Commit aa18294a authored by Jussi Kivilinna's avatar Jussi Kivilinna Committed by John W. Linville

rndis_wlan: cleanup: capitalize enum labels

Capitalize enum labels as told in Documents/CodingStyle.
Signed-off-by: default avatarJussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent a60e77e5
...@@ -157,55 +157,55 @@ MODULE_PARM_DESC(workaround_interval, ...@@ -157,55 +157,55 @@ MODULE_PARM_DESC(workaround_interval,
#define NDIS_802_11_LENGTH_RATES_EX 16 #define NDIS_802_11_LENGTH_RATES_EX 16
enum ndis_80211_net_type { enum ndis_80211_net_type {
ndis_80211_type_freq_hop, NDIS_80211_TYPE_FREQ_HOP,
ndis_80211_type_direct_seq, NDIS_80211_TYPE_DIRECT_SEQ,
ndis_80211_type_ofdm_a, NDIS_80211_TYPE_OFDM_A,
ndis_80211_type_ofdm_g NDIS_80211_TYPE_OFDM_G
}; };
enum ndis_80211_net_infra { enum ndis_80211_net_infra {
ndis_80211_infra_adhoc, NDIS_80211_INFRA_ADHOC,
ndis_80211_infra_infra, NDIS_80211_INFRA_INFRA,
ndis_80211_infra_auto_unknown NDIS_80211_INFRA_AUTO_UNKNOWN
}; };
enum ndis_80211_auth_mode { enum ndis_80211_auth_mode {
ndis_80211_auth_open, NDIS_80211_AUTH_OPEN,
ndis_80211_auth_shared, NDIS_80211_AUTH_SHARED,
ndis_80211_auth_auto_switch, NDIS_80211_AUTH_AUTO_SWITCH,
ndis_80211_auth_wpa, NDIS_80211_AUTH_WPA,
ndis_80211_auth_wpa_psk, NDIS_80211_AUTH_WPA_PSK,
ndis_80211_auth_wpa_none, NDIS_80211_AUTH_WPA_NONE,
ndis_80211_auth_wpa2, NDIS_80211_AUTH_WPA2,
ndis_80211_auth_wpa2_psk NDIS_80211_AUTH_WPA2_PSK
}; };
enum ndis_80211_encr_status { enum ndis_80211_encr_status {
ndis_80211_encr_wep_enabled, NDIS_80211_ENCR_WEP_ENABLED,
ndis_80211_encr_disabled, NDIS_80211_ENCR_DISABLED,
ndis_80211_encr_wep_key_absent, NDIS_80211_ENCR_WEP_KEY_ABSENT,
ndis_80211_encr_not_supported, NDIS_80211_ENCR_NOT_SUPPORTED,
ndis_80211_encr_tkip_enabled, NDIS_80211_ENCR_TKIP_ENABLED,
ndis_80211_encr_tkip_key_absent, NDIS_80211_ENCR_TKIP_KEY_ABSENT,
ndis_80211_encr_ccmp_enabled, NDIS_80211_ENCR_CCMP_ENABLED,
ndis_80211_encr_ccmp_key_absent NDIS_80211_ENCR_CCMP_KEY_ABSENT
}; };
enum ndis_80211_priv_filter { enum ndis_80211_priv_filter {
ndis_80211_priv_accept_all, NDIS_80211_PRIV_ACCEPT_ALL,
ndis_80211_priv_8021x_wep NDIS_80211_PRIV_8021X_WEP
}; };
enum ndis_80211_addkey_bits { enum ndis_80211_addkey_bits {
ndis_80211_addkey_8021x_auth = cpu_to_le32(1 << 28), NDIS_80211_ADDKEY_8021X_AUTH = cpu_to_le32(1 << 28),
ndis_80211_addkey_set_init_recv_seq = cpu_to_le32(1 << 29), NDIS_80211_ADDKEY_SET_INIT_RECV_SEQ = cpu_to_le32(1 << 29),
ndis_80211_addkey_pairwise_key = cpu_to_le32(1 << 30), NDIS_80211_ADDKEY_PAIRWISE_KEY = cpu_to_le32(1 << 30),
ndis_80211_addkey_transmit_key = cpu_to_le32(1 << 31), NDIS_80211_ADDKEY_TRANSMIT_KEY = cpu_to_le32(1 << 31)
}; };
enum ndis_80211_addwep_bits { enum ndis_80211_addwep_bits {
ndis_80211_addwep_perclient_key = cpu_to_le32(1 << 30), NDIS_80211_ADDWEP_PERCLIENT_KEY = cpu_to_le32(1 << 30),
ndis_80211_addwep_transmit_key = cpu_to_le32(1 << 31), NDIS_80211_ADDWEP_TRANSMIT_KEY = cpu_to_le32(1 << 31)
}; };
struct ndis_80211_ssid { struct ndis_80211_ssid {
...@@ -835,23 +835,23 @@ static int set_auth_mode(struct usbnet *usbdev, int wpa_version, int authalg) ...@@ -835,23 +835,23 @@ static int set_auth_mode(struct usbnet *usbdev, int wpa_version, int authalg)
if (wpa_version & IW_AUTH_WPA_VERSION_WPA2) { if (wpa_version & IW_AUTH_WPA_VERSION_WPA2) {
if (priv->wpa_keymgmt & IW_AUTH_KEY_MGMT_802_1X) if (priv->wpa_keymgmt & IW_AUTH_KEY_MGMT_802_1X)
auth_mode = ndis_80211_auth_wpa2; auth_mode = NDIS_80211_AUTH_WPA2;
else else
auth_mode = ndis_80211_auth_wpa2_psk; auth_mode = NDIS_80211_AUTH_WPA2_PSK;
} else if (wpa_version & IW_AUTH_WPA_VERSION_WPA) { } else if (wpa_version & IW_AUTH_WPA_VERSION_WPA) {
if (priv->wpa_keymgmt & IW_AUTH_KEY_MGMT_802_1X) if (priv->wpa_keymgmt & IW_AUTH_KEY_MGMT_802_1X)
auth_mode = ndis_80211_auth_wpa; auth_mode = NDIS_80211_AUTH_WPA;
else if (priv->wpa_keymgmt & IW_AUTH_KEY_MGMT_PSK) else if (priv->wpa_keymgmt & IW_AUTH_KEY_MGMT_PSK)
auth_mode = ndis_80211_auth_wpa_psk; auth_mode = NDIS_80211_AUTH_WPA_PSK;
else else
auth_mode = ndis_80211_auth_wpa_none; auth_mode = NDIS_80211_AUTH_WPA_NONE;
} else if (authalg & IW_AUTH_ALG_SHARED_KEY) { } else if (authalg & IW_AUTH_ALG_SHARED_KEY) {
if (authalg & IW_AUTH_ALG_OPEN_SYSTEM) if (authalg & IW_AUTH_ALG_OPEN_SYSTEM)
auth_mode = ndis_80211_auth_auto_switch; auth_mode = NDIS_80211_AUTH_AUTO_SWITCH;
else else
auth_mode = ndis_80211_auth_shared; auth_mode = NDIS_80211_AUTH_SHARED;
} else } else
auth_mode = ndis_80211_auth_open; auth_mode = NDIS_80211_AUTH_OPEN;
tmp = cpu_to_le32(auth_mode); tmp = cpu_to_le32(auth_mode);
ret = rndis_set_oid(usbdev, OID_802_11_AUTHENTICATION_MODE, &tmp, ret = rndis_set_oid(usbdev, OID_802_11_AUTHENTICATION_MODE, &tmp,
...@@ -876,9 +876,9 @@ static int set_priv_filter(struct usbnet *usbdev) ...@@ -876,9 +876,9 @@ static int set_priv_filter(struct usbnet *usbdev)
if (priv->wpa_version & IW_AUTH_WPA_VERSION_WPA2 || if (priv->wpa_version & IW_AUTH_WPA_VERSION_WPA2 ||
priv->wpa_version & IW_AUTH_WPA_VERSION_WPA) priv->wpa_version & IW_AUTH_WPA_VERSION_WPA)
tmp = cpu_to_le32(ndis_80211_priv_8021x_wep); tmp = cpu_to_le32(NDIS_80211_PRIV_8021X_WEP);
else else
tmp = cpu_to_le32(ndis_80211_priv_accept_all); tmp = cpu_to_le32(NDIS_80211_PRIV_ACCEPT_ALL);
return rndis_set_oid(usbdev, OID_802_11_PRIVACY_FILTER, &tmp, return rndis_set_oid(usbdev, OID_802_11_PRIVACY_FILTER, &tmp,
sizeof(tmp)); sizeof(tmp));
...@@ -896,18 +896,18 @@ static int set_encr_mode(struct usbnet *usbdev, int pairwise, int groupwise) ...@@ -896,18 +896,18 @@ static int set_encr_mode(struct usbnet *usbdev, int pairwise, int groupwise)
groupwise); groupwise);
if (pairwise & IW_AUTH_CIPHER_CCMP) if (pairwise & IW_AUTH_CIPHER_CCMP)
encr_mode = ndis_80211_encr_ccmp_enabled; encr_mode = NDIS_80211_ENCR_CCMP_ENABLED;
else if (pairwise & IW_AUTH_CIPHER_TKIP) else if (pairwise & IW_AUTH_CIPHER_TKIP)
encr_mode = ndis_80211_encr_tkip_enabled; encr_mode = NDIS_80211_ENCR_TKIP_ENABLED;
else if (pairwise & else if (pairwise &
(IW_AUTH_CIPHER_WEP40 | IW_AUTH_CIPHER_WEP104)) (IW_AUTH_CIPHER_WEP40 | IW_AUTH_CIPHER_WEP104))
encr_mode = ndis_80211_encr_wep_enabled; encr_mode = NDIS_80211_ENCR_WEP_ENABLED;
else if (groupwise & IW_AUTH_CIPHER_CCMP) else if (groupwise & IW_AUTH_CIPHER_CCMP)
encr_mode = ndis_80211_encr_ccmp_enabled; encr_mode = NDIS_80211_ENCR_CCMP_ENABLED;
else if (groupwise & IW_AUTH_CIPHER_TKIP) else if (groupwise & IW_AUTH_CIPHER_TKIP)
encr_mode = ndis_80211_encr_tkip_enabled; encr_mode = NDIS_80211_ENCR_TKIP_ENABLED;
else else
encr_mode = ndis_80211_encr_disabled; encr_mode = NDIS_80211_ENCR_DISABLED;
tmp = cpu_to_le32(encr_mode); tmp = cpu_to_le32(encr_mode);
ret = rndis_set_oid(usbdev, OID_802_11_ENCRYPTION_STATUS, &tmp, 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,7 +975,7 @@ static void set_default_iw_params(struct usbnet *usbdev)
priv->wpa_keymgmt = 0; priv->wpa_keymgmt = 0;
priv->wpa_version = 0; priv->wpa_version = 0;
set_infra_mode(usbdev, ndis_80211_infra_infra); set_infra_mode(usbdev, NDIS_80211_INFRA_INFRA);
set_auth_mode(usbdev, IW_AUTH_WPA_VERSION_DISABLED, set_auth_mode(usbdev, IW_AUTH_WPA_VERSION_DISABLED,
IW_AUTH_ALG_OPEN_SYSTEM); IW_AUTH_ALG_OPEN_SYSTEM);
set_priv_filter(usbdev); set_priv_filter(usbdev);
...@@ -1011,7 +1011,7 @@ static int add_wep_key(struct usbnet *usbdev, char *key, int key_len, int index) ...@@ -1011,7 +1011,7 @@ static int add_wep_key(struct usbnet *usbdev, char *key, int key_len, int index)
memcpy(&ndis_key.material, key, key_len); memcpy(&ndis_key.material, key, key_len);
if (index == priv->encr_tx_key_index) { if (index == priv->encr_tx_key_index) {
ndis_key.index |= ndis_80211_addwep_transmit_key; ndis_key.index |= NDIS_80211_ADDWEP_TRANSMIT_KEY;
ret = set_encr_mode(usbdev, IW_AUTH_CIPHER_WEP104, ret = set_encr_mode(usbdev, IW_AUTH_CIPHER_WEP104,
IW_AUTH_CIPHER_NONE); IW_AUTH_CIPHER_NONE);
if (ret) if (ret)
...@@ -1047,15 +1047,15 @@ static int add_wpa_key(struct usbnet *usbdev, const u8 *key, int key_len, ...@@ -1047,15 +1047,15 @@ static int add_wpa_key(struct usbnet *usbdev, const u8 *key, int key_len,
return -EINVAL; return -EINVAL;
if (key_len > sizeof(ndis_key.material) || key_len < 0) if (key_len > sizeof(ndis_key.material) || key_len < 0)
return -EINVAL; return -EINVAL;
if ((flags & ndis_80211_addkey_set_init_recv_seq) && !rx_seq) if ((flags & NDIS_80211_ADDKEY_SET_INIT_RECV_SEQ) && !rx_seq)
return -EINVAL; return -EINVAL;
if ((flags & ndis_80211_addkey_pairwise_key) && !addr) if ((flags & NDIS_80211_ADDKEY_PAIRWISE_KEY) && !addr)
return -EINVAL; return -EINVAL;
devdbg(usbdev, "add_wpa_key(%i): flags:%i%i%i", index, devdbg(usbdev, "add_wpa_key(%i): flags:%i%i%i", index,
!!(flags & ndis_80211_addkey_transmit_key), !!(flags & NDIS_80211_ADDKEY_TRANSMIT_KEY),
!!(flags & ndis_80211_addkey_pairwise_key), !!(flags & NDIS_80211_ADDKEY_PAIRWISE_KEY),
!!(flags & ndis_80211_addkey_set_init_recv_seq)); !!(flags & NDIS_80211_ADDKEY_SET_INIT_RECV_SEQ));
memset(&ndis_key, 0, sizeof(ndis_key)); memset(&ndis_key, 0, sizeof(ndis_key));
...@@ -1073,15 +1073,15 @@ static int add_wpa_key(struct usbnet *usbdev, const u8 *key, int key_len, ...@@ -1073,15 +1073,15 @@ static int add_wpa_key(struct usbnet *usbdev, const u8 *key, int key_len,
} else } else
memcpy(ndis_key.material, key, key_len); memcpy(ndis_key.material, key, key_len);
if (flags & ndis_80211_addkey_set_init_recv_seq) if (flags & NDIS_80211_ADDKEY_SET_INIT_RECV_SEQ)
memcpy(ndis_key.rsc, rx_seq, 6); memcpy(ndis_key.rsc, rx_seq, 6);
if (flags & ndis_80211_addkey_pairwise_key) { if (flags & NDIS_80211_ADDKEY_PAIRWISE_KEY) {
/* pairwise key */ /* pairwise key */
memcpy(ndis_key.bssid, addr->sa_data, ETH_ALEN); memcpy(ndis_key.bssid, addr->sa_data, ETH_ALEN);
} else { } else {
/* group key */ /* group key */
if (priv->infra_mode == ndis_80211_infra_adhoc) if (priv->infra_mode == NDIS_80211_INFRA_ADHOC)
memset(ndis_key.bssid, 0xff, ETH_ALEN); memset(ndis_key.bssid, 0xff, ETH_ALEN);
else else
get_bssid(usbdev, ndis_key.bssid); 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,7 +1096,7 @@ static int add_wpa_key(struct usbnet *usbdev, const u8 *key, int key_len,
priv->encr_key_len[index] = key_len; priv->encr_key_len[index] = key_len;
priv->encr_key_wpa[index] = 1; priv->encr_key_wpa[index] = 1;
if (flags & ndis_80211_addkey_transmit_key) if (flags & NDIS_80211_ADDKEY_TRANSMIT_KEY)
priv->encr_tx_key_index = index; priv->encr_tx_key_index = index;
return 0; return 0;
...@@ -1128,7 +1128,7 @@ static int remove_key(struct usbnet *usbdev, int index, u8 bssid[ETH_ALEN]) ...@@ -1128,7 +1128,7 @@ static int remove_key(struct usbnet *usbdev, int index, u8 bssid[ETH_ALEN])
/* pairwise key */ /* pairwise key */
if (memcmp(bssid, ffff_bssid, ETH_ALEN) != 0) if (memcmp(bssid, ffff_bssid, ETH_ALEN) != 0)
remove_key.index |= remove_key.index |=
ndis_80211_addkey_pairwise_key; NDIS_80211_ADDKEY_PAIRWISE_KEY;
memcpy(remove_key.bssid, bssid, memcpy(remove_key.bssid, bssid,
sizeof(remove_key.bssid)); sizeof(remove_key.bssid));
} else } else
...@@ -1238,10 +1238,10 @@ static int rndis_change_virtual_intf(struct wiphy *wiphy, int ifindex, ...@@ -1238,10 +1238,10 @@ static int rndis_change_virtual_intf(struct wiphy *wiphy, int ifindex,
switch (type) { switch (type) {
case NL80211_IFTYPE_ADHOC: case NL80211_IFTYPE_ADHOC:
mode = ndis_80211_infra_adhoc; mode = NDIS_80211_INFRA_ADHOC;
break; break;
case NL80211_IFTYPE_STATION: case NL80211_IFTYPE_STATION:
mode = ndis_80211_infra_infra; mode = NDIS_80211_INFRA_INFRA;
break; break;
default: default:
return -EINVAL; return -EINVAL;
...@@ -1698,11 +1698,11 @@ static int rndis_iw_set_encode_ext(struct net_device *dev, ...@@ -1698,11 +1698,11 @@ static int rndis_iw_set_encode_ext(struct net_device *dev,
flags = 0; flags = 0;
if (ext->ext_flags & IW_ENCODE_EXT_RX_SEQ_VALID) if (ext->ext_flags & IW_ENCODE_EXT_RX_SEQ_VALID)
flags |= ndis_80211_addkey_set_init_recv_seq; flags |= NDIS_80211_ADDKEY_SET_INIT_RECV_SEQ;
if (!(ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY)) if (!(ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY))
flags |= ndis_80211_addkey_pairwise_key; flags |= NDIS_80211_ADDKEY_PAIRWISE_KEY;
if (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) if (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY)
flags |= ndis_80211_addkey_transmit_key; flags |= NDIS_80211_ADDKEY_TRANSMIT_KEY;
return add_wpa_key(usbdev, ext->key, ext->key_len, keyidx, &ext->addr, return add_wpa_key(usbdev, ext->key, ext->key_len, keyidx, &ext->addr,
ext->rx_seq, ext->alg, flags); ext->rx_seq, ext->alg, flags);
...@@ -2160,14 +2160,14 @@ static int rndis_wext_get_caps(struct usbnet *usbdev) ...@@ -2160,14 +2160,14 @@ static int rndis_wext_get_caps(struct usbnet *usbdev)
n = 8; n = 8;
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
switch (le32_to_cpu(networks_supported.items[i])) { switch (le32_to_cpu(networks_supported.items[i])) {
case ndis_80211_type_freq_hop: case NDIS_80211_TYPE_FREQ_HOP:
case ndis_80211_type_direct_seq: case NDIS_80211_TYPE_DIRECT_SEQ:
priv->caps |= CAP_MODE_80211B; priv->caps |= CAP_MODE_80211B;
break; break;
case ndis_80211_type_ofdm_a: case NDIS_80211_TYPE_OFDM_A:
priv->caps |= CAP_MODE_80211A; priv->caps |= CAP_MODE_80211A;
break; break;
case ndis_80211_type_ofdm_g: case NDIS_80211_TYPE_OFDM_G:
priv->caps |= CAP_MODE_80211G; priv->caps |= CAP_MODE_80211G;
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment