summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00config.c
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2008-03-09 22:46:18 +0100
committerJohn W. Linville <linville@tuxdriver.com>2008-03-13 16:02:36 -0400
commit728103794316f7ff8d98bc2ce044aff7a260ee21 (patch)
tree2addb2b483f2a74e30314c486abeb7ab86521ecb /drivers/net/wireless/rt2x00/rt2x00config.c
parente4030a2f40a9575bccc71c3e156ca78c7d6fded6 (diff)
downloadop-kernel-dev-728103794316f7ff8d98bc2ce044aff7a260ee21.zip
op-kernel-dev-728103794316f7ff8d98bc2ce044aff7a260ee21.tar.gz
rt2x00: Rename config_preamble() to config_erp()
Rename config_preamble() to config_erp() and cleanup argument list by putting it all into a single structure. This will make the function more meaningful and easier to expand later. This second option is mostly intended to make the patch "mac80211: proper short-slot handling" from Johannes Berg easier to apply for rt2x00. 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/rt2x00config.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00config.c43
1 files changed, 20 insertions, 23 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00config.c b/drivers/net/wireless/rt2x00/rt2x00config.c
index 6995912..7211169 100644
--- a/drivers/net/wireless/rt2x00/rt2x00config.c
+++ b/drivers/net/wireless/rt2x00/rt2x00config.c
@@ -75,43 +75,40 @@ void rt2x00lib_config_intf(struct rt2x00_dev *rt2x00dev,
rt2x00dev->ops->lib->config_intf(rt2x00dev, intf, &conf, flags);
}
-void rt2x00lib_config_preamble(struct rt2x00_dev *rt2x00dev,
- struct rt2x00_intf *intf,
- const unsigned int short_preamble)
+void rt2x00lib_config_erp(struct rt2x00_dev *rt2x00dev,
+ struct rt2x00_intf *intf,
+ struct ieee80211_bss_conf *bss_conf)
{
+ struct rt2x00lib_erp erp;
int retval;
- int ack_timeout;
- int ack_consume_time;
- ack_timeout = PLCP + get_duration(ACK_SIZE, 10);
- ack_consume_time = SIFS + PLCP + get_duration(ACK_SIZE, 10);
+ memset(&erp, 0, sizeof(erp));
+
+ erp.short_preamble = bss_conf->use_short_preamble;
+ erp.ack_timeout = PLCP + get_duration(ACK_SIZE, 10);
+ erp.ack_consume_time = SIFS + PLCP + get_duration(ACK_SIZE, 10);
if (rt2x00dev->hw->conf.flags & IEEE80211_CONF_SHORT_SLOT_TIME)
- ack_timeout += SHORT_DIFS;
+ erp.ack_timeout += SHORT_DIFS;
else
- ack_timeout += DIFS;
+ erp.ack_timeout += DIFS;
- if (short_preamble) {
- ack_timeout += SHORT_PREAMBLE;
- ack_consume_time += SHORT_PREAMBLE;
+ if (bss_conf->use_short_preamble) {
+ erp.ack_timeout += SHORT_PREAMBLE;
+ erp.ack_consume_time += SHORT_PREAMBLE;
} else {
- ack_timeout += PREAMBLE;
- ack_consume_time += PREAMBLE;
+ erp.ack_timeout += PREAMBLE;
+ erp.ack_consume_time += PREAMBLE;
}
- retval = rt2x00dev->ops->lib->config_preamble(rt2x00dev,
- short_preamble,
- ack_timeout,
- ack_consume_time);
-
- spin_lock(&intf->lock);
+ retval = rt2x00dev->ops->lib->config_erp(rt2x00dev, &erp);
if (retval) {
- intf->delayed_flags |= DELAYED_CONFIG_PREAMBLE;
+ spin_lock(&intf->lock);
+ intf->delayed_flags |= DELAYED_CONFIG_ERP;
queue_work(rt2x00dev->hw->workqueue, &rt2x00dev->intf_work);
+ spin_unlock(&intf->lock);
}
-
- spin_unlock(&intf->lock);
}
void rt2x00lib_config_antenna(struct rt2x00_dev *rt2x00dev,
OpenPOWER on IntegriCloud