|
@@ -342,12 +342,13 @@ struct dp_ast_entry *dp_peer_ast_hash_find(struct dp_soc *soc,
|
|
|
* @mac_addr: MAC address of ast node
|
|
|
* @hw_peer_id: HW AST Index returned by target in peer map event
|
|
|
* @vdev_id: vdev id for VAP to which the peer belongs to
|
|
|
+ * @ast_hash: ast hash value in HW
|
|
|
*
|
|
|
* Return: None
|
|
|
*/
|
|
|
static inline void dp_peer_map_ast(struct dp_soc *soc,
|
|
|
struct dp_peer *peer, uint8_t *mac_addr, uint16_t hw_peer_id,
|
|
|
- uint8_t vdev_id)
|
|
|
+ uint8_t vdev_id, uint16_t ast_hash)
|
|
|
{
|
|
|
struct dp_ast_entry *ast_entry;
|
|
|
enum cdp_txrx_ast_entry_type peer_type = CDP_TXRX_AST_TYPE_STATIC;
|
|
@@ -372,6 +373,7 @@ static inline void dp_peer_map_ast(struct dp_soc *soc,
|
|
|
ast_entry->is_active = TRUE;
|
|
|
peer_type = ast_entry->type;
|
|
|
ast_entry_found = TRUE;
|
|
|
+ ast_entry->ast_hash_value = ast_hash;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -677,7 +679,7 @@ static int dp_peer_ast_hash_attach(struct dp_soc *soc)
|
|
|
|
|
|
static inline void dp_peer_map_ast(struct dp_soc *soc,
|
|
|
struct dp_peer *peer, uint8_t *mac_addr, uint16_t hw_peer_id,
|
|
|
- uint8_t vdev_id)
|
|
|
+ uint8_t vdev_id, uint16_t ast_hash)
|
|
|
{
|
|
|
return;
|
|
|
}
|
|
@@ -947,7 +949,14 @@ static inline struct dp_peer *dp_peer_find_add_id(struct dp_soc *soc,
|
|
|
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_INFO,
|
|
|
"%s: ref_cnt: %d", __func__,
|
|
|
qdf_atomic_read(&peer->ref_cnt));
|
|
|
- soc->peer_id_to_obj_map[peer_id] = peer;
|
|
|
+ if (!soc->peer_id_to_obj_map[peer_id])
|
|
|
+ soc->peer_id_to_obj_map[peer_id] = peer;
|
|
|
+ else {
|
|
|
+ /* Peer map event came for peer_id which
|
|
|
+ * is already mapped, this is not expected
|
|
|
+ */
|
|
|
+ QDF_ASSERT(0);
|
|
|
+ }
|
|
|
|
|
|
if (dp_peer_find_add_id_to_obj(peer, peer_id)) {
|
|
|
/* TBDXXX: assert for now */
|
|
@@ -965,8 +974,10 @@ static inline struct dp_peer *dp_peer_find_add_id(struct dp_soc *soc,
|
|
|
* @soc_handle - genereic soc handle
|
|
|
* @peeri_id - peer_id from firmware
|
|
|
* @hw_peer_id - ast index for this peer
|
|
|
- * vdev_id - vdev ID
|
|
|
- * peer_mac_addr - macc assress of the peer
|
|
|
+ * @vdev_id - vdev ID
|
|
|
+ * @peer_mac_addr - mac address of the peer
|
|
|
+ * @ast_hash - ast hash value
|
|
|
+ * @is_wds - flag to indicate peer map event for WDS ast entry
|
|
|
*
|
|
|
* associate the peer_id that firmware provided with peer entry
|
|
|
* and update the ast table in the host with the hw_peer_id.
|
|
@@ -975,8 +986,10 @@ static inline struct dp_peer *dp_peer_find_add_id(struct dp_soc *soc,
|
|
|
*/
|
|
|
|
|
|
void
|
|
|
-dp_rx_peer_map_handler(void *soc_handle, uint16_t peer_id, uint16_t hw_peer_id,
|
|
|
- uint8_t vdev_id, uint8_t *peer_mac_addr)
|
|
|
+dp_rx_peer_map_handler(void *soc_handle, uint16_t peer_id,
|
|
|
+ uint16_t hw_peer_id, uint8_t vdev_id,
|
|
|
+ uint8_t *peer_mac_addr, uint16_t ast_hash,
|
|
|
+ uint8_t is_wds)
|
|
|
{
|
|
|
struct dp_soc *soc = (struct dp_soc *)soc_handle;
|
|
|
struct dp_peer *peer = NULL;
|
|
@@ -988,50 +1001,66 @@ dp_rx_peer_map_handler(void *soc_handle, uint16_t peer_id, uint16_t hw_peer_id,
|
|
|
peer_mac_addr[2], peer_mac_addr[3], peer_mac_addr[4],
|
|
|
peer_mac_addr[5], vdev_id);
|
|
|
|
|
|
- peer = soc->peer_id_to_obj_map[peer_id];
|
|
|
-
|
|
|
if ((hw_peer_id < 0) || (hw_peer_id > (WLAN_UMAC_PSOC_MAX_PEERS * 2))) {
|
|
|
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
|
|
|
"invalid hw_peer_id: %d", hw_peer_id);
|
|
|
qdf_assert_always(0);
|
|
|
}
|
|
|
|
|
|
- /*
|
|
|
- * check if peer already exists for this peer_id, if so
|
|
|
- * this peer map event is in response for a wds peer add
|
|
|
- * wmi command sent during wds source port learning.
|
|
|
- * in this case just add the ast entry to the existing
|
|
|
- * peer ast_list.
|
|
|
+ /* Peer map event for WDS ast entry get the peer from
|
|
|
+ * obj map
|
|
|
*/
|
|
|
- if (!peer)
|
|
|
+ if (is_wds) {
|
|
|
+ peer = soc->peer_id_to_obj_map[peer_id];
|
|
|
+ } else {
|
|
|
peer = dp_peer_find_add_id(soc, peer_mac_addr, peer_id,
|
|
|
- hw_peer_id, vdev_id);
|
|
|
+ hw_peer_id, vdev_id);
|
|
|
|
|
|
- if (peer) {
|
|
|
- qdf_assert_always(peer->vdev);
|
|
|
- /*
|
|
|
- * For every peer MAp message search and set if bss_peer
|
|
|
- */
|
|
|
- if (!(qdf_mem_cmp(peer->mac_addr.raw, peer->vdev->mac_addr.raw,
|
|
|
- DP_MAC_ADDR_LEN))) {
|
|
|
- QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_INFO_HIGH,
|
|
|
- "vdev bss_peer!!!!");
|
|
|
- peer->bss_peer = 1;
|
|
|
- peer->vdev->vap_bss_peer = peer;
|
|
|
+ if (peer) {
|
|
|
+ /*
|
|
|
+ * For every peer MAp message search and set if bss_peer
|
|
|
+ */
|
|
|
+ if (!(qdf_mem_cmp(peer->mac_addr.raw,
|
|
|
+ peer->vdev->mac_addr.raw,
|
|
|
+ DP_MAC_ADDR_LEN))) {
|
|
|
+ QDF_TRACE(QDF_MODULE_ID_DP,
|
|
|
+ QDF_TRACE_LEVEL_INFO_HIGH,
|
|
|
+ "vdev bss_peer!!!!");
|
|
|
+ peer->bss_peer = 1;
|
|
|
+ peer->vdev->vap_bss_peer = peer;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (peer->vdev->opmode == wlan_op_mode_sta)
|
|
|
+ peer->vdev->bss_ast_hash = ast_hash;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
dp_peer_map_ast(soc, peer, peer_mac_addr,
|
|
|
- hw_peer_id, vdev_id);
|
|
|
+ hw_peer_id, vdev_id, ast_hash);
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * dp_rx_peer_unmap_handler() - handle peer unmap event from firmware
|
|
|
+ * @soc_handle - genereic soc handle
|
|
|
+ * @peeri_id - peer_id from firmware
|
|
|
+ * @vdev_id - vdev ID
|
|
|
+ * @peer_mac_addr - mac address of the peer
|
|
|
+ * @is_wds - flag to indicate peer map event for WDS ast entry
|
|
|
+ *
|
|
|
+ * Return: none
|
|
|
+ */
|
|
|
void
|
|
|
-dp_rx_peer_unmap_handler(void *soc_handle, uint16_t peer_id)
|
|
|
+dp_rx_peer_unmap_handler(void *soc_handle, uint16_t peer_id,
|
|
|
+ uint8_t vdev_id, uint8_t *peer_mac_addr,
|
|
|
+ uint8_t is_wds)
|
|
|
{
|
|
|
struct dp_peer *peer;
|
|
|
struct dp_soc *soc = (struct dp_soc *)soc_handle;
|
|
|
uint8_t i;
|
|
|
|
|
|
+ if (is_wds)
|
|
|
+ return;
|
|
|
+
|
|
|
peer = __dp_peer_find_by_id(soc, peer_id);
|
|
|
|
|
|
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_INFO_HIGH,
|