iwl-agn-rxon.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603
  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 old_assoc = !!(ctx->active.filter_flags & RXON_FILTER_ASSOC_MSK);
  85. bool new_assoc = !!(ctx->staging.filter_flags & RXON_FILTER_ASSOC_MSK);
  86. int ret;
  87. lockdep_assert_held(&priv->mutex);
  88. if (!iwl_is_alive(priv))
  89. return -EBUSY;
  90. /* This function hardcodes a bunch of dual-mode assumptions */
  91. BUILD_BUG_ON(NUM_IWL_RXON_CTX != 2);
  92. if (!ctx->is_active)
  93. return 0;
  94. /* always get timestamp with Rx frame */
  95. ctx->staging.flags |= RXON_FLG_TSF2HOST_MSK;
  96. if ((ctx->vif && ctx->vif->bss_conf.use_short_slot) ||
  97. !(ctx->staging.flags & RXON_FLG_BAND_24G_MSK))
  98. ctx->staging.flags |= RXON_FLG_SHORT_SLOT_MSK;
  99. else
  100. ctx->staging.flags &= ~RXON_FLG_SHORT_SLOT_MSK;
  101. ret = iwl_check_rxon_cmd(priv, ctx);
  102. if (ret) {
  103. IWL_ERR(priv, "Invalid RXON configuration. Not committing.\n");
  104. return -EINVAL;
  105. }
  106. /*
  107. * receive commit_rxon request
  108. * abort any previous channel switch if still in process
  109. */
  110. if (priv->switch_rxon.switch_in_progress &&
  111. (priv->switch_rxon.channel != ctx->staging.channel)) {
  112. IWL_DEBUG_11H(priv, "abort channel switch on %d\n",
  113. le16_to_cpu(priv->switch_rxon.channel));
  114. iwl_chswitch_done(priv, false);
  115. }
  116. /*
  117. * If we don't need to send a full RXON, we can use
  118. * iwl_rxon_assoc_cmd which is used to reconfigure filter
  119. * and other flags for the current radio configuration.
  120. */
  121. if (!iwl_full_rxon_required(priv, ctx)) {
  122. ret = iwl_send_rxon_assoc(priv, ctx);
  123. if (ret) {
  124. IWL_ERR(priv, "Error setting RXON_ASSOC (%d)\n", ret);
  125. return ret;
  126. }
  127. memcpy(active, &ctx->staging, sizeof(*active));
  128. iwl_print_rx_config_cmd(priv, ctx);
  129. return 0;
  130. }
  131. if (priv->cfg->ops->hcmd->set_pan_params) {
  132. ret = priv->cfg->ops->hcmd->set_pan_params(priv);
  133. if (ret)
  134. return ret;
  135. }
  136. iwl_set_rxon_hwcrypto(priv, ctx, !priv->cfg->mod_params->sw_crypto);
  137. IWL_DEBUG_INFO(priv,
  138. "Going to commit RXON\n"
  139. " * with%s RXON_FILTER_ASSOC_MSK\n"
  140. " * channel = %d\n"
  141. " * bssid = %pM\n",
  142. (new_assoc ? "" : "out"),
  143. le16_to_cpu(ctx->staging.channel),
  144. ctx->staging.bssid_addr);
  145. /*
  146. * If we are currently associated and the new config is also
  147. * going to be associated, OR if the new config is simply not
  148. * associated, clear associated.
  149. */
  150. if ((old_assoc && new_assoc) || !new_assoc) {
  151. struct iwl_rxon_cmd *send = active;
  152. if (!new_assoc)
  153. send = &ctx->staging;
  154. if (ctx->ctxid == IWL_RXON_CTX_BSS)
  155. ret = iwlagn_disable_bss(priv, ctx, send);
  156. else
  157. ret = iwlagn_disable_pan(priv, ctx, send);
  158. if (ret)
  159. return ret;
  160. if (send != active)
  161. memcpy(active, send, sizeof(*active));
  162. /*
  163. * Un-assoc RXON clears the station table and WEP
  164. * keys, so we have to restore those afterwards.
  165. */
  166. iwl_clear_ucode_stations(priv, ctx);
  167. iwl_restore_stations(priv, ctx);
  168. ret = iwl_restore_default_wep_keys(priv, ctx);
  169. if (ret) {
  170. IWL_ERR(priv, "Failed to restore WEP keys (%d)\n", ret);
  171. return ret;
  172. }
  173. }
  174. /* RXON timing must be before associated RXON */
  175. ret = iwl_send_rxon_timing(priv, ctx);
  176. if (ret) {
  177. IWL_ERR(priv, "Failed to send timing (%d)!\n", ret);
  178. return ret;
  179. }
  180. if (new_assoc) {
  181. /*
  182. * We'll run into this code path when beaconing is
  183. * enabled, but then we also need to send the beacon
  184. * to the device.
  185. */
  186. if (ctx->vif && (ctx->vif->type == NL80211_IFTYPE_AP)) {
  187. ret = iwlagn_update_beacon(priv, ctx->vif);
  188. if (ret) {
  189. IWL_ERR(priv,
  190. "Error sending required beacon (%d)!\n",
  191. ret);
  192. return ret;
  193. }
  194. }
  195. priv->start_calib = 0;
  196. /*
  197. * Apply the new configuration.
  198. *
  199. * Associated RXON doesn't clear the station table in uCode,
  200. * so we don't need to restore stations etc. after this.
  201. */
  202. ret = iwl_send_cmd_pdu(priv, ctx->rxon_cmd,
  203. sizeof(struct iwl_rxon_cmd), &ctx->staging);
  204. if (ret) {
  205. IWL_ERR(priv, "Error setting new RXON (%d)\n", ret);
  206. return ret;
  207. }
  208. memcpy(active, &ctx->staging, sizeof(*active));
  209. /* IBSS beacon needs to be sent after setting assoc */
  210. if (ctx->vif && (ctx->vif->type == NL80211_IFTYPE_ADHOC))
  211. if (iwlagn_update_beacon(priv, ctx->vif))
  212. IWL_ERR(priv, "Error sending IBSS beacon\n");
  213. }
  214. iwl_print_rx_config_cmd(priv, ctx);
  215. iwl_init_sensitivity(priv);
  216. /*
  217. * If we issue a new RXON command which required a tune then we must
  218. * send a new TXPOWER command or we won't be able to Tx any frames.
  219. *
  220. * FIXME: which RXON requires a tune? Can we optimise this out in
  221. * some cases?
  222. */
  223. ret = iwl_set_tx_power(priv, priv->tx_power_user_lmt, true);
  224. if (ret) {
  225. IWL_ERR(priv, "Error sending TX power (%d)\n", ret);
  226. return ret;
  227. }
  228. return 0;
  229. }
  230. int iwlagn_mac_config(struct ieee80211_hw *hw, u32 changed)
  231. {
  232. struct iwl_priv *priv = hw->priv;
  233. struct iwl_rxon_context *ctx;
  234. struct ieee80211_conf *conf = &hw->conf;
  235. struct ieee80211_channel *channel = conf->channel;
  236. const struct iwl_channel_info *ch_info;
  237. int ret = 0;
  238. IWL_DEBUG_MAC80211(priv, "changed %#x", changed);
  239. mutex_lock(&priv->mutex);
  240. if (unlikely(test_bit(STATUS_SCANNING, &priv->status))) {
  241. IWL_DEBUG_MAC80211(priv, "leave - scanning\n");
  242. goto out;
  243. }
  244. if (!iwl_is_ready(priv)) {
  245. IWL_DEBUG_MAC80211(priv, "leave - not ready\n");
  246. goto out;
  247. }
  248. if (changed & (IEEE80211_CONF_CHANGE_SMPS |
  249. IEEE80211_CONF_CHANGE_CHANNEL)) {
  250. /* mac80211 uses static for non-HT which is what we want */
  251. priv->current_ht_config.smps = conf->smps_mode;
  252. /*
  253. * Recalculate chain counts.
  254. *
  255. * If monitor mode is enabled then mac80211 will
  256. * set up the SM PS mode to OFF if an HT channel is
  257. * configured.
  258. */
  259. if (priv->cfg->ops->hcmd->set_rxon_chain)
  260. for_each_context(priv, ctx)
  261. priv->cfg->ops->hcmd->set_rxon_chain(priv, ctx);
  262. }
  263. if (changed & IEEE80211_CONF_CHANGE_CHANNEL) {
  264. unsigned long flags;
  265. ch_info = iwl_get_channel_info(priv, channel->band,
  266. channel->hw_value);
  267. if (!is_channel_valid(ch_info)) {
  268. IWL_DEBUG_MAC80211(priv, "leave - invalid channel\n");
  269. ret = -EINVAL;
  270. goto out;
  271. }
  272. spin_lock_irqsave(&priv->lock, flags);
  273. for_each_context(priv, ctx) {
  274. /* Configure HT40 channels */
  275. ctx->ht.enabled = conf_is_ht(conf);
  276. if (ctx->ht.enabled) {
  277. if (conf_is_ht40_minus(conf)) {
  278. ctx->ht.extension_chan_offset =
  279. IEEE80211_HT_PARAM_CHA_SEC_BELOW;
  280. ctx->ht.is_40mhz = true;
  281. } else if (conf_is_ht40_plus(conf)) {
  282. ctx->ht.extension_chan_offset =
  283. IEEE80211_HT_PARAM_CHA_SEC_ABOVE;
  284. ctx->ht.is_40mhz = true;
  285. } else {
  286. ctx->ht.extension_chan_offset =
  287. IEEE80211_HT_PARAM_CHA_SEC_NONE;
  288. ctx->ht.is_40mhz = false;
  289. }
  290. } else
  291. ctx->ht.is_40mhz = false;
  292. /*
  293. * Default to no protection. Protection mode will
  294. * later be set from BSS config in iwl_ht_conf
  295. */
  296. ctx->ht.protection = IEEE80211_HT_OP_MODE_PROTECTION_NONE;
  297. /* if we are switching from ht to 2.4 clear flags
  298. * from any ht related info since 2.4 does not
  299. * support ht */
  300. if (le16_to_cpu(ctx->staging.channel) !=
  301. channel->hw_value)
  302. ctx->staging.flags = 0;
  303. iwl_set_rxon_channel(priv, channel, ctx);
  304. iwl_set_rxon_ht(priv, &priv->current_ht_config);
  305. iwl_set_flags_for_band(priv, ctx, channel->band,
  306. ctx->vif);
  307. }
  308. spin_unlock_irqrestore(&priv->lock, flags);
  309. iwl_update_bcast_stations(priv);
  310. /*
  311. * The list of supported rates and rate mask can be different
  312. * for each band; since the band may have changed, reset
  313. * the rate mask to what mac80211 lists.
  314. */
  315. iwl_set_rate(priv);
  316. }
  317. if (changed & (IEEE80211_CONF_CHANGE_PS |
  318. IEEE80211_CONF_CHANGE_IDLE)) {
  319. ret = iwl_power_update_mode(priv, false);
  320. if (ret)
  321. IWL_DEBUG_MAC80211(priv, "Error setting sleep level\n");
  322. }
  323. if (changed & IEEE80211_CONF_CHANGE_POWER) {
  324. IWL_DEBUG_MAC80211(priv, "TX Power old=%d new=%d\n",
  325. priv->tx_power_user_lmt, conf->power_level);
  326. iwl_set_tx_power(priv, conf->power_level, false);
  327. }
  328. for_each_context(priv, ctx) {
  329. if (!memcmp(&ctx->staging, &ctx->active, sizeof(ctx->staging)))
  330. continue;
  331. iwlagn_commit_rxon(priv, ctx);
  332. }
  333. out:
  334. mutex_unlock(&priv->mutex);
  335. return ret;
  336. }
  337. static void iwlagn_update_qos(struct iwl_priv *priv,
  338. struct iwl_rxon_context *ctx)
  339. {
  340. int ret;
  341. if (!ctx->is_active)
  342. return;
  343. ctx->qos_data.def_qos_parm.qos_flags = 0;
  344. if (ctx->qos_data.qos_active)
  345. ctx->qos_data.def_qos_parm.qos_flags |=
  346. QOS_PARAM_FLG_UPDATE_EDCA_MSK;
  347. if (ctx->ht.enabled)
  348. ctx->qos_data.def_qos_parm.qos_flags |= QOS_PARAM_FLG_TGN_MSK;
  349. IWL_DEBUG_QOS(priv, "send QoS cmd with Qos active=%d FLAGS=0x%X\n",
  350. ctx->qos_data.qos_active,
  351. ctx->qos_data.def_qos_parm.qos_flags);
  352. ret = iwl_send_cmd_pdu(priv, ctx->qos_cmd,
  353. sizeof(struct iwl_qosparam_cmd),
  354. &ctx->qos_data.def_qos_parm);
  355. if (ret)
  356. IWL_ERR(priv, "Failed to update QoS\n");
  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. if ((ht_cap->mcs.rx_mask[1] == 0) &&
  380. (ht_cap->mcs.rx_mask[2] == 0))
  381. need_multiple = false;
  382. if (maxstreams <= 1)
  383. need_multiple = true;
  384. } else {
  385. /*
  386. * If at all, this can only happen through a race
  387. * when the AP disconnects us while we're still
  388. * setting up the connection, in that case mac80211
  389. * will soon tell us about that.
  390. */
  391. need_multiple = false;
  392. }
  393. rcu_read_unlock();
  394. break;
  395. case NL80211_IFTYPE_ADHOC:
  396. /* currently */
  397. need_multiple = false;
  398. break;
  399. default:
  400. /* only AP really */
  401. need_multiple = true;
  402. break;
  403. }
  404. ctx->ht_need_multiple_chains = need_multiple;
  405. if (!need_multiple) {
  406. /* check all contexts */
  407. for_each_context(priv, tmp) {
  408. if (!tmp->vif)
  409. continue;
  410. if (tmp->ht_need_multiple_chains) {
  411. need_multiple = true;
  412. break;
  413. }
  414. }
  415. }
  416. ht_conf->single_chain_sufficient = !need_multiple;
  417. }
  418. void iwlagn_bss_info_changed(struct ieee80211_hw *hw,
  419. struct ieee80211_vif *vif,
  420. struct ieee80211_bss_conf *bss_conf,
  421. u32 changes)
  422. {
  423. struct iwl_priv *priv = hw->priv;
  424. struct iwl_rxon_context *ctx = iwl_rxon_ctx_from_vif(vif);
  425. int ret;
  426. bool force = false;
  427. mutex_lock(&priv->mutex);
  428. if (changes & BSS_CHANGED_BEACON_INT)
  429. force = true;
  430. if (changes & BSS_CHANGED_QOS) {
  431. ctx->qos_data.qos_active = bss_conf->qos;
  432. iwlagn_update_qos(priv, ctx);
  433. }
  434. ctx->staging.assoc_id = cpu_to_le16(vif->bss_conf.aid);
  435. if (vif->bss_conf.use_short_preamble)
  436. ctx->staging.flags |= RXON_FLG_SHORT_PREAMBLE_MSK;
  437. else
  438. ctx->staging.flags &= ~RXON_FLG_SHORT_PREAMBLE_MSK;
  439. if (changes & BSS_CHANGED_ASSOC) {
  440. if (bss_conf->assoc) {
  441. iwl_led_associate(priv);
  442. priv->timestamp = bss_conf->timestamp;
  443. ctx->staging.filter_flags |= RXON_FILTER_ASSOC_MSK;
  444. } else {
  445. ctx->staging.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
  446. iwl_led_disassociate(priv);
  447. }
  448. }
  449. if (ctx->ht.enabled) {
  450. ctx->ht.protection = bss_conf->ht_operation_mode &
  451. IEEE80211_HT_OP_MODE_PROTECTION;
  452. ctx->ht.non_gf_sta_present = !!(bss_conf->ht_operation_mode &
  453. IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT);
  454. iwlagn_check_needed_chains(priv, ctx, bss_conf);
  455. }
  456. if (priv->cfg->ops->hcmd->set_rxon_chain)
  457. priv->cfg->ops->hcmd->set_rxon_chain(priv, ctx);
  458. if (bss_conf->use_cts_prot && (priv->band != IEEE80211_BAND_5GHZ))
  459. ctx->staging.flags |= RXON_FLG_TGG_PROTECT_MSK;
  460. else
  461. ctx->staging.flags &= ~RXON_FLG_TGG_PROTECT_MSK;
  462. if (bss_conf->use_cts_prot)
  463. ctx->staging.flags |= RXON_FLG_SELF_CTS_EN;
  464. else
  465. ctx->staging.flags &= ~RXON_FLG_SELF_CTS_EN;
  466. memcpy(ctx->staging.bssid_addr, bss_conf->bssid, ETH_ALEN);
  467. if (vif->type == NL80211_IFTYPE_AP ||
  468. vif->type == NL80211_IFTYPE_ADHOC) {
  469. if (vif->bss_conf.enable_beacon) {
  470. ctx->staging.filter_flags |= RXON_FILTER_ASSOC_MSK;
  471. priv->beacon_ctx = ctx;
  472. } else {
  473. ctx->staging.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
  474. priv->beacon_ctx = NULL;
  475. }
  476. }
  477. if (force || memcmp(&ctx->staging, &ctx->active, sizeof(ctx->staging)))
  478. iwlagn_commit_rxon(priv, ctx);
  479. if (changes & BSS_CHANGED_IBSS) {
  480. ret = iwlagn_manage_ibss_station(priv, vif,
  481. bss_conf->ibss_joined);
  482. if (ret)
  483. IWL_ERR(priv, "failed to %s IBSS station %pM\n",
  484. bss_conf->ibss_joined ? "add" : "remove",
  485. bss_conf->bssid);
  486. }
  487. if (changes & BSS_CHANGED_BEACON && vif->type == NL80211_IFTYPE_ADHOC &&
  488. priv->beacon_ctx) {
  489. if (iwlagn_update_beacon(priv, vif))
  490. IWL_ERR(priv, "Error sending IBSS beacon\n");
  491. }
  492. mutex_unlock(&priv->mutex);
  493. }
  494. void iwlagn_post_scan(struct iwl_priv *priv)
  495. {
  496. struct iwl_rxon_context *ctx;
  497. /*
  498. * Since setting the RXON may have been deferred while
  499. * performing the scan, fire one off if needed
  500. */
  501. for_each_context(priv, ctx)
  502. if (memcmp(&ctx->staging, &ctx->active, sizeof(ctx->staging)))
  503. iwlagn_commit_rxon(priv, ctx);
  504. if (priv->cfg->ops->hcmd->set_pan_params)
  505. priv->cfg->ops->hcmd->set_pan_params(priv);
  506. }