diff options
Diffstat (limited to 'drivers/net/wireless/b43legacy')
-rw-r--r-- | drivers/net/wireless/b43legacy/b43legacy.h | 17 | ||||
-rw-r--r-- | drivers/net/wireless/b43legacy/dma.c | 43 | ||||
-rw-r--r-- | drivers/net/wireless/b43legacy/dma.h | 7 | ||||
-rw-r--r-- | drivers/net/wireless/b43legacy/main.c | 31 | ||||
-rw-r--r-- | drivers/net/wireless/b43legacy/phy.c | 14 | ||||
-rw-r--r-- | drivers/net/wireless/b43legacy/pio.c | 27 | ||||
-rw-r--r-- | drivers/net/wireless/b43legacy/pio.h | 7 | ||||
-rw-r--r-- | drivers/net/wireless/b43legacy/radio.c | 12 | ||||
-rw-r--r-- | drivers/net/wireless/b43legacy/xmit.c | 51 | ||||
-rw-r--r-- | drivers/net/wireless/b43legacy/xmit.h | 2 |
10 files changed, 91 insertions, 120 deletions
diff --git a/drivers/net/wireless/b43legacy/b43legacy.h b/drivers/net/wireless/b43legacy/b43legacy.h index ded3cd31b3df..c40078e1fff9 100644 --- a/drivers/net/wireless/b43legacy/b43legacy.h +++ b/drivers/net/wireless/b43legacy/b43legacy.h | |||
@@ -823,23 +823,6 @@ void b43legacydbg(struct b43legacy_wl *wl, const char *fmt, ...) | |||
823 | # define b43legacydbg(wl, fmt...) do { /* nothing */ } while (0) | 823 | # define b43legacydbg(wl, fmt...) do { /* nothing */ } while (0) |
824 | #endif /* DEBUG */ | 824 | #endif /* DEBUG */ |
825 | 825 | ||
826 | |||
827 | /** Limit a value between two limits */ | ||
828 | #ifdef limit_value | ||
829 | # undef limit_value | ||
830 | #endif | ||
831 | #define limit_value(value, min, max) \ | ||
832 | ({ \ | ||
833 | typeof(value) __value = (value); \ | ||
834 | typeof(value) __min = (min); \ | ||
835 | typeof(value) __max = (max); \ | ||
836 | if (__value < __min) \ | ||
837 | __value = __min; \ | ||
838 | else if (__value > __max) \ | ||
839 | __value = __max; \ | ||
840 | __value; \ | ||
841 | }) | ||
842 | |||
843 | /* Macros for printing a value in Q5.2 format */ | 826 | /* Macros for printing a value in Q5.2 format */ |
844 | #define Q52_FMT "%u.%u" | 827 | #define Q52_FMT "%u.%u" |
845 | #define Q52_ARG(q52) ((q52) / 4), (((q52) & 3) * 100 / 4) | 828 | #define Q52_ARG(q52) ((q52) / 4), (((q52) & 3) * 100 / 4) |
diff --git a/drivers/net/wireless/b43legacy/dma.c b/drivers/net/wireless/b43legacy/dma.c index 93ddc1cbcc8b..203b0f42ac58 100644 --- a/drivers/net/wireless/b43legacy/dma.c +++ b/drivers/net/wireless/b43legacy/dma.c | |||
@@ -1205,10 +1205,10 @@ struct b43legacy_dmaring *parse_cookie(struct b43legacy_wldev *dev, | |||
1205 | } | 1205 | } |
1206 | 1206 | ||
1207 | static int dma_tx_fragment(struct b43legacy_dmaring *ring, | 1207 | static int dma_tx_fragment(struct b43legacy_dmaring *ring, |
1208 | struct sk_buff *skb, | 1208 | struct sk_buff *skb) |
1209 | struct ieee80211_tx_control *ctl) | ||
1210 | { | 1209 | { |
1211 | const struct b43legacy_dma_ops *ops = ring->ops; | 1210 | const struct b43legacy_dma_ops *ops = ring->ops; |
1211 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | ||
1212 | u8 *header; | 1212 | u8 *header; |
1213 | int slot, old_top_slot, old_used_slots; | 1213 | int slot, old_top_slot, old_used_slots; |
1214 | int err; | 1214 | int err; |
@@ -1231,7 +1231,7 @@ static int dma_tx_fragment(struct b43legacy_dmaring *ring, | |||
1231 | header = &(ring->txhdr_cache[slot * sizeof( | 1231 | header = &(ring->txhdr_cache[slot * sizeof( |
1232 | struct b43legacy_txhdr_fw3)]); | 1232 | struct b43legacy_txhdr_fw3)]); |
1233 | err = b43legacy_generate_txhdr(ring->dev, header, | 1233 | err = b43legacy_generate_txhdr(ring->dev, header, |
1234 | skb->data, skb->len, ctl, | 1234 | skb->data, skb->len, info, |
1235 | generate_cookie(ring, slot)); | 1235 | generate_cookie(ring, slot)); |
1236 | if (unlikely(err)) { | 1236 | if (unlikely(err)) { |
1237 | ring->current_slot = old_top_slot; | 1237 | ring->current_slot = old_top_slot; |
@@ -1255,7 +1255,6 @@ static int dma_tx_fragment(struct b43legacy_dmaring *ring, | |||
1255 | desc = ops->idx2desc(ring, slot, &meta); | 1255 | desc = ops->idx2desc(ring, slot, &meta); |
1256 | memset(meta, 0, sizeof(*meta)); | 1256 | memset(meta, 0, sizeof(*meta)); |
1257 | 1257 | ||
1258 | memcpy(&meta->txstat.control, ctl, sizeof(*ctl)); | ||
1259 | meta->skb = skb; | 1258 | meta->skb = skb; |
1260 | meta->is_last_fragment = 1; | 1259 | meta->is_last_fragment = 1; |
1261 | 1260 | ||
@@ -1323,14 +1322,13 @@ int should_inject_overflow(struct b43legacy_dmaring *ring) | |||
1323 | } | 1322 | } |
1324 | 1323 | ||
1325 | int b43legacy_dma_tx(struct b43legacy_wldev *dev, | 1324 | int b43legacy_dma_tx(struct b43legacy_wldev *dev, |
1326 | struct sk_buff *skb, | 1325 | struct sk_buff *skb) |
1327 | struct ieee80211_tx_control *ctl) | ||
1328 | { | 1326 | { |
1329 | struct b43legacy_dmaring *ring; | 1327 | struct b43legacy_dmaring *ring; |
1330 | int err = 0; | 1328 | int err = 0; |
1331 | unsigned long flags; | 1329 | unsigned long flags; |
1332 | 1330 | ||
1333 | ring = priority_to_txring(dev, ctl->queue); | 1331 | ring = priority_to_txring(dev, skb_get_queue_mapping(skb)); |
1334 | spin_lock_irqsave(&ring->lock, flags); | 1332 | spin_lock_irqsave(&ring->lock, flags); |
1335 | B43legacy_WARN_ON(!ring->tx); | 1333 | B43legacy_WARN_ON(!ring->tx); |
1336 | if (unlikely(free_slots(ring) < SLOTS_PER_PACKET)) { | 1334 | if (unlikely(free_slots(ring) < SLOTS_PER_PACKET)) { |
@@ -1343,7 +1341,7 @@ int b43legacy_dma_tx(struct b43legacy_wldev *dev, | |||
1343 | * That would be a mac80211 bug. */ | 1341 | * That would be a mac80211 bug. */ |
1344 | B43legacy_BUG_ON(ring->stopped); | 1342 | B43legacy_BUG_ON(ring->stopped); |
1345 | 1343 | ||
1346 | err = dma_tx_fragment(ring, skb, ctl); | 1344 | err = dma_tx_fragment(ring, skb); |
1347 | if (unlikely(err == -ENOKEY)) { | 1345 | if (unlikely(err == -ENOKEY)) { |
1348 | /* Drop this packet, as we don't have the encryption key | 1346 | /* Drop this packet, as we don't have the encryption key |
1349 | * anymore and must not transmit it unencrypted. */ | 1347 | * anymore and must not transmit it unencrypted. */ |
@@ -1401,26 +1399,29 @@ void b43legacy_dma_handle_txstatus(struct b43legacy_wldev *dev, | |||
1401 | 1); | 1399 | 1); |
1402 | 1400 | ||
1403 | if (meta->is_last_fragment) { | 1401 | if (meta->is_last_fragment) { |
1404 | B43legacy_WARN_ON(!meta->skb); | 1402 | struct ieee80211_tx_info *info; |
1403 | BUG_ON(!meta->skb); | ||
1404 | info = IEEE80211_SKB_CB(meta->skb); | ||
1405 | /* Call back to inform the ieee80211 subsystem about the | 1405 | /* Call back to inform the ieee80211 subsystem about the |
1406 | * status of the transmission. | 1406 | * status of the transmission. |
1407 | * Some fields of txstat are already filled in dma_tx(). | 1407 | * Some fields of txstat are already filled in dma_tx(). |
1408 | */ | 1408 | */ |
1409 | |||
1410 | memset(&info->status, 0, sizeof(info->status)); | ||
1411 | |||
1409 | if (status->acked) { | 1412 | if (status->acked) { |
1410 | meta->txstat.flags |= IEEE80211_TX_STATUS_ACK; | 1413 | info->flags |= IEEE80211_TX_STAT_ACK; |
1411 | } else { | 1414 | } else { |
1412 | if (!(meta->txstat.control.flags | 1415 | if (!(info->flags & IEEE80211_TX_CTL_NO_ACK)) |
1413 | & IEEE80211_TXCTL_NO_ACK)) | 1416 | info->status.excessive_retries = 1; |
1414 | meta->txstat.excessive_retries = 1; | ||
1415 | } | 1417 | } |
1416 | if (status->frame_count == 0) { | 1418 | if (status->frame_count == 0) { |
1417 | /* The frame was not transmitted at all. */ | 1419 | /* The frame was not transmitted at all. */ |
1418 | meta->txstat.retry_count = 0; | 1420 | info->status.retry_count = 0; |
1419 | } else | 1421 | } else |
1420 | meta->txstat.retry_count = status->frame_count | 1422 | info->status.retry_count = status->frame_count |
1421 | - 1; | 1423 | - 1; |
1422 | ieee80211_tx_status_irqsafe(dev->wl->hw, meta->skb, | 1424 | ieee80211_tx_status_irqsafe(dev->wl->hw, meta->skb); |
1423 | &(meta->txstat)); | ||
1424 | /* skb is freed by ieee80211_tx_status_irqsafe() */ | 1425 | /* skb is freed by ieee80211_tx_status_irqsafe() */ |
1425 | meta->skb = NULL; | 1426 | meta->skb = NULL; |
1426 | } else { | 1427 | } else { |
@@ -1455,18 +1456,16 @@ void b43legacy_dma_get_tx_stats(struct b43legacy_wldev *dev, | |||
1455 | { | 1456 | { |
1456 | const int nr_queues = dev->wl->hw->queues; | 1457 | const int nr_queues = dev->wl->hw->queues; |
1457 | struct b43legacy_dmaring *ring; | 1458 | struct b43legacy_dmaring *ring; |
1458 | struct ieee80211_tx_queue_stats_data *data; | ||
1459 | unsigned long flags; | 1459 | unsigned long flags; |
1460 | int i; | 1460 | int i; |
1461 | 1461 | ||
1462 | for (i = 0; i < nr_queues; i++) { | 1462 | for (i = 0; i < nr_queues; i++) { |
1463 | data = &(stats->data[i]); | ||
1464 | ring = priority_to_txring(dev, i); | 1463 | ring = priority_to_txring(dev, i); |
1465 | 1464 | ||
1466 | spin_lock_irqsave(&ring->lock, flags); | 1465 | spin_lock_irqsave(&ring->lock, flags); |
1467 | data->len = ring->used_slots / SLOTS_PER_PACKET; | 1466 | stats[i].len = ring->used_slots / SLOTS_PER_PACKET; |
1468 | data->limit = ring->nr_slots / SLOTS_PER_PACKET; | 1467 | stats[i].limit = ring->nr_slots / SLOTS_PER_PACKET; |
1469 | data->count = ring->nr_tx_packets; | 1468 | stats[i].count = ring->nr_tx_packets; |
1470 | spin_unlock_irqrestore(&ring->lock, flags); | 1469 | spin_unlock_irqrestore(&ring->lock, flags); |
1471 | } | 1470 | } |
1472 | } | 1471 | } |
diff --git a/drivers/net/wireless/b43legacy/dma.h b/drivers/net/wireless/b43legacy/dma.h index 2dd488c5be2d..2f186003c31e 100644 --- a/drivers/net/wireless/b43legacy/dma.h +++ b/drivers/net/wireless/b43legacy/dma.h | |||
@@ -195,7 +195,6 @@ struct b43legacy_dmadesc_meta { | |||
195 | dma_addr_t dmaaddr; | 195 | dma_addr_t dmaaddr; |
196 | /* ieee80211 TX status. Only used once per 802.11 frag. */ | 196 | /* ieee80211 TX status. Only used once per 802.11 frag. */ |
197 | bool is_last_fragment; | 197 | bool is_last_fragment; |
198 | struct ieee80211_tx_status txstat; | ||
199 | }; | 198 | }; |
200 | 199 | ||
201 | struct b43legacy_dmaring; | 200 | struct b43legacy_dmaring; |
@@ -297,8 +296,7 @@ void b43legacy_dma_get_tx_stats(struct b43legacy_wldev *dev, | |||
297 | struct ieee80211_tx_queue_stats *stats); | 296 | struct ieee80211_tx_queue_stats *stats); |
298 | 297 | ||
299 | int b43legacy_dma_tx(struct b43legacy_wldev *dev, | 298 | int b43legacy_dma_tx(struct b43legacy_wldev *dev, |
300 | struct sk_buff *skb, | 299 | struct sk_buff *skb); |
301 | struct ieee80211_tx_control *ctl); | ||
302 | void b43legacy_dma_handle_txstatus(struct b43legacy_wldev *dev, | 300 | void b43legacy_dma_handle_txstatus(struct b43legacy_wldev *dev, |
303 | const struct b43legacy_txstatus *status); | 301 | const struct b43legacy_txstatus *status); |
304 | 302 | ||
@@ -323,8 +321,7 @@ void b43legacy_dma_get_tx_stats(struct b43legacy_wldev *dev, | |||
323 | } | 321 | } |
324 | static inline | 322 | static inline |
325 | int b43legacy_dma_tx(struct b43legacy_wldev *dev, | 323 | int b43legacy_dma_tx(struct b43legacy_wldev *dev, |
326 | struct sk_buff *skb, | 324 | struct sk_buff *skb) |
327 | struct ieee80211_tx_control *ctl) | ||
328 | { | 325 | { |
329 | return 0; | 326 | return 0; |
330 | } | 327 | } |
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c index 3e612d0a13e8..069157eea05c 100644 --- a/drivers/net/wireless/b43legacy/main.c +++ b/drivers/net/wireless/b43legacy/main.c | |||
@@ -846,10 +846,10 @@ static void handle_irq_noise(struct b43legacy_wldev *dev) | |||
846 | /* Get the noise samples. */ | 846 | /* Get the noise samples. */ |
847 | B43legacy_WARN_ON(dev->noisecalc.nr_samples >= 8); | 847 | B43legacy_WARN_ON(dev->noisecalc.nr_samples >= 8); |
848 | i = dev->noisecalc.nr_samples; | 848 | i = dev->noisecalc.nr_samples; |
849 | noise[0] = limit_value(noise[0], 0, ARRAY_SIZE(phy->nrssi_lt) - 1); | 849 | noise[0] = clamp_val(noise[0], 0, ARRAY_SIZE(phy->nrssi_lt) - 1); |
850 | noise[1] = limit_value(noise[1], 0, ARRAY_SIZE(phy->nrssi_lt) - 1); | 850 | noise[1] = clamp_val(noise[1], 0, ARRAY_SIZE(phy->nrssi_lt) - 1); |
851 | noise[2] = limit_value(noise[2], 0, ARRAY_SIZE(phy->nrssi_lt) - 1); | 851 | noise[2] = clamp_val(noise[2], 0, ARRAY_SIZE(phy->nrssi_lt) - 1); |
852 | noise[3] = limit_value(noise[3], 0, ARRAY_SIZE(phy->nrssi_lt) - 1); | 852 | noise[3] = clamp_val(noise[3], 0, ARRAY_SIZE(phy->nrssi_lt) - 1); |
853 | dev->noisecalc.samples[i][0] = phy->nrssi_lt[noise[0]]; | 853 | dev->noisecalc.samples[i][0] = phy->nrssi_lt[noise[0]]; |
854 | dev->noisecalc.samples[i][1] = phy->nrssi_lt[noise[1]]; | 854 | dev->noisecalc.samples[i][1] = phy->nrssi_lt[noise[1]]; |
855 | dev->noisecalc.samples[i][2] = phy->nrssi_lt[noise[2]]; | 855 | dev->noisecalc.samples[i][2] = phy->nrssi_lt[noise[2]]; |
@@ -2358,8 +2358,7 @@ static int b43legacy_rng_init(struct b43legacy_wl *wl) | |||
2358 | } | 2358 | } |
2359 | 2359 | ||
2360 | static int b43legacy_op_tx(struct ieee80211_hw *hw, | 2360 | static int b43legacy_op_tx(struct ieee80211_hw *hw, |
2361 | struct sk_buff *skb, | 2361 | struct sk_buff *skb) |
2362 | struct ieee80211_tx_control *ctl) | ||
2363 | { | 2362 | { |
2364 | struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw); | 2363 | struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw); |
2365 | struct b43legacy_wldev *dev = wl->current_dev; | 2364 | struct b43legacy_wldev *dev = wl->current_dev; |
@@ -2373,10 +2372,10 @@ static int b43legacy_op_tx(struct ieee80211_hw *hw, | |||
2373 | /* DMA-TX is done without a global lock. */ | 2372 | /* DMA-TX is done without a global lock. */ |
2374 | if (b43legacy_using_pio(dev)) { | 2373 | if (b43legacy_using_pio(dev)) { |
2375 | spin_lock_irqsave(&wl->irq_lock, flags); | 2374 | spin_lock_irqsave(&wl->irq_lock, flags); |
2376 | err = b43legacy_pio_tx(dev, skb, ctl); | 2375 | err = b43legacy_pio_tx(dev, skb); |
2377 | spin_unlock_irqrestore(&wl->irq_lock, flags); | 2376 | spin_unlock_irqrestore(&wl->irq_lock, flags); |
2378 | } else | 2377 | } else |
2379 | err = b43legacy_dma_tx(dev, skb, ctl); | 2378 | err = b43legacy_dma_tx(dev, skb); |
2380 | out: | 2379 | out: |
2381 | if (unlikely(err)) { | 2380 | if (unlikely(err)) { |
2382 | /* Drop the packet. */ | 2381 | /* Drop the packet. */ |
@@ -2385,8 +2384,7 @@ out: | |||
2385 | return NETDEV_TX_OK; | 2384 | return NETDEV_TX_OK; |
2386 | } | 2385 | } |
2387 | 2386 | ||
2388 | static int b43legacy_op_conf_tx(struct ieee80211_hw *hw, | 2387 | static int b43legacy_op_conf_tx(struct ieee80211_hw *hw, u16 queue, |
2389 | int queue, | ||
2390 | const struct ieee80211_tx_queue_params *params) | 2388 | const struct ieee80211_tx_queue_params *params) |
2391 | { | 2389 | { |
2392 | return 0; | 2390 | return 0; |
@@ -2797,7 +2795,6 @@ static int b43legacy_wireless_core_start(struct b43legacy_wldev *dev) | |||
2797 | /* Start data flow (TX/RX) */ | 2795 | /* Start data flow (TX/RX) */ |
2798 | b43legacy_mac_enable(dev); | 2796 | b43legacy_mac_enable(dev); |
2799 | b43legacy_interrupt_enable(dev, dev->irq_savedstate); | 2797 | b43legacy_interrupt_enable(dev, dev->irq_savedstate); |
2800 | ieee80211_start_queues(dev->wl->hw); | ||
2801 | 2798 | ||
2802 | /* Start maintenance work */ | 2799 | /* Start maintenance work */ |
2803 | b43legacy_periodic_tasks_setup(dev); | 2800 | b43legacy_periodic_tasks_setup(dev); |
@@ -3406,7 +3403,7 @@ static int b43legacy_op_beacon_set_tim(struct ieee80211_hw *hw, | |||
3406 | * field, but that would probably require resizing and moving of data | 3403 | * field, but that would probably require resizing and moving of data |
3407 | * within the beacon template. Simply request a new beacon and let | 3404 | * within the beacon template. Simply request a new beacon and let |
3408 | * mac80211 do the hard work. */ | 3405 | * mac80211 do the hard work. */ |
3409 | beacon = ieee80211_beacon_get(hw, wl->vif, NULL); | 3406 | beacon = ieee80211_beacon_get(hw, wl->vif); |
3410 | if (unlikely(!beacon)) | 3407 | if (unlikely(!beacon)) |
3411 | return -ENOMEM; | 3408 | return -ENOMEM; |
3412 | spin_lock_irqsave(&wl->irq_lock, flags); | 3409 | spin_lock_irqsave(&wl->irq_lock, flags); |
@@ -3417,8 +3414,7 @@ static int b43legacy_op_beacon_set_tim(struct ieee80211_hw *hw, | |||
3417 | } | 3414 | } |
3418 | 3415 | ||
3419 | static int b43legacy_op_ibss_beacon_update(struct ieee80211_hw *hw, | 3416 | static int b43legacy_op_ibss_beacon_update(struct ieee80211_hw *hw, |
3420 | struct sk_buff *beacon, | 3417 | struct sk_buff *beacon) |
3421 | struct ieee80211_tx_control *ctl) | ||
3422 | { | 3418 | { |
3423 | struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw); | 3419 | struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw); |
3424 | unsigned long flags; | 3420 | unsigned long flags; |
@@ -3718,10 +3714,9 @@ static int b43legacy_wireless_init(struct ssb_device *dev) | |||
3718 | 3714 | ||
3719 | /* fill hw info */ | 3715 | /* fill hw info */ |
3720 | hw->flags = IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE | | 3716 | hw->flags = IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE | |
3721 | IEEE80211_HW_RX_INCLUDES_FCS; | 3717 | IEEE80211_HW_RX_INCLUDES_FCS | |
3722 | hw->max_signal = 100; | 3718 | IEEE80211_HW_SIGNAL_DBM | |
3723 | hw->max_rssi = -110; | 3719 | IEEE80211_HW_NOISE_DBM; |
3724 | hw->max_noise = -110; | ||
3725 | hw->queues = 1; /* FIXME: hardware has more queues */ | 3720 | hw->queues = 1; /* FIXME: hardware has more queues */ |
3726 | SET_IEEE80211_DEV(hw, dev->dev); | 3721 | SET_IEEE80211_DEV(hw, dev->dev); |
3727 | if (is_valid_ether_addr(sprom->et1mac)) | 3722 | if (is_valid_ether_addr(sprom->et1mac)) |
diff --git a/drivers/net/wireless/b43legacy/phy.c b/drivers/net/wireless/b43legacy/phy.c index 8e5c09b81871..768cccb9b1ba 100644 --- a/drivers/net/wireless/b43legacy/phy.c +++ b/drivers/net/wireless/b43legacy/phy.c | |||
@@ -1088,7 +1088,7 @@ static void b43legacy_phy_initg(struct b43legacy_wldev *dev) | |||
1088 | * the value 0x7FFFFFFF here. I think that is some weird | 1088 | * the value 0x7FFFFFFF here. I think that is some weird |
1089 | * compiler optimization in the original driver. | 1089 | * compiler optimization in the original driver. |
1090 | * Essentially, what we do here is resetting all NRSSI LT | 1090 | * Essentially, what we do here is resetting all NRSSI LT |
1091 | * entries to -32 (see the limit_value() in nrssi_hw_update()) | 1091 | * entries to -32 (see the clamp_val() in nrssi_hw_update()) |
1092 | */ | 1092 | */ |
1093 | b43legacy_nrssi_hw_update(dev, 0xFFFF); | 1093 | b43legacy_nrssi_hw_update(dev, 0xFFFF); |
1094 | b43legacy_calc_nrssi_threshold(dev); | 1094 | b43legacy_calc_nrssi_threshold(dev); |
@@ -1756,7 +1756,7 @@ static s8 b43legacy_phy_estimate_power_out(struct b43legacy_wldev *dev, s8 tssi) | |||
1756 | switch (phy->type) { | 1756 | switch (phy->type) { |
1757 | case B43legacy_PHYTYPE_B: | 1757 | case B43legacy_PHYTYPE_B: |
1758 | case B43legacy_PHYTYPE_G: | 1758 | case B43legacy_PHYTYPE_G: |
1759 | tmp = limit_value(tmp, 0x00, 0x3F); | 1759 | tmp = clamp_val(tmp, 0x00, 0x3F); |
1760 | dbm = phy->tssi2dbm[tmp]; | 1760 | dbm = phy->tssi2dbm[tmp]; |
1761 | break; | 1761 | break; |
1762 | default: | 1762 | default: |
@@ -1859,7 +1859,7 @@ void b43legacy_phy_xmitpower(struct b43legacy_wldev *dev) | |||
1859 | 1859 | ||
1860 | /* find the desired power in Q5.2 - power_level is in dBm | 1860 | /* find the desired power in Q5.2 - power_level is in dBm |
1861 | * and limit it - max_pwr is already in Q5.2 */ | 1861 | * and limit it - max_pwr is already in Q5.2 */ |
1862 | desired_pwr = limit_value(phy->power_level << 2, 0, max_pwr); | 1862 | desired_pwr = clamp_val(phy->power_level << 2, 0, max_pwr); |
1863 | if (b43legacy_debug(dev, B43legacy_DBG_XMITPOWER)) | 1863 | if (b43legacy_debug(dev, B43legacy_DBG_XMITPOWER)) |
1864 | b43legacydbg(dev->wl, "Current TX power output: " Q52_FMT | 1864 | b43legacydbg(dev->wl, "Current TX power output: " Q52_FMT |
1865 | " dBm, Desired TX power output: " Q52_FMT | 1865 | " dBm, Desired TX power output: " Q52_FMT |
@@ -1905,7 +1905,7 @@ void b43legacy_phy_xmitpower(struct b43legacy_wldev *dev) | |||
1905 | radio_attenuation++; | 1905 | radio_attenuation++; |
1906 | } | 1906 | } |
1907 | } | 1907 | } |
1908 | baseband_attenuation = limit_value(baseband_attenuation, 0, 11); | 1908 | baseband_attenuation = clamp_val(baseband_attenuation, 0, 11); |
1909 | 1909 | ||
1910 | txpower = phy->txctl1; | 1910 | txpower = phy->txctl1; |
1911 | if ((phy->radio_ver == 0x2050) && (phy->radio_rev == 2)) { | 1911 | if ((phy->radio_ver == 0x2050) && (phy->radio_rev == 2)) { |
@@ -1933,8 +1933,8 @@ void b43legacy_phy_xmitpower(struct b43legacy_wldev *dev) | |||
1933 | } | 1933 | } |
1934 | /* Save the control values */ | 1934 | /* Save the control values */ |
1935 | phy->txctl1 = txpower; | 1935 | phy->txctl1 = txpower; |
1936 | baseband_attenuation = limit_value(baseband_attenuation, 0, 11); | 1936 | baseband_attenuation = clamp_val(baseband_attenuation, 0, 11); |
1937 | radio_attenuation = limit_value(radio_attenuation, 0, 9); | 1937 | radio_attenuation = clamp_val(radio_attenuation, 0, 9); |
1938 | phy->rfatt = radio_attenuation; | 1938 | phy->rfatt = radio_attenuation; |
1939 | phy->bbatt = baseband_attenuation; | 1939 | phy->bbatt = baseband_attenuation; |
1940 | 1940 | ||
@@ -1979,7 +1979,7 @@ s8 b43legacy_tssi2dbm_entry(s8 entry [], u8 index, s16 pab0, s16 pab1, s16 pab2) | |||
1979 | f = q; | 1979 | f = q; |
1980 | i++; | 1980 | i++; |
1981 | } while (delta >= 2); | 1981 | } while (delta >= 2); |
1982 | entry[index] = limit_value(b43legacy_tssi2dbm_ad(m1 * f, 8192), | 1982 | entry[index] = clamp_val(b43legacy_tssi2dbm_ad(m1 * f, 8192), |
1983 | -127, 128); | 1983 | -127, 128); |
1984 | return 0; | 1984 | return 0; |
1985 | } | 1985 | } |
diff --git a/drivers/net/wireless/b43legacy/pio.c b/drivers/net/wireless/b43legacy/pio.c index bcdd54eb2edb..a86c7647fa2d 100644 --- a/drivers/net/wireless/b43legacy/pio.c +++ b/drivers/net/wireless/b43legacy/pio.c | |||
@@ -196,7 +196,7 @@ static int pio_tx_write_fragment(struct b43legacy_pioqueue *queue, | |||
196 | B43legacy_WARN_ON(skb_shinfo(skb)->nr_frags != 0); | 196 | B43legacy_WARN_ON(skb_shinfo(skb)->nr_frags != 0); |
197 | err = b43legacy_generate_txhdr(queue->dev, | 197 | err = b43legacy_generate_txhdr(queue->dev, |
198 | txhdr, skb->data, skb->len, | 198 | txhdr, skb->data, skb->len, |
199 | &packet->txstat.control, | 199 | IEEE80211_SKB_CB(skb), |
200 | generate_cookie(queue, packet)); | 200 | generate_cookie(queue, packet)); |
201 | if (err) | 201 | if (err) |
202 | return err; | 202 | return err; |
@@ -463,8 +463,7 @@ err_destroy0: | |||
463 | } | 463 | } |
464 | 464 | ||
465 | int b43legacy_pio_tx(struct b43legacy_wldev *dev, | 465 | int b43legacy_pio_tx(struct b43legacy_wldev *dev, |
466 | struct sk_buff *skb, | 466 | struct sk_buff *skb) |
467 | struct ieee80211_tx_control *ctl) | ||
468 | { | 467 | { |
469 | struct b43legacy_pioqueue *queue = dev->pio.queue1; | 468 | struct b43legacy_pioqueue *queue = dev->pio.queue1; |
470 | struct b43legacy_pio_txpacket *packet; | 469 | struct b43legacy_pio_txpacket *packet; |
@@ -476,9 +475,6 @@ int b43legacy_pio_tx(struct b43legacy_wldev *dev, | |||
476 | list); | 475 | list); |
477 | packet->skb = skb; | 476 | packet->skb = skb; |
478 | 477 | ||
479 | memset(&packet->txstat, 0, sizeof(packet->txstat)); | ||
480 | memcpy(&packet->txstat.control, ctl, sizeof(*ctl)); | ||
481 | |||
482 | list_move_tail(&packet->list, &queue->txqueue); | 478 | list_move_tail(&packet->list, &queue->txqueue); |
483 | queue->nr_txfree--; | 479 | queue->nr_txfree--; |
484 | queue->nr_tx_packets++; | 480 | queue->nr_tx_packets++; |
@@ -494,6 +490,7 @@ void b43legacy_pio_handle_txstatus(struct b43legacy_wldev *dev, | |||
494 | { | 490 | { |
495 | struct b43legacy_pioqueue *queue; | 491 | struct b43legacy_pioqueue *queue; |
496 | struct b43legacy_pio_txpacket *packet; | 492 | struct b43legacy_pio_txpacket *packet; |
493 | struct ieee80211_tx_info *info; | ||
497 | 494 | ||
498 | queue = parse_cookie(dev, status->cookie, &packet); | 495 | queue = parse_cookie(dev, status->cookie, &packet); |
499 | B43legacy_WARN_ON(!queue); | 496 | B43legacy_WARN_ON(!queue); |
@@ -505,11 +502,13 @@ void b43legacy_pio_handle_txstatus(struct b43legacy_wldev *dev, | |||
505 | queue->tx_devq_used -= (packet->skb->len + | 502 | queue->tx_devq_used -= (packet->skb->len + |
506 | sizeof(struct b43legacy_txhdr_fw3)); | 503 | sizeof(struct b43legacy_txhdr_fw3)); |
507 | 504 | ||
505 | info = IEEE80211_SKB_CB(packet->skb); | ||
506 | memset(&info->status, 0, sizeof(info->status)); | ||
507 | |||
508 | if (status->acked) | 508 | if (status->acked) |
509 | packet->txstat.flags |= IEEE80211_TX_STATUS_ACK; | 509 | info->flags |= IEEE80211_TX_STAT_ACK; |
510 | packet->txstat.retry_count = status->frame_count - 1; | 510 | info->status.retry_count = status->frame_count - 1; |
511 | ieee80211_tx_status_irqsafe(dev->wl->hw, packet->skb, | 511 | ieee80211_tx_status_irqsafe(dev->wl->hw, packet->skb); |
512 | &(packet->txstat)); | ||
513 | packet->skb = NULL; | 512 | packet->skb = NULL; |
514 | 513 | ||
515 | free_txpacket(packet, 1); | 514 | free_txpacket(packet, 1); |
@@ -525,13 +524,11 @@ void b43legacy_pio_get_tx_stats(struct b43legacy_wldev *dev, | |||
525 | { | 524 | { |
526 | struct b43legacy_pio *pio = &dev->pio; | 525 | struct b43legacy_pio *pio = &dev->pio; |
527 | struct b43legacy_pioqueue *queue; | 526 | struct b43legacy_pioqueue *queue; |
528 | struct ieee80211_tx_queue_stats_data *data; | ||
529 | 527 | ||
530 | queue = pio->queue1; | 528 | queue = pio->queue1; |
531 | data = &(stats->data[0]); | 529 | stats[0].len = B43legacy_PIO_MAXTXPACKETS - queue->nr_txfree; |
532 | data->len = B43legacy_PIO_MAXTXPACKETS - queue->nr_txfree; | 530 | stats[0].limit = B43legacy_PIO_MAXTXPACKETS; |
533 | data->limit = B43legacy_PIO_MAXTXPACKETS; | 531 | stats[0].count = queue->nr_tx_packets; |
534 | data->count = queue->nr_tx_packets; | ||
535 | } | 532 | } |
536 | 533 | ||
537 | static void pio_rx_error(struct b43legacy_pioqueue *queue, | 534 | static void pio_rx_error(struct b43legacy_pioqueue *queue, |
diff --git a/drivers/net/wireless/b43legacy/pio.h b/drivers/net/wireless/b43legacy/pio.h index 5bfed0c40030..464fec05a06d 100644 --- a/drivers/net/wireless/b43legacy/pio.h +++ b/drivers/net/wireless/b43legacy/pio.h | |||
@@ -41,7 +41,6 @@ struct b43legacy_xmitstatus; | |||
41 | struct b43legacy_pio_txpacket { | 41 | struct b43legacy_pio_txpacket { |
42 | struct b43legacy_pioqueue *queue; | 42 | struct b43legacy_pioqueue *queue; |
43 | struct sk_buff *skb; | 43 | struct sk_buff *skb; |
44 | struct ieee80211_tx_status txstat; | ||
45 | struct list_head list; | 44 | struct list_head list; |
46 | }; | 45 | }; |
47 | 46 | ||
@@ -104,8 +103,7 @@ int b43legacy_pio_init(struct b43legacy_wldev *dev); | |||
104 | void b43legacy_pio_free(struct b43legacy_wldev *dev); | 103 | void b43legacy_pio_free(struct b43legacy_wldev *dev); |
105 | 104 | ||
106 | int b43legacy_pio_tx(struct b43legacy_wldev *dev, | 105 | int b43legacy_pio_tx(struct b43legacy_wldev *dev, |
107 | struct sk_buff *skb, | 106 | struct sk_buff *skb); |
108 | struct ieee80211_tx_control *ctl); | ||
109 | void b43legacy_pio_handle_txstatus(struct b43legacy_wldev *dev, | 107 | void b43legacy_pio_handle_txstatus(struct b43legacy_wldev *dev, |
110 | const struct b43legacy_txstatus *status); | 108 | const struct b43legacy_txstatus *status); |
111 | void b43legacy_pio_get_tx_stats(struct b43legacy_wldev *dev, | 109 | void b43legacy_pio_get_tx_stats(struct b43legacy_wldev *dev, |
@@ -132,8 +130,7 @@ void b43legacy_pio_free(struct b43legacy_wldev *dev) | |||
132 | } | 130 | } |
133 | static inline | 131 | static inline |
134 | int b43legacy_pio_tx(struct b43legacy_wldev *dev, | 132 | int b43legacy_pio_tx(struct b43legacy_wldev *dev, |
135 | struct sk_buff *skb, | 133 | struct sk_buff *skb) |
136 | struct ieee80211_tx_control *ctl) | ||
137 | { | 134 | { |
138 | return 0; | 135 | return 0; |
139 | } | 136 | } |
diff --git a/drivers/net/wireless/b43legacy/radio.c b/drivers/net/wireless/b43legacy/radio.c index 955832e8654f..2df545cfad14 100644 --- a/drivers/net/wireless/b43legacy/radio.c +++ b/drivers/net/wireless/b43legacy/radio.c | |||
@@ -357,7 +357,7 @@ void b43legacy_nrssi_hw_update(struct b43legacy_wldev *dev, u16 val) | |||
357 | for (i = 0; i < 64; i++) { | 357 | for (i = 0; i < 64; i++) { |
358 | tmp = b43legacy_nrssi_hw_read(dev, i); | 358 | tmp = b43legacy_nrssi_hw_read(dev, i); |
359 | tmp -= val; | 359 | tmp -= val; |
360 | tmp = limit_value(tmp, -32, 31); | 360 | tmp = clamp_val(tmp, -32, 31); |
361 | b43legacy_nrssi_hw_write(dev, i, tmp); | 361 | b43legacy_nrssi_hw_write(dev, i, tmp); |
362 | } | 362 | } |
363 | } | 363 | } |
@@ -375,7 +375,7 @@ void b43legacy_nrssi_mem_update(struct b43legacy_wldev *dev) | |||
375 | tmp = (i - delta) * phy->nrssislope; | 375 | tmp = (i - delta) * phy->nrssislope; |
376 | tmp /= 0x10000; | 376 | tmp /= 0x10000; |
377 | tmp += 0x3A; | 377 | tmp += 0x3A; |
378 | tmp = limit_value(tmp, 0, 0x3F); | 378 | tmp = clamp_val(tmp, 0, 0x3F); |
379 | phy->nrssi_lt[i] = tmp; | 379 | phy->nrssi_lt[i] = tmp; |
380 | } | 380 | } |
381 | } | 381 | } |
@@ -839,7 +839,7 @@ void b43legacy_calc_nrssi_threshold(struct b43legacy_wldev *dev) | |||
839 | } else | 839 | } else |
840 | threshold = phy->nrssi[1] - 5; | 840 | threshold = phy->nrssi[1] - 5; |
841 | 841 | ||
842 | threshold = limit_value(threshold, 0, 0x3E); | 842 | threshold = clamp_val(threshold, 0, 0x3E); |
843 | b43legacy_phy_read(dev, 0x0020); /* dummy read */ | 843 | b43legacy_phy_read(dev, 0x0020); /* dummy read */ |
844 | b43legacy_phy_write(dev, 0x0020, (((u16)threshold) << 8) | 844 | b43legacy_phy_write(dev, 0x0020, (((u16)threshold) << 8) |
845 | | 0x001C); | 845 | | 0x001C); |
@@ -892,7 +892,7 @@ void b43legacy_calc_nrssi_threshold(struct b43legacy_wldev *dev) | |||
892 | else | 892 | else |
893 | a += 32; | 893 | a += 32; |
894 | a = a >> 6; | 894 | a = a >> 6; |
895 | a = limit_value(a, -31, 31); | 895 | a = clamp_val(a, -31, 31); |
896 | 896 | ||
897 | b = b * (phy->nrssi[1] - phy->nrssi[0]); | 897 | b = b * (phy->nrssi[1] - phy->nrssi[0]); |
898 | b += (phy->nrssi[0] << 6); | 898 | b += (phy->nrssi[0] << 6); |
@@ -901,7 +901,7 @@ void b43legacy_calc_nrssi_threshold(struct b43legacy_wldev *dev) | |||
901 | else | 901 | else |
902 | b += 32; | 902 | b += 32; |
903 | b = b >> 6; | 903 | b = b >> 6; |
904 | b = limit_value(b, -31, 31); | 904 | b = clamp_val(b, -31, 31); |
905 | 905 | ||
906 | tmp_u16 = b43legacy_phy_read(dev, 0x048A) & 0xF000; | 906 | tmp_u16 = b43legacy_phy_read(dev, 0x048A) & 0xF000; |
907 | tmp_u16 |= ((u32)b & 0x0000003F); | 907 | tmp_u16 |= ((u32)b & 0x0000003F); |
@@ -1905,7 +1905,7 @@ void b43legacy_radio_set_txpower_a(struct b43legacy_wldev *dev, u16 txpower) | |||
1905 | u16 dac; | 1905 | u16 dac; |
1906 | u16 ilt; | 1906 | u16 ilt; |
1907 | 1907 | ||
1908 | txpower = limit_value(txpower, 0, 63); | 1908 | txpower = clamp_val(txpower, 0, 63); |
1909 | 1909 | ||
1910 | pamp = b43legacy_get_txgain_freq_power_amp(txpower); | 1910 | pamp = b43legacy_get_txgain_freq_power_amp(txpower); |
1911 | pamp <<= 5; | 1911 | pamp <<= 5; |
diff --git a/drivers/net/wireless/b43legacy/xmit.c b/drivers/net/wireless/b43legacy/xmit.c index dcad2491a606..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 = (u16)(txctl->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, |
@@ -532,12 +535,12 @@ void b43legacy_rx(struct b43legacy_wldev *dev, | |||
532 | } | 535 | } |
533 | } | 536 | } |
534 | 537 | ||
535 | status.ssi = b43legacy_rssi_postprocess(dev, jssi, | 538 | status.signal = b43legacy_rssi_postprocess(dev, jssi, |
536 | (phystat0 & B43legacy_RX_PHYST0_OFDM), | 539 | (phystat0 & B43legacy_RX_PHYST0_OFDM), |
537 | (phystat0 & B43legacy_RX_PHYST0_GAINCTL), | 540 | (phystat0 & B43legacy_RX_PHYST0_GAINCTL), |
538 | (phystat3 & B43legacy_RX_PHYST3_TRSTATE)); | 541 | (phystat3 & B43legacy_RX_PHYST3_TRSTATE)); |
539 | status.noise = dev->stats.link_noise; | 542 | status.noise = dev->stats.link_noise; |
540 | status.signal = (jssi * 100) / B43legacy_RX_MAX_SSI; | 543 | status.qual = (jssi * 100) / B43legacy_RX_MAX_SSI; |
541 | /* change to support A PHY */ | 544 | /* change to support A PHY */ |
542 | if (phystat0 & B43legacy_RX_PHYST0_OFDM) | 545 | if (phystat0 & B43legacy_RX_PHYST0_OFDM) |
543 | status.rate_idx = b43legacy_plcp_get_bitrate_idx_ofdm(plcp, false); | 546 | status.rate_idx = b43legacy_plcp_get_bitrate_idx_ofdm(plcp, false); |
diff --git a/drivers/net/wireless/b43legacy/xmit.h b/drivers/net/wireless/b43legacy/xmit.h index bab47928a0c9..e56777e0feab 100644 --- a/drivers/net/wireless/b43legacy/xmit.h +++ b/drivers/net/wireless/b43legacy/xmit.h | |||
@@ -80,7 +80,7 @@ int b43legacy_generate_txhdr(struct b43legacy_wldev *dev, | |||
80 | u8 *txhdr, | 80 | u8 *txhdr, |
81 | const unsigned char *fragment_data, | 81 | const unsigned char *fragment_data, |
82 | unsigned int fragment_len, | 82 | unsigned int fragment_len, |
83 | const struct ieee80211_tx_control *txctl, | 83 | const struct ieee80211_tx_info *info, |
84 | u16 cookie); | 84 | u16 cookie); |
85 | 85 | ||
86 | 86 | ||