aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00config.c
diff options
context:
space:
mode:
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 69959124d25d..72111694154e 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,
75 rt2x00dev->ops->lib->config_intf(rt2x00dev, intf, &conf, flags); 75 rt2x00dev->ops->lib->config_intf(rt2x00dev, intf, &conf, flags);
76} 76}
77 77
78void rt2x00lib_config_preamble(struct rt2x00_dev *rt2x00dev, 78void rt2x00lib_config_erp(struct rt2x00_dev *rt2x00dev,
79 struct rt2x00_intf *intf, 79 struct rt2x00_intf *intf,
80 const unsigned int short_preamble) 80 struct ieee80211_bss_conf *bss_conf)
81{ 81{
82 struct rt2x00lib_erp erp;
82 int retval; 83 int retval;
83 int ack_timeout;
84 int ack_consume_time;
85 84
86 ack_timeout = PLCP + get_duration(ACK_SIZE, 10); 85 memset(&erp, 0, sizeof(erp));
87 ack_consume_time = SIFS + PLCP + get_duration(ACK_SIZE, 10); 86
87 erp.short_preamble = bss_conf->use_short_preamble;
88 erp.ack_timeout = PLCP + get_duration(ACK_SIZE, 10);
89 erp.ack_consume_time = SIFS + PLCP + get_duration(ACK_SIZE, 10);
88 90
89 if (rt2x00dev->hw->conf.flags & IEEE80211_CONF_SHORT_SLOT_TIME) 91 if (rt2x00dev->hw->conf.flags & IEEE80211_CONF_SHORT_SLOT_TIME)
90 ack_timeout += SHORT_DIFS; 92 erp.ack_timeout += SHORT_DIFS;
91 else 93 else
92 ack_timeout += DIFS; 94 erp.ack_timeout += DIFS;
93 95
94 if (short_preamble) { 96 if (bss_conf->use_short_preamble) {
95 ack_timeout += SHORT_PREAMBLE; 97 erp.ack_timeout += SHORT_PREAMBLE;
96 ack_consume_time += SHORT_PREAMBLE; 98 erp.ack_consume_time += SHORT_PREAMBLE;
97 } else { 99 } else {
98 ack_timeout += PREAMBLE; 100 erp.ack_timeout += PREAMBLE;
99 ack_consume_time += PREAMBLE; 101 erp.ack_consume_time += PREAMBLE;
100 } 102 }
101 103
102 retval = rt2x00dev->ops->lib->config_preamble(rt2x00dev, 104 retval = rt2x00dev->ops->lib->config_erp(rt2x00dev, &erp);
103 short_preamble,
104 ack_timeout,
105 ack_consume_time);
106
107 spin_lock(&intf->lock);
108 105
109 if (retval) { 106 if (retval) {
110 intf->delayed_flags |= DELAYED_CONFIG_PREAMBLE; 107 spin_lock(&intf->lock);
108 intf->delayed_flags |= DELAYED_CONFIG_ERP;
111 queue_work(rt2x00dev->hw->workqueue, &rt2x00dev->intf_work); 109 queue_work(rt2x00dev->hw->workqueue, &rt2x00dev->intf_work);
110 spin_unlock(&intf->lock);
112 } 111 }
113
114 spin_unlock(&intf->lock);
115} 112}
116 113
117void rt2x00lib_config_antenna(struct rt2x00_dev *rt2x00dev, 114void rt2x00lib_config_antenna(struct rt2x00_dev *rt2x00dev,