1 /* 2 * Copyright (c) 2021, The Linux Foundation. All rights reserved. 3 * 4 * Permission to use, copy, modify, and/or distribute this software for any 5 * purpose with or without fee is hereby granted, provided that the above 6 * copyright notice and this permission notice appear in all copies. 7 * 8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 */ 16 17 #ifndef _DP_MON_FILTER_2_0_H_ 18 #define _DP_MON_FILTER_2_0_H_ 19 20 #include <dp_htt.h> 21 22 /** 23 * struct dp_mon_filter_be - Monitor TLV filter 24 * @rx_tlv_filter: Rx MON TLV filter 25 * @tx_tlv_filter: Tx MON TLV filter 26 * @tx_valid: enable/disable Tx Mon TLV filter 27 */ 28 struct dp_mon_filter_be { 29 struct dp_mon_filter rx_tlv_filter; 30 struct htt_tx_ring_tlv_filter tx_tlv_filter; 31 int tx_valid; 32 }; 33 34 /** 35 * dp_rx_mon_packet_length_set() - Setup rx monitor per packet type length 36 * @msg_word: msg word 37 * @htt_tlv_filter: rx ring filter configuration 38 */ 39 void 40 dp_rx_mon_packet_length_set(uint32_t *msg_word, 41 struct htt_rx_ring_tlv_filter *tlvi_filter); 42 43 /** 44 * dp_rx_mon_word_mask_subscribe() - Setup rx monitor word mask subscription 45 * @msg_word: msg word 46 * @htt_tlv_filter: rx ring filter configuration 47 */ 48 void 49 dp_rx_mon_word_mask_subscribe(uint32_t *msg_word, 50 struct htt_rx_ring_tlv_filter *tlv_filter); 51 52 /** 53 * dp_rx_mon_enable_mpdu_logging() - Setup rx monitor per packet mpdu logging 54 * @msg_word: msg word 55 * @htt_tlv_filter: rx ring filter configuration 56 */ 57 void 58 dp_rx_mon_enable_mpdu_logging(uint32_t *msg_word, 59 struct htt_rx_ring_tlv_filter *tlv_filter); 60 61 #ifdef QCA_ENHANCED_STATS_SUPPORT 62 /** 63 * dp_mon_filter_setup_enhanced_stats() - Setup the enhanced stats filter 64 * @pdev: DP pdev handle 65 */ 66 void dp_mon_filter_setup_enhanced_stats_2_0(struct dp_pdev *pdev); 67 68 /*** 69 * dp_mon_filter_reset_enhanced_stats() - Reset the enhanced stats filter 70 * @pdev: DP pdev handle 71 */ 72 void dp_mon_filter_reset_enhanced_stats_2_0(struct dp_pdev *pdev); 73 #else 74 static inline void 75 dp_mon_filter_setup_enhanced_stats_2_0(struct dp_pdev *pdev) 76 { 77 } 78 79 static inline void 80 dp_mon_filter_reset_enhanced_stats_2_0(struct dp_pdev *pdev) 81 { 82 } 83 #endif 84 85 #ifdef QCA_MCOPY_SUPPORT 86 /** 87 * dp_mon_filter_setup_mcopy_mode() - Setup the m_copy mode filter 88 * @pdev: DP pdev handle 89 */ 90 void dp_mon_filter_setup_mcopy_mode_2_0(struct dp_pdev *pdev); 91 92 /** 93 * dp_mon_filter_reset_mcopy_mode() - Reset the m_copy mode filter 94 * @pdev: DP pdev handle 95 */ 96 void dp_mon_filter_reset_mcopy_mode_2_0(struct dp_pdev *pdev); 97 #else 98 static inline void 99 dp_mon_filter_setup_mcopy_mode_2_0(struct dp_pdev *pdev) 100 { 101 } 102 103 static inline void 104 dp_mon_filter_reset_mcopy_mode_2_0(struct dp_pdev *pdev) 105 { 106 } 107 #endif 108 109 #if defined(ATH_SUPPORT_NAC_RSSI) || defined(ATH_SUPPORT_NAC) 110 /** 111 * dp_mon_filter_setup_smart_monitor() - Setup the smart monitor mode filter 112 * @pdev: DP pdev handle 113 */ 114 void dp_mon_filter_setup_smart_monitor_2_0(struct dp_pdev *pdev); 115 116 /** 117 * dp_mon_filter_reset_smart_monitor() - Reset the smart monitor mode filter 118 * @pdev: DP pdev handle 119 */ 120 void dp_mon_filter_reset_smart_monitor_2_0(struct dp_pdev *pdev); 121 #else 122 static inline void 123 dp_mon_filter_setup_smart_monitor_2_0(struct dp_pdev *pdev) 124 { 125 } 126 127 static inline void 128 dp_mon_filter_reset_smart_monitor_2_0(struct dp_pdev *pdev) 129 { 130 } 131 #endif 132 133 #ifdef WLAN_RX_PKT_CAPTURE_ENH 134 /** 135 * dp_mon_filter_setup_rx_enh_capture() - Setup the Rx capture mode filters 136 * @pdev: DP pdev handle 137 */ 138 void dp_mon_filter_setup_rx_enh_capture_2_0(struct dp_pdev *pdev); 139 140 /** 141 * dp_mon_filter_reset_rx_enh_capture() - Reset the Rx capture mode filters 142 * @pdev: DP pdev handle 143 */ 144 void dp_mon_filter_reset_rx_enh_capture_2_0(struct dp_pdev *pdev); 145 #else 146 static inline void 147 dp_mon_filter_setup_rx_enh_capture_2_0(struct dp_pdev *pdev) 148 { 149 } 150 151 static inline void 152 dp_mon_filter_reset_rx_enh_capture_2_0(struct dp_pdev *pdev) 153 { 154 } 155 #endif 156 157 /** 158 * dp_mon_filter_setup_mon_mode() - Setup the Rx monitor mode filter 159 * @pdev: DP pdev handle 160 */ 161 void dp_mon_filter_setup_mon_mode_2_0(struct dp_pdev *pdev); 162 163 /** 164 * dp_mon_filter_reset_mon_mode() - Reset the Rx monitor mode filter 165 * @pdev: DP pdev handle 166 */ 167 void dp_mon_filter_reset_mon_mode_2_0(struct dp_pdev *pdev); 168 169 #ifdef WDI_EVENT_ENABLE 170 /** 171 * dp_mon_filter_setup_rx_pkt_log_full() - Setup the Rx pktlog full mode filter 172 * @pdev: DP pdev handle 173 */ 174 void dp_mon_filter_setup_rx_pkt_log_full_2_0(struct dp_pdev *pdev); 175 176 /** 177 * dp_mon_filter_reset_rx_pkt_log_full_2_0() - Reset pktlog full mode filter 178 * @pdev: DP pdev handle 179 */ 180 void dp_mon_filter_reset_rx_pkt_log_full_2_0(struct dp_pdev *pdev); 181 182 /** 183 * dp_mon_filter_setup_rx_pkt_log_lite() - Setup the Rx pktlog lite mode filter 184 * in the radio object. 185 * @pdev: DP pdev handle 186 */ 187 void dp_mon_filter_setup_rx_pkt_log_lite_2_0(struct dp_pdev *pdev); 188 189 /** 190 * dp_mon_filter_reset_rx_pkt_log_lite() - Reset the Rx pktlog lite mode filter 191 * @pdev: DP pdev handle 192 */ 193 void dp_mon_filter_reset_rx_pkt_log_lite_2_0(struct dp_pdev *pdev); 194 195 /** 196 * dp_mon_filter_setup_rx_pkt_log_cbf() - Setup the Rx pktlog cbf mode filter 197 * in the radio object. 198 * @pdev: DP pdev handle 199 */ 200 void dp_mon_filter_setup_rx_pkt_log_cbf_2_0(struct dp_pdev *pdev); 201 202 /** 203 * dp_mon_filter_reset_rx_pktlog_cbf() - Reset the Rx pktlog cbf mode filter 204 * @pdev: DP pdev handle 205 */ 206 void dp_mon_filter_reset_rx_pktlog_cbf_2_0(struct dp_pdev *pdev); 207 #else 208 static inline void 209 dp_mon_filter_setup_rx_pkt_log_full_2_0(struct dp_pdev *pdev) 210 { 211 } 212 213 static inline void 214 dp_mon_filter_reset_rx_pkt_log_full_2_0(struct dp_pdev *pdev) 215 { 216 } 217 218 static inline void 219 dp_mon_filter_setup_rx_pkt_log_lite_2_0(struct dp_pdev *pdev) 220 { 221 } 222 223 static inline void 224 dp_mon_filter_reset_rx_pkt_log_lite_2_0(struct dp_pdev *pdev) 225 { 226 } 227 228 static inline void 229 dp_mon_filter_setup_rx_pkt_log_cbf_2_0(struct dp_pdev *pdev) 230 { 231 } 232 233 static inline void 234 dp_mon_filter_reset_rx_pktlog_cbf_2_0(struct dp_pdev *pdev) 235 { 236 } 237 #endif 238 239 /** 240 * dp_mon_filter_update_2_0() - Update monitor filter configuration 241 * @pdev: physical device handle 242 * 243 * Return: non-zero for failure, zero for success 244 */ 245 QDF_STATUS dp_mon_filter_update_2_0(struct dp_pdev *pdev); 246 247 #endif /* _DP_MON_FILTER_2_0_H_ */ 248