qcacld-3.0: Modify callers of ObjMgr APIs to include pdev_id

wlan_objmgr_get_vdev_by_macaddr_from_psoc and wlan_objmgr_get_peer
API's definitions have been changed to include pdev_id as an
argument.

Modify the callers of these APIs to include pdev_id as argument.

Change-Id: I3d0de6a0bc1dfefbe1b3cad51ec23f703baaf3ad
CRs-Fixed: 2210728
This commit is contained in:
Vignesh Viswanathan
2018-03-15 16:42:17 +05:30
committed by nshrivas
parent 3f553c4267
commit ad47f0a2a8
4 changed files with 35 additions and 5 deletions

View File

@@ -359,7 +359,9 @@ int hdd_objmgr_remove_peer_object(struct wlan_objmgr_vdev *vdev,
uint8_t *mac_addr) uint8_t *mac_addr)
{ {
struct wlan_objmgr_psoc *psoc; struct wlan_objmgr_psoc *psoc;
struct wlan_objmgr_pdev *pdev;
struct wlan_objmgr_peer *peer; struct wlan_objmgr_peer *peer;
uint8_t pdev_id;
if (!vdev) { if (!vdev) {
hdd_err("vdev NULL"); hdd_err("vdev NULL");
@@ -374,7 +376,16 @@ int hdd_objmgr_remove_peer_object(struct wlan_objmgr_vdev *vdev,
return -EINVAL; return -EINVAL;
} }
peer = wlan_objmgr_get_peer(psoc, mac_addr, WLAN_HDD_ID_OBJ_MGR); pdev = wlan_vdev_get_pdev(vdev);
if (!pdev) {
hdd_err("pdev NULL");
QDF_ASSERT(0);
return -EINVAL;
}
pdev_id = wlan_objmgr_pdev_get_pdev_id(pdev);
peer = wlan_objmgr_get_peer(psoc, pdev_id, mac_addr,
WLAN_HDD_ID_OBJ_MGR);
if (peer) { if (peer) {
wlan_objmgr_peer_obj_delete(peer); wlan_objmgr_peer_obj_delete(peer);

View File

@@ -834,6 +834,7 @@ QDF_STATUS sap_goto_channel_sel(struct sap_context *sap_context,
struct scan_start_request *req; struct scan_start_request *req;
struct wlan_objmgr_vdev *vdev; struct wlan_objmgr_vdev *vdev;
uint8_t i; uint8_t i;
uint8_t pdev_id;
#ifdef SOFTAP_CHANNEL_RANGE #ifdef SOFTAP_CHANNEL_RANGE
uint8_t *channel_list = NULL; uint8_t *channel_list = NULL;
@@ -979,8 +980,10 @@ QDF_STATUS sap_goto_channel_sel(struct sap_context *sap_context,
FL("Failed to allocate memory")); FL("Failed to allocate memory"));
return QDF_STATUS_E_NOMEM; return QDF_STATUS_E_NOMEM;
} }
vdev = wlan_objmgr_get_vdev_by_macaddr_from_psoc(
mac_ctx->psoc, pdev_id = wlan_objmgr_pdev_get_pdev_id(mac_ctx->pdev);
vdev = wlan_objmgr_get_vdev_by_macaddr_from_psoc(mac_ctx->psoc,
pdev_id,
sap_context->self_mac_addr, sap_context->self_mac_addr,
WLAN_LEGACY_SME_ID); WLAN_LEGACY_SME_ID);
if (!vdev) { if (!vdev) {

View File

@@ -2215,6 +2215,7 @@ QDF_STATUS csr_scan_for_ssid(tpAniSirGlobal mac_ctx, uint32_t session_id,
struct scan_start_request *req; struct scan_start_request *req;
struct wlan_objmgr_vdev *vdev; struct wlan_objmgr_vdev *vdev;
uint8_t i, chan, num_chan = 0; uint8_t i, chan, num_chan = 0;
uint8_t pdev_id;
wlan_scan_id scan_id; wlan_scan_id scan_id;
struct csr_roam_session *session = CSR_GET_SESSION(mac_ctx, session_id); struct csr_roam_session *session = CSR_GET_SESSION(mac_ctx, session_id);
@@ -2230,6 +2231,12 @@ QDF_STATUS csr_scan_for_ssid(tpAniSirGlobal mac_ctx, uint32_t session_id,
return status; return status;
} }
if (!mac_ctx->pdev) {
sme_err("pdev ctx is NULL");
return status;
}
pdev_id = wlan_objmgr_pdev_get_pdev_id(mac_ctx->pdev);
session->scan_info.profile = session->scan_info.profile =
qdf_mem_malloc(sizeof(struct csr_roam_profile)); qdf_mem_malloc(sizeof(struct csr_roam_profile));
if (!session->scan_info.profile) if (!session->scan_info.profile)
@@ -2250,7 +2257,9 @@ QDF_STATUS csr_scan_for_ssid(tpAniSirGlobal mac_ctx, uint32_t session_id,
FL("Failed to allocate memory")); FL("Failed to allocate memory"));
goto error; goto error;
} }
vdev = wlan_objmgr_get_vdev_by_macaddr_from_psoc(mac_ctx->psoc, vdev = wlan_objmgr_get_vdev_by_macaddr_from_psoc(mac_ctx->psoc,
pdev_id,
session->selfMacAddr.bytes, session->selfMacAddr.bytes,
WLAN_LEGACY_SME_ID); WLAN_LEGACY_SME_ID);
ucfg_scan_init_default_params(vdev, req); ucfg_scan_init_default_params(vdev, req);

View File

@@ -2369,6 +2369,7 @@ QDF_STATUS wma_tx_packet(void *wma_context, void *tx_frame, uint16_t frmLen,
struct wlan_objmgr_psoc *psoc; struct wlan_objmgr_psoc *psoc;
void *mac_addr; void *mac_addr;
bool is_5g = false; bool is_5g = false;
uint8_t pdev_id;
if (NULL == wma_handle) { if (NULL == wma_handle) {
WMA_LOGE("wma_handle is NULL"); WMA_LOGE("wma_handle is NULL");
@@ -2743,12 +2744,18 @@ QDF_STATUS wma_tx_packet(void *wma_context, void *tx_frame, uint16_t frmLen,
goto error; goto error;
} }
if (!wma_handle->pdev) {
WMA_LOGE("%s: pdev ctx is NULL", __func__);
goto error;
}
pdev_id = wlan_objmgr_pdev_get_pdev_id(wma_handle->pdev);
wh = (struct ieee80211_frame *)(qdf_nbuf_data(tx_frame)); wh = (struct ieee80211_frame *)(qdf_nbuf_data(tx_frame));
mac_addr = wh->i_addr1; mac_addr = wh->i_addr1;
peer = wlan_objmgr_get_peer(psoc, mac_addr, WLAN_MGMT_NB_ID); peer = wlan_objmgr_get_peer(psoc, pdev_id, mac_addr, WLAN_MGMT_NB_ID);
if (!peer) { if (!peer) {
mac_addr = wh->i_addr2; mac_addr = wh->i_addr2;
peer = wlan_objmgr_get_peer(psoc, mac_addr, peer = wlan_objmgr_get_peer(psoc, pdev_id, mac_addr,
WLAN_MGMT_NB_ID); WLAN_MGMT_NB_ID);
} }