qcacld-3.0: Clean up the usage of sta_to_adapter in HDD

The mapping of sta_id to the adapter in hdd context stores the adapter
with respect to the corresponding sta_id. Currently, the mapping is not
used anywhere in the driver even though the adapters are stored in it.

As there is no usage for the mapping, remove it as a part of sta_id
cleanup effort.

Change-Id: I26590a69e61d82f723a83eb3f9f24c42afa6c5a2
CRs-Fixed: 2511767
This commit is contained in:
Sourav Mohapatra 2019-08-19 11:37:22 +05:30 • committed by nshrivas
commit efb49da46e
5 changed files with 2 additions and 48 deletions

View file

@ -1681,8 +1681,6 @@ struct hdd_context {
qdf_spinlock_t hdd_adapter_lock;
qdf_list_t hdd_adapters; /* List of adapters */
struct hdd_adapter *sta_to_adapter[HDD_MAX_ADAPTERS];
/** Pointer for firmware image data */
const struct firmware *fw;

View file

@ -1829,10 +1829,6 @@ static QDF_STATUS hdd_dis_connect_handler(struct hdd_adapter *adapter,
sta_id, status, status);
status = QDF_STATUS_E_FAILURE;
}
if (sta_id < HDD_MAX_ADAPTERS)
hdd_ctx->sta_to_adapter[sta_id] = NULL;
else
hdd_debug("invalid sta id %d", sta_id);
/* Clear all the peer sta register with TL. */
for (i = 0; i < MAX_PEERS; i++) {
if (HDD_WLAN_INVALID_STA_ID ==
@ -1855,10 +1851,7 @@ static QDF_STATUS hdd_dis_connect_handler(struct hdd_adapter *adapter,
HDD_WLAN_INVALID_STA_ID;
qdf_mem_zero(&sta_ctx->conn_info.peer_macaddr[i],
sizeof(struct qdf_mac_addr));
if (sta_id < HDD_MAX_ADAPTERS)
hdd_ctx->sta_to_adapter[sta_id] = NULL;
else
hdd_debug("invalid sta_id %d", sta_id);
}
} else {
sta_id = sta_ctx->conn_info.sta_id[0];
@ -1875,10 +1868,7 @@ static QDF_STATUS hdd_dis_connect_handler(struct hdd_adapter *adapter,
sme_remove_bssid_from_scan_list(mac_handle,
sta_ctx->conn_info.bssid.bytes);
}
if (sta_id < HDD_MAX_ADAPTERS)
hdd_ctx->sta_to_adapter[sta_id] = NULL;
else
hdd_debug("invalid sta_id %d", sta_id);
}
/* Clear saved connection information in HDD */
hdd_conn_remove_connect_info(sta_ctx);
@ -2897,10 +2887,6 @@ hdd_association_completion_handler(struct hdd_adapter *adapter,
sta_ctx->ft_carrier_on = false;
ft_carrier_on = true;
}
if (roam_info->staId < HDD_MAX_ADAPTERS)
hdd_ctx->sta_to_adapter[roam_info->staId] = adapter;
else
hdd_err("Wrong Staid: %d", roam_info->staId);
if (ucfg_ipa_is_enabled())
ucfg_ipa_wlan_evt(hdd_ctx->pdev, adapter->dev,
@ -3571,12 +3557,6 @@ static void hdd_roam_ibss_indication_handler(struct hdd_adapter *adapter,
hdd_sta_ctx->broadcast_sta_id = roam_info->staId;
if (roam_info->staId < HDD_MAX_ADAPTERS)
hdd_ctx->sta_to_adapter[roam_info->staId] =
adapter;
else
hdd_debug("invalid sta id %d", roam_info->staId);
hdd_roam_register_sta(adapter, roam_info,
roam_info->staId,
roam_info->bss_desc);
@ -3901,7 +3881,6 @@ roam_roam_connect_status_update_handler(struct hdd_adapter *adapter,
eRoamCmdStatus roam_status,
eCsrRoamResult roam_result)
{
struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
struct wlan_objmgr_vdev *vdev;
QDF_STATUS qdf_status;
@ -3928,11 +3907,6 @@ roam_roam_connect_status_update_handler(struct hdd_adapter *adapter,
break;
}
if (roam_info->staId < HDD_MAX_ADAPTERS)
hdd_ctx->sta_to_adapter[roam_info->staId] = adapter;
else
hdd_debug("invalid sta id %d", roam_info->staId);
if (hdd_is_key_install_required_for_ibss(encr_type))
roam_info->fAuthRequired = true;
@ -4010,11 +3984,6 @@ roam_roam_connect_status_update_handler(struct hdd_adapter *adapter,
hdd_roam_deregister_sta(adapter, roam_info->peerMac);
if (roam_info->staId < HDD_MAX_ADAPTERS)
hdd_ctx->sta_to_adapter[roam_info->staId] = NULL;
else
hdd_debug("invalid sta id %d", roam_info->staId);
sta_ctx->ibss_sta_generation++;
cfg80211_del_sta(adapter->dev,

View file

@ -654,7 +654,6 @@ int hdd_ndi_delete(uint8_t vdev_id, char *iface_name, uint16_t transaction_id)
}
/* Since, the interface is being deleted, remove the broadcast id. */
hdd_ctx->sta_to_adapter[sta_id] = NULL;
sta_ctx->broadcast_sta_id = HDD_WLAN_INVALID_STA_ID;
os_if_nan_set_ndp_delete_transaction_id(adapter->vdev,
@ -726,7 +725,6 @@ void hdd_ndi_drv_ndi_create_rsp_handler(uint8_t vdev_id,
sta_ctx->broadcast_sta_id = sta_id;
hdd_save_peer(sta_ctx, sta_id, &bc_mac_addr);
hdd_roam_register_sta(adapter, roam_info, sta_id, &tmp_bss_descp);
hdd_ctx->sta_to_adapter[sta_id] = adapter;
qdf_mem_free(roam_info);
}
@ -778,7 +776,6 @@ void hdd_ndi_drv_ndi_delete_rsp_handler(uint8_t vdev_id)
sta_id = sta_ctx->broadcast_sta_id;
if (sta_id < HDD_MAX_ADAPTERS) {
hdd_ctx->sta_to_adapter[sta_id] = NULL;
hdd_roam_deregister_sta(adapter, sta_ctx->requested_bssid);
hdd_delete_peer(sta_ctx, sta_id);
sta_ctx->broadcast_sta_id = HDD_WLAN_INVALID_STA_ID;
@ -849,7 +846,6 @@ int hdd_ndp_new_peer_handler(uint8_t vdev_id, uint16_t sta_id,
/* this function is called for each new peer */
hdd_roam_register_sta(adapter, roam_info, sta_id, &tmp_bss_descp);
hdd_ctx->sta_to_adapter[sta_id] = adapter;
/* perform following steps for first new peer ind */
if (fist_peer) {
hdd_info("Set ctx connection state to connected");
@ -906,7 +902,6 @@ void hdd_ndp_peer_departed_handler(uint8_t vdev_id, uint16_t sta_id,
hdd_roam_deregister_sta(adapter, *peer_mac_addr);
hdd_delete_peer(sta_ctx, sta_id);
hdd_ctx->sta_to_adapter[sta_id] = NULL;
if (last_peer) {
hdd_info("No more ndp peers.");

View file

@ -238,8 +238,6 @@ static int hdd_ocb_register_sta(struct hdd_adapter *adapter)
return -EINVAL;
}
hdd_ctx->sta_to_adapter[peer_id] = adapter;
/* To be cleaned up */
sta_desc.sta_id = peer_id;
WLAN_ADDR_COPY(sta_desc.peer_addr.bytes, adapter->mac_addr.bytes);

View file

@ -1052,7 +1052,6 @@ QDF_STATUS hdd_softap_deregister_sta(struct hdd_adapter *adapter,
spin_unlock_bh(&adapter->sta_info_lock);
}
hdd_ctx->sta_to_adapter[sta_id] = NULL;
ucfg_mlme_update_oce_flags(hdd_ctx->pdev);
return qdf_status;
@ -1108,9 +1107,6 @@ QDF_STATUS hdd_softap_register_sta(struct hdd_adapter *adapter,
else
qdf_copy_macaddr(&txrx_desc.peer_addr, sta_mac);
/* Save the adapter Pointer for this sta_id */
hdd_ctx->sta_to_adapter[sta_id] = adapter;
qdf_status = hdd_softap_init_tx_rx_sta(adapter, sta_id, sta_mac);
txrx_desc.is_qos_enabled = wmm_enabled;
@ -1206,7 +1202,6 @@ QDF_STATUS hdd_softap_register_bc_sta(struct hdd_adapter *adapter,
bool privacy_required)
{
QDF_STATUS qdf_status = QDF_STATUS_E_FAILURE;
struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
struct qdf_mac_addr broadcast_macaddr = QDF_MAC_ADDR_BCAST_INIT;
struct hdd_ap_ctx *ap_ctx;
uint8_t sta_id;
@ -1218,7 +1213,6 @@ QDF_STATUS hdd_softap_register_bc_sta(struct hdd_adapter *adapter,
return qdf_status;
}
hdd_ctx->sta_to_adapter[sta_id] = adapter;
qdf_status = hdd_softap_register_sta(adapter, false,
privacy_required, sta_id,
&broadcast_macaddr, 0);