aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/ath9k/main.c1
-rw-r--r--drivers/net/wireless/b43/main.c60
-rw-r--r--drivers/net/wireless/b43legacy/main.c59
-rw-r--r--drivers/net/wireless/rt2x00/rt2400pci.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt2500pci.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00.h3
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00mac.c9
-rw-r--r--drivers/net/wireless/rt2x00/rt61pci.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt73usb.c2
-rw-r--r--include/net/mac80211.h14
-rw-r--r--net/mac80211/debugfs.c4
-rw-r--r--net/mac80211/ieee80211_i.h2
-rw-r--r--net/mac80211/main.c4
-rw-r--r--net/mac80211/tx.c4
-rw-r--r--net/mac80211/wext.c28
15 files changed, 89 insertions, 107 deletions
diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c
index f49910799ede..41cd114c438c 100644
--- a/drivers/net/wireless/ath9k/main.c
+++ b/drivers/net/wireless/ath9k/main.c
@@ -1659,7 +1659,6 @@ static struct ieee80211_ops ath9k_ops = {
1659 .get_tkip_seq = NULL, 1659 .get_tkip_seq = NULL,
1660 .set_rts_threshold = NULL, 1660 .set_rts_threshold = NULL,
1661 .set_frag_threshold = NULL, 1661 .set_frag_threshold = NULL,
1662 .set_retry_limit = NULL,
1663 .get_tsf = ath9k_get_tsf, 1662 .get_tsf = ath9k_get_tsf,
1664 .reset_tsf = ath9k_reset_tsf, 1663 .reset_tsf = ath9k_reset_tsf,
1665 .tx_last_beacon = NULL, 1664 .tx_last_beacon = NULL,
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 2e81af1022e4..9aeeb6553a91 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -3320,6 +3320,22 @@ init_failure:
3320 return err; 3320 return err;
3321} 3321}
3322 3322
3323/* Write the short and long frame retry limit values. */
3324static void b43_set_retry_limits(struct b43_wldev *dev,
3325 unsigned int short_retry,
3326 unsigned int long_retry)
3327{
3328 /* The retry limit is a 4-bit counter. Enforce this to avoid overflowing
3329 * the chip-internal counter. */
3330 short_retry = min(short_retry, (unsigned int)0xF);
3331 long_retry = min(long_retry, (unsigned int)0xF);
3332
3333 b43_shm_write16(dev, B43_SHM_SCRATCH, B43_SHM_SC_SRLIMIT,
3334 short_retry);
3335 b43_shm_write16(dev, B43_SHM_SCRATCH, B43_SHM_SC_LRLIMIT,
3336 long_retry);
3337}
3338
3323static int b43_op_config(struct ieee80211_hw *hw, u32 changed) 3339static int b43_op_config(struct ieee80211_hw *hw, u32 changed)
3324{ 3340{
3325 struct b43_wl *wl = hw_to_b43_wl(hw); 3341 struct b43_wl *wl = hw_to_b43_wl(hw);
@@ -3340,6 +3356,13 @@ static int b43_op_config(struct ieee80211_hw *hw, u32 changed)
3340 dev = wl->current_dev; 3356 dev = wl->current_dev;
3341 phy = &dev->phy; 3357 phy = &dev->phy;
3342 3358
3359 if (changed & IEEE80211_CONF_CHANGE_RETRY_LIMITS)
3360 b43_set_retry_limits(dev, conf->short_frame_max_tx_count,
3361 conf->long_frame_max_tx_count);
3362 changed &= ~IEEE80211_CONF_CHANGE_RETRY_LIMITS;
3363 if (!changed)
3364 goto out_unlock_mutex;
3365
3343 /* Disable IRQs while reconfiguring the device. 3366 /* Disable IRQs while reconfiguring the device.
3344 * This makes it possible to drop the spinlock throughout 3367 * This makes it possible to drop the spinlock throughout
3345 * the reconfiguration process. */ 3368 * the reconfiguration process. */
@@ -3859,22 +3882,6 @@ static void b43_imcfglo_timeouts_workaround(struct b43_wldev *dev)
3859#endif /* CONFIG_SSB_DRIVER_PCICORE */ 3882#endif /* CONFIG_SSB_DRIVER_PCICORE */
3860} 3883}
3861 3884
3862/* Write the short and long frame retry limit values. */
3863static void b43_set_retry_limits(struct b43_wldev *dev,
3864 unsigned int short_retry,
3865 unsigned int long_retry)
3866{
3867 /* The retry limit is a 4-bit counter. Enforce this to avoid overflowing
3868 * the chip-internal counter. */
3869 short_retry = min(short_retry, (unsigned int)0xF);
3870 long_retry = min(long_retry, (unsigned int)0xF);
3871
3872 b43_shm_write16(dev, B43_SHM_SCRATCH, B43_SHM_SC_SRLIMIT,
3873 short_retry);
3874 b43_shm_write16(dev, B43_SHM_SCRATCH, B43_SHM_SC_LRLIMIT,
3875 long_retry);
3876}
3877
3878static void b43_set_synth_pu_delay(struct b43_wldev *dev, bool idle) 3885static void b43_set_synth_pu_delay(struct b43_wldev *dev, bool idle)
3879{ 3886{
3880 u16 pu_delay; 3887 u16 pu_delay;
@@ -4195,26 +4202,6 @@ static void b43_op_stop(struct ieee80211_hw *hw)
4195 cancel_work_sync(&(wl->txpower_adjust_work)); 4202 cancel_work_sync(&(wl->txpower_adjust_work));
4196} 4203}
4197 4204
4198static int b43_op_set_retry_limit(struct ieee80211_hw *hw,
4199 u32 short_retry_limit, u32 long_retry_limit)
4200{
4201 struct b43_wl *wl = hw_to_b43_wl(hw);
4202 struct b43_wldev *dev;
4203 int err = 0;
4204
4205 mutex_lock(&wl->mutex);
4206 dev = wl->current_dev;
4207 if (unlikely(!dev || (b43_status(dev) < B43_STAT_INITIALIZED))) {
4208 err = -ENODEV;
4209 goto out_unlock;
4210 }
4211 b43_set_retry_limits(dev, short_retry_limit, long_retry_limit);
4212out_unlock:
4213 mutex_unlock(&wl->mutex);
4214
4215 return err;
4216}
4217
4218static int b43_op_beacon_set_tim(struct ieee80211_hw *hw, 4205static int b43_op_beacon_set_tim(struct ieee80211_hw *hw,
4219 struct ieee80211_sta *sta, bool set) 4206 struct ieee80211_sta *sta, bool set)
4220{ 4207{
@@ -4251,7 +4238,6 @@ static const struct ieee80211_ops b43_hw_ops = {
4251 .get_tx_stats = b43_op_get_tx_stats, 4238 .get_tx_stats = b43_op_get_tx_stats,
4252 .start = b43_op_start, 4239 .start = b43_op_start,
4253 .stop = b43_op_stop, 4240 .stop = b43_op_stop,
4254 .set_retry_limit = b43_op_set_retry_limit,
4255 .set_tim = b43_op_beacon_set_tim, 4241 .set_tim = b43_op_beacon_set_tim,
4256 .sta_notify = b43_op_sta_notify, 4242 .sta_notify = b43_op_sta_notify,
4257}; 4243};
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c
index 793cc396562f..78e46365f69e 100644
--- a/drivers/net/wireless/b43legacy/main.c
+++ b/drivers/net/wireless/b43legacy/main.c
@@ -2556,6 +2556,20 @@ init_failure:
2556 return err; 2556 return err;
2557} 2557}
2558 2558
2559/* Write the short and long frame retry limit values. */
2560static void b43legacy_set_retry_limits(struct b43legacy_wldev *dev,
2561 unsigned int short_retry,
2562 unsigned int long_retry)
2563{
2564 /* The retry limit is a 4-bit counter. Enforce this to avoid overflowing
2565 * the chip-internal counter. */
2566 short_retry = min(short_retry, (unsigned int)0xF);
2567 long_retry = min(long_retry, (unsigned int)0xF);
2568
2569 b43legacy_shm_write16(dev, B43legacy_SHM_WIRELESS, 0x0006, short_retry);
2570 b43legacy_shm_write16(dev, B43legacy_SHM_WIRELESS, 0x0007, long_retry);
2571}
2572
2559static int b43legacy_op_dev_config(struct ieee80211_hw *hw, 2573static int b43legacy_op_dev_config(struct ieee80211_hw *hw,
2560 u32 changed) 2574 u32 changed)
2561{ 2575{
@@ -2577,6 +2591,14 @@ static int b43legacy_op_dev_config(struct ieee80211_hw *hw,
2577 dev = wl->current_dev; 2591 dev = wl->current_dev;
2578 phy = &dev->phy; 2592 phy = &dev->phy;
2579 2593
2594 if (changed & IEEE80211_CONF_CHANGE_RETRY_LIMITS)
2595 b43legacy_set_retry_limits(dev,
2596 conf->short_frame_max_tx_count,
2597 conf->long_frame_max_tx_count);
2598 changed &= ~IEEE80211_CONF_CHANGE_RETRY_LIMITS;
2599 if (!changed)
2600 goto out_unlock_mutex;
2601
2580 /* Switch the PHY mode (if necessary). */ 2602 /* Switch the PHY mode (if necessary). */
2581 switch (conf->channel->band) { 2603 switch (conf->channel->band) {
2582 case IEEE80211_BAND_2GHZ: 2604 case IEEE80211_BAND_2GHZ:
@@ -2989,20 +3011,6 @@ static void b43legacy_imcfglo_timeouts_workaround(struct b43legacy_wldev *dev)
2989#endif /* CONFIG_SSB_DRIVER_PCICORE */ 3011#endif /* CONFIG_SSB_DRIVER_PCICORE */
2990} 3012}
2991 3013
2992/* Write the short and long frame retry limit values. */
2993static void b43legacy_set_retry_limits(struct b43legacy_wldev *dev,
2994 unsigned int short_retry,
2995 unsigned int long_retry)
2996{
2997 /* The retry limit is a 4-bit counter. Enforce this to avoid overflowing
2998 * the chip-internal counter. */
2999 short_retry = min(short_retry, (unsigned int)0xF);
3000 long_retry = min(long_retry, (unsigned int)0xF);
3001
3002 b43legacy_shm_write16(dev, B43legacy_SHM_WIRELESS, 0x0006, short_retry);
3003 b43legacy_shm_write16(dev, B43legacy_SHM_WIRELESS, 0x0007, long_retry);
3004}
3005
3006static void b43legacy_set_synth_pu_delay(struct b43legacy_wldev *dev, 3014static void b43legacy_set_synth_pu_delay(struct b43legacy_wldev *dev,
3007 bool idle) { 3015 bool idle) {
3008 u16 pu_delay = 1050; 3016 u16 pu_delay = 1050;
@@ -3367,28 +3375,6 @@ static void b43legacy_op_stop(struct ieee80211_hw *hw)
3367 mutex_unlock(&wl->mutex); 3375 mutex_unlock(&wl->mutex);
3368} 3376}
3369 3377
3370static int b43legacy_op_set_retry_limit(struct ieee80211_hw *hw,
3371 u32 short_retry_limit,
3372 u32 long_retry_limit)
3373{
3374 struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw);
3375 struct b43legacy_wldev *dev;
3376 int err = 0;
3377
3378 mutex_lock(&wl->mutex);
3379 dev = wl->current_dev;
3380 if (unlikely(!dev ||
3381 (b43legacy_status(dev) < B43legacy_STAT_INITIALIZED))) {
3382 err = -ENODEV;
3383 goto out_unlock;
3384 }
3385 b43legacy_set_retry_limits(dev, short_retry_limit, long_retry_limit);
3386out_unlock:
3387 mutex_unlock(&wl->mutex);
3388
3389 return err;
3390}
3391
3392static int b43legacy_op_beacon_set_tim(struct ieee80211_hw *hw, 3378static int b43legacy_op_beacon_set_tim(struct ieee80211_hw *hw,
3393 struct ieee80211_sta *sta, bool set) 3379 struct ieee80211_sta *sta, bool set)
3394{ 3380{
@@ -3414,7 +3400,6 @@ static const struct ieee80211_ops b43legacy_hw_ops = {
3414 .get_tx_stats = b43legacy_op_get_tx_stats, 3400 .get_tx_stats = b43legacy_op_get_tx_stats,
3415 .start = b43legacy_op_start, 3401 .start = b43legacy_op_start,
3416 .stop = b43legacy_op_stop, 3402 .stop = b43legacy_op_stop,
3417 .set_retry_limit = b43legacy_op_set_retry_limit,
3418 .set_tim = b43legacy_op_beacon_set_tim, 3403 .set_tim = b43legacy_op_beacon_set_tim,
3419}; 3404};
3420 3405
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
index 96eaf5f4dc68..1adca7a1b9dc 100644
--- a/drivers/net/wireless/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/rt2x00/rt2400pci.c
@@ -1574,7 +1574,6 @@ static const struct ieee80211_ops rt2400pci_mac80211_ops = {
1574 .config_interface = rt2x00mac_config_interface, 1574 .config_interface = rt2x00mac_config_interface,
1575 .configure_filter = rt2x00mac_configure_filter, 1575 .configure_filter = rt2x00mac_configure_filter,
1576 .get_stats = rt2x00mac_get_stats, 1576 .get_stats = rt2x00mac_get_stats,
1577 .set_retry_limit = rt2400pci_set_retry_limit,
1578 .bss_info_changed = rt2x00mac_bss_info_changed, 1577 .bss_info_changed = rt2x00mac_bss_info_changed,
1579 .conf_tx = rt2400pci_conf_tx, 1578 .conf_tx = rt2400pci_conf_tx,
1580 .get_tx_stats = rt2x00mac_get_tx_stats, 1579 .get_tx_stats = rt2x00mac_get_tx_stats,
@@ -1603,6 +1602,7 @@ static const struct rt2x00lib_ops rt2400pci_rt2x00_ops = {
1603 .config_intf = rt2400pci_config_intf, 1602 .config_intf = rt2400pci_config_intf,
1604 .config_erp = rt2400pci_config_erp, 1603 .config_erp = rt2400pci_config_erp,
1605 .config = rt2400pci_config, 1604 .config = rt2400pci_config,
1605 .set_retry_limit = rt2400pci_set_retry_limit,
1606}; 1606};
1607 1607
1608static const struct data_queue_desc rt2400pci_queue_rx = { 1608static const struct data_queue_desc rt2400pci_queue_rx = {
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c
index 8b772ab613e4..85b0387f46eb 100644
--- a/drivers/net/wireless/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/rt2x00/rt2500pci.c
@@ -1874,7 +1874,6 @@ static const struct ieee80211_ops rt2500pci_mac80211_ops = {
1874 .config_interface = rt2x00mac_config_interface, 1874 .config_interface = rt2x00mac_config_interface,
1875 .configure_filter = rt2x00mac_configure_filter, 1875 .configure_filter = rt2x00mac_configure_filter,
1876 .get_stats = rt2x00mac_get_stats, 1876 .get_stats = rt2x00mac_get_stats,
1877 .set_retry_limit = rt2500pci_set_retry_limit,
1878 .bss_info_changed = rt2x00mac_bss_info_changed, 1877 .bss_info_changed = rt2x00mac_bss_info_changed,
1879 .conf_tx = rt2x00mac_conf_tx, 1878 .conf_tx = rt2x00mac_conf_tx,
1880 .get_tx_stats = rt2x00mac_get_tx_stats, 1879 .get_tx_stats = rt2x00mac_get_tx_stats,
@@ -1903,6 +1902,7 @@ static const struct rt2x00lib_ops rt2500pci_rt2x00_ops = {
1903 .config_intf = rt2500pci_config_intf, 1902 .config_intf = rt2500pci_config_intf,
1904 .config_erp = rt2500pci_config_erp, 1903 .config_erp = rt2500pci_config_erp,
1905 .config = rt2500pci_config, 1904 .config = rt2500pci_config,
1905 .set_retry_limit = rt2500pci_set_retry_limit,
1906}; 1906};
1907 1907
1908static const struct data_queue_desc rt2500pci_queue_rx = { 1908static const struct data_queue_desc rt2500pci_queue_rx = {
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h
index 8ec8f7e9ec64..0887e895d5c1 100644
--- a/drivers/net/wireless/rt2x00/rt2x00.h
+++ b/drivers/net/wireless/rt2x00/rt2x00.h
@@ -599,6 +599,9 @@ struct rt2x00lib_ops {
599#define CONFIG_UPDATE_SLOT_TIME ( 1 << 5 ) 599#define CONFIG_UPDATE_SLOT_TIME ( 1 << 5 )
600#define CONFIG_UPDATE_BEACON_INT ( 1 << 6 ) 600#define CONFIG_UPDATE_BEACON_INT ( 1 << 6 )
601#define CONFIG_UPDATE_ALL 0xffff 601#define CONFIG_UPDATE_ALL 0xffff
602
603 int (*set_retry_limit) (struct ieee80211_hw *hw,
604 u32 short_limit, u32 long_limit);
602}; 605};
603 606
604/* 607/*
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c
index da7b49a364ff..931183369f07 100644
--- a/drivers/net/wireless/rt2x00/rt2x00mac.c
+++ b/drivers/net/wireless/rt2x00/rt2x00mac.c
@@ -349,6 +349,15 @@ int rt2x00mac_config(struct ieee80211_hw *hw, u32 changed)
349 if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags)) 349 if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags))
350 return 0; 350 return 0;
351 351
352 if (changed & IEEE80211_CONF_CHANGE_RETRY_LIMITS) {
353 rt2x00dev->ops->lib->set_retry_limit(hw,
354 conf->short_frame_max_tx_count,
355 conf->long_frame_max_tx_count);
356 }
357 changed &= ~IEEE80211_CONF_CHANGE_RETRY_LIMITS;
358 if (!changed)
359 return 0;
360
352 /* 361 /*
353 * Only change device state when the radio is enabled. It does not 362 * Only change device state when the radio is enabled. It does not
354 * matter what parameters we have configured when the radio is disabled 363 * matter what parameters we have configured when the radio is disabled
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index 45f69f83552c..08eb896ae36c 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -2724,7 +2724,6 @@ static const struct ieee80211_ops rt61pci_mac80211_ops = {
2724 .configure_filter = rt2x00mac_configure_filter, 2724 .configure_filter = rt2x00mac_configure_filter,
2725 .set_key = rt2x00mac_set_key, 2725 .set_key = rt2x00mac_set_key,
2726 .get_stats = rt2x00mac_get_stats, 2726 .get_stats = rt2x00mac_get_stats,
2727 .set_retry_limit = rt61pci_set_retry_limit,
2728 .bss_info_changed = rt2x00mac_bss_info_changed, 2727 .bss_info_changed = rt2x00mac_bss_info_changed,
2729 .conf_tx = rt61pci_conf_tx, 2728 .conf_tx = rt61pci_conf_tx,
2730 .get_tx_stats = rt2x00mac_get_tx_stats, 2729 .get_tx_stats = rt2x00mac_get_tx_stats,
@@ -2757,6 +2756,7 @@ static const struct rt2x00lib_ops rt61pci_rt2x00_ops = {
2757 .config_intf = rt61pci_config_intf, 2756 .config_intf = rt61pci_config_intf,
2758 .config_erp = rt61pci_config_erp, 2757 .config_erp = rt61pci_config_erp,
2759 .config = rt61pci_config, 2758 .config = rt61pci_config,
2759 .set_retry_limit = rt61pci_set_retry_limit,
2760}; 2760};
2761 2761
2762static const struct data_queue_desc rt61pci_queue_rx = { 2762static const struct data_queue_desc rt61pci_queue_rx = {
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index 336fecb04c46..7f89782a34e4 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -2315,7 +2315,6 @@ static const struct ieee80211_ops rt73usb_mac80211_ops = {
2315 .configure_filter = rt2x00mac_configure_filter, 2315 .configure_filter = rt2x00mac_configure_filter,
2316 .set_key = rt2x00mac_set_key, 2316 .set_key = rt2x00mac_set_key,
2317 .get_stats = rt2x00mac_get_stats, 2317 .get_stats = rt2x00mac_get_stats,
2318 .set_retry_limit = rt73usb_set_retry_limit,
2319 .bss_info_changed = rt2x00mac_bss_info_changed, 2318 .bss_info_changed = rt2x00mac_bss_info_changed,
2320 .conf_tx = rt73usb_conf_tx, 2319 .conf_tx = rt73usb_conf_tx,
2321 .get_tx_stats = rt2x00mac_get_tx_stats, 2320 .get_tx_stats = rt2x00mac_get_tx_stats,
@@ -2347,6 +2346,7 @@ static const struct rt2x00lib_ops rt73usb_rt2x00_ops = {
2347 .config_intf = rt73usb_config_intf, 2346 .config_intf = rt73usb_config_intf,
2348 .config_erp = rt73usb_config_erp, 2347 .config_erp = rt73usb_config_erp,
2349 .config = rt73usb_config, 2348 .config = rt73usb_config,
2349 .set_retry_limit = rt73usb_set_retry_limit,
2350}; 2350};
2351 2351
2352static const struct data_queue_desc rt73usb_queue_rx = { 2352static const struct data_queue_desc rt73usb_queue_rx = {
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 34e8569b59bb..fd52300b96d0 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -473,6 +473,7 @@ static inline int __deprecated __IEEE80211_CONF_SHORT_SLOT_TIME(void)
473 * @IEEE80211_CONF_CHANGE_PS: the PS flag changed 473 * @IEEE80211_CONF_CHANGE_PS: the PS flag changed
474 * @IEEE80211_CONF_CHANGE_POWER: the TX power changed 474 * @IEEE80211_CONF_CHANGE_POWER: the TX power changed
475 * @IEEE80211_CONF_CHANGE_CHANNEL: the channel changed 475 * @IEEE80211_CONF_CHANGE_CHANNEL: the channel changed
476 * @IEEE80211_CONF_CHANGE_RETRY_LIMITS: retry limits changed
476 */ 477 */
477enum ieee80211_conf_changed { 478enum ieee80211_conf_changed {
478 IEEE80211_CONF_CHANGE_RADIO_ENABLED = BIT(0), 479 IEEE80211_CONF_CHANGE_RADIO_ENABLED = BIT(0),
@@ -482,6 +483,7 @@ enum ieee80211_conf_changed {
482 IEEE80211_CONF_CHANGE_PS = BIT(4), 483 IEEE80211_CONF_CHANGE_PS = BIT(4),
483 IEEE80211_CONF_CHANGE_POWER = BIT(5), 484 IEEE80211_CONF_CHANGE_POWER = BIT(5),
484 IEEE80211_CONF_CHANGE_CHANNEL = BIT(6), 485 IEEE80211_CONF_CHANGE_CHANNEL = BIT(6),
486 IEEE80211_CONF_CHANGE_RETRY_LIMITS = BIT(7),
485}; 487};
486 488
487/** 489/**
@@ -497,6 +499,12 @@ enum ieee80211_conf_changed {
497 * @ht_cap: describes current self configuration of 802.11n HT capabilities 499 * @ht_cap: describes current self configuration of 802.11n HT capabilities
498 * @ht_bss_conf: describes current BSS configuration of 802.11n HT parameters 500 * @ht_bss_conf: describes current BSS configuration of 802.11n HT parameters
499 * @channel: the channel to tune to 501 * @channel: the channel to tune to
502 * @long_frame_max_tx_count: Maximum number of transmissions for a "long" frame
503 * (a frame not RTS protected), called "dot11LongRetryLimit" in 802.11,
504 * but actually means the number of transmissions not the number of retries
505 * @short_frame_max_tx_count: Maximum number of transmissions for a "short"
506 * frame, called "dot11ShortRetryLimit" in 802.11, but actually means the
507 * number of transmissions not the number of retries
500 */ 508 */
501struct ieee80211_conf { 509struct ieee80211_conf {
502 int beacon_int; 510 int beacon_int;
@@ -506,6 +514,8 @@ struct ieee80211_conf {
506 u16 listen_interval; 514 u16 listen_interval;
507 bool radio_enabled; 515 bool radio_enabled;
508 516
517 u8 long_frame_max_tx_count, short_frame_max_tx_count;
518
509 struct ieee80211_channel *channel; 519 struct ieee80211_channel *channel;
510 520
511 struct ieee80211_sta_ht_cap ht_cap; 521 struct ieee80211_sta_ht_cap ht_cap;
@@ -1190,8 +1200,6 @@ enum ieee80211_ampdu_mlme_action {
1190 * the device does fragmentation by itself; if this method is assigned then 1200 * the device does fragmentation by itself; if this method is assigned then
1191 * the stack will not do fragmentation. 1201 * the stack will not do fragmentation.
1192 * 1202 *
1193 * @set_retry_limit: Configuration of retry limits (if device needs it)
1194 *
1195 * @sta_notify: Notifies low level driver about addition or removal 1203 * @sta_notify: Notifies low level driver about addition or removal
1196 * of assocaited station or AP. 1204 * of assocaited station or AP.
1197 * 1205 *
@@ -1261,8 +1269,6 @@ struct ieee80211_ops {
1261 u32 *iv32, u16 *iv16); 1269 u32 *iv32, u16 *iv16);
1262 int (*set_rts_threshold)(struct ieee80211_hw *hw, u32 value); 1270 int (*set_rts_threshold)(struct ieee80211_hw *hw, u32 value);
1263 int (*set_frag_threshold)(struct ieee80211_hw *hw, u32 value); 1271 int (*set_frag_threshold)(struct ieee80211_hw *hw, u32 value);
1264 int (*set_retry_limit)(struct ieee80211_hw *hw,
1265 u32 short_retry, u32 long_retr);
1266 void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 1272 void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1267 enum sta_notify_cmd, struct ieee80211_sta *sta); 1273 enum sta_notify_cmd, struct ieee80211_sta *sta);
1268 int (*conf_tx)(struct ieee80211_hw *hw, u16 queue, 1274 int (*conf_tx)(struct ieee80211_hw *hw, u16 queue,
diff --git a/net/mac80211/debugfs.c b/net/mac80211/debugfs.c
index 767dbca50adb..2697a2fe608f 100644
--- a/net/mac80211/debugfs.c
+++ b/net/mac80211/debugfs.c
@@ -52,9 +52,9 @@ DEBUGFS_READONLY_FILE(rts_threshold, 20, "%d",
52DEBUGFS_READONLY_FILE(fragmentation_threshold, 20, "%d", 52DEBUGFS_READONLY_FILE(fragmentation_threshold, 20, "%d",
53 local->fragmentation_threshold); 53 local->fragmentation_threshold);
54DEBUGFS_READONLY_FILE(short_retry_limit, 20, "%d", 54DEBUGFS_READONLY_FILE(short_retry_limit, 20, "%d",
55 local->short_retry_limit); 55 local->hw.conf.short_frame_max_tx_count);
56DEBUGFS_READONLY_FILE(long_retry_limit, 20, "%d", 56DEBUGFS_READONLY_FILE(long_retry_limit, 20, "%d",
57 local->long_retry_limit); 57 local->hw.conf.long_frame_max_tx_count);
58DEBUGFS_READONLY_FILE(total_ps_buffered, 20, "%d", 58DEBUGFS_READONLY_FILE(total_ps_buffered, 20, "%d",
59 local->total_ps_buffered); 59 local->total_ps_buffered);
60DEBUGFS_READONLY_FILE(wep_iv, 20, "%#06x", 60DEBUGFS_READONLY_FILE(wep_iv, 20, "%#06x",
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 819844726dd4..f1ef522bfe07 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -635,8 +635,6 @@ struct ieee80211_local {
635 635
636 int rts_threshold; 636 int rts_threshold;
637 int fragmentation_threshold; 637 int fragmentation_threshold;
638 int short_retry_limit; /* dot11ShortRetryLimit */
639 int long_retry_limit; /* dot11LongRetryLimit */
640 638
641 struct crypto_blkcipher *wep_tx_tfm; 639 struct crypto_blkcipher *wep_tx_tfm;
642 struct crypto_blkcipher *wep_rx_tfm; 640 struct crypto_blkcipher *wep_rx_tfm;
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index c936017f6d48..59be9e782699 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -673,8 +673,8 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
673 673
674 local->rts_threshold = IEEE80211_MAX_RTS_THRESHOLD; 674 local->rts_threshold = IEEE80211_MAX_RTS_THRESHOLD;
675 local->fragmentation_threshold = IEEE80211_MAX_FRAG_THRESHOLD; 675 local->fragmentation_threshold = IEEE80211_MAX_FRAG_THRESHOLD;
676 local->short_retry_limit = 7; 676 local->hw.conf.long_frame_max_tx_count = 4;
677 local->long_retry_limit = 4; 677 local->hw.conf.short_frame_max_tx_count = 7;
678 local->hw.conf.radio_enabled = true; 678 local->hw.conf.radio_enabled = true;
679 679
680 INIT_LIST_HEAD(&local->interfaces); 680 INIT_LIST_HEAD(&local->interfaces);
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 8bcabefa86e0..dd440a07634e 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -505,10 +505,10 @@ ieee80211_tx_h_misc(struct ieee80211_tx_data *tx)
505 info->flags |= 505 info->flags |=
506 IEEE80211_TX_CTL_LONG_RETRY_LIMIT; 506 IEEE80211_TX_CTL_LONG_RETRY_LIMIT;
507 info->control.retry_limit = 507 info->control.retry_limit =
508 tx->local->long_retry_limit; 508 tx->local->hw.conf.long_frame_max_tx_count - 1;
509 } else { 509 } else {
510 info->control.retry_limit = 510 info->control.retry_limit =
511 tx->local->short_retry_limit; 511 tx->local->hw.conf.short_frame_max_tx_count - 1;
512 } 512 }
513 } else { 513 } else {
514 info->control.retry_limit = 1; 514 info->control.retry_limit = 1;
diff --git a/net/mac80211/wext.c b/net/mac80211/wext.c
index 94c4b35eeb14..f7e442f80a17 100644
--- a/net/mac80211/wext.c
+++ b/net/mac80211/wext.c
@@ -802,21 +802,16 @@ static int ieee80211_ioctl_siwretry(struct net_device *dev,
802 (retry->flags & IW_RETRY_TYPE) != IW_RETRY_LIMIT) 802 (retry->flags & IW_RETRY_TYPE) != IW_RETRY_LIMIT)
803 return -EINVAL; 803 return -EINVAL;
804 804
805 if (retry->flags & IW_RETRY_MAX) 805 if (retry->flags & IW_RETRY_MAX) {
806 local->long_retry_limit = retry->value; 806 local->hw.conf.long_frame_max_tx_count = retry->value;
807 else if (retry->flags & IW_RETRY_MIN) 807 } else if (retry->flags & IW_RETRY_MIN) {
808 local->short_retry_limit = retry->value; 808 local->hw.conf.short_frame_max_tx_count = retry->value;
809 else { 809 } else {
810 local->long_retry_limit = retry->value; 810 local->hw.conf.long_frame_max_tx_count = retry->value;
811 local->short_retry_limit = retry->value; 811 local->hw.conf.short_frame_max_tx_count = retry->value;
812 } 812 }
813 813
814 if (local->ops->set_retry_limit) { 814 ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_RETRY_LIMITS);
815 return local->ops->set_retry_limit(
816 local_to_hw(local),
817 local->short_retry_limit,
818 local->long_retry_limit);
819 }
820 815
821 return 0; 816 return 0;
822} 817}
@@ -833,14 +828,15 @@ static int ieee80211_ioctl_giwretry(struct net_device *dev,
833 /* first return min value, iwconfig will ask max value 828 /* first return min value, iwconfig will ask max value
834 * later if needed */ 829 * later if needed */
835 retry->flags |= IW_RETRY_LIMIT; 830 retry->flags |= IW_RETRY_LIMIT;
836 retry->value = local->short_retry_limit; 831 retry->value = local->hw.conf.short_frame_max_tx_count;
837 if (local->long_retry_limit != local->short_retry_limit) 832 if (local->hw.conf.long_frame_max_tx_count !=
833 local->hw.conf.short_frame_max_tx_count)
838 retry->flags |= IW_RETRY_MIN; 834 retry->flags |= IW_RETRY_MIN;
839 return 0; 835 return 0;
840 } 836 }
841 if (retry->flags & IW_RETRY_MAX) { 837 if (retry->flags & IW_RETRY_MAX) {
842 retry->flags = IW_RETRY_LIMIT | IW_RETRY_MAX; 838 retry->flags = IW_RETRY_LIMIT | IW_RETRY_MAX;
843 retry->value = local->long_retry_limit; 839 retry->value = local->hw.conf.long_frame_max_tx_count;
844 } 840 }
845 841
846 return 0; 842 return 0;