[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>
This commit is contained in:
committed by
David S. Miller
parent
4f5af6eb3d
commit
5c58ee51ff
@@ -365,6 +365,40 @@ int rt2x00mac_get_tx_stats(struct ieee80211_hw *hw,
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(rt2x00mac_get_tx_stats);
|
||||
|
||||
void rt2x00mac_erp_ie_changed(struct ieee80211_hw *hw, u8 changes,
|
||||
int cts_protection, int preamble)
|
||||
{
|
||||
struct rt2x00_dev *rt2x00dev = hw->priv;
|
||||
int short_preamble;
|
||||
int ack_timeout;
|
||||
int ack_consume_time;
|
||||
int difs;
|
||||
|
||||
/*
|
||||
* We only support changing preamble mode.
|
||||
*/
|
||||
if (!(changes & IEEE80211_ERP_CHANGE_PREAMBLE))
|
||||
return;
|
||||
|
||||
short_preamble = !preamble;
|
||||
preamble = !!(preamble) ? PREAMBLE : SHORT_PREAMBLE;
|
||||
|
||||
difs = (hw->conf.flags & IEEE80211_CONF_SHORT_SLOT_TIME) ?
|
||||
SHORT_DIFS : DIFS;
|
||||
ack_timeout = difs + PLCP + preamble + get_duration(ACK_SIZE, 10);
|
||||
|
||||
ack_consume_time = SIFS + PLCP + preamble + get_duration(ACK_SIZE, 10);
|
||||
|
||||
if (short_preamble)
|
||||
__set_bit(CONFIG_SHORT_PREAMBLE, &rt2x00dev->flags);
|
||||
else
|
||||
__clear_bit(CONFIG_SHORT_PREAMBLE, &rt2x00dev->flags);
|
||||
|
||||
rt2x00dev->ops->lib->config_preamble(rt2x00dev, short_preamble,
|
||||
ack_timeout, ack_consume_time);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(rt2x00mac_erp_ie_changed);
|
||||
|
||||
int rt2x00mac_conf_tx(struct ieee80211_hw *hw, int queue,
|
||||
const struct ieee80211_tx_queue_params *params)
|
||||
{
|
||||
|
Reference in New Issue
Block a user