diff --git a/core/hdd/inc/wlan_hdd_assoc.h b/core/hdd/inc/wlan_hdd_assoc.h index 3a8287567698..ad4993be97b0 100644 --- a/core/hdd/inc/wlan_hdd_assoc.h +++ b/core/hdd/inc/wlan_hdd_assoc.h @@ -146,7 +146,6 @@ struct hdd_conn_flag { * @auth_type: Auth Type * @uc_encrypt_type: Unicast Encryption Type * @mc_encrypt_type: Multicast Encryption Type - * @channel: Operation Channel * @is_authenticated: Remembers authenticated state * @dot11mode: dot11mode * @proxy_arp_service: proxy arp service @@ -154,7 +153,7 @@ struct hdd_conn_flag { * @gtk_installed: gtk installed state * @nss: number of spatial streams negotiated * @rate_flags: rate flags for current connection - * @freq: channel frequency + * @chan_freq: channel frequency * @txrate: txrate structure holds nss & datarate info * @rxrate: rx rate info * @noise: holds noise information @@ -183,7 +182,6 @@ struct hdd_connection_info { enum csr_akm_type auth_type; eCsrEncryptionType uc_encrypt_type; eCsrEncryptionType mc_encrypt_type; - uint8_t channel; uint8_t is_authenticated; uint32_t dot11mode; uint8_t proxy_arp_service; @@ -191,7 +189,7 @@ struct hdd_connection_info { bool gtk_installed; uint8_t nss; uint32_t rate_flags; - uint32_t freq; + uint32_t chan_freq; struct rate_info txrate; struct rate_info rxrate; int8_t noise; diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index f4d72c89a13e..76cae0b6835f 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -340,7 +340,7 @@ enum band_info hdd_conn_get_connected_band(struct hdd_station_ctx *sta_ctx) uint32_t sta_freq = 0; if (eConnectionState_Associated == sta_ctx->conn_info.conn_state) - sta_freq = sta_ctx->conn_info.freq; + sta_freq = sta_ctx->conn_info.chan_freq; if (wlan_reg_is_24ghz_ch_freq(sta_freq)) return BAND_2G; @@ -959,7 +959,6 @@ hdd_conn_save_connect_info(struct hdd_adapter *adapter, { struct hdd_station_ctx *sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); eCsrEncryptionType encrypt_type = eCSR_ENCRYPT_TYPE_NONE; - struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); QDF_ASSERT(roam_info); @@ -1012,12 +1011,7 @@ hdd_conn_save_connect_info(struct hdd_adapter *adapter, sta_ctx->conn_info.last_auth_type = sta_ctx->conn_info.auth_type; - sta_ctx->conn_info.channel = - wlan_reg_freq_to_chan( - hdd_ctx->pdev, - roam_info->u.pConnectedProfile->op_freq); - - sta_ctx->conn_info.freq = + sta_ctx->conn_info.chan_freq = roam_info->u.pConnectedProfile->op_freq; /* Save the ssid for the connection */ @@ -1641,8 +1635,8 @@ static void hdd_print_bss_info(struct hdd_station_ctx *hdd_sta_ctx) uint32_t *cap_info; hdd_debug("WIFI DATA LOGGER"); - hdd_debug("channel: %d", - hdd_sta_ctx->conn_info.freq); + hdd_debug("chan_freq: %d", + hdd_sta_ctx->conn_info.chan_freq); hdd_debug("dot11mode: %d", hdd_sta_ctx->conn_info.dot11mode); hdd_debug("AKM: %d", @@ -2921,20 +2915,20 @@ hdd_association_completion_handler(struct hdd_adapter *adapter, conn_info_channel = wlan_reg_freq_to_chan(hdd_ctx->pdev, - sta_ctx->conn_info.freq); + sta_ctx->conn_info.chan_freq); hdd_debug("check if STA chan ok for DNBS"); if (policy_mgr_is_chan_ok_for_dnbs(hdd_ctx->psoc, conn_info_channel, &ok)) { hdd_err("Unable to check DNBS eligibility for chan(freq):%u", - sta_ctx->conn_info.freq); + sta_ctx->conn_info.chan_freq); return QDF_STATUS_E_FAILURE; } if (!ok) { hdd_err("Chan(freq):%u not suitable for DNBS", - sta_ctx->conn_info.freq); + sta_ctx->conn_info.chan_freq); wlan_hdd_netif_queue_control(adapter, WLAN_NETIF_CARRIER_OFF, WLAN_CONTROL_PATH); diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index e8c91490033d..048d4497b28b 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -4381,7 +4381,7 @@ static bool wlan_hdd_check_dfs_channel_for_adapter(struct hdd_context *hdd_ctx, conn_info_channel = wlan_reg_freq_to_chan( hdd_ctx->pdev, - sta_ctx->conn_info.freq); + sta_ctx->conn_info.chan_freq); /* * if STA is already connected on DFS channel, * do not disable scan on dfs channels @@ -8878,7 +8878,7 @@ static int __wlan_hdd_cfg80211_get_link_properties(struct wiphy *wiphy, } nss = hdd_sta_ctx->conn_info.nss; - freq = hdd_sta_ctx->conn_info.freq; + freq = hdd_sta_ctx->conn_info.chan_freq; rate_flags = hdd_sta_ctx->conn_info.rate_flags; } else if (adapter->device_mode == QDF_P2P_GO_MODE || adapter->device_mode == QDF_SAP_MODE) { @@ -19186,12 +19186,11 @@ static int __wlan_hdd_cfg80211_join_ibss(struct wiphy *wiphy, /* Set the Operational Channel */ hdd_debug("set channel %d", channelNum); roam_profile->ChannelInfo.numOfChannels = 1; - sta_ctx->conn_info.channel = channelNum; - sta_ctx->conn_info.freq = + sta_ctx->conn_info.chan_freq = wlan_reg_chan_to_freq(hdd_ctx->pdev, channelNum); roam_profile->ChannelInfo.freq_list = - &sta_ctx->conn_info.freq; + &sta_ctx->conn_info.chan_freq; } /* Initialize security parameters */ @@ -19204,7 +19203,7 @@ static int __wlan_hdd_cfg80211_join_ibss(struct wiphy *wiphy, conn_info_channel = wlan_reg_freq_to_chan( hdd_ctx->pdev, - sta_ctx->conn_info.freq); + sta_ctx->conn_info.chan_freq); /* Issue connect start */ status = wlan_hdd_cfg80211_connect_start(adapter, params->ssid, params->ssid_len, diff --git a/core/hdd/src/wlan_hdd_debugfs_connect.c b/core/hdd/src/wlan_hdd_debugfs_connect.c index f673b14c1dd9..2de9bf1b0cd6 100644 --- a/core/hdd/src/wlan_hdd_debugfs_connect.c +++ b/core/hdd/src/wlan_hdd_debugfs_connect.c @@ -374,7 +374,7 @@ wlan_hdd_connect_info_debugfs(struct hdd_adapter *adapter, uint8_t *buf, QDF_MAC_ADDR_ARRAY(conn_info->bssid.bytes), conn_info->connect_time, conn_info->auth_time, - conn_info->freq, + conn_info->chan_freq, hdd_ch_width_str(conn_info->ch_width), conn_info->signal, tx_bit_rate, diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 8fc284d4349c..d8a6d1593c64 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -3165,7 +3165,7 @@ QDF_STATUS wlan_hdd_get_channel_for_sap_restart( policy_mgr_valid_sap_conc_channel_check( hdd_ctx->psoc, &intf_ch, sap_ch, vdev_id))) { hdd_debug("can't move sap to chan(freq): %u", - hdd_sta_ctx->conn_info.freq); + hdd_sta_ctx->conn_info.chan_freq); return QDF_STATUS_E_FAILURE; } } @@ -3687,12 +3687,9 @@ int wlan_hdd_set_channel(struct wiphy *wiphy, roam_profile = hdd_roam_profile(adapter); num_ch = roam_profile->ChannelInfo.numOfChannels = 1; - sta_ctx->conn_info.channel = channel; - sta_ctx->conn_info.freq = - wlan_reg_chan_to_freq(hdd_ctx->pdev, - channel); + sta_ctx->conn_info.chan_freq = chandef->chan->center_freq; roam_profile->ChannelInfo.freq_list = - &sta_ctx->conn_info.freq; + &sta_ctx->conn_info.chan_freq; } else if ((adapter->device_mode == QDF_SAP_MODE) || (adapter->device_mode == QDF_P2P_GO_MODE) ) { diff --git a/core/hdd/src/wlan_hdd_ioctl.c b/core/hdd/src/wlan_hdd_ioctl.c index 43383155d143..2ae86562314c 100644 --- a/core/hdd/src/wlan_hdd_ioctl.c +++ b/core/hdd/src/wlan_hdd_ioctl.c @@ -747,7 +747,7 @@ int hdd_reassoc(struct hdd_adapter *adapter, const uint8_t *bssid, QDF_MAC_ADDR_SIZE)) { hdd_warn("Reassoc BSSID is same as currently associated AP bssid"); channel = wlan_reg_freq_to_chan(hdd_ctx->pdev, - sta_ctx->conn_info.freq); + sta_ctx->conn_info.chan_freq); } /* Check channel number is a valid channel number */ @@ -965,7 +965,7 @@ hdd_sendactionframe(struct hdd_adapter *adapter, const uint8_t *bssid, if (!qdf_mem_cmp(vendor->Oui, oui, 3)) { conn_info_channel = wlan_reg_freq_to_chan( hdd_ctx->pdev, - sta_ctx->conn_info.freq); + sta_ctx->conn_info.chan_freq); /* * if the channel number is different from operating * channel then no need to send action frame @@ -993,7 +993,7 @@ hdd_sendactionframe(struct hdd_adapter *adapter, const uint8_t *bssid, * 0 is accepted as current home channel, * delayed transmission of action frame is ok. */ - chan.center_freq = sta_ctx->conn_info.freq; + chan.center_freq = sta_ctx->conn_info.chan_freq; } } } @@ -4368,7 +4368,7 @@ static int drv_cmd_fast_reassoc(struct hdd_adapter *adapter, if (roaming_offload_enabled(hdd_ctx)) { channel = wlan_reg_freq_to_chan( hdd_ctx->pdev, - sta_ctx->conn_info.freq); + sta_ctx->conn_info.chan_freq); hdd_wma_send_fastreassoc_cmd(adapter, bssid, channel); } else { diff --git a/core/hdd/src/wlan_hdd_ipa.c b/core/hdd/src/wlan_hdd_ipa.c index 3c2e4db4b79c..4fe7c0aba660 100644 --- a/core/hdd/src/wlan_hdd_ipa.c +++ b/core/hdd/src/wlan_hdd_ipa.c @@ -78,7 +78,7 @@ void hdd_ipa_set_tx_flow_info(void) sta_ctx->conn_info.conn_state) { staChannel = wlan_reg_freq_to_chan( hdd_ctx->pdev, - sta_ctx->conn_info.freq); + sta_ctx->conn_info.chan_freq); qdf_copy_macaddr(&staBssid, &sta_ctx->conn_info.bssid); #ifdef QCA_LL_LEGACY_TX_FLOW_CONTROL @@ -92,7 +92,7 @@ void hdd_ipa_set_tx_flow_info(void) sta_ctx->conn_info.conn_state) { p2pChannel = wlan_reg_freq_to_chan( hdd_ctx->pdev, - sta_ctx->conn_info.freq); + sta_ctx->conn_info.chan_freq); qdf_copy_macaddr(&p2pBssid, &sta_ctx->conn_info.bssid); p2pMode = "CLI"; diff --git a/core/hdd/src/wlan_hdd_lpass.c b/core/hdd/src/wlan_hdd_lpass.c index 27bf52045fba..58b67c6cf0ed 100644 --- a/core/hdd/src/wlan_hdd_lpass.c +++ b/core/hdd/src/wlan_hdd_lpass.c @@ -140,7 +140,7 @@ static int wlan_hdd_gen_wlan_status_pack(struct wlan_status_data *data, if (sta_ctx) { data->is_connected = is_connected; data->rssi = adapter->rssi; - data->freq = sta_ctx->conn_info.freq; + data->freq = sta_ctx->conn_info.chan_freq; if (WLAN_SVC_MAX_SSID_LEN >= sta_ctx->conn_info.ssid.SSID.length) { data->ssid_len = sta_ctx->conn_info.ssid.SSID.length; diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index f8ee7ee1d01c..97e0c4073257 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -915,7 +915,7 @@ uint8_t hdd_get_adapter_home_channel(struct hdd_adapter *adapter) home_channel = wlan_reg_freq_to_chan( hdd_ctx->pdev, - adapter->session.station.conn_info.freq); + adapter->session.station.conn_info.chan_freq); } return home_channel; @@ -4683,9 +4683,7 @@ QDF_STATUS hdd_init_station_mode(struct hdd_adapter *adapter) status = sme_config_fast_roaming(mac_handle, adapter->vdev_id, true); /* Set the default operation channel */ - sta_ctx->conn_info.channel = - hdd_ctx->config->operating_channel; - sta_ctx->conn_info.freq = + sta_ctx->conn_info.chan_freq = wlan_reg_chan_to_freq( hdd_ctx->pdev, hdd_ctx->config->operating_channel); @@ -7346,33 +7344,8 @@ uint8_t hdd_get_operating_channel(struct hdd_context *hdd_ctx, hdd_for_each_adapter(hdd_ctx, adapter) { if (mode == adapter->device_mode) { - switch (adapter->device_mode) { - case QDF_STA_MODE: - case QDF_P2P_CLIENT_MODE: - if (hdd_conn_is_connected - (WLAN_HDD_GET_STATION_CTX_PTR - (adapter))) { - operatingChannel = - (WLAN_HDD_GET_STATION_CTX_PTR - (adapter))->conn_info. - channel; - } - break; - case QDF_SAP_MODE: - case QDF_P2P_GO_MODE: - /* softap connection info */ - if (test_bit - (SOFTAP_BSS_STARTED, - &adapter->event_flags)) - operatingChannel = - (WLAN_HDD_GET_AP_CTX_PTR - (adapter))->operating_channel; - break; - default: - break; - } - - /* Found the device of interest. break the loop */ + operatingChannel = + hdd_get_adapter_home_channel(adapter); break; } } diff --git a/core/hdd/src/wlan_hdd_station_info.c b/core/hdd/src/wlan_hdd_station_info.c index 4e68b569dc0e..601fcd1e9cba 100644 --- a/core/hdd/src/wlan_hdd_station_info.c +++ b/core/hdd/src/wlan_hdd_station_info.c @@ -469,7 +469,7 @@ static int32_t hdd_add_survey_info(struct sk_buff *skb, if (!nla_attr) goto fail; if (nla_put_u32(skb, NL80211_SURVEY_INFO_FREQUENCY, - hdd_sta_ctx->cache_conn_info.freq) || + hdd_sta_ctx->cache_conn_info.chan_freq) || nla_put_u8(skb, NL80211_SURVEY_INFO_NOISE, (hdd_sta_ctx->cache_conn_info.noise + 100))) { hdd_err("put fail"); @@ -594,7 +594,7 @@ static int hdd_get_station_info(struct hdd_context *hdd_ctx, nl_buf_len += sizeof(hdd_sta_ctx-> cache_conn_info.last_ssid.SSID.length) + QDF_MAC_ADDR_SIZE + - sizeof(hdd_sta_ctx->cache_conn_info.freq) + + sizeof(hdd_sta_ctx->cache_conn_info.chan_freq) + sizeof(hdd_sta_ctx->cache_conn_info.noise) + sizeof(hdd_sta_ctx->cache_conn_info.signal) + (sizeof(uint32_t) * 2) + diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c index 5eaf0c6eee92..2b8dd8cad86c 100644 --- a/core/hdd/src/wlan_hdd_wext.c +++ b/core/hdd/src/wlan_hdd_wext.c @@ -7442,7 +7442,7 @@ static int __iw_setnone_getnone(struct net_device *dev, uint8_t operating_ch = wlan_reg_freq_to_chan( hdd_ctx->pdev, - adapter->session.station.conn_info.freq); + adapter->session.station.conn_info.chan_freq); tCsrRoamModifyProfileFields mod_fields; sme_get_modify_profile_fields(mac_handle, adapter->vdev_id,