Lines Matching +full:memcpy +full:- +full:channels

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 Copyright (C) 2004 - 2009 Ivo van Doorn <IvDoorn@gmail.com>
53 memcpy(conf.mac, mac, ETH_ALEN); 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()
133 ant->flags |= ANTENNA_TX_DIVERSITY; in rt2x00lib_config_antenna()
135 if (def->tx == ANTENNA_SW_DIVERSITY) in rt2x00lib_config_antenna()
138 config.tx = def->tx; 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()
159 memcpy(active, &config, sizeof(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()
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()
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()
209 set_bit(CONFIG_HT_DISABLED, &rt2x00dev->flags); in rt2x00lib_config()
211 clear_bit(CONFIG_HT_DISABLED, &rt2x00dev->flags); in rt2x00lib_config()
214 set_bit(CONFIG_CHANNEL_HT40, &rt2x00dev->flags); 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()
221 memcpy(&libconf.rf, in rt2x00lib_config()
222 &rt2x00dev->spec.channels[hw_value], in rt2x00lib_config()
225 memcpy(&libconf.channel, 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()