Mistake on this page?
Report an issue in GitHub or email us
rda5981_sniffer.h
1 /* Copyright (c) 2019 Unisoc Communications Inc.
2  * SPDX-License-Identifier: Apache-2.0
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef _RDA5981_SNIFFER_H_
18 #define _RDA5981_SNIFFER_H_
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 #include "wland_types.h"
24 
25 /* Enable filtering ACK frames (no support)*/
26 //#define RDA_RX_FILTER_DROP_ACK BIT0
27 
28 /* Enable filtering CTS frames (no support)*/
29 //#define RDA_RX_FILTER_DROP_CTS BIT1
30 
31 /* Enable filtering RTS frames (no support)*/
32 //#define RDA_RX_FILTER_DROP_RTS BIT2
33 
34 /* Enable filtering beacon frames */
35 #define RDA_RX_FILTER_DROP_BEACON BIT3
36 
37 /* Enable filtering ATIM frames (no support)*/
38 //#define RDA_RX_FILTER_DROP_ATIM BIT4
39 
40 /* Enable filtering CF_END frames (no support)*/
41 //#define RDA_RX_FILTER_DROP_CF_END BIT5
42 
43 /* Enable filtering QCF_POLL frames (no support)*/
44 //#define RDA_RX_FILTER_DROP_QCF_POLL BIT6
45 
46 /* Filter Management frames which are not directed to current STA */
47 #define RDA_RX_FILTER_DROP_ND_MGMT BIT7
48 
49 /* Filter BC/MC MGMT frames belonging to other BSS */
50 #define RDA_RX_FILTER_DROP_BC_MC_MGMT_OTHER_BSS BIT8
51 
52 /* Enable filtering of duplicate frames */
53 #define RDA_RX_FILTER_DROP_DUPLICATE BIT9
54 
55 /* Enable filtering of frames whose FCS has failed */
56 #define RDA_RX_FILTER_DROP_FCS_FAILED BIT10
57 
58 /* Enable filtering of De-authentication frame */
59 #define RDA_RX_FILTER_DROP_DEAUTH BIT11
60 
61 /* Filter BA frames which are not received as SIFS response (no support)*/
62 //#define RDA_RX_FILTER_DROP_NSIFS_RESP_BA BIT12
63 
64 /* Filter BA frames which are received as SIFS response (no support)*/
65 //#define RDA_RX_FILTER_DROP_SIFS_RESP_BA BIT13
66 
67 /* Filter frames which are received in secondary channel (20 MHz PPDU from Secondary channel) */
68 #define RDA_RX_FILTER_DROP_SEC_CHANNEL BIT14
69 
70 /* Filter BC/MC DATA frames belonging to other BSS */
71 #define RDA_RX_FILTER_DROP_BC_MC_DATA_OTHER_BSS BIT15
72 
73 /* Filter DATA frames not directed to this station */
74 #define RDA_RX_FILTER_DROP_ND_DATA BIT16
75 
76 /* Filter Control frames which are not directed to current STA (no support)*/
77 //#define RDA_RX_FILTER_DROP_ND_CONTROL BIT17
78 
79 /* Filter Beacon frames (in IBSS mode) which are not used for adoption because the timestamp field is lower than TSF timer */
80 #define RDA_RX_FILTER_DROP_IBSS_BEACON BIT18
81 
82 typedef int (*sniffer_handler_t)(unsigned short data_len, void *data);
83 
84 int rda5981_enable_sniffer(sniffer_handler_t handler);
85 int rda5981_disable_sniffer(void);
86 //don't use this in sniffer callback handler
87 int rda5981_disable_sniffer_nocallback(void);
88 ///TODO: time is no use anymore
89 int rda5981_start_sniffer(unsigned char channel, unsigned char to_ds,
90  unsigned char from_ds, unsigned char mgm_frame, unsigned short time);
91 int rda5981_stop_sniffer(void);
92 int wland_sniffer_set_channel(unsigned char channel);
93 int rda5981_set_filter(unsigned char to_ds, unsigned char from_ds, unsigned int mgm_filter);
94 int rda5981_sniffer_enable_fcs(void);//for hiflying
95 #ifdef __cplusplus
96 }
97 #endif
98 
99 #endif /*_RDA5981_SNIFFER_H_*/
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.