qcacmn: Add support for DBDC repeater

Added CDP callback APIs so the DBDC repeater module
outside of cmn_dev can add, delete and update the AST
entries. Also with this change the sending of wds cmds
to fw is tied to adding AST, deleteing AST and updating
the AST entries.

Change-Id: I48d31962236860f50e16b771abaf3b8825b798df
This commit is contained in:
Tallapragada Kalyan 2018-01-02 12:58:33 +05:30 • committed by snandini
commit 57b6bb3e1d
10 changed files with 503 additions and 76 deletions

View file

@ -257,6 +257,138 @@ static inline void cdp_peer_setup
peer);
}
static inline int cdp_peer_add_ast
(ol_txrx_soc_handle soc, struct cdp_peer *peer_handle,
uint8_t *mac_addr, enum cdp_txrx_ast_entry_type type, uint32_t flags)
{
if (!soc || !soc->ops) {
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
"%s: Invalid Instance:", __func__);
QDF_BUG(0);
return 0;
}
if (!soc->ops->cmn_drv_ops ||
!soc->ops->cmn_drv_ops->txrx_peer_add_ast)
return 0;
return soc->ops->cmn_drv_ops->txrx_peer_add_ast(soc,
peer_handle,
mac_addr,
type,
flags);
}
static inline int cdp_peer_update_ast
(ol_txrx_soc_handle soc, void *ast_handle,
struct cdp_peer *peer_handle, uint32_t flags)
{
if (!soc || !soc->ops) {
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
"%s: Invalid Instance:", __func__);
QDF_BUG(0);
return 0;
}
if (!soc->ops->cmn_drv_ops ||
!soc->ops->cmn_drv_ops->txrx_peer_update_ast)
return 0;
return soc->ops->cmn_drv_ops->txrx_peer_update_ast(soc,
peer_handle,
ast_handle,
flags);
}
static inline void cdp_peer_del_ast
(ol_txrx_soc_handle soc, void *ast_handle)
{
if (!soc || !soc->ops) {
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
"%s: Invalid Instance:", __func__);
QDF_BUG(0);
return;
}
if (!soc->ops->cmn_drv_ops ||
!soc->ops->cmn_drv_ops->txrx_peer_del_ast)
return;
soc->ops->cmn_drv_ops->txrx_peer_del_ast(soc, ast_handle);
}
static inline void *cdp_peer_ast_hash_find
(ol_txrx_soc_handle soc, uint8_t *ast_mac_addr)
{
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_peer_ast_hash_find)
return NULL;
return soc->ops->cmn_drv_ops->txrx_peer_ast_hash_find(soc,
ast_mac_addr);
}
static inline uint8_t cdp_peer_ast_get_pdev_id
(ol_txrx_soc_handle soc, void *ast_handle)
{
if (!soc || !soc->ops) {
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
"%s: Invalid Instance:", __func__);
QDF_BUG(0);
return 0xff;
}
if (!soc->ops->cmn_drv_ops ||
!soc->ops->cmn_drv_ops->txrx_peer_ast_get_pdev_id)
return 0xff;
return soc->ops->cmn_drv_ops->txrx_peer_ast_get_pdev_id(soc,
ast_handle);
}
static inline uint8_t cdp_peer_ast_get_next_hop
(ol_txrx_soc_handle soc, void *ast_handle)
{
if (!soc || !soc->ops) {
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
"%s: Invalid Instance:", __func__);
QDF_BUG(0);
return 0xff;
}
if (!soc->ops->cmn_drv_ops ||
!soc->ops->cmn_drv_ops->txrx_peer_ast_get_next_hop)
return 0xff;
return soc->ops->cmn_drv_ops->txrx_peer_ast_get_next_hop(soc,
ast_handle);
}
static inline void cdp_peer_ast_set_type
(ol_txrx_soc_handle soc, void *ast_handle,
enum cdp_txrx_ast_entry_type type)
{
if (!soc || !soc->ops) {
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
"%s: Invalid Instance:", __func__);
QDF_BUG(0);
return;
}
if (!soc->ops->cmn_drv_ops ||
!soc->ops->cmn_drv_ops->txrx_peer_ast_set_type)
return;
soc->ops->cmn_drv_ops->txrx_peer_ast_set_type(soc, ast_handle, type);
}
static inline void cdp_peer_teardown
(ol_txrx_soc_handle soc, struct cdp_vdev *vdev, void *peer)
{

View file

@ -274,9 +274,10 @@ enum ol_txrx_peer_state {
*/
enum cdp_txrx_ast_entry_type {
CDP_TXRX_AST_TYPE_NONE, /* static ast entry for connected peer */
CDP_TXRX_AST_TYPE_STATIC,/* static ast entry for connected peer */
CDP_TXRX_AST_TYPE_STATIC, /* static ast entry for connected peer */
CDP_TXRX_AST_TYPE_WDS, /* WDS peer ast entry type*/
CDP_TXRX_AST_TYPE_MEC, /* Multicast echo ast entry type */
CDP_TXRX_AST_TYPE_WDS_HM, /* HM WDS entry */
CDP_TXRX_AST_TYPE_MAX
};

View file

@ -80,6 +80,31 @@ struct cdp_cmn_ops {
void (*txrx_peer_teardown)
(struct cdp_vdev *vdev_hdl, void *peer_hdl);
int (*txrx_peer_add_ast)
(ol_txrx_soc_handle soc, struct cdp_peer *peer_hdl,
uint8_t *mac_addr, enum cdp_txrx_ast_entry_type type,
uint32_t flags);
void (*txrx_peer_del_ast)
(ol_txrx_soc_handle soc, void *ast_hdl);
int (*txrx_peer_update_ast)
(ol_txrx_soc_handle soc, struct cdp_peer *peer_hdl,
void *ast_hdl, uint32_t flags);
void *(*txrx_peer_ast_hash_find)
(ol_txrx_soc_handle soc, uint8_t *ast_mac_addr);
uint8_t (*txrx_peer_ast_get_pdev_id)
(ol_txrx_soc_handle soc, void *ast_hdl);
uint8_t (*txrx_peer_ast_get_next_hop)
(ol_txrx_soc_handle soc, void *ast_hdl);
void (*txrx_peer_ast_set_type)
(ol_txrx_soc_handle soc, void *ast_hdl,
enum cdp_txrx_ast_entry_type type);
void (*txrx_peer_delete)(void *peer, uint32_t bitmap);
int (*txrx_set_monitor_mode)(struct cdp_vdev *vdev,
@ -636,13 +661,13 @@ struct ol_if_ops {
int (*peer_unref_delete)(void *scn_handle, uint8_t vdev_id,
uint8_t *peer_macaddr);
bool (*is_hw_dbs_2x2_capable)(struct wlan_objmgr_psoc *psoc);
int (*peer_add_wds_entry)(void *ol_osif_vdev_handle,
int (*peer_add_wds_entry)(void *ol_soc_handle,
const uint8_t *dest_macaddr, uint8_t *peer_macaddr,
uint32_t flags);
int (*peer_update_wds_entry)(void *ol_osif_vdev_handle,
int (*peer_update_wds_entry)(void *ol_soc_handle,
uint8_t *dest_macaddr, uint8_t *peer_macaddr,
uint32_t flags);
void (*peer_del_wds_entry)(void *ol_osif_vdev_handle,
void (*peer_del_wds_entry)(void *ol_soc_handle,
uint8_t *wds_macaddr);
QDF_STATUS (*lro_hash_config)(void *scn_handle,
struct cdp_lro_hash_config *lro_hash);