diff options
Diffstat (limited to 'drivers/net/wireless/b43legacy/xmit.c')
-rw-r--r-- | drivers/net/wireless/b43legacy/xmit.c | 47 |
1 files changed, 25 insertions, 22 deletions
diff --git a/drivers/net/wireless/b43legacy/xmit.c b/drivers/net/wireless/b43legacy/xmit.c index bed9e041d6c5..82dc04d59446 100644 --- a/drivers/net/wireless/b43legacy/xmit.c +++ b/drivers/net/wireless/b43legacy/xmit.c | |||
@@ -188,11 +188,11 @@ static int generate_txhdr_fw3(struct b43legacy_wldev *dev, | |||
188 | struct b43legacy_txhdr_fw3 *txhdr, | 188 | struct b43legacy_txhdr_fw3 *txhdr, |
189 | const unsigned char *fragment_data, | 189 | const unsigned char *fragment_data, |
190 | unsigned int fragment_len, | 190 | unsigned int fragment_len, |
191 | const struct ieee80211_tx_control *txctl, | 191 | const struct ieee80211_tx_info *info, |
192 | u16 cookie) | 192 | u16 cookie) |
193 | { | 193 | { |
194 | const struct ieee80211_hdr *wlhdr; | 194 | const struct ieee80211_hdr *wlhdr; |
195 | int use_encryption = (!(txctl->flags & IEEE80211_TXCTL_DO_NOT_ENCRYPT)); | 195 | int use_encryption = (!(info->flags & IEEE80211_TX_CTL_DO_NOT_ENCRYPT)); |
196 | u16 fctl; | 196 | u16 fctl; |
197 | u8 rate; | 197 | u8 rate; |
198 | struct ieee80211_rate *rate_fb; | 198 | struct ieee80211_rate *rate_fb; |
@@ -201,15 +201,18 @@ static int generate_txhdr_fw3(struct b43legacy_wldev *dev, | |||
201 | unsigned int plcp_fragment_len; | 201 | unsigned int plcp_fragment_len; |
202 | u32 mac_ctl = 0; | 202 | u32 mac_ctl = 0; |
203 | u16 phy_ctl = 0; | 203 | u16 phy_ctl = 0; |
204 | struct ieee80211_rate *tx_rate; | ||
204 | 205 | ||
205 | wlhdr = (const struct ieee80211_hdr *)fragment_data; | 206 | wlhdr = (const struct ieee80211_hdr *)fragment_data; |
206 | fctl = le16_to_cpu(wlhdr->frame_control); | 207 | fctl = le16_to_cpu(wlhdr->frame_control); |
207 | 208 | ||
208 | memset(txhdr, 0, sizeof(*txhdr)); | 209 | memset(txhdr, 0, sizeof(*txhdr)); |
209 | 210 | ||
210 | rate = txctl->tx_rate->hw_value; | 211 | tx_rate = ieee80211_get_tx_rate(dev->wl->hw, info); |
212 | |||
213 | rate = tx_rate->hw_value; | ||
211 | rate_ofdm = b43legacy_is_ofdm_rate(rate); | 214 | rate_ofdm = b43legacy_is_ofdm_rate(rate); |
212 | rate_fb = txctl->alt_retry_rate ? : txctl->tx_rate; | 215 | rate_fb = ieee80211_get_alt_retry_rate(dev->wl->hw, info) ? : tx_rate; |
213 | rate_fb_ofdm = b43legacy_is_ofdm_rate(rate_fb->hw_value); | 216 | rate_fb_ofdm = b43legacy_is_ofdm_rate(rate_fb->hw_value); |
214 | 217 | ||
215 | txhdr->mac_frame_ctl = wlhdr->frame_control; | 218 | txhdr->mac_frame_ctl = wlhdr->frame_control; |
@@ -225,14 +228,14 @@ static int generate_txhdr_fw3(struct b43legacy_wldev *dev, | |||
225 | txhdr->dur_fb = wlhdr->duration_id; | 228 | txhdr->dur_fb = wlhdr->duration_id; |
226 | } else { | 229 | } else { |
227 | txhdr->dur_fb = ieee80211_generic_frame_duration(dev->wl->hw, | 230 | txhdr->dur_fb = ieee80211_generic_frame_duration(dev->wl->hw, |
228 | txctl->vif, | 231 | info->control.vif, |
229 | fragment_len, | 232 | fragment_len, |
230 | rate_fb); | 233 | rate_fb); |
231 | } | 234 | } |
232 | 235 | ||
233 | plcp_fragment_len = fragment_len + FCS_LEN; | 236 | plcp_fragment_len = fragment_len + FCS_LEN; |
234 | if (use_encryption) { | 237 | if (use_encryption) { |
235 | u8 key_idx = txctl->hw_key->hw_key_idx; | 238 | u8 key_idx = info->control.hw_key->hw_key_idx; |
236 | struct b43legacy_key *key; | 239 | struct b43legacy_key *key; |
237 | int wlhdr_len; | 240 | int wlhdr_len; |
238 | size_t iv_len; | 241 | size_t iv_len; |
@@ -242,7 +245,7 @@ static int generate_txhdr_fw3(struct b43legacy_wldev *dev, | |||
242 | 245 | ||
243 | if (key->enabled) { | 246 | if (key->enabled) { |
244 | /* Hardware appends ICV. */ | 247 | /* Hardware appends ICV. */ |
245 | plcp_fragment_len += txctl->icv_len; | 248 | plcp_fragment_len += info->control.icv_len; |
246 | 249 | ||
247 | key_idx = b43legacy_kidx_to_fw(dev, key_idx); | 250 | key_idx = b43legacy_kidx_to_fw(dev, key_idx); |
248 | mac_ctl |= (key_idx << B43legacy_TX4_MAC_KEYIDX_SHIFT) & | 251 | mac_ctl |= (key_idx << B43legacy_TX4_MAC_KEYIDX_SHIFT) & |
@@ -251,7 +254,7 @@ static int generate_txhdr_fw3(struct b43legacy_wldev *dev, | |||
251 | B43legacy_TX4_MAC_KEYALG_SHIFT) & | 254 | B43legacy_TX4_MAC_KEYALG_SHIFT) & |
252 | B43legacy_TX4_MAC_KEYALG; | 255 | B43legacy_TX4_MAC_KEYALG; |
253 | wlhdr_len = ieee80211_get_hdrlen(fctl); | 256 | wlhdr_len = ieee80211_get_hdrlen(fctl); |
254 | iv_len = min((size_t)txctl->iv_len, | 257 | iv_len = min((size_t)info->control.iv_len, |
255 | ARRAY_SIZE(txhdr->iv)); | 258 | ARRAY_SIZE(txhdr->iv)); |
256 | memcpy(txhdr->iv, ((u8 *)wlhdr) + wlhdr_len, iv_len); | 259 | memcpy(txhdr->iv, ((u8 *)wlhdr) + wlhdr_len, iv_len); |
257 | } else { | 260 | } else { |
@@ -275,7 +278,7 @@ static int generate_txhdr_fw3(struct b43legacy_wldev *dev, | |||
275 | phy_ctl |= B43legacy_TX4_PHY_OFDM; | 278 | phy_ctl |= B43legacy_TX4_PHY_OFDM; |
276 | if (dev->short_preamble) | 279 | if (dev->short_preamble) |
277 | phy_ctl |= B43legacy_TX4_PHY_SHORTPRMBL; | 280 | phy_ctl |= B43legacy_TX4_PHY_SHORTPRMBL; |
278 | switch (txctl->antenna_sel_tx) { | 281 | switch (info->antenna_sel_tx) { |
279 | case 0: | 282 | case 0: |
280 | phy_ctl |= B43legacy_TX4_PHY_ANTLAST; | 283 | phy_ctl |= B43legacy_TX4_PHY_ANTLAST; |
281 | break; | 284 | break; |
@@ -290,21 +293,21 @@ static int generate_txhdr_fw3(struct b43legacy_wldev *dev, | |||
290 | } | 293 | } |
291 | 294 | ||
292 | /* MAC control */ | 295 | /* MAC control */ |
293 | if (!(txctl->flags & IEEE80211_TXCTL_NO_ACK)) | 296 | if (!(info->flags & IEEE80211_TX_CTL_NO_ACK)) |
294 | mac_ctl |= B43legacy_TX4_MAC_ACK; | 297 | mac_ctl |= B43legacy_TX4_MAC_ACK; |
295 | if (!(((fctl & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_CTL) && | 298 | if (!(((fctl & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_CTL) && |
296 | ((fctl & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_PSPOLL))) | 299 | ((fctl & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_PSPOLL))) |
297 | mac_ctl |= B43legacy_TX4_MAC_HWSEQ; | 300 | mac_ctl |= B43legacy_TX4_MAC_HWSEQ; |
298 | if (txctl->flags & IEEE80211_TXCTL_FIRST_FRAGMENT) | 301 | if (info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT) |
299 | mac_ctl |= B43legacy_TX4_MAC_STMSDU; | 302 | mac_ctl |= B43legacy_TX4_MAC_STMSDU; |
300 | if (rate_fb_ofdm) | 303 | if (rate_fb_ofdm) |
301 | mac_ctl |= B43legacy_TX4_MAC_FALLBACKOFDM; | 304 | mac_ctl |= B43legacy_TX4_MAC_FALLBACKOFDM; |
302 | if (txctl->flags & IEEE80211_TXCTL_LONG_RETRY_LIMIT) | 305 | if (info->flags & IEEE80211_TX_CTL_LONG_RETRY_LIMIT) |
303 | mac_ctl |= B43legacy_TX4_MAC_LONGFRAME; | 306 | mac_ctl |= B43legacy_TX4_MAC_LONGFRAME; |
304 | 307 | ||
305 | /* Generate the RTS or CTS-to-self frame */ | 308 | /* Generate the RTS or CTS-to-self frame */ |
306 | if ((txctl->flags & IEEE80211_TXCTL_USE_RTS_CTS) || | 309 | if ((info->flags & IEEE80211_TX_CTL_USE_RTS_CTS) || |
307 | (txctl->flags & IEEE80211_TXCTL_USE_CTS_PROTECT)) { | 310 | (info->flags & IEEE80211_TX_CTL_USE_CTS_PROTECT)) { |
308 | unsigned int len; | 311 | unsigned int len; |
309 | struct ieee80211_hdr *hdr; | 312 | struct ieee80211_hdr *hdr; |
310 | int rts_rate; | 313 | int rts_rate; |
@@ -312,26 +315,26 @@ static int generate_txhdr_fw3(struct b43legacy_wldev *dev, | |||
312 | int rts_rate_ofdm; | 315 | int rts_rate_ofdm; |
313 | int rts_rate_fb_ofdm; | 316 | int rts_rate_fb_ofdm; |
314 | 317 | ||
315 | rts_rate = txctl->rts_cts_rate->hw_value; | 318 | rts_rate = ieee80211_get_rts_cts_rate(dev->wl->hw, info)->hw_value; |
316 | rts_rate_ofdm = b43legacy_is_ofdm_rate(rts_rate); | 319 | rts_rate_ofdm = b43legacy_is_ofdm_rate(rts_rate); |
317 | rts_rate_fb = b43legacy_calc_fallback_rate(rts_rate); | 320 | rts_rate_fb = b43legacy_calc_fallback_rate(rts_rate); |
318 | rts_rate_fb_ofdm = b43legacy_is_ofdm_rate(rts_rate_fb); | 321 | rts_rate_fb_ofdm = b43legacy_is_ofdm_rate(rts_rate_fb); |
319 | if (rts_rate_fb_ofdm) | 322 | if (rts_rate_fb_ofdm) |
320 | mac_ctl |= B43legacy_TX4_MAC_CTSFALLBACKOFDM; | 323 | mac_ctl |= B43legacy_TX4_MAC_CTSFALLBACKOFDM; |
321 | 324 | ||
322 | if (txctl->flags & IEEE80211_TXCTL_USE_CTS_PROTECT) { | 325 | if (info->flags & IEEE80211_TX_CTL_USE_CTS_PROTECT) { |
323 | ieee80211_ctstoself_get(dev->wl->hw, | 326 | ieee80211_ctstoself_get(dev->wl->hw, |
324 | txctl->vif, | 327 | info->control.vif, |
325 | fragment_data, | 328 | fragment_data, |
326 | fragment_len, txctl, | 329 | fragment_len, info, |
327 | (struct ieee80211_cts *) | 330 | (struct ieee80211_cts *) |
328 | (txhdr->rts_frame)); | 331 | (txhdr->rts_frame)); |
329 | mac_ctl |= B43legacy_TX4_MAC_SENDCTS; | 332 | mac_ctl |= B43legacy_TX4_MAC_SENDCTS; |
330 | len = sizeof(struct ieee80211_cts); | 333 | len = sizeof(struct ieee80211_cts); |
331 | } else { | 334 | } else { |
332 | ieee80211_rts_get(dev->wl->hw, | 335 | ieee80211_rts_get(dev->wl->hw, |
333 | txctl->vif, | 336 | info->control.vif, |
334 | fragment_data, fragment_len, txctl, | 337 | fragment_data, fragment_len, info, |
335 | (struct ieee80211_rts *) | 338 | (struct ieee80211_rts *) |
336 | (txhdr->rts_frame)); | 339 | (txhdr->rts_frame)); |
337 | mac_ctl |= B43legacy_TX4_MAC_SENDRTS; | 340 | mac_ctl |= B43legacy_TX4_MAC_SENDRTS; |
@@ -362,12 +365,12 @@ int b43legacy_generate_txhdr(struct b43legacy_wldev *dev, | |||
362 | u8 *txhdr, | 365 | u8 *txhdr, |
363 | const unsigned char *fragment_data, | 366 | const unsigned char *fragment_data, |
364 | unsigned int fragment_len, | 367 | unsigned int fragment_len, |
365 | const struct ieee80211_tx_control *txctl, | 368 | const struct ieee80211_tx_info *info, |
366 | u16 cookie) | 369 | u16 cookie) |
367 | { | 370 | { |
368 | return generate_txhdr_fw3(dev, (struct b43legacy_txhdr_fw3 *)txhdr, | 371 | return generate_txhdr_fw3(dev, (struct b43legacy_txhdr_fw3 *)txhdr, |
369 | fragment_data, fragment_len, | 372 | fragment_data, fragment_len, |
370 | txctl, cookie); | 373 | info, cookie); |
371 | } | 374 | } |
372 | 375 | ||
373 | static s8 b43legacy_rssi_postprocess(struct b43legacy_wldev *dev, | 376 | static s8 b43legacy_rssi_postprocess(struct b43legacy_wldev *dev, |