Lines Matching refs:priv
34 static int iwlagn_disable_bss(struct iwl_priv *priv,
42 ret = iwl_dvm_send_cmd_pdu(priv, ctx->rxon_cmd,
48 IWL_DEBUG_QUIET_RFKILL(priv,
54 static int iwlagn_disable_pan(struct iwl_priv *priv,
63 iwl_init_notification_wait(&priv->notif_wait, &disable_wait,
69 ret = iwl_dvm_send_cmd_pdu(priv, ctx->rxon_cmd,
76 IWL_ERR(priv, "Error disabling PAN (%d)\n", ret);
77 iwl_remove_notification(&priv->notif_wait, &disable_wait);
79 ret = iwl_wait_notification(&priv->notif_wait,
82 IWL_ERR(priv, "Timed out waiting for PAN disable\n");
88 static int iwlagn_disconn_pan(struct iwl_priv *priv,
96 ret = iwl_dvm_send_cmd_pdu(priv, ctx->rxon_cmd, CMD_SYNC,
104 static void iwlagn_update_qos(struct iwl_priv *priv,
121 IWL_DEBUG_INFO(priv, "send QoS cmd with Qos active=%d FLAGS=0x%X\n",
125 ret = iwl_dvm_send_cmd_pdu(priv, ctx->qos_cmd, CMD_SYNC,
129 IWL_DEBUG_QUIET_RFKILL(priv, "Failed to update QoS\n");
132 static int iwlagn_update_beacon(struct iwl_priv *priv,
135 lockdep_assert_held(&priv->mutex);
137 dev_kfree_skb(priv->beacon_skb);
138 priv->beacon_skb = ieee80211_beacon_get(priv->hw, vif);
139 if (!priv->beacon_skb)
141 return iwlagn_send_beacon_cmd(priv);
144 static int iwlagn_send_rxon_assoc(struct iwl_priv *priv,
164 IWL_DEBUG_INFO(priv, "Using current RXON_ASSOC. Not resending.\n");
184 ret = iwl_dvm_send_cmd_pdu(priv, ctx->rxon_assoc_cmd,
189 static int iwlagn_rxon_disconn(struct iwl_priv *priv,
196 ret = iwlagn_disable_bss(priv, ctx, &ctx->staging);
198 ret = iwlagn_disable_pan(priv, ctx, &ctx->staging);
202 ret = iwl_send_rxon_timing(priv, ctx);
204 IWL_ERR(priv, "Failed to send timing (%d)!\n", ret);
207 ret = iwlagn_disconn_pan(priv, ctx, &ctx->staging);
217 iwl_clear_ucode_stations(priv, ctx);
219 iwl_update_bcast_station(priv, ctx);
220 iwl_restore_stations(priv, ctx);
221 ret = iwl_restore_default_wep_keys(priv, ctx);
223 IWL_ERR(priv, "Failed to restore WEP keys (%d)\n", ret);
231 static int iwlagn_rxon_connect(struct iwl_priv *priv,
239 ret = iwl_send_rxon_timing(priv, ctx);
241 IWL_ERR(priv, "Failed to send timing (%d)!\n", ret);
246 iwlagn_update_qos(priv, ctx);
254 ret = iwlagn_update_beacon(priv, ctx->vif);
256 IWL_ERR(priv,
263 priv->start_calib = 0;
270 ret = iwl_dvm_send_cmd_pdu(priv, ctx->rxon_cmd, CMD_SYNC,
273 IWL_ERR(priv, "Error setting new RXON (%d)\n", ret);
280 if (iwlagn_update_beacon(priv, ctx->vif))
281 IWL_ERR(priv, "Error sending IBSS beacon\n");
282 iwl_init_sensitivity(priv);
291 ret = iwl_set_tx_power(priv, priv->tx_power_next, true);
293 IWL_ERR(priv, "Error sending TX power (%d)\n", ret);
298 cfg(priv)->ht_params && cfg(priv)->ht_params->smps_mode)
300 cfg(priv)->ht_params->smps_mode);
305 int iwlagn_set_pan_params(struct iwl_priv *priv)
312 if (priv->shrd->valid_contexts == BIT(IWL_RXON_CTX_BSS))
317 lockdep_assert_held(&priv->mutex);
319 ctx_bss = &priv->contexts[IWL_RXON_CTX_BSS];
320 ctx_pan = &priv->contexts[IWL_RXON_CTX_PAN];
339 if (priv->hw_roc_setup) {
353 IWL_ERR(priv,
364 if (test_bit(STATUS_SCAN_HW, &priv->status) ||
380 if (test_bit(STATUS_SCAN_HW, &priv->status)) {
389 ret = iwl_dvm_send_cmd_pdu(priv, REPLY_WIPAN_PARAMS, CMD_SYNC,
392 IWL_ERR(priv, "Error setting PAN parameters (%d)\n", ret);
415 int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
422 lockdep_assert_held(&priv->mutex);
424 if (!iwl_is_alive(priv))
440 if (!hw_params(priv).use_rts_for_aggregation)
449 iwl_print_rx_config_cmd(priv, ctx->ctxid);
450 ret = iwl_check_rxon_cmd(priv, ctx);
452 IWL_ERR(priv, "Invalid RXON configuration. Not committing.\n");
460 if (test_bit(STATUS_CHANNEL_SWITCH_PENDING, &priv->status) &&
461 (priv->switch_channel != ctx->staging.channel)) {
462 IWL_DEBUG_11H(priv, "abort channel switch on %d\n",
463 le16_to_cpu(priv->switch_channel));
464 iwl_chswitch_done(priv, false);
472 if (!iwl_full_rxon_required(priv, ctx)) {
473 ret = iwlagn_send_rxon_assoc(priv, ctx);
475 IWL_ERR(priv, "Error setting RXON_ASSOC (%d)\n", ret);
484 iwl_set_tx_power(priv, priv->tx_power_next, false);
487 iwl_power_update_mode(priv, true);
492 iwl_set_rxon_hwcrypto(priv, ctx, !iwlagn_mod_params.sw_crypto);
494 IWL_DEBUG_INFO(priv,
509 ret = iwlagn_rxon_disconn(priv, ctx);
513 ret = iwlagn_set_pan_params(priv);
518 return iwlagn_rxon_connect(priv, ctx);
543 struct iwl_priv *priv = IWL_MAC80211_GET_DVM(hw);
550 IWL_DEBUG_MAC80211(priv, "enter: changed %#x", changed);
552 mutex_lock(&priv->mutex);
554 if (unlikely(test_bit(STATUS_SCANNING, &priv->status))) {
555 IWL_DEBUG_MAC80211(priv, "leave - scanning\n");
559 if (!iwl_is_ready(priv)) {
560 IWL_DEBUG_MAC80211(priv, "leave - not ready\n");
567 priv->current_ht_config.smps = conf->smps_mode;
576 for_each_context(priv, ctx)
577 iwlagn_set_rxon_chain(priv, ctx);
581 ch_info = iwl_get_channel_info(priv, channel->band,
584 IWL_DEBUG_MAC80211(priv, "leave - invalid channel\n");
589 for_each_context(priv, ctx) {
616 iwl_set_rxon_channel(priv, channel, ctx);
617 iwl_set_rxon_ht(priv, &priv->current_ht_config);
619 iwl_set_flags_for_band(priv, ctx, channel->band,
623 iwl_update_bcast_stations(priv);
630 iwl_set_rate(priv);
635 ret = iwl_power_update_mode(priv, false);
637 IWL_DEBUG_MAC80211(priv, "Error setting sleep level\n");
641 IWL_DEBUG_MAC80211(priv, "TX Power old=%d new=%d\n",
642 priv->tx_power_user_lmt, conf->power_level);
644 iwl_set_tx_power(priv, conf->power_level, false);
647 for_each_context(priv, ctx) {
650 iwlagn_commit_rxon(priv, ctx);
653 mutex_unlock(&priv->mutex);
654 IWL_DEBUG_MAC80211(priv, "leave\n");
659 static void iwlagn_check_needed_chains(struct iwl_priv *priv,
666 struct iwl_ht_config *ht_conf = &priv->current_ht_config;
670 lockdep_assert_held(&priv->mutex);
740 for_each_context(priv, tmp) {
753 static void iwlagn_chain_noise_reset(struct iwl_priv *priv)
755 struct iwl_chain_noise_data *data = &priv->chain_noise_data;
759 iwl_is_any_associated(priv)) {
773 priv->phy_calib_chain_noise_reset_cmd);
774 ret = iwl_dvm_send_cmd_pdu(priv,
778 IWL_ERR(priv,
781 IWL_DEBUG_CALIB(priv, "Run chain_noise_calibrate\n");
790 struct iwl_priv *priv = IWL_MAC80211_GET_DVM(hw);
795 mutex_lock(&priv->mutex);
797 if (unlikely(!iwl_is_ready(priv))) {
798 IWL_DEBUG_MAC80211(priv, "leave - not ready\n");
799 mutex_unlock(&priv->mutex);
804 IWL_DEBUG_MAC80211(priv, "leave - vif is NULL\n");
805 mutex_unlock(&priv->mutex);
814 iwlagn_update_qos(priv, ctx);
825 priv->timestamp = bss_conf->last_tsf;
836 iwlagn_lift_passive_no_rx(priv);
841 priv->have_rekey_data = false;
844 iwlagn_bt_coex_rssi_monitor(priv);
852 iwlagn_check_needed_chains(priv, ctx, bss_conf);
853 iwl_set_rxon_ht(priv, &priv->current_ht_config);
856 iwlagn_set_rxon_chain(priv, ctx);
858 if (bss_conf->use_cts_prot && (priv->band != IEEE80211_BAND_5GHZ))
874 priv->beacon_ctx = ctx;
877 priv->beacon_ctx = NULL;
898 iwlagn_commit_rxon(priv, ctx);
906 if (priv->chain_noise_data.state == IWL_CHAIN_NOISE_DONE)
907 iwl_power_update_mode(priv, false);
910 if (!priv->disable_chain_noise_cal)
911 iwlagn_chain_noise_reset(priv);
912 priv->start_calib = 1;
916 ret = iwlagn_manage_ibss_station(priv, vif,
919 IWL_ERR(priv, "failed to %s IBSS station %pM\n",
925 priv->beacon_ctx) {
926 if (iwlagn_update_beacon(priv, vif))
927 IWL_ERR(priv, "Error sending IBSS beacon\n");
930 mutex_unlock(&priv->mutex);
933 void iwlagn_post_scan(struct iwl_priv *priv)
941 iwl_power_set_mode(priv, &priv->power_data.sleep_cmd_next, false);
942 iwl_set_tx_power(priv, priv->tx_power_next, false);
948 for_each_context(priv, ctx)
950 iwlagn_commit_rxon(priv, ctx);
952 iwlagn_set_pan_params(priv);