qcacmn: Send peer create to NSS only for connected peers

Send peer create to NSS only when peer map comes for connected peers.
When peer map comes for WDS peers only update WDS peer specific entries.

Change-Id: I32d785180bcd1dae2703d40b55f4536685f10439
This commit is contained in:
Radha krishna Simha Jiguru
2017-08-02 18:32:22 +05:30
committed by Gerrit - the friendly Code Review server
parent f80cf0eccb
commit f70f991f45
8 changed files with 36 additions and 18 deletions

View File

@@ -215,6 +215,16 @@ enum ol_txrx_peer_state {
OL_TXRX_PEER_STATE_AUTH, /* authentication successful */
};
/**
* struct ol_txrx_ast_type - AST entry type information
*/
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_WDS, /* WDS peer ast entry type*/
CDP_TXRX_AST_TYPE_MEC, /* Multicast echo ast entry type */
CDP_TXRX_AST_TYPE_MAX
};
/**
* struct cdp_sec_type - security type information

View File

@@ -618,7 +618,8 @@ struct ol_if_ops {
uint8_t (*rx_invalid_peer)(void *osif_pdev, void *msg);
int (*peer_map_event)(void *ol_soc_handle, uint16_t peer_id, uint16_t hw_peer_id,
uint8_t vdev_id, uint8_t *peer_mac_addr);
uint8_t vdev_id, uint8_t *peer_mac_addr,
enum cdp_txrx_ast_entry_type peer_type);
int (*peer_unmap_event)(void *ol_soc_handle, uint16_t peer_id);
int (*get_dp_cfg_param)(void *ol_soc_handle, enum cdp_cfg_param_type param_num);

View File

@@ -1489,7 +1489,7 @@ static void dp_wds_aging_timer_fn(void *soc_hdl)
/*
* Do not expire static ast entries
*/
if (ase->is_static)
if (ase->type == CDP_TXRX_AST_TYPE_STATIC)
continue;
if (ase->is_active) {

View File

@@ -354,17 +354,12 @@ static inline void dp_peer_map_ast(struct dp_soc *soc,
uint8_t vdev_id)
{
struct dp_ast_entry *ast_entry;
enum cdp_txrx_ast_entry_type peer_type = CDP_TXRX_AST_TYPE_NONE;
if (!peer) {
return;
}
if (soc->cdp_soc.ol_ops->peer_map_event) {
soc->cdp_soc.ol_ops->peer_map_event(soc->osif_soc,
peer->peer_ids[0], hw_peer_id, vdev_id,
mac_addr);
}
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
"%s: peer %p ID %d vid %d mac %02x:%02x:%02x:%02x:%02x:%02x\n",
__func__, peer, hw_peer_id, vdev_id, mac_addr[0],
@@ -378,7 +373,14 @@ static inline void dp_peer_map_ast(struct dp_soc *soc,
ast_entry->ast_idx = hw_peer_id;
soc->ast_table[hw_peer_id] = ast_entry;
ast_entry->is_active = TRUE;
peer_type = ast_entry->type;
qdf_spin_unlock_bh(&soc->ast_lock);
if (soc->cdp_soc.ol_ops->peer_map_event) {
soc->cdp_soc.ol_ops->peer_map_event(
soc->osif_soc, peer->peer_ids[0],
hw_peer_id, vdev_id,
mac_addr, peer_type);
}
return;
}
}
@@ -417,7 +419,7 @@ int dp_peer_add_ast(struct dp_soc *soc, struct dp_peer *peer,
/* If AST entry already exists , just return from here */
ast_entry = dp_peer_ast_hash_find(soc, mac_addr, 0);
if (ast_entry) {
if (ast_entry->is_mec)
if (ast_entry->type == CDP_TXRX_AST_TYPE_MEC)
ast_entry->is_active = TRUE;
qdf_spin_unlock_bh(&soc->ast_lock);
@@ -441,16 +443,15 @@ int dp_peer_add_ast(struct dp_soc *soc, struct dp_peer *peer,
switch (is_self) {
case 1:
peer->self_ast_entry = ast_entry;
ast_entry->is_static = TRUE;
ast_entry->type = CDP_TXRX_AST_TYPE_STATIC;
break;
case 0:
ast_entry->next_hop = 1;
ast_entry->is_static = FALSE;
ast_entry->type = CDP_TXRX_AST_TYPE_WDS;
break;
case 2:
ast_entry->is_mec = 1;
ast_entry->next_hop = 1;
ast_entry->is_static = FALSE;
ast_entry->type = CDP_TXRX_AST_TYPE_MEC;
break;
default:
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,

View File

@@ -372,7 +372,8 @@ dp_rx_null_q_desc_handle(struct dp_soc *soc, struct dp_rx_desc *rx_desc,
ase = dp_peer_ast_hash_find(soc, &data[DP_MAC_ADDR_LEN], 0);
if (ase) {
if (ase->is_mec || (ase->peer != peer)) {
if ((ase->type == CDP_TXRX_AST_TYPE_MEC) ||
(ase->peer != peer)) {
qdf_spin_unlock_bh(&soc->ast_lock);
QDF_TRACE(QDF_MODULE_ID_DP,
QDF_TRACE_LEVEL_INFO,

View File

@@ -1684,7 +1684,7 @@ static inline void dp_tx_comp_free_buf(struct dp_soc *soc,
* Return: none
*/
#ifdef FEATURE_WDS
static void dp_tx_mec_handler(struct dp_vdev *vdev, uint8_t *status)
void dp_tx_mec_handler(struct dp_vdev *vdev, uint8_t *status)
{
struct dp_soc *soc;

View File

@@ -149,6 +149,11 @@ uint32_t dp_tx_comp_handler(struct dp_soc *soc, uint32_t ring_id,
int32_t
dp_tx_prepare_send_me(struct dp_vdev *vdev, qdf_nbuf_t nbuf);
#ifdef FEATURE_WDS
void dp_tx_mec_handler(struct dp_vdev *vdev, uint8_t *status);
#endif
/* TODO TX_FEATURE_NOT_YET */
static inline void dp_tx_comp_process_exception(struct dp_tx_desc_s *tx_desc)
{

View File

@@ -515,8 +515,9 @@ union dp_align_mac_addr {
* @next_hop: Set to 1 if this is for a WDS node
* @is_active: flag to indicate active data traffic on this node
* (used for aging out/expiry)
* @is_static: flag to indicate static entry (should not be expired)
* @ase_list_elem: node in peer AST list
* @is_bss: flag to indicate if entry corresponds to bss peer
* @type: flag to indicate type of the entry(static/WDS/MEC)
* @hash_list_elem: node in soc AST hash list (mac address used as hash)
*/
struct dp_ast_entry {
@@ -526,9 +527,8 @@ struct dp_ast_entry {
struct dp_peer *peer;
bool next_hop;
bool is_active;
bool is_static;
bool is_mec;
bool is_bss;
enum cdp_txrx_ast_entry_type type;
TAILQ_ENTRY(dp_ast_entry) ase_list_elem;
TAILQ_ENTRY(dp_ast_entry) hash_list_elem;
};