qcacld-3.0: Define API to retrieve adapter by interface name

Define HDD API to get adapter by interface name. This will be used in
NDI + NDI and similar scenarios.

Change-Id: Icd7fb7c60c67e73aa030752b2e6840853a242fc9
CRs-Fixed: 2032704
This commit is contained in:
Naveen Rawat 2017-04-12 10:09:17 -07:00 • committed by Sandeep Puligilla
commit 4edb682f08
2 changed files with 37 additions and 0 deletions

View file

@ -1993,6 +1993,18 @@ const char *hdd_get_fwpath(void);
void hdd_indicate_mgmt_frame(tSirSmeMgmtFrameInd *frame_ind);
hdd_adapter_t *hdd_get_adapter_by_sme_session_id(hdd_context_t *hdd_ctx,
uint32_t sme_session_id);
/**
* hdd_get_adapter_by_iface_name() - Return adapter with given interface name
* @hdd_ctx: hdd context.
* @iface_name: interface name
*
* This function is used to get the adapter with given interface name
*
* Return: adapter pointer if found, NULL otherwise
*
*/
hdd_adapter_t *hdd_get_adapter_by_iface_name(hdd_context_t *hdd_ctx,
const char *iface_name);
enum phy_ch_width hdd_map_nl_chan_width(enum nl80211_chan_width ch_width);
uint8_t wlan_hdd_find_opclass(tHalHandle hal, uint8_t channel,
uint8_t bw_offset);

View file

@ -4749,6 +4749,31 @@ hdd_adapter_t *hdd_get_adapter_by_sme_session_id(hdd_context_t *hdd_ctx,
return NULL;
}
hdd_adapter_t *hdd_get_adapter_by_iface_name(hdd_context_t *hdd_ctx,
const char *iface_name)
{
hdd_adapter_list_node_t *adapter_node = NULL, *next = NULL;
hdd_adapter_t *adapter;
QDF_STATUS qdf_status;
qdf_status = hdd_get_front_adapter(hdd_ctx, &adapter_node);
while ((NULL != adapter_node) &&
(QDF_STATUS_SUCCESS == qdf_status)) {
adapter = adapter_node->pAdapter;
if (adapter &&
!qdf_str_cmp(adapter->dev->name, iface_name))
return adapter;
qdf_status =
hdd_get_next_adapter(hdd_ctx,
adapter_node, &next);
adapter_node = next;
}
return NULL;
}
/**
* hdd_get_adapter() - to get adapter matching the mode
* @hdd_ctx: hdd context