diff options
author | Holger Schurig <hs4233@mail.mn-solutions.de> | 2007-08-02 11:53:36 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:49:53 -0400 |
commit | 6b63cd0f420c3c3002024da6c9eff252a3772021 (patch) | |
tree | 87df4e20432a393b9137952a4ad6aa0cc63163b5 /drivers/net/wireless/libertas/host.h | |
parent | ece561919326236c7fb791a5e883f0eb76af029e (diff) |
[PATCH] libertas: remove a hundred CMD_RET_xxx definitions
types.h contains the same amount of CMD_RET_xxx and CMD_xxx definitions.
They contains the same info: the firmware command opcode and, when the
firmware sends back a result, the command opcode ORed with 0x8000.
Having the same data twice in the source code is redundant and can lead to
errors (e.g. if you update or delete only one instance). This patch removed
all CMD_RET_xxx definitions and introduces a simple CMD_RET() macro.
Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/host.h')
-rw-r--r-- | drivers/net/wireless/libertas/host.h | 87 |
1 files changed, 11 insertions, 76 deletions
diff --git a/drivers/net/wireless/libertas/host.h b/drivers/net/wireless/libertas/host.h index 12d5dd9af40c..c6b44c831594 100644 --- a/drivers/net/wireless/libertas/host.h +++ b/drivers/net/wireless/libertas/host.h | |||
@@ -22,7 +22,17 @@ | |||
22 | 22 | ||
23 | #define CMD_OPTION_WAITFORRSP 0x0002 | 23 | #define CMD_OPTION_WAITFORRSP 0x0002 |
24 | 24 | ||
25 | /** Host command ID */ | 25 | /** Host command IDs */ |
26 | |||
27 | /* Return command are almost always the same as the host command, but with | ||
28 | * bit 15 set high. There are a few exceptions, though... | ||
29 | */ | ||
30 | #define CMD_RET(cmd) (0x8000 | cmd) | ||
31 | |||
32 | /* Return command convention exceptions: */ | ||
33 | #define CMD_RET_802_11_ASSOCIATE 0x8012 | ||
34 | |||
35 | /* Command codes */ | ||
26 | #define CMD_CODE_DNLD 0x0002 | 36 | #define CMD_CODE_DNLD 0x0002 |
27 | #define CMD_GET_HW_SPEC 0x0003 | 37 | #define CMD_GET_HW_SPEC 0x0003 |
28 | #define CMD_EEPROM_UPDATE 0x0004 | 38 | #define CMD_EEPROM_UPDATE 0x0004 |
@@ -97,13 +107,10 @@ | |||
97 | #define CMD_GET_TSF 0x0080 | 107 | #define CMD_GET_TSF 0x0080 |
98 | 108 | ||
99 | #define CMD_BT_ACCESS 0x0087 | 109 | #define CMD_BT_ACCESS 0x0087 |
100 | #define CMD_RET_BT_ACCESS 0x8087 | ||
101 | 110 | ||
102 | #define CMD_FWT_ACCESS 0x0095 | 111 | #define CMD_FWT_ACCESS 0x0095 |
103 | #define CMD_RET_FWT_ACCESS 0x8095 | ||
104 | 112 | ||
105 | #define CMD_MESH_ACCESS 0x009b | 113 | #define CMD_MESH_ACCESS 0x009b |
106 | #define CMD_RET_MESH_ACCESS 0x809b | ||
107 | 114 | ||
108 | /* For the IEEE Power Save */ | 115 | /* For the IEEE Power Save */ |
109 | #define CMD_SUBCMD_ENTER_PS 0x0030 | 116 | #define CMD_SUBCMD_ENTER_PS 0x0030 |
@@ -112,46 +119,6 @@ | |||
112 | #define CMD_SUBCMD_FULL_POWERDOWN 0x0035 | 119 | #define CMD_SUBCMD_FULL_POWERDOWN 0x0035 |
113 | #define CMD_SUBCMD_FULL_POWERUP 0x0036 | 120 | #define CMD_SUBCMD_FULL_POWERUP 0x0036 |
114 | 121 | ||
115 | /* command RET code, MSB is set to 1 */ | ||
116 | #define CMD_RET_HW_SPEC_INFO 0x8003 | ||
117 | #define CMD_RET_EEPROM_UPDATE 0x8004 | ||
118 | #define CMD_RET_802_11_RESET 0x8005 | ||
119 | #define CMD_RET_802_11_SCAN 0x8006 | ||
120 | #define CMD_RET_802_11_GET_LOG 0x800b | ||
121 | #define CMD_RET_MAC_CONTROL 0x8028 | ||
122 | #define CMD_RET_MAC_MULTICAST_ADR 0x8010 | ||
123 | #define CMD_RET_802_11_AUTHENTICATE 0x8011 | ||
124 | #define CMD_RET_802_11_DEAUTHENTICATE 0x8024 | ||
125 | #define CMD_RET_802_11_ASSOCIATE 0x8012 | ||
126 | #define CMD_RET_802_11_REASSOCIATE 0x8025 | ||
127 | #define CMD_RET_802_11_DISASSOCIATE 0x8026 | ||
128 | #define CMD_RET_802_11_SET_WEP 0x8013 | ||
129 | #define CMD_RET_802_11_STAT 0x8014 | ||
130 | #define CMD_RET_802_3_STAT 0x8015 | ||
131 | #define CMD_RET_802_11_SNMP_MIB 0x8016 | ||
132 | #define CMD_RET_MAC_REG_MAP 0x8017 | ||
133 | #define CMD_RET_BBP_REG_MAP 0x8018 | ||
134 | #define CMD_RET_RF_REG_MAP 0x8023 | ||
135 | #define CMD_RET_MAC_REG_ACCESS 0x8019 | ||
136 | #define CMD_RET_BBP_REG_ACCESS 0x801a | ||
137 | #define CMD_RET_RF_REG_ACCESS 0x801b | ||
138 | #define CMD_RET_802_11_RADIO_CONTROL 0x801c | ||
139 | #define CMD_RET_802_11_RF_CHANNEL 0x801d | ||
140 | #define CMD_RET_802_11_RSSI 0x801f | ||
141 | #define CMD_RET_802_11_RF_TX_POWER 0x801e | ||
142 | #define CMD_RET_802_11_RF_ANTENNA 0x8020 | ||
143 | #define CMD_RET_802_11_PS_MODE 0x8021 | ||
144 | #define CMD_RET_802_11_DATA_RATE 0x8022 | ||
145 | |||
146 | #define CMD_RET_802_11_AD_HOC_START 0x802B | ||
147 | #define CMD_RET_802_11_AD_HOC_JOIN 0x802C | ||
148 | |||
149 | #define CMD_RET_802_11_QUERY_TKIP_REPLY_CNTRS 0x802e | ||
150 | #define CMD_RET_802_11_ENABLE_RSN 0x802f | ||
151 | #define CMD_RET_802_11_PAIRWISE_TSC 0x8036 | ||
152 | #define CMD_RET_802_11_GROUP_TSC 0x8037 | ||
153 | #define CMD_RET_802_11_KEY_MATERIAL 0x805e | ||
154 | |||
155 | #define CMD_ENABLE_RSN 0x0001 | 122 | #define CMD_ENABLE_RSN 0x0001 |
156 | #define CMD_DISABLE_RSN 0x0000 | 123 | #define CMD_DISABLE_RSN 0x0000 |
157 | 124 | ||
@@ -162,38 +129,6 @@ | |||
162 | #define CMD_ACT_SET_AES (CMD_ACT_SET + 2) | 129 | #define CMD_ACT_SET_AES (CMD_ACT_SET + 2) |
163 | #define CMD_ACT_REMOVE_AES (CMD_ACT_SET + 3) | 130 | #define CMD_ACT_REMOVE_AES (CMD_ACT_SET + 3) |
164 | 131 | ||
165 | #define CMD_RET_802_11_SET_AFC 0x803c | ||
166 | #define CMD_RET_802_11_GET_AFC 0x803d | ||
167 | |||
168 | #define CMD_RET_802_11_AD_HOC_STOP 0x8040 | ||
169 | |||
170 | #define CMD_RET_802_11_BEACON_STOP 0x8049 | ||
171 | |||
172 | #define CMD_RET_802_11_MAC_ADDRESS 0x804D | ||
173 | #define CMD_RET_802_11_EEPROM_ACCESS 0x8059 | ||
174 | |||
175 | #define CMD_RET_802_11_BAND_CONFIG 0x8058 | ||
176 | |||
177 | #define CMD_RET_802_11_SLEEP_PARAMS 0x8066 | ||
178 | |||
179 | #define CMD_RET_802_11_INACTIVITY_TIMEOUT 0x8067 | ||
180 | |||
181 | #define CMD_RET_802_11D_DOMAIN_INFO (0x8000 | \ | ||
182 | CMD_802_11D_DOMAIN_INFO) | ||
183 | |||
184 | #define CMD_RET_802_11_TPC_CFG (CMD_802_11_TPC_CFG | 0x8000) | ||
185 | #define CMD_RET_802_11_PWR_CFG (CMD_802_11_PWR_CFG | 0x8000) | ||
186 | |||
187 | #define CMD_RET_802_11_LED_GPIO_CTRL 0x804e | ||
188 | |||
189 | #define CMD_RET_802_11_SUBSCRIBE_EVENT (CMD_802_11_SUBSCRIBE_EVENT | 0x8000) | ||
190 | |||
191 | #define CMD_RET_802_11_RATE_ADAPT_RATESET (CMD_802_11_RATE_ADAPT_RATESET | 0x8000) | ||
192 | |||
193 | #define CMD_RTE_802_11_TX_RATE_QUERY (CMD_802_11_TX_RATE_QUERY | 0x8000) | ||
194 | |||
195 | #define CMD_RET_GET_TSF 0x8080 | ||
196 | |||
197 | /* Define action or option for CMD_802_11_SET_WEP */ | 132 | /* Define action or option for CMD_802_11_SET_WEP */ |
198 | #define CMD_ACT_ADD 0x0002 | 133 | #define CMD_ACT_ADD 0x0002 |
199 | #define CMD_ACT_REMOVE 0x0004 | 134 | #define CMD_ACT_REMOVE 0x0004 |