K2.6 patches and update.
[tomato.git] / release / src-rt / wl / exe / wlu_cmd.h
blobfb2b02c8aca4ac6f2407be6513d310c8b23d6e50
1 /*
2 * Command structure for wl command line utility
4 * Copyright 2002, Broadcom Corporation
5 * All Rights Reserved.
7 * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Broadcom Corporation;
8 * the contents of this file may not be disclosed to third parties, copied or
9 * duplicated in any form, in whole or in part, without the prior written
10 * permission of Broadcom Corporation.
12 * $Id: wlu_cmd.h,v 1.6 2007-02-02 19:30:07 Exp $
15 #ifndef _wlu_cmd_h_
16 #define _wlu_cmd_h_
18 typedef struct cmd cmd_t;
19 typedef int (cmd_func_t)(void *wl, cmd_t *cmd, char **argv);
21 /* generic command line argument handler */
22 struct cmd {
23 const char *name;
24 cmd_func_t *func;
25 int get;
26 int set;
27 const char *help;
30 /* list of command line arguments */
31 extern cmd_t wl_cmds[];
32 extern cmd_t wl_varcmd;
34 /* per-port ioctl handlers */
35 extern int wl_get(void *wl, int cmd, void *buf, int len);
36 extern int wl_set(void *wl, int cmd, void *buf, int len);
39 * Flags for command categories. A command may belong to
40 * multiple categories. These are used in bitmaps, so be careful
41 * to keep the macro value (2 ^ n) and the array indexes (n)
42 * consistent.
45 #define CMD_PHY 0x1
46 #define CMD_CHAN 0x2
47 #define CMD_RATE 0x4
48 #define CMD_POWER 0x8
49 #define CMD_MAC 0x10
50 #define CMD_MGMT 0x20
51 #define CMD_SEC 0x40
52 #define CMD_WME 0x80
53 #define CMD_MON 0x100
54 #define CMD_AP 0x200
55 #define CMD_STA 0x400
56 #define CMD_BOARD 0x800
57 #define CMD_ADMIN 0x1000
58 #define CMD_DEV 0x2000
59 #define CMD_DEP 0x4000
60 #define CMD_UNCAT 0x8000
62 #define CMD_ALL 0xffff
64 /* Initializer for category string array */
66 #define CMD_CATEGORY_STRINGS_INIT { \
67 "phy", \
68 "chan", \
69 "rate", \
70 "power", \
71 "mac", \
72 "mgmt", \
73 "sec", \
74 "wme", \
75 "mon", \
76 "ap", \
77 "sta", \
78 "board", \
79 "admin", \
80 "dev", \
81 "dep", \
82 "uncat", \
83 "" }
85 extern const char *wl_cmd_category_strings[];
86 extern const int wl_cmd_category_count;
88 /* Initializer for category description strings array */
89 #define CMD_CATEGORY_DESC_INIT { \
90 "PHY and radio; speed, band, etc", \
91 "Channel; subclass of phy", \
92 "Rate; subclass of phy, a/b/g", \
93 "Power; subclass of phy", \
94 "MAC; Media access", \
95 "Management, association, IE, etc", \
96 "Security; subclass of mgmt", \
97 "WME; media extensions", \
98 "Monitoring device (counters, etc)", \
99 "AP subclass of mgmt", \
100 "STA subclass of mgmt", \
101 "Board, hardware", \
102 "Administration; software, UI, diags", \
103 "Device; low level control", \
104 "Deprecated", \
105 "Uncategorized so far", \
106 "" }
108 extern const char *wl_cmd_category_desc[];
112 * IO variable information
116 /* Supplemental IO variable info structure */
117 typedef const struct wlu_iov_info_s {
118 const char *name;
119 uint32 cat; /* Category flags; same as command categories */
120 uint32 flags; /* See below */
121 int dflt; /* Only for integers; see flags */
122 const char *desc; /* Description */
123 } wlu_iov_info_t;
125 /* Flags for wlu_iov_info_t */
126 #define WLU_IOVI_READ_ONLY 0x1 /* Known to be read only */
127 #define WLU_IOVI_WRITE_ONLY 0x2 /* Known to be write only */
128 #define WLU_IOVI_BCM_INTERNAL 0x4 /* Known to be BCM internal */
129 #define WLU_IOVI_DEFAULT_VALID 0x8 /* Default value in structure is valid */
131 extern wlu_iov_info_t wlu_iov_info[];
132 extern int wlu_iov_info_count;
134 #define WLU_IOV_BLOCK_LEN 10
136 #define WLU_MOD_NAME_MAX 16
137 #define WLU_MOD_NAME_BYTES 16
139 #endif /* _wlu_cmd_h_ */