Lines Matching +full:conf +full:- +full:tx

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 Copyright (C) 2004 - 2009 Ivo van Doorn <IvDoorn@gmail.com>
24 struct rt2x00intf_conf conf; in rt2x00lib_config_intf() local
27 conf.type = type; in rt2x00lib_config_intf()
31 conf.sync = TSF_SYNC_ADHOC; in rt2x00lib_config_intf()
35 conf.sync = TSF_SYNC_AP_NONE; in rt2x00lib_config_intf()
38 conf.sync = TSF_SYNC_INFRA; in rt2x00lib_config_intf()
41 conf.sync = TSF_SYNC_NONE; in rt2x00lib_config_intf()
51 memset(conf.mac, 0, sizeof(conf.mac)); in rt2x00lib_config_intf()
53 memcpy(conf.mac, mac, ETH_ALEN); in rt2x00lib_config_intf()
55 memset(conf.bssid, 0, sizeof(conf.bssid)); in rt2x00lib_config_intf()
57 memcpy(conf.bssid, bssid, ETH_ALEN); in rt2x00lib_config_intf()
60 if (mac || (!rt2x00dev->intf_ap_count && !rt2x00dev->intf_sta_count)) in rt2x00lib_config_intf()
62 if (bssid || (!rt2x00dev->intf_ap_count && !rt2x00dev->intf_sta_count)) in rt2x00lib_config_intf()
65 rt2x00dev->ops->lib->config_intf(rt2x00dev, intf, &conf, flags); in rt2x00lib_config_intf()
79 erp.short_preamble = bss_conf->use_short_preamble; in rt2x00lib_config_erp()
80 erp.cts_protection = bss_conf->use_cts_prot; in rt2x00lib_config_erp()
82 erp.slot_time = bss_conf->use_short_slot ? SHORT_SLOT_TIME : SLOT_TIME; in rt2x00lib_config_erp()
84 erp.pifs = bss_conf->use_short_slot ? SHORT_PIFS : PIFS; in rt2x00lib_config_erp()
85 erp.difs = bss_conf->use_short_slot ? SHORT_DIFS : DIFS; in rt2x00lib_config_erp()
86 erp.eifs = bss_conf->use_short_slot ? SHORT_EIFS : EIFS; in rt2x00lib_config_erp()
88 erp.basic_rates = bss_conf->basic_rates; in rt2x00lib_config_erp()
89 erp.beacon_int = bss_conf->beacon_int; in rt2x00lib_config_erp()
92 rt2x00dev->aid = vif->cfg.assoc ? vif->cfg.aid : 0; in rt2x00lib_config_erp()
93 rt2x00dev->last_beacon = bss_conf->sync_tsf; in rt2x00lib_config_erp()
96 rt2x00dev->beacon_int = bss_conf->beacon_int; in rt2x00lib_config_erp()
99 erp.ht_opmode = bss_conf->ht_operation_mode; in rt2x00lib_config_erp()
101 rt2x00dev->ops->lib->config_erp(rt2x00dev, &erp, changed); in rt2x00lib_config_erp()
107 struct link_ant *ant = &rt2x00dev->link.ant; in rt2x00lib_config_antenna()
108 struct antenna_setup *def = &rt2x00dev->default_ant; in rt2x00lib_config_antenna()
109 struct antenna_setup *active = &rt2x00dev->link.ant.active; in rt2x00lib_config_antenna()
119 if (!(ant->flags & ANTENNA_RX_DIVERSITY)) { in rt2x00lib_config_antenna()
121 ant->flags |= ANTENNA_RX_DIVERSITY; in rt2x00lib_config_antenna()
123 if (def->rx == ANTENNA_SW_DIVERSITY) in rt2x00lib_config_antenna()
126 config.rx = def->rx; in rt2x00lib_config_antenna()
129 config.rx = active->rx; in rt2x00lib_config_antenna()
131 if (!(ant->flags & ANTENNA_TX_DIVERSITY)) { in rt2x00lib_config_antenna()
132 if (config.tx == ANTENNA_SW_DIVERSITY) { in rt2x00lib_config_antenna()
133 ant->flags |= ANTENNA_TX_DIVERSITY; in rt2x00lib_config_antenna()
135 if (def->tx == ANTENNA_SW_DIVERSITY) in rt2x00lib_config_antenna()
136 config.tx = ANTENNA_B; in rt2x00lib_config_antenna()
138 config.tx = def->tx; in rt2x00lib_config_antenna()
140 } else if (config.tx == ANTENNA_SW_DIVERSITY) in rt2x00lib_config_antenna()
141 config.tx = active->tx; in rt2x00lib_config_antenna()
147 if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags)) in rt2x00lib_config_antenna()
148 rt2x00queue_stop_queue(rt2x00dev->rx); in rt2x00lib_config_antenna()
153 * noise-sensitivity ratio for the new setup. in rt2x00lib_config_antenna()
155 rt2x00dev->ops->lib->config_ant(rt2x00dev, &config); in rt2x00lib_config_antenna()
161 if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags)) in rt2x00lib_config_antenna()
162 rt2x00queue_start_queue(rt2x00dev->rx); in rt2x00lib_config_antenna()
166 struct ieee80211_conf *conf) in rt2x00ht_center_channel() argument
168 struct hw_mode_spec *spec = &rt2x00dev->spec; in rt2x00ht_center_channel()
175 center_channel = spec->channels[conf->chandef.chan->hw_value].channel; in rt2x00ht_center_channel()
178 * Adjust center channel to HT40+ and HT40- operation. in rt2x00ht_center_channel()
180 if (conf_is_ht40_plus(conf)) in rt2x00ht_center_channel()
182 else if (conf_is_ht40_minus(conf)) in rt2x00ht_center_channel()
183 center_channel -= (center_channel == 14) ? 1 : 2; in rt2x00ht_center_channel()
185 for (i = 0; i < spec->num_channels; i++) in rt2x00ht_center_channel()
186 if (spec->channels[i].channel == center_channel) in rt2x00ht_center_channel()
190 return conf->chandef.chan->hw_value; in rt2x00ht_center_channel()
194 struct ieee80211_conf *conf, in rt2x00lib_config() argument
205 libconf.conf = conf; in rt2x00lib_config()
208 if (!conf_is_ht(conf)) in rt2x00lib_config()
209 set_bit(CONFIG_HT_DISABLED, &rt2x00dev->flags); in rt2x00lib_config()
211 clear_bit(CONFIG_HT_DISABLED, &rt2x00dev->flags); in rt2x00lib_config()
213 if (conf_is_ht40(conf)) { in rt2x00lib_config()
214 set_bit(CONFIG_CHANNEL_HT40, &rt2x00dev->flags); in rt2x00lib_config()
215 hw_value = rt2x00ht_center_channel(rt2x00dev, conf); in rt2x00lib_config()
217 clear_bit(CONFIG_CHANNEL_HT40, &rt2x00dev->flags); in rt2x00lib_config()
218 hw_value = conf->chandef.chan->hw_value; in rt2x00lib_config()
222 &rt2x00dev->spec.channels[hw_value], in rt2x00lib_config()
226 &rt2x00dev->spec.channels_info[hw_value], in rt2x00lib_config()
230 rt2x00dev->rf_channel = libconf.rf.channel; in rt2x00lib_config()
235 cancel_delayed_work_sync(&rt2x00dev->autowakeup_work); in rt2x00lib_config()
240 rt2x00dev->ops->lib->config(rt2x00dev, &libconf, ieee80211_flags); in rt2x00lib_config()
242 if (conf->flags & IEEE80211_CONF_PS) in rt2x00lib_config()
243 set_bit(CONFIG_POWERSAVING, &rt2x00dev->flags); in rt2x00lib_config()
245 clear_bit(CONFIG_POWERSAVING, &rt2x00dev->flags); in rt2x00lib_config()
247 if (conf->flags & IEEE80211_CONF_MONITOR) in rt2x00lib_config()
248 set_bit(CONFIG_MONITORING, &rt2x00dev->flags); in rt2x00lib_config()
250 clear_bit(CONFIG_MONITORING, &rt2x00dev->flags); in rt2x00lib_config()
252 rt2x00dev->curr_band = conf->chandef.chan->band; in rt2x00lib_config()
253 rt2x00dev->curr_freq = conf->chandef.chan->center_freq; in rt2x00lib_config()
254 rt2x00dev->tx_power = conf->power_level; in rt2x00lib_config()
255 rt2x00dev->short_retry = conf->short_frame_max_tx_count; in rt2x00lib_config()
256 rt2x00dev->long_retry = conf->long_frame_max_tx_count; in rt2x00lib_config()
265 if (test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags) && in rt2x00lib_config()
268 (conf->flags & IEEE80211_CONF_PS)) { in rt2x00lib_config()
269 beacon_diff = (long)jiffies - (long)rt2x00dev->last_beacon; in rt2x00lib_config()
270 beacon_int = msecs_to_jiffies(rt2x00dev->beacon_int); in rt2x00lib_config()
275 autowake_timeout = (conf->ps_dtim_period * beacon_int) - beacon_diff; in rt2x00lib_config()
276 queue_delayed_work(rt2x00dev->workqueue, in rt2x00lib_config()
277 &rt2x00dev->autowakeup_work, in rt2x00lib_config()
278 autowake_timeout - 15); in rt2x00lib_config()