iwl-agn-rxon.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612
  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. static void iwlagn_update_qos(struct iwl_priv *priv,
  231. struct iwl_rxon_context *ctx)
  232. {
  233. int ret;
  234. if (!ctx->is_active)
  235. return;
  236. ctx->qos_data.def_qos_parm.qos_flags = 0;
  237. if (ctx->qos_data.qos_active)
  238. ctx->qos_data.def_qos_parm.qos_flags |=
  239. QOS_PARAM_FLG_UPDATE_EDCA_MSK;
  240. if (ctx->ht.enabled)
  241. ctx->qos_data.def_qos_parm.qos_flags |= QOS_PARAM_FLG_TGN_MSK;
  242. IWL_DEBUG_QOS(priv, "send QoS cmd with Qos active=%d FLAGS=0x%X\n",
  243. ctx->qos_data.qos_active,
  244. ctx->qos_data.def_qos_parm.qos_flags);
  245. ret = iwl_send_cmd_pdu(priv, ctx->qos_cmd,
  246. sizeof(struct iwl_qosparam_cmd),
  247. &ctx->qos_data.def_qos_parm);
  248. if (ret)
  249. IWL_ERR(priv, "Failed to update QoS\n");
  250. }
  251. int iwlagn_mac_config(struct ieee80211_hw *hw, u32 changed)
  252. {
  253. struct iwl_priv *priv = hw->priv;
  254. struct iwl_rxon_context *ctx;
  255. struct ieee80211_conf *conf = &hw->conf;
  256. struct ieee80211_channel *channel = conf->channel;
  257. const struct iwl_channel_info *ch_info;
  258. int ret = 0;
  259. bool ht_changed[NUM_IWL_RXON_CTX] = {};
  260. IWL_DEBUG_MAC80211(priv, "changed %#x", changed);
  261. mutex_lock(&priv->mutex);
  262. if (unlikely(test_bit(STATUS_SCANNING, &priv->status))) {
  263. IWL_DEBUG_MAC80211(priv, "leave - scanning\n");
  264. goto out;
  265. }
  266. if (!iwl_is_ready(priv)) {
  267. IWL_DEBUG_MAC80211(priv, "leave - not ready\n");
  268. goto out;
  269. }
  270. if (changed & (IEEE80211_CONF_CHANGE_SMPS |
  271. IEEE80211_CONF_CHANGE_CHANNEL)) {
  272. /* mac80211 uses static for non-HT which is what we want */
  273. priv->current_ht_config.smps = conf->smps_mode;
  274. /*
  275. * Recalculate chain counts.
  276. *
  277. * If monitor mode is enabled then mac80211 will
  278. * set up the SM PS mode to OFF if an HT channel is
  279. * configured.
  280. */
  281. if (priv->cfg->ops->hcmd->set_rxon_chain)
  282. for_each_context(priv, ctx)
  283. priv->cfg->ops->hcmd->set_rxon_chain(priv, ctx);
  284. }
  285. if (changed & IEEE80211_CONF_CHANGE_CHANNEL) {
  286. unsigned long flags;
  287. ch_info = iwl_get_channel_info(priv, channel->band,
  288. channel->hw_value);
  289. if (!is_channel_valid(ch_info)) {
  290. IWL_DEBUG_MAC80211(priv, "leave - invalid channel\n");
  291. ret = -EINVAL;
  292. goto out;
  293. }
  294. spin_lock_irqsave(&priv->lock, flags);
  295. for_each_context(priv, ctx) {
  296. /* Configure HT40 channels */
  297. if (ctx->ht.enabled != conf_is_ht(conf)) {
  298. ctx->ht.enabled = conf_is_ht(conf);
  299. ht_changed[ctx->ctxid] = true;
  300. }
  301. if (ctx->ht.enabled) {
  302. if (conf_is_ht40_minus(conf)) {
  303. ctx->ht.extension_chan_offset =
  304. IEEE80211_HT_PARAM_CHA_SEC_BELOW;
  305. ctx->ht.is_40mhz = true;
  306. } else if (conf_is_ht40_plus(conf)) {
  307. ctx->ht.extension_chan_offset =
  308. IEEE80211_HT_PARAM_CHA_SEC_ABOVE;
  309. ctx->ht.is_40mhz = true;
  310. } else {
  311. ctx->ht.extension_chan_offset =
  312. IEEE80211_HT_PARAM_CHA_SEC_NONE;
  313. ctx->ht.is_40mhz = false;
  314. }
  315. } else
  316. ctx->ht.is_40mhz = false;
  317. /*
  318. * Default to no protection. Protection mode will
  319. * later be set from BSS config in iwl_ht_conf
  320. */
  321. ctx->ht.protection = IEEE80211_HT_OP_MODE_PROTECTION_NONE;
  322. /* if we are switching from ht to 2.4 clear flags
  323. * from any ht related info since 2.4 does not
  324. * support ht */
  325. if (le16_to_cpu(ctx->staging.channel) !=
  326. channel->hw_value)
  327. ctx->staging.flags = 0;
  328. iwl_set_rxon_channel(priv, channel, ctx);
  329. iwl_set_rxon_ht(priv, &priv->current_ht_config);
  330. iwl_set_flags_for_band(priv, ctx, channel->band,
  331. ctx->vif);
  332. }
  333. spin_unlock_irqrestore(&priv->lock, flags);
  334. iwl_update_bcast_stations(priv);
  335. /*
  336. * The list of supported rates and rate mask can be different
  337. * for each band; since the band may have changed, reset
  338. * the rate mask to what mac80211 lists.
  339. */
  340. iwl_set_rate(priv);
  341. }
  342. if (changed & (IEEE80211_CONF_CHANGE_PS |
  343. IEEE80211_CONF_CHANGE_IDLE)) {
  344. ret = iwl_power_update_mode(priv, false);
  345. if (ret)
  346. IWL_DEBUG_MAC80211(priv, "Error setting sleep level\n");
  347. }
  348. if (changed & IEEE80211_CONF_CHANGE_POWER) {
  349. IWL_DEBUG_MAC80211(priv, "TX Power old=%d new=%d\n",
  350. priv->tx_power_user_lmt, conf->power_level);
  351. iwl_set_tx_power(priv, conf->power_level, false);
  352. }
  353. for_each_context(priv, ctx) {
  354. if (!memcmp(&ctx->staging, &ctx->active, sizeof(ctx->staging)))
  355. continue;
  356. iwlagn_commit_rxon(priv, ctx);
  357. if (ht_changed[ctx->ctxid])
  358. iwlagn_update_qos(priv, ctx);
  359. }
  360. out:
  361. mutex_unlock(&priv->mutex);
  362. return ret;
  363. }
  364. static void iwlagn_check_needed_chains(struct iwl_priv *priv,
  365. struct iwl_rxon_context *ctx,
  366. struct ieee80211_bss_conf *bss_conf)
  367. {
  368. struct ieee80211_vif *vif = ctx->vif;
  369. struct iwl_rxon_context *tmp;
  370. struct ieee80211_sta *sta;
  371. struct iwl_ht_config *ht_conf = &priv->current_ht_config;
  372. bool need_multiple;
  373. lockdep_assert_held(&priv->mutex);
  374. switch (vif->type) {
  375. case NL80211_IFTYPE_STATION:
  376. rcu_read_lock();
  377. sta = ieee80211_find_sta(vif, bss_conf->bssid);
  378. if (sta) {
  379. struct ieee80211_sta_ht_cap *ht_cap = &sta->ht_cap;
  380. int maxstreams;
  381. maxstreams = (ht_cap->mcs.tx_params &
  382. IEEE80211_HT_MCS_TX_MAX_STREAMS_MASK)
  383. >> IEEE80211_HT_MCS_TX_MAX_STREAMS_SHIFT;
  384. maxstreams += 1;
  385. need_multiple = true;
  386. if ((ht_cap->mcs.rx_mask[1] == 0) &&
  387. (ht_cap->mcs.rx_mask[2] == 0))
  388. need_multiple = false;
  389. if (maxstreams <= 1)
  390. need_multiple = false;
  391. } else {
  392. /*
  393. * If at all, this can only happen through a race
  394. * when the AP disconnects us while we're still
  395. * setting up the connection, in that case mac80211
  396. * will soon tell us about that.
  397. */
  398. need_multiple = false;
  399. }
  400. rcu_read_unlock();
  401. break;
  402. case NL80211_IFTYPE_ADHOC:
  403. /* currently */
  404. need_multiple = false;
  405. break;
  406. default:
  407. /* only AP really */
  408. need_multiple = true;
  409. break;
  410. }
  411. ctx->ht_need_multiple_chains = need_multiple;
  412. if (!need_multiple) {
  413. /* check all contexts */
  414. for_each_context(priv, tmp) {
  415. if (!tmp->vif)
  416. continue;
  417. if (tmp->ht_need_multiple_chains) {
  418. need_multiple = true;
  419. break;
  420. }
  421. }
  422. }
  423. ht_conf->single_chain_sufficient = !need_multiple;
  424. }
  425. void iwlagn_bss_info_changed(struct ieee80211_hw *hw,
  426. struct ieee80211_vif *vif,
  427. struct ieee80211_bss_conf *bss_conf,
  428. u32 changes)
  429. {
  430. struct iwl_priv *priv = hw->priv;
  431. struct iwl_rxon_context *ctx = iwl_rxon_ctx_from_vif(vif);
  432. int ret;
  433. bool force = false;
  434. mutex_lock(&priv->mutex);
  435. if (changes & BSS_CHANGED_BEACON_INT)
  436. force = true;
  437. if (changes & BSS_CHANGED_QOS) {
  438. ctx->qos_data.qos_active = bss_conf->qos;
  439. iwlagn_update_qos(priv, ctx);
  440. }
  441. ctx->staging.assoc_id = cpu_to_le16(vif->bss_conf.aid);
  442. if (vif->bss_conf.use_short_preamble)
  443. ctx->staging.flags |= RXON_FLG_SHORT_PREAMBLE_MSK;
  444. else
  445. ctx->staging.flags &= ~RXON_FLG_SHORT_PREAMBLE_MSK;
  446. if (changes & BSS_CHANGED_ASSOC) {
  447. if (bss_conf->assoc) {
  448. iwl_led_associate(priv);
  449. priv->timestamp = bss_conf->timestamp;
  450. ctx->staging.filter_flags |= RXON_FILTER_ASSOC_MSK;
  451. } else {
  452. ctx->staging.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
  453. iwl_led_disassociate(priv);
  454. }
  455. }
  456. if (ctx->ht.enabled) {
  457. ctx->ht.protection = bss_conf->ht_operation_mode &
  458. IEEE80211_HT_OP_MODE_PROTECTION;
  459. ctx->ht.non_gf_sta_present = !!(bss_conf->ht_operation_mode &
  460. IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT);
  461. iwlagn_check_needed_chains(priv, ctx, bss_conf);
  462. }
  463. if (priv->cfg->ops->hcmd->set_rxon_chain)
  464. priv->cfg->ops->hcmd->set_rxon_chain(priv, ctx);
  465. if (bss_conf->use_cts_prot && (priv->band != IEEE80211_BAND_5GHZ))
  466. ctx->staging.flags |= RXON_FLG_TGG_PROTECT_MSK;
  467. else
  468. ctx->staging.flags &= ~RXON_FLG_TGG_PROTECT_MSK;
  469. if (bss_conf->use_cts_prot)
  470. ctx->staging.flags |= RXON_FLG_SELF_CTS_EN;
  471. else
  472. ctx->staging.flags &= ~RXON_FLG_SELF_CTS_EN;
  473. memcpy(ctx->staging.bssid_addr, bss_conf->bssid, ETH_ALEN);
  474. if (vif->type == NL80211_IFTYPE_AP ||
  475. vif->type == NL80211_IFTYPE_ADHOC) {
  476. if (vif->bss_conf.enable_beacon) {
  477. ctx->staging.filter_flags |= RXON_FILTER_ASSOC_MSK;
  478. priv->beacon_ctx = ctx;
  479. } else {
  480. ctx->staging.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
  481. priv->beacon_ctx = NULL;
  482. }
  483. }
  484. if (force || memcmp(&ctx->staging, &ctx->active, sizeof(ctx->staging)))
  485. iwlagn_commit_rxon(priv, ctx);
  486. if (changes & BSS_CHANGED_IBSS) {
  487. ret = iwlagn_manage_ibss_station(priv, vif,
  488. bss_conf->ibss_joined);
  489. if (ret)
  490. IWL_ERR(priv, "failed to %s IBSS station %pM\n",
  491. bss_conf->ibss_joined ? "add" : "remove",
  492. bss_conf->bssid);
  493. }
  494. if (changes & BSS_CHANGED_BEACON && vif->type == NL80211_IFTYPE_ADHOC &&
  495. priv->beacon_ctx) {
  496. if (iwlagn_update_beacon(priv, vif))
  497. IWL_ERR(priv, "Error sending IBSS beacon\n");
  498. }
  499. mutex_unlock(&priv->mutex);
  500. }
  501. void iwlagn_post_scan(struct iwl_priv *priv)
  502. {
  503. struct iwl_rxon_context *ctx;
  504. /*
  505. * Since setting the RXON may have been deferred while
  506. * performing the scan, fire one off if needed
  507. */
  508. for_each_context(priv, ctx)
  509. if (memcmp(&ctx->staging, &ctx->active, sizeof(ctx->staging)))
  510. iwlagn_commit_rxon(priv, ctx);
  511. if (priv->cfg->ops->hcmd->set_pan_params)
  512. priv->cfg->ops->hcmd->set_pan_params(priv);
  513. }