diff options
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2500usb.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2500usb.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c index 9a915be547b3..b985d8f8cc6e 100644 --- a/drivers/net/wireless/rt2x00/rt2500usb.c +++ b/drivers/net/wireless/rt2x00/rt2500usb.c | |||
@@ -1033,7 +1033,7 @@ static void rt2500usb_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
1033 | struct txentry_desc *txdesc) | 1033 | struct txentry_desc *txdesc) |
1034 | { | 1034 | { |
1035 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb); | 1035 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb); |
1036 | __le32 *txd = skbdesc->desc; | 1036 | __le32 *txd = (__le32 *)(skb->data - TXD_DESC_SIZE); |
1037 | u32 word; | 1037 | u32 word; |
1038 | 1038 | ||
1039 | /* | 1039 | /* |
@@ -1075,6 +1075,12 @@ static void rt2500usb_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
1075 | _rt2x00_desc_write(txd, 3, skbdesc->iv[0]); | 1075 | _rt2x00_desc_write(txd, 3, skbdesc->iv[0]); |
1076 | _rt2x00_desc_write(txd, 4, skbdesc->iv[1]); | 1076 | _rt2x00_desc_write(txd, 4, skbdesc->iv[1]); |
1077 | } | 1077 | } |
1078 | |||
1079 | /* | ||
1080 | * Register descriptor details in skb frame descriptor. | ||
1081 | */ | ||
1082 | skbdesc->desc = txd; | ||
1083 | skbdesc->desc_len = TXD_DESC_SIZE; | ||
1078 | } | 1084 | } |
1079 | 1085 | ||
1080 | /* | 1086 | /* |
@@ -1088,19 +1094,11 @@ static void rt2500usb_write_beacon(struct queue_entry *entry, | |||
1088 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; | 1094 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; |
1089 | struct usb_device *usb_dev = to_usb_device_intf(rt2x00dev->dev); | 1095 | struct usb_device *usb_dev = to_usb_device_intf(rt2x00dev->dev); |
1090 | struct queue_entry_priv_usb_bcn *bcn_priv = entry->priv_data; | 1096 | struct queue_entry_priv_usb_bcn *bcn_priv = entry->priv_data; |
1091 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb); | ||
1092 | int pipe = usb_sndbulkpipe(usb_dev, entry->queue->usb_endpoint); | 1097 | int pipe = usb_sndbulkpipe(usb_dev, entry->queue->usb_endpoint); |
1093 | int length; | 1098 | int length; |
1094 | u16 reg, reg0; | 1099 | u16 reg, reg0; |
1095 | 1100 | ||
1096 | /* | 1101 | /* |
1097 | * Add the descriptor in front of the skb. | ||
1098 | */ | ||
1099 | skb_push(entry->skb, entry->queue->desc_size); | ||
1100 | memcpy(entry->skb->data, skbdesc->desc, skbdesc->desc_len); | ||
1101 | skbdesc->desc = entry->skb->data; | ||
1102 | |||
1103 | /* | ||
1104 | * Disable beaconing while we are reloading the beacon data, | 1102 | * Disable beaconing while we are reloading the beacon data, |
1105 | * otherwise we might be sending out invalid data. | 1103 | * otherwise we might be sending out invalid data. |
1106 | */ | 1104 | */ |
@@ -1109,6 +1107,11 @@ static void rt2500usb_write_beacon(struct queue_entry *entry, | |||
1109 | rt2500usb_register_write(rt2x00dev, TXRX_CSR19, reg); | 1107 | rt2500usb_register_write(rt2x00dev, TXRX_CSR19, reg); |
1110 | 1108 | ||
1111 | /* | 1109 | /* |
1110 | * Take the descriptor in front of the skb into account. | ||
1111 | */ | ||
1112 | skb_push(entry->skb, TXD_DESC_SIZE); | ||
1113 | |||
1114 | /* | ||
1112 | * USB devices cannot blindly pass the skb->len as the | 1115 | * USB devices cannot blindly pass the skb->len as the |
1113 | * length of the data to usb_fill_bulk_urb. Pass the skb | 1116 | * length of the data to usb_fill_bulk_urb. Pass the skb |
1114 | * to the driver to determine what the length should be. | 1117 | * to the driver to determine what the length should be. |