Lines Matching refs:ctx

19 				   struct iwl_rxon_context *ctx)
21 memset(&ctx->staging, 0, sizeof(ctx->staging));
23 if (!ctx->vif) {
24 ctx->staging.dev_type = ctx->unused_devtype;
26 switch (ctx->vif->type) {
28 ctx->staging.dev_type = ctx->ap_devtype;
32 ctx->staging.dev_type = ctx->station_devtype;
33 ctx->staging.filter_flags = RXON_FILTER_ACCEPT_GRP_MSK;
37 ctx->staging.dev_type = ctx->ibss_devtype;
38 ctx->staging.flags = RXON_FLG_SHORT_PREAMBLE_MSK;
39 ctx->staging.filter_flags = RXON_FILTER_BCON_AWARE_MSK |
44 ctx->staging.dev_type = RXON_DEV_TYPE_SNIFFER;
49 ctx->vif->type);
57 ctx->staging.flags &= ~RXON_FLG_SHORT_PREAMBLE_MSK;
59 ctx->staging.flags |= RXON_FLG_SHORT_PREAMBLE_MSK;
62 ctx->staging.channel =
66 iwl_set_flags_for_band(priv, ctx, priv->band, ctx->vif);
69 ctx->staging.flags &= ~(RXON_FLG_CHANNEL_MODE_MIXED |
71 if (ctx->vif)
72 memcpy(ctx->staging.node_addr, ctx->vif->addr, ETH_ALEN);
74 ctx->staging.ofdm_ht_single_stream_basic_rates = 0xff;
75 ctx->staging.ofdm_ht_dual_stream_basic_rates = 0xff;
76 ctx->staging.ofdm_ht_triple_stream_basic_rates = 0xff;
80 struct iwl_rxon_context *ctx,
87 ret = iwl_dvm_send_cmd_pdu(priv, ctx->rxon_cmd,
100 struct iwl_rxon_context *ctx,
117 ret = iwl_dvm_send_cmd_pdu(priv, ctx->rxon_cmd,
137 struct iwl_rxon_context *ctx,
144 ret = iwl_dvm_send_cmd_pdu(priv, ctx->rxon_cmd, 0,
153 struct iwl_rxon_context *ctx)
157 if (!ctx->is_active)
160 ctx->qos_data.def_qos_parm.qos_flags = 0;
162 if (ctx->qos_data.qos_active)
163 ctx->qos_data.def_qos_parm.qos_flags |=
166 if (ctx->ht.enabled)
167 ctx->qos_data.def_qos_parm.qos_flags |= QOS_PARAM_FLG_TGN_MSK;
170 ctx->qos_data.qos_active,
171 ctx->qos_data.def_qos_parm.qos_flags);
173 ret = iwl_dvm_send_cmd_pdu(priv, ctx->qos_cmd, 0,
175 &ctx->qos_data.def_qos_parm);
193 struct iwl_rxon_context *ctx)
197 const struct iwl_rxon_cmd *rxon1 = &ctx->staging;
198 const struct iwl_rxon_cmd *rxon2 = &ctx->active;
216 rxon_assoc.flags = ctx->staging.flags;
217 rxon_assoc.filter_flags = ctx->staging.filter_flags;
218 rxon_assoc.ofdm_basic_rates = ctx->staging.ofdm_basic_rates;
219 rxon_assoc.cck_basic_rates = ctx->staging.cck_basic_rates;
224 ctx->staging.ofdm_ht_single_stream_basic_rates;
226 ctx->staging.ofdm_ht_dual_stream_basic_rates;
227 rxon_assoc.rx_chain_select_flags = ctx->staging.rx_chain;
229 ctx->staging.ofdm_ht_triple_stream_basic_rates;
230 rxon_assoc.acquisition_data = ctx->staging.acquisition_data;
232 ret = iwl_dvm_send_cmd_pdu(priv, ctx->rxon_assoc_cmd,
273 struct iwl_rxon_context *ctx)
279 struct ieee80211_vif *vif = ctx->vif;
285 memset(&ctx->timing, 0, sizeof(struct iwl_rxon_time_cmd));
287 ctx->timing.timestamp = cpu_to_le64(priv->timestamp);
288 ctx->timing.listen_interval = cpu_to_le16(conf->listen_interval);
296 ctx->timing.atim_window = 0;
298 if (ctx->ctxid == IWL_RXON_CTX_PAN &&
299 (!ctx->vif || ctx->vif->type != NL80211_IFTYPE_STATION) &&
303 ctx->timing.beacon_interval =
305 beacon_int = le16_to_cpu(ctx->timing.beacon_interval);
306 } else if (ctx->ctxid == IWL_RXON_CTX_BSS &&
310 (!iwl_is_associated_ctx(ctx) || !ctx->vif ||
311 !ctx->vif->bss_conf.beacon_int)) {
312 ctx->timing.beacon_interval =
314 beacon_int = le16_to_cpu(ctx->timing.beacon_interval);
318 ctx->timing.beacon_interval = cpu_to_le16(beacon_int);
321 ctx->beacon_int = beacon_int;
326 ctx->timing.beacon_init_val = cpu_to_le32(interval_tm - rem);
328 ctx->timing.dtim_period = vif ? (vif->bss_conf.dtim_period ?: 1) : 1;
332 le16_to_cpu(ctx->timing.beacon_interval),
333 le32_to_cpu(ctx->timing.beacon_init_val),
334 le16_to_cpu(ctx->timing.atim_window));
336 return iwl_dvm_send_cmd_pdu(priv, ctx->rxon_timing_cmd,
337 0, sizeof(ctx->timing), &ctx->timing);
341 struct iwl_rxon_context *ctx)
344 struct iwl_rxon_cmd *active = (void *)&ctx->active;
346 if (ctx->ctxid == IWL_RXON_CTX_BSS) {
347 ret = iwlagn_disable_bss(priv, ctx, &ctx->staging);
349 ret = iwlagn_disable_pan(priv, ctx, &ctx->staging);
352 if (ctx->vif) {
353 ret = iwl_send_rxon_timing(priv, ctx);
358 ret = iwlagn_disconn_pan(priv, ctx, &ctx->staging);
368 iwl_clear_ucode_stations(priv, ctx);
370 iwl_update_bcast_station(priv, ctx);
371 iwl_restore_stations(priv, ctx);
372 ret = iwl_restore_default_wep_keys(priv, ctx);
378 memcpy(active, &ctx->staging, sizeof(*active));
387 struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS];
421 memcmp(&ctx->active, &ctx->staging, sizeof(ctx->staging));
441 struct iwl_rxon_context *ctx)
444 struct iwl_rxon_cmd *active = (void *)&ctx->active;
447 if (ctx->ctxid == IWL_RXON_CTX_BSS) {
448 ret = iwl_send_rxon_timing(priv, ctx);
455 iwlagn_update_qos(priv, ctx);
462 if (ctx->vif && (ctx->vif->type == NL80211_IFTYPE_AP)) {
463 ret = iwlagn_update_beacon(priv, ctx->vif);
479 ret = iwl_dvm_send_cmd_pdu(priv, ctx->rxon_cmd, 0,
480 sizeof(struct iwl_rxon_cmd), &ctx->staging);
485 memcpy(active, &ctx->staging, sizeof(*active));
488 if (ctx->vif && (ctx->vif->type == NL80211_IFTYPE_ADHOC))
489 if (iwlagn_update_beacon(priv, ctx->vif))
599 struct iwl_rxon_context *ctx)
601 struct iwl_rxon_cmd *rxon = &ctx->staging;
603 if (!ctx->ht.enabled) {
614 rxon->flags |= cpu_to_le32(ctx->ht.protection <<
622 if (iwl_is_ht40_tx_allowed(priv, ctx, NULL)) {
624 if (ctx->ht.protection ==
631 switch (ctx->ht.extension_chan_offset) {
646 switch (ctx->ht.extension_chan_offset) {
671 iwlagn_set_rxon_chain(priv, ctx);
675 le32_to_cpu(rxon->flags), ctx->ht.protection,
676 ctx->ht.extension_chan_offset);
681 struct iwl_rxon_context *ctx;
683 for_each_context(priv, ctx)
684 _iwl_set_rxon_ht(priv, ht_conf, ctx);
695 struct iwl_rxon_context *ctx)
700 if ((le16_to_cpu(ctx->staging.channel) == channel) &&
704 ctx->staging.channel = cpu_to_le16(channel);
706 ctx->staging.flags &= ~RXON_FLG_BAND_24G_MSK;
708 ctx->staging.flags |= RXON_FLG_BAND_24G_MSK;
717 struct iwl_rxon_context *ctx,
722 ctx->staging.flags &=
725 ctx->staging.flags |= RXON_FLG_SHORT_SLOT_MSK;
729 ctx->staging.flags |= RXON_FLG_SHORT_SLOT_MSK;
731 ctx->staging.flags &= ~RXON_FLG_SHORT_SLOT_MSK;
733 ctx->staging.flags |= RXON_FLG_BAND_24G_MSK;
734 ctx->staging.flags |= RXON_FLG_AUTO_DETECT_MSK;
735 ctx->staging.flags &= ~RXON_FLG_CCK_MSK;
740 struct iwl_rxon_context *ctx, int hw_decrypt)
742 struct iwl_rxon_cmd *rxon = &ctx->staging;
753 struct iwl_rxon_context *ctx)
755 struct iwl_rxon_cmd *rxon = &ctx->staging;
833 struct iwl_rxon_context *ctx)
835 const struct iwl_rxon_cmd *staging = &ctx->staging;
836 const struct iwl_rxon_cmd *active = &ctx->active;
853 CHK(!iwl_is_associated_ctx(ctx));
891 struct iwl_rxon_context *ctx = &priv->contexts[ctxid];
892 struct iwl_rxon_cmd *rxon = &ctx->staging;
915 struct iwl_rxon_context *ctx)
922 if (ctx->vif) {
924 unsigned long basic = ctx->vif->bss_conf.basic_rates;
1001 ctx->staging.cck_basic_rates = cck;
1002 ctx->staging.ofdm_basic_rates = ofdm;
1023 int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
1026 struct iwl_rxon_cmd *active = (void *)&ctx->active;
1027 bool new_assoc = !!(ctx->staging.filter_flags & RXON_FILTER_ASSOC_MSK);
1038 if (!ctx->is_active)
1042 ctx->staging.flags |= RXON_FLG_TSF2HOST_MSK;
1045 iwl_calc_basic_rates(priv, ctx);
1052 ctx->staging.flags |= RXON_FLG_SELF_CTS_EN;
1054 if ((ctx->vif && ctx->vif->bss_conf.use_short_slot) ||
1055 !(ctx->staging.flags & RXON_FLG_BAND_24G_MSK))
1056 ctx->staging.flags |= RXON_FLG_SHORT_SLOT_MSK;
1058 ctx->staging.flags &= ~RXON_FLG_SHORT_SLOT_MSK;
1060 iwl_print_rx_config_cmd(priv, ctx->ctxid);
1061 ret = iwl_check_rxon_cmd(priv, ctx);
1072 (priv->switch_channel != ctx->staging.channel)) {
1083 if (!iwl_full_rxon_required(priv, ctx)) {
1084 ret = iwlagn_send_rxon_assoc(priv, ctx);
1090 memcpy(active, &ctx->staging, sizeof(*active));
1103 iwl_set_rxon_hwcrypto(priv, ctx, !iwlwifi_mod_params.swcrypto);
1111 le16_to_cpu(ctx->staging.channel),
1112 ctx->staging.bssid_addr);
1120 ret = iwlagn_rxon_disconn(priv, ctx);
1129 return iwlagn_rxon_connect(priv, ctx);
1135 struct iwl_rxon_context *ctx)
1138 ctx->ht.extension_chan_offset =
1140 ctx->ht.is_40mhz = true;
1142 ctx->ht.extension_chan_offset =
1144 ctx->ht.is_40mhz = true;
1146 ctx->ht.extension_chan_offset =
1148 ctx->ht.is_40mhz = false;
1155 struct iwl_rxon_context *ctx;
1186 for_each_context(priv, ctx)
1187 iwlagn_set_rxon_chain(priv, ctx);
1191 for_each_context(priv, ctx) {
1193 if (ctx->ht.enabled != conf_is_ht(conf))
1194 ctx->ht.enabled = conf_is_ht(conf);
1196 if (ctx->ht.enabled) {
1199 if (!ctx->ht.is_40mhz ||
1200 !iwl_is_associated_ctx(ctx))
1201 iwlagn_config_ht40(conf, ctx);
1203 ctx->ht.is_40mhz = false;
1209 ctx->ht.protection = IEEE80211_HT_OP_MODE_PROTECTION_NONE;
1214 if (le16_to_cpu(ctx->staging.channel) !=
1216 ctx->staging.flags = 0;
1218 iwl_set_rxon_channel(priv, channel, ctx);
1221 iwl_set_flags_for_band(priv, ctx, channel->band,
1222 ctx->vif);
1242 for_each_context(priv, ctx) {
1243 if (!memcmp(&ctx->staging, &ctx->active, sizeof(ctx->staging)))
1245 iwlagn_commit_rxon(priv, ctx);
1255 struct iwl_rxon_context *ctx,
1258 struct ieee80211_vif *vif = ctx->vif;
1331 ctx->ht_need_multiple_chains = need_multiple;
1389 struct iwl_rxon_context *ctx = iwl_rxon_ctx_from_vif(vif);
1409 if (unlikely(!ctx->vif)) {
1419 ctx->qos_data.qos_active = bss_conf->qos;
1420 iwlagn_update_qos(priv, ctx);
1423 ctx->staging.assoc_id = cpu_to_le16(vif->cfg.aid);
1425 ctx->staging.flags |= RXON_FLG_SHORT_PREAMBLE_MSK;
1427 ctx->staging.flags &= ~RXON_FLG_SHORT_PREAMBLE_MSK;
1432 ctx->staging.filter_flags |= RXON_FILTER_ASSOC_MSK;
1434 ctx->staging.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
1436 if (ctx->ctxid == IWL_RXON_CTX_BSS)
1443 if (ctx->ht.enabled) {
1444 ctx->ht.protection = bss_conf->ht_operation_mode &
1446 ctx->ht.non_gf_sta_present = !!(bss_conf->ht_operation_mode &
1448 iwlagn_check_needed_chains(priv, ctx, bss_conf);
1452 iwlagn_set_rxon_chain(priv, ctx);
1455 ctx->staging.flags |= RXON_FLG_TGG_PROTECT_MSK;
1457 ctx->staging.flags &= ~RXON_FLG_TGG_PROTECT_MSK;
1460 ctx->staging.flags |= RXON_FLG_SELF_CTS_EN;
1462 ctx->staging.flags &= ~RXON_FLG_SELF_CTS_EN;
1464 memcpy(ctx->staging.bssid_addr, bss_conf->bssid, ETH_ALEN);
1469 ctx->staging.filter_flags |= RXON_FILTER_ASSOC_MSK;
1470 priv->beacon_ctx = ctx;
1472 ctx->staging.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
1487 ctx->staging.filter_flags |= RXON_FILTER_BCON_AWARE_MSK;
1489 ctx->staging.filter_flags &=
1493 if (force || memcmp(&ctx->staging, &ctx->active, sizeof(ctx->staging)))
1494 iwlagn_commit_rxon(priv, ctx);
1519 if (changes & BSS_CHANGED_BEACON && priv->beacon_ctx == ctx) {
1529 struct iwl_rxon_context *ctx;
1542 for_each_context(priv, ctx)
1543 if (memcmp(&ctx->staging, &ctx->active, sizeof(ctx->staging)))
1544 iwlagn_commit_rxon(priv, ctx);