qca-wifi: Add fdb entry add and refresh API
Add an API for bridge fdb add and refresh. Change-Id: Ifc8124c344d1b2bfa6c50532c0a12f5692cec625
This commit is contained in:
@@ -29,6 +29,19 @@
|
||||
#include <net/cfg80211.h>
|
||||
#include <br_private.h>
|
||||
|
||||
/**
|
||||
* qca_multi_link_entry_type - bridge entry type
|
||||
* @QCA_MULTI_LINK_ENTRY_USER_ADDED: Entry added by user
|
||||
* @QCA_MULTI_LINK_ENTRY_LOCAL: Local permanent bridge entry
|
||||
* @QCA_MULTI_LINK_ENTRY_STATIC: Permanent non-ARP type entry
|
||||
*/
|
||||
typedef enum qca_multi_link_entry_type {
|
||||
QCA_MULTI_LINK_ENTRY_NONE = 0,
|
||||
QCA_MULTI_LINK_ENTRY_USER_ADDED,
|
||||
QCA_MULTI_LINK_ENTRY_LOCAL,
|
||||
QCA_MULTI_LINK_ENTRY_STATIC,
|
||||
} qca_multi_link_entry_type_t;
|
||||
|
||||
typedef struct qca_multi_link_tbl_entry {
|
||||
struct wireless_dev *qal_fdb_ieee80211_ptr;
|
||||
struct net_device *qal_fdb_dev;
|
||||
@@ -58,6 +71,17 @@ int qca_multi_link_tbl_get_eth_entries(struct net_device *net_dev,
|
||||
*/
|
||||
struct net_device *qca_multi_link_tbl_find_sta_or_ap(struct net_device *net_dev, uint8_t dev_type);
|
||||
|
||||
/**
|
||||
*
|
||||
* qca_multi_link_tbl_add_or_refresh_entry() - Add or refresh a bridge entry
|
||||
*
|
||||
* To be called from the code with a valid netdevice
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS qca_multi_link_tbl_add_or_refresh_entry(struct net_device *net_dev, uint8_t *addr,
|
||||
qca_multi_link_entry_type_t entry_type);
|
||||
|
||||
/**
|
||||
*
|
||||
* qca_multi_link_tbl_delete_entry() - Delete a non-local bridge fdb entry
|
||||
|
@@ -129,6 +129,36 @@ struct net_device *qca_multi_link_tbl_find_sta_or_ap(struct net_device *net_dev,
|
||||
|
||||
qdf_export_symbol(qca_multi_link_tbl_find_sta_or_ap);
|
||||
|
||||
QDF_STATUS qca_multi_link_tbl_add_or_refresh_entry(struct net_device *net_dev, uint8_t *addr,
|
||||
qca_multi_link_entry_type_t entry_type)
|
||||
{
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 24)
|
||||
int status;
|
||||
uint16_t state = NUD_NONE;
|
||||
|
||||
if (entry_type == QCA_MULTI_LINK_ENTRY_USER_ADDED) {
|
||||
state = NUD_REACHABLE;
|
||||
} else if (entry_type == QCA_MULTI_LINK_ENTRY_LOCAL) {
|
||||
state = NUD_PERMANENT;
|
||||
} else if (entry_type == QCA_MULTI_LINK_ENTRY_STATIC) {
|
||||
state = NUD_NOARP;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 24)
|
||||
status = br_fdb_add_or_refresh_by_netdev(net_dev, addr, 0, state);
|
||||
if (status < 0) {
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
#else
|
||||
/* Use 5.4-specific API */
|
||||
qdf_info("Needs alternative implementation");
|
||||
#endif
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
qdf_export_symbol(qca_multi_link_tbl_add_or_refresh_entry);
|
||||
|
||||
QDF_STATUS qca_multi_link_tbl_delete_entry(struct net_device *net_dev, uint8_t *addr)
|
||||
{
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 24)
|
||||
|
مرجع در شماره جدید
Block a user