@@ -145,7 +145,7 @@ typedef enum {
145
145
WIFI_ANT_MAX , /**< Invalid WiFi antenna */
146
146
} wifi_ant_t ;
147
147
148
- /** @brief Description of an WiFi AP */
148
+ /** @brief Description of a WiFi AP */
149
149
typedef struct {
150
150
uint8_t bssid [6 ]; /**< MAC address of AP */
151
151
uint8_t ssid [33 ]; /**< SSID of AP */
@@ -299,30 +299,30 @@ typedef struct {
299
299
/** @brief Received packet radio metadata header, this is the common header at the beginning of all promiscuous mode RX callback buffers */
300
300
typedef struct {
301
301
signed rssi :8 ; /**< signal intensity of packet */
302
- unsigned rate :5 ; /**< data rate */
302
+ unsigned rate :4 ; /**< data rate */
303
+ unsigned is_group :1 ;
303
304
unsigned :1 ; /**< reserve */
304
305
unsigned sig_mode :2 ; /**< 0:is not 11n packet; 1:is 11n packet */
305
- unsigned :16 ; /**< reserve */
306
+ unsigned legacy_length :12 ;
307
+ unsigned damatch0 :1 ;
308
+ unsigned damatch1 :1 ;
309
+ unsigned bssidmatch0 :1 ;
310
+ unsigned bssidmatch1 :1 ;
306
311
unsigned mcs :7 ; /**< if is 11n packet, shows the modulation(range from 0 to 76) */
307
312
unsigned cwb :1 ; /**< if is 11n packet, shows if is HT40 packet or not */
308
- unsigned :16 ; /**< reserve */
313
+ unsigned HT_length :16 ; /**< reserve */
309
314
unsigned smoothing :1 ; /**< reserve */
310
315
unsigned not_sounding :1 ; /**< reserve */
311
316
unsigned :1 ; /**< reserve */
312
317
unsigned aggregation :1 ; /**< Aggregation */
313
318
unsigned stbc :2 ; /**< STBC */
314
319
unsigned fec_coding :1 ; /**< Flag is set for 11n packets which are LDPC */
315
320
unsigned sgi :1 ; /**< SGI */
316
- unsigned noise_floor :8 ; /**< noise floor */
321
+ unsigned rxend_state :8 ;
317
322
unsigned ampdu_cnt :8 ; /**< ampdu cnt */
318
323
unsigned channel :4 ; /**< which channel this packet in */
319
- unsigned :12 ; /**< reserve */
320
- unsigned timestamp :32 ; /**< timestamp */
321
- unsigned :32 ; /**< reserve */
322
- unsigned :32 ; /**< reserve */
323
- unsigned sig_len :12 ; /**< length of packet */
324
- unsigned :12 ; /**< reserve */
325
- unsigned rx_state :8 ; /**< rx state */
324
+ unsigned :4 ; /**< reserve */
325
+ signed noise_floor :8 ;
326
326
} wifi_pkt_rx_ctrl_t ;
327
327
328
328
/** @brief Payload passed to 'buf' parameter of promiscuous mode RX callback.
@@ -340,17 +340,28 @@ typedef struct {
340
340
*/
341
341
typedef enum {
342
342
WIFI_PKT_MGMT , /**< Management frame, indicates 'buf' argument is wifi_promiscuous_pkt_t */
343
+ WIFI_PKT_CTRL , /**< Control frame, indicates 'buf' argument is wifi_promiscuous_pkt_t */
343
344
WIFI_PKT_DATA , /**< Data frame, indiciates 'buf' argument is wifi_promiscuous_pkt_t */
344
345
WIFI_PKT_MISC , /**< Other type, such as MIMO etc. 'buf' argument is wifi_promiscuous_pkt_t but the payload is zero length. */
345
346
} wifi_promiscuous_pkt_type_t ;
346
347
347
348
348
349
#define WIFI_PROMIS_FILTER_MASK_ALL (0xFFFFFFFF) /**< filter all packets */
349
350
#define WIFI_PROMIS_FILTER_MASK_MGMT (1) /**< filter the packets with type of WIFI_PKT_MGMT */
350
- #define WIFI_PROMIS_FILTER_MASK_DATA (1<<1) /**< filter the packets with type of WIFI_PKT_DATA */
351
- #define WIFI_PROMIS_FILTER_MASK_MISC (1<<2) /**< filter the packets with type of WIFI_PKT_MISC */
352
- #define WIFI_PROMIS_FILTER_MASK_DATA_MPDU (1<<3) /**< filter the MPDU which is a kind of WIFI_PKT_DATA */
353
- #define WIFI_PROMIS_FILTER_MASK_DATA_AMPDU (1<<4) /**< filter the AMPDU which is a kind of WIFI_PKT_DATA */
351
+ #define WIFI_PROMIS_FILTER_MASK_CTRL (1<<1) /**< filter the packets with type of WIFI_PKT_CTRL */
352
+ #define WIFI_PROMIS_FILTER_MASK_DATA (1<<2) /**< filter the packets with type of WIFI_PKT_DATA */
353
+ #define WIFI_PROMIS_FILTER_MASK_MISC (1<<3) /**< filter the packets with type of WIFI_PKT_MISC */
354
+
355
+ #define WIFI_PROMIS_CTRL_FILTER_MASK_ALL (0xFF800000) /**< filter all control packets */
356
+ #define WIFI_PROMIS_CTRL_FILTER_MASK_WRAPPER (1<<23) /**< filter the control packets with subtype of Control Wrapper */
357
+ #define WIFI_PROMIS_CTRL_FILTER_MASK_BAR (1<<24) /**< filter the control packets with subtype of Block Ack Request */
358
+ #define WIFI_PROMIS_CTRL_FILTER_MASK_BA (1<<25) /**< filter the control packets with subtype of Block Ack */
359
+ #define WIFI_PROMIS_CTRL_FILTER_MASK_PSPOLL (1<<26) /**< filter the control packets with subtype of PS-Poll */
360
+ #define WIFI_PROMIS_CTRL_FILTER_MASK_RTS (1<<27) /**< filter the control packets with subtype of RTS */
361
+ #define WIFI_PROMIS_CTRL_FILTER_MASK_CTS (1<<28) /**< filter the control packets with subtype of CTS */
362
+ #define WIFI_PROMIS_CTRL_FILTER_MASK_ACK (1<<29) /**< filter the control packets with subtype of ACK */
363
+ #define WIFI_PROMIS_CTRL_FILTER_MASK_CFEND (1<<30) /**< filter the control packets with subtype of CF-END */
364
+ #define WIFI_PROMIS_CTRL_FILTER_MASK_CFENDACK (1<<31) /**< filter the control packets with subtype of CF-END+CF-ACK */
354
365
355
366
/** @brief Mask for filtering different packet types in promiscuous mode. */
356
367
typedef struct {
0 commit comments