aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rtl8187_dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/rtl8187_dev.c')
-rw-r--r--drivers/net/wireless/rtl8187_dev.c41
1 files changed, 17 insertions, 24 deletions
diff --git a/drivers/net/wireless/rtl8187_dev.c b/drivers/net/wireless/rtl8187_dev.c
index 86a09b49681c..b581ef8a6377 100644
--- a/drivers/net/wireless/rtl8187_dev.c
+++ b/drivers/net/wireless/rtl8187_dev.c
@@ -145,27 +145,22 @@ void rtl8187_write_phy(struct ieee80211_hw *dev, u8 addr, u32 data)
145 145
146static void rtl8187_tx_cb(struct urb *urb) 146static void rtl8187_tx_cb(struct urb *urb)
147{ 147{
148 struct ieee80211_tx_status status;
149 struct sk_buff *skb = (struct sk_buff *)urb->context; 148 struct sk_buff *skb = (struct sk_buff *)urb->context;
150 struct rtl8187_tx_info *info = (struct rtl8187_tx_info *)skb->cb; 149 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
150 struct ieee80211_hw *hw = info->driver_data[0];
151 151
152 memset(&status, 0, sizeof(status)); 152 usb_free_urb(info->driver_data[1]);
153
154 usb_free_urb(info->urb);
155 if (info->control)
156 memcpy(&status.control, info->control, sizeof(status.control));
157 kfree(info->control);
158 skb_pull(skb, sizeof(struct rtl8187_tx_hdr)); 153 skb_pull(skb, sizeof(struct rtl8187_tx_hdr));
159 status.flags |= IEEE80211_TX_STATUS_ACK; 154 memset(&info->status, 0, sizeof(info->status));
160 ieee80211_tx_status_irqsafe(info->dev, skb, &status); 155 info->flags |= IEEE80211_TX_STAT_ACK;
156 ieee80211_tx_status_irqsafe(hw, skb);
161} 157}
162 158
163static int rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb, 159static int rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
164 struct ieee80211_tx_control *control)
165{ 160{
166 struct rtl8187_priv *priv = dev->priv; 161 struct rtl8187_priv *priv = dev->priv;
162 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
167 struct rtl8187_tx_hdr *hdr; 163 struct rtl8187_tx_hdr *hdr;
168 struct rtl8187_tx_info *info;
169 struct urb *urb; 164 struct urb *urb;
170 __le16 rts_dur = 0; 165 __le16 rts_dur = 0;
171 u32 flags; 166 u32 flags;
@@ -179,29 +174,27 @@ static int rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb,
179 flags = skb->len; 174 flags = skb->len;
180 flags |= RTL8187_TX_FLAG_NO_ENCRYPT; 175 flags |= RTL8187_TX_FLAG_NO_ENCRYPT;
181 176
182 flags |= ieee80211_get_tx_rate(dev, control)->hw_value << 24; 177 flags |= ieee80211_get_tx_rate(dev, info)->hw_value << 24;
183 if (ieee80211_get_morefrag((struct ieee80211_hdr *)skb->data)) 178 if (ieee80211_get_morefrag((struct ieee80211_hdr *)skb->data))
184 flags |= RTL8187_TX_FLAG_MORE_FRAG; 179 flags |= RTL8187_TX_FLAG_MORE_FRAG;
185 if (control->flags & IEEE80211_TXCTL_USE_RTS_CTS) { 180 if (info->flags & IEEE80211_TX_CTL_USE_RTS_CTS) {
186 flags |= RTL8187_TX_FLAG_RTS; 181 flags |= RTL8187_TX_FLAG_RTS;
187 flags |= ieee80211_get_rts_cts_rate(dev, control)->hw_value << 19; 182 flags |= ieee80211_get_rts_cts_rate(dev, info)->hw_value << 19;
188 rts_dur = ieee80211_rts_duration(dev, priv->vif, 183 rts_dur = ieee80211_rts_duration(dev, priv->vif,
189 skb->len, control); 184 skb->len, info);
190 } else if (control->flags & IEEE80211_TXCTL_USE_CTS_PROTECT) { 185 } else if (info->flags & IEEE80211_TX_CTL_USE_CTS_PROTECT) {
191 flags |= RTL8187_TX_FLAG_CTS; 186 flags |= RTL8187_TX_FLAG_CTS;
192 flags |= ieee80211_get_rts_cts_rate(dev, control)->hw_value << 19; 187 flags |= ieee80211_get_rts_cts_rate(dev, info)->hw_value << 19;
193 } 188 }
194 189
195 hdr = (struct rtl8187_tx_hdr *)skb_push(skb, sizeof(*hdr)); 190 hdr = (struct rtl8187_tx_hdr *)skb_push(skb, sizeof(*hdr));
196 hdr->flags = cpu_to_le32(flags); 191 hdr->flags = cpu_to_le32(flags);
197 hdr->len = 0; 192 hdr->len = 0;
198 hdr->rts_duration = rts_dur; 193 hdr->rts_duration = rts_dur;
199 hdr->retry = cpu_to_le32(control->retry_limit << 8); 194 hdr->retry = cpu_to_le32(info->control.retry_limit << 8);
200 195
201 info = (struct rtl8187_tx_info *)skb->cb; 196 info->driver_data[0] = dev;
202 info->control = kmemdup(control, sizeof(*control), GFP_ATOMIC); 197 info->driver_data[1] = urb;
203 info->urb = urb;
204 info->dev = dev;
205 usb_fill_bulk_urb(urb, priv->udev, usb_sndbulkpipe(priv->udev, 2), 198 usb_fill_bulk_urb(urb, priv->udev, usb_sndbulkpipe(priv->udev, 2),
206 hdr, skb->len, rtl8187_tx_cb, skb); 199 hdr, skb->len, rtl8187_tx_cb, skb);
207 usb_submit_urb(urb, GFP_ATOMIC); 200 usb_submit_urb(urb, GFP_ATOMIC);