All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] staging: ks7010: Reviews some custom stuff in favour of kernel definitions
@ 2018-03-20 17:13 Sergio Paracuellos
  2018-03-20 17:13 ` [PATCH 1/3] staging: ks7010: remove not used function signature ks_wlan_read_config_file Sergio Paracuellos
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Sergio Paracuellos @ 2018-03-20 17:13 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, wsa

This patch series removes some custom definitions included in the driver
replacing them with the ones used in the linux kernel global headers. Not
used function signature is removed also.

Sergio Paracuellos (3):
  staging: ks7010: remove not used function signature
    ks_wlan_read_config_file
  staging: ks7010: replace some custom defines with the ones in
    uapi/linux/if_ether.h
  staging: ks7010: review custom bit defines using macros from bitops
    header file

 drivers/staging/ks7010/eap_packet.h    | 41 ++++++++++++++--------------------
 drivers/staging/ks7010/ks_hostif.c     |  8 +++----
 drivers/staging/ks7010/ks_wlan_ioctl.h |  1 -
 3 files changed, 21 insertions(+), 29 deletions(-)

-- 
2.7.4

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/3] staging: ks7010: remove not used function signature ks_wlan_read_config_file
  2018-03-20 17:13 [PATCH 0/3] staging: ks7010: Reviews some custom stuff in favour of kernel definitions Sergio Paracuellos
@ 2018-03-20 17:13 ` Sergio Paracuellos
  2018-03-20 17:13 ` [PATCH 2/3] staging: ks7010: replace some custom defines with the ones in uapi/linux/if_ether.h Sergio Paracuellos
  2018-03-20 17:13 ` [PATCH 3/3] staging: ks7010: review custom bit defines using macros from bitops header file Sergio Paracuellos
  2 siblings, 0 replies; 4+ messages in thread
From: Sergio Paracuellos @ 2018-03-20 17:13 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, wsa

This commit removes definition of function ks_wlan_read_config_file
which is not being used at all.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/ks7010/ks_wlan_ioctl.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/ks7010/ks_wlan_ioctl.h b/drivers/staging/ks7010/ks_wlan_ioctl.h
index 28b381c..121e7cb 100644
--- a/drivers/staging/ks7010/ks_wlan_ioctl.h
+++ b/drivers/staging/ks7010/ks_wlan_ioctl.h
@@ -58,7 +58,6 @@
 #include "ks_wlan.h"
 #include <linux/netdevice.h>
 
-int ks_wlan_read_config_file(struct ks_wlan_private *priv);
 int ks_wlan_setup_parameter(struct ks_wlan_private *priv,
 			    unsigned int commit_flag);
 
-- 
2.7.4

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] staging: ks7010: replace some custom defines with the ones in uapi/linux/if_ether.h
  2018-03-20 17:13 [PATCH 0/3] staging: ks7010: Reviews some custom stuff in favour of kernel definitions Sergio Paracuellos
  2018-03-20 17:13 ` [PATCH 1/3] staging: ks7010: remove not used function signature ks_wlan_read_config_file Sergio Paracuellos
@ 2018-03-20 17:13 ` Sergio Paracuellos
  2018-03-20 17:13 ` [PATCH 3/3] staging: ks7010: review custom bit defines using macros from bitops header file Sergio Paracuellos
  2 siblings, 0 replies; 4+ messages in thread
From: Sergio Paracuellos @ 2018-03-20 17:13 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, wsa

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>
---
 drivers/staging/ks7010/eap_packet.h | 8 +-------
 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 dca2a14..1bf1a8c 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 ce1ac11..3ef9126 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) {
-- 
2.7.4

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] staging: ks7010: review custom bit defines using macros from bitops header file
  2018-03-20 17:13 [PATCH 0/3] staging: ks7010: Reviews some custom stuff in favour of kernel definitions Sergio Paracuellos
  2018-03-20 17:13 ` [PATCH 1/3] staging: ks7010: remove not used function signature ks_wlan_read_config_file Sergio Paracuellos
  2018-03-20 17:13 ` [PATCH 2/3] staging: ks7010: replace some custom defines with the ones in uapi/linux/if_ether.h Sergio Paracuellos
@ 2018-03-20 17:13 ` Sergio Paracuellos
  2 siblings, 0 replies; 4+ messages in thread
From: Sergio Paracuellos @ 2018-03-20 17:13 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, wsa

This commit reviews custom definitions using custom bit macros changing
them for the ones defined in the bitops header file.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/ks7010/eap_packet.h | 33 ++++++++++++++++-----------------
 1 file changed, 16 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/ks7010/eap_packet.h b/drivers/staging/ks7010/eap_packet.h
index 1bf1a8c..58c2a3d 100644
--- a/drivers/staging/ks7010/eap_packet.h
+++ b/drivers/staging/ks7010/eap_packet.h
@@ -3,10 +3,9 @@
 #define EAP_PACKET_H
 
 #include <linux/compiler.h>
+#include <linux/bitops.h>
 #include <uapi/linux/if_ether.h>
 
-#define WBIT(n) (1 << (n))
-
 #define ETHER_HDR_SIZE 20
 
 struct ether_hdr {
@@ -98,23 +97,23 @@ struct wpa_eapol_key {
 	/* followed by key_data_length bytes of key_data */
 } __packed;
 
-#define WPA_KEY_INFO_TYPE_MASK (WBIT(0) | WBIT(1) | WBIT(2))
-#define WPA_KEY_INFO_TYPE_HMAC_MD5_RC4 WBIT(0)
-#define WPA_KEY_INFO_TYPE_HMAC_SHA1_AES WBIT(1)
-#define WPA_KEY_INFO_KEY_TYPE WBIT(3)	/* 1 = Pairwise, 0 = Group key */
+#define WPA_KEY_INFO_TYPE_MASK GENMASK(2, 0)
+#define WPA_KEY_INFO_TYPE_HMAC_MD5_RC4 BIT(0)
+#define WPA_KEY_INFO_TYPE_HMAC_SHA1_AES BIT(1)
+#define WPA_KEY_INFO_KEY_TYPE BIT(3)	/* 1 = Pairwise, 0 = Group key */
 /* bit4..5 is used in WPA, but is reserved in IEEE 802.11i/RSN */
-#define WPA_KEY_INFO_KEY_INDEX_MASK (WBIT(4) | WBIT(5))
+#define WPA_KEY_INFO_KEY_INDEX_MASK GENMASK(5, 4)
 #define WPA_KEY_INFO_KEY_INDEX_SHIFT 4
-#define WPA_KEY_INFO_INSTALL WBIT(6)	/* pairwise */
-#define WPA_KEY_INFO_TXRX WBIT(6)	/* group */
-#define WPA_KEY_INFO_ACK WBIT(7)
-#define WPA_KEY_INFO_MIC WBIT(8)
-#define WPA_KEY_INFO_SECURE WBIT(9)
-#define WPA_KEY_INFO_ERROR WBIT(10)
-#define WPA_KEY_INFO_REQUEST WBIT(11)
-#define WPA_KEY_INFO_ENCR_KEY_DATA WBIT(12)	/* IEEE 802.11i/RSN only */
-
-#define WPA_CAPABILITY_PREAUTH WBIT(0)
+#define WPA_KEY_INFO_INSTALL BIT(6)	/* pairwise */
+#define WPA_KEY_INFO_TXRX BIT(6)	/* group */
+#define WPA_KEY_INFO_ACK BIT(7)
+#define WPA_KEY_INFO_MIC BIT(8)
+#define WPA_KEY_INFO_SECURE BIT(9)
+#define WPA_KEY_INFO_ERROR BIT(10)
+#define WPA_KEY_INFO_REQUEST BIT(11)
+#define WPA_KEY_INFO_ENCR_KEY_DATA BIT(12)	/* IEEE 802.11i/RSN only */
+
+#define WPA_CAPABILITY_PREAUTH BIT(0)
 
 #define GENERIC_INFO_ELEM 0xdd
 #define RSN_INFO_ELEM 0x30
-- 
2.7.4

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-03-20 17:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-20 17:13 [PATCH 0/3] staging: ks7010: Reviews some custom stuff in favour of kernel definitions Sergio Paracuellos
2018-03-20 17:13 ` [PATCH 1/3] staging: ks7010: remove not used function signature ks_wlan_read_config_file Sergio Paracuellos
2018-03-20 17:13 ` [PATCH 2/3] staging: ks7010: replace some custom defines with the ones in uapi/linux/if_ether.h Sergio Paracuellos
2018-03-20 17:13 ` [PATCH 3/3] staging: ks7010: review custom bit defines using macros from bitops header file Sergio Paracuellos

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.