30 #include <linux/string.h>
31 #include <linux/module.h>
32 #include <asm/byteorder.h>
109 IRDA_DEBUG(1,
"%s(), wrong magic in skb!\n", __func__);
118 IRDA_DEBUG(0,
"%s(), too many xbofs (%d)\n", __func__,
130 for (
i=0;
i <
skb->len;
i++) {
136 if(
n >= (buffsize-5)) {
137 IRDA_ERROR(
"%s(), tx buffer overflow (n=%d)\n",
142 n += stuff_byte(
skb->data[
i], tx_buff+
n);
148 #ifdef __LITTLE_ENDIAN
149 n += stuff_byte(
fcs.bytes[0], tx_buff+
n);
150 n += stuff_byte(
fcs.bytes[1], tx_buff+
n);
152 n += stuff_byte(
fcs.bytes[1], tx_buff+
n);
153 n += stuff_byte(
fcs.bytes[0], tx_buff+
n);
222 docopy = ((rx_buff->
skb ==
NULL) ||
226 newskb = dev_alloc_skb(docopy ? rx_buff->
len + 1 : rx_buff->
truesize);
238 skb_reserve(newskb, 1);
242 skb_copy_to_linear_data(newskb, rx_buff->
data,
248 dataskb = rx_buff->
skb;
250 rx_buff->
skb = newskb;
260 skb_reset_mac_header(dataskb);
284 switch(rx_buff->
state) {
289 IRDA_DEBUG(1,
"%s(), Discarding incomplete frame\n",
324 #ifdef POSTPONE_RX_CRC
328 switch(rx_buff->
state) {
346 #ifdef POSTPONE_RX_CRC
349 for(i = 0; i < rx_buff->
len; i++)
357 async_bump(dev, stats, rx_buff);
382 switch(rx_buff->
state) {
412 switch(rx_buff->
state) {
419 #ifndef POSTPONE_RX_CRC
423 IRDA_DEBUG(1,
"%s(), Rx buffer overflow, aborting\n",
437 #ifndef POSTPONE_RX_CRC
442 IRDA_DEBUG(1,
"%s(), Rx buffer overflow, aborting\n",
457 #ifndef POSTPONE_RX_CRC
478 async_unwrap_ce(dev, stats, rx_buff, byte);
481 async_unwrap_bof(dev, stats, rx_buff, byte);
484 async_unwrap_eof(dev, stats, rx_buff, byte);
487 async_unwrap_other(dev, stats, rx_buff, byte);