iwl-agn-rxon.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2003 - 2010 Intel Corporation. All rights reserved.
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms of version 2 of the GNU General Public License as
  7. * published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  12. * more details.
  13. *
  14. * You should have received a copy of the GNU General Public License along with
  15. * this program; if not, write to the Free Software Foundation, Inc.,
  16. * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
  17. *
  18. * The full GNU General Public License is included in this distribution in the
  19. * file called LICENSE.
  20. *
  21. * Contact Information:
  22. * Intel Linux Wireless <ilw@linux.intel.com>
  23. * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
  24. *
  25. *****************************************************************************/
  26. #include "iwl-dev.h"
  27. #include "iwl-agn.h"
  28. #include "iwl-sta.h"
  29. #include "iwl-core.h"
  30. #include "iwl-agn-calib.h"
  31. static int iwlagn_disable_bss(struct iwl_priv *priv,
  32. struct iwl_rxon_context *ctx,
  33. struct iwl_rxon_cmd *send)
  34. {
  35. __le32 old_filter = send->filter_flags;
  36. int ret;
  37. send->filter_flags &= ~RXON_FILTER_ASSOC_MSK;
  38. ret = iwl_send_cmd_pdu(priv, ctx->rxon_cmd, sizeof(*send), send);
  39. send->filter_flags = old_filter;
  40. if (ret)
  41. IWL_ERR(priv, "Error clearing ASSOC_MSK on BSS (%d)\n", ret);
  42. return ret;
  43. }
  44. static int iwlagn_disable_pan(struct iwl_priv *priv,
  45. struct iwl_rxon_context *ctx,
  46. struct iwl_rxon_cmd *send)
  47. {
  48. __le32 old_filter = send->filter_flags;
  49. u8 old_dev_type = send->dev_type;
  50. int ret;
  51. send->filter_flags &= ~RXON_FILTER_ASSOC_MSK;
  52. send->dev_type = RXON_DEV_TYPE_P2P;
  53. ret = iwl_send_cmd_pdu(priv, ctx->rxon_cmd, sizeof(*send), send);
  54. send->filter_flags = old_filter;
  55. send->dev_type = old_dev_type;
  56. if (ret)
  57. IWL_ERR(priv, "Error disabling PAN (%d)\n", ret);
  58. /* FIXME: WAIT FOR PAN DISABLE */
  59. msleep(300);
  60. return ret;
  61. }
  62. static int iwlagn_update_beacon(struct iwl_priv *priv,
  63. struct ieee80211_vif *vif)
  64. {
  65. lockdep_assert_held(&priv->mutex);
  66. dev_kfree_skb(priv->beacon_skb);
  67. priv->beacon_skb = ieee80211_beacon_get(priv->hw, vif);
  68. if (!priv->beacon_skb)
  69. return -ENOMEM;
  70. return iwlagn_send_beacon_cmd(priv);
  71. }
  72. /**
  73. * iwlagn_commit_rxon - commit staging_rxon to hardware
  74. *
  75. * The RXON command in staging_rxon is committed to the hardware and
  76. * the active_rxon structure is updated with the new data. This
  77. * function correctly transitions out of the RXON_ASSOC_MSK state if
  78. * a HW tune is required based on the RXON structure changes.
  79. */
  80. int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
  81. {
  82. /* cast away the const for active_rxon in this function */
  83. struct iwl_rxon_cmd *active = (void *)&ctx->active;
  84. bool new_assoc = !!(ctx->staging.filter_flags & RXON_FILTER_ASSOC_MSK);
  85. int ret;
  86. lockdep_assert_held(&priv->mutex);
  87. if (!iwl_is_alive(priv))
  88. return -EBUSY;
  89. /* This function hardcodes a bunch of dual-mode assumptions */
  90. BUILD_BUG_ON(NUM_IWL_RXON_CTX != 2);
  91. if (!ctx->is_active)
  92. return 0;
  93. /* always get timestamp with Rx frame */
  94. ctx->staging.flags |= RXON_FLG_TSF2HOST_MSK;
  95. if ((ctx->vif && ctx->vif->bss_conf.use_short_slot) ||
  96. !(ctx->staging.flags & RXON_FLG_BAND_24G_MSK))
  97. ctx->staging.flags |= RXON_FLG_SHORT_SLOT_MSK;
  98. else
  99. ctx->staging.flags &= ~RXON_FLG_SHORT_SLOT_MSK;
  100. ret = iwl_check_rxon_cmd(priv, ctx);
  101. if (ret) {
  102. IWL_ERR(priv, "Invalid RXON configuration. Not committing.\n");
  103. return -EINVAL;
  104. }
  105. /*
  106. * receive commit_rxon request
  107. * abort any previous channel switch if still in process
  108. */
  109. if (priv->switch_rxon.switch_in_progress &&
  110. (priv->switch_rxon.channel != ctx->staging.channel)) {
  111. IWL_DEBUG_11H(priv, "abort channel switch on %d\n",
  112. le16_to_cpu(priv->switch_rxon.channel));
  113. iwl_chswitch_done(priv, false);
  114. }
  115. /*
  116. * If we don't need to send a full RXON, we can use
  117. * iwl_rxon_assoc_cmd which is used to reconfigure filter
  118. * and other flags for the current radio configuration.
  119. */
  120. if (!iwl_full_rxon_required(priv, ctx)) {
  121. ret = iwl_send_rxon_assoc(priv, ctx);
  122. if (ret) {
  123. IWL_ERR(priv, "Error setting RXON_ASSOC (%d)\n", ret);
  124. return ret;
  125. }
  126. memcpy(active, &ctx->staging, sizeof(*active));
  127. iwl_print_rx_config_cmd(priv, ctx);
  128. return 0;
  129. }
  130. if (priv->cfg->ops->hcmd->set_pan_params) {
  131. ret = priv->cfg->ops->hcmd->set_pan_params(priv);
  132. if (ret)
  133. return ret;
  134. }
  135. iwl_set_rxon_hwcrypto(priv, ctx, !priv->cfg->mod_params->sw_crypto);
  136. IWL_DEBUG_INFO(priv,
  137. "Going to commit RXON\n"
  138. " * with%s RXON_FILTER_ASSOC_MSK\n"
  139. " * channel = %d\n"
  140. " * bssid = %pM\n",
  141. (new_assoc ? "" : "out"),
  142. le16_to_cpu(ctx->staging.channel),
  143. ctx->staging.bssid_addr);
  144. /*
  145. * Always clear associated first, but with the correct config.
  146. * This is required as for example station addition for the
  147. * AP station must be done after the BSSID is set to correctly
  148. * set up filters in the device.
  149. */
  150. if (ctx->ctxid == IWL_RXON_CTX_BSS)
  151. ret = iwlagn_disable_bss(priv, ctx, &ctx->staging);
  152. else
  153. ret = iwlagn_disable_pan(priv, ctx, &ctx->staging);
  154. if (ret)
  155. return ret;
  156. memcpy(active, &ctx->staging, sizeof(*active));
  157. /*
  158. * Un-assoc RXON clears the station table and WEP
  159. * keys, so we have to restore those afterwards.
  160. */
  161. iwl_clear_ucode_stations(priv, ctx);
  162. iwl_restore_stations(priv, ctx);
  163. ret = iwl_restore_default_wep_keys(priv, ctx);
  164. if (ret) {
  165. IWL_ERR(priv, "Failed to restore WEP keys (%d)\n", ret);
  166. return ret;
  167. }
  168. /* RXON timing must be before associated RXON */
  169. ret = iwl_send_rxon_timing(priv, ctx);
  170. if (ret) {
  171. IWL_ERR(priv, "Failed to send timing (%d)!\n", ret);
  172. return ret;
  173. }
  174. if (new_assoc) {
  175. /*
  176. * We'll run into this code path when beaconing is
  177. * enabled, but then we also need to send the beacon
  178. * to the device.
  179. */
  180. if (ctx->vif && (ctx->vif->type == NL80211_IFTYPE_AP)) {
  181. ret = iwlagn_update_beacon(priv, ctx->vif);
  182. if (ret) {
  183. IWL_ERR(priv,
  184. "Error sending required beacon (%d)!\n",
  185. ret);
  186. return ret;
  187. }
  188. }
  189. priv->start_calib = 0;
  190. /*
  191. * Apply the new configuration.
  192. *
  193. * Associated RXON doesn't clear the station table in uCode,
  194. * so we don't need to restore stations etc. after this.
  195. */
  196. ret = iwl_send_cmd_pdu(priv, ctx->rxon_cmd,
  197. sizeof(struct iwl_rxon_cmd), &ctx->staging);
  198. if (ret) {
  199. IWL_ERR(priv, "Error setting new RXON (%d)\n", ret);
  200. return ret;
  201. }
  202. memcpy(active, &ctx->staging, sizeof(*active));
  203. /* IBSS beacon needs to be sent after setting assoc */
  204. if (ctx->vif && (ctx->vif->type == NL80211_IFTYPE_ADHOC))
  205. if (iwlagn_update_beacon(priv, ctx->vif))
  206. IWL_ERR(priv, "Error sending IBSS beacon\n");
  207. }
  208. iwl_print_rx_config_cmd(priv, ctx);
  209. iwl_init_sensitivity(priv);
  210. /*
  211. * If we issue a new RXON command which required a tune then we must
  212. * send a new TXPOWER command or we won't be able to Tx any frames.
  213. *
  214. * FIXME: which RXON requires a tune? Can we optimise this out in
  215. * some cases?
  216. */
  217. ret = iwl_set_tx_power(priv, priv->tx_power_user_lmt, true);
  218. if (ret) {
  219. IWL_ERR(priv, "Error sending TX power (%d)\n", ret);
  220. return ret;
  221. }
  222. return 0;
  223. }
  224. static void iwlagn_update_qos(struct iwl_priv *priv,
  225. struct iwl_rxon_context *ctx)
  226. {
  227. int ret;
  228. if (!ctx->is_active)
  229. return;
  230. ctx->qos_data.def_qos_parm.qos_flags = 0;
  231. if (ctx->qos_data.qos_active)
  232. ctx->qos_data.def_qos_parm.qos_flags |=
  233. QOS_PARAM_FLG_UPDATE_EDCA_MSK;
  234. if (ctx->ht.enabled)
  235. ctx->qos_data.def_qos_parm.qos_flags |= QOS_PARAM_FLG_TGN_MSK;
  236. IWL_DEBUG_QOS(priv, "send QoS cmd with Qos active=%d FLAGS=0x%X\n",
  237. ctx->qos_data.qos_active,
  238. ctx->qos_data.def_qos_parm.qos_flags);
  239. ret = iwl_send_cmd_pdu(priv, ctx->qos_cmd,
  240. sizeof(struct iwl_qosparam_cmd),
  241. &ctx->qos_data.def_qos_parm);
  242. if (ret)
  243. IWL_ERR(priv, "Failed to update QoS\n");
  244. }
  245. int iwlagn_mac_config(struct ieee80211_hw *hw, u32 changed)
  246. {
  247. struct iwl_priv *priv = hw->priv;
  248. struct iwl_rxon_context *ctx;
  249. struct ieee80211_conf *conf = &hw->conf;
  250. struct ieee80211_channel *channel = conf->channel;
  251. const struct iwl_channel_info *ch_info;
  252. int ret = 0;
  253. bool ht_changed[NUM_IWL_RXON_CTX] = {};
  254. IWL_DEBUG_MAC80211(priv, "changed %#x", changed);
  255. mutex_lock(&priv->mutex);
  256. if (unlikely(test_bit(STATUS_SCANNING, &priv->status))) {
  257. IWL_DEBUG_MAC80211(priv, "leave - scanning\n");
  258. goto out;
  259. }
  260. if (!iwl_is_ready(priv)) {
  261. IWL_DEBUG_MAC80211(priv, "leave - not ready\n");
  262. goto out;
  263. }
  264. if (changed & (IEEE80211_CONF_CHANGE_SMPS |
  265. IEEE80211_CONF_CHANGE_CHANNEL)) {
  266. /* mac80211 uses static for non-HT which is what we want */
  267. priv->current_ht_config.smps = conf->smps_mode;
  268. /*
  269. * Recalculate chain counts.
  270. *
  271. * If monitor mode is enabled then mac80211 will
  272. * set up the SM PS mode to OFF if an HT channel is
  273. * configured.
  274. */
  275. if (priv->cfg->ops->hcmd->set_rxon_chain)
  276. for_each_context(priv, ctx)
  277. priv->cfg->ops->hcmd->set_rxon_chain(priv, ctx);
  278. }
  279. if (changed & IEEE80211_CONF_CHANGE_CHANNEL) {
  280. unsigned long flags;
  281. ch_info = iwl_get_channel_info(priv, channel->band,
  282. channel->hw_value);
  283. if (!is_channel_valid(ch_info)) {
  284. IWL_DEBUG_MAC80211(priv, "leave - invalid channel\n");
  285. ret = -EINVAL;
  286. goto out;
  287. }
  288. spin_lock_irqsave(&priv->lock, flags);
  289. for_each_context(priv, ctx) {
  290. /* Configure HT40 channels */
  291. if (ctx->ht.enabled != conf_is_ht(conf)) {
  292. ctx->ht.enabled = conf_is_ht(conf);
  293. ht_changed[ctx->ctxid] = true;
  294. }
  295. if (ctx->ht.enabled) {
  296. if (conf_is_ht40_minus(conf)) {
  297. ctx->ht.extension_chan_offset =
  298. IEEE80211_HT_PARAM_CHA_SEC_BELOW;
  299. ctx->ht.is_40mhz = true;
  300. } else if (conf_is_ht40_plus(conf)) {
  301. ctx->ht.extension_chan_offset =
  302. IEEE80211_HT_PARAM_CHA_SEC_ABOVE;
  303. ctx->ht.is_40mhz = true;
  304. } else {
  305. ctx->ht.extension_chan_offset =
  306. IEEE80211_HT_PARAM_CHA_SEC_NONE;
  307. ctx->ht.is_40mhz = false;
  308. }
  309. } else
  310. ctx->ht.is_40mhz = false;
  311. /*
  312. * Default to no protection. Protection mode will
  313. * later be set from BSS config in iwl_ht_conf
  314. */
  315. ctx->ht.protection = IEEE80211_HT_OP_MODE_PROTECTION_NONE;
  316. /* if we are switching from ht to 2.4 clear flags
  317. * from any ht related info since 2.4 does not
  318. * support ht */
  319. if (le16_to_cpu(ctx->staging.channel) !=
  320. channel->hw_value)
  321. ctx->staging.flags = 0;
  322. iwl_set_rxon_channel(priv, channel, ctx);
  323. iwl_set_rxon_ht(priv, &priv->current_ht_config);
  324. iwl_set_flags_for_band(priv, ctx, channel->band,
  325. ctx->vif);
  326. }
  327. spin_unlock_irqrestore(&priv->lock, flags);
  328. iwl_update_bcast_stations(priv);
  329. /*
  330. * The list of supported rates and rate mask can be different
  331. * for each band; since the band may have changed, reset
  332. * the rate mask to what mac80211 lists.
  333. */
  334. iwl_set_rate(priv);
  335. }
  336. if (changed & (IEEE80211_CONF_CHANGE_PS |
  337. IEEE80211_CONF_CHANGE_IDLE)) {
  338. ret = iwl_power_update_mode(priv, false);
  339. if (ret)
  340. IWL_DEBUG_MAC80211(priv, "Error setting sleep level\n");
  341. }
  342. if (changed & IEEE80211_CONF_CHANGE_POWER) {
  343. IWL_DEBUG_MAC80211(priv, "TX Power old=%d new=%d\n",
  344. priv->tx_power_user_lmt, conf->power_level);
  345. iwl_set_tx_power(priv, conf->power_level, false);
  346. }
  347. for_each_context(priv, ctx) {
  348. if (!memcmp(&ctx->staging, &ctx->active, sizeof(ctx->staging)))
  349. continue;
  350. iwlagn_commit_rxon(priv, ctx);
  351. if (ht_changed[ctx->ctxid])
  352. iwlagn_update_qos(priv, ctx);
  353. }
  354. out:
  355. mutex_unlock(&priv->mutex);
  356. return ret;
  357. }
  358. static void iwlagn_check_needed_chains(struct iwl_priv *priv,
  359. struct iwl_rxon_context *ctx,
  360. struct ieee80211_bss_conf *bss_conf)
  361. {
  362. struct ieee80211_vif *vif = ctx->vif;
  363. struct iwl_rxon_context *tmp;
  364. struct ieee80211_sta *sta;
  365. struct iwl_ht_config *ht_conf = &priv->current_ht_config;
  366. bool need_multiple;
  367. lockdep_assert_held(&priv->mutex);
  368. switch (vif->type) {
  369. case NL80211_IFTYPE_STATION:
  370. rcu_read_lock();
  371. sta = ieee80211_find_sta(vif, bss_conf->bssid);
  372. if (sta) {
  373. struct ieee80211_sta_ht_cap *ht_cap = &sta->ht_cap;
  374. int maxstreams;
  375. maxstreams = (ht_cap->mcs.tx_params &
  376. IEEE80211_HT_MCS_TX_MAX_STREAMS_MASK)
  377. >> IEEE80211_HT_MCS_TX_MAX_STREAMS_SHIFT;
  378. maxstreams += 1;
  379. need_multiple = true;
  380. if ((ht_cap->mcs.rx_mask[1] == 0) &&
  381. (ht_cap->mcs.rx_mask[2] == 0))
  382. need_multiple = false;
  383. if (maxstreams <= 1)
  384. need_multiple = false;
  385. } else {
  386. /*
  387. * If at all, this can only happen through a race
  388. * when the AP disconnects us while we're still
  389. * setting up the connection, in that case mac80211
  390. * will soon tell us about that.
  391. */
  392. need_multiple = false;
  393. }
  394. rcu_read_unlock();
  395. break;
  396. case NL80211_IFTYPE_ADHOC:
  397. /* currently */
  398. need_multiple = false;
  399. break;
  400. default:
  401. /* only AP really */
  402. need_multiple = true;
  403. break;
  404. }
  405. ctx->ht_need_multiple_chains = need_multiple;
  406. if (!need_multiple) {
  407. /* check all contexts */
  408. for_each_context(priv, tmp) {
  409. if (!tmp->vif)
  410. continue;
  411. if (tmp->ht_need_multiple_chains) {
  412. need_multiple = true;
  413. break;
  414. }
  415. }
  416. }
  417. ht_conf->single_chain_sufficient = !need_multiple;
  418. }
  419. void iwlagn_bss_info_changed(struct ieee80211_hw *hw,
  420. struct ieee80211_vif *vif,
  421. struct ieee80211_bss_conf *bss_conf,
  422. u32 changes)
  423. {
  424. struct iwl_priv *priv = hw->priv;
  425. struct iwl_rxon_context *ctx = iwl_rxon_ctx_from_vif(vif);
  426. int ret;
  427. bool force = false;
  428. mutex_lock(&priv->mutex);
  429. if (changes & BSS_CHANGED_BEACON_INT)
  430. force = true;
  431. if (changes & BSS_CHANGED_QOS) {
  432. ctx->qos_data.qos_active = bss_conf->qos;
  433. iwlagn_update_qos(priv, ctx);
  434. }
  435. ctx->staging.assoc_id = cpu_to_le16(vif->bss_conf.aid);
  436. if (vif->bss_conf.use_short_preamble)
  437. ctx->staging.flags |= RXON_FLG_SHORT_PREAMBLE_MSK;
  438. else
  439. ctx->staging.flags &= ~RXON_FLG_SHORT_PREAMBLE_MSK;
  440. if (changes & BSS_CHANGED_ASSOC) {
  441. if (bss_conf->assoc) {
  442. iwl_led_associate(priv);
  443. priv->timestamp = bss_conf->timestamp;
  444. ctx->staging.filter_flags |= RXON_FILTER_ASSOC_MSK;
  445. } else {
  446. ctx->staging.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
  447. iwl_led_disassociate(priv);
  448. }
  449. }
  450. if (ctx->ht.enabled) {
  451. ctx->ht.protection = bss_conf->ht_operation_mode &
  452. IEEE80211_HT_OP_MODE_PROTECTION;
  453. ctx->ht.non_gf_sta_present = !!(bss_conf->ht_operation_mode &
  454. IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT);
  455. iwlagn_check_needed_chains(priv, ctx, bss_conf);
  456. }
  457. if (priv->cfg->ops->hcmd->set_rxon_chain)
  458. priv->cfg->ops->hcmd->set_rxon_chain(priv, ctx);
  459. if (bss_conf->use_cts_prot && (priv->band != IEEE80211_BAND_5GHZ))
  460. ctx->staging.flags |= RXON_FLG_TGG_PROTECT_MSK;
  461. else
  462. ctx->staging.flags &= ~RXON_FLG_TGG_PROTECT_MSK;
  463. if (bss_conf->use_cts_prot)
  464. ctx->staging.flags |= RXON_FLG_SELF_CTS_EN;
  465. else
  466. ctx->staging.flags &= ~RXON_FLG_SELF_CTS_EN;
  467. memcpy(ctx->staging.bssid_addr, bss_conf->bssid, ETH_ALEN);
  468. if (vif->type == NL80211_IFTYPE_AP ||
  469. vif->type == NL80211_IFTYPE_ADHOC) {
  470. if (vif->bss_conf.enable_beacon) {
  471. ctx->staging.filter_flags |= RXON_FILTER_ASSOC_MSK;
  472. priv->beacon_ctx = ctx;
  473. } else {
  474. ctx->staging.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
  475. priv->beacon_ctx = NULL;
  476. }
  477. }
  478. if (force || memcmp(&ctx->staging, &ctx->active, sizeof(ctx->staging)))
  479. iwlagn_commit_rxon(priv, ctx);
  480. if (changes & BSS_CHANGED_IBSS) {
  481. ret = iwlagn_manage_ibss_station(priv, vif,
  482. bss_conf->ibss_joined);
  483. if (ret)
  484. IWL_ERR(priv, "failed to %s IBSS station %pM\n",
  485. bss_conf->ibss_joined ? "add" : "remove",
  486. bss_conf->bssid);
  487. }
  488. if (changes & BSS_CHANGED_BEACON && vif->type == NL80211_IFTYPE_ADHOC &&
  489. priv->beacon_ctx) {
  490. if (iwlagn_update_beacon(priv, vif))
  491. IWL_ERR(priv, "Error sending IBSS beacon\n");
  492. }
  493. mutex_unlock(&priv->mutex);
  494. }
  495. void iwlagn_post_scan(struct iwl_priv *priv)
  496. {
  497. struct iwl_rxon_context *ctx;
  498. /*
  499. * Since setting the RXON may have been deferred while
  500. * performing the scan, fire one off if needed
  501. */
  502. for_each_context(priv, ctx)
  503. if (memcmp(&ctx->staging, &ctx->active, sizeof(ctx->staging)))
  504. iwlagn_commit_rxon(priv, ctx);
  505. if (priv->cfg->ops->hcmd->set_pan_params)
  506. priv->cfg->ops->hcmd->set_pan_params(priv);
  507. }