diff options
author | Jussi Kivilinna <jussi.kivilinna@mbnet.fi> | 2008-03-07 18:23:17 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-03-13 16:02:32 -0400 |
commit | 1e41e1d2771456274ae2c748ed2cc74524a5863f (patch) | |
tree | d0cba823fe9fed65507baf7061ee492b25d5ae8c /drivers/net/wireless/rndis_wlan.c | |
parent | e9010e2fdfe68360da374e31f7008a6d9935c783 (diff) |
rndis_wlan: cleanup, rename and reorder enums and structures
Rename enums and structures to ndis_80211_* for greater readability.
Also change order so that enumerations are presented first.
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rndis_wlan.c')
-rw-r--r-- | drivers/net/wireless/rndis_wlan.c | 213 |
1 files changed, 103 insertions, 110 deletions
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c index 10b776c1adc5..157c46463429 100644 --- a/drivers/net/wireless/rndis_wlan.c +++ b/drivers/net/wireless/rndis_wlan.c | |||
@@ -154,107 +154,100 @@ MODULE_PARM_DESC(workaround_interval, | |||
154 | #define NDIS_802_11_LENGTH_RATES 8 | 154 | #define NDIS_802_11_LENGTH_RATES 8 |
155 | #define NDIS_802_11_LENGTH_RATES_EX 16 | 155 | #define NDIS_802_11_LENGTH_RATES_EX 16 |
156 | 156 | ||
157 | struct NDIS_802_11_SSID { | 157 | enum ndis_80211_net_type { |
158 | ndis_80211_type_freq_hop, | ||
159 | ndis_80211_type_direct_seq, | ||
160 | ndis_80211_type_ofdm_a, | ||
161 | ndis_80211_type_ofdm_g | ||
162 | }; | ||
163 | |||
164 | enum ndis_80211_net_infra { | ||
165 | ndis_80211_infra_adhoc, | ||
166 | ndis_80211_infra_infra, | ||
167 | ndis_80211_infra_auto_unknown | ||
168 | }; | ||
169 | |||
170 | enum ndis_80211_auth_mode { | ||
171 | ndis_80211_auth_open, | ||
172 | ndis_80211_auth_shared, | ||
173 | ndis_80211_auth_auto_switch, | ||
174 | ndis_80211_auth_wpa, | ||
175 | ndis_80211_auth_wpa_psk, | ||
176 | ndis_80211_auth_wpa_none, | ||
177 | ndis_80211_auth_wpa2, | ||
178 | ndis_80211_auth_wpa2_psk | ||
179 | }; | ||
180 | |||
181 | enum ndis_80211_encr_status { | ||
182 | ndis_80211_encr_wep_enabled, | ||
183 | ndis_80211_encr_disabled, | ||
184 | ndis_80211_encr_wep_key_absent, | ||
185 | ndis_80211_encr_not_supported, | ||
186 | ndis_80211_encr_tkip_enabled, | ||
187 | ndis_80211_encr_tkip_key_absent, | ||
188 | ndis_80211_encr_ccmp_enabled, | ||
189 | ndis_80211_encr_ccmp_key_absent | ||
190 | }; | ||
191 | |||
192 | enum ndis_80211_priv_filter { | ||
193 | ndis_80211_priv_accept_all, | ||
194 | ndis_80211_priv_8021x_wep | ||
195 | }; | ||
196 | |||
197 | struct ndis_80211_ssid { | ||
158 | __le32 SsidLength; | 198 | __le32 SsidLength; |
159 | u8 Ssid[NDIS_802_11_LENGTH_SSID]; | 199 | u8 Ssid[NDIS_802_11_LENGTH_SSID]; |
160 | } __attribute__((packed)); | 200 | } __attribute__((packed)); |
161 | 201 | ||
162 | enum NDIS_802_11_NETWORK_TYPE { | 202 | struct ndis_80211_conf_freq_hop { |
163 | Ndis802_11FH, | ||
164 | Ndis802_11DS, | ||
165 | Ndis802_11OFDM5, | ||
166 | Ndis802_11OFDM24, | ||
167 | Ndis802_11NetworkTypeMax | ||
168 | }; | ||
169 | |||
170 | struct NDIS_802_11_CONFIGURATION_FH { | ||
171 | __le32 Length; | 203 | __le32 Length; |
172 | __le32 HopPattern; | 204 | __le32 HopPattern; |
173 | __le32 HopSet; | 205 | __le32 HopSet; |
174 | __le32 DwellTime; | 206 | __le32 DwellTime; |
175 | } __attribute__((packed)); | 207 | } __attribute__((packed)); |
176 | 208 | ||
177 | struct NDIS_802_11_CONFIGURATION { | 209 | struct ndis_80211_conf { |
178 | __le32 Length; | 210 | __le32 Length; |
179 | __le32 BeaconPeriod; | 211 | __le32 BeaconPeriod; |
180 | __le32 ATIMWindow; | 212 | __le32 ATIMWindow; |
181 | __le32 DSConfig; | 213 | __le32 DSConfig; |
182 | struct NDIS_802_11_CONFIGURATION_FH FHConfig; | 214 | struct ndis_80211_conf_freq_hop FHConfig; |
183 | } __attribute__((packed)); | 215 | } __attribute__((packed)); |
184 | 216 | ||
185 | enum NDIS_802_11_NETWORK_INFRASTRUCTURE { | 217 | struct ndis_80211_bssid_ex { |
186 | Ndis802_11IBSS, | ||
187 | Ndis802_11Infrastructure, | ||
188 | Ndis802_11AutoUnknown, | ||
189 | Ndis802_11InfrastructureMax | ||
190 | }; | ||
191 | |||
192 | enum NDIS_802_11_AUTHENTICATION_MODE { | ||
193 | Ndis802_11AuthModeOpen, | ||
194 | Ndis802_11AuthModeShared, | ||
195 | Ndis802_11AuthModeAutoSwitch, | ||
196 | Ndis802_11AuthModeWPA, | ||
197 | Ndis802_11AuthModeWPAPSK, | ||
198 | Ndis802_11AuthModeWPANone, | ||
199 | Ndis802_11AuthModeWPA2, | ||
200 | Ndis802_11AuthModeWPA2PSK, | ||
201 | Ndis802_11AuthModeMax | ||
202 | }; | ||
203 | |||
204 | enum NDIS_802_11_ENCRYPTION_STATUS { | ||
205 | Ndis802_11WEPEnabled, | ||
206 | Ndis802_11Encryption1Enabled = Ndis802_11WEPEnabled, | ||
207 | Ndis802_11WEPDisabled, | ||
208 | Ndis802_11EncryptionDisabled = Ndis802_11WEPDisabled, | ||
209 | Ndis802_11WEPKeyAbsent, | ||
210 | Ndis802_11Encryption1KeyAbsent = Ndis802_11WEPKeyAbsent, | ||
211 | Ndis802_11WEPNotSupported, | ||
212 | Ndis802_11EncryptionNotSupported = Ndis802_11WEPNotSupported, | ||
213 | Ndis802_11Encryption2Enabled, | ||
214 | Ndis802_11Encryption2KeyAbsent, | ||
215 | Ndis802_11Encryption3Enabled, | ||
216 | Ndis802_11Encryption3KeyAbsent | ||
217 | }; | ||
218 | |||
219 | enum NDIS_802_11_PRIVACY_FILTER { | ||
220 | Ndis802_11PrivFilterAcceptAll, | ||
221 | Ndis802_11PrivFilter8021xWEP | ||
222 | }; | ||
223 | |||
224 | struct NDIS_WLAN_BSSID_EX { | ||
225 | __le32 Length; | 218 | __le32 Length; |
226 | u8 MacAddress[6]; | 219 | u8 MacAddress[6]; |
227 | u8 Padding[2]; | 220 | u8 Padding[2]; |
228 | struct NDIS_802_11_SSID Ssid; | 221 | struct ndis_80211_ssid Ssid; |
229 | __le32 Privacy; | 222 | __le32 Privacy; |
230 | __le32 Rssi; | 223 | __le32 Rssi; |
231 | __le32 NetworkTypeInUse; | 224 | __le32 NetworkTypeInUse; |
232 | struct NDIS_802_11_CONFIGURATION Configuration; | 225 | struct ndis_80211_conf Configuration; |
233 | __le32 InfrastructureMode; | 226 | __le32 InfrastructureMode; |
234 | u8 SupportedRates[NDIS_802_11_LENGTH_RATES_EX]; | 227 | u8 SupportedRates[NDIS_802_11_LENGTH_RATES_EX]; |
235 | __le32 IELength; | 228 | __le32 IELength; |
236 | u8 IEs[0]; | 229 | u8 IEs[0]; |
237 | } __attribute__((packed)); | 230 | } __attribute__((packed)); |
238 | 231 | ||
239 | struct NDIS_802_11_BSSID_LIST_EX { | 232 | struct ndis_80211_bssid_list_ex { |
240 | __le32 NumberOfItems; | 233 | __le32 NumberOfItems; |
241 | struct NDIS_WLAN_BSSID_EX Bssid[0]; | 234 | struct ndis_80211_bssid_ex Bssid[0]; |
242 | } __attribute__((packed)); | 235 | } __attribute__((packed)); |
243 | 236 | ||
244 | struct NDIS_802_11_FIXED_IEs { | 237 | struct ndis_80211_fixed_ies { |
245 | u8 Timestamp[8]; | 238 | u8 Timestamp[8]; |
246 | __le16 BeaconInterval; | 239 | __le16 BeaconInterval; |
247 | __le16 Capabilities; | 240 | __le16 Capabilities; |
248 | } __attribute__((packed)); | 241 | } __attribute__((packed)); |
249 | 242 | ||
250 | struct NDIS_802_11_WEP { | 243 | struct ndis_80211_wep_key { |
251 | __le32 Length; | 244 | __le32 Length; |
252 | __le32 KeyIndex; | 245 | __le32 KeyIndex; |
253 | __le32 KeyLength; | 246 | __le32 KeyLength; |
254 | u8 KeyMaterial[32]; | 247 | u8 KeyMaterial[32]; |
255 | } __attribute__((packed)); | 248 | } __attribute__((packed)); |
256 | 249 | ||
257 | struct NDIS_802_11_KEY { | 250 | struct ndis_80211_key { |
258 | __le32 Length; | 251 | __le32 Length; |
259 | __le32 KeyIndex; | 252 | __le32 KeyIndex; |
260 | __le32 KeyLength; | 253 | __le32 KeyLength; |
@@ -264,13 +257,13 @@ struct NDIS_802_11_KEY { | |||
264 | u8 KeyMaterial[32]; | 257 | u8 KeyMaterial[32]; |
265 | } __attribute__((packed)); | 258 | } __attribute__((packed)); |
266 | 259 | ||
267 | struct NDIS_802_11_REMOVE_KEY { | 260 | struct ndis_80211_remove_key { |
268 | __le32 Length; | 261 | __le32 Length; |
269 | __le32 KeyIndex; | 262 | __le32 KeyIndex; |
270 | u8 Bssid[6]; | 263 | u8 Bssid[6]; |
271 | } __attribute__((packed)); | 264 | } __attribute__((packed)); |
272 | 265 | ||
273 | struct RNDIS_CONFIG_PARAMETER_INFOBUFFER { | 266 | struct ndis_config_param { |
274 | __le32 ParameterNameOffset; | 267 | __le32 ParameterNameOffset; |
275 | __le32 ParameterNameLength; | 268 | __le32 ParameterNameLength; |
276 | __le32 ParameterType; | 269 | __le32 ParameterType; |
@@ -334,7 +327,7 @@ struct rndis_wext_private { | |||
334 | /* hardware state */ | 327 | /* hardware state */ |
335 | int radio_on; | 328 | int radio_on; |
336 | int infra_mode; | 329 | int infra_mode; |
337 | struct NDIS_802_11_SSID essid; | 330 | struct ndis_80211_ssid essid; |
338 | 331 | ||
339 | /* encryption stuff */ | 332 | /* encryption stuff */ |
340 | int encr_tx_key_index; | 333 | int encr_tx_key_index; |
@@ -484,7 +477,7 @@ static int rndis_set_oid(struct usbnet *dev, __le32 oid, void *data, int len) | |||
484 | static int rndis_set_config_parameter(struct usbnet *dev, char *param, | 477 | static int rndis_set_config_parameter(struct usbnet *dev, char *param, |
485 | int value_type, void *value) | 478 | int value_type, void *value) |
486 | { | 479 | { |
487 | struct RNDIS_CONFIG_PARAMETER_INFOBUFFER *infobuf; | 480 | struct ndis_config_param *infobuf; |
488 | int value_len, info_len, param_len, ret, i; | 481 | int value_len, info_len, param_len, ret, i; |
489 | __le16 *unibuf; | 482 | __le16 *unibuf; |
490 | __le32 *dst_value; | 483 | __le32 *dst_value; |
@@ -630,7 +623,7 @@ static int freq_to_dsconfig(struct iw_freq *freq, unsigned int *dsconfig) | |||
630 | static int | 623 | static int |
631 | add_wep_key(struct usbnet *usbdev, char *key, int key_len, int index); | 624 | add_wep_key(struct usbnet *usbdev, char *key, int key_len, int index); |
632 | 625 | ||
633 | static int get_essid(struct usbnet *usbdev, struct NDIS_802_11_SSID *ssid) | 626 | static int get_essid(struct usbnet *usbdev, struct ndis_80211_ssid *ssid) |
634 | { | 627 | { |
635 | int ret, len; | 628 | int ret, len; |
636 | 629 | ||
@@ -653,7 +646,7 @@ static int get_essid(struct usbnet *usbdev, struct NDIS_802_11_SSID *ssid) | |||
653 | } | 646 | } |
654 | 647 | ||
655 | 648 | ||
656 | static int set_essid(struct usbnet *usbdev, struct NDIS_802_11_SSID *ssid) | 649 | static int set_essid(struct usbnet *usbdev, struct ndis_80211_ssid *ssid) |
657 | { | 650 | { |
658 | struct rndis_wext_private *priv = get_rndis_wext_priv(usbdev); | 651 | struct rndis_wext_private *priv = get_rndis_wext_priv(usbdev); |
659 | int ret; | 652 | int ret; |
@@ -697,7 +690,7 @@ static int is_associated(struct usbnet *usbdev) | |||
697 | static int disassociate(struct usbnet *usbdev, int reset_ssid) | 690 | static int disassociate(struct usbnet *usbdev, int reset_ssid) |
698 | { | 691 | { |
699 | struct rndis_wext_private *priv = get_rndis_wext_priv(usbdev); | 692 | struct rndis_wext_private *priv = get_rndis_wext_priv(usbdev); |
700 | struct NDIS_802_11_SSID ssid; | 693 | struct ndis_80211_ssid ssid; |
701 | int i, ret = 0; | 694 | int i, ret = 0; |
702 | 695 | ||
703 | if (priv->radio_on) { | 696 | if (priv->radio_on) { |
@@ -737,23 +730,23 @@ static int set_auth_mode(struct usbnet *usbdev, int wpa_version, int authalg) | |||
737 | 730 | ||
738 | if (wpa_version & IW_AUTH_WPA_VERSION_WPA2) { | 731 | if (wpa_version & IW_AUTH_WPA_VERSION_WPA2) { |
739 | if (priv->wpa_keymgmt & IW_AUTH_KEY_MGMT_802_1X) | 732 | if (priv->wpa_keymgmt & IW_AUTH_KEY_MGMT_802_1X) |
740 | auth_mode = Ndis802_11AuthModeWPA2; | 733 | auth_mode = ndis_80211_auth_wpa2; |
741 | else | 734 | else |
742 | auth_mode = Ndis802_11AuthModeWPA2PSK; | 735 | auth_mode = ndis_80211_auth_wpa2_psk; |
743 | } else if (wpa_version & IW_AUTH_WPA_VERSION_WPA) { | 736 | } else if (wpa_version & IW_AUTH_WPA_VERSION_WPA) { |
744 | if (priv->wpa_keymgmt & IW_AUTH_KEY_MGMT_802_1X) | 737 | if (priv->wpa_keymgmt & IW_AUTH_KEY_MGMT_802_1X) |
745 | auth_mode = Ndis802_11AuthModeWPA; | 738 | auth_mode = ndis_80211_auth_wpa; |
746 | else if (priv->wpa_keymgmt & IW_AUTH_KEY_MGMT_PSK) | 739 | else if (priv->wpa_keymgmt & IW_AUTH_KEY_MGMT_PSK) |
747 | auth_mode = Ndis802_11AuthModeWPAPSK; | 740 | auth_mode = ndis_80211_auth_wpa_psk; |
748 | else | 741 | else |
749 | auth_mode = Ndis802_11AuthModeWPANone; | 742 | auth_mode = ndis_80211_auth_wpa_none; |
750 | } else if (authalg & IW_AUTH_ALG_SHARED_KEY) { | 743 | } else if (authalg & IW_AUTH_ALG_SHARED_KEY) { |
751 | if (authalg & IW_AUTH_ALG_OPEN_SYSTEM) | 744 | if (authalg & IW_AUTH_ALG_OPEN_SYSTEM) |
752 | auth_mode = Ndis802_11AuthModeAutoSwitch; | 745 | auth_mode = ndis_80211_auth_auto_switch; |
753 | else | 746 | else |
754 | auth_mode = Ndis802_11AuthModeShared; | 747 | auth_mode = ndis_80211_auth_shared; |
755 | } else | 748 | } else |
756 | auth_mode = Ndis802_11AuthModeOpen; | 749 | auth_mode = ndis_80211_auth_open; |
757 | 750 | ||
758 | tmp = cpu_to_le32(auth_mode); | 751 | tmp = cpu_to_le32(auth_mode); |
759 | ret = rndis_set_oid(usbdev, OID_802_11_AUTHENTICATION_MODE, &tmp, | 752 | ret = rndis_set_oid(usbdev, OID_802_11_AUTHENTICATION_MODE, &tmp, |
@@ -778,9 +771,9 @@ static int set_priv_filter(struct usbnet *usbdev) | |||
778 | 771 | ||
779 | if (priv->wpa_version & IW_AUTH_WPA_VERSION_WPA2 || | 772 | if (priv->wpa_version & IW_AUTH_WPA_VERSION_WPA2 || |
780 | priv->wpa_version & IW_AUTH_WPA_VERSION_WPA) | 773 | priv->wpa_version & IW_AUTH_WPA_VERSION_WPA) |
781 | tmp = cpu_to_le32(Ndis802_11PrivFilter8021xWEP); | 774 | tmp = cpu_to_le32(ndis_80211_priv_8021x_wep); |
782 | else | 775 | else |
783 | tmp = cpu_to_le32(Ndis802_11PrivFilterAcceptAll); | 776 | tmp = cpu_to_le32(ndis_80211_priv_accept_all); |
784 | 777 | ||
785 | return rndis_set_oid(usbdev, OID_802_11_PRIVACY_FILTER, &tmp, | 778 | return rndis_set_oid(usbdev, OID_802_11_PRIVACY_FILTER, &tmp, |
786 | sizeof(tmp)); | 779 | sizeof(tmp)); |
@@ -798,18 +791,18 @@ static int set_encr_mode(struct usbnet *usbdev, int pairwise, int groupwise) | |||
798 | groupwise); | 791 | groupwise); |
799 | 792 | ||
800 | if (pairwise & IW_AUTH_CIPHER_CCMP) | 793 | if (pairwise & IW_AUTH_CIPHER_CCMP) |
801 | encr_mode = Ndis802_11Encryption3Enabled; | 794 | encr_mode = ndis_80211_encr_ccmp_enabled; |
802 | else if (pairwise & IW_AUTH_CIPHER_TKIP) | 795 | else if (pairwise & IW_AUTH_CIPHER_TKIP) |
803 | encr_mode = Ndis802_11Encryption2Enabled; | 796 | encr_mode = ndis_80211_encr_tkip_enabled; |
804 | else if (pairwise & | 797 | else if (pairwise & |
805 | (IW_AUTH_CIPHER_WEP40 | IW_AUTH_CIPHER_WEP104)) | 798 | (IW_AUTH_CIPHER_WEP40 | IW_AUTH_CIPHER_WEP104)) |
806 | encr_mode = Ndis802_11Encryption1Enabled; | 799 | encr_mode = ndis_80211_encr_wep_enabled; |
807 | else if (groupwise & IW_AUTH_CIPHER_CCMP) | 800 | else if (groupwise & IW_AUTH_CIPHER_CCMP) |
808 | encr_mode = Ndis802_11Encryption3Enabled; | 801 | encr_mode = ndis_80211_encr_ccmp_enabled; |
809 | else if (groupwise & IW_AUTH_CIPHER_TKIP) | 802 | else if (groupwise & IW_AUTH_CIPHER_TKIP) |
810 | encr_mode = Ndis802_11Encryption2Enabled; | 803 | encr_mode = ndis_80211_encr_tkip_enabled; |
811 | else | 804 | else |
812 | encr_mode = Ndis802_11EncryptionDisabled; | 805 | encr_mode = ndis_80211_encr_disabled; |
813 | 806 | ||
814 | tmp = cpu_to_le32(encr_mode); | 807 | tmp = cpu_to_le32(encr_mode); |
815 | ret = rndis_set_oid(usbdev, OID_802_11_ENCRYPTION_STATUS, &tmp, | 808 | ret = rndis_set_oid(usbdev, OID_802_11_ENCRYPTION_STATUS, &tmp, |
@@ -877,7 +870,7 @@ static void set_default_iw_params(struct usbnet *usbdev) | |||
877 | priv->wpa_keymgmt = 0; | 870 | priv->wpa_keymgmt = 0; |
878 | priv->wpa_version = 0; | 871 | priv->wpa_version = 0; |
879 | 872 | ||
880 | set_infra_mode(usbdev, Ndis802_11Infrastructure); | 873 | set_infra_mode(usbdev, ndis_80211_infra_infra); |
881 | set_auth_mode(usbdev, IW_AUTH_WPA_VERSION_DISABLED, | 874 | set_auth_mode(usbdev, IW_AUTH_WPA_VERSION_DISABLED, |
882 | IW_AUTH_ALG_OPEN_SYSTEM); | 875 | IW_AUTH_ALG_OPEN_SYSTEM); |
883 | set_priv_filter(usbdev); | 876 | set_priv_filter(usbdev); |
@@ -899,7 +892,7 @@ static int deauthenticate(struct usbnet *usbdev) | |||
899 | static int add_wep_key(struct usbnet *usbdev, char *key, int key_len, int index) | 892 | static int add_wep_key(struct usbnet *usbdev, char *key, int key_len, int index) |
900 | { | 893 | { |
901 | struct rndis_wext_private *priv = get_rndis_wext_priv(usbdev); | 894 | struct rndis_wext_private *priv = get_rndis_wext_priv(usbdev); |
902 | struct NDIS_802_11_WEP ndis_key; | 895 | struct ndis_80211_wep_key ndis_key; |
903 | int ret; | 896 | int ret; |
904 | 897 | ||
905 | if (key_len <= 0 || key_len > 32 || index < 0 || index >= 4) | 898 | if (key_len <= 0 || key_len > 32 || index < 0 || index >= 4) |
@@ -940,7 +933,7 @@ static int add_wep_key(struct usbnet *usbdev, char *key, int key_len, int index) | |||
940 | static int remove_key(struct usbnet *usbdev, int index, u8 bssid[ETH_ALEN]) | 933 | static int remove_key(struct usbnet *usbdev, int index, u8 bssid[ETH_ALEN]) |
941 | { | 934 | { |
942 | struct rndis_wext_private *priv = get_rndis_wext_priv(usbdev); | 935 | struct rndis_wext_private *priv = get_rndis_wext_priv(usbdev); |
943 | struct NDIS_802_11_REMOVE_KEY remove_key; | 936 | struct ndis_80211_remove_key remove_key; |
944 | __le32 keyindex; | 937 | __le32 keyindex; |
945 | int ret; | 938 | int ret; |
946 | 939 | ||
@@ -1184,7 +1177,7 @@ static int rndis_iw_get_name(struct net_device *dev, | |||
1184 | static int rndis_iw_set_essid(struct net_device *dev, | 1177 | static int rndis_iw_set_essid(struct net_device *dev, |
1185 | struct iw_request_info *info, union iwreq_data *wrqu, char *essid) | 1178 | struct iw_request_info *info, union iwreq_data *wrqu, char *essid) |
1186 | { | 1179 | { |
1187 | struct NDIS_802_11_SSID ssid; | 1180 | struct ndis_80211_ssid ssid; |
1188 | int length = wrqu->essid.length; | 1181 | int length = wrqu->essid.length; |
1189 | struct usbnet *usbdev = dev->priv; | 1182 | struct usbnet *usbdev = dev->priv; |
1190 | 1183 | ||
@@ -1212,7 +1205,7 @@ static int rndis_iw_set_essid(struct net_device *dev, | |||
1212 | static int rndis_iw_get_essid(struct net_device *dev, | 1205 | static int rndis_iw_get_essid(struct net_device *dev, |
1213 | struct iw_request_info *info, union iwreq_data *wrqu, char *essid) | 1206 | struct iw_request_info *info, union iwreq_data *wrqu, char *essid) |
1214 | { | 1207 | { |
1215 | struct NDIS_802_11_SSID ssid; | 1208 | struct ndis_80211_ssid ssid; |
1216 | struct usbnet *usbdev = dev->priv; | 1209 | struct usbnet *usbdev = dev->priv; |
1217 | int ret; | 1210 | int ret; |
1218 | 1211 | ||
@@ -1398,13 +1391,13 @@ static int rndis_iw_get_mode(struct net_device *dev, | |||
1398 | struct rndis_wext_private *priv = get_rndis_wext_priv(usbdev); | 1391 | struct rndis_wext_private *priv = get_rndis_wext_priv(usbdev); |
1399 | 1392 | ||
1400 | switch (priv->infra_mode) { | 1393 | switch (priv->infra_mode) { |
1401 | case Ndis802_11IBSS: | 1394 | case ndis_80211_infra_adhoc: |
1402 | wrqu->mode = IW_MODE_ADHOC; | 1395 | wrqu->mode = IW_MODE_ADHOC; |
1403 | break; | 1396 | break; |
1404 | case Ndis802_11Infrastructure: | 1397 | case ndis_80211_infra_infra: |
1405 | wrqu->mode = IW_MODE_INFRA; | 1398 | wrqu->mode = IW_MODE_INFRA; |
1406 | break; | 1399 | break; |
1407 | /*case Ndis802_11AutoUnknown:*/ | 1400 | /*case ndis_80211_infra_auto_unknown:*/ |
1408 | default: | 1401 | default: |
1409 | wrqu->mode = IW_MODE_AUTO; | 1402 | wrqu->mode = IW_MODE_AUTO; |
1410 | break; | 1403 | break; |
@@ -1424,14 +1417,14 @@ static int rndis_iw_set_mode(struct net_device *dev, | |||
1424 | 1417 | ||
1425 | switch (wrqu->mode) { | 1418 | switch (wrqu->mode) { |
1426 | case IW_MODE_ADHOC: | 1419 | case IW_MODE_ADHOC: |
1427 | mode = Ndis802_11IBSS; | 1420 | mode = ndis_80211_infra_adhoc; |
1428 | break; | 1421 | break; |
1429 | case IW_MODE_INFRA: | 1422 | case IW_MODE_INFRA: |
1430 | mode = Ndis802_11Infrastructure; | 1423 | mode = ndis_80211_infra_infra; |
1431 | break; | 1424 | break; |
1432 | /*case IW_MODE_AUTO:*/ | 1425 | /*case IW_MODE_AUTO:*/ |
1433 | default: | 1426 | default: |
1434 | mode = Ndis802_11AutoUnknown; | 1427 | mode = ndis_80211_infra_auto_unknown; |
1435 | break; | 1428 | break; |
1436 | } | 1429 | } |
1437 | 1430 | ||
@@ -1507,7 +1500,7 @@ static int rndis_iw_set_encode_ext(struct net_device *dev, | |||
1507 | struct iw_encode_ext *ext = (struct iw_encode_ext *)extra; | 1500 | struct iw_encode_ext *ext = (struct iw_encode_ext *)extra; |
1508 | struct usbnet *usbdev = dev->priv; | 1501 | struct usbnet *usbdev = dev->priv; |
1509 | struct rndis_wext_private *priv = get_rndis_wext_priv(usbdev); | 1502 | struct rndis_wext_private *priv = get_rndis_wext_priv(usbdev); |
1510 | struct NDIS_802_11_KEY ndis_key; | 1503 | struct ndis_80211_key ndis_key; |
1511 | int keyidx, ret; | 1504 | int keyidx, ret; |
1512 | u8 *addr; | 1505 | u8 *addr; |
1513 | 1506 | ||
@@ -1550,7 +1543,7 @@ static int rndis_iw_set_encode_ext(struct net_device *dev, | |||
1550 | addr = ext->addr.sa_data; | 1543 | addr = ext->addr.sa_data; |
1551 | if (ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY) { | 1544 | if (ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY) { |
1552 | /* group key */ | 1545 | /* group key */ |
1553 | if (priv->infra_mode == Ndis802_11IBSS) | 1546 | if (priv->infra_mode == ndis_80211_infra_adhoc) |
1554 | memset(ndis_key.Bssid, 0xff, ETH_ALEN); | 1547 | memset(ndis_key.Bssid, 0xff, ETH_ALEN); |
1555 | else | 1548 | else |
1556 | get_bssid(usbdev, ndis_key.Bssid); | 1549 | get_bssid(usbdev, ndis_key.Bssid); |
@@ -1611,7 +1604,7 @@ static int rndis_iw_set_scan(struct net_device *dev, | |||
1611 | 1604 | ||
1612 | 1605 | ||
1613 | static char *rndis_translate_scan(struct net_device *dev, | 1606 | static char *rndis_translate_scan(struct net_device *dev, |
1614 | char *cev, char *end_buf, struct NDIS_WLAN_BSSID_EX *bssid) | 1607 | char *cev, char *end_buf, struct ndis_80211_bssid_ex *bssid) |
1615 | { | 1608 | { |
1616 | #ifdef DEBUG | 1609 | #ifdef DEBUG |
1617 | struct usbnet *usbdev = dev->priv; | 1610 | struct usbnet *usbdev = dev->priv; |
@@ -1645,13 +1638,13 @@ static char *rndis_translate_scan(struct net_device *dev, | |||
1645 | le32_to_cpu(bssid->InfrastructureMode)); | 1638 | le32_to_cpu(bssid->InfrastructureMode)); |
1646 | iwe.cmd = SIOCGIWMODE; | 1639 | iwe.cmd = SIOCGIWMODE; |
1647 | switch (le32_to_cpu(bssid->InfrastructureMode)) { | 1640 | switch (le32_to_cpu(bssid->InfrastructureMode)) { |
1648 | case Ndis802_11IBSS: | 1641 | case ndis_80211_infra_adhoc: |
1649 | iwe.u.mode = IW_MODE_ADHOC; | 1642 | iwe.u.mode = IW_MODE_ADHOC; |
1650 | break; | 1643 | break; |
1651 | case Ndis802_11Infrastructure: | 1644 | case ndis_80211_infra_infra: |
1652 | iwe.u.mode = IW_MODE_INFRA; | 1645 | iwe.u.mode = IW_MODE_INFRA; |
1653 | break; | 1646 | break; |
1654 | /*case Ndis802_11AutoUnknown:*/ | 1647 | /*case ndis_80211_infra_auto_unknown:*/ |
1655 | default: | 1648 | default: |
1656 | iwe.u.mode = IW_MODE_AUTO; | 1649 | iwe.u.mode = IW_MODE_AUTO; |
1657 | break; | 1650 | break; |
@@ -1677,7 +1670,7 @@ static char *rndis_translate_scan(struct net_device *dev, | |||
1677 | devdbg(usbdev, "ENCODE %d", le32_to_cpu(bssid->Privacy)); | 1670 | devdbg(usbdev, "ENCODE %d", le32_to_cpu(bssid->Privacy)); |
1678 | iwe.cmd = SIOCGIWENCODE; | 1671 | iwe.cmd = SIOCGIWENCODE; |
1679 | iwe.u.data.length = 0; | 1672 | iwe.u.data.length = 0; |
1680 | if (le32_to_cpu(bssid->Privacy) == Ndis802_11PrivFilterAcceptAll) | 1673 | if (le32_to_cpu(bssid->Privacy) == ndis_80211_priv_accept_all) |
1681 | iwe.u.data.flags = IW_ENCODE_DISABLED; | 1674 | iwe.u.data.flags = IW_ENCODE_DISABLED; |
1682 | else | 1675 | else |
1683 | iwe.u.data.flags = IW_ENCODE_ENABLED | IW_ENCODE_NOKEY; | 1676 | iwe.u.data.flags = IW_ENCODE_ENABLED | IW_ENCODE_NOKEY; |
@@ -1716,10 +1709,10 @@ static char *rndis_translate_scan(struct net_device *dev, | |||
1716 | iwe.u.data.length = strlen(sbuf); | 1709 | iwe.u.data.length = strlen(sbuf); |
1717 | cev = iwe_stream_add_point(cev, end_buf, &iwe, sbuf); | 1710 | cev = iwe_stream_add_point(cev, end_buf, &iwe, sbuf); |
1718 | 1711 | ||
1719 | ie = (void *)(bssid->IEs + sizeof(struct NDIS_802_11_FIXED_IEs)); | 1712 | ie = (void *)(bssid->IEs + sizeof(struct ndis_80211_fixed_ies)); |
1720 | ie_len = min(bssid_len - (int)sizeof(*bssid), | 1713 | ie_len = min(bssid_len - (int)sizeof(*bssid), |
1721 | (int)le32_to_cpu(bssid->IELength)); | 1714 | (int)le32_to_cpu(bssid->IELength)); |
1722 | ie_len -= sizeof(struct NDIS_802_11_FIXED_IEs); | 1715 | ie_len -= sizeof(struct ndis_80211_fixed_ies); |
1723 | while (ie_len >= sizeof(*ie) && sizeof(*ie) + ie->len <= ie_len) { | 1716 | while (ie_len >= sizeof(*ie) && sizeof(*ie) + ie->len <= ie_len) { |
1724 | if ((ie->id == MFIE_TYPE_GENERIC && ie->len >= 4 && | 1717 | if ((ie->id == MFIE_TYPE_GENERIC && ie->len >= 4 && |
1725 | memcmp(ie->data, "\x00\x50\xf2\x01", 4) == 0) || | 1718 | memcmp(ie->data, "\x00\x50\xf2\x01", 4) == 0) || |
@@ -1746,8 +1739,8 @@ static int rndis_iw_get_scan(struct net_device *dev, | |||
1746 | struct usbnet *usbdev = dev->priv; | 1739 | struct usbnet *usbdev = dev->priv; |
1747 | void *buf = NULL; | 1740 | void *buf = NULL; |
1748 | char *cev = extra; | 1741 | char *cev = extra; |
1749 | struct NDIS_802_11_BSSID_LIST_EX *bssid_list; | 1742 | struct ndis_80211_bssid_list_ex *bssid_list; |
1750 | struct NDIS_WLAN_BSSID_EX *bssid; | 1743 | struct ndis_80211_bssid_ex *bssid; |
1751 | int ret = -EINVAL, len, count, bssid_len; | 1744 | int ret = -EINVAL, len, count, bssid_len; |
1752 | 1745 | ||
1753 | devdbg(usbdev, "SIOCGIWSCAN"); | 1746 | devdbg(usbdev, "SIOCGIWSCAN"); |
@@ -1948,7 +1941,7 @@ static int rndis_iw_set_freq(struct net_device *dev, | |||
1948 | struct iw_request_info *info, union iwreq_data *wrqu, char *extra) | 1941 | struct iw_request_info *info, union iwreq_data *wrqu, char *extra) |
1949 | { | 1942 | { |
1950 | struct usbnet *usbdev = dev->priv; | 1943 | struct usbnet *usbdev = dev->priv; |
1951 | struct NDIS_802_11_CONFIGURATION config; | 1944 | struct ndis_80211_conf config; |
1952 | unsigned int dsconfig; | 1945 | unsigned int dsconfig; |
1953 | int len, ret; | 1946 | int len, ret; |
1954 | 1947 | ||
@@ -1979,7 +1972,7 @@ static int rndis_iw_get_freq(struct net_device *dev, | |||
1979 | struct iw_request_info *info, union iwreq_data *wrqu, char *extra) | 1972 | struct iw_request_info *info, union iwreq_data *wrqu, char *extra) |
1980 | { | 1973 | { |
1981 | struct usbnet *usbdev = dev->priv; | 1974 | struct usbnet *usbdev = dev->priv; |
1982 | struct NDIS_802_11_CONFIGURATION config; | 1975 | struct ndis_80211_conf config; |
1983 | int len, ret; | 1976 | int len, ret; |
1984 | 1977 | ||
1985 | len = sizeof(config); | 1978 | len = sizeof(config); |
@@ -2266,14 +2259,14 @@ static int rndis_wext_get_caps(struct usbnet *dev) | |||
2266 | n = 8; | 2259 | n = 8; |
2267 | for (i = 0; i < n; i++) { | 2260 | for (i = 0; i < n; i++) { |
2268 | switch (le32_to_cpu(networks_supported.items[i])) { | 2261 | switch (le32_to_cpu(networks_supported.items[i])) { |
2269 | case Ndis802_11FH: | 2262 | case ndis_80211_type_freq_hop: |
2270 | case Ndis802_11DS: | 2263 | case ndis_80211_type_direct_seq: |
2271 | priv->caps |= CAP_MODE_80211B; | 2264 | priv->caps |= CAP_MODE_80211B; |
2272 | break; | 2265 | break; |
2273 | case Ndis802_11OFDM5: | 2266 | case ndis_80211_type_ofdm_a: |
2274 | priv->caps |= CAP_MODE_80211A; | 2267 | priv->caps |= CAP_MODE_80211A; |
2275 | break; | 2268 | break; |
2276 | case Ndis802_11OFDM24: | 2269 | case ndis_80211_type_ofdm_g: |
2277 | priv->caps |= CAP_MODE_80211G; | 2270 | priv->caps |= CAP_MODE_80211G; |
2278 | break; | 2271 | break; |
2279 | } | 2272 | } |