diff options
author | David S. Miller <davem@davemloft.net> | 2008-06-10 04:54:31 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-06-10 04:54:31 -0400 |
commit | 788c0a53164c05c5ccdb1472474372b72ba74644 (patch) | |
tree | 5f274102e3dc4bcca6cb3a695aa2c8228ad5fc4f /drivers/net/wireless/rtl8187_dev.c | |
parent | e64bda89b8fe81cce9b4a20885d2c204c2d52532 (diff) | |
parent | 78cf07472f0ede8394bacc4bc02354505080cfe1 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/linville/wireless-next-2.6
Conflicts:
drivers/net/ps3_gelic_wireless.c
drivers/net/wireless/libertas/main.c
Diffstat (limited to 'drivers/net/wireless/rtl8187_dev.c')
-rw-r--r-- | drivers/net/wireless/rtl8187_dev.c | 45 |
1 files changed, 17 insertions, 28 deletions
diff --git a/drivers/net/wireless/rtl8187_dev.c b/drivers/net/wireless/rtl8187_dev.c index 23514456d373..0078c7e9918c 100644 --- a/drivers/net/wireless/rtl8187_dev.c +++ b/drivers/net/wireless/rtl8187_dev.c | |||
@@ -150,27 +150,22 @@ void rtl8187_write_phy(struct ieee80211_hw *dev, u8 addr, u32 data) | |||
150 | 150 | ||
151 | static void rtl8187_tx_cb(struct urb *urb) | 151 | static void rtl8187_tx_cb(struct urb *urb) |
152 | { | 152 | { |
153 | struct ieee80211_tx_status status; | ||
154 | struct sk_buff *skb = (struct sk_buff *)urb->context; | 153 | struct sk_buff *skb = (struct sk_buff *)urb->context; |
155 | struct rtl8187_tx_info *info = (struct rtl8187_tx_info *)skb->cb; | 154 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); |
155 | struct ieee80211_hw *hw = info->driver_data[0]; | ||
156 | 156 | ||
157 | memset(&status, 0, sizeof(status)); | 157 | usb_free_urb(info->driver_data[1]); |
158 | |||
159 | usb_free_urb(info->urb); | ||
160 | if (info->control) | ||
161 | memcpy(&status.control, info->control, sizeof(status.control)); | ||
162 | kfree(info->control); | ||
163 | skb_pull(skb, sizeof(struct rtl8187_tx_hdr)); | 158 | skb_pull(skb, sizeof(struct rtl8187_tx_hdr)); |
164 | status.flags |= IEEE80211_TX_STATUS_ACK; | 159 | memset(&info->status, 0, sizeof(info->status)); |
165 | ieee80211_tx_status_irqsafe(info->dev, skb, &status); | 160 | info->flags |= IEEE80211_TX_STAT_ACK; |
161 | ieee80211_tx_status_irqsafe(hw, skb); | ||
166 | } | 162 | } |
167 | 163 | ||
168 | static int rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb, | 164 | static int rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb) |
169 | struct ieee80211_tx_control *control) | ||
170 | { | 165 | { |
171 | struct rtl8187_priv *priv = dev->priv; | 166 | struct rtl8187_priv *priv = dev->priv; |
167 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | ||
172 | struct rtl8187_tx_hdr *hdr; | 168 | struct rtl8187_tx_hdr *hdr; |
173 | struct rtl8187_tx_info *info; | ||
174 | struct urb *urb; | 169 | struct urb *urb; |
175 | __le16 rts_dur = 0; | 170 | __le16 rts_dur = 0; |
176 | u32 flags; | 171 | u32 flags; |
@@ -185,33 +180,27 @@ static int rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb, | |||
185 | flags = skb->len; | 180 | flags = skb->len; |
186 | flags |= RTL8187_TX_FLAG_NO_ENCRYPT; | 181 | flags |= RTL8187_TX_FLAG_NO_ENCRYPT; |
187 | 182 | ||
188 | BUG_ON(!control->tx_rate); | 183 | flags |= ieee80211_get_tx_rate(dev, info)->hw_value << 24; |
189 | |||
190 | flags |= control->tx_rate->hw_value << 24; | ||
191 | if (ieee80211_get_morefrag((struct ieee80211_hdr *)skb->data)) | 184 | if (ieee80211_get_morefrag((struct ieee80211_hdr *)skb->data)) |
192 | flags |= RTL8187_TX_FLAG_MORE_FRAG; | 185 | flags |= RTL8187_TX_FLAG_MORE_FRAG; |
193 | if (control->flags & IEEE80211_TXCTL_USE_RTS_CTS) { | 186 | if (info->flags & IEEE80211_TX_CTL_USE_RTS_CTS) { |
194 | BUG_ON(!control->rts_cts_rate); | ||
195 | flags |= RTL8187_TX_FLAG_RTS; | 187 | flags |= RTL8187_TX_FLAG_RTS; |
196 | flags |= control->rts_cts_rate->hw_value << 19; | 188 | flags |= ieee80211_get_rts_cts_rate(dev, info)->hw_value << 19; |
197 | rts_dur = ieee80211_rts_duration(dev, priv->vif, | 189 | rts_dur = ieee80211_rts_duration(dev, priv->vif, |
198 | skb->len, control); | 190 | skb->len, info); |
199 | } else if (control->flags & IEEE80211_TXCTL_USE_CTS_PROTECT) { | 191 | } else if (info->flags & IEEE80211_TX_CTL_USE_CTS_PROTECT) { |
200 | BUG_ON(!control->rts_cts_rate); | ||
201 | flags |= RTL8187_TX_FLAG_CTS; | 192 | flags |= RTL8187_TX_FLAG_CTS; |
202 | flags |= control->rts_cts_rate->hw_value << 19; | 193 | flags |= ieee80211_get_rts_cts_rate(dev, info)->hw_value << 19; |
203 | } | 194 | } |
204 | 195 | ||
205 | hdr = (struct rtl8187_tx_hdr *)skb_push(skb, sizeof(*hdr)); | 196 | hdr = (struct rtl8187_tx_hdr *)skb_push(skb, sizeof(*hdr)); |
206 | hdr->flags = cpu_to_le32(flags); | 197 | hdr->flags = cpu_to_le32(flags); |
207 | hdr->len = 0; | 198 | hdr->len = 0; |
208 | hdr->rts_duration = rts_dur; | 199 | hdr->rts_duration = rts_dur; |
209 | hdr->retry = cpu_to_le32(control->retry_limit << 8); | 200 | hdr->retry = cpu_to_le32(info->control.retry_limit << 8); |
210 | 201 | ||
211 | info = (struct rtl8187_tx_info *)skb->cb; | 202 | info->driver_data[0] = dev; |
212 | info->control = kmemdup(control, sizeof(*control), GFP_ATOMIC); | 203 | info->driver_data[1] = urb; |
213 | info->urb = urb; | ||
214 | info->dev = dev; | ||
215 | usb_fill_bulk_urb(urb, priv->udev, usb_sndbulkpipe(priv->udev, 2), | 204 | usb_fill_bulk_urb(urb, priv->udev, usb_sndbulkpipe(priv->udev, 2), |
216 | hdr, skb->len, rtl8187_tx_cb, skb); | 205 | hdr, skb->len, rtl8187_tx_cb, skb); |
217 | rc = usb_submit_urb(urb, GFP_ATOMIC); | 206 | rc = usb_submit_urb(urb, GFP_ATOMIC); |