diff options
author | Jussi Kivilinna <jussi.kivilinna@mbnet.fi> | 2008-03-07 18:23:25 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-03-13 16:02:33 -0400 |
commit | 461b3f2aa3c45eb2e85751b6a3b75a8dd1abd04a (patch) | |
tree | bbd9eddf9d719d1e8ad77e2fb4af5cd9af1d9ac6 | |
parent | 1e41e1d2771456274ae2c748ed2cc74524a5863f (diff) |
rndis_wlan: cleanup, rename structure members
Rename members of ndis_80211_* structures to match the style of
the rest of the code.
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/rndis_wlan.c | 258 |
1 files changed, 126 insertions, 132 deletions
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c index 157c46463429..977751f372ff 100644 --- a/drivers/net/wireless/rndis_wlan.c +++ b/drivers/net/wireless/rndis_wlan.c | |||
@@ -195,80 +195,80 @@ enum ndis_80211_priv_filter { | |||
195 | }; | 195 | }; |
196 | 196 | ||
197 | struct ndis_80211_ssid { | 197 | struct ndis_80211_ssid { |
198 | __le32 SsidLength; | 198 | __le32 length; |
199 | u8 Ssid[NDIS_802_11_LENGTH_SSID]; | 199 | u8 essid[NDIS_802_11_LENGTH_SSID]; |
200 | } __attribute__((packed)); | 200 | } __attribute__((packed)); |
201 | 201 | ||
202 | struct ndis_80211_conf_freq_hop { | 202 | struct ndis_80211_conf_freq_hop { |
203 | __le32 Length; | 203 | __le32 length; |
204 | __le32 HopPattern; | 204 | __le32 hop_pattern; |
205 | __le32 HopSet; | 205 | __le32 hop_set; |
206 | __le32 DwellTime; | 206 | __le32 dwell_time; |
207 | } __attribute__((packed)); | 207 | } __attribute__((packed)); |
208 | 208 | ||
209 | struct ndis_80211_conf { | 209 | struct ndis_80211_conf { |
210 | __le32 Length; | 210 | __le32 length; |
211 | __le32 BeaconPeriod; | 211 | __le32 beacon_period; |
212 | __le32 ATIMWindow; | 212 | __le32 atim_window; |
213 | __le32 DSConfig; | 213 | __le32 ds_config; |
214 | struct ndis_80211_conf_freq_hop FHConfig; | 214 | struct ndis_80211_conf_freq_hop fh_config; |
215 | } __attribute__((packed)); | 215 | } __attribute__((packed)); |
216 | 216 | ||
217 | struct ndis_80211_bssid_ex { | 217 | struct ndis_80211_bssid_ex { |
218 | __le32 Length; | 218 | __le32 length; |
219 | u8 MacAddress[6]; | 219 | u8 mac[6]; |
220 | u8 Padding[2]; | 220 | u8 padding[2]; |
221 | struct ndis_80211_ssid Ssid; | 221 | struct ndis_80211_ssid ssid; |
222 | __le32 Privacy; | 222 | __le32 privacy; |
223 | __le32 Rssi; | 223 | __le32 rssi; |
224 | __le32 NetworkTypeInUse; | 224 | __le32 net_type; |
225 | struct ndis_80211_conf Configuration; | 225 | struct ndis_80211_conf config; |
226 | __le32 InfrastructureMode; | 226 | __le32 net_infra; |
227 | u8 SupportedRates[NDIS_802_11_LENGTH_RATES_EX]; | 227 | u8 rates[NDIS_802_11_LENGTH_RATES_EX]; |
228 | __le32 IELength; | 228 | __le32 ie_length; |
229 | u8 IEs[0]; | 229 | u8 ies[0]; |
230 | } __attribute__((packed)); | 230 | } __attribute__((packed)); |
231 | 231 | ||
232 | struct ndis_80211_bssid_list_ex { | 232 | struct ndis_80211_bssid_list_ex { |
233 | __le32 NumberOfItems; | 233 | __le32 num_items; |
234 | struct ndis_80211_bssid_ex Bssid[0]; | 234 | struct ndis_80211_bssid_ex bssid[0]; |
235 | } __attribute__((packed)); | 235 | } __attribute__((packed)); |
236 | 236 | ||
237 | struct ndis_80211_fixed_ies { | 237 | struct ndis_80211_fixed_ies { |
238 | u8 Timestamp[8]; | 238 | u8 timestamp[8]; |
239 | __le16 BeaconInterval; | 239 | __le16 beacon_interval; |
240 | __le16 Capabilities; | 240 | __le16 capabilities; |
241 | } __attribute__((packed)); | 241 | } __attribute__((packed)); |
242 | 242 | ||
243 | struct ndis_80211_wep_key { | 243 | struct ndis_80211_wep_key { |
244 | __le32 Length; | 244 | __le32 size; |
245 | __le32 KeyIndex; | 245 | __le32 index; |
246 | __le32 KeyLength; | 246 | __le32 length; |
247 | u8 KeyMaterial[32]; | 247 | u8 material[32]; |
248 | } __attribute__((packed)); | 248 | } __attribute__((packed)); |
249 | 249 | ||
250 | struct ndis_80211_key { | 250 | struct ndis_80211_key { |
251 | __le32 Length; | 251 | __le32 size; |
252 | __le32 KeyIndex; | 252 | __le32 index; |
253 | __le32 KeyLength; | 253 | __le32 length; |
254 | u8 Bssid[6]; | 254 | u8 bssid[6]; |
255 | u8 Padding[6]; | 255 | u8 padding[6]; |
256 | u8 KeyRSC[8]; | 256 | u8 rsc[8]; |
257 | u8 KeyMaterial[32]; | 257 | u8 material[32]; |
258 | } __attribute__((packed)); | 258 | } __attribute__((packed)); |
259 | 259 | ||
260 | struct ndis_80211_remove_key { | 260 | struct ndis_80211_remove_key { |
261 | __le32 Length; | 261 | __le32 size; |
262 | __le32 KeyIndex; | 262 | __le32 index; |
263 | u8 Bssid[6]; | 263 | u8 bssid[6]; |
264 | } __attribute__((packed)); | 264 | } __attribute__((packed)); |
265 | 265 | ||
266 | struct ndis_config_param { | 266 | struct ndis_config_param { |
267 | __le32 ParameterNameOffset; | 267 | __le32 name_offs; |
268 | __le32 ParameterNameLength; | 268 | __le32 name_length; |
269 | __le32 ParameterType; | 269 | __le32 type; |
270 | __le32 ParameterValueOffset; | 270 | __le32 value_offs; |
271 | __le32 ParameterValueLength; | 271 | __le32 value_length; |
272 | } __attribute__((packed)); | 272 | } __attribute__((packed)); |
273 | 273 | ||
274 | /* these have to match what is in wpa_supplicant */ | 274 | /* these have to match what is in wpa_supplicant */ |
@@ -512,12 +512,11 @@ static int rndis_set_config_parameter(struct usbnet *dev, char *param, | |||
512 | devdbg(dev, "setting config parameter: %s, value: %d", | 512 | devdbg(dev, "setting config parameter: %s, value: %d", |
513 | param, *(u32 *)value); | 513 | param, *(u32 *)value); |
514 | 514 | ||
515 | infobuf->ParameterNameOffset = cpu_to_le32(sizeof(*infobuf)); | 515 | infobuf->name_offs = cpu_to_le32(sizeof(*infobuf)); |
516 | infobuf->ParameterNameLength = cpu_to_le32(param_len); | 516 | infobuf->name_length = cpu_to_le32(param_len); |
517 | infobuf->ParameterType = cpu_to_le32(value_type); | 517 | infobuf->type = cpu_to_le32(value_type); |
518 | infobuf->ParameterValueOffset = cpu_to_le32(sizeof(*infobuf) + | 518 | infobuf->value_offs = cpu_to_le32(sizeof(*infobuf) + param_len); |
519 | param_len); | 519 | infobuf->value_length = cpu_to_le32(value_len); |
520 | infobuf->ParameterValueLength = cpu_to_le32(value_len); | ||
521 | 520 | ||
522 | /* simple string to unicode string conversion */ | 521 | /* simple string to unicode string conversion */ |
523 | unibuf = (void *)infobuf + sizeof(*infobuf); | 522 | unibuf = (void *)infobuf + sizeof(*infobuf); |
@@ -631,14 +630,14 @@ static int get_essid(struct usbnet *usbdev, struct ndis_80211_ssid *ssid) | |||
631 | ret = rndis_query_oid(usbdev, OID_802_11_SSID, ssid, &len); | 630 | ret = rndis_query_oid(usbdev, OID_802_11_SSID, ssid, &len); |
632 | 631 | ||
633 | if (ret != 0) | 632 | if (ret != 0) |
634 | ssid->SsidLength = 0; | 633 | ssid->length = 0; |
635 | 634 | ||
636 | #ifdef DEBUG | 635 | #ifdef DEBUG |
637 | { | 636 | { |
638 | unsigned char tmp[NDIS_802_11_LENGTH_SSID + 1]; | 637 | unsigned char tmp[NDIS_802_11_LENGTH_SSID + 1]; |
639 | 638 | ||
640 | memcpy(tmp, ssid->Ssid, le32_to_cpu(ssid->SsidLength)); | 639 | memcpy(tmp, ssid->essid, le32_to_cpu(ssid->length)); |
641 | tmp[le32_to_cpu(ssid->SsidLength)] = 0; | 640 | tmp[le32_to_cpu(ssid->length)] = 0; |
642 | devdbg(usbdev, "get_essid: '%s', ret: %d", tmp, ret); | 641 | devdbg(usbdev, "get_essid: '%s', ret: %d", tmp, ret); |
643 | } | 642 | } |
644 | #endif | 643 | #endif |
@@ -707,12 +706,12 @@ static int disassociate(struct usbnet *usbdev, int reset_ssid) | |||
707 | /* disassociate causes radio to be turned off; if reset_ssid | 706 | /* disassociate causes radio to be turned off; if reset_ssid |
708 | * is given, set random ssid to enable radio */ | 707 | * is given, set random ssid to enable radio */ |
709 | if (reset_ssid) { | 708 | if (reset_ssid) { |
710 | ssid.SsidLength = cpu_to_le32(sizeof(ssid.Ssid)); | 709 | ssid.length = cpu_to_le32(sizeof(ssid.essid)); |
711 | get_random_bytes(&ssid.Ssid[2], sizeof(ssid.Ssid)-2); | 710 | get_random_bytes(&ssid.essid[2], sizeof(ssid.essid)-2); |
712 | ssid.Ssid[0] = 0x1; | 711 | ssid.essid[0] = 0x1; |
713 | ssid.Ssid[1] = 0xff; | 712 | ssid.essid[1] = 0xff; |
714 | for (i = 2; i < sizeof(ssid.Ssid); i++) | 713 | for (i = 2; i < sizeof(ssid.essid); i++) |
715 | ssid.Ssid[i] = 0x1 + (ssid.Ssid[i] * 0xfe / 0xff); | 714 | ssid.essid[i] = 0x1 + (ssid.essid[i] * 0xfe / 0xff); |
716 | ret = set_essid(usbdev, &ssid); | 715 | ret = set_essid(usbdev, &ssid); |
717 | } | 716 | } |
718 | return ret; | 717 | return ret; |
@@ -900,13 +899,13 @@ static int add_wep_key(struct usbnet *usbdev, char *key, int key_len, int index) | |||
900 | 899 | ||
901 | memset(&ndis_key, 0, sizeof(ndis_key)); | 900 | memset(&ndis_key, 0, sizeof(ndis_key)); |
902 | 901 | ||
903 | ndis_key.Length = cpu_to_le32(sizeof(ndis_key)); | 902 | ndis_key.size = cpu_to_le32(sizeof(ndis_key)); |
904 | ndis_key.KeyLength = cpu_to_le32(key_len); | 903 | ndis_key.length = cpu_to_le32(key_len); |
905 | ndis_key.KeyIndex = cpu_to_le32(index); | 904 | ndis_key.index = cpu_to_le32(index); |
906 | memcpy(&ndis_key.KeyMaterial, key, key_len); | 905 | memcpy(&ndis_key.material, key, key_len); |
907 | 906 | ||
908 | if (index == priv->encr_tx_key_index) { | 907 | if (index == priv->encr_tx_key_index) { |
909 | ndis_key.KeyIndex |= cpu_to_le32(1 << 31); | 908 | ndis_key.index |= cpu_to_le32(1 << 31); |
910 | ret = set_encr_mode(usbdev, IW_AUTH_CIPHER_WEP104, | 909 | ret = set_encr_mode(usbdev, IW_AUTH_CIPHER_WEP104, |
911 | IW_AUTH_CIPHER_NONE); | 910 | IW_AUTH_CIPHER_NONE); |
912 | if (ret) | 911 | if (ret) |
@@ -947,17 +946,17 @@ static int remove_key(struct usbnet *usbdev, int index, u8 bssid[ETH_ALEN]) | |||
947 | priv->wpa_cipher_pair == IW_AUTH_CIPHER_CCMP || | 946 | priv->wpa_cipher_pair == IW_AUTH_CIPHER_CCMP || |
948 | priv->wpa_cipher_group == IW_AUTH_CIPHER_TKIP || | 947 | priv->wpa_cipher_group == IW_AUTH_CIPHER_TKIP || |
949 | priv->wpa_cipher_group == IW_AUTH_CIPHER_CCMP) { | 948 | priv->wpa_cipher_group == IW_AUTH_CIPHER_CCMP) { |
950 | remove_key.Length = cpu_to_le32(sizeof(remove_key)); | 949 | remove_key.size = cpu_to_le32(sizeof(remove_key)); |
951 | remove_key.KeyIndex = cpu_to_le32(index); | 950 | remove_key.index = cpu_to_le32(index); |
952 | if (bssid) { | 951 | if (bssid) { |
953 | /* pairwise key */ | 952 | /* pairwise key */ |
954 | if (memcmp(bssid, ffff_bssid, ETH_ALEN) != 0) | 953 | if (memcmp(bssid, ffff_bssid, ETH_ALEN) != 0) |
955 | remove_key.KeyIndex |= cpu_to_le32(1 << 30); | 954 | remove_key.index |= cpu_to_le32(1 << 30); |
956 | memcpy(remove_key.Bssid, bssid, | 955 | memcpy(remove_key.bssid, bssid, |
957 | sizeof(remove_key.Bssid)); | 956 | sizeof(remove_key.bssid)); |
958 | } else | 957 | } else |
959 | memset(remove_key.Bssid, 0xff, | 958 | memset(remove_key.bssid, 0xff, |
960 | sizeof(remove_key.Bssid)); | 959 | sizeof(remove_key.bssid)); |
961 | 960 | ||
962 | ret = rndis_set_oid(usbdev, OID_802_11_REMOVE_KEY, &remove_key, | 961 | ret = rndis_set_oid(usbdev, OID_802_11_REMOVE_KEY, &remove_key, |
963 | sizeof(remove_key)); | 962 | sizeof(remove_key)); |
@@ -1187,11 +1186,11 @@ static int rndis_iw_set_essid(struct net_device *dev, | |||
1187 | if (length > NDIS_802_11_LENGTH_SSID) | 1186 | if (length > NDIS_802_11_LENGTH_SSID) |
1188 | length = NDIS_802_11_LENGTH_SSID; | 1187 | length = NDIS_802_11_LENGTH_SSID; |
1189 | 1188 | ||
1190 | ssid.SsidLength = cpu_to_le32(length); | 1189 | ssid.length = cpu_to_le32(length); |
1191 | if (length > 0) | 1190 | if (length > 0) |
1192 | memcpy(ssid.Ssid, essid, length); | 1191 | memcpy(ssid.essid, essid, length); |
1193 | else | 1192 | else |
1194 | memset(ssid.Ssid, 0, NDIS_802_11_LENGTH_SSID); | 1193 | memset(ssid.essid, 0, NDIS_802_11_LENGTH_SSID); |
1195 | 1194 | ||
1196 | set_assoc_params(usbdev); | 1195 | set_assoc_params(usbdev); |
1197 | 1196 | ||
@@ -1211,10 +1210,10 @@ static int rndis_iw_get_essid(struct net_device *dev, | |||
1211 | 1210 | ||
1212 | ret = get_essid(usbdev, &ssid); | 1211 | ret = get_essid(usbdev, &ssid); |
1213 | 1212 | ||
1214 | if (ret == 0 && le32_to_cpu(ssid.SsidLength) > 0) { | 1213 | if (ret == 0 && le32_to_cpu(ssid.length) > 0) { |
1215 | wrqu->essid.flags = 1; | 1214 | wrqu->essid.flags = 1; |
1216 | wrqu->essid.length = le32_to_cpu(ssid.SsidLength); | 1215 | wrqu->essid.length = le32_to_cpu(ssid.length); |
1217 | memcpy(essid, ssid.Ssid, wrqu->essid.length); | 1216 | memcpy(essid, ssid.essid, wrqu->essid.length); |
1218 | essid[wrqu->essid.length] = 0; | 1217 | essid[wrqu->essid.length] = 0; |
1219 | } else { | 1218 | } else { |
1220 | memset(essid, 0, sizeof(NDIS_802_11_LENGTH_SSID)); | 1219 | memset(essid, 0, sizeof(NDIS_802_11_LENGTH_SSID)); |
@@ -1525,54 +1524,54 @@ static int rndis_iw_set_encode_ext(struct net_device *dev, | |||
1525 | ext->alg == IW_ENCODE_ALG_NONE || ext->key_len == 0) | 1524 | ext->alg == IW_ENCODE_ALG_NONE || ext->key_len == 0) |
1526 | return remove_key(usbdev, keyidx, NULL); | 1525 | return remove_key(usbdev, keyidx, NULL); |
1527 | 1526 | ||
1528 | if (ext->key_len > sizeof(ndis_key.KeyMaterial)) | 1527 | if (ext->key_len > sizeof(ndis_key.material)) |
1529 | return -1; | 1528 | return -1; |
1530 | 1529 | ||
1531 | memset(&ndis_key, 0, sizeof(ndis_key)); | 1530 | memset(&ndis_key, 0, sizeof(ndis_key)); |
1532 | 1531 | ||
1533 | ndis_key.Length = cpu_to_le32(sizeof(ndis_key) - | 1532 | ndis_key.size = cpu_to_le32(sizeof(ndis_key) - |
1534 | sizeof(ndis_key.KeyMaterial) + ext->key_len); | 1533 | sizeof(ndis_key.material) + ext->key_len); |
1535 | ndis_key.KeyLength = cpu_to_le32(ext->key_len); | 1534 | ndis_key.length = cpu_to_le32(ext->key_len); |
1536 | ndis_key.KeyIndex = cpu_to_le32(keyidx); | 1535 | ndis_key.index = cpu_to_le32(keyidx); |
1537 | 1536 | ||
1538 | if (ext->ext_flags & IW_ENCODE_EXT_RX_SEQ_VALID) { | 1537 | if (ext->ext_flags & IW_ENCODE_EXT_RX_SEQ_VALID) { |
1539 | memcpy(ndis_key.KeyRSC, ext->rx_seq, 6); | 1538 | memcpy(ndis_key.rsc, ext->rx_seq, 6); |
1540 | ndis_key.KeyIndex |= cpu_to_le32(1 << 29); | 1539 | ndis_key.index |= cpu_to_le32(1 << 29); |
1541 | } | 1540 | } |
1542 | 1541 | ||
1543 | addr = ext->addr.sa_data; | 1542 | addr = ext->addr.sa_data; |
1544 | if (ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY) { | 1543 | if (ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY) { |
1545 | /* group key */ | 1544 | /* group key */ |
1546 | if (priv->infra_mode == ndis_80211_infra_adhoc) | 1545 | if (priv->infra_mode == ndis_80211_infra_adhoc) |
1547 | memset(ndis_key.Bssid, 0xff, ETH_ALEN); | 1546 | memset(ndis_key.bssid, 0xff, ETH_ALEN); |
1548 | else | 1547 | else |
1549 | get_bssid(usbdev, ndis_key.Bssid); | 1548 | get_bssid(usbdev, ndis_key.bssid); |
1550 | } else { | 1549 | } else { |
1551 | /* pairwise key */ | 1550 | /* pairwise key */ |
1552 | ndis_key.KeyIndex |= cpu_to_le32(1 << 30); | 1551 | ndis_key.index |= cpu_to_le32(1 << 30); |
1553 | memcpy(ndis_key.Bssid, addr, ETH_ALEN); | 1552 | memcpy(ndis_key.bssid, addr, ETH_ALEN); |
1554 | } | 1553 | } |
1555 | 1554 | ||
1556 | if (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) | 1555 | if (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) |
1557 | ndis_key.KeyIndex |= cpu_to_le32(1 << 31); | 1556 | ndis_key.index |= cpu_to_le32(1 << 31); |
1558 | 1557 | ||
1559 | if (ext->alg == IW_ENCODE_ALG_TKIP && ext->key_len == 32) { | 1558 | if (ext->alg == IW_ENCODE_ALG_TKIP && ext->key_len == 32) { |
1560 | /* wpa_supplicant gives us the Michael MIC RX/TX keys in | 1559 | /* wpa_supplicant gives us the Michael MIC RX/TX keys in |
1561 | * different order than NDIS spec, so swap the order here. */ | 1560 | * different order than NDIS spec, so swap the order here. */ |
1562 | memcpy(ndis_key.KeyMaterial, ext->key, 16); | 1561 | memcpy(ndis_key.material, ext->key, 16); |
1563 | memcpy(ndis_key.KeyMaterial + 16, ext->key + 24, 8); | 1562 | memcpy(ndis_key.material + 16, ext->key + 24, 8); |
1564 | memcpy(ndis_key.KeyMaterial + 24, ext->key + 16, 8); | 1563 | memcpy(ndis_key.material + 24, ext->key + 16, 8); |
1565 | } else | 1564 | } else |
1566 | memcpy(ndis_key.KeyMaterial, ext->key, ext->key_len); | 1565 | memcpy(ndis_key.material, ext->key, ext->key_len); |
1567 | 1566 | ||
1568 | ret = rndis_set_oid(usbdev, OID_802_11_ADD_KEY, &ndis_key, | 1567 | ret = rndis_set_oid(usbdev, OID_802_11_ADD_KEY, &ndis_key, |
1569 | le32_to_cpu(ndis_key.Length)); | 1568 | le32_to_cpu(ndis_key.size)); |
1570 | devdbg(usbdev, "SIOCSIWENCODEEXT: OID_802_11_ADD_KEY -> %08X", ret); | 1569 | devdbg(usbdev, "SIOCSIWENCODEEXT: OID_802_11_ADD_KEY -> %08X", ret); |
1571 | if (ret != 0) | 1570 | if (ret != 0) |
1572 | return ret; | 1571 | return ret; |
1573 | 1572 | ||
1574 | priv->encr_key_len[keyidx] = ext->key_len; | 1573 | priv->encr_key_len[keyidx] = ext->key_len; |
1575 | memcpy(&priv->encr_keys[keyidx], ndis_key.KeyMaterial, ext->key_len); | 1574 | memcpy(&priv->encr_keys[keyidx], ndis_key.material, ext->key_len); |
1576 | if (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) | 1575 | if (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) |
1577 | priv->encr_tx_key_index = keyidx; | 1576 | priv->encr_tx_key_index = keyidx; |
1578 | 1577 | ||
@@ -1617,27 +1616,24 @@ static char *rndis_translate_scan(struct net_device *dev, | |||
1617 | unsigned char sbuf[32]; | 1616 | unsigned char sbuf[32]; |
1618 | DECLARE_MAC_BUF(mac); | 1617 | DECLARE_MAC_BUF(mac); |
1619 | 1618 | ||
1620 | bssid_len = le32_to_cpu(bssid->Length); | 1619 | bssid_len = le32_to_cpu(bssid->length); |
1621 | 1620 | ||
1622 | devdbg(usbdev, "BSSID %s", print_mac(mac, bssid->MacAddress)); | 1621 | devdbg(usbdev, "BSSID %s", print_mac(mac, bssid->mac)); |
1623 | iwe.cmd = SIOCGIWAP; | 1622 | iwe.cmd = SIOCGIWAP; |
1624 | iwe.u.ap_addr.sa_family = ARPHRD_ETHER; | 1623 | iwe.u.ap_addr.sa_family = ARPHRD_ETHER; |
1625 | memcpy(iwe.u.ap_addr.sa_data, bssid->MacAddress, ETH_ALEN); | 1624 | memcpy(iwe.u.ap_addr.sa_data, bssid->mac, ETH_ALEN); |
1626 | cev = iwe_stream_add_event(cev, end_buf, &iwe, IW_EV_ADDR_LEN); | 1625 | cev = iwe_stream_add_event(cev, end_buf, &iwe, IW_EV_ADDR_LEN); |
1627 | 1626 | ||
1628 | devdbg(usbdev, "SSID(%d) %s", | 1627 | devdbg(usbdev, "SSID(%d) %s", le32_to_cpu(bssid->ssid.length), |
1629 | le32_to_cpu(bssid->Ssid.SsidLength), | 1628 | bssid->ssid.essid); |
1630 | bssid->Ssid.Ssid); | ||
1631 | iwe.cmd = SIOCGIWESSID; | 1629 | iwe.cmd = SIOCGIWESSID; |
1632 | iwe.u.essid.length = le32_to_cpu(bssid->Ssid.SsidLength); | 1630 | iwe.u.essid.length = le32_to_cpu(bssid->ssid.length); |
1633 | iwe.u.essid.flags = 1; | 1631 | iwe.u.essid.flags = 1; |
1634 | cev = iwe_stream_add_point(cev, end_buf, &iwe, | 1632 | cev = iwe_stream_add_point(cev, end_buf, &iwe, bssid->ssid.essid); |
1635 | bssid->Ssid.Ssid); | ||
1636 | 1633 | ||
1637 | devdbg(usbdev, "MODE %d", | 1634 | devdbg(usbdev, "MODE %d", le32_to_cpu(bssid->net_infra)); |
1638 | le32_to_cpu(bssid->InfrastructureMode)); | ||
1639 | iwe.cmd = SIOCGIWMODE; | 1635 | iwe.cmd = SIOCGIWMODE; |
1640 | switch (le32_to_cpu(bssid->InfrastructureMode)) { | 1636 | switch (le32_to_cpu(bssid->net_infra)) { |
1641 | case ndis_80211_infra_adhoc: | 1637 | case ndis_80211_infra_adhoc: |
1642 | iwe.u.mode = IW_MODE_ADHOC; | 1638 | iwe.u.mode = IW_MODE_ADHOC; |
1643 | break; | 1639 | break; |
@@ -1651,26 +1647,24 @@ static char *rndis_translate_scan(struct net_device *dev, | |||
1651 | } | 1647 | } |
1652 | cev = iwe_stream_add_event(cev, end_buf, &iwe, IW_EV_UINT_LEN); | 1648 | cev = iwe_stream_add_event(cev, end_buf, &iwe, IW_EV_UINT_LEN); |
1653 | 1649 | ||
1654 | devdbg(usbdev, "FREQ %d kHz", | 1650 | devdbg(usbdev, "FREQ %d kHz", le32_to_cpu(bssid->config.ds_config)); |
1655 | le32_to_cpu(bssid->Configuration.DSConfig)); | ||
1656 | iwe.cmd = SIOCGIWFREQ; | 1651 | iwe.cmd = SIOCGIWFREQ; |
1657 | dsconfig_to_freq(le32_to_cpu(bssid->Configuration.DSConfig), | 1652 | dsconfig_to_freq(le32_to_cpu(bssid->config.ds_config), &iwe.u.freq); |
1658 | &iwe.u.freq); | ||
1659 | cev = iwe_stream_add_event(cev, end_buf, &iwe, IW_EV_FREQ_LEN); | 1653 | cev = iwe_stream_add_event(cev, end_buf, &iwe, IW_EV_FREQ_LEN); |
1660 | 1654 | ||
1661 | devdbg(usbdev, "QUAL %d", le32_to_cpu(bssid->Rssi)); | 1655 | devdbg(usbdev, "QUAL %d", le32_to_cpu(bssid->rssi)); |
1662 | iwe.cmd = IWEVQUAL; | 1656 | iwe.cmd = IWEVQUAL; |
1663 | iwe.u.qual.qual = level_to_qual(le32_to_cpu(bssid->Rssi)); | 1657 | iwe.u.qual.qual = level_to_qual(le32_to_cpu(bssid->rssi)); |
1664 | iwe.u.qual.level = le32_to_cpu(bssid->Rssi); | 1658 | iwe.u.qual.level = le32_to_cpu(bssid->rssi); |
1665 | iwe.u.qual.updated = IW_QUAL_QUAL_UPDATED | 1659 | iwe.u.qual.updated = IW_QUAL_QUAL_UPDATED |
1666 | | IW_QUAL_LEVEL_UPDATED | 1660 | | IW_QUAL_LEVEL_UPDATED |
1667 | | IW_QUAL_NOISE_INVALID; | 1661 | | IW_QUAL_NOISE_INVALID; |
1668 | cev = iwe_stream_add_event(cev, end_buf, &iwe, IW_EV_QUAL_LEN); | 1662 | cev = iwe_stream_add_event(cev, end_buf, &iwe, IW_EV_QUAL_LEN); |
1669 | 1663 | ||
1670 | devdbg(usbdev, "ENCODE %d", le32_to_cpu(bssid->Privacy)); | 1664 | devdbg(usbdev, "ENCODE %d", le32_to_cpu(bssid->privacy)); |
1671 | iwe.cmd = SIOCGIWENCODE; | 1665 | iwe.cmd = SIOCGIWENCODE; |
1672 | iwe.u.data.length = 0; | 1666 | iwe.u.data.length = 0; |
1673 | if (le32_to_cpu(bssid->Privacy) == ndis_80211_priv_accept_all) | 1667 | if (le32_to_cpu(bssid->privacy) == ndis_80211_priv_accept_all) |
1674 | iwe.u.data.flags = IW_ENCODE_DISABLED; | 1668 | iwe.u.data.flags = IW_ENCODE_DISABLED; |
1675 | else | 1669 | else |
1676 | iwe.u.data.flags = IW_ENCODE_ENABLED | IW_ENCODE_NOKEY; | 1670 | iwe.u.data.flags = IW_ENCODE_ENABLED | IW_ENCODE_NOKEY; |
@@ -1680,10 +1674,10 @@ static char *rndis_translate_scan(struct net_device *dev, | |||
1680 | devdbg(usbdev, "RATES:"); | 1674 | devdbg(usbdev, "RATES:"); |
1681 | current_val = cev + IW_EV_LCP_LEN; | 1675 | current_val = cev + IW_EV_LCP_LEN; |
1682 | iwe.cmd = SIOCGIWRATE; | 1676 | iwe.cmd = SIOCGIWRATE; |
1683 | for (i = 0; i < sizeof(bssid->SupportedRates); i++) { | 1677 | for (i = 0; i < sizeof(bssid->rates); i++) { |
1684 | if (bssid->SupportedRates[i] & 0x7f) { | 1678 | if (bssid->rates[i] & 0x7f) { |
1685 | iwe.u.bitrate.value = | 1679 | iwe.u.bitrate.value = |
1686 | ((bssid->SupportedRates[i] & 0x7f) * | 1680 | ((bssid->rates[i] & 0x7f) * |
1687 | 500000); | 1681 | 500000); |
1688 | devdbg(usbdev, " %d", iwe.u.bitrate.value); | 1682 | devdbg(usbdev, " %d", iwe.u.bitrate.value); |
1689 | current_val = iwe_stream_add_value(cev, | 1683 | current_val = iwe_stream_add_value(cev, |
@@ -1695,23 +1689,23 @@ static char *rndis_translate_scan(struct net_device *dev, | |||
1695 | if ((current_val - cev) > IW_EV_LCP_LEN) | 1689 | if ((current_val - cev) > IW_EV_LCP_LEN) |
1696 | cev = current_val; | 1690 | cev = current_val; |
1697 | 1691 | ||
1698 | beacon = le32_to_cpu(bssid->Configuration.BeaconPeriod); | 1692 | beacon = le32_to_cpu(bssid->config.beacon_period); |
1699 | devdbg(usbdev, "BCN_INT %d", beacon); | 1693 | devdbg(usbdev, "BCN_INT %d", beacon); |
1700 | iwe.cmd = IWEVCUSTOM; | 1694 | iwe.cmd = IWEVCUSTOM; |
1701 | snprintf(sbuf, sizeof(sbuf), "bcn_int=%d", beacon); | 1695 | snprintf(sbuf, sizeof(sbuf), "bcn_int=%d", beacon); |
1702 | iwe.u.data.length = strlen(sbuf); | 1696 | iwe.u.data.length = strlen(sbuf); |
1703 | cev = iwe_stream_add_point(cev, end_buf, &iwe, sbuf); | 1697 | cev = iwe_stream_add_point(cev, end_buf, &iwe, sbuf); |
1704 | 1698 | ||
1705 | atim = le32_to_cpu(bssid->Configuration.ATIMWindow); | 1699 | atim = le32_to_cpu(bssid->config.atim_window); |
1706 | devdbg(usbdev, "ATIM %d", atim); | 1700 | devdbg(usbdev, "ATIM %d", atim); |
1707 | iwe.cmd = IWEVCUSTOM; | 1701 | iwe.cmd = IWEVCUSTOM; |
1708 | snprintf(sbuf, sizeof(sbuf), "atim=%u", atim); | 1702 | snprintf(sbuf, sizeof(sbuf), "atim=%u", atim); |
1709 | iwe.u.data.length = strlen(sbuf); | 1703 | iwe.u.data.length = strlen(sbuf); |
1710 | cev = iwe_stream_add_point(cev, end_buf, &iwe, sbuf); | 1704 | cev = iwe_stream_add_point(cev, end_buf, &iwe, sbuf); |
1711 | 1705 | ||
1712 | ie = (void *)(bssid->IEs + sizeof(struct ndis_80211_fixed_ies)); | 1706 | ie = (void *)(bssid->ies + sizeof(struct ndis_80211_fixed_ies)); |
1713 | ie_len = min(bssid_len - (int)sizeof(*bssid), | 1707 | ie_len = min(bssid_len - (int)sizeof(*bssid), |
1714 | (int)le32_to_cpu(bssid->IELength)); | 1708 | (int)le32_to_cpu(bssid->ie_length)); |
1715 | ie_len -= sizeof(struct ndis_80211_fixed_ies); | 1709 | ie_len -= sizeof(struct ndis_80211_fixed_ies); |
1716 | while (ie_len >= sizeof(*ie) && sizeof(*ie) + ie->len <= ie_len) { | 1710 | while (ie_len >= sizeof(*ie) && sizeof(*ie) + ie->len <= ie_len) { |
1717 | if ((ie->id == MFIE_TYPE_GENERIC && ie->len >= 4 && | 1711 | if ((ie->id == MFIE_TYPE_GENERIC && ie->len >= 4 && |
@@ -1758,16 +1752,16 @@ static int rndis_iw_get_scan(struct net_device *dev, | |||
1758 | goto out; | 1752 | goto out; |
1759 | 1753 | ||
1760 | bssid_list = buf; | 1754 | bssid_list = buf; |
1761 | bssid = bssid_list->Bssid; | 1755 | bssid = bssid_list->bssid; |
1762 | bssid_len = le32_to_cpu(bssid->Length); | 1756 | bssid_len = le32_to_cpu(bssid->length); |
1763 | count = le32_to_cpu(bssid_list->NumberOfItems); | 1757 | count = le32_to_cpu(bssid_list->num_items); |
1764 | devdbg(usbdev, "SIOCGIWSCAN: %d BSSIDs found", count); | 1758 | devdbg(usbdev, "SIOCGIWSCAN: %d BSSIDs found", count); |
1765 | 1759 | ||
1766 | while (count && ((void *)bssid + bssid_len) <= (buf + len)) { | 1760 | while (count && ((void *)bssid + bssid_len) <= (buf + len)) { |
1767 | cev = rndis_translate_scan(dev, cev, extra + IW_SCAN_MAX_DATA, | 1761 | cev = rndis_translate_scan(dev, cev, extra + IW_SCAN_MAX_DATA, |
1768 | bssid); | 1762 | bssid); |
1769 | bssid = (void *)bssid + bssid_len; | 1763 | bssid = (void *)bssid + bssid_len; |
1770 | bssid_len = le32_to_cpu(bssid->Length); | 1764 | bssid_len = le32_to_cpu(bssid->length); |
1771 | count--; | 1765 | count--; |
1772 | } | 1766 | } |
1773 | 1767 | ||
@@ -1960,7 +1954,7 @@ static int rndis_iw_set_freq(struct net_device *dev, | |||
1960 | return 0; | 1954 | return 0; |
1961 | } | 1955 | } |
1962 | 1956 | ||
1963 | config.DSConfig = cpu_to_le32(dsconfig); | 1957 | config.ds_config = cpu_to_le32(dsconfig); |
1964 | 1958 | ||
1965 | devdbg(usbdev, "SIOCSIWFREQ: %d * 10^%d", wrqu->freq.m, wrqu->freq.e); | 1959 | devdbg(usbdev, "SIOCSIWFREQ: %d * 10^%d", wrqu->freq.m, wrqu->freq.e); |
1966 | return rndis_set_oid(usbdev, OID_802_11_CONFIGURATION, &config, | 1960 | return rndis_set_oid(usbdev, OID_802_11_CONFIGURATION, &config, |
@@ -1978,7 +1972,7 @@ static int rndis_iw_get_freq(struct net_device *dev, | |||
1978 | len = sizeof(config); | 1972 | len = sizeof(config); |
1979 | ret = rndis_query_oid(usbdev, OID_802_11_CONFIGURATION, &config, &len); | 1973 | ret = rndis_query_oid(usbdev, OID_802_11_CONFIGURATION, &config, &len); |
1980 | if (ret == 0) | 1974 | if (ret == 0) |
1981 | dsconfig_to_freq(le32_to_cpu(config.DSConfig), &wrqu->freq); | 1975 | dsconfig_to_freq(le32_to_cpu(config.ds_config), &wrqu->freq); |
1982 | 1976 | ||
1983 | devdbg(usbdev, "SIOCGIWFREQ: %d", wrqu->freq.m); | 1977 | devdbg(usbdev, "SIOCGIWFREQ: %d", wrqu->freq.m); |
1984 | return ret; | 1978 | return ret; |