diff options
author | Sergio Paracuellos <sergio.paracuellos@gmail.com> | 2018-03-20 18:13:13 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-03-22 18:20:54 +0100 |
commit | 38fc31e73c475733d21a204811be04755deec8a2 (patch) | |
tree | 46824054e3e781aaa17ebaa571e98f01b9b0fae9 /drivers/staging/ks7010 | |
parent | c07040694193f2c1722cff00cc4c55b5ba4318b5 (diff) |
staging: ks7010: replace some custom defines with the ones in uapi/linux/if_ether.h
This commit reviews some custom defines changing them for the
globals defined in if_ether header file.
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/ks7010')
-rw-r--r-- | drivers/staging/ks7010/eap_packet.h | 8 | ||||
-rw-r--r-- | drivers/staging/ks7010/ks_hostif.c | 8 |
2 files changed, 5 insertions, 11 deletions
diff --git a/drivers/staging/ks7010/eap_packet.h b/drivers/staging/ks7010/eap_packet.h index dca2a142e834..1bf1a8c94b0c 100644 --- a/drivers/staging/ks7010/eap_packet.h +++ b/drivers/staging/ks7010/eap_packet.h @@ -3,13 +3,10 @@ #define EAP_PACKET_H #include <linux/compiler.h> +#include <uapi/linux/if_ether.h> #define WBIT(n) (1 << (n)) -#ifndef ETH_ALEN -#define ETH_ALEN 6 -#endif - #define ETHER_HDR_SIZE 20 struct ether_hdr { @@ -20,9 +17,6 @@ struct ether_hdr { unsigned char h_command; unsigned char h_vendor_id[3]; __be16 h_proto; /* packet type ID field */ -#define ETHER_PROTOCOL_TYPE_EAP 0x888e -#define ETHER_PROTOCOL_TYPE_IP 0x0800 -#define ETHER_PROTOCOL_TYPE_ARP 0x0806 /* followed by length octets of data */ } __packed; diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c index ce1ac119a031..3ef9126ab810 100644 --- a/drivers/staging/ks7010/ks_hostif.c +++ b/drivers/staging/ks7010/ks_hostif.c @@ -1152,7 +1152,7 @@ int hostif_data_request(struct ks_wlan_private *priv, struct sk_buff *skb) eth_proto = ntohs(eth_hdr->h_proto); /* for MIC FAILURE REPORT check */ - if (eth_proto == ETHER_PROTOCOL_TYPE_EAP && + if (eth_proto == ETH_P_PAE && priv->wpa.mic_failure.failure > 0) { aa1x_hdr = (struct ieee802_1x_hdr *)(eth_hdr + 1); if (aa1x_hdr->type == IEEE802_1X_TYPE_EAPOL_KEY) { @@ -1162,7 +1162,7 @@ int hostif_data_request(struct ks_wlan_private *priv, struct sk_buff *skb) } if (priv->wpa.rsn_enabled && priv->wpa.key[0].key_len) { - if (eth_proto == ETHER_PROTOCOL_TYPE_EAP && + if (eth_proto == ETH_P_PAE && priv->wpa.key[1].key_len == 0 && priv->wpa.key[2].key_len == 0 && priv->wpa.key[3].key_len == 0) { @@ -1189,7 +1189,7 @@ int hostif_data_request(struct ks_wlan_private *priv, struct sk_buff *skb) } } } else { - if (eth_proto == ETHER_PROTOCOL_TYPE_EAP) + if (eth_proto == ETH_P_PAE) pp->auth_type = cpu_to_le16((uint16_t)TYPE_AUTH); else pp->auth_type = cpu_to_le16((uint16_t)TYPE_DATA); @@ -1206,7 +1206,7 @@ int hostif_data_request(struct ks_wlan_private *priv, struct sk_buff *skb) send_packet_complete, skb); /* MIC FAILURE REPORT check */ - if (eth_proto == ETHER_PROTOCOL_TYPE_EAP && + if (eth_proto == ETH_P_PAE && priv->wpa.mic_failure.failure > 0) { if (keyinfo & WPA_KEY_INFO_ERROR && keyinfo & WPA_KEY_INFO_REQUEST) { |