99#include <linux/string.h>
1010#define NONE 0xFFFF
1111
12- //--------------------------------------------------------------------------------
1312/* TYPE and SUBTYPE
1413 * Define valid TYPE (or category or code-path, however you like to think of it)
1514 * and SUBTYPE s.
1615 * Type and SubType are treated as bitmasks.
1716 */
18- /*-----------------BEGIN TYPEs------------------------------------------*/
19- #define DBG_TYPE_INITEXIT (1 << 0) // 1
20- #define DBG_TYPE_TX (1 << 1) // 2
21- #define DBG_TYPE_RX (1 << 2) // 4
22- #define DBG_TYPE_OTHERS (1 << 3) // 8
23- /*-----------------END TYPEs------------------------------------------*/
24- #define NUMTYPES 4 // careful!
25- /*-----------------BEGIN SUBTYPEs---------------------------------------*/
26-
27- /*-SUBTYPEs for TX : TYPE is DBG_TYPE_TX -----//
28- Transmit.c ,Arp.c, LeakyBucket.c, And Qos.c
29- total 17 macros */
30- // Transmit.c
17+ #define DBG_TYPE_INITEXIT (1 << 0) /* 1 */
18+ #define DBG_TYPE_TX (1 << 1) /* 2 */
19+ #define DBG_TYPE_RX (1 << 2) /* 4 */
20+ #define DBG_TYPE_OTHERS (1 << 3) /* 8 */
21+ #define NUMTYPES 4
22+
23+ /* -SUBTYPEs for TX : TYPE is DBG_TYPE_TX -----//
24+ * Transmit.c ,Arp.c, LeakyBucket.c, And Qos.c
25+ * total 17 macros
26+ */
27+ /* Transmit.c */
3128#define TX 1
3229#define MP_SEND (TX << 0)
3330#define NEXT_SEND (TX << 1)
3431#define TX_FIFO (TX << 2)
3532#define TX_CONTROL (TX << 3)
3633
37- // Arp.c
34+ /* Arp.c */
3835#define IP_ADDR (TX << 4)
3936#define ARP_REQ (TX << 5)
4037#define ARP_RESP (TX << 6)
4138
42- // Leakybucket.c
39+ /* Leakybucket.c */
4340#define TOKEN_COUNTS (TX << 8)
4441#define CHECK_TOKENS (TX << 9)
4542#define TX_PACKETS (TX << 10)
4643#define TIMER (TX << 11)
4744
48- // Qos.c
45+ /* Qos.c */
4946#define QOS TX
5047#define QUEUE_INDEX (QOS << 12)
5148#define IPV4_DBG (QOS << 13)
5249#define IPV6_DBG (QOS << 14)
5350#define PRUNE_QUEUE (QOS << 15)
5451#define SEND_QUEUE (QOS << 16)
5552
56- // TX_Misc
53+ /* TX_Misc */
5754#define TX_OSAL_DBG (TX << 17)
5855
59- //--SUBTYPEs for ------INIT & EXIT---------------------
60- /*------------ TYPE is DBG_TYPE_INITEXIT -----//
61- DriverEntry.c, bcmfwup.c, ChipDetectTask.c, HaltnReset.c, InterfaceDDR.c */
56+ /* --SUBTYPEs for ------INIT & EXIT---------------------
57+ * ------------ TYPE is DBG_TYPE_INITEXIT -----//
58+ * DriverEntry.c, bcmfwup.c, ChipDetectTask.c, HaltnReset.c, InterfaceDDR.c
59+ */
6260#define MP 1
6361#define DRV_ENTRY (MP << 0)
6462#define MP_INIT (MP << 1)
@@ -69,37 +67,38 @@ DriverEntry.c, bcmfwup.c, ChipDetectTask.c, HaltnReset.c, InterfaceDDR.c */
6967#define INIT_DISP (MP << 6)
7068#define RX_INIT (MP << 7)
7169
72- //-SUBTYPEs for --RX----------------------------------
73- //------------RX : TYPE is DBG_TYPE_RX -----//
74- // Receive.c
70+ /* -SUBTYPEs for --RX----------------------------------
71+ * ------------RX : TYPE is DBG_TYPE_RX -----//
72+ * Receive.c
73+ */
7574#define RX 1
7675#define RX_DPC (RX << 0)
7776#define RX_CTRL (RX << 3)
7877#define RX_DATA (RX << 4)
7978#define MP_RETURN (RX << 1)
8079#define LINK_MSG (RX << 2)
8180
82- //-SUBTYPEs for ----OTHER ROUTINES------------------
83- //------------OTHERS : TYPE is DBG_TYPE_OTHER -----//
84- // HaltnReset,CheckForHang,PnP,Misc,CmHost
85- // total 12 macros
81+ /* -SUBTYPEs for ----OTHER ROUTINES------------------
82+ * ------------OTHERS : TYPE is DBG_TYPE_OTHER -----//
83+ * HaltnReset,CheckForHang,PnP,Misc,CmHost
84+ * total 12 macros
85+ */
8686#define OTHERS 1
87- // ??ISR.C
8887#define ISR OTHERS
8988#define MP_DPC (ISR << 0)
9089
91- // HaltnReset.c
90+ /* HaltnReset.c */
9291#define HALT OTHERS
9392#define MP_HALT (HALT << 1)
9493#define CHECK_HANG (HALT << 2)
9594#define MP_RESET (HALT << 3)
9695#define MP_SHUTDOWN (HALT << 4)
9796
98- // pnp.c
97+ /* pnp.c */
9998#define PNP OTHERS
10099#define MP_PNP (PNP << 5)
101100
102- // Misc.c
101+ /* Misc.c */
103102#define MISC OTHERS
104103#define DUMP_INFO (MISC << 6)
105104#define CLASSIFY (MISC << 7)
@@ -108,14 +107,14 @@ DriverEntry.c, bcmfwup.c, ChipDetectTask.c, HaltnReset.c, InterfaceDDR.c */
108107#define DUMP_CONTROL (MISC << 10)
109108#define LED_DUMP_INFO (MISC << 11)
110109
111- // CmHost.c
110+ /* CmHost.c */
112111#define CMHOST OTHERS
113112#define SERIAL (OTHERS << 12)
114113#define IDLE_MODE (OTHERS << 13)
115114#define WRM (OTHERS << 14)
116115#define RDM (OTHERS << 15)
117116
118- // TODO - put PHS_SEND in Tx PHS_RECEIVE in Rx path ?
117+ /* TODO - put PHS_SEND in Tx PHS_RECEIVE in Rx path ? */
119118#define PHS_SEND (OTHERS << 16)
120119#define PHS_RECEIVE (OTHERS << 17)
121120#define PHS_MODULE (OTHERS << 18)
@@ -133,7 +132,6 @@ DriverEntry.c, bcmfwup.c, ChipDetectTask.c, HaltnReset.c, InterfaceDDR.c */
133132
134133#define HOST_MIBS (OTHERS << 28)
135134#define CONN_MSG (CMHOST << 29)
136- /*-----------------END SUBTYPEs------------------------------------------*/
137135
138136/* Debug level
139137 * We have 8 debug levels, in (numerical) increasing order of verbosity.
@@ -154,32 +152,33 @@ DriverEntry.c, bcmfwup.c, ChipDetectTask.c, HaltnReset.c, InterfaceDDR.c */
154152#define BCM_SCREAM 2
155153#define BCM_ERR 1
156154/* Not meant for developer in debug prints.
157- * To be used to disable all prints by setting the DBG_LVL_CURR to this value */
155+ * To be used to disable all prints by setting the DBG_LVL_CURR to this value
156+ */
158157#define BCM_NONE 0
159158
160159/* The current driver logging level.
161160 * Everything at this level and (numerically) lower (meaning higher prio)
162161 * is logged.
163- * Replace 'BCM_ALL' in the DBG_LVL_CURR macro with the logging level desired.
162+ * Replace 'BCM_ALL' in the DBG_LVL_CURR macro with the logging level desired.
164163 * For eg. to set the logging level to 'errors only' use:
165164 * #define DBG_LVL_CURR (BCM_ERR)
166165 */
167166
168167#define DBG_LVL_CURR (BCM_ALL)
169168#define DBG_LVL_ALL BCM_ALL
170169
171- /*---Userspace mapping of Debug State.
170+ /* ---Userspace mapping of Debug State.
172171 * Delibrately matches that of the Windows driver..
173172 * The TestApp's ioctl passes this struct to us.
174173 */
175174typedef struct
176175{
177176 unsigned int Subtype , Type ;
178177 unsigned int OnOff ;
179- // unsigned int debug_level; /* future expansion */
178+ /* unsigned int debug_level; future expansion */
180179} __attribute__((packed )) USER_BCM_DBG_STATE ;
181180
182- // ---Kernel-space mapping of Debug State
181+ /* ---Kernel-space mapping of Debug State */
183182typedef struct _S_BCM_DEBUG_STATE {
184183 UINT type ;
185184 /* A bitmap of 32 bits for Subtype per Type.
@@ -190,13 +189,14 @@ typedef struct _S_BCM_DEBUG_STATE {
190189 UINT subtype [(NUMTYPES * 2 )+ 1 ];
191190 UINT debug_level ;
192191} S_BCM_DEBUG_STATE ;
193- /* Instantiated in the Adapter structure */
194- /* We'll reuse the debug level parameter to include a bit (the MSB) to indicate whether or not
195- * we want the function's name printed. */
192+ /* Instantiated in the Adapter structure
193+ * We'll reuse the debug level parameter to include a bit (the MSB) to indicate whether or not
194+ * we want the function's name printed.
195+ */
196196#define DBG_NO_FUNC_PRINT 1 << 31
197197#define DBG_LVL_BITMASK 0xFF
198198
199- // --- Only for direct printk's; "hidden" to API.
199+ /* --- Only for direct printk's; "hidden" to API. */
200200#define DBG_TYPE_PRINTK 3
201201
202202#define BCM_DEBUG_PRINT (Adapter , Type , SubType , dbg_level , string , args ...) \
@@ -232,7 +232,8 @@ typedef struct _S_BCM_DEBUG_STATE {
232232 for (i = 0; i < (NUMTYPES * 2) + 1; i++) { \
233233 if ((i == 1) || (i == 2) || (i == 4) || (i == 8)) { \
234234 /* CAUTION! Forcefully turn on ALL debug paths and subpaths! \
235- Adapter->stDebugState.subtype[i] = 0xffffffff; */ \
235+ * Adapter->stDebugState.subtype[i] = 0xffffffff; \
236+ */ \
236237 BCM_DEBUG_PRINT (Adapter , DBG_TYPE_PRINTK , 0 , 0 , "subtype[%d] = 0x%08x\n" , \
237238 i , Adapter -> stDebugState .subtype [i ]); \
238239 } \
0 commit comments