aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/orinoco.c
diff options
context:
space:
mode:
authorPavel Roskin <proski@gnu.org>2006-04-07 04:10:41 -0400
committerJohn W. Linville <linville@tuxdriver.com>2006-04-24 16:15:51 -0400
commit8d5be088263b0d3dbb7e7959b7c403b3d026a5d3 (patch)
tree912fd8275e7f96a22f3c4935ffba86a520e97b63 /drivers/net/wireless/orinoco.c
parent6b61626290900f12b7f3978f57f329da6811fb59 (diff)
[PATCH] orinoco: don't use any padding for Tx frames
hermes_bap_pwrite() supports odd-sized packets now. There is no minimal packet size for 802.11. Also, hermes_bap_pwrite() supports odd-sized packets now. This removes all reasons to pad the Tx data. Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/orinoco.c')
-rw-r--r--drivers/net/wireless/orinoco.c25
1 files changed, 7 insertions, 18 deletions
diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c
index 173e9e4523c0..9fde17bebebf 100644
--- a/drivers/net/wireless/orinoco.c
+++ b/drivers/net/wireless/orinoco.c
@@ -423,7 +423,7 @@ static int orinoco_xmit(struct sk_buff *skb, struct net_device *dev)
423 u16 txfid = priv->txfid; 423 u16 txfid = priv->txfid;
424 char *p; 424 char *p;
425 struct ethhdr *eh; 425 struct ethhdr *eh;
426 int len, data_len, data_off; 426 int data_len, data_off;
427 struct hermes_tx_descriptor desc; 427 struct hermes_tx_descriptor desc;
428 unsigned long flags; 428 unsigned long flags;
429 429
@@ -455,13 +455,10 @@ static int orinoco_xmit(struct sk_buff *skb, struct net_device *dev)
455 return NETDEV_TX_OK; 455 return NETDEV_TX_OK;
456 } 456 }
457 457
458 /* Length of the packet body */ 458 /* Check packet length */
459 /* FIXME: what if the skb is smaller than this? */ 459 data_len = skb->len;
460 len = max_t(int, ALIGN(skb->len, 2), ETH_ZLEN); 460 if (data_len < ETH_HLEN)
461 skb = skb_padto(skb, len);
462 if (skb == NULL)
463 goto fail; 461 goto fail;
464 len -= ETH_HLEN;
465 462
466 eh = (struct ethhdr *)skb->data; 463 eh = (struct ethhdr *)skb->data;
467 464
@@ -485,7 +482,7 @@ static int orinoco_xmit(struct sk_buff *skb, struct net_device *dev)
485 /* Encapsulate Ethernet-II frames */ 482 /* Encapsulate Ethernet-II frames */
486 if (ntohs(eh->h_proto) > ETH_DATA_LEN) { /* Ethernet-II frame */ 483 if (ntohs(eh->h_proto) > ETH_DATA_LEN) { /* Ethernet-II frame */
487 struct header_struct hdr; 484 struct header_struct hdr;
488 data_len = len; 485 data_len = skb->len - ETH_HLEN;
489 data_off = HERMES_802_3_OFFSET + sizeof(hdr); 486 data_off = HERMES_802_3_OFFSET + sizeof(hdr);
490 p = skb->data + ETH_HLEN; 487 p = skb->data + ETH_HLEN;
491 488
@@ -507,21 +504,13 @@ static int orinoco_xmit(struct sk_buff *skb, struct net_device *dev)
507 stats->tx_errors++; 504 stats->tx_errors++;
508 goto fail; 505 goto fail;
509 } 506 }
510 /* Actual xfer length - allow for padding */
511 len = ALIGN(data_len, 2);
512 if (len < ETH_ZLEN - ETH_HLEN)
513 len = ETH_ZLEN - ETH_HLEN;
514 } else { /* IEEE 802.3 frame */ 507 } else { /* IEEE 802.3 frame */
515 data_len = len + ETH_HLEN; 508 data_len = skb->len;
516 data_off = HERMES_802_3_OFFSET; 509 data_off = HERMES_802_3_OFFSET;
517 p = skb->data; 510 p = skb->data;
518 /* Actual xfer length - round up for odd length packets */
519 len = ALIGN(data_len, 2);
520 if (len < ETH_ZLEN)
521 len = ETH_ZLEN;
522 } 511 }
523 512
524 err = hermes_bap_pwrite_pad(hw, USER_BAP, p, data_len, len, 513 err = hermes_bap_pwrite(hw, USER_BAP, p, data_len,
525 txfid, data_off); 514 txfid, data_off);
526 if (err) { 515 if (err) {
527 printk(KERN_ERR "%s: Error %d writing packet to BAP\n", 516 printk(KERN_ERR "%s: Error %d writing packet to BAP\n",