qcacmn: cdp: Converge cdp_cmn_ops
Currently cdp ops are given pdev/vdev/peer handle as its arguments, which is directly accessed in those APIs. This can cause a race-condition in access of the respective handles if it has been deleted in parallel. Hence as a part of cdp convergence, pass only the pdev_id or vdev_id or peer mac address, which will be used to get the respective handles, and hence avoiding the unwanted access of the handles if it has been deleted. - txrx_peer_unmap_sync_cb_set - txrx_fw_stats_get - txrx_get_ctrl_pdev_from_vdev - txrx_get_mon_vdev_from_pdev Change-Id: I4472dc0905edb7700acb4401b117c8876ba455f3 CRs-Fixed: 2541460
This commit is contained in:

committed by
nshrivas

parent
61392d0275
commit
27e7bb4d79
@@ -112,7 +112,7 @@ static inline struct cdp_cfg
|
||||
/**
|
||||
* cdp_cfg_vdev_rx_set_intrabss_fwd() - enable/disable intra bass forwarding
|
||||
* @soc - data path soc handle
|
||||
* @vdev - virtual interface instance
|
||||
* @vdev_id - virtual interface id
|
||||
* @val - enable or disable intra bss forwarding
|
||||
*
|
||||
* ap isolate, do not forward intra bss traffic
|
||||
@@ -121,7 +121,7 @@ static inline struct cdp_cfg
|
||||
*/
|
||||
static inline void
|
||||
cdp_cfg_vdev_rx_set_intrabss_fwd(ol_txrx_soc_handle soc,
|
||||
struct cdp_vdev *vdev, bool val)
|
||||
uint8_t vdev_id, bool val)
|
||||
{
|
||||
if (!soc || !soc->ops) {
|
||||
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG,
|
||||
@@ -134,7 +134,7 @@ cdp_cfg_vdev_rx_set_intrabss_fwd(ol_txrx_soc_handle soc,
|
||||
!soc->ops->cfg_ops->vdev_rx_set_intrabss_fwd)
|
||||
return;
|
||||
|
||||
soc->ops->cfg_ops->vdev_rx_set_intrabss_fwd(vdev, val);
|
||||
soc->ops->cfg_ops->vdev_rx_set_intrabss_fwd(soc, vdev_id, val);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -295,8 +295,17 @@ static inline struct cdp_pdev *cdp_pdev_attach
|
||||
pdev_id);
|
||||
}
|
||||
|
||||
static inline int cdp_pdev_post_attach(ol_txrx_soc_handle soc,
|
||||
struct cdp_pdev *pdev)
|
||||
/**
|
||||
* cdp_pdev_post_attach() - attach the data SW state
|
||||
* @soc: datapath soc handle
|
||||
* @pdev_id: the data physical device id being removed
|
||||
*
|
||||
* This function is used when the WLAN driver is being loaded to
|
||||
* attach the host data component within the driver.
|
||||
*
|
||||
* Return: 0 for success or error code
|
||||
*/
|
||||
static inline int cdp_pdev_post_attach(ol_txrx_soc_handle soc, uint8_t pdev_id)
|
||||
{
|
||||
if (!soc || !soc->ops) {
|
||||
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
||||
@@ -309,11 +318,24 @@ static inline int cdp_pdev_post_attach(ol_txrx_soc_handle soc,
|
||||
!soc->ops->cmn_drv_ops->txrx_pdev_post_attach)
|
||||
return 0;
|
||||
|
||||
return soc->ops->cmn_drv_ops->txrx_pdev_post_attach(pdev);
|
||||
return soc->ops->cmn_drv_ops->txrx_pdev_post_attach(soc, pdev_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* cdp_pdev_pre_detach() - detach the data SW state
|
||||
* @soc: datapath soc handle
|
||||
* @pdev_id: the data physical device id being removed
|
||||
* @force: delete the pdev (and its vdevs and peers) even if
|
||||
* there are outstanding references by the target to the vdevs
|
||||
* and peers within the pdev
|
||||
*
|
||||
* This function is used when the WLAN driver is being removed to
|
||||
* detach the host data component within the driver.
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
static inline void
|
||||
cdp_pdev_pre_detach(ol_txrx_soc_handle soc, struct cdp_pdev *pdev, int force)
|
||||
cdp_pdev_pre_detach(ol_txrx_soc_handle soc, uint8_t pdev_id, int force)
|
||||
{
|
||||
if (!soc || !soc->ops) {
|
||||
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
||||
@@ -326,7 +348,7 @@ cdp_pdev_pre_detach(ol_txrx_soc_handle soc, struct cdp_pdev *pdev, int force)
|
||||
!soc->ops->cmn_drv_ops->txrx_pdev_pre_detach)
|
||||
return;
|
||||
|
||||
soc->ops->cmn_drv_ops->txrx_pdev_pre_detach(pdev, force);
|
||||
soc->ops->cmn_drv_ops->txrx_pdev_pre_detach(soc, pdev_id, force);
|
||||
}
|
||||
|
||||
static inline QDF_STATUS
|
||||
@@ -706,8 +728,18 @@ cdp_peer_delete(ol_txrx_soc_handle soc, uint8_t vdev_id,
|
||||
soc->ops->cmn_drv_ops->txrx_peer_delete(soc, vdev_id, peer_mac, bitmap);
|
||||
}
|
||||
|
||||
/**
|
||||
* cdp_peer_detach_sync() - peer detach sync callback
|
||||
* @soc: datapath soc handle
|
||||
* @vdev_id: virtual device/interface id
|
||||
* @peer_mac: peer mac address
|
||||
* @peer_unmap_sync: peer unmap sync cb.
|
||||
* @bitmap: bitmap indicating special handling of request.
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
static inline void
|
||||
cdp_peer_delete_sync(ol_txrx_soc_handle soc, void *peer,
|
||||
cdp_peer_delete_sync(ol_txrx_soc_handle soc, uint8_t vdev_id, uint8_t *peer_mac,
|
||||
QDF_STATUS(*delete_cb)(
|
||||
uint8_t vdev_id,
|
||||
uint32_t peerid_cnt,
|
||||
@@ -725,7 +757,7 @@ cdp_peer_delete_sync(ol_txrx_soc_handle soc, void *peer,
|
||||
!soc->ops->cmn_drv_ops->txrx_peer_delete_sync)
|
||||
return;
|
||||
|
||||
soc->ops->cmn_drv_ops->txrx_peer_delete_sync(peer,
|
||||
soc->ops->cmn_drv_ops->txrx_peer_delete_sync(soc, vdev_id, peer_mac,
|
||||
delete_cb,
|
||||
bitmap);
|
||||
}
|
||||
@@ -881,9 +913,17 @@ cdp_mgmt_tx_cb_set(ol_txrx_soc_handle soc, uint8_t pdev_id,
|
||||
(soc, pdev_id, type, download_cb, ota_ack_cb, ctxt);
|
||||
}
|
||||
|
||||
/**
|
||||
* cdp_peer_unmap_sync_cb_set() - set peer unmap sync callback
|
||||
* @soc: datapath soc handle
|
||||
* @pdev_id: physical device instance id
|
||||
* @peer_unmap_sync: peer unmap sync callback
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
static inline void
|
||||
cdp_peer_unmap_sync_cb_set(ol_txrx_soc_handle soc,
|
||||
struct cdp_pdev *pdev,
|
||||
uint8_t pdev_id,
|
||||
QDF_STATUS(*unmap_resp_cb)(
|
||||
uint8_t vdev_id,
|
||||
uint32_t peerid_cnt,
|
||||
@@ -900,7 +940,8 @@ cdp_peer_unmap_sync_cb_set(ol_txrx_soc_handle soc,
|
||||
!soc->ops->cmn_drv_ops->txrx_peer_unmap_sync_cb_set)
|
||||
return;
|
||||
|
||||
soc->ops->cmn_drv_ops->txrx_peer_unmap_sync_cb_set(pdev, unmap_resp_cb);
|
||||
soc->ops->cmn_drv_ops->txrx_peer_unmap_sync_cb_set(soc, pdev_id,
|
||||
unmap_resp_cb);
|
||||
}
|
||||
|
||||
static inline int cdp_get_tx_pending(ol_txrx_soc_handle soc,
|
||||
@@ -921,8 +962,16 @@ struct cdp_pdev *pdev)
|
||||
return soc->ops->cmn_drv_ops->txrx_get_tx_pending(pdev);
|
||||
}
|
||||
|
||||
/*
|
||||
* cdp_data_tx_cb_set(): set the callback for non standard tx
|
||||
* @soc - datapath soc handle
|
||||
* @vdev_id - virtual device/interface id
|
||||
* @callback - callback function
|
||||
* @ctxt: callback context
|
||||
*
|
||||
*/
|
||||
static inline void
|
||||
cdp_data_tx_cb_set(ol_txrx_soc_handle soc, struct cdp_vdev *data_vdev,
|
||||
cdp_data_tx_cb_set(ol_txrx_soc_handle soc, uint8_t vdev_id,
|
||||
ol_txrx_data_tx_cb callback, void *ctxt)
|
||||
{
|
||||
if (!soc || !soc->ops) {
|
||||
@@ -936,7 +985,7 @@ cdp_data_tx_cb_set(ol_txrx_soc_handle soc, struct cdp_vdev *data_vdev,
|
||||
!soc->ops->cmn_drv_ops->txrx_data_tx_cb_set)
|
||||
return;
|
||||
|
||||
soc->ops->cmn_drv_ops->txrx_data_tx_cb_set(data_vdev,
|
||||
soc->ops->cmn_drv_ops->txrx_data_tx_cb_set(soc, vdev_id,
|
||||
callback, ctxt);
|
||||
}
|
||||
|
||||
@@ -1053,8 +1102,16 @@ static inline void cdp_print_level_set(ol_txrx_soc_handle soc, unsigned level)
|
||||
soc->ops->cmn_drv_ops->txrx_print_level_set(level);
|
||||
}
|
||||
|
||||
/*
|
||||
* cdp_get_vdev_mac_addr() – Detach txrx peer
|
||||
* @soc_hdl: Datapath soc handle
|
||||
* @vdev_id: virtual device/interface id
|
||||
*
|
||||
* Return: MAC address on success, NULL on failure.
|
||||
*
|
||||
*/
|
||||
static inline uint8_t *
|
||||
cdp_get_vdev_mac_addr(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
|
||||
cdp_get_vdev_mac_addr(ol_txrx_soc_handle soc, uint8_t vdev_id)
|
||||
{
|
||||
if (!soc || !soc->ops) {
|
||||
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
||||
@@ -1067,63 +1124,14 @@ cdp_get_vdev_mac_addr(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
|
||||
!soc->ops->cmn_drv_ops->txrx_get_vdev_mac_addr)
|
||||
return NULL;
|
||||
|
||||
return soc->ops->cmn_drv_ops->txrx_get_vdev_mac_addr(vdev);
|
||||
return soc->ops->cmn_drv_ops->txrx_get_vdev_mac_addr(soc, vdev_id);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* cdp_get_vdev_struct_mac_addr() - Return handle to struct qdf_mac_addr of
|
||||
* vdev
|
||||
* @vdev: vdev handle
|
||||
*
|
||||
* Return: Handle to struct qdf_mac_addr
|
||||
*/
|
||||
static inline struct qdf_mac_addr *cdp_get_vdev_struct_mac_addr
|
||||
(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
|
||||
{
|
||||
if (!soc || !soc->ops) {
|
||||
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
||||
"%s: Invalid Instance:", __func__);
|
||||
QDF_BUG(0);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!soc->ops->cmn_drv_ops ||
|
||||
!soc->ops->cmn_drv_ops->txrx_get_vdev_struct_mac_addr)
|
||||
return NULL;
|
||||
|
||||
return soc->ops->cmn_drv_ops->txrx_get_vdev_struct_mac_addr
|
||||
(vdev);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* cdp_get_pdev_from_vdev() - Return handle to pdev of vdev
|
||||
* @vdev: vdev handle
|
||||
*
|
||||
* Return: Handle to pdev
|
||||
*/
|
||||
static inline struct cdp_pdev *cdp_get_pdev_from_vdev
|
||||
(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
|
||||
{
|
||||
if (!soc || !soc->ops) {
|
||||
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
||||
"%s: Invalid Instance:", __func__);
|
||||
QDF_BUG(0);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!soc->ops->cmn_drv_ops ||
|
||||
!soc->ops->cmn_drv_ops->txrx_get_pdev_from_vdev)
|
||||
return NULL;
|
||||
|
||||
return soc->ops->cmn_drv_ops->txrx_get_pdev_from_vdev(vdev);
|
||||
}
|
||||
|
||||
/**
|
||||
* cdp_get_os_rx_handles_from_vdev() - Return os rx handles for a vdev
|
||||
* @soc: ol_txrx_soc_handle handle
|
||||
* @vdev: vdev for which os rx handles are needed
|
||||
* @vdev_id: vdev id for which os rx handles are needed
|
||||
* @stack_fn_p: pointer to stack function pointer
|
||||
* @osif_handle_p: pointer to ol_osif_vdev_handle
|
||||
*
|
||||
@@ -1131,7 +1139,7 @@ static inline struct cdp_pdev *cdp_get_pdev_from_vdev
|
||||
*/
|
||||
static inline
|
||||
void cdp_get_os_rx_handles_from_vdev(ol_txrx_soc_handle soc,
|
||||
struct cdp_vdev *vdev,
|
||||
uint8_t vdev_id,
|
||||
ol_txrx_rx_fp *stack_fn_p,
|
||||
ol_osif_vdev_handle *osif_handle_p)
|
||||
{
|
||||
@@ -1146,19 +1154,20 @@ void cdp_get_os_rx_handles_from_vdev(ol_txrx_soc_handle soc,
|
||||
!soc->ops->cmn_drv_ops->txrx_get_os_rx_handles_from_vdev)
|
||||
return;
|
||||
|
||||
soc->ops->cmn_drv_ops->txrx_get_os_rx_handles_from_vdev(vdev,
|
||||
soc->ops->cmn_drv_ops->txrx_get_os_rx_handles_from_vdev(soc, vdev_id,
|
||||
stack_fn_p,
|
||||
osif_handle_p);
|
||||
}
|
||||
|
||||
/**
|
||||
* cdp_get_ctrl_pdev_from_vdev() - Return control pdev of vdev
|
||||
* @vdev: vdev handle
|
||||
* @soc: datapath soc handle
|
||||
* @vdev_id: virtual device/interface id
|
||||
*
|
||||
* Return: Handle to control pdev
|
||||
*/
|
||||
static inline struct cdp_cfg *
|
||||
cdp_get_ctrl_pdev_from_vdev(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
|
||||
cdp_get_ctrl_pdev_from_vdev(ol_txrx_soc_handle soc, uint8_t vdev_id)
|
||||
{
|
||||
if (!soc || !soc->ops) {
|
||||
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
||||
@@ -1171,26 +1180,32 @@ cdp_get_ctrl_pdev_from_vdev(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
|
||||
!soc->ops->cmn_drv_ops->txrx_get_ctrl_pdev_from_vdev)
|
||||
return NULL;
|
||||
|
||||
return soc->ops->cmn_drv_ops->txrx_get_ctrl_pdev_from_vdev
|
||||
(vdev);
|
||||
return soc->ops->cmn_drv_ops->txrx_get_ctrl_pdev_from_vdev(soc,
|
||||
vdev_id);
|
||||
}
|
||||
|
||||
static inline struct cdp_vdev *
|
||||
cdp_get_mon_vdev_from_pdev(ol_txrx_soc_handle soc, struct cdp_pdev *pdev)
|
||||
/*
|
||||
* cdp_get_mon_vdev_from_pdev() - Get vdev handle of monitor mode
|
||||
* @soc: datapath soc handle
|
||||
* @pdev_id: physical device instance id
|
||||
*
|
||||
* Return: virtual interface id
|
||||
*/
|
||||
static inline uint8_t
|
||||
cdp_get_mon_vdev_from_pdev(ol_txrx_soc_handle soc, uint8_t pdev_id)
|
||||
{
|
||||
if (!soc || !soc->ops) {
|
||||
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
||||
"%s: Invalid Instance:", __func__);
|
||||
QDF_BUG(0);
|
||||
return NULL;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!soc->ops->cmn_drv_ops ||
|
||||
!soc->ops->cmn_drv_ops->txrx_get_mon_vdev_from_pdev)
|
||||
return NULL;
|
||||
return -EINVAL;
|
||||
|
||||
return soc->ops->cmn_drv_ops->txrx_get_mon_vdev_from_pdev
|
||||
(pdev);
|
||||
return soc->ops->cmn_drv_ops->txrx_get_mon_vdev_from_pdev(soc, pdev_id);
|
||||
}
|
||||
|
||||
static inline void
|
||||
|
@@ -83,10 +83,11 @@ struct cdp_cmn_ops {
|
||||
(ol_txrx_soc_handle soc, HTC_HANDLE htc_pdev,
|
||||
qdf_device_t osdev, uint8_t pdev_id);
|
||||
|
||||
int (*txrx_pdev_post_attach)(struct cdp_pdev *pdev);
|
||||
int (*txrx_pdev_post_attach)(struct cdp_soc_t *soc, uint8_t pdev_id);
|
||||
|
||||
void
|
||||
(*txrx_pdev_pre_detach)(struct cdp_pdev *pdev, int force);
|
||||
(*txrx_pdev_pre_detach)(struct cdp_soc_t *soc, uint8_t pdev_id,
|
||||
int force);
|
||||
|
||||
QDF_STATUS
|
||||
(*txrx_pdev_detach)(struct cdp_soc_t *psoc, uint8_t pdev_id,
|
||||
@@ -157,18 +158,18 @@ struct cdp_cmn_ops {
|
||||
QDF_STATUS (*txrx_set_monitor_mode)(struct cdp_soc_t *soc,
|
||||
uint8_t vdev_id,
|
||||
uint8_t smart_monitor);
|
||||
void (*txrx_peer_delete_sync)(void *peer,
|
||||
void (*txrx_peer_delete_sync)(struct cdp_soc_t *soc, uint8_t vdev_id,
|
||||
uint8_t *peer_mac,
|
||||
QDF_STATUS(*delete_cb)(
|
||||
uint8_t vdev_id,
|
||||
uint32_t peerid_cnt,
|
||||
uint16_t *peerid_list),
|
||||
uint32_t bitmap);
|
||||
|
||||
void (*txrx_peer_unmap_sync_cb_set)(struct cdp_pdev *pdev,
|
||||
QDF_STATUS(*unmap_resp_cb)(
|
||||
uint8_t vdev_id,
|
||||
uint32_t peerid_cnt,
|
||||
uint16_t *peerid_list));
|
||||
void (*txrx_peer_unmap_sync_cb_set)(struct cdp_soc_t *soc_hdl,
|
||||
uint8_t pdev_id,
|
||||
ol_txrx_peer_unmap_sync_cb
|
||||
peer_unmap_sync);
|
||||
|
||||
uint8_t (*txrx_get_pdev_id_frm_pdev)(struct cdp_pdev *pdev);
|
||||
bool (*txrx_get_vow_config_frm_pdev)(struct cdp_pdev *pdev);
|
||||
@@ -264,7 +265,7 @@ struct cdp_cmn_ops {
|
||||
* done being transmitted
|
||||
*/
|
||||
|
||||
void (*txrx_data_tx_cb_set)(struct cdp_vdev *data_vdev,
|
||||
void (*txrx_data_tx_cb_set)(struct cdp_soc_t *soc, uint8_t vdev_id,
|
||||
ol_txrx_data_tx_cb callback, void *ctxt);
|
||||
|
||||
/*******************************************************************
|
||||
@@ -291,48 +292,33 @@ struct cdp_cmn_ops {
|
||||
|
||||
/**
|
||||
* ol_txrx_get_vdev_mac_addr() - Return mac addr of vdev
|
||||
* @vdev: vdev handle
|
||||
* @soc: datapath soc handle
|
||||
* @vdev_id: vdev id
|
||||
*
|
||||
* Return: vdev mac address
|
||||
*/
|
||||
uint8_t * (*txrx_get_vdev_mac_addr)(struct cdp_vdev *vdev);
|
||||
|
||||
/**
|
||||
* ol_txrx_get_vdev_struct_mac_addr() - Return handle to struct qdf_mac_addr of
|
||||
* vdev
|
||||
* @vdev: vdev handle
|
||||
*
|
||||
* Return: Handle to struct qdf_mac_addr
|
||||
*/
|
||||
struct qdf_mac_addr *
|
||||
(*txrx_get_vdev_struct_mac_addr)(struct cdp_vdev *vdev);
|
||||
|
||||
/**
|
||||
* ol_txrx_get_pdev_from_vdev() - Return handle to pdev of vdev
|
||||
* @vdev: vdev handle
|
||||
*
|
||||
* Return: Handle to pdev
|
||||
*/
|
||||
struct cdp_pdev *(*txrx_get_pdev_from_vdev)
|
||||
(struct cdp_vdev *vdev);
|
||||
uint8_t * (*txrx_get_vdev_mac_addr)(struct cdp_soc_t *soc,
|
||||
uint8_t vdev_id);
|
||||
|
||||
/**
|
||||
* ol_txrx_get_ctrl_pdev_from_vdev() - Return control pdev of vdev
|
||||
* @vdev: vdev handle
|
||||
* @soc: datapath soc handle
|
||||
* @vdev_id: vdev id
|
||||
*
|
||||
* Return: Handle to control pdev
|
||||
*/
|
||||
struct cdp_cfg *
|
||||
(*txrx_get_ctrl_pdev_from_vdev)(struct cdp_vdev *vdev);
|
||||
struct cdp_cfg *(*txrx_get_ctrl_pdev_from_vdev)(struct cdp_soc_t *soc,
|
||||
uint8_t vdev_id);
|
||||
|
||||
/**
|
||||
* txrx_get_mon_vdev_from_pdev() - Return monitor mode vdev
|
||||
* @pdev: pdev handle
|
||||
* @soc: datapath soc handle
|
||||
* @pdev: pdev id
|
||||
*
|
||||
* Return: Handle to vdev
|
||||
* Return: vdev_id
|
||||
*/
|
||||
struct cdp_vdev *
|
||||
(*txrx_get_mon_vdev_from_pdev)(struct cdp_pdev *pdev);
|
||||
uint8_t (*txrx_get_mon_vdev_from_pdev)(struct cdp_soc_t *soc,
|
||||
uint8_t pdev_id);
|
||||
|
||||
void (*txrx_soc_detach)(struct cdp_soc_t *soc);
|
||||
|
||||
@@ -488,12 +474,14 @@ struct cdp_cmn_ops {
|
||||
/**
|
||||
* txrx_get_os_rx_handles_from_vdev() - Return function, osif vdev
|
||||
* to deliver pkt to stack.
|
||||
* @vdev: vdev handle
|
||||
* @soc: datapath soc handle
|
||||
* @vdev: vdev id
|
||||
* @stack_fn: pointer to - function pointer to deliver RX pkt to stack
|
||||
* @osif_vdev: pointer to - osif vdev to deliver RX packet to.
|
||||
*/
|
||||
void (*txrx_get_os_rx_handles_from_vdev)
|
||||
(struct cdp_vdev *vdev,
|
||||
(ol_txrx_soc_handle soc,
|
||||
uint8_t vdev_id,
|
||||
ol_txrx_rx_fp *stack_fn,
|
||||
ol_osif_vdev_handle *osif_vdev);
|
||||
int (*txrx_classify_update)
|
||||
@@ -1393,7 +1381,8 @@ struct cdp_cfg_ops {
|
||||
void (*set_cfg_packet_log_enabled)(struct cdp_cfg *cfg_pdev,
|
||||
uint8_t val);
|
||||
struct cdp_cfg * (*cfg_attach)(qdf_device_t osdev, void *cfg_param);
|
||||
void (*vdev_rx_set_intrabss_fwd)(struct cdp_vdev *vdev, bool val);
|
||||
void (*vdev_rx_set_intrabss_fwd)(struct cdp_soc_t *soc_hdl,
|
||||
uint8_t vdev_id, bool val);
|
||||
uint8_t (*is_rx_fwd_disabled)(struct cdp_vdev *vdev);
|
||||
void (*tx_set_is_mgmt_over_wmi_enabled)(uint8_t value);
|
||||
int (*is_high_latency)(struct cdp_cfg *cfg_pdev);
|
||||
|
@@ -468,19 +468,6 @@ uint32_t dp_soc_get_mon_mask_for_interrupt_mode(struct dp_soc *soc, int intr_ctx
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* dp_get_dp_vdev_from_cdp_vdev() - get dp_vdev from cdp_vdev by type-casting
|
||||
* @cdp_opaque_vdev: pointer to cdp_vdev
|
||||
*
|
||||
* Return: pointer to dp_vdev
|
||||
*/
|
||||
static
|
||||
struct dp_vdev *dp_get_dp_vdev_from_cdp_vdev(struct cdp_vdev *cdp_opaque_vdev)
|
||||
{
|
||||
return (struct dp_vdev *)cdp_opaque_vdev;
|
||||
}
|
||||
|
||||
|
||||
static int dp_peer_add_ast_wifi3(struct cdp_soc_t *soc_hdl,
|
||||
uint8_t vdev_id,
|
||||
uint8_t *peer_mac,
|
||||
@@ -6268,12 +6255,21 @@ static QDF_STATUS dp_peer_delete_wifi3(struct cdp_soc_t *soc, uint8_t vdev_id,
|
||||
|
||||
/*
|
||||
* dp_get_vdev_mac_addr_wifi3() – Detach txrx peer
|
||||
* @peer_handle: Datapath peer handle
|
||||
* @soc_hdl: Datapath soc handle
|
||||
* @vdev_id: virtual interface id
|
||||
*
|
||||
* Return: MAC address on success, NULL on failure.
|
||||
*
|
||||
*/
|
||||
static uint8 *dp_get_vdev_mac_addr_wifi3(struct cdp_vdev *pvdev)
|
||||
static uint8 *dp_get_vdev_mac_addr_wifi3(struct cdp_soc_t *soc_hdl,
|
||||
uint8_t vdev_id)
|
||||
{
|
||||
struct dp_vdev *vdev = (struct dp_vdev *)pvdev;
|
||||
struct dp_soc *soc = cdp_soc_t_to_dp_soc(soc_hdl);
|
||||
struct dp_vdev *vdev = dp_get_vdev_from_soc_vdev_id_wifi3(soc, vdev_id);
|
||||
|
||||
if (!vdev)
|
||||
return NULL;
|
||||
|
||||
return vdev->mac_addr.raw;
|
||||
}
|
||||
|
||||
@@ -6299,20 +6295,22 @@ static int dp_vdev_set_wds(struct cdp_soc_t *soc, uint8_t vdev_id, uint32_t val)
|
||||
}
|
||||
|
||||
/*
|
||||
* dp_get_mon_vdev_from_pdev_wifi3() - Get vdev handle of monitor mode
|
||||
* @dev: PDEV handle
|
||||
* dp_get_mon_vdev_from_pdev_wifi3() - Get vdev id of monitor mode
|
||||
* @soc_hdl: datapath soc handle
|
||||
* @pdev_id: physical device instance id
|
||||
*
|
||||
* Return: VDEV handle of monitor mode
|
||||
* Return: virtual interface id
|
||||
*/
|
||||
|
||||
static struct cdp_vdev *dp_get_mon_vdev_from_pdev_wifi3(struct cdp_pdev *dev)
|
||||
static uint8_t dp_get_mon_vdev_from_pdev_wifi3(struct cdp_soc_t *soc_hdl,
|
||||
uint8_t pdev_id)
|
||||
{
|
||||
struct dp_pdev *pdev = (struct dp_pdev *)dev;
|
||||
struct dp_soc *soc = cdp_soc_t_to_dp_soc(soc_hdl);
|
||||
struct dp_pdev *pdev = dp_get_pdev_from_soc_pdev_id_wifi3(soc, pdev_id);
|
||||
|
||||
if (qdf_unlikely(!pdev))
|
||||
return NULL;
|
||||
return -EINVAL;
|
||||
|
||||
return (struct cdp_vdev *)pdev->monitor_vdev;
|
||||
return pdev->monitor_vdev->vdev_id;
|
||||
}
|
||||
|
||||
static int dp_get_opmode(struct cdp_soc_t *soc_hdl, uint8_t vdev_id)
|
||||
@@ -6328,23 +6326,50 @@ static int dp_get_opmode(struct cdp_soc_t *soc_hdl, uint8_t vdev_id)
|
||||
return vdev->opmode;
|
||||
}
|
||||
|
||||
/**
|
||||
* dp_get_os_rx_handles_from_vdev_wifi3() - Get os rx handles for a vdev
|
||||
* @soc_hdl: ol_txrx_soc_handle handle
|
||||
* @vdev_id: vdev id for which os rx handles are needed
|
||||
* @stack_fn_p: pointer to stack function pointer
|
||||
* @osif_handle_p: pointer to ol_osif_vdev_handle
|
||||
*
|
||||
* Return: void
|
||||
*/
|
||||
static
|
||||
void dp_get_os_rx_handles_from_vdev_wifi3(struct cdp_vdev *pvdev,
|
||||
void dp_get_os_rx_handles_from_vdev_wifi3(struct cdp_soc_t *soc_hdl,
|
||||
uint8_t vdev_id,
|
||||
ol_txrx_rx_fp *stack_fn_p,
|
||||
ol_osif_vdev_handle *osif_vdev_p)
|
||||
{
|
||||
struct dp_vdev *vdev = dp_get_dp_vdev_from_cdp_vdev(pvdev);
|
||||
struct dp_soc *soc = cdp_soc_t_to_dp_soc(soc_hdl);
|
||||
struct dp_vdev *vdev = dp_get_vdev_from_soc_vdev_id_wifi3(soc, vdev_id);
|
||||
|
||||
if (!vdev)
|
||||
return;
|
||||
|
||||
qdf_assert(vdev);
|
||||
*stack_fn_p = vdev->osif_rx_stack;
|
||||
*osif_vdev_p = vdev->osif_vdev;
|
||||
}
|
||||
|
||||
static struct cdp_cfg *dp_get_ctrl_pdev_from_vdev_wifi3(struct cdp_vdev *pvdev)
|
||||
/**
|
||||
* dp_get_ctrl_pdev_from_vdev() - Get control pdev of vdev
|
||||
* @soc_hdl: datapath soc handle
|
||||
* @vdev_id: virtual device/interface id
|
||||
*
|
||||
* Return: Handle to control pdev
|
||||
*/
|
||||
static struct cdp_cfg *dp_get_ctrl_pdev_from_vdev_wifi3(
|
||||
struct cdp_soc_t *soc_hdl,
|
||||
uint8_t vdev_id)
|
||||
{
|
||||
struct dp_vdev *vdev = (struct dp_vdev *)pvdev;
|
||||
struct dp_pdev *pdev = vdev->pdev;
|
||||
struct dp_soc *soc = cdp_soc_t_to_dp_soc(soc_hdl);
|
||||
struct dp_vdev *vdev = dp_get_vdev_from_soc_vdev_id_wifi3(soc, vdev_id);
|
||||
struct dp_pdev *pdev;
|
||||
|
||||
if (!vdev || !vdev->pdev)
|
||||
return NULL;
|
||||
|
||||
pdev = vdev->pdev;
|
||||
return (struct cdp_cfg *)pdev->wlan_cfg_ctx;
|
||||
}
|
||||
|
||||
@@ -8840,16 +8865,21 @@ static struct cdp_wds_ops dp_ops_wds = {
|
||||
|
||||
/*
|
||||
* dp_txrx_data_tx_cb_set(): set the callback for non standard tx
|
||||
* @vdev_handle - datapath vdev handle
|
||||
* @soc_hdl - datapath soc handle
|
||||
* @vdev_id - virtual interface id
|
||||
* @callback - callback function
|
||||
* @ctxt: callback context
|
||||
*
|
||||
*/
|
||||
static void
|
||||
dp_txrx_data_tx_cb_set(struct cdp_vdev *vdev_handle,
|
||||
dp_txrx_data_tx_cb_set(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
|
||||
ol_txrx_data_tx_cb callback, void *ctxt)
|
||||
{
|
||||
struct dp_vdev *vdev = (struct dp_vdev *)vdev_handle;
|
||||
struct dp_soc *soc = cdp_soc_t_to_dp_soc(soc_hdl);
|
||||
struct dp_vdev *vdev = dp_get_vdev_from_soc_vdev_id_wifi3(soc, vdev_id);
|
||||
|
||||
if (!vdev)
|
||||
return;
|
||||
|
||||
vdev->tx_non_std_data_callback.func = callback;
|
||||
vdev->tx_non_std_data_callback.ctxt = ctxt;
|
||||
|
@@ -102,10 +102,13 @@ QDF_STATUS tgt_vdev_mgr_create_send(
|
||||
vdev_addr, vdev_id,
|
||||
cdp_txrx_opmode,
|
||||
cdp_txrx_subtype);
|
||||
if (!vdev_txrx_handle)
|
||||
if (!vdev_txrx_handle) {
|
||||
wlan_vdev_set_dp_handle(vdev, NULL);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
|
||||
} else {
|
||||
wlan_vdev_set_dp_handle(vdev, vdev_txrx_handle);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -290,7 +293,6 @@ QDF_STATUS tgt_vdev_mgr_up_send(
|
||||
QDF_STATUS status;
|
||||
struct wlan_lmac_if_mlme_tx_ops *txops;
|
||||
ol_txrx_soc_handle soc_txrx_handle;
|
||||
struct cdp_vdev *vdev_txrx_handle;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
struct wlan_objmgr_vdev *vdev;
|
||||
uint8_t vdev_id;
|
||||
@@ -311,8 +313,7 @@ QDF_STATUS tgt_vdev_mgr_up_send(
|
||||
/* cdp set rx and tx decap type */
|
||||
psoc = wlan_vdev_get_psoc(vdev);
|
||||
soc_txrx_handle = wlan_psoc_get_dp_handle(psoc);
|
||||
vdev_txrx_handle = wlan_vdev_get_dp_handle(vdev);
|
||||
if (!soc_txrx_handle || !vdev_txrx_handle)
|
||||
if (!soc_txrx_handle || vdev_id == WLAN_INVALID_VDEV_ID)
|
||||
return QDF_STATUS_E_INVAL;
|
||||
|
||||
status = txops->vdev_up_send(vdev, param);
|
||||
|
Reference in New Issue
Block a user