From 8d5be088263b0d3dbb7e7959b7c403b3d026a5d3 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Fri, 7 Apr 2006 04:10:41 -0400 Subject: [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 Signed-off-by: John W. Linville --- drivers/net/wireless/orinoco.c | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) (limited to 'drivers/net/wireless/orinoco.c') 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) u16 txfid = priv->txfid; char *p; struct ethhdr *eh; - int len, data_len, data_off; + int data_len, data_off; struct hermes_tx_descriptor desc; unsigned long flags; @@ -455,13 +455,10 @@ static int orinoco_xmit(struct sk_buff *skb, struct net_device *dev) return NETDEV_TX_OK; } - /* Length of the packet body */ - /* FIXME: what if the skb is smaller than this? */ - len = max_t(int, ALIGN(skb->len, 2), ETH_ZLEN); - skb = skb_padto(skb, len); - if (skb == NULL) + /* Check packet length */ + data_len = skb->len; + if (data_len < ETH_HLEN) goto fail; - len -= ETH_HLEN; eh = (struct ethhdr *)skb->data; @@ -485,7 +482,7 @@ static int orinoco_xmit(struct sk_buff *skb, struct net_device *dev) /* Encapsulate Ethernet-II frames */ if (ntohs(eh->h_proto) > ETH_DATA_LEN) { /* Ethernet-II frame */ struct header_struct hdr; - data_len = len; + data_len = skb->len - ETH_HLEN; data_off = HERMES_802_3_OFFSET + sizeof(hdr); p = skb->data + ETH_HLEN; @@ -507,21 +504,13 @@ static int orinoco_xmit(struct sk_buff *skb, struct net_device *dev) stats->tx_errors++; goto fail; } - /* Actual xfer length - allow for padding */ - len = ALIGN(data_len, 2); - if (len < ETH_ZLEN - ETH_HLEN) - len = ETH_ZLEN - ETH_HLEN; } else { /* IEEE 802.3 frame */ - data_len = len + ETH_HLEN; + data_len = skb->len; data_off = HERMES_802_3_OFFSET; p = skb->data; - /* Actual xfer length - round up for odd length packets */ - len = ALIGN(data_len, 2); - if (len < ETH_ZLEN) - len = ETH_ZLEN; } - err = hermes_bap_pwrite_pad(hw, USER_BAP, p, data_len, len, + err = hermes_bap_pwrite(hw, USER_BAP, p, data_len, txfid, data_off); if (err) { printk(KERN_ERR "%s: Error %d writing packet to BAP\n", -- cgit v1.2.1