aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2008-01-06 17:42:04 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:09:28 -0500
commit7d1de80644dad9cd6db6e00984bd12d6cae63855 (patch)
tree9e2a6bdf4f5d8353a8646b36d2216210a8252616 /drivers
parent837e7f247a8ed3f5577462655f8099a81b360422 (diff)
rt2x00: Correctly initialize data and desc pointer
rt2500usb and rt73usb store the descriptor in different places. This means we should move the initialization of the 2 pointers to the driver callback function fill_rxdone(). Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/rt2x00/rt2500usb.c12
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00usb.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt73usb.c7
3 files changed, 19 insertions, 2 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index 46491eec377d..6579718f36ad 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -1113,6 +1113,7 @@ static void rt2500usb_kick_tx_queue(struct rt2x00_dev *rt2x00dev,
1113static void rt2500usb_fill_rxdone(struct data_entry *entry, 1113static void rt2500usb_fill_rxdone(struct data_entry *entry,
1114 struct rxdata_entry_desc *desc) 1114 struct rxdata_entry_desc *desc)
1115{ 1115{
1116 struct skb_desc *skbdesc = get_skb_desc(entry->skb);
1116 struct urb *urb = entry->priv; 1117 struct urb *urb = entry->priv;
1117 __le32 *rxd = (__le32 *)(entry->skb->data + 1118 __le32 *rxd = (__le32 *)(entry->skb->data +
1118 (urb->actual_length - entry->ring->desc_size)); 1119 (urb->actual_length - entry->ring->desc_size));
@@ -1137,6 +1138,17 @@ static void rt2500usb_fill_rxdone(struct data_entry *entry,
1137 desc->ofdm = rt2x00_get_field32(word0, RXD_W0_OFDM); 1138 desc->ofdm = rt2x00_get_field32(word0, RXD_W0_OFDM);
1138 desc->size = rt2x00_get_field32(word0, RXD_W0_DATABYTE_COUNT); 1139 desc->size = rt2x00_get_field32(word0, RXD_W0_DATABYTE_COUNT);
1139 desc->my_bss = !!rt2x00_get_field32(word0, RXD_W0_MY_BSS); 1140 desc->my_bss = !!rt2x00_get_field32(word0, RXD_W0_MY_BSS);
1141
1142 /*
1143 * Trim the skb to clear the descriptor area.
1144 */
1145 skb_pull(entry->skb, entry->ring->desc_size);
1146
1147 /*
1148 * Set descriptor and data pointer.
1149 */
1150 skbdesc->desc = entry->skb->data + skbdesc->data_len;
1151 skbdesc->data = entry->skb->data;
1140} 1152}
1141 1153
1142/* 1154/*
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c
index 63726a152a1a..d7d3a271b1b0 100644
--- a/drivers/net/wireless/rt2x00/rt2x00usb.c
+++ b/drivers/net/wireless/rt2x00/rt2x00usb.c
@@ -303,8 +303,6 @@ static void rt2x00usb_interrupt_rxdone(struct urb *urb)
303 skbdesc = get_skb_desc(entry->skb); 303 skbdesc = get_skb_desc(entry->skb);
304 skbdesc->desc_len = entry->ring->desc_size; 304 skbdesc->desc_len = entry->ring->desc_size;
305 skbdesc->data_len = entry->skb->len; 305 skbdesc->data_len = entry->skb->len;
306 skbdesc->desc = entry->skb->data - skbdesc->desc_len;
307 skbdesc->data = entry->skb->data;
308 skbdesc->ring = ring; 306 skbdesc->ring = ring;
309 skbdesc->entry = entry; 307 skbdesc->entry = entry;
310 308
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index 78217dcb4638..47ed3070ae0b 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -1376,6 +1376,7 @@ static int rt73usb_agc_to_rssi(struct rt2x00_dev *rt2x00dev, int rxd_w1)
1376static void rt73usb_fill_rxdone(struct data_entry *entry, 1376static void rt73usb_fill_rxdone(struct data_entry *entry,
1377 struct rxdata_entry_desc *desc) 1377 struct rxdata_entry_desc *desc)
1378{ 1378{
1379 struct skb_desc *skbdesc = get_skb_desc(entry->skb);
1379 __le32 *rxd = (__le32 *)entry->skb->data; 1380 __le32 *rxd = (__le32 *)entry->skb->data;
1380 u32 word0; 1381 u32 word0;
1381 u32 word1; 1382 u32 word1;
@@ -1400,6 +1401,12 @@ static void rt73usb_fill_rxdone(struct data_entry *entry,
1400 * Pull the skb to clear the descriptor area. 1401 * Pull the skb to clear the descriptor area.
1401 */ 1402 */
1402 skb_pull(entry->skb, entry->ring->desc_size); 1403 skb_pull(entry->skb, entry->ring->desc_size);
1404
1405 /*
1406 * Set descriptor and data pointer.
1407 */
1408 skbdesc->desc = entry->skb->data - skbdesc->desc_len;
1409 skbdesc->data = entry->skb->data;
1403} 1410}
1404 1411
1405/* 1412/*