Path: blob/main/sys/contrib/dev/athk/ath12k/dp_cmn.h
283314 views
/* SPDX-License-Identifier: BSD-3-Clause-Clear */1/*2* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.3*/45#ifndef ATH12K_DP_CMN_H6#define ATH12K_DP_CMN_H78#include "cmn_defs.h"910struct ath12k_hw_group;1112/*13* ML Peer IDs start from 8192, assuming max SLO clients count 1536,14* then max peer id shall be 9728, therefore rounding the peer table size15* to the nearest next power of 2 i.e 16384.16*/17#define MAX_DP_PEER_LIST_SIZE 163841819struct ath12k_dp_hw {20struct ath12k_dp_peer __rcu *dp_peers[MAX_DP_PEER_LIST_SIZE];2122/* Lock for protection of dp_peer_list and peers */23spinlock_t peer_lock;24struct list_head dp_peers_list;25};2627struct ath12k_dp_hw_group {28struct ath12k_dp *dp[ATH12K_MAX_DEVICES];29};3031struct ath12k_dp_link_vif {32u32 vdev_id;33u8 search_type;34u8 hal_addr_search_flags;35u8 pdev_idx;36u8 lmac_id;37u16 ast_idx;38u16 ast_hash;39u16 tcl_metadata;40u8 vdev_id_check_en;41int bank_id;42};4344struct ath12k_dp_vif {45u8 tx_encap_type;46u32 key_cipher;47atomic_t mcbc_gsn;48struct ath12k_dp_link_vif dp_link_vif[ATH12K_NUM_MAX_LINKS];49};5051/* TODO: Move this to a separate dp_stats file */52struct ath12k_per_peer_tx_stats {53u32 succ_bytes;54u32 retry_bytes;55u32 failed_bytes;56u32 duration;57u16 succ_pkts;58u16 retry_pkts;59u16 failed_pkts;60u16 ru_start;61u16 ru_tones;62u8 ba_fails;63u8 ppdu_type;64u32 mu_grpid;65u32 mu_pos;66bool is_ampdu;67};6869struct ath12k_dp_peer_create_params {70struct ieee80211_sta *sta;71bool is_mlo;72u16 peer_id;73bool ucast_ra_only;74};7576struct ath12k_dp_link_peer_rate_info {77struct rate_info txrate;78u64 rx_duration;79u64 tx_duration;80u8 rssi_comb;81s8 signal_avg;82};8384static inline struct ath12k_dp_link_vif *85ath12k_dp_vif_to_dp_link_vif(struct ath12k_dp_vif *dp_vif, u8 link_id)86{87return &dp_vif->dp_link_vif[link_id];88}8990void ath12k_dp_cmn_device_deinit(struct ath12k_dp *dp);91int ath12k_dp_cmn_device_init(struct ath12k_dp *dp);92void ath12k_dp_cmn_hw_group_unassign(struct ath12k_dp *dp,93struct ath12k_hw_group *ag);94void ath12k_dp_cmn_hw_group_assign(struct ath12k_dp *dp,95struct ath12k_hw_group *ag);96int ath12k_dp_link_peer_assign(struct ath12k_dp *dp, struct ath12k_dp_hw *dp_hw,97u8 vdev_id, struct ieee80211_sta *sta, u8 *addr,98u8 link_id, u32 hw_link_id);99void ath12k_dp_link_peer_unassign(struct ath12k_dp *dp, struct ath12k_dp_hw *dp_hw,100u8 vdev_id, u8 *addr, u32 hw_link_id);101void102ath12k_dp_link_peer_get_sta_rate_info_stats(struct ath12k_dp *dp, const u8 *addr,103struct ath12k_dp_link_peer_rate_info *info);104void ath12k_dp_link_peer_reset_rx_stats(struct ath12k_dp *dp, const u8 *addr);105#endif106107108