aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefano Brivio <stefano.brivio@polimi.it>2007-11-06 16:48:12 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:04:28 -0500
commit0a6e1bee5770a6d4c4569a4720614402ab5f9d7a (patch)
tree6ef2afacb07c068a0812278fce78291ed887b8cd
parent43831b1581031991357385dd6c0762c06a3a62ab (diff)
b43legacy: use the retry limits provided by mac80211
Use the retry limits provided by mac80211. The patch to b43 by Michael Buesch <mb@bu3sch.de> has been ported to b43legacy. Signed-off-by: Stefano Brivio <stefano.brivio@polimi.it> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/b43legacy/main.c79
-rw-r--r--drivers/net/wireless/b43legacy/xmit.c3
2 files changed, 52 insertions, 30 deletions
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c
index af75f41668c4..c9fe09dda941 100644
--- a/drivers/net/wireless/b43legacy/main.c
+++ b/drivers/net/wireless/b43legacy/main.c
@@ -75,14 +75,6 @@ module_param_named(bad_frames_preempt, modparam_bad_frames_preempt, int, 0444);
75MODULE_PARM_DESC(bad_frames_preempt, "enable(1) / disable(0) Bad Frames" 75MODULE_PARM_DESC(bad_frames_preempt, "enable(1) / disable(0) Bad Frames"
76 " Preemption"); 76 " Preemption");
77 77
78static int modparam_short_retry = B43legacy_DEFAULT_SHORT_RETRY_LIMIT;
79module_param_named(short_retry, modparam_short_retry, int, 0444);
80MODULE_PARM_DESC(short_retry, "Short-Retry-Limit (0 - 15)");
81
82static int modparam_long_retry = B43legacy_DEFAULT_LONG_RETRY_LIMIT;
83module_param_named(long_retry, modparam_long_retry, int, 0444);
84MODULE_PARM_DESC(long_retry, "Long-Retry-Limit (0 - 15)");
85
86static char modparam_fwpostfix[16]; 78static char modparam_fwpostfix[16];
87module_param_string(fwpostfix, modparam_fwpostfix, 16, 0444); 79module_param_string(fwpostfix, modparam_fwpostfix, 16, 0444);
88MODULE_PARM_DESC(fwpostfix, "Postfix for the firmware files to load."); 80MODULE_PARM_DESC(fwpostfix, "Postfix for the firmware files to load.");
@@ -2930,6 +2922,20 @@ static void b43legacy_imcfglo_timeouts_workaround(struct b43legacy_wldev *dev)
2930#endif /* CONFIG_SSB_DRIVER_PCICORE */ 2922#endif /* CONFIG_SSB_DRIVER_PCICORE */
2931} 2923}
2932 2924
2925/* Write the short and long frame retry limit values. */
2926static void b43legacy_set_retry_limits(struct b43legacy_wldev *dev,
2927 unsigned int short_retry,
2928 unsigned int long_retry)
2929{
2930 /* The retry limit is a 4-bit counter. Enforce this to avoid overflowing
2931 * the chip-internal counter. */
2932 short_retry = min(short_retry, (unsigned int)0xF);
2933 long_retry = min(long_retry, (unsigned int)0xF);
2934
2935 b43legacy_shm_write16(dev, B43legacy_SHM_WIRELESS, 0x0006, short_retry);
2936 b43legacy_shm_write16(dev, B43legacy_SHM_WIRELESS, 0x0007, long_retry);
2937}
2938
2933/* Shutdown a wireless core */ 2939/* Shutdown a wireless core */
2934/* Locking: wl->mutex */ 2940/* Locking: wl->mutex */
2935static void b43legacy_wireless_core_exit(struct b43legacy_wldev *dev) 2941static void b43legacy_wireless_core_exit(struct b43legacy_wldev *dev)
@@ -3067,16 +3073,9 @@ static int b43legacy_wireless_core_init(struct b43legacy_wldev *dev)
3067 } 3073 }
3068 b43legacy_hf_write(dev, hf); 3074 b43legacy_hf_write(dev, hf);
3069 3075
3070 /* Short/Long Retry Limit. 3076 b43legacy_set_retry_limits(dev,
3071 * The retry-limit is a 4-bit counter. Enforce this to avoid overflowing 3077 B43legacy_DEFAULT_SHORT_RETRY_LIMIT,
3072 * the chip-internal counter. 3078 B43legacy_DEFAULT_LONG_RETRY_LIMIT);
3073 */
3074 tmp = limit_value(modparam_short_retry, 0, 0xF);
3075 b43legacy_shm_write16(dev, B43legacy_SHM_WIRELESS,
3076 0x0006, tmp);
3077 tmp = limit_value(modparam_long_retry, 0, 0xF);
3078 b43legacy_shm_write16(dev, B43legacy_SHM_WIRELESS,
3079 0x0007, tmp);
3080 3079
3081 b43legacy_shm_write16(dev, B43legacy_SHM_SHARED, 3080 b43legacy_shm_write16(dev, B43legacy_SHM_SHARED,
3082 0x0044, 3); 3081 0x0044, 3);
@@ -3253,19 +3252,41 @@ static void b43legacy_stop(struct ieee80211_hw *hw)
3253 mutex_unlock(&wl->mutex); 3252 mutex_unlock(&wl->mutex);
3254} 3253}
3255 3254
3255static int b43legacy_op_set_retry_limit(struct ieee80211_hw *hw,
3256 u32 short_retry_limit,
3257 u32 long_retry_limit)
3258{
3259 struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw);
3260 struct b43legacy_wldev *dev;
3261 int err = 0;
3262
3263 mutex_lock(&wl->mutex);
3264 dev = wl->current_dev;
3265 if (unlikely(!dev ||
3266 (b43legacy_status(dev) < B43legacy_STAT_INITIALIZED))) {
3267 err = -ENODEV;
3268 goto out_unlock;
3269 }
3270 b43legacy_set_retry_limits(dev, short_retry_limit, long_retry_limit);
3271out_unlock:
3272 mutex_unlock(&wl->mutex);
3273
3274 return err;
3275}
3256 3276
3257static const struct ieee80211_ops b43legacy_hw_ops = { 3277static const struct ieee80211_ops b43legacy_hw_ops = {
3258 .tx = b43legacy_tx, 3278 .tx = b43legacy_tx,
3259 .conf_tx = b43legacy_conf_tx, 3279 .conf_tx = b43legacy_conf_tx,
3260 .add_interface = b43legacy_add_interface, 3280 .add_interface = b43legacy_add_interface,
3261 .remove_interface = b43legacy_remove_interface, 3281 .remove_interface = b43legacy_remove_interface,
3262 .config = b43legacy_dev_config, 3282 .config = b43legacy_dev_config,
3263 .config_interface = b43legacy_config_interface, 3283 .config_interface = b43legacy_config_interface,
3264 .configure_filter = b43legacy_configure_filter, 3284 .configure_filter = b43legacy_configure_filter,
3265 .get_stats = b43legacy_get_stats, 3285 .get_stats = b43legacy_get_stats,
3266 .get_tx_stats = b43legacy_get_tx_stats, 3286 .get_tx_stats = b43legacy_get_tx_stats,
3267 .start = b43legacy_start, 3287 .start = b43legacy_start,
3268 .stop = b43legacy_stop, 3288 .stop = b43legacy_stop,
3289 .set_retry_limit = b43legacy_op_set_retry_limit,
3269}; 3290};
3270 3291
3271/* Hard-reset the chip. Do not call this directly. 3292/* Hard-reset the chip. Do not call this directly.
diff --git a/drivers/net/wireless/b43legacy/xmit.c b/drivers/net/wireless/b43legacy/xmit.c
index b71cc949f7d4..d558a3a7cbf9 100644
--- a/drivers/net/wireless/b43legacy/xmit.c
+++ b/drivers/net/wireless/b43legacy/xmit.c
@@ -290,6 +290,8 @@ static void generate_txhdr_fw3(struct b43legacy_wldev *dev,
290 mac_ctl |= B43legacy_TX4_MAC_STMSDU; 290 mac_ctl |= B43legacy_TX4_MAC_STMSDU;
291 if (rate_fb_ofdm) 291 if (rate_fb_ofdm)
292 mac_ctl |= B43legacy_TX4_MAC_FALLBACKOFDM; 292 mac_ctl |= B43legacy_TX4_MAC_FALLBACKOFDM;
293 if (txctl->flags & IEEE80211_TXCTL_LONG_RETRY_LIMIT)
294 mac_ctl |= B43legacy_TX4_MAC_LONGFRAME;
293 295
294 /* Generate the RTS or CTS-to-self frame */ 296 /* Generate the RTS or CTS-to-self frame */
295 if ((txctl->flags & IEEE80211_TXCTL_USE_RTS_CTS) || 297 if ((txctl->flags & IEEE80211_TXCTL_USE_RTS_CTS) ||
@@ -335,7 +337,6 @@ static void generate_txhdr_fw3(struct b43legacy_wldev *dev,
335 len, rts_rate_fb); 337 len, rts_rate_fb);
336 hdr = (struct ieee80211_hdr *)(&txhdr->rts_frame); 338 hdr = (struct ieee80211_hdr *)(&txhdr->rts_frame);
337 txhdr->rts_dur_fb = hdr->duration_id; 339 txhdr->rts_dur_fb = hdr->duration_id;
338 mac_ctl |= B43legacy_TX4_MAC_LONGFRAME;
339 } 340 }
340 341
341 /* Magic cookie */ 342 /* Magic cookie */