summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/rt2x00/rt2x00usb.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2008-01-18 14:06:44 -0800
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-01-18 14:06:44 -0800
commit8b2d1833a29e9dc8bccad348396ad08666379d77 (patch)
treea7bb3bb922bb744934cc0d0bcce043ad8129ab0e /drivers/net/wireless/rt2x00/rt2x00usb.c
parentc9daa2722a3f1967e3e9750fd4cb6a7352a3cd63 (diff)
parentba596a01886b236c8171fc28d53842da0128224e (diff)
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/netdev-2.6: (31 commits) Replace cpmac fix dl2k: the rest dl2k: MSCR, MSSR, ESR, PHY_SCR fixes dl2k: BMSR fixes dl2k: ANAR, ANLPAR fixes dl2k: BMCR_t fixes 3c574, 3c515 bitfields abuse sbni endian fixes wan/lmc bitfields fixes dscc4 endian fixes S2io: Fixed synchronization between scheduling of napi with card reset and close atl1: fix frame length bug Documentation: add a guideline for hard_start_xmit method Revert "sky2: remove check for PCI wakeup setting from BIOS" e1000e Kconfig: remove ref to nonexistant docs bonding: Don't hold lock when calling rtnl_unlock bonding: fix lock ordering for rtnl and bonding_rwsem bonding: Fix up parameter parsing bonding: release slaves when master removed via sysfs bonding: fix locking during alb failover and slave removal ...
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00usb.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00usb.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c
index ab4797ed94c..568d73847dc 100644
--- a/drivers/net/wireless/rt2x00/rt2x00usb.c
+++ b/drivers/net/wireless/rt2x00/rt2x00usb.c
@@ -245,13 +245,20 @@ static void rt2x00usb_interrupt_rxdone(struct urb *urb)
* Allocate a new sk buffer to replace the current one.
* If allocation fails, we should drop the current frame
* so we can recycle the existing sk buffer for the new frame.
+ * As alignment we use 2 and not NET_IP_ALIGN because we need
+ * to be sure we have 2 bytes room in the head. (NET_IP_ALIGN
+ * can be 0 on some hardware). We use these 2 bytes for frame
+ * alignment later, we assume that the chance that
+ * header_size % 4 == 2 is bigger then header_size % 2 == 0
+ * and thus optimize alignment by reserving the 2 bytes in
+ * advance.
*/
frame_size = entry->ring->data_size + entry->ring->desc_size;
- skb = dev_alloc_skb(frame_size + NET_IP_ALIGN);
+ skb = dev_alloc_skb(frame_size + 2);
if (!skb)
goto skip_entry;
- skb_reserve(skb, NET_IP_ALIGN);
+ skb_reserve(skb, 2);
skb_put(skb, frame_size);
/*