[PATCH 08/10] staging: ks7010: move two preprocessor definitions to ks_wlan.h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In ks_wlan_translate_scan function there are two preprocessor
definitions:

    - RSN_INFO_ELEM_ID
    - GENERIC_INFO_ELEM_ID

These can be moved to common ks_wlan.h because they can be used
in get_current_ap function instead of use hardcoded values.
GENERIC_INFO_ELEM_ID has been renamed to WPA_INFO_ELEM_ID which
is more clear.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@xxxxxxxxx>
---
 drivers/staging/ks7010/ks_hostif.c   | 4 ++--
 drivers/staging/ks7010/ks_wlan.h     | 3 +++
 drivers/staging/ks7010/ks_wlan_net.c | 4 +---
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c
index f8bca54..0054c48 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -132,12 +132,12 @@ int get_current_ap(struct ks_wlan_private *priv, struct link_ap_info *ap_info)
 		ap_info->rsn.size : RSN_IE_BODY_MAX;
 	if ((ap_info->rsn_mode & RSN_MODE_WPA2) &&
 	    (priv->wpa.version == IW_AUTH_WPA_VERSION_WPA2)) {
-		ap->rsn_ie.id = 0x30;
+		ap->rsn_ie.id = RSN_INFO_ELEM_ID;
 		ap->rsn_ie.size = size;
 		memcpy(ap->rsn_ie.body, ap_info->rsn.body, size);
 	} else if ((ap_info->rsn_mode & RSN_MODE_WPA) &&
 		   (priv->wpa.version == IW_AUTH_WPA_VERSION_WPA)) {
-		ap->wpa_ie.id = 0xdd;
+		ap->wpa_ie.id = WPA_INFO_ELEM_ID;
 		ap->wpa_ie.size = size;
 		memcpy(ap->wpa_ie.body, ap_info->rsn.body, size);
 	} else {
diff --git a/drivers/staging/ks7010/ks_wlan.h b/drivers/staging/ks7010/ks_wlan.h
index fb080fe..dd42692 100644
--- a/drivers/staging/ks7010/ks_wlan.h
+++ b/drivers/staging/ks7010/ks_wlan.h
@@ -190,6 +190,9 @@ struct rsn_ie {
 	u8 body[RSN_IE_BODY_MAX];
 } __packed;
 
+#define WPA_INFO_ELEM_ID 0xdd
+#define RSN_INFO_ELEM_ID 0x30
+
 #define WPS_IE_BODY_MAX 255
 struct wps_ie {
 	u8 id;	/* 221 'dd <len> 00 50 F2 04' */
diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c
index e964779..838db49 100644
--- a/drivers/staging/ks7010/ks_wlan_net.c
+++ b/drivers/staging/ks7010/ks_wlan_net.c
@@ -1268,14 +1268,12 @@ static inline char *ks_wlan_translate_scan(struct net_device *dev,
 	if ((current_val - current_ev) > IW_EV_LCP_LEN)
 		current_ev = current_val;
 
-#define GENERIC_INFO_ELEM_ID 0xdd
-#define RSN_INFO_ELEM_ID 0x30
 	if (ap->rsn_ie.id == RSN_INFO_ELEM_ID && ap->rsn_ie.size != 0)
 		current_ev = ks_wlan_add_leader_event(rsn_leader, end_buf,
 						      current_ev, &ap->rsn_ie,
 						      &iwe, info);
 
-	if (ap->wpa_ie.id == GENERIC_INFO_ELEM_ID && ap->wpa_ie.size != 0)
+	if (ap->wpa_ie.id == WPA_INFO_ELEM_ID && ap->wpa_ie.size != 0)
 		current_ev = ks_wlan_add_leader_event(wpa_leader, end_buf,
 						      current_ev, &ap->wpa_ie,
 						      &iwe, info);
-- 
2.7.4

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



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux