aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00mac.c
diff options
context:
space:
mode:
authorIvo van Doorn <IvDoorn@gmail.com>2007-10-06 07:34:52 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:55:15 -0400
commit5c58ee51ff8c0aca74c225e0263bc5dd2b917781 (patch)
treea08e875dade8a6f55d45419b728b2b077cec6dc0 /drivers/net/wireless/rt2x00/rt2x00mac.c
parent4f5af6eb3d17f8e343597ea99d97eb2f2905b2fb (diff)
[PATCH] rt2x00: Reorganize configuration handler
Reorganize configuration handling by creating a extra structure which contains precalculated values based on the mac80211 values which are usefull for all individual drivers. This also fixes the preamble configuration problem, up untill now preamble was never configured since by default the rate->val value was used when changing the mode. Now rate->val will only be used to set the basic rate mask. The preamble configuration will now be done correctly through the erp_ie_changed callback function. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00mac.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00mac.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c
index f519d7396848..4a6a0bd01ff1 100644
--- a/drivers/net/wireless/rt2x00/rt2x00mac.c
+++ b/drivers/net/wireless/rt2x00/rt2x00mac.c
@@ -365,6 +365,40 @@ int rt2x00mac_get_tx_stats(struct ieee80211_hw *hw,
365} 365}
366EXPORT_SYMBOL_GPL(rt2x00mac_get_tx_stats); 366EXPORT_SYMBOL_GPL(rt2x00mac_get_tx_stats);
367 367
368void rt2x00mac_erp_ie_changed(struct ieee80211_hw *hw, u8 changes,
369 int cts_protection, int preamble)
370{
371 struct rt2x00_dev *rt2x00dev = hw->priv;
372 int short_preamble;
373 int ack_timeout;
374 int ack_consume_time;
375 int difs;
376
377 /*
378 * We only support changing preamble mode.
379 */
380 if (!(changes & IEEE80211_ERP_CHANGE_PREAMBLE))
381 return;
382
383 short_preamble = !preamble;
384 preamble = !!(preamble) ? PREAMBLE : SHORT_PREAMBLE;
385
386 difs = (hw->conf.flags & IEEE80211_CONF_SHORT_SLOT_TIME) ?
387 SHORT_DIFS : DIFS;
388 ack_timeout = difs + PLCP + preamble + get_duration(ACK_SIZE, 10);
389
390 ack_consume_time = SIFS + PLCP + preamble + get_duration(ACK_SIZE, 10);
391
392 if (short_preamble)
393 __set_bit(CONFIG_SHORT_PREAMBLE, &rt2x00dev->flags);
394 else
395 __clear_bit(CONFIG_SHORT_PREAMBLE, &rt2x00dev->flags);
396
397 rt2x00dev->ops->lib->config_preamble(rt2x00dev, short_preamble,
398 ack_timeout, ack_consume_time);
399}
400EXPORT_SYMBOL_GPL(rt2x00mac_erp_ie_changed);
401
368int rt2x00mac_conf_tx(struct ieee80211_hw *hw, int queue, 402int rt2x00mac_conf_tx(struct ieee80211_hw *hw, int queue,
369 const struct ieee80211_tx_queue_params *params) 403 const struct ieee80211_tx_queue_params *params)
370{ 404{