• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Header file for the Packet dump helper functions
3  *
4  * Copyright (C) 1999-2019, Broadcom.
5  *
6  *      Unless you and Broadcom execute a separate written software license
7  * agreement governing use of this software, this software is licensed to you
8  * under the terms of the GNU General Public License version 2 (the "GPL"),
9  * available at http://www.broadcom.com/licenses/GPLv2.php, with the
10  * following added to such license:
11  *
12  *      As a special exception, the copyright holders of this software give you
13  * permission to link this software with independent modules, and to copy and
14  * distribute the resulting executable under terms of your choice, provided that
15  * you also meet, for each linked independent module, the terms and conditions
16  * of the license of that module.  An independent module is a module which is
17  * not derived from this software.  The special exception does not apply to any
18  * modifications of the software.
19  *
20  *      Notwithstanding the above, under no circumstances may you combine this
21  * software in any way with any other Broadcom software provided under a license
22  * other than the GPL, without Broadcom's express prior written consent.
23  *
24  *
25  * <<Broadcom-WL-IPTag/Open:>>
26  *
27  * $Id: dhd_linux_pktdump.h 820929 2019-05-21 14:09:11Z $
28  */
29 
30 #ifndef __DHD_LINUX_PKTDUMP_H_
31 #define __DHD_LINUX_PKTDUMP_H_
32 
33 #include <typedefs.h>
34 #include <dhd.h>
35 
36 typedef enum {
37     EAPOL_OTHER = 0,
38     EAPOL_4WAY_M1,
39     EAPOL_4WAY_M2,
40     EAPOL_4WAY_M3,
41     EAPOL_4WAY_M4,
42     EAPOL_GROUPKEY_M1,
43     EAPOL_GROUPKEY_M2
44 } msg_eapol_t;
45 
46 typedef enum pkt_cnt_rsn {
47     PKT_CNT_RSN_INVALID = 0,
48     PKT_CNT_RSN_ROAM = 1,
49     PKT_CNT_RSN_GRPKEY_UP = 2,
50     PKT_CNT_RSN_CONNECT = 3,
51     PKT_CNT_RSN_MAX = 4
52 } pkt_cnt_rsn_t;
53 
54 extern msg_eapol_t dhd_is_4way_msg(uint8 *pktdata);
55 extern void dhd_dump_pkt(dhd_pub_t *dhd, int ifidx, uint8 *pktdata,
56                          uint32 pktlen, bool tx, uint32 *pkthash,
57                          uint16 *pktfate);
58 
59 #ifdef DHD_PKTDUMP_ROAM
60 extern void dhd_dump_mod_pkt_timer(dhd_pub_t *dhdp, uint16 rsn);
61 extern void dhd_dump_pkt_init(dhd_pub_t *dhdp);
62 extern void dhd_dump_pkt_deinit(dhd_pub_t *dhdp);
63 extern void dhd_dump_pkt_clear(dhd_pub_t *dhdp);
64 #else
dhd_dump_mod_pkt_timer(dhd_pub_t * dhdp,uint16 rsn)65 static INLINE void dhd_dump_mod_pkt_timer(dhd_pub_t *dhdp, uint16 rsn)
66 {
67 }
dhd_dump_pkt_init(dhd_pub_t * dhdp)68 static INLINE void dhd_dump_pkt_init(dhd_pub_t *dhdp)
69 {
70 }
dhd_dump_pkt_deinit(dhd_pub_t * dhdp)71 static INLINE void dhd_dump_pkt_deinit(dhd_pub_t *dhdp)
72 {
73 }
dhd_dump_pkt_clear(dhd_pub_t * dhdp)74 static INLINE void dhd_dump_pkt_clear(dhd_pub_t *dhdp)
75 {
76 }
77 #endif /* DHD_PKTDUMP_ROAM */
78 
79 /* Rx packet dump */
80 #ifdef DHD_TRX_DUMP
81 extern void dhd_trx_pkt_dump(dhd_pub_t *dhdp, int ifidx, uint8 *pktdata,
82                              uint32 pktlen, bool tx);
83 #else
dhd_trx_pkt_dump(dhd_pub_t * dhdp,int ifidx,uint8 * pktdata,uint32 pktlen,bool tx)84 static INLINE void dhd_trx_pkt_dump(dhd_pub_t *dhdp, int ifidx, uint8 *pktdata,
85                                     uint32 pktlen, bool tx)
86 {
87 }
88 #endif /* DHD_TRX_DUMP */
89 
90 /* DHCP packet dump */
91 #ifdef DHD_DHCP_DUMP
92 extern void dhd_dhcp_dump(dhd_pub_t *dhdp, int ifidx, uint8 *pktdata, bool tx,
93                           uint32 *pkthash, uint16 *pktfate);
94 #else
dhd_dhcp_dump(dhd_pub_t * dhdp,int ifidx,uint8 * pktdata,bool tx,uint32 * pkthash,uint16 * pktfate)95 static INLINE void dhd_dhcp_dump(dhd_pub_t *dhdp, int ifidx, uint8 *pktdata,
96                                  bool tx, uint32 *pkthash, uint16 *pktfate)
97 {
98 }
99 #endif /* DHD_DHCP_DUMP */
100 
101 /* DNS packet dump */
102 #ifdef DHD_DNS_DUMP
103 extern void dhd_dns_dump(dhd_pub_t *dhdp, int ifidx, uint8 *pktdata, bool tx,
104                          uint32 *pkthash, uint16 *pktfate);
105 #else
dhd_dns_dump(dhd_pub_t * dhdp,int ifidx,uint8 * pktdata,bool tx,uint32 * pkthash,uint16 * pktfate)106 static INLINE void dhd_dns_dump(dhd_pub_t *dhdp, int ifidx, uint8 *pktdata,
107                                 bool tx, uint32 *pkthash, uint16 *pktfate)
108 {
109 }
110 #endif /* DHD_DNS_DUMP */
111 
112 /* ICMP packet dump */
113 #ifdef DHD_ICMP_DUMP
114 extern void dhd_icmp_dump(dhd_pub_t *dhdp, int ifidx, uint8 *pktdata, bool tx,
115                           uint32 *pkthash, uint16 *pktfate);
116 #else
dhd_icmp_dump(dhd_pub_t * dhdp,int ifidx,uint8 * pktdata,bool tx,uint32 * pkthash,uint16 * pktfate)117 static INLINE void dhd_icmp_dump(dhd_pub_t *dhdp, int ifidx, uint8 *pktdata,
118                                  bool tx, uint32 *pkthash, uint16 *pktfate)
119 {
120 }
121 #endif /* DHD_ICMP_DUMP */
122 
123 /* ARP packet dump */
124 #ifdef DHD_ARP_DUMP
125 extern void dhd_arp_dump(dhd_pub_t *dhdp, int ifidx, uint8 *pktdata, bool tx,
126                          uint32 *pkthash, uint16 *pktfate);
127 #else
dhd_arp_dump(dhd_pub_t * dhdp,int ifidx,uint8 * pktdata,bool tx,uint32 * pkthash,uint16 * pktfate)128 static INLINE void dhd_arp_dump(dhd_pub_t *dhdp, int ifidx, uint8 *pktdata,
129                                 bool tx, uint32 *pkthash, uint16 *pktfate)
130 {
131 }
132 #endif /* DHD_ARP_DUMP */
133 
134 /* 802.1X packet dump */
135 #ifdef DHD_8021X_DUMP
136 extern void dhd_dump_eapol_message(dhd_pub_t *dhd, int ifidx, uint8 *pktdata,
137                                    uint32 pktlen, bool tx, uint32 *pkthash,
138                                    uint16 *pktfate);
139 #else
dhd_dump_eapol_message(dhd_pub_t * dhd,int ifidx,uint8 * pktdata,uint32 pktlen,bool tx,uint32 * pkthash,uint16 * pktfate)140 static INLINE void dhd_dump_eapol_message(dhd_pub_t *dhd, int ifidx,
141                                           uint8 *pktdata, uint32 pktlen,
142                                           bool tx, uint32 *pkthash,
143                                           uint16 *pktfate)
144 {
145 }
146 #endif /* DHD_8021X_DUMP */
147 
148 #endif /* __DHD_LINUX_PKTDUMP_H_ */
149