static int iwlagn_rxon_connect(struct iwl_priv *priv, struct iwl_rxon_context *ctx) { int ret; struct iwl_rxon_cmd *active = (void *)&ctx->active; if (ctx->ctxid == IWL_RXON_CTX_BSS) { ret = iwl_send_rxon_timing(priv, ctx); if (ret) { IWL_ERR(priv, "Failed to send timing (%d)!\n", ret); return ret; } } iwlagn_update_qos(priv, ctx); if (ctx->vif && (ctx->vif->type == NL80211_IFTYPE_AP)) { ret = iwlagn_update_beacon(priv, ctx->vif); if (ret) { IWL_ERR(priv, "Error sending required beacon (%d)!\n", ret); return ret; } } priv->start_calib = 0; ret = iwl_dvm_send_cmd_pdu(priv, ctx->rxon_cmd, CMD_SYNC, sizeof(struct iwl_rxon_cmd), &ctx->staging); if (ret) { IWL_ERR(priv, "Error setting new RXON (%d)\n", ret); return ret; } memcpy(active, &ctx->staging, sizeof(*active)); if (ctx->vif && (ctx->vif->type == NL80211_IFTYPE_ADHOC)) if (iwlagn_update_beacon(priv, ctx->vif)) IWL_ERR(priv, "Error sending IBSS beacon\n"); iwl_init_sensitivity(priv); ret = iwl_set_tx_power(priv, priv->tx_power_next, true); if (ret) { IWL_ERR(priv, "Error sending TX power (%d)\n", ret); return ret; } if (ctx->vif && ctx->vif->type == NL80211_IFTYPE_STATION && cfg(priv)->ht_params && cfg(priv)->ht_params->smps_mode) ieee80211_request_smps(ctx->vif, cfg(priv)->ht_params->smps_mode); return 0; }
static int iwlagn_rxon_connect(struct iwl_priv *priv, struct iwl_rxon_context *ctx) { int ret; struct iwl_rxon_cmd *active = (void *)&ctx->active; /* RXON timing must be before associated RXON */ if (ctx->ctxid == IWL_RXON_CTX_BSS) { ret = iwl_send_rxon_timing(priv, ctx); if (ret) { IWL_ERR(priv, "Failed to send timing (%d)!\n", ret); return ret; } } /* QoS info may be cleared by previous un-assoc RXON */ iwlagn_update_qos(priv, ctx); /* * We'll run into this code path when beaconing is * enabled, but then we also need to send the beacon * to the device. */ if (ctx->vif && (ctx->vif->type == NL80211_IFTYPE_AP)) { ret = iwlagn_update_beacon(priv, ctx->vif); if (ret) { IWL_ERR(priv, "Error sending required beacon (%d)!\n", ret); return ret; } } priv->start_calib = 0; /* * Apply the new configuration. * * Associated RXON doesn't clear the station table in uCode, * so we don't need to restore stations etc. after this. */ ret = trans_send_cmd_pdu(&priv->trans, ctx->rxon_cmd, CMD_SYNC, sizeof(struct iwl_rxon_cmd), &ctx->staging); if (ret) { IWL_ERR(priv, "Error setting new RXON (%d)\n", ret); return ret; } memcpy(active, &ctx->staging, sizeof(*active)); iwl_reprogram_ap_sta(priv, ctx); /* IBSS beacon needs to be sent after setting assoc */ if (ctx->vif && (ctx->vif->type == NL80211_IFTYPE_ADHOC)) if (iwlagn_update_beacon(priv, ctx->vif)) IWL_ERR(priv, "Error sending IBSS beacon\n"); iwl_init_sensitivity(priv); /* * If we issue a new RXON command which required a tune then * we must send a new TXPOWER command or we won't be able to * Tx any frames. * * It's expected we set power here if channel is changing. */ ret = iwl_set_tx_power(priv, priv->tx_power_next, true); if (ret) { IWL_ERR(priv, "Error sending TX power (%d)\n", ret); return ret; } if ((ctx->vif && ctx->vif->type == NL80211_IFTYPE_STATION) && priv->cfg->ht_params->smps_mode) ieee80211_request_smps(ctx->vif, priv->cfg->ht_params->smps_mode); return 0; }
static void iwlagn_bt_traffic_change_work(struct work_struct *work) { struct iwl_priv *priv = container_of(work, struct iwl_priv, bt_traffic_change_work); struct iwl_rxon_context *ctx; int smps_request = -1; if (priv->bt_enable_flag == IWLAGN_BT_FLAG_COEX_MODE_DISABLED) { /* bt coex disabled */ return; } /* * Note: bt_traffic_load can be overridden by scan complete and * coex profile notifications. Ignore that since only bad consequence * can be not matching debug print with actual state. */ IWL_DEBUG_COEX(priv, "BT traffic load changes: %d\n", priv->bt_traffic_load); switch (priv->bt_traffic_load) { case IWL_BT_COEX_TRAFFIC_LOAD_NONE: if (priv->bt_status) smps_request = IEEE80211_SMPS_DYNAMIC; else smps_request = IEEE80211_SMPS_AUTOMATIC; break; case IWL_BT_COEX_TRAFFIC_LOAD_LOW: smps_request = IEEE80211_SMPS_DYNAMIC; break; case IWL_BT_COEX_TRAFFIC_LOAD_HIGH: case IWL_BT_COEX_TRAFFIC_LOAD_CONTINUOUS: smps_request = IEEE80211_SMPS_STATIC; break; default: IWL_ERR(priv, "Invalid BT traffic load: %d\n", priv->bt_traffic_load); break; } mutex_lock(&priv->mutex); /* * We can not send command to firmware while scanning. When the scan * complete we will schedule this work again. We do check with mutex * locked to prevent new scan request to arrive. We do not check * STATUS_SCANNING to avoid race when queue_work two times from * different notifications, but quit and not perform any work at all. */ if (test_bit(STATUS_SCAN_HW, &priv->status)) goto out; iwl_update_chain_flags(priv); if (smps_request != -1) { priv->current_ht_config.smps = smps_request; for_each_context(priv, ctx) { if (ctx->vif && ctx->vif->type == NL80211_IFTYPE_STATION) ieee80211_request_smps(ctx->vif, smps_request); } }