aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJussi Kivilinna <jussi.kivilinna@mbnet.fi>2009-06-04 13:13:19 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-06-10 13:27:49 -0400
commitaa18294a289548f45ea6a784f008295ccddf6b14 (patch)
tree0bd55070c485a15e599d6f9accf24a90cbc8fbde /drivers
parenta60e77e5a41330334fd0ca428f18919d1ea6ed62 (diff)
rndis_wlan: cleanup: capitalize enum labels
Capitalize enum labels as told in Documents/CodingStyle. Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/rndis_wlan.c136
1 files changed, 68 insertions, 68 deletions
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c
index c254fdf446fd..de94496cb0e9 100644
--- a/drivers/net/wireless/rndis_wlan.c
+++ b/drivers/net/wireless/rndis_wlan.c
@@ -157,55 +157,55 @@ MODULE_PARM_DESC(workaround_interval,
157#define NDIS_802_11_LENGTH_RATES_EX 16 157#define NDIS_802_11_LENGTH_RATES_EX 16
158 158
159enum ndis_80211_net_type { 159enum ndis_80211_net_type {
160 ndis_80211_type_freq_hop, 160 NDIS_80211_TYPE_FREQ_HOP,
161 ndis_80211_type_direct_seq, 161 NDIS_80211_TYPE_DIRECT_SEQ,
162 ndis_80211_type_ofdm_a, 162 NDIS_80211_TYPE_OFDM_A,
163 ndis_80211_type_ofdm_g 163 NDIS_80211_TYPE_OFDM_G
164}; 164};
165 165
166enum ndis_80211_net_infra { 166enum ndis_80211_net_infra {
167 ndis_80211_infra_adhoc, 167 NDIS_80211_INFRA_ADHOC,
168 ndis_80211_infra_infra, 168 NDIS_80211_INFRA_INFRA,
169 ndis_80211_infra_auto_unknown 169 NDIS_80211_INFRA_AUTO_UNKNOWN
170}; 170};
171 171
172enum ndis_80211_auth_mode { 172enum ndis_80211_auth_mode {
173 ndis_80211_auth_open, 173 NDIS_80211_AUTH_OPEN,
174 ndis_80211_auth_shared, 174 NDIS_80211_AUTH_SHARED,
175 ndis_80211_auth_auto_switch, 175 NDIS_80211_AUTH_AUTO_SWITCH,
176 ndis_80211_auth_wpa, 176 NDIS_80211_AUTH_WPA,
177 ndis_80211_auth_wpa_psk, 177 NDIS_80211_AUTH_WPA_PSK,
178 ndis_80211_auth_wpa_none, 178 NDIS_80211_AUTH_WPA_NONE,
179 ndis_80211_auth_wpa2, 179 NDIS_80211_AUTH_WPA2,
180 ndis_80211_auth_wpa2_psk 180 NDIS_80211_AUTH_WPA2_PSK
181}; 181};
182 182
183enum ndis_80211_encr_status { 183enum ndis_80211_encr_status {
184 ndis_80211_encr_wep_enabled, 184 NDIS_80211_ENCR_WEP_ENABLED,
185 ndis_80211_encr_disabled, 185 NDIS_80211_ENCR_DISABLED,
186 ndis_80211_encr_wep_key_absent, 186 NDIS_80211_ENCR_WEP_KEY_ABSENT,
187 ndis_80211_encr_not_supported, 187 NDIS_80211_ENCR_NOT_SUPPORTED,
188 ndis_80211_encr_tkip_enabled, 188 NDIS_80211_ENCR_TKIP_ENABLED,
189 ndis_80211_encr_tkip_key_absent, 189 NDIS_80211_ENCR_TKIP_KEY_ABSENT,
190 ndis_80211_encr_ccmp_enabled, 190 NDIS_80211_ENCR_CCMP_ENABLED,
191 ndis_80211_encr_ccmp_key_absent 191 NDIS_80211_ENCR_CCMP_KEY_ABSENT
192}; 192};
193 193
194enum ndis_80211_priv_filter { 194enum ndis_80211_priv_filter {
195 ndis_80211_priv_accept_all, 195 NDIS_80211_PRIV_ACCEPT_ALL,
196 ndis_80211_priv_8021x_wep 196 NDIS_80211_PRIV_8021X_WEP
197}; 197};
198 198
199enum ndis_80211_addkey_bits { 199enum ndis_80211_addkey_bits {
200 ndis_80211_addkey_8021x_auth = cpu_to_le32(1 << 28), 200 NDIS_80211_ADDKEY_8021X_AUTH = cpu_to_le32(1 << 28),
201 ndis_80211_addkey_set_init_recv_seq = cpu_to_le32(1 << 29), 201 NDIS_80211_ADDKEY_SET_INIT_RECV_SEQ = cpu_to_le32(1 << 29),
202 ndis_80211_addkey_pairwise_key = cpu_to_le32(1 << 30), 202 NDIS_80211_ADDKEY_PAIRWISE_KEY = cpu_to_le32(1 << 30),
203 ndis_80211_addkey_transmit_key = cpu_to_le32(1 << 31), 203 NDIS_80211_ADDKEY_TRANSMIT_KEY = cpu_to_le32(1 << 31)
204}; 204};
205 205
206enum ndis_80211_addwep_bits { 206enum ndis_80211_addwep_bits {
207 ndis_80211_addwep_perclient_key = cpu_to_le32(1 << 30), 207 NDIS_80211_ADDWEP_PERCLIENT_KEY = cpu_to_le32(1 << 30),
208 ndis_80211_addwep_transmit_key = cpu_to_le32(1 << 31), 208 NDIS_80211_ADDWEP_TRANSMIT_KEY = cpu_to_le32(1 << 31)
209}; 209};
210 210
211struct ndis_80211_ssid { 211struct ndis_80211_ssid {
@@ -835,23 +835,23 @@ static int set_auth_mode(struct usbnet *usbdev, int wpa_version, int authalg)
835 835
836 if (wpa_version & IW_AUTH_WPA_VERSION_WPA2) { 836 if (wpa_version & IW_AUTH_WPA_VERSION_WPA2) {
837 if (priv->wpa_keymgmt & IW_AUTH_KEY_MGMT_802_1X) 837 if (priv->wpa_keymgmt & IW_AUTH_KEY_MGMT_802_1X)
838 auth_mode = ndis_80211_auth_wpa2; 838 auth_mode = NDIS_80211_AUTH_WPA2;
839 else 839 else
840 auth_mode = ndis_80211_auth_wpa2_psk; 840 auth_mode = NDIS_80211_AUTH_WPA2_PSK;
841 } else if (wpa_version & IW_AUTH_WPA_VERSION_WPA) { 841 } else if (wpa_version & IW_AUTH_WPA_VERSION_WPA) {
842 if (priv->wpa_keymgmt & IW_AUTH_KEY_MGMT_802_1X) 842 if (priv->wpa_keymgmt & IW_AUTH_KEY_MGMT_802_1X)
843 auth_mode = ndis_80211_auth_wpa; 843 auth_mode = NDIS_80211_AUTH_WPA;
844 else if (priv->wpa_keymgmt & IW_AUTH_KEY_MGMT_PSK) 844 else if (priv->wpa_keymgmt & IW_AUTH_KEY_MGMT_PSK)
845 auth_mode = ndis_80211_auth_wpa_psk; 845 auth_mode = NDIS_80211_AUTH_WPA_PSK;
846 else 846 else
847 auth_mode = ndis_80211_auth_wpa_none; 847 auth_mode = NDIS_80211_AUTH_WPA_NONE;
848 } else if (authalg & IW_AUTH_ALG_SHARED_KEY) { 848 } else if (authalg & IW_AUTH_ALG_SHARED_KEY) {
849 if (authalg & IW_AUTH_ALG_OPEN_SYSTEM) 849 if (authalg & IW_AUTH_ALG_OPEN_SYSTEM)
850 auth_mode = ndis_80211_auth_auto_switch; 850 auth_mode = NDIS_80211_AUTH_AUTO_SWITCH;
851 else 851 else
852 auth_mode = ndis_80211_auth_shared; 852 auth_mode = NDIS_80211_AUTH_SHARED;
853 } else 853 } else
854 auth_mode = ndis_80211_auth_open; 854 auth_mode = NDIS_80211_AUTH_OPEN;
855 855
856 tmp = cpu_to_le32(auth_mode); 856 tmp = cpu_to_le32(auth_mode);
857 ret = rndis_set_oid(usbdev, OID_802_11_AUTHENTICATION_MODE, &tmp, 857 ret = rndis_set_oid(usbdev, OID_802_11_AUTHENTICATION_MODE, &tmp,
@@ -876,9 +876,9 @@ static int set_priv_filter(struct usbnet *usbdev)
876 876
877 if (priv->wpa_version & IW_AUTH_WPA_VERSION_WPA2 || 877 if (priv->wpa_version & IW_AUTH_WPA_VERSION_WPA2 ||
878 priv->wpa_version & IW_AUTH_WPA_VERSION_WPA) 878 priv->wpa_version & IW_AUTH_WPA_VERSION_WPA)
879 tmp = cpu_to_le32(ndis_80211_priv_8021x_wep); 879 tmp = cpu_to_le32(NDIS_80211_PRIV_8021X_WEP);
880 else 880 else
881 tmp = cpu_to_le32(ndis_80211_priv_accept_all); 881 tmp = cpu_to_le32(NDIS_80211_PRIV_ACCEPT_ALL);
882 882
883 return rndis_set_oid(usbdev, OID_802_11_PRIVACY_FILTER, &tmp, 883 return rndis_set_oid(usbdev, OID_802_11_PRIVACY_FILTER, &tmp,
884 sizeof(tmp)); 884 sizeof(tmp));
@@ -896,18 +896,18 @@ static int set_encr_mode(struct usbnet *usbdev, int pairwise, int groupwise)
896 groupwise); 896 groupwise);
897 897
898 if (pairwise & IW_AUTH_CIPHER_CCMP) 898 if (pairwise & IW_AUTH_CIPHER_CCMP)
899 encr_mode = ndis_80211_encr_ccmp_enabled; 899 encr_mode = NDIS_80211_ENCR_CCMP_ENABLED;
900 else if (pairwise & IW_AUTH_CIPHER_TKIP) 900 else if (pairwise & IW_AUTH_CIPHER_TKIP)
901 encr_mode = ndis_80211_encr_tkip_enabled; 901 encr_mode = NDIS_80211_ENCR_TKIP_ENABLED;
902 else if (pairwise & 902 else if (pairwise &
903 (IW_AUTH_CIPHER_WEP40 | IW_AUTH_CIPHER_WEP104)) 903 (IW_AUTH_CIPHER_WEP40 | IW_AUTH_CIPHER_WEP104))
904 encr_mode = ndis_80211_encr_wep_enabled; 904 encr_mode = NDIS_80211_ENCR_WEP_ENABLED;
905 else if (groupwise & IW_AUTH_CIPHER_CCMP) 905 else if (groupwise & IW_AUTH_CIPHER_CCMP)
906 encr_mode = ndis_80211_encr_ccmp_enabled; 906 encr_mode = NDIS_80211_ENCR_CCMP_ENABLED;
907 else if (groupwise & IW_AUTH_CIPHER_TKIP) 907 else if (groupwise & IW_AUTH_CIPHER_TKIP)
908 encr_mode = ndis_80211_encr_tkip_enabled; 908 encr_mode = NDIS_80211_ENCR_TKIP_ENABLED;
909 else 909 else
910 encr_mode = ndis_80211_encr_disabled; 910 encr_mode = NDIS_80211_ENCR_DISABLED;
911 911
912 tmp = cpu_to_le32(encr_mode); 912 tmp = cpu_to_le32(encr_mode);
913 ret = rndis_set_oid(usbdev, OID_802_11_ENCRYPTION_STATUS, &tmp, 913 ret = rndis_set_oid(usbdev, OID_802_11_ENCRYPTION_STATUS, &tmp,
@@ -975,7 +975,7 @@ static void set_default_iw_params(struct usbnet *usbdev)
975 priv->wpa_keymgmt = 0; 975 priv->wpa_keymgmt = 0;
976 priv->wpa_version = 0; 976 priv->wpa_version = 0;
977 977
978 set_infra_mode(usbdev, ndis_80211_infra_infra); 978 set_infra_mode(usbdev, NDIS_80211_INFRA_INFRA);
979 set_auth_mode(usbdev, IW_AUTH_WPA_VERSION_DISABLED, 979 set_auth_mode(usbdev, IW_AUTH_WPA_VERSION_DISABLED,
980 IW_AUTH_ALG_OPEN_SYSTEM); 980 IW_AUTH_ALG_OPEN_SYSTEM);
981 set_priv_filter(usbdev); 981 set_priv_filter(usbdev);
@@ -1011,7 +1011,7 @@ static int add_wep_key(struct usbnet *usbdev, char *key, int key_len, int index)
1011 memcpy(&ndis_key.material, key, key_len); 1011 memcpy(&ndis_key.material, key, key_len);
1012 1012
1013 if (index == priv->encr_tx_key_index) { 1013 if (index == priv->encr_tx_key_index) {
1014 ndis_key.index |= ndis_80211_addwep_transmit_key; 1014 ndis_key.index |= NDIS_80211_ADDWEP_TRANSMIT_KEY;
1015 ret = set_encr_mode(usbdev, IW_AUTH_CIPHER_WEP104, 1015 ret = set_encr_mode(usbdev, IW_AUTH_CIPHER_WEP104,
1016 IW_AUTH_CIPHER_NONE); 1016 IW_AUTH_CIPHER_NONE);
1017 if (ret) 1017 if (ret)
@@ -1047,15 +1047,15 @@ static int add_wpa_key(struct usbnet *usbdev, const u8 *key, int key_len,
1047 return -EINVAL; 1047 return -EINVAL;
1048 if (key_len > sizeof(ndis_key.material) || key_len < 0) 1048 if (key_len > sizeof(ndis_key.material) || key_len < 0)
1049 return -EINVAL; 1049 return -EINVAL;
1050 if ((flags & ndis_80211_addkey_set_init_recv_seq) && !rx_seq) 1050 if ((flags & NDIS_80211_ADDKEY_SET_INIT_RECV_SEQ) && !rx_seq)
1051 return -EINVAL; 1051 return -EINVAL;
1052 if ((flags & ndis_80211_addkey_pairwise_key) && !addr) 1052 if ((flags & NDIS_80211_ADDKEY_PAIRWISE_KEY) && !addr)
1053 return -EINVAL; 1053 return -EINVAL;
1054 1054
1055 devdbg(usbdev, "add_wpa_key(%i): flags:%i%i%i", index, 1055 devdbg(usbdev, "add_wpa_key(%i): flags:%i%i%i", index,
1056 !!(flags & ndis_80211_addkey_transmit_key), 1056 !!(flags & NDIS_80211_ADDKEY_TRANSMIT_KEY),
1057 !!(flags & ndis_80211_addkey_pairwise_key), 1057 !!(flags & NDIS_80211_ADDKEY_PAIRWISE_KEY),
1058 !!(flags & ndis_80211_addkey_set_init_recv_seq)); 1058 !!(flags & NDIS_80211_ADDKEY_SET_INIT_RECV_SEQ));
1059 1059
1060 memset(&ndis_key, 0, sizeof(ndis_key)); 1060 memset(&ndis_key, 0, sizeof(ndis_key));
1061 1061
@@ -1073,15 +1073,15 @@ static int add_wpa_key(struct usbnet *usbdev, const u8 *key, int key_len,
1073 } else 1073 } else
1074 memcpy(ndis_key.material, key, key_len); 1074 memcpy(ndis_key.material, key, key_len);
1075 1075
1076 if (flags & ndis_80211_addkey_set_init_recv_seq) 1076 if (flags & NDIS_80211_ADDKEY_SET_INIT_RECV_SEQ)
1077 memcpy(ndis_key.rsc, rx_seq, 6); 1077 memcpy(ndis_key.rsc, rx_seq, 6);
1078 1078
1079 if (flags & ndis_80211_addkey_pairwise_key) { 1079 if (flags & NDIS_80211_ADDKEY_PAIRWISE_KEY) {
1080 /* pairwise key */ 1080 /* pairwise key */
1081 memcpy(ndis_key.bssid, addr->sa_data, ETH_ALEN); 1081 memcpy(ndis_key.bssid, addr->sa_data, ETH_ALEN);
1082 } else { 1082 } else {
1083 /* group key */ 1083 /* group key */
1084 if (priv->infra_mode == ndis_80211_infra_adhoc) 1084 if (priv->infra_mode == NDIS_80211_INFRA_ADHOC)
1085 memset(ndis_key.bssid, 0xff, ETH_ALEN); 1085 memset(ndis_key.bssid, 0xff, ETH_ALEN);
1086 else 1086 else
1087 get_bssid(usbdev, ndis_key.bssid); 1087 get_bssid(usbdev, ndis_key.bssid);
@@ -1096,7 +1096,7 @@ static int add_wpa_key(struct usbnet *usbdev, const u8 *key, int key_len,
1096 priv->encr_key_len[index] = key_len; 1096 priv->encr_key_len[index] = key_len;
1097 priv->encr_key_wpa[index] = 1; 1097 priv->encr_key_wpa[index] = 1;
1098 1098
1099 if (flags & ndis_80211_addkey_transmit_key) 1099 if (flags & NDIS_80211_ADDKEY_TRANSMIT_KEY)
1100 priv->encr_tx_key_index = index; 1100 priv->encr_tx_key_index = index;
1101 1101
1102 return 0; 1102 return 0;
@@ -1128,7 +1128,7 @@ static int remove_key(struct usbnet *usbdev, int index, u8 bssid[ETH_ALEN])
1128 /* pairwise key */ 1128 /* pairwise key */
1129 if (memcmp(bssid, ffff_bssid, ETH_ALEN) != 0) 1129 if (memcmp(bssid, ffff_bssid, ETH_ALEN) != 0)
1130 remove_key.index |= 1130 remove_key.index |=
1131 ndis_80211_addkey_pairwise_key; 1131 NDIS_80211_ADDKEY_PAIRWISE_KEY;
1132 memcpy(remove_key.bssid, bssid, 1132 memcpy(remove_key.bssid, bssid,
1133 sizeof(remove_key.bssid)); 1133 sizeof(remove_key.bssid));
1134 } else 1134 } else
@@ -1238,10 +1238,10 @@ static int rndis_change_virtual_intf(struct wiphy *wiphy, int ifindex,
1238 1238
1239 switch (type) { 1239 switch (type) {
1240 case NL80211_IFTYPE_ADHOC: 1240 case NL80211_IFTYPE_ADHOC:
1241 mode = ndis_80211_infra_adhoc; 1241 mode = NDIS_80211_INFRA_ADHOC;
1242 break; 1242 break;
1243 case NL80211_IFTYPE_STATION: 1243 case NL80211_IFTYPE_STATION:
1244 mode = ndis_80211_infra_infra; 1244 mode = NDIS_80211_INFRA_INFRA;
1245 break; 1245 break;
1246 default: 1246 default:
1247 return -EINVAL; 1247 return -EINVAL;
@@ -1698,11 +1698,11 @@ static int rndis_iw_set_encode_ext(struct net_device *dev,
1698 1698
1699 flags = 0; 1699 flags = 0;
1700 if (ext->ext_flags & IW_ENCODE_EXT_RX_SEQ_VALID) 1700 if (ext->ext_flags & IW_ENCODE_EXT_RX_SEQ_VALID)
1701 flags |= ndis_80211_addkey_set_init_recv_seq; 1701 flags |= NDIS_80211_ADDKEY_SET_INIT_RECV_SEQ;
1702 if (!(ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY)) 1702 if (!(ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY))
1703 flags |= ndis_80211_addkey_pairwise_key; 1703 flags |= NDIS_80211_ADDKEY_PAIRWISE_KEY;
1704 if (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) 1704 if (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY)
1705 flags |= ndis_80211_addkey_transmit_key; 1705 flags |= NDIS_80211_ADDKEY_TRANSMIT_KEY;
1706 1706
1707 return add_wpa_key(usbdev, ext->key, ext->key_len, keyidx, &ext->addr, 1707 return add_wpa_key(usbdev, ext->key, ext->key_len, keyidx, &ext->addr,
1708 ext->rx_seq, ext->alg, flags); 1708 ext->rx_seq, ext->alg, flags);
@@ -2160,14 +2160,14 @@ static int rndis_wext_get_caps(struct usbnet *usbdev)
2160 n = 8; 2160 n = 8;
2161 for (i = 0; i < n; i++) { 2161 for (i = 0; i < n; i++) {
2162 switch (le32_to_cpu(networks_supported.items[i])) { 2162 switch (le32_to_cpu(networks_supported.items[i])) {
2163 case ndis_80211_type_freq_hop: 2163 case NDIS_80211_TYPE_FREQ_HOP:
2164 case ndis_80211_type_direct_seq: 2164 case NDIS_80211_TYPE_DIRECT_SEQ:
2165 priv->caps |= CAP_MODE_80211B; 2165 priv->caps |= CAP_MODE_80211B;
2166 break; 2166 break;
2167 case ndis_80211_type_ofdm_a: 2167 case NDIS_80211_TYPE_OFDM_A:
2168 priv->caps |= CAP_MODE_80211A; 2168 priv->caps |= CAP_MODE_80211A;
2169 break; 2169 break;
2170 case ndis_80211_type_ofdm_g: 2170 case NDIS_80211_TYPE_OFDM_G:
2171 priv->caps |= CAP_MODE_80211G; 2171 priv->caps |= CAP_MODE_80211G;
2172 break; 2172 break;
2173 } 2173 }