diff options
Diffstat (limited to 'drivers/net/wireless/orinoco.c')
-rw-r--r-- | drivers/net/wireless/orinoco.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c index d3d4ec9e242e..488ab06fb79f 100644 --- a/drivers/net/wireless/orinoco.c +++ b/drivers/net/wireless/orinoco.c | |||
@@ -490,7 +490,8 @@ static int orinoco_xmit(struct sk_buff *skb, struct net_device *dev) | |||
490 | return 0; | 490 | return 0; |
491 | } | 491 | } |
492 | 492 | ||
493 | /* Check packet length, pad short packets, round up odd length */ | 493 | /* Length of the packet body */ |
494 | /* FIXME: what if the skb is smaller than this? */ | ||
494 | len = max_t(int, ALIGN(skb->len, 2), ETH_ZLEN); | 495 | len = max_t(int, ALIGN(skb->len, 2), ETH_ZLEN); |
495 | skb = skb_padto(skb, len); | 496 | skb = skb_padto(skb, len); |
496 | if (skb == NULL) | 497 | if (skb == NULL) |
@@ -541,13 +542,21 @@ static int orinoco_xmit(struct sk_buff *skb, struct net_device *dev) | |||
541 | stats->tx_errors++; | 542 | stats->tx_errors++; |
542 | goto fail; | 543 | goto fail; |
543 | } | 544 | } |
545 | /* Actual xfer length - allow for padding */ | ||
546 | len = ALIGN(data_len, 2); | ||
547 | if (len < ETH_ZLEN - ETH_HLEN) | ||
548 | len = ETH_ZLEN - ETH_HLEN; | ||
544 | } else { /* IEEE 802.3 frame */ | 549 | } else { /* IEEE 802.3 frame */ |
545 | data_len = len + ETH_HLEN; | 550 | data_len = len + ETH_HLEN; |
546 | data_off = HERMES_802_3_OFFSET; | 551 | data_off = HERMES_802_3_OFFSET; |
547 | p = skb->data; | 552 | p = skb->data; |
553 | /* Actual xfer length - round up for odd length packets */ | ||
554 | len = ALIGN(data_len, 2); | ||
555 | if (len < ETH_ZLEN) | ||
556 | len = ETH_ZLEN; | ||
548 | } | 557 | } |
549 | 558 | ||
550 | err = hermes_bap_pwrite(hw, USER_BAP, p, data_len, | 559 | err = hermes_bap_pwrite_pad(hw, USER_BAP, p, data_len, len, |
551 | txfid, data_off); | 560 | txfid, data_off); |
552 | if (err) { | 561 | if (err) { |
553 | printk(KERN_ERR "%s: Error %d writing packet to BAP\n", | 562 | printk(KERN_ERR "%s: Error %d writing packet to BAP\n", |