qcacmn: lmac header exclusion from wlan_objmgr_psoc_obj.h
Avoid inclusion of wlan_lmac_if_def headerfile in wlan_objmgr_psoc_obj.h which led to inclusion of several other components header files, so handling dependencies by adding a forward declaration. Change-Id: I9ad231152789a1d8d9c01fd772abe4a8b06ad0b4
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
#ifdef WLAN_CONV_SPECTRAL_ENABLE
|
||||
#include <wlan_spectral_utils_api.h>
|
||||
#endif
|
||||
|
||||
/* Function pointer to call DA/OL specific tx_ops registration function */
|
||||
QDF_STATUS (*wlan_global_lmac_if_tx_ops_register[MAX_DEV_TYPE])
|
||||
(struct wlan_lmac_if_tx_ops *tx_ops);
|
||||
@@ -124,7 +125,7 @@ wlan_global_lmac_if_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
|
||||
* Ex: rx_ops->fp = function;
|
||||
*/
|
||||
if (!rx_ops) {
|
||||
qdf_print("%s: lmac if rx ops pointer is NULL", __func__);
|
||||
qdf_err("lmac if rx ops pointer is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
/* Registeration for UMAC componets */
|
||||
@@ -152,19 +153,45 @@ QDF_STATUS wlan_global_lmac_if_open(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
WLAN_DEV_TYPE dev_type;
|
||||
|
||||
struct wlan_lmac_if_tx_ops *tx_ops;
|
||||
struct wlan_lmac_if_rx_ops *rx_ops;
|
||||
|
||||
if (!psoc) {
|
||||
qdf_err("psoc is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
tx_ops = qdf_mem_malloc(sizeof(*tx_ops));
|
||||
if (!tx_ops) {
|
||||
qdf_err("tx_ops is NULL");
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
}
|
||||
|
||||
rx_ops = qdf_mem_malloc(sizeof(*rx_ops));
|
||||
if (!rx_ops) {
|
||||
qdf_err("rx_ops is NULL");
|
||||
qdf_mem_free(tx_ops);
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
}
|
||||
|
||||
wlan_psoc_set_lmac_if_txops(psoc, tx_ops);
|
||||
wlan_psoc_set_lmac_if_rxops(psoc, rx_ops);
|
||||
|
||||
dev_type = psoc->soc_nif.phy_type;
|
||||
|
||||
if (dev_type == WLAN_DEV_DA || dev_type == WLAN_DEV_OL) {
|
||||
wlan_global_lmac_if_tx_ops_register[dev_type]
|
||||
(&psoc->soc_cb.tx_ops);
|
||||
(tx_ops);
|
||||
} else {
|
||||
/* Control should ideally not reach here */
|
||||
qdf_print("Invalid device type");
|
||||
qdf_mem_free(tx_ops);
|
||||
qdf_mem_free(rx_ops);
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
/* Function call to register rx-ops handlers */
|
||||
wlan_global_lmac_if_rx_ops_register(&psoc->soc_cb.rx_ops);
|
||||
wlan_global_lmac_if_rx_ops_register(rx_ops);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
@@ -180,8 +207,22 @@ qdf_export_symbol(wlan_global_lmac_if_open);
|
||||
*/
|
||||
QDF_STATUS wlan_global_lmac_if_close(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
qdf_mem_zero(&psoc->soc_cb.tx_ops, sizeof(psoc->soc_cb.tx_ops));
|
||||
qdf_mem_zero(&psoc->soc_cb.rx_ops, sizeof(psoc->soc_cb.rx_ops));
|
||||
struct wlan_lmac_if_tx_ops *tx_ops;
|
||||
struct wlan_lmac_if_rx_ops *rx_ops;
|
||||
|
||||
if (!psoc) {
|
||||
qdf_err("psoc is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
tx_ops = wlan_psoc_get_lmac_if_txops(psoc);
|
||||
rx_ops = wlan_psoc_get_lmac_if_rxops(psoc);
|
||||
|
||||
wlan_psoc_set_lmac_if_txops(psoc, NULL);
|
||||
wlan_psoc_set_lmac_if_rxops(psoc, NULL);
|
||||
|
||||
qdf_mem_free(tx_ops);
|
||||
qdf_mem_free(rx_ops);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
Reference in New Issue
Block a user