void ath12k_dp_peer_cleanup(struct ath12k *ar, int vdev_id, const u8 *addr)
{
struct ath12k_base *ab = ar->ab;
- struct ath12k_peer *peer;
+ struct ath12k_dp_link_peer *peer;
/* TODO: Any other peer specific DP cleanup */
spin_lock_bh(&ab->base_lock);
- peer = ath12k_peer_find(ab, vdev_id, addr);
+ peer = ath12k_dp_link_peer_find_by_vdev_and_addr(ab, vdev_id, addr);
if (!peer) {
ath12k_warn(ab, "failed to lookup peer %pM on vdev %d\n",
addr, vdev_id);
int ath12k_dp_peer_setup(struct ath12k *ar, int vdev_id, const u8 *addr)
{
struct ath12k_base *ab = ar->ab;
- struct ath12k_peer *peer;
+ struct ath12k_dp_link_peer *peer;
u32 reo_dest;
int ret = 0, tid;
peer_clean:
spin_lock_bh(&ab->base_lock);
- peer = ath12k_peer_find(ab, vdev_id, addr);
+ peer = ath12k_dp_link_peer_find_by_vdev_and_addr(ab, vdev_id, addr);
if (!peer) {
ath12k_warn(ab, "failed to find the peer to del rx tid\n");
spin_unlock_bh(&ab->base_lock);
#define MAX_RXDMA_PER_PDEV 2
struct ath12k_base;
-struct ath12k_peer;
+struct ath12k_dp_link_peer;
struct ath12k_dp;
struct ath12k_vif;
struct ath12k_link_vif;
{
struct ath12k_dp *dp = dp_pdev->dp;
struct ath12k_base *ab = dp->ab;
- struct ath12k_peer *peer;
+ struct ath12k_dp_link_peer *peer;
struct ath12k_link_sta *arsta;
struct htt_ppdu_stats_user_rate *user_rate;
struct ath12k_per_peer_tx_stats *peer_stats = &dp_pdev->peer_tx_stats;
rcu_read_lock();
spin_lock_bh(&ab->base_lock);
- peer = ath12k_peer_find_by_id(ab, usr_stats->peer_id);
+ peer = ath12k_dp_link_peer_find_by_id(ab, usr_stats->peer_id);
if (!peer || !peer->sta) {
spin_unlock_bh(&ab->base_lock);
return;
}
- arsta = ath12k_peer_get_link_sta(ab, peer);
+ arsta = ath12k_dp_link_peer_to_link_sta(ab, peer);
if (!arsta) {
spin_unlock_bh(&ab->base_lock);
rcu_read_unlock();
return ppdu_info;
}
-static void ath12k_copy_to_delay_stats(struct ath12k_peer *peer,
+static void ath12k_copy_to_delay_stats(struct ath12k_dp_link_peer *peer,
struct htt_ppdu_user_stats *usr_stats)
{
peer->ppdu_stats_delayba.sw_peer_id = le16_to_cpu(usr_stats->rate.sw_peer_id);
peer->delayba_flag = true;
}
-static void ath12k_copy_to_bar(struct ath12k_peer *peer,
+static void ath12k_copy_to_bar(struct ath12k_dp_link_peer *peer,
struct htt_ppdu_user_stats *usr_stats)
{
usr_stats->rate.sw_peer_id = cpu_to_le16(peer->ppdu_stats_delayba.sw_peer_id);
struct ath12k_dp *dp = ath12k_ab_to_dp(ab);
struct ath12k_htt_ppdu_stats_msg *msg;
struct htt_ppdu_stats_info *ppdu_info;
- struct ath12k_peer *peer = NULL;
+ struct ath12k_dp_link_peer *peer = NULL;
struct htt_ppdu_user_stats *usr_stats = NULL;
u32 peer_id = 0;
struct ath12k_pdev_dp *dp_pdev;
for (i = 0; i < ppdu_info->ppdu_stats.common.num_users; i++) {
peer_id = ppdu_info->ppdu_stats.user_stats[i].peer_id;
spin_lock_bh(&ab->base_lock);
- peer = ath12k_peer_find_by_id(ab, peer_id);
+ peer = ath12k_dp_link_peer_find_by_id(ab, peer_id);
if (!peer) {
spin_unlock_bh(&ab->base_lock);
continue;
for (i = 0; i < ppdu_info->bar_num_users; i++) {
peer_id = ppdu_info->ppdu_stats.user_stats[i].peer_id;
spin_lock_bh(&ab->base_lock);
- peer = ath12k_peer_find_by_id(ab, peer_id);
+ peer = ath12k_dp_link_peer_find_by_id(ab, peer_id);
if (!peer) {
spin_unlock_bh(&ab->base_lock);
continue;
HTT_T2H_PEER_MAP_INFO1_MAC_ADDR_H16);
ath12k_dp_get_mac_addr(le32_to_cpu(resp->peer_map_ev.mac_addr_l32),
peer_mac_h16, mac_addr);
- ath12k_peer_map_event(ab, vdev_id, peer_id, mac_addr, 0, 0);
+ ath12k_dp_link_peer_map_event(ab, vdev_id, peer_id, mac_addr, 0, 0);
break;
case HTT_T2H_MSG_TYPE_PEER_MAP2:
vdev_id = le32_get_bits(resp->peer_map_ev.info,
HTT_T2H_PEER_MAP_INFO2_AST_HASH_VAL);
hw_peer_id = le32_get_bits(resp->peer_map_ev.info1,
HTT_T2H_PEER_MAP_INFO1_HW_PEER_ID);
- ath12k_peer_map_event(ab, vdev_id, peer_id, mac_addr, ast_hash,
- hw_peer_id);
+ ath12k_dp_link_peer_map_event(ab, vdev_id, peer_id, mac_addr, ast_hash,
+ hw_peer_id);
break;
case HTT_T2H_MSG_TYPE_PEER_MAP3:
vdev_id = le32_get_bits(resp->peer_map_ev.info,
HTT_T2H_PEER_MAP3_INFO2_AST_HASH_VAL);
hw_peer_id = le32_get_bits(resp->peer_map_ev.info2,
HTT_T2H_PEER_MAP3_INFO2_HW_PEER_ID);
- ath12k_peer_map_event(ab, vdev_id, peer_id, mac_addr, ast_hash,
- hw_peer_id);
+ ath12k_dp_link_peer_map_event(ab, vdev_id, peer_id, mac_addr, ast_hash,
+ hw_peer_id);
break;
case HTT_T2H_MSG_TYPE_PEER_UNMAP:
case HTT_T2H_MSG_TYPE_PEER_UNMAP2:
peer_id = le32_get_bits(resp->peer_unmap_ev.info,
HTT_T2H_PEER_UNMAP_INFO_PEER_ID);
- ath12k_peer_unmap_event(ab, peer_id);
+ ath12k_dp_link_peer_unmap_event(ab, peer_id);
break;
case HTT_T2H_MSG_TYPE_PPDU_STATS_IND:
ath12k_htt_pull_ppdu_stats(ab, skb);
struct ieee80211_rx_status *rx_status;
struct ieee80211_radiotap_he *he = NULL;
struct ieee80211_sta *pubsta = NULL;
- struct ath12k_peer *peer;
+ struct ath12k_dp_link_peer *peer;
struct ath12k_skb_rxcb *rxcb = ATH12K_SKB_RXCB(msdu);
struct hal_rx_desc_data rx_info;
bool is_mcbc = rxcb->is_mcbc;
spin_lock_bh(&ab->base_lock);
rx_info.addr2_present = false;
- peer = ath12k_dp_rx_h_find_peer(ab, msdu, &rx_info);
+ peer = ath12k_dp_rx_h_find_link_peer(ab, msdu, &rx_info);
if (peer && peer->sta) {
pubsta = peer->sta;
if (pubsta->valid_links) {
struct ath12k_link_sta *arsta;
struct ath12k_rx_peer_stats *rx_stats = NULL;
struct hal_rx_user_status *user_stats = &ppdu_info->userstats[uid];
- struct ath12k_peer *peer;
+ struct ath12k_dp_link_peer *peer;
u32 num_msdu;
if (user_stats->ast_index == 0 || user_stats->ast_index == 0xFFFF)
return;
- peer = ath12k_peer_find_by_ast(ab, user_stats->ast_index);
+ peer = ath12k_dp_link_peer_find_by_ast(ab, user_stats->ast_index);
if (!peer) {
ath12k_warn(ab, "peer ast idx %d can't be found\n",
return;
}
- arsta = ath12k_peer_get_link_sta(ab, peer);
+ arsta = ath12k_dp_link_peer_to_link_sta(ab, peer);
if (!arsta) {
ath12k_warn(ab, "link sta not found on peer %pM id %d\n",
peer->addr, peer->peer_id);
struct hal_srng *srng;
struct dp_rxdma_mon_ring *buf_ring;
struct ath12k_link_sta *arsta;
- struct ath12k_peer *peer;
+ struct ath12k_dp_link_peer *peer;
struct sk_buff_head skb_list;
u64 cookie;
int num_buffs_reaped = 0, srng_id, buf_id;
rcu_read_lock();
spin_lock_bh(&ab->base_lock);
- peer = ath12k_peer_find_by_id(ab, ppdu_info->peer_id);
+ peer = ath12k_dp_link_peer_find_by_id(ab, ppdu_info->peer_id);
if (!peer || !peer->sta) {
ath12k_dbg(ab, ATH12K_DBG_DATA,
"failed to find the peer with monitor peer_id %d\n",
}
if (ppdu_info->reception_type == HAL_RX_RECEPTION_TYPE_SU) {
- arsta = ath12k_peer_get_link_sta(ab, peer);
+ arsta = ath12k_dp_link_peer_to_link_sta(ab, peer);
if (!arsta) {
ath12k_warn(ab, "link sta not found on peer %pM id %d\n",
peer->addr, peer->peer_id);
#include "dp_peer.h"
#include "debug.h"
-struct ath12k_peer *ath12k_peer_find(struct ath12k_base *ab, int vdev_id,
- const u8 *addr)
+struct ath12k_dp_link_peer *
+ath12k_dp_link_peer_find_by_vdev_and_addr(struct ath12k_base *ab,
+ int vdev_id, const u8 *addr)
{
- struct ath12k_peer *peer;
+ struct ath12k_dp_link_peer *peer;
lockdep_assert_held(&ab->base_lock);
return NULL;
}
-struct ath12k_peer *ath12k_peer_find_by_pdev_idx(struct ath12k_base *ab,
- u8 pdev_idx, const u8 *addr)
+struct ath12k_dp_link_peer *
+ath12k_dp_link_peer_find_by_pdev_and_addr(struct ath12k_base *ab, u8 pdev_idx,
+ const u8 *addr)
{
- struct ath12k_peer *peer;
+ struct ath12k_dp_link_peer *peer;
lockdep_assert_held(&ab->base_lock);
return NULL;
}
-struct ath12k_peer *ath12k_peer_find_by_addr(struct ath12k_base *ab,
- const u8 *addr)
+struct ath12k_dp_link_peer *
+ath12k_dp_link_peer_find_by_addr(struct ath12k_base *ab, const u8 *addr)
{
- struct ath12k_peer *peer;
+ struct ath12k_dp_link_peer *peer;
lockdep_assert_held(&ab->base_lock);
return NULL;
}
-EXPORT_SYMBOL(ath12k_peer_find_by_addr);
+EXPORT_SYMBOL(ath12k_dp_link_peer_find_by_addr);
-static struct ath12k_peer *ath12k_peer_find_by_ml_id(struct ath12k_base *ab,
- int ml_peer_id)
+static struct ath12k_dp_link_peer *
+ath12k_dp_link_peer_find_by_ml_id(struct ath12k_base *ab, int ml_peer_id)
{
- struct ath12k_peer *peer;
+ struct ath12k_dp_link_peer *peer;
lockdep_assert_held(&ab->base_lock);
return NULL;
}
-struct ath12k_peer *ath12k_peer_find_by_id(struct ath12k_base *ab,
- int peer_id)
+struct ath12k_dp_link_peer *
+ath12k_dp_link_peer_find_by_id(struct ath12k_base *ab, int peer_id)
{
- struct ath12k_peer *peer;
+ struct ath12k_dp_link_peer *peer;
lockdep_assert_held(&ab->base_lock);
return NULL;
if (peer_id & ATH12K_PEER_ML_ID_VALID)
- return ath12k_peer_find_by_ml_id(ab, peer_id);
+ return ath12k_dp_link_peer_find_by_ml_id(ab, peer_id);
list_for_each_entry(peer, &ab->peers, list)
if (peer_id == peer->peer_id)
return NULL;
}
-bool ath12k_peer_exist_by_vdev_id(struct ath12k_base *ab, int vdev_id)
+bool ath12k_dp_link_peer_exist_by_vdev_id(struct ath12k_base *ab, int vdev_id)
{
- struct ath12k_peer *peer;
+ struct ath12k_dp_link_peer *peer;
spin_lock_bh(&ab->base_lock);
return false;
}
-struct ath12k_peer *ath12k_peer_find_by_ast(struct ath12k_base *ab,
- int ast_hash)
+struct ath12k_dp_link_peer *
+ath12k_dp_link_peer_find_by_ast(struct ath12k_base *ab, int ast_hash)
{
- struct ath12k_peer *peer;
+ struct ath12k_dp_link_peer *peer;
lockdep_assert_held(&ab->base_lock);
return NULL;
}
-void ath12k_peer_unmap_event(struct ath12k_base *ab, u16 peer_id)
+void ath12k_dp_link_peer_unmap_event(struct ath12k_base *ab, u16 peer_id)
{
- struct ath12k_peer *peer;
+ struct ath12k_dp_link_peer *peer;
spin_lock_bh(&ab->base_lock);
- peer = ath12k_peer_find_by_id(ab, peer_id);
+ peer = ath12k_dp_link_peer_find_by_id(ab, peer_id);
if (!peer) {
ath12k_warn(ab, "peer-unmap-event: unknown peer id %d\n",
peer_id);
spin_unlock_bh(&ab->base_lock);
}
-void ath12k_peer_map_event(struct ath12k_base *ab, u8 vdev_id, u16 peer_id,
- u8 *mac_addr, u16 ast_hash, u16 hw_peer_id)
+void ath12k_dp_link_peer_map_event(struct ath12k_base *ab, u8 vdev_id, u16 peer_id,
+ u8 *mac_addr, u16 ast_hash, u16 hw_peer_id)
{
- struct ath12k_peer *peer;
+ struct ath12k_dp_link_peer *peer;
spin_lock_bh(&ab->base_lock);
- peer = ath12k_peer_find(ab, vdev_id, mac_addr);
+ peer = ath12k_dp_link_peer_find_by_vdev_and_addr(ab, vdev_id, mac_addr);
if (!peer) {
peer = kzalloc(sizeof(*peer), GFP_ATOMIC);
if (!peer)
spin_unlock_bh(&ab->base_lock);
}
-struct ath12k_link_sta *ath12k_peer_get_link_sta(struct ath12k_base *ab,
- struct ath12k_peer *peer)
+struct ath12k_link_sta *ath12k_dp_link_peer_to_link_sta(struct ath12k_base *ab,
+ struct ath12k_dp_link_peer *peer)
{
struct ath12k_sta *ahsta;
struct ath12k_link_sta *arsta;
#define ATH12K_PEER_ML_ID_VALID BIT(13)
-struct ath12k_peer {
+struct ath12k_dp_link_peer {
struct list_head list;
struct ieee80211_sta *sta;
int vdev_id;
bool ucast_ra_only;
};
-void ath12k_peer_unmap_event(struct ath12k_base *ab, u16 peer_id);
-void ath12k_peer_map_event(struct ath12k_base *ab, u8 vdev_id, u16 peer_id,
- u8 *mac_addr, u16 ast_hash, u16 hw_peer_id);
-struct ath12k_peer *ath12k_peer_find(struct ath12k_base *ab, int vdev_id,
- const u8 *addr);
-struct ath12k_peer *ath12k_peer_find_by_addr(struct ath12k_base *ab,
- const u8 *addr);
-struct ath12k_peer *ath12k_peer_find_by_id(struct ath12k_base *ab, int peer_id);
-bool ath12k_peer_exist_by_vdev_id(struct ath12k_base *ab, int vdev_id);
-struct ath12k_peer *ath12k_peer_find_by_ast(struct ath12k_base *ab, int ast_hash);
-struct ath12k_peer *ath12k_peer_find_by_pdev_idx(struct ath12k_base *ab,
- u8 pdev_idx, const u8 *addr);
-struct ath12k_link_sta *ath12k_peer_get_link_sta(struct ath12k_base *ab,
- struct ath12k_peer *peer);
+void ath12k_dp_link_peer_unmap_event(struct ath12k_base *ab, u16 peer_id);
+void ath12k_dp_link_peer_map_event(struct ath12k_base *ab, u8 vdev_id, u16 peer_id,
+ u8 *mac_addr, u16 ast_hash, u16 hw_peer_id);
+struct ath12k_dp_link_peer *
+ath12k_dp_link_peer_find_by_vdev_and_addr(struct ath12k_base *ab,
+ int vdev_id, const u8 *addr);
+struct ath12k_dp_link_peer *
+ath12k_dp_link_peer_find_by_addr(struct ath12k_base *ab, const u8 *addr);
+struct ath12k_dp_link_peer *
+ath12k_dp_link_peer_find_by_id(struct ath12k_base *ab, int peer_id);
+bool ath12k_dp_link_peer_exist_by_vdev_id(struct ath12k_base *ab, int vdev_id);
+struct ath12k_dp_link_peer *
+ath12k_dp_link_peer_find_by_ast(struct ath12k_base *ab, int ast_hash);
+struct ath12k_dp_link_peer *
+ath12k_dp_link_peer_find_by_pdev_and_addr(struct ath12k_base *ab, u8 pdev_idx,
+ const u8 *addr);
+struct ath12k_link_sta *ath12k_dp_link_peer_to_link_sta(struct ath12k_base *ab,
+ struct ath12k_dp_link_peer *peer);
#endif
__skb_queue_purge(&rx_tid->rx_frags);
}
-void ath12k_dp_rx_peer_tid_cleanup(struct ath12k *ar, struct ath12k_peer *peer)
+void ath12k_dp_rx_peer_tid_cleanup(struct ath12k *ar, struct ath12k_dp_link_peer *peer)
{
struct ath12k_dp_rx_tid *rx_tid;
int i;
{
struct ath12k_base *ab = ar->ab;
struct ath12k_dp *dp = ath12k_ab_to_dp(ab);
- struct ath12k_peer *peer;
+ struct ath12k_dp_link_peer *peer;
struct ath12k_sta *ahsta;
struct ath12k_dp_rx_tid *rx_tid;
dma_addr_t paddr_aligned;
spin_lock_bh(&ab->base_lock);
- peer = ath12k_peer_find(ab, vdev_id, peer_mac);
+ peer = ath12k_dp_link_peer_find_by_vdev_and_addr(ab, vdev_id, peer_mac);
if (!peer) {
spin_unlock_bh(&ab->base_lock);
ath12k_warn(ab, "failed to find the peer to set up rx tid\n");
u8 link_id)
{
struct ath12k_base *ab = ar->ab;
- struct ath12k_peer *peer;
+ struct ath12k_dp_link_peer *peer;
struct ath12k_sta *ahsta = ath12k_sta_to_ahsta(params->sta);
struct ath12k_link_sta *arsta;
int vdev_id;
spin_lock_bh(&ab->base_lock);
- peer = ath12k_peer_find(ab, vdev_id, arsta->addr);
+ peer = ath12k_dp_link_peer_find_by_vdev_and_addr(ab, vdev_id, arsta->addr);
if (!peer) {
spin_unlock_bh(&ab->base_lock);
ath12k_warn(ab, "failed to find the peer to stop rx aggregation\n");
struct ath12k *ar = arvif->ar;
struct ath12k_base *ab = ar->ab;
struct ath12k_hal_reo_cmd cmd = {};
- struct ath12k_peer *peer;
+ struct ath12k_dp_link_peer *peer;
struct ath12k_dp_rx_tid *rx_tid;
u8 tid;
int ret = 0;
spin_lock_bh(&ab->base_lock);
- peer = ath12k_peer_find(ab, arvif->vdev_id, peer_addr);
+ peer = ath12k_dp_link_peer_find_by_vdev_and_addr(ab, arvif->vdev_id,
+ peer_addr);
if (!peer) {
spin_unlock_bh(&ab->base_lock);
ath12k_warn(ab, "failed to find the peer %pM to configure pn replay detection\n",
}
}
-struct ath12k_peer *
-ath12k_dp_rx_h_find_peer(struct ath12k_base *ab, struct sk_buff *msdu,
- struct hal_rx_desc_data *rx_info)
+struct ath12k_dp_link_peer *
+ath12k_dp_rx_h_find_link_peer(struct ath12k_base *ab, struct sk_buff *msdu,
+ struct hal_rx_desc_data *rx_info)
{
struct ath12k_skb_rxcb *rxcb = ATH12K_SKB_RXCB(msdu);
- struct ath12k_peer *peer = NULL;
+ struct ath12k_dp_link_peer *peer = NULL;
lockdep_assert_held(&ab->base_lock);
if (rxcb->peer_id)
- peer = ath12k_peer_find_by_id(ab, rxcb->peer_id);
+ peer = ath12k_dp_link_peer_find_by_id(ab, rxcb->peer_id);
if (peer)
return peer;
if (rx_info->addr2_present)
- peer = ath12k_peer_find_by_addr(ab, rx_info->addr2);
+ peer = ath12k_dp_link_peer_find_by_addr(ab, rx_info->addr2);
return peer;
}
struct ath12k_base *ab = dp->ab;
struct ieee80211_rx_status *rx_status;
struct ieee80211_sta *pubsta;
- struct ath12k_peer *peer;
+ struct ath12k_dp_link_peer *peer;
struct ath12k_skb_rxcb *rxcb = ATH12K_SKB_RXCB(msdu);
struct ieee80211_rx_status *status = rx_info->rx_status;
u8 decap = rx_info->decap_type;
bool is_eapol = rxcb->is_eapol;
spin_lock_bh(&ab->base_lock);
- peer = ath12k_dp_rx_h_find_peer(ab, msdu, rx_info);
+ peer = ath12k_dp_rx_h_find_link_peer(ab, msdu, rx_info);
pubsta = peer ? peer->sta : NULL;
{
struct ath12k_base *ab = ar->ab;
struct crypto_shash *tfm;
- struct ath12k_peer *peer;
+ struct ath12k_dp_link_peer *peer;
struct ath12k_dp_rx_tid *rx_tid;
int i;
spin_lock_bh(&ab->base_lock);
- peer = ath12k_peer_find(ab, vdev_id, peer_mac);
+ peer = ath12k_dp_link_peer_find_by_vdev_and_addr(ab, vdev_id, peer_mac);
if (!peer) {
spin_unlock_bh(&ab->base_lock);
crypto_free_shash(tfm);
const u8 *peer_addr,
enum set_key_cmd key_cmd,
struct ieee80211_key_conf *key);
-void ath12k_dp_rx_peer_tid_cleanup(struct ath12k *ar, struct ath12k_peer *peer);
+void ath12k_dp_rx_peer_tid_cleanup(struct ath12k *ar, struct ath12k_dp_link_peer *peer);
void ath12k_dp_rx_peer_tid_delete(struct ath12k *ar,
- struct ath12k_peer *peer, u8 tid);
+ struct ath12k_dp_link_peer *peer, u8 tid);
int ath12k_dp_rx_peer_tid_setup(struct ath12k *ar, const u8 *peer_mac, int vdev_id,
u8 tid, u32 ba_win_sz, u16 ssn,
enum hal_pn_type pn_type);
u8 ath12k_dp_rx_h_l3pad(struct ath12k_base *ab,
struct hal_rx_desc *desc);
-struct ath12k_peer *
-ath12k_dp_rx_h_find_peer(struct ath12k_base *ab, struct sk_buff *msdu,
- struct hal_rx_desc_data *rx_info);
+struct ath12k_dp_link_peer *
+ath12k_dp_rx_h_find_link_peer(struct ath12k_base *ab, struct sk_buff *msdu,
+ struct hal_rx_desc_data *rx_info);
u8 ath12k_dp_rx_h_decap_type(struct ath12k_base *ab,
struct hal_rx_desc *desc);
u32 ath12k_dp_rx_h_mpdu_err(struct ath12k_base *ab,
void ath12k_mac_peer_cleanup_all(struct ath12k *ar)
{
- struct ath12k_peer *peer, *tmp;
+ struct ath12k_dp_link_peer *peer, *tmp;
struct ath12k_base *ab = ar->ab;
lockdep_assert_wiphy(ath12k_ar_to_hw(ar)->wiphy);
struct ath12k_link_sta *arsta;
struct ieee80211_sta *ap_sta;
struct ath12k_sta *ahsta;
- struct ath12k_peer *peer;
+ struct ath12k_dp_link_peer *peer;
bool is_auth = false;
u32 hemode = 0;
int ret;
spin_lock_bh(&ar->ab->base_lock);
- peer = ath12k_peer_find(ar->ab, arvif->vdev_id, arvif->bssid);
+ peer = ath12k_dp_link_peer_find_by_vdev_and_addr(ar->ab, arvif->vdev_id,
+ arvif->bssid);
if (peer && peer->is_authorized)
is_auth = true;
{
struct ath12k *ar = arvif->ar;
struct ath12k_base *ab = ar->ab;
- struct ath12k_peer *peer;
+ struct ath12k_dp_link_peer *peer;
int first_errno = 0;
int ret;
int i;
lockdep_assert_wiphy(ath12k_ar_to_hw(ar)->wiphy);
spin_lock_bh(&ab->base_lock);
- peer = ath12k_peer_find(ab, arvif->vdev_id, addr);
+ peer = ath12k_dp_link_peer_find_by_vdev_and_addr(ab, arvif->vdev_id, addr);
spin_unlock_bh(&ab->base_lock);
if (!peer)
{
struct ieee80211_sta *sta = NULL;
struct ath12k_base *ab = ar->ab;
- struct ath12k_peer *peer;
+ struct ath12k_dp_link_peer *peer;
struct ath12k_sta *ahsta;
const u8 *peer_addr;
int ret;
* we already hold wiphy lock. we just make sure its there now.
*/
spin_lock_bh(&ab->base_lock);
- peer = ath12k_peer_find(ab, arvif->vdev_id, peer_addr);
+ peer = ath12k_dp_link_peer_find_by_vdev_and_addr(ab, arvif->vdev_id,
+ peer_addr);
spin_unlock_bh(&ab->base_lock);
if (!peer) {
}
spin_lock_bh(&ab->base_lock);
- peer = ath12k_peer_find(ab, arvif->vdev_id, peer_addr);
+ peer = ath12k_dp_link_peer_find_by_vdev_and_addr(ab, arvif->vdev_id,
+ peer_addr);
if (peer && cmd == SET_KEY) {
peer->keys[key->keyidx] = key;
if (key->flags & IEEE80211_KEY_FLAG_PAIRWISE) {
{
struct ieee80211_vif *vif = ath12k_ahvif_to_vif(arvif->ahvif);
struct ieee80211_sta *sta = ath12k_ahsta_to_sta(arsta->ahsta);
- struct ath12k_peer *peer;
+ struct ath12k_dp_link_peer *peer;
lockdep_assert_wiphy(ath12k_ar_to_hw(ar)->wiphy);
spin_lock_bh(&ar->ab->base_lock);
- peer = ath12k_peer_find(ar->ab, arvif->vdev_id, arsta->addr);
+ peer = ath12k_dp_link_peer_find_by_vdev_and_addr(ar->ab, arvif->vdev_id,
+ arsta->addr);
if (peer && peer->sta == sta) {
ath12k_warn(ar->ab, "Found peer entry %pM n vdev %i after it was supposedly removed\n",
vif->addr, arvif->vdev_id);
struct ath12k_link_vif *arvif,
struct ath12k_link_sta *arsta)
{
- struct ath12k_peer *peer;
+ struct ath12k_dp_link_peer *peer;
int ret;
lockdep_assert_wiphy(ath12k_ar_to_hw(ar)->wiphy);
spin_lock_bh(&ar->ab->base_lock);
- peer = ath12k_peer_find(ar->ab, arvif->vdev_id, arsta->addr);
+ peer = ath12k_dp_link_peer_find_by_vdev_and_addr(ar->ab, arvif->vdev_id,
+ arsta->addr);
if (peer)
peer->is_authorized = false;
struct ath12k_link_vif *arvif,
struct ath12k_link_sta *arsta)
{
- struct ath12k_peer *peer;
+ struct ath12k_dp_link_peer *peer;
struct ieee80211_vif *vif = ath12k_ahvif_to_vif(arvif->ahvif);
int ret;
spin_lock_bh(&ar->ab->base_lock);
- peer = ath12k_peer_find(ar->ab, arvif->vdev_id, arsta->addr);
+ peer = ath12k_dp_link_peer_find_by_vdev_and_addr(ar->ab, arvif->vdev_id,
+ arsta->addr);
if (peer)
peer->is_authorized = true;
struct ath12k_hw *ah = ath12k_hw_to_ah(hw);
struct ath12k_link_sta *arsta;
struct ath12k_link_vif *arvif;
- struct ath12k_peer *peer;
+ struct ath12k_dp_link_peer *peer;
u32 bw, smps;
rcu_read_lock();
}
spin_lock_bh(&ar->ab->base_lock);
- peer = ath12k_peer_find(ar->ab, arvif->vdev_id, arsta->addr);
+ peer = ath12k_dp_link_peer_find_by_vdev_and_addr(ar->ab, arvif->vdev_id,
+ arsta->addr);
if (!peer) {
spin_unlock_bh(&ar->ab->base_lock);
rcu_read_unlock();
struct sk_buff *msdu_copied;
struct ath12k *ar, *tmp_ar;
struct ath12k_pdev_dp *dp_pdev, *tmp_dp_pdev;
- struct ath12k_peer *peer;
+ struct ath12k_dp_link_peer *peer;
unsigned long links_map;
bool is_mcast = false;
bool is_dvlan = false;
goto skip_peer_find;
spin_lock_bh(&tmp_ar->ab->base_lock);
- peer = ath12k_peer_find_by_addr(tmp_ar->ab, tmp_arvif->bssid);
+ peer = ath12k_dp_link_peer_find_by_addr(tmp_ar->ab,
+ tmp_arvif->bssid);
if (!peer) {
spin_unlock_bh(&tmp_ar->ab->base_lock);
ath12k_warn(tmp_ar->ab,
if (ab->hw_params->vdev_start_delay &&
ahvif->vdev_type != WMI_VDEV_TYPE_AP &&
ahvif->vdev_type != WMI_VDEV_TYPE_MONITOR &&
- !ath12k_peer_exist_by_vdev_id(ab, arvif->vdev_id)) {
+ !ath12k_dp_link_peer_exist_by_vdev_id(ab, arvif->vdev_id)) {
ret = 0;
goto out;
}
bool he_fixed_rate = false, vht_fixed_rate = false;
const u16 *vht_mcs_mask, *he_mcs_mask;
struct ieee80211_link_sta *link_sta;
- struct ath12k_peer *peer, *tmp;
+ struct ath12k_dp_link_peer *peer, *tmp;
u8 vht_nss, he_nss;
int ret = true;
}
EXPORT_SYMBOL(ath12k_peer_ml_find);
-static int ath12k_wait_for_peer_common(struct ath12k_base *ab, int vdev_id,
- const u8 *addr, bool expect_mapped)
+static int ath12k_wait_for_dp_link_peer_common(struct ath12k_base *ab, int vdev_id,
+ const u8 *addr, bool expect_mapped)
{
int ret;
bool mapped;
spin_lock_bh(&ab->base_lock);
- mapped = !!ath12k_peer_find(ab, vdev_id, addr);
+ mapped = !!ath12k_dp_link_peer_find_by_vdev_and_addr(ab,
+ vdev_id,
+ addr);
spin_unlock_bh(&ab->base_lock);
(mapped == expect_mapped ||
void ath12k_peer_cleanup(struct ath12k *ar, u32 vdev_id)
{
- struct ath12k_peer *peer, *tmp;
+ struct ath12k_dp_link_peer *peer, *tmp;
struct ath12k_base *ab = ar->ab;
lockdep_assert_wiphy(ath12k_ar_to_hw(ar)->wiphy);
static int ath12k_wait_for_peer_deleted(struct ath12k *ar, int vdev_id, const u8 *addr)
{
- return ath12k_wait_for_peer_common(ar->ab, vdev_id, addr, false);
+ return ath12k_wait_for_dp_link_peer_common(ar->ab, vdev_id, addr, false);
}
int ath12k_wait_for_peer_delete_done(struct ath12k *ar, u32 vdev_id,
static int ath12k_wait_for_peer_created(struct ath12k *ar, int vdev_id, const u8 *addr)
{
- return ath12k_wait_for_peer_common(ar->ab, vdev_id, addr, true);
+ return ath12k_wait_for_dp_link_peer_common(ar->ab, vdev_id, addr, true);
}
int ath12k_peer_create(struct ath12k *ar, struct ath12k_link_vif *arvif,
struct ath12k_dp_link_vif *dp_link_vif;
struct ath12k_link_sta *arsta;
u8 link_id = arvif->link_id;
- struct ath12k_peer *peer;
+ struct ath12k_dp_link_peer *peer;
struct ath12k_sta *ahsta;
u16 ml_peer_id;
int ret;
}
spin_lock_bh(&ar->ab->base_lock);
- peer = ath12k_peer_find_by_pdev_idx(ar->ab, ar->pdev_idx, arg->peer_addr);
+ peer = ath12k_dp_link_peer_find_by_pdev_and_addr(ar->ab, ar->pdev_idx,
+ arg->peer_addr);
if (peer) {
spin_unlock_bh(&ar->ab->base_lock);
return -EINVAL;
spin_lock_bh(&ar->ab->base_lock);
- peer = ath12k_peer_find(ar->ab, arg->vdev_id, arg->peer_addr);
+ peer = ath12k_dp_link_peer_find_by_vdev_and_addr(ar->ab, arg->vdev_id,
+ arg->peer_addr);
if (!peer) {
spin_unlock_bh(&ar->ab->base_lock);
ath12k_warn(ar->ab, "failed to find peer %pM on vdev %i after creation\n",
}
void ath12k_wifi7_dp_rx_peer_tid_delete(struct ath12k *ar,
- struct ath12k_peer *peer, u8 tid)
+ struct ath12k_dp_link_peer *peer, u8 tid)
{
struct ath12k_hal_reo_cmd cmd = {};
struct ath12k_dp_rx_tid *rx_tid = &peer->rx_tid[tid];
}
int ath12k_wifi7_peer_rx_tid_reo_update(struct ath12k *ar,
- struct ath12k_peer *peer,
+ struct ath12k_dp_link_peer *peer,
struct ath12k_dp_rx_tid *rx_tid,
u32 ba_win_sz, u16 ssn,
bool update_ssn)
enum hal_encrypt_type enctype;
bool is_decrypted = false;
struct ieee80211_hdr *hdr;
- struct ath12k_peer *peer;
+ struct ath12k_dp_link_peer *peer;
struct ieee80211_rx_status *rx_status = rx_info->rx_status;
u32 err_bitmap = rx_info->err_bitmap;
rxcb->peer_id = rx_info->peer_id;
spin_lock_bh(&ab->base_lock);
- peer = ath12k_dp_rx_h_find_peer(ab, msdu, rx_info);
+ peer = ath12k_dp_rx_h_find_link_peer(ab, msdu, rx_info);
if (peer) {
/* resetting mcbc bit because mcbc packets are unicast
* packets only for AP as STA sends unicast packets.
}
static int ath12k_wifi7_dp_rx_h_verify_tkip_mic(struct ath12k_pdev_dp *dp_pdev,
- struct ath12k_peer *peer,
+ struct ath12k_dp_link_peer *peer,
enum hal_encrypt_type enctype,
struct sk_buff *msdu,
struct hal_rx_desc_data *rx_info)
}
static int ath12k_wifi7_dp_rx_h_defrag(struct ath12k_pdev_dp *dp_pdev,
- struct ath12k_peer *peer,
+ struct ath12k_dp_link_peer *peer,
struct ath12k_dp_rx_tid *rx_tid,
struct sk_buff **defrag_skb,
enum hal_encrypt_type enctype,
{
struct ath12k_dp *dp = dp_pdev->dp;
struct ath12k_base *ab = dp->ab;
- struct ath12k_peer *peer;
+ struct ath12k_dp_link_peer *peer;
struct ath12k_dp_rx_tid *rx_tid;
struct sk_buff *defrag_skb = NULL;
u32 peer_id = rx_info->peer_id;
return -EINVAL;
spin_lock_bh(&ab->base_lock);
- peer = ath12k_peer_find_by_id(ab, peer_id);
+ peer = ath12k_dp_link_peer_find_by_id(ab, peer_id);
if (!peer) {
ath12k_warn(ab, "failed to find the peer to de-fragment received fragment peer_id %d\n",
peer_id);
timer_delete_sync(&rx_tid->frag_timer);
spin_lock_bh(&ab->base_lock);
- peer = ath12k_peer_find_by_id(ab, peer_id);
+ peer = ath12k_dp_link_peer_find_by_id(ab, peer_id);
if (!peer)
goto err_frags_cleanup;
void ath12k_wifi7_peer_rx_tid_qref_setup(struct ath12k_base *ab, u16 peer_id, u16 tid,
dma_addr_t paddr);
void ath12k_wifi7_dp_rx_peer_tid_delete(struct ath12k *ar,
- struct ath12k_peer *peer, u8 tid);
+ struct ath12k_dp_link_peer *peer, u8 tid);
int ath12k_wifi7_dp_reo_cmd_send(struct ath12k_base *ab, struct ath12k_dp_rx_tid *rx_tid,
enum hal_reo_cmd_type type,
struct ath12k_hal_reo_cmd *cmd,
void ath12k_wifi7_dp_reo_cache_flush(struct ath12k_base *ab,
struct ath12k_dp_rx_tid *rx_tid);
int ath12k_wifi7_peer_rx_tid_reo_update(struct ath12k *ar,
- struct ath12k_peer *peer,
+ struct ath12k_dp_link_peer *peer,
struct ath12k_dp_rx_tid *rx_tid,
u32 ba_win_sz, u16 ssn,
bool update_ssn);
struct sk_buff *msdu = desc_params->skb;
s32 noise_floor;
struct ieee80211_tx_status status = {};
- struct ath12k_peer *peer;
+ struct ath12k_dp_link_peer *peer;
skb_cb = ATH12K_SKB_CB(msdu);
info = IEEE80211_SKB_CB(msdu);
}
rcu_read_lock();
spin_lock_bh(&ab->base_lock);
- peer = ath12k_peer_find_by_id(ab, peer_id);
+ peer = ath12k_dp_link_peer_find_by_id(ab, peer_id);
if (!peer || !peer->sta) {
ath12k_dbg(ab, ATH12K_DBG_DATA,
"dp_tx: failed to find the peer with peer_id %d\n", peer_id);
{
struct ath12k_dp *dp = dp_pdev->dp;
struct ath12k_base *ab = dp->ab;
- struct ath12k_peer *peer;
+ struct ath12k_dp_link_peer *peer;
struct ieee80211_sta *sta;
struct ath12k_sta *ahsta;
struct ath12k_link_sta *arsta;
int ret;
spin_lock_bh(&ab->base_lock);
- peer = ath12k_peer_find_by_id(ab, ts->peer_id);
+ peer = ath12k_dp_link_peer_find_by_id(ab, ts->peer_id);
if (!peer || !peer->sta) {
ath12k_dbg(ab, ATH12K_DBG_DP_TX,
"failed to find the peer by id %u\n", ts->peer_id);
s32 noise_floor;
struct ieee80211_tx_status status = {};
struct ieee80211_rate_status status_rate = {};
- struct ath12k_peer *peer;
+ struct ath12k_dp_link_peer *peer;
struct ath12k_link_sta *arsta;
struct ath12k_sta *ahsta;
struct rate_info rate;
ath12k_wifi7_dp_tx_update_txcompl(dp_pdev, ts);
spin_lock_bh(&ab->base_lock);
- peer = ath12k_peer_find_by_id(ab, ts->peer_id);
+ peer = ath12k_dp_link_peer_find_by_id(ab, ts->peer_id);
if (!peer || !peer->sta) {
ath12k_err(ab,
"dp_tx: failed to find the peer with peer_id %d\n",
__le16 fc = mgmt->frame_control;
spin_lock_bh(&ab->base_lock);
- if (!ath12k_peer_find_by_addr(ab, mgmt->da) &&
+ if (!ath12k_dp_link_peer_find_by_addr(ab, mgmt->da) &&
!ath12k_peer_ml_find(ah, mgmt->da)) {
spin_unlock_bh(&ab->base_lock);
return false;
{
struct wmi_peer_sta_kickout_arg arg = {};
struct ieee80211_sta *sta;
- struct ath12k_peer *peer;
+ struct ath12k_dp_link_peer *peer;
struct ath12k *ar;
if (ath12k_pull_peer_sta_kickout_ev(ab, skb, &arg) != 0) {
spin_lock_bh(&ab->base_lock);
- peer = ath12k_peer_find_by_addr(ab, arg.mac_addr);
+ peer = ath12k_dp_link_peer_find_by_addr(ab, arg.mac_addr);
if (!peer) {
ath12k_warn(ab, "peer not found %pM\n",