All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/24] staging: ks7010: remaining cleanups from previous series
@ 2018-04-23 13:44 Sergio Paracuellos
  2018-04-23 13:44 ` [PATCH 01/24] staging: ks7010: avoid casts in michael_mic_function calls Sergio Paracuellos
                   ` (23 more replies)
  0 siblings, 24 replies; 25+ messages in thread
From: Sergio Paracuellos @ 2018-04-23 13:44 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, wsa

This patch series contains those patches which wasn't be applied 
from previous series. Just rebase and resend them to be applied.

Sergio Paracuellos (24):
  staging: ks7010: avoid casts in michael_mic_function calls
  staging: ks7010: move ROM_FILE definition into source file
  staging: ks7010: move sdio specific register definitions into source
    file
  staging: ks7010: delete not used definitions in ks7010_sdio source
  staging: ks7010: add REG suffix to sdio register definitions
  staging: ks7010: review comment style in ks7010_sdio source file
  staging: ks7010: review debug and error messages in ks7010_sdio source
  staging: ks7010: avoid one extra level indentation in ks_wlan_hw_rx
    function
  staging: ks7010: move MODULE_DEVICE_TABLE related code
  staging: ks7010: replace create_workqueue with alloc_workqueue
  staging: ks7010: check sdio_set_block_size return value
  staging: ks7010: fix error paths in ks7010_sdio_remove function
  staging: ks7010: use u8 instead of unsigned char for firmware buffers
  staging: ks7010: assign dev_alloc_name() result to variable before
    check it
  staging: ks7010: change name and type for device_open_status field
  staging: ks7010: avoid one level indentation in devio_rec_ind function
  staging: ks7010: remove superfluous comments in ks_hostif source file
  staging: ks7010: fix warning aout long line in init_request
  staging: ks7010: avoid blank line between definitions in
    hostif_data_request
  staging: ks7010: remove two fields of ks_wlan_private struct
  staging: ks7010: removes data_buff field of ks_wlan_private struct
  staging: ks7010: review includes of ks_hostif file
  staging: ks7010: use IW_HANDLER macro in ks_wlan_handler
  staging: ks7010: remove KSC_OPNOTSUPP related code

 drivers/staging/ks7010/ks7010_sdio.c | 236 +++++++++++------
 drivers/staging/ks7010/ks7010_sdio.h |  71 -----
 drivers/staging/ks7010/ks_hostif.c   |  96 +++----
 drivers/staging/ks7010/ks_wlan.h     |   7 +-
 drivers/staging/ks7010/ks_wlan_net.c | 484 ++++++++++++++---------------------
 drivers/staging/ks7010/michael_mic.c |   2 +-
 drivers/staging/ks7010/michael_mic.h |   2 +-
 7 files changed, 383 insertions(+), 515 deletions(-)

-- 
2.7.4

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

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

* [PATCH 01/24] staging: ks7010: avoid casts in michael_mic_function calls
  2018-04-23 13:44 [PATCH 00/24] staging: ks7010: remaining cleanups from previous series Sergio Paracuellos
@ 2018-04-23 13:44 ` Sergio Paracuellos
  2018-04-23 13:44 ` [PATCH 02/24] staging: ks7010: move ROM_FILE definition into source file Sergio Paracuellos
                   ` (22 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Sergio Paracuellos @ 2018-04-23 13:44 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, wsa

This commit removes casts in calls to michael_mic_function.
Most of them are nosense because types match perfectly function
parameters. To avoid also int casting for len parameter just
pass unsigned len to function which makes sense because is only
being called with unsigned int len parameters.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/ks7010/ks_hostif.c   | 17 ++++++-----------
 drivers/staging/ks7010/michael_mic.c |  2 +-
 drivers/staging/ks7010/michael_mic.h |  2 +-
 3 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c
index e5657dc..d11b0a2 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -337,12 +337,9 @@ int hostif_data_indication_wpa(struct ks_wlan_private *priv,
 		memcpy(&recv_mic[0], (priv->rxp) + ((priv->rx_size) - 8), 8);
 		priv->rx_size = priv->rx_size - 8;
 		if (auth_type > 0 && auth_type < 4) {	/* auth_type check */
-			michael_mic_function(&michael_mic,
-					     (uint8_t *)key->rx_mic_key,
-					     (uint8_t *)priv->rxp,
-					     (int)priv->rx_size,
-					     (uint8_t)0,	/* priority */
-					     (uint8_t *)michael_mic.result);
+			michael_mic_function(&michael_mic, key->rx_mic_key,
+					     priv->rxp, priv->rx_size,
+					     0,	michael_mic.result);
 		}
 		if (memcmp(michael_mic.result, recv_mic, 8) != 0) {
 			now = jiffies;
@@ -1164,11 +1161,9 @@ int hostif_data_request(struct ks_wlan_private *priv, struct sk_buff *skb)
 		} else {
 			if (priv->wpa.pairwise_suite == IW_AUTH_CIPHER_TKIP) {
 				michael_mic_function(&michael_mic,
-						     (uint8_t *)priv->wpa.key[0].tx_mic_key,
-						     (uint8_t *)&pp->data[0],
-						     (int)skb_len,
-						     (uint8_t)0,	/* priority */
-						     (uint8_t *)michael_mic.result);
+						     priv->wpa.key[0].tx_mic_key,
+						     &pp->data[0], skb_len,
+						     0,	michael_mic.result);
 				memcpy(p, michael_mic.result, 8);
 				length += 8;
 				skb_len += 8;
diff --git a/drivers/staging/ks7010/michael_mic.c b/drivers/staging/ks7010/michael_mic.c
index 6bc1b09..2128c84 100644
--- a/drivers/staging/ks7010/michael_mic.c
+++ b/drivers/staging/ks7010/michael_mic.c
@@ -110,7 +110,7 @@ static void michael_get_mic(struct michael_mic *mic, u8 *dst)
 }
 
 void michael_mic_function(struct michael_mic *mic, u8 *key,
-			  u8 *data, int len, u8 priority, u8 *result)
+			  u8 *data, unsigned int len, u8 priority, u8 *result)
 {
 	u8 pad_data[4] = { priority, 0, 0, 0 };
 	// Compute the MIC value
diff --git a/drivers/staging/ks7010/michael_mic.h b/drivers/staging/ks7010/michael_mic.h
index d335080..eb22fdd 100644
--- a/drivers/staging/ks7010/michael_mic.h
+++ b/drivers/staging/ks7010/michael_mic.h
@@ -21,4 +21,4 @@ struct michael_mic {
 };
 
 void michael_mic_function(struct michael_mic *mic, u8 *key,
-			  u8 *data, int len, u8 priority, u8 *result);
+			  u8 *data, unsigned int len, u8 priority, u8 *result);
-- 
2.7.4

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

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

* [PATCH 02/24] staging: ks7010: move ROM_FILE definition into source file
  2018-04-23 13:44 [PATCH 00/24] staging: ks7010: remaining cleanups from previous series Sergio Paracuellos
  2018-04-23 13:44 ` [PATCH 01/24] staging: ks7010: avoid casts in michael_mic_function calls Sergio Paracuellos
@ 2018-04-23 13:44 ` Sergio Paracuellos
  2018-04-23 13:44 ` [PATCH 03/24] staging: ks7010: move sdio specific register definitions " Sergio Paracuellos
                   ` (21 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Sergio Paracuellos @ 2018-04-23 13:44 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, wsa

This commit moves ROM_FILE from header to source file because
there is not being used outside this.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/ks7010/ks7010_sdio.c | 1 +
 drivers/staging/ks7010/ks7010_sdio.h | 2 --
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
index c1bd7de..d340124 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -22,6 +22,7 @@
 #include "ks_hostif.h"
 #include "ks7010_sdio.h"
 
+#define ROM_FILE "ks7010sd.rom"
 #define KS7010_FUNC_NUM 1
 #define KS7010_IO_BLOCK_SIZE 512
 #define KS7010_MAX_CLOCK 25000000
diff --git a/drivers/staging/ks7010/ks7010_sdio.h b/drivers/staging/ks7010/ks7010_sdio.h
index 3f65845..1bcdbe3 100644
--- a/drivers/staging/ks7010/ks7010_sdio.h
+++ b/drivers/staging/ks7010/ks7010_sdio.h
@@ -154,6 +154,4 @@ struct rx_device {
 	spinlock_t rx_dev_lock;	/* protect access to the queue */
 };
 
-#define	ROM_FILE "ks7010sd.rom"
-
 #endif /* _KS7010_SDIO_H */
-- 
2.7.4

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

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

* [PATCH 03/24] staging: ks7010: move sdio specific register definitions into source file
  2018-04-23 13:44 [PATCH 00/24] staging: ks7010: remaining cleanups from previous series Sergio Paracuellos
  2018-04-23 13:44 ` [PATCH 01/24] staging: ks7010: avoid casts in michael_mic_function calls Sergio Paracuellos
  2018-04-23 13:44 ` [PATCH 02/24] staging: ks7010: move ROM_FILE definition into source file Sergio Paracuellos
@ 2018-04-23 13:44 ` Sergio Paracuellos
  2018-04-23 13:44 ` [PATCH 04/24] staging: ks7010: delete not used definitions in ks7010_sdio source Sergio Paracuellos
                   ` (20 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Sergio Paracuellos @ 2018-04-23 13:44 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, wsa

This commit moves SDIO related register definitions from header
to source file. There is no need to have those into the header
because they are only being used in specific SDIO code.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/ks7010/ks7010_sdio.c | 72 ++++++++++++++++++++++++++++++++++++
 drivers/staging/ks7010/ks7010_sdio.h | 69 ----------------------------------
 2 files changed, 72 insertions(+), 69 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
index d340124..2029b491 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -23,6 +23,78 @@
 #include "ks7010_sdio.h"
 
 #define ROM_FILE "ks7010sd.rom"
+
+/*  SDIO KeyStream vendor and device */
+#define SDIO_VENDOR_ID_KS_CODE_A	0x005b
+#define SDIO_VENDOR_ID_KS_CODE_B	0x0023
+
+/* Older sources suggest earlier versions were named 7910 or 79xx */
+#define SDIO_DEVICE_ID_KS_7010		0x7910
+
+/* Read/Write Status Register */
+#define READ_STATUS		0x000000
+#define WRITE_STATUS		0x00000C
+enum reg_status_type {
+	REG_STATUS_BUSY,
+	REG_STATUS_IDLE
+};
+
+/* Read Index Register */
+#define READ_INDEX		0x000004
+
+/* Read Data Size Register */
+#define READ_DATA_SIZE		0x000008
+
+/* Write Index Register */
+#define WRITE_INDEX		0x000010
+
+/* Write Status/Read Data Size Register
+ * for network packet (less than 2048 bytes data)
+ */
+#define WSTATUS_RSIZE		0x000014
+#define WSTATUS_MASK		0x80	/* Write Status Register value */
+#define RSIZE_MASK		0x7F	/* Read Data Size Register value [10:4] */
+
+/* ARM to SD interrupt Enable */
+#define INT_ENABLE		0x000020
+/* ARM to SD interrupt Pending */
+#define INT_PENDING		0x000024
+
+#define INT_GCR_B              BIT(7)
+#define INT_GCR_A              BIT(6)
+#define INT_WRITE_STATUS       BIT(5)
+#define INT_WRITE_INDEX        BIT(4)
+#define INT_WRITE_SIZE         BIT(3)
+#define INT_READ_STATUS        BIT(2)
+#define INT_READ_INDEX         BIT(1)
+#define INT_READ_SIZE          BIT(0)
+
+/* General Communication Register A */
+#define GCR_A			0x000028
+enum gen_com_reg_a {
+	GCR_A_INIT,
+	GCR_A_REMAP,
+	GCR_A_RUN
+};
+
+/* General Communication Register B */
+#define GCR_B			0x00002C
+enum gen_com_reg_b {
+	GCR_B_ACTIVE,
+	GCR_B_DOZE
+};
+
+/* Wakeup Register */
+#define WAKEUP			0x008018
+#define WAKEUP_REQ		0x5a
+
+/* AHB Data Window  0x010000-0x01FFFF */
+#define DATA_WINDOW		0x010000
+#define WINDOW_SIZE		(64 * 1024)
+
+#define KS7010_IRAM_ADDRESS	0x06000000
+
+
 #define KS7010_FUNC_NUM 1
 #define KS7010_IO_BLOCK_SIZE 512
 #define KS7010_MAX_CLOCK 25000000
diff --git a/drivers/staging/ks7010/ks7010_sdio.h b/drivers/staging/ks7010/ks7010_sdio.h
index 1bcdbe3..95ac86b 100644
--- a/drivers/staging/ks7010/ks7010_sdio.h
+++ b/drivers/staging/ks7010/ks7010_sdio.h
@@ -11,75 +11,6 @@
 #ifndef _KS7010_SDIO_H
 #define _KS7010_SDIO_H
 
-/*  SDIO KeyStream vendor and device */
-#define SDIO_VENDOR_ID_KS_CODE_A	0x005b
-#define SDIO_VENDOR_ID_KS_CODE_B	0x0023
-/* Older sources suggest earlier versions were named 7910 or 79xx */
-#define SDIO_DEVICE_ID_KS_7010		0x7910
-
-/* Read/Write Status Register */
-#define READ_STATUS		0x000000
-#define WRITE_STATUS		0x00000C
-enum reg_status_type {
-	REG_STATUS_BUSY,
-	REG_STATUS_IDLE
-};
-
-/* Read Index Register */
-#define READ_INDEX		0x000004
-
-/* Read Data Size Register */
-#define READ_DATA_SIZE		0x000008
-
-/* Write Index Register */
-#define WRITE_INDEX		0x000010
-
-/* Write Status/Read Data Size Register
- * for network packet (less than 2048 bytes data)
- */
-#define WSTATUS_RSIZE		0x000014
-#define WSTATUS_MASK		0x80	/* Write Status Register value */
-#define RSIZE_MASK		0x7F	/* Read Data Size Register value [10:4] */
-
-/* ARM to SD interrupt Enable */
-#define INT_ENABLE		0x000020
-/* ARM to SD interrupt Pending */
-#define INT_PENDING		0x000024
-
-#define INT_GCR_B              BIT(7)
-#define INT_GCR_A              BIT(6)
-#define INT_WRITE_STATUS       BIT(5)
-#define INT_WRITE_INDEX        BIT(4)
-#define INT_WRITE_SIZE         BIT(3)
-#define INT_READ_STATUS        BIT(2)
-#define INT_READ_INDEX         BIT(1)
-#define INT_READ_SIZE          BIT(0)
-
-/* General Communication Register A */
-#define GCR_A			0x000028
-enum gen_com_reg_a {
-	GCR_A_INIT,
-	GCR_A_REMAP,
-	GCR_A_RUN
-};
-
-/* General Communication Register B */
-#define GCR_B			0x00002C
-enum gen_com_reg_b {
-	GCR_B_ACTIVE,
-	GCR_B_DOZE
-};
-
-/* Wakeup Register */
-#define WAKEUP			0x008018
-#define WAKEUP_REQ		0x5a
-
-/* AHB Data Window  0x010000-0x01FFFF */
-#define DATA_WINDOW		0x010000
-#define WINDOW_SIZE		(64 * 1024)
-
-#define KS7010_IRAM_ADDRESS	0x06000000
-
 /**
  * struct ks_sdio_card - SDIO device data.
  *
-- 
2.7.4

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

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

* [PATCH 04/24] staging: ks7010: delete not used definitions in ks7010_sdio source
  2018-04-23 13:44 [PATCH 00/24] staging: ks7010: remaining cleanups from previous series Sergio Paracuellos
                   ` (2 preceding siblings ...)
  2018-04-23 13:44 ` [PATCH 03/24] staging: ks7010: move sdio specific register definitions " Sergio Paracuellos
@ 2018-04-23 13:44 ` Sergio Paracuellos
  2018-04-23 13:44 ` [PATCH 05/24] staging: ks7010: add REG suffix to sdio register definitions Sergio Paracuellos
                   ` (19 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Sergio Paracuellos @ 2018-04-23 13:44 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, wsa

This commit removes two definitions inside ks7010_sdio source file
because they are not being used at all.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/ks7010/ks7010_sdio.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
index 2029b491..817268a 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -94,10 +94,7 @@ enum gen_com_reg_b {
 
 #define KS7010_IRAM_ADDRESS	0x06000000
 
-
-#define KS7010_FUNC_NUM 1
 #define KS7010_IO_BLOCK_SIZE 512
-#define KS7010_MAX_CLOCK 25000000
 
 static const struct sdio_device_id ks7010_sdio_ids[] = {
 	{SDIO_DEVICE(SDIO_VENDOR_ID_KS_CODE_A, SDIO_DEVICE_ID_KS_7010)},
-- 
2.7.4

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

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

* [PATCH 05/24] staging: ks7010: add REG suffix to sdio register definitions
  2018-04-23 13:44 [PATCH 00/24] staging: ks7010: remaining cleanups from previous series Sergio Paracuellos
                   ` (3 preceding siblings ...)
  2018-04-23 13:44 ` [PATCH 04/24] staging: ks7010: delete not used definitions in ks7010_sdio source Sergio Paracuellos
@ 2018-04-23 13:44 ` Sergio Paracuellos
  2018-04-23 13:44 ` [PATCH 06/24] staging: ks7010: review comment style in ks7010_sdio source file Sergio Paracuellos
                   ` (18 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Sergio Paracuellos @ 2018-04-23 13:44 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, wsa

This commit adds REG suffix to register definitions related
with SDIO in order to improve readability.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/ks7010/ks7010_sdio.c | 96 ++++++++++++++++++------------------
 1 file changed, 48 insertions(+), 48 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
index 817268a..cf9f347 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -32,33 +32,33 @@
 #define SDIO_DEVICE_ID_KS_7010		0x7910
 
 /* Read/Write Status Register */
-#define READ_STATUS		0x000000
-#define WRITE_STATUS		0x00000C
+#define READ_STATUS_REG		0x000000
+#define WRITE_STATUS_REG	0x00000C
 enum reg_status_type {
 	REG_STATUS_BUSY,
 	REG_STATUS_IDLE
 };
 
 /* Read Index Register */
-#define READ_INDEX		0x000004
+#define READ_INDEX_REG		0x000004
 
 /* Read Data Size Register */
-#define READ_DATA_SIZE		0x000008
+#define READ_DATA_SIZE_REG	0x000008
 
 /* Write Index Register */
-#define WRITE_INDEX		0x000010
+#define WRITE_INDEX_REG		0x000010
 
 /* Write Status/Read Data Size Register
  * for network packet (less than 2048 bytes data)
  */
-#define WSTATUS_RSIZE		0x000014
+#define WSTATUS_RSIZE_REG	0x000014
 #define WSTATUS_MASK		0x80	/* Write Status Register value */
 #define RSIZE_MASK		0x7F	/* Read Data Size Register value [10:4] */
 
 /* ARM to SD interrupt Enable */
-#define INT_ENABLE		0x000020
+#define INT_ENABLE_REG		0x000020
 /* ARM to SD interrupt Pending */
-#define INT_PENDING		0x000024
+#define INT_PENDING_REG		0x000024
 
 #define INT_GCR_B              BIT(7)
 #define INT_GCR_A              BIT(6)
@@ -70,7 +70,7 @@ enum reg_status_type {
 #define INT_READ_SIZE          BIT(0)
 
 /* General Communication Register A */
-#define GCR_A			0x000028
+#define GCR_A_REG		0x000028
 enum gen_com_reg_a {
 	GCR_A_INIT,
 	GCR_A_REMAP,
@@ -78,14 +78,14 @@ enum gen_com_reg_a {
 };
 
 /* General Communication Register B */
-#define GCR_B			0x00002C
+#define GCR_B_REG		0x00002C
 enum gen_com_reg_b {
 	GCR_B_ACTIVE,
 	GCR_B_DOZE
 };
 
 /* Wakeup Register */
-#define WAKEUP			0x008018
+#define WAKEUP_REG		0x008018
 #define WAKEUP_REQ		0x5a
 
 /* AHB Data Window  0x010000-0x01FFFF */
@@ -197,9 +197,9 @@ static void ks_wlan_hw_sleep_doze_request(struct ks_wlan_private *priv)
 	atomic_set(&priv->sleepstatus.doze_request, 0);
 
 	if (atomic_read(&priv->sleepstatus.status) == 0) {
-		ret = ks7010_sdio_writeb(priv, GCR_B, GCR_B_DOZE);
+		ret = ks7010_sdio_writeb(priv, GCR_B_REG, GCR_B_DOZE);
 		if (ret) {
-			netdev_err(priv->net_dev, " error : GCR_B\n");
+			netdev_err(priv->net_dev, " error : GCR_B_REG\n");
 			goto set_sleep_mode;
 		}
 		atomic_set(&priv->sleepstatus.status, 1);
@@ -218,9 +218,9 @@ static void ks_wlan_hw_sleep_wakeup_request(struct ks_wlan_private *priv)
 	atomic_set(&priv->sleepstatus.wakeup_request, 0);
 
 	if (atomic_read(&priv->sleepstatus.status) == 1) {
-		ret = ks7010_sdio_writeb(priv, WAKEUP, WAKEUP_REQ);
+		ret = ks7010_sdio_writeb(priv, WAKEUP_REG, WAKEUP_REQ);
 		if (ret) {
-			netdev_err(priv->net_dev, " error : WAKEUP\n");
+			netdev_err(priv->net_dev, " error : WAKEUP_REG\n");
 			goto set_sleep_mode;
 		}
 		atomic_set(&priv->sleepstatus.status, 0);
@@ -237,9 +237,9 @@ void ks_wlan_hw_wakeup_request(struct ks_wlan_private *priv)
 	int ret;
 
 	if (atomic_read(&priv->psstatus.status) == PS_SNOOZE) {
-		ret = ks7010_sdio_writeb(priv, WAKEUP, WAKEUP_REQ);
+		ret = ks7010_sdio_writeb(priv, WAKEUP_REG, WAKEUP_REQ);
 		if (ret)
-			netdev_err(priv->net_dev, " error : WAKEUP\n");
+			netdev_err(priv->net_dev, " error : WAKEUP_REG\n");
 
 		priv->last_wakeup = jiffies;
 		++priv->wakeup_count;
@@ -279,17 +279,17 @@ static void _ks_wlan_hw_power_save(struct ks_wlan_private *priv)
 		return;
 	}
 
-	ret = ks7010_sdio_readb(priv, INT_PENDING, &byte);
+	ret = ks7010_sdio_readb(priv, INT_PENDING_REG, &byte);
 	if (ret) {
-		netdev_err(priv->net_dev, " error : INT_PENDING\n");
+		netdev_err(priv->net_dev, " error : INT_PENDING_REG\n");
 		goto queue_delayed_work;
 	}
 	if (byte)
 		goto queue_delayed_work;
 
-	ret = ks7010_sdio_writeb(priv, GCR_B, GCR_B_DOZE);
+	ret = ks7010_sdio_writeb(priv, GCR_B_REG, GCR_B_DOZE);
 	if (ret) {
-		netdev_err(priv->net_dev, " error : GCR_B\n");
+		netdev_err(priv->net_dev, " error : GCR_B_REG\n");
 		goto queue_delayed_work;
 	}
 	atomic_set(&priv->psstatus.status, PS_SNOOZE);
@@ -364,9 +364,9 @@ static int write_to_device(struct ks_wlan_private *priv, unsigned char *buffer,
 		return ret;
 	}
 
-	ret = ks7010_sdio_writeb(priv, WRITE_STATUS, REG_STATUS_BUSY);
+	ret = ks7010_sdio_writeb(priv, WRITE_STATUS_REG, REG_STATUS_BUSY);
 	if (ret) {
-		netdev_err(priv->net_dev, " error : WRITE_STATUS\n");
+		netdev_err(priv->net_dev, " error : WRITE_STATUS_REG\n");
 		return ret;
 	}
 
@@ -472,9 +472,9 @@ static void ks_wlan_hw_rx(struct ks_wlan_private *priv, uint16_t size)
 				     DUMP_PREFIX_OFFSET,
 				     rx_buffer->data, 32);
 #endif
-		ret = ks7010_sdio_writeb(priv, READ_STATUS, REG_STATUS_IDLE);
+		ret = ks7010_sdio_writeb(priv, READ_STATUS_REG, REG_STATUS_IDLE);
 		if (ret)
-			netdev_err(priv->net_dev, " error : READ_STATUS\n");
+			netdev_err(priv->net_dev, " error : READ_STATUS_REG\n");
 
 		/* length check fail */
 		return;
@@ -485,9 +485,9 @@ static void ks_wlan_hw_rx(struct ks_wlan_private *priv, uint16_t size)
 	event = le16_to_cpu(hdr->event);
 	inc_rxqtail(priv);
 
-	ret = ks7010_sdio_writeb(priv, READ_STATUS, REG_STATUS_IDLE);
+	ret = ks7010_sdio_writeb(priv, READ_STATUS_REG, REG_STATUS_IDLE);
 	if (ret)
-		netdev_err(priv->net_dev, " error : READ_STATUS\n");
+		netdev_err(priv->net_dev, " error : READ_STATUS_REG\n");
 
 	if (atomic_read(&priv->psstatus.confirm_wait)) {
 		if (is_hif_conf(event)) {
@@ -546,9 +546,9 @@ static void ks7010_rw_function(struct work_struct *work)
 	}
 
 	/* read (WriteStatus/ReadDataSize FN1:00_0014) */
-	ret = ks7010_sdio_readb(priv, WSTATUS_RSIZE, &byte);
+	ret = ks7010_sdio_readb(priv, WSTATUS_RSIZE_REG, &byte);
 	if (ret) {
-		netdev_err(priv->net_dev, " error : WSTATUS_RSIZE psstatus=%d\n",
+		netdev_err(priv->net_dev, " error : WSTATUS_RSIZE_REG psstatus=%d\n",
 			   atomic_read(&priv->psstatus.status));
 		goto release_host;
 	}
@@ -578,9 +578,9 @@ static void ks_sdio_interrupt(struct sdio_func *func)
 	if (priv->dev_state < DEVICE_STATE_BOOT)
 		goto queue_delayed_work;
 
-	ret = ks7010_sdio_readb(priv, INT_PENDING, &status);
+	ret = ks7010_sdio_readb(priv, INT_PENDING_REG, &status);
 	if (ret) {
-		netdev_err(priv->net_dev, "error : INT_PENDING\n");
+		netdev_err(priv->net_dev, "error : INT_PENDING_REG\n");
 		goto queue_delayed_work;
 	}
 
@@ -591,9 +591,9 @@ static void ks_sdio_interrupt(struct sdio_func *func)
 	/* bit2 -> Read Status Busy  */
 	if (status & INT_GCR_B ||
 	    atomic_read(&priv->psstatus.status) == PS_SNOOZE) {
-		ret = ks7010_sdio_readb(priv, GCR_B, &byte);
+		ret = ks7010_sdio_readb(priv, GCR_B_REG, &byte);
 		if (ret) {
-			netdev_err(priv->net_dev, " error : GCR_B\n");
+			netdev_err(priv->net_dev, " error : GCR_B_REG\n");
 			goto queue_delayed_work;
 		}
 		if (byte == GCR_B_ACTIVE) {
@@ -607,9 +607,9 @@ static void ks_sdio_interrupt(struct sdio_func *func)
 
 	do {
 		/* read (WriteStatus/ReadDataSize FN1:00_0014) */
-		ret = ks7010_sdio_readb(priv, WSTATUS_RSIZE, &byte);
+		ret = ks7010_sdio_readb(priv, WSTATUS_RSIZE_REG, &byte);
 		if (ret) {
-			netdev_err(priv->net_dev, " error : WSTATUS_RSIZE\n");
+			netdev_err(priv->net_dev, " error : WSTATUS_RSIZE_REG\n");
 			goto queue_delayed_work;
 		}
 		rsize = byte & RSIZE_MASK;
@@ -675,11 +675,11 @@ static int ks7010_sdio_update_index(struct ks_wlan_private *priv, u32 index)
 	if (!data_buf)
 		return -ENOMEM;
 
-	ret = ks7010_sdio_write(priv, WRITE_INDEX, data_buf, sizeof(index));
+	ret = ks7010_sdio_write(priv, WRITE_INDEX_REG, data_buf, sizeof(index));
 	if (ret)
 		goto err_free_data_buf;
 
-	ret = ks7010_sdio_write(priv, READ_INDEX, data_buf, sizeof(index));
+	ret = ks7010_sdio_write(priv, READ_INDEX_REG, data_buf, sizeof(index));
 	if (ret)
 		goto err_free_data_buf;
 
@@ -768,7 +768,7 @@ static int ks7010_copy_firmware(struct ks_wlan_private *priv,
 
 	} while (size);
 
-	ret = ks7010_sdio_writeb(priv, GCR_A, GCR_A_REMAP);
+	ret = ks7010_sdio_writeb(priv, GCR_A_REG, GCR_A_REMAP);
 
 free_rom_buf:
 	kfree(rom_buf);
@@ -787,7 +787,7 @@ static int ks7010_upload_firmware(struct ks_sdio_card *card)
 	sdio_claim_host(card->func);
 
 	/* Firmware running ? */
-	ret = ks7010_sdio_readb(priv, GCR_A, &byte);
+	ret = ks7010_sdio_readb(priv, GCR_A_REG, &byte);
 	if (ret)
 		goto release_host;
 	if (byte == GCR_A_RUN) {
@@ -808,7 +808,7 @@ static int ks7010_upload_firmware(struct ks_sdio_card *card)
 	/* Firmware running check */
 	for (n = 0; n < 50; ++n) {
 		usleep_range(10000, 11000);	/* wait_ms(10); */
-		ret = ks7010_sdio_readb(priv, GCR_A, &byte);
+		ret = ks7010_sdio_readb(priv, GCR_A_REG, &byte);
 		if (ret)
 			goto release_firmware;
 
@@ -913,11 +913,11 @@ static int ks7010_sdio_setup_irqs(struct sdio_func *func)
 	int ret;
 
 	/* interrupt disable */
-	sdio_writeb(func, 0, INT_ENABLE, &ret);
+	sdio_writeb(func, 0, INT_ENABLE_REG, &ret);
 	if (ret)
 		goto irq_error;
 
-	sdio_writeb(func, 0xff, INT_PENDING, &ret);
+	sdio_writeb(func, 0xff, INT_PENDING_REG, &ret);
 	if (ret)
 		goto irq_error;
 
@@ -940,18 +940,18 @@ static void ks7010_sdio_init_irqs(struct sdio_func *func,
 	 * (ARMtoSD_InterruptPending FN1:00_0024)
 	 */
 	sdio_claim_host(func);
-	ret = ks7010_sdio_writeb(priv, INT_PENDING, 0xff);
+	ret = ks7010_sdio_writeb(priv, INT_PENDING_REG, 0xff);
 	sdio_release_host(func);
 	if (ret)
-		netdev_err(priv->net_dev, " error : INT_PENDING\n");
+		netdev_err(priv->net_dev, " error : INT_PENDING_REG\n");
 
 	/* enable ks7010sdio interrupt */
 	byte = (INT_GCR_B | INT_READ_STATUS | INT_WRITE_STATUS);
 	sdio_claim_host(func);
-	ret = ks7010_sdio_writeb(priv, INT_ENABLE, byte);
+	ret = ks7010_sdio_writeb(priv, INT_ENABLE_REG, byte);
 	sdio_release_host(func);
 	if (ret)
-		netdev_err(priv->net_dev, " err : INT_ENABLE\n");
+		netdev_err(priv->net_dev, " err : INT_ENABLE_REG\n");
 }
 
 static void ks7010_private_init(struct ks_wlan_private *priv,
@@ -1122,8 +1122,8 @@ static void ks7010_sdio_remove(struct sdio_func *func)
 
 		/* interrupt disable */
 		sdio_claim_host(func);
-		sdio_writeb(func, 0, INT_ENABLE, &ret);
-		sdio_writeb(func, 0xff, INT_PENDING, &ret);
+		sdio_writeb(func, 0, INT_ENABLE_REG, &ret);
+		sdio_writeb(func, 0xff, INT_PENDING_REG, &ret);
 		sdio_release_host(func);
 
 		ret = send_stop_request(func);
-- 
2.7.4

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

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

* [PATCH 06/24] staging: ks7010: review comment style in ks7010_sdio source file
  2018-04-23 13:44 [PATCH 00/24] staging: ks7010: remaining cleanups from previous series Sergio Paracuellos
                   ` (4 preceding siblings ...)
  2018-04-23 13:44 ` [PATCH 05/24] staging: ks7010: add REG suffix to sdio register definitions Sergio Paracuellos
@ 2018-04-23 13:44 ` Sergio Paracuellos
  2018-04-23 13:44 ` [PATCH 07/24] staging: ks7010: review debug and error messages in ks7010_sdio source Sergio Paracuellos
                   ` (17 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Sergio Paracuellos @ 2018-04-23 13:44 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, wsa

This commit reviews comment style used in ks7010_sdio source file
in order to be coherent with the rest of the code. Most comments
in this source are before definitions but only two of them have
been written at the right. So, be coherent moving this two to the
top of definitions. Also fix one multiline comment style to use
the normal preferred kernel style.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/ks7010/ks7010_sdio.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
index cf9f347..23bfdf3 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -48,12 +48,17 @@ enum reg_status_type {
 /* Write Index Register */
 #define WRITE_INDEX_REG		0x000010
 
-/* Write Status/Read Data Size Register
+/*
+ * Write Status/Read Data Size Register
  * for network packet (less than 2048 bytes data)
  */
 #define WSTATUS_RSIZE_REG	0x000014
-#define WSTATUS_MASK		0x80	/* Write Status Register value */
-#define RSIZE_MASK		0x7F	/* Read Data Size Register value [10:4] */
+
+/* Write Status Register value */
+#define WSTATUS_MASK		0x80
+
+/* Read Data Size Register value [10:4] */
+#define RSIZE_MASK		0x7F
 
 /* ARM to SD interrupt Enable */
 #define INT_ENABLE_REG		0x000020
-- 
2.7.4

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

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

* [PATCH 07/24] staging: ks7010: review debug and error messages in ks7010_sdio source
  2018-04-23 13:44 [PATCH 00/24] staging: ks7010: remaining cleanups from previous series Sergio Paracuellos
                   ` (5 preceding siblings ...)
  2018-04-23 13:44 ` [PATCH 06/24] staging: ks7010: review comment style in ks7010_sdio source file Sergio Paracuellos
@ 2018-04-23 13:44 ` Sergio Paracuellos
  2018-04-23 13:44 ` [PATCH 08/24] staging: ks7010: avoid one extra level indentation in ks_wlan_hw_rx function Sergio Paracuellos
                   ` (16 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Sergio Paracuellos @ 2018-04-23 13:44 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, wsa

This commit reviews debug and error messages in code located
in ks7010_sdio source file avoiding to use 'error' or 'ks7010'
because this file is using netdev_* functions and has non
sense to repeat information in log messages.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/ks7010/ks7010_sdio.c | 38 +++++++++++++++++-------------------
 1 file changed, 18 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
index 23bfdf3..b16a668 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -204,7 +204,7 @@ static void ks_wlan_hw_sleep_doze_request(struct ks_wlan_private *priv)
 	if (atomic_read(&priv->sleepstatus.status) == 0) {
 		ret = ks7010_sdio_writeb(priv, GCR_B_REG, GCR_B_DOZE);
 		if (ret) {
-			netdev_err(priv->net_dev, " error : GCR_B_REG\n");
+			netdev_err(priv->net_dev, "write GCR_B_REG\n");
 			goto set_sleep_mode;
 		}
 		atomic_set(&priv->sleepstatus.status, 1);
@@ -225,7 +225,7 @@ static void ks_wlan_hw_sleep_wakeup_request(struct ks_wlan_private *priv)
 	if (atomic_read(&priv->sleepstatus.status) == 1) {
 		ret = ks7010_sdio_writeb(priv, WAKEUP_REG, WAKEUP_REQ);
 		if (ret) {
-			netdev_err(priv->net_dev, " error : WAKEUP_REG\n");
+			netdev_err(priv->net_dev, "write WAKEUP_REG\n");
 			goto set_sleep_mode;
 		}
 		atomic_set(&priv->sleepstatus.status, 0);
@@ -244,7 +244,7 @@ void ks_wlan_hw_wakeup_request(struct ks_wlan_private *priv)
 	if (atomic_read(&priv->psstatus.status) == PS_SNOOZE) {
 		ret = ks7010_sdio_writeb(priv, WAKEUP_REG, WAKEUP_REQ);
 		if (ret)
-			netdev_err(priv->net_dev, " error : WAKEUP_REG\n");
+			netdev_err(priv->net_dev, "write WAKEUP_REG\n");
 
 		priv->last_wakeup = jiffies;
 		++priv->wakeup_count;
@@ -286,7 +286,7 @@ static void _ks_wlan_hw_power_save(struct ks_wlan_private *priv)
 
 	ret = ks7010_sdio_readb(priv, INT_PENDING_REG, &byte);
 	if (ret) {
-		netdev_err(priv->net_dev, " error : INT_PENDING_REG\n");
+		netdev_err(priv->net_dev, "read INT_PENDING_REG\n");
 		goto queue_delayed_work;
 	}
 	if (byte)
@@ -294,7 +294,7 @@ static void _ks_wlan_hw_power_save(struct ks_wlan_private *priv)
 
 	ret = ks7010_sdio_writeb(priv, GCR_B_REG, GCR_B_DOZE);
 	if (ret) {
-		netdev_err(priv->net_dev, " error : GCR_B_REG\n");
+		netdev_err(priv->net_dev, "write GCR_B_REG\n");
 		goto queue_delayed_work;
 	}
 	atomic_set(&priv->psstatus.status, PS_SNOOZE);
@@ -365,13 +365,13 @@ static int write_to_device(struct ks_wlan_private *priv, unsigned char *buffer,
 
 	ret = ks7010_sdio_write(priv, DATA_WINDOW, buffer, size);
 	if (ret) {
-		netdev_err(priv->net_dev, " write error : retval=%d\n", ret);
+		netdev_err(priv->net_dev, "write DATA_WINDOW\n");
 		return ret;
 	}
 
 	ret = ks7010_sdio_writeb(priv, WRITE_STATUS_REG, REG_STATUS_BUSY);
 	if (ret) {
-		netdev_err(priv->net_dev, " error : WRITE_STATUS_REG\n");
+		netdev_err(priv->net_dev, "write WRITE_STATUS_REG\n");
 		return ret;
 	}
 
@@ -479,7 +479,7 @@ static void ks_wlan_hw_rx(struct ks_wlan_private *priv, uint16_t size)
 #endif
 		ret = ks7010_sdio_writeb(priv, READ_STATUS_REG, REG_STATUS_IDLE);
 		if (ret)
-			netdev_err(priv->net_dev, " error : READ_STATUS_REG\n");
+			netdev_err(priv->net_dev, "write READ_STATUS_REG\n");
 
 		/* length check fail */
 		return;
@@ -492,7 +492,7 @@ static void ks_wlan_hw_rx(struct ks_wlan_private *priv, uint16_t size)
 
 	ret = ks7010_sdio_writeb(priv, READ_STATUS_REG, REG_STATUS_IDLE);
 	if (ret)
-		netdev_err(priv->net_dev, " error : READ_STATUS_REG\n");
+		netdev_err(priv->net_dev, "write READ_STATUS_REG\n");
 
 	if (atomic_read(&priv->psstatus.confirm_wait)) {
 		if (is_hif_conf(event)) {
@@ -553,7 +553,7 @@ static void ks7010_rw_function(struct work_struct *work)
 	/* read (WriteStatus/ReadDataSize FN1:00_0014) */
 	ret = ks7010_sdio_readb(priv, WSTATUS_RSIZE_REG, &byte);
 	if (ret) {
-		netdev_err(priv->net_dev, " error : WSTATUS_RSIZE_REG psstatus=%d\n",
+		netdev_err(priv->net_dev, "read WSTATUS_RSIZE_REG psstatus=%d\n",
 			   atomic_read(&priv->psstatus.status));
 		goto release_host;
 	}
@@ -585,7 +585,7 @@ static void ks_sdio_interrupt(struct sdio_func *func)
 
 	ret = ks7010_sdio_readb(priv, INT_PENDING_REG, &status);
 	if (ret) {
-		netdev_err(priv->net_dev, "error : INT_PENDING_REG\n");
+		netdev_err(priv->net_dev, "read INT_PENDING_REG\n");
 		goto queue_delayed_work;
 	}
 
@@ -598,7 +598,7 @@ static void ks_sdio_interrupt(struct sdio_func *func)
 	    atomic_read(&priv->psstatus.status) == PS_SNOOZE) {
 		ret = ks7010_sdio_readb(priv, GCR_B_REG, &byte);
 		if (ret) {
-			netdev_err(priv->net_dev, " error : GCR_B_REG\n");
+			netdev_err(priv->net_dev, "read GCR_B_REG\n");
 			goto queue_delayed_work;
 		}
 		if (byte == GCR_B_ACTIVE) {
@@ -614,7 +614,7 @@ static void ks_sdio_interrupt(struct sdio_func *func)
 		/* read (WriteStatus/ReadDataSize FN1:00_0014) */
 		ret = ks7010_sdio_readb(priv, WSTATUS_RSIZE_REG, &byte);
 		if (ret) {
-			netdev_err(priv->net_dev, " error : WSTATUS_RSIZE_REG\n");
+			netdev_err(priv->net_dev, "read WSTATUS_RSIZE_REG\n");
 			goto queue_delayed_work;
 		}
 		rsize = byte & RSIZE_MASK;
@@ -948,7 +948,7 @@ static void ks7010_sdio_init_irqs(struct sdio_func *func,
 	ret = ks7010_sdio_writeb(priv, INT_PENDING_REG, 0xff);
 	sdio_release_host(func);
 	if (ret)
-		netdev_err(priv->net_dev, " error : INT_PENDING_REG\n");
+		netdev_err(priv->net_dev, "write INT_PENDING_REG\n");
 
 	/* enable ks7010sdio interrupt */
 	byte = (INT_GCR_B | INT_READ_STATUS | INT_WRITE_STATUS);
@@ -956,7 +956,7 @@ static void ks7010_sdio_init_irqs(struct sdio_func *func,
 	ret = ks7010_sdio_writeb(priv, INT_ENABLE_REG, byte);
 	sdio_release_host(func);
 	if (ret)
-		netdev_err(priv->net_dev, " err : INT_ENABLE_REG\n");
+		netdev_err(priv->net_dev, "write INT_ENABLE_REG\n");
 }
 
 static void ks7010_private_init(struct ks_wlan_private *priv,
@@ -1024,12 +1024,11 @@ static int ks7010_sdio_probe(struct sdio_func *func,
 	/* private memory allocate */
 	netdev = alloc_etherdev(sizeof(*priv));
 	if (!netdev) {
-		dev_err(&card->func->dev, "ks7010 : Unable to alloc new net device\n");
+		dev_err(&card->func->dev, "Unable to alloc new net device\n");
 		goto err_release_irq;
 	}
 	if (dev_alloc_name(netdev, "wlan%d") < 0) {
-		dev_err(&card->func->dev,
-			"ks7010 :  Couldn't get name!\n");
+		dev_err(&card->func->dev, "Couldn't get name!\n");
 		goto err_free_netdev;
 	}
 
@@ -1043,8 +1042,7 @@ static int ks7010_sdio_probe(struct sdio_func *func,
 	ret = ks7010_upload_firmware(card);
 	if (ret) {
 		netdev_err(priv->net_dev,
-			   "ks7010: firmware load failed !! return code = %d\n",
-			   ret);
+			   "firmware load failed !! ret = %d\n", ret);
 		goto err_free_netdev;
 	}
 
-- 
2.7.4

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

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

* [PATCH 08/24] staging: ks7010: avoid one extra level indentation in ks_wlan_hw_rx function
  2018-04-23 13:44 [PATCH 00/24] staging: ks7010: remaining cleanups from previous series Sergio Paracuellos
                   ` (6 preceding siblings ...)
  2018-04-23 13:44 ` [PATCH 07/24] staging: ks7010: review debug and error messages in ks7010_sdio source Sergio Paracuellos
@ 2018-04-23 13:44 ` Sergio Paracuellos
  2018-04-23 13:44 ` [PATCH 09/24] staging: ks7010: move MODULE_DEVICE_TABLE related code Sergio Paracuellos
                   ` (15 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Sergio Paracuellos @ 2018-04-23 13:44 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, wsa

This commit use an and operator in a if condition to avoid one
indentation level which is not needed at all.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/ks7010/ks7010_sdio.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
index b16a668..434d5e8 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -494,11 +494,9 @@ static void ks_wlan_hw_rx(struct ks_wlan_private *priv, uint16_t size)
 	if (ret)
 		netdev_err(priv->net_dev, "write READ_STATUS_REG\n");
 
-	if (atomic_read(&priv->psstatus.confirm_wait)) {
-		if (is_hif_conf(event)) {
-			netdev_dbg(priv->net_dev, "IS_HIF_CONF true !!\n");
-			atomic_dec(&priv->psstatus.confirm_wait);
-		}
+	if (atomic_read(&priv->psstatus.confirm_wait) && is_hif_conf(event)) {
+		netdev_dbg(priv->net_dev, "IS_HIF_CONF true !!\n");
+		atomic_dec(&priv->psstatus.confirm_wait);
 	}
 
 	tasklet_schedule(&priv->rx_bh_task);
-- 
2.7.4

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

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

* [PATCH 09/24] staging: ks7010: move MODULE_DEVICE_TABLE related code
  2018-04-23 13:44 [PATCH 00/24] staging: ks7010: remaining cleanups from previous series Sergio Paracuellos
                   ` (7 preceding siblings ...)
  2018-04-23 13:44 ` [PATCH 08/24] staging: ks7010: avoid one extra level indentation in ks_wlan_hw_rx function Sergio Paracuellos
@ 2018-04-23 13:44 ` Sergio Paracuellos
  2018-04-23 13:44 ` [PATCH 10/24] staging: ks7010: replace create_workqueue with alloc_workqueue Sergio Paracuellos
                   ` (14 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Sergio Paracuellos @ 2018-04-23 13:44 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, wsa

This commit moves MODULE_DEVICE_TABLE related code to the end of
the file. This is not necessary at all but moving it just before
its use improves readability.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/ks7010/ks7010_sdio.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
index 434d5e8..31022e4 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -101,13 +101,6 @@ enum gen_com_reg_b {
 
 #define KS7010_IO_BLOCK_SIZE 512
 
-static const struct sdio_device_id ks7010_sdio_ids[] = {
-	{SDIO_DEVICE(SDIO_VENDOR_ID_KS_CODE_A, SDIO_DEVICE_ID_KS_7010)},
-	{SDIO_DEVICE(SDIO_VENDOR_ID_KS_CODE_B, SDIO_DEVICE_ID_KS_7010)},
-	{ /* all zero */ }
-};
-MODULE_DEVICE_TABLE(sdio, ks7010_sdio_ids);
-
 static inline void inc_txqhead(struct ks_wlan_private *priv)
 {
 	priv->tx_dev.qhead = (priv->tx_dev.qhead + 1) % TX_DEVICE_BUFF_SIZE;
@@ -1153,6 +1146,13 @@ static void ks7010_sdio_remove(struct sdio_func *func)
 	kfree(card);
 }
 
+static const struct sdio_device_id ks7010_sdio_ids[] = {
+	{SDIO_DEVICE(SDIO_VENDOR_ID_KS_CODE_A, SDIO_DEVICE_ID_KS_7010)},
+	{SDIO_DEVICE(SDIO_VENDOR_ID_KS_CODE_B, SDIO_DEVICE_ID_KS_7010)},
+	{ /* all zero */ }
+};
+MODULE_DEVICE_TABLE(sdio, ks7010_sdio_ids);
+
 static struct sdio_driver ks7010_sdio_driver = {
 	.name = "ks7010_sdio",
 	.id_table = ks7010_sdio_ids,
-- 
2.7.4

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

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

* [PATCH 10/24] staging: ks7010: replace create_workqueue with alloc_workqueue
  2018-04-23 13:44 [PATCH 00/24] staging: ks7010: remaining cleanups from previous series Sergio Paracuellos
                   ` (8 preceding siblings ...)
  2018-04-23 13:44 ` [PATCH 09/24] staging: ks7010: move MODULE_DEVICE_TABLE related code Sergio Paracuellos
@ 2018-04-23 13:44 ` Sergio Paracuellos
  2018-04-23 13:44 ` [PATCH 11/24] staging: ks7010: check sdio_set_block_size return value Sergio Paracuellos
                   ` (13 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Sergio Paracuellos @ 2018-04-23 13:44 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, wsa

This commit replaces deprecated create_workqueue call with the
alloc_workqueue one which is the one to be used now for this
purpose.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/ks7010/ks7010_sdio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
index 31022e4..fe4beb0 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -1041,7 +1041,7 @@ static int ks7010_sdio_probe(struct sdio_func *func,
 
 	priv->dev_state = DEVICE_STATE_BOOT;
 
-	priv->wq = create_workqueue("wq");
+	priv->wq = alloc_workqueue("wq", WQ_MEM_RECLAIM, 1);
 	if (!priv->wq) {
 		netdev_err(priv->net_dev, "create_workqueue failed !!\n");
 		goto err_free_netdev;
-- 
2.7.4

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

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

* [PATCH 11/24] staging: ks7010: check sdio_set_block_size return value
  2018-04-23 13:44 [PATCH 00/24] staging: ks7010: remaining cleanups from previous series Sergio Paracuellos
                   ` (9 preceding siblings ...)
  2018-04-23 13:44 ` [PATCH 10/24] staging: ks7010: replace create_workqueue with alloc_workqueue Sergio Paracuellos
@ 2018-04-23 13:44 ` Sergio Paracuellos
  2018-04-23 13:44 ` [PATCH 12/24] staging: ks7010: fix error paths in ks7010_sdio_remove function Sergio Paracuellos
                   ` (12 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Sergio Paracuellos @ 2018-04-23 13:44 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, wsa

This commit checks sdio_set_block_size function return value.
If it fails abort driver initialization.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/ks7010/ks7010_sdio.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
index fe4beb0..1d569ef 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -994,6 +994,9 @@ static int ks7010_sdio_probe(struct sdio_func *func,
 	sdio_claim_host(func);
 
 	ret = sdio_set_block_size(func, KS7010_IO_BLOCK_SIZE);
+	if (ret)
+		goto err_free_card;
+
 	dev_dbg(&card->func->dev, "multi_block=%d sdio_set_block_size()=%d %d\n",
 		func->card->cccr.multi_block, func->cur_blksize, ret);
 
-- 
2.7.4

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

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

* [PATCH 12/24] staging: ks7010: fix error paths in ks7010_sdio_remove function
  2018-04-23 13:44 [PATCH 00/24] staging: ks7010: remaining cleanups from previous series Sergio Paracuellos
                   ` (10 preceding siblings ...)
  2018-04-23 13:44 ` [PATCH 11/24] staging: ks7010: check sdio_set_block_size return value Sergio Paracuellos
@ 2018-04-23 13:44 ` Sergio Paracuellos
  2018-04-23 13:44 ` [PATCH 13/24] staging: ks7010: use u8 instead of unsigned char for firmware buffers Sergio Paracuellos
                   ` (11 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Sergio Paracuellos @ 2018-04-23 13:44 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, wsa

This commit reviews and fixes error paths in ks7010_sdio_remove
driver function. It change logic to handle error directly
after priv dereference to avoid one level indentation. It also
removes a temporal netdev variable which wasn't being used in all
of the function calls. Also if send_stop_request call fails it
was making a direct 'return' instead of doing a properly cleaning.
Because of this a new 'err_free_card' label has been added.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/ks7010/ks7010_sdio.c | 42 ++++++++++++++++++------------------
 1 file changed, 21 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
index 1d569ef..5293b48 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -1112,39 +1112,39 @@ static void ks7010_sdio_remove(struct sdio_func *func)
 		return;
 
 	priv = card->priv;
-	if (priv) {
-		struct net_device *netdev = priv->net_dev;
+	if (!priv)
+		goto err_free_card;
 
-		ks_wlan_net_stop(netdev);
+	ks_wlan_net_stop(priv->net_dev);
 
-		/* interrupt disable */
-		sdio_claim_host(func);
-		sdio_writeb(func, 0, INT_ENABLE_REG, &ret);
-		sdio_writeb(func, 0xff, INT_PENDING_REG, &ret);
-		sdio_release_host(func);
+	/* interrupt disable */
+	sdio_claim_host(func);
+	sdio_writeb(func, 0, INT_ENABLE_REG, &ret);
+	sdio_writeb(func, 0xff, INT_PENDING_REG, &ret);
+	sdio_release_host(func);
 
-		ret = send_stop_request(func);
-		if (ret)	/* memory allocation failure */
-			return;
+	ret = send_stop_request(func);
+	if (ret)	/* memory allocation failure */
+		goto err_free_card;
 
-		if (priv->wq) {
-			flush_workqueue(priv->wq);
-			destroy_workqueue(priv->wq);
-		}
+	if (priv->wq) {
+		flush_workqueue(priv->wq);
+		destroy_workqueue(priv->wq);
+	}
 
-		hostif_exit(priv);
+	hostif_exit(priv);
 
-		unregister_netdev(netdev);
+	unregister_netdev(priv->net_dev);
 
-		trx_device_exit(priv);
-		free_netdev(priv->net_dev);
-		card->priv = NULL;
-	}
+	trx_device_exit(priv);
+	free_netdev(priv->net_dev);
+	card->priv = NULL;
 
 	sdio_claim_host(func);
 	sdio_release_irq(func);
 	sdio_disable_func(func);
 	sdio_release_host(func);
+err_free_card:
 	sdio_set_drvdata(func, NULL);
 	kfree(card);
 }
-- 
2.7.4

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

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

* [PATCH 13/24] staging: ks7010: use u8 instead of unsigned char for firmware buffers
  2018-04-23 13:44 [PATCH 00/24] staging: ks7010: remaining cleanups from previous series Sergio Paracuellos
                   ` (11 preceding siblings ...)
  2018-04-23 13:44 ` [PATCH 12/24] staging: ks7010: fix error paths in ks7010_sdio_remove function Sergio Paracuellos
@ 2018-04-23 13:44 ` Sergio Paracuellos
  2018-04-23 13:44 ` [PATCH 14/24] staging: ks7010: assign dev_alloc_name() result to variable before check it Sergio Paracuellos
                   ` (10 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Sergio Paracuellos @ 2018-04-23 13:44 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, wsa

This commit replaces type unsigned char which is the one which
is being used for firmware buffers with u8 type which is preferred.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/ks7010/ks7010_sdio.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
index 5293b48..130e0be 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -689,10 +689,10 @@ static int ks7010_sdio_update_index(struct ks_wlan_private *priv, u32 index)
 
 #define ROM_BUFF_SIZE (64 * 1024)
 static int ks7010_sdio_data_compare(struct ks_wlan_private *priv, u32 address,
-				    unsigned char *data, unsigned int size)
+				    u8 *data, unsigned int size)
 {
 	int ret;
-	unsigned char *read_buf;
+	u8 *read_buf;
 
 	read_buf = kmalloc(ROM_BUFF_SIZE, GFP_KERNEL);
 	if (!read_buf)
@@ -723,7 +723,7 @@ static int ks7010_copy_firmware(struct ks_wlan_private *priv,
 	unsigned int size;
 	unsigned int offset;
 	unsigned int n = 0;
-	unsigned char *rom_buf;
+	u8 *rom_buf;
 	int ret;
 
 	rom_buf = kmalloc(ROM_BUFF_SIZE, GFP_KERNEL);
-- 
2.7.4

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

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

* [PATCH 14/24] staging: ks7010: assign dev_alloc_name() result to variable before check it
  2018-04-23 13:44 [PATCH 00/24] staging: ks7010: remaining cleanups from previous series Sergio Paracuellos
                   ` (12 preceding siblings ...)
  2018-04-23 13:44 ` [PATCH 13/24] staging: ks7010: use u8 instead of unsigned char for firmware buffers Sergio Paracuellos
@ 2018-04-23 13:44 ` Sergio Paracuellos
  2018-04-23 13:44 ` [PATCH 15/24] staging: ks7010: change name and type for device_open_status field Sergio Paracuellos
                   ` (9 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Sergio Paracuellos @ 2018-04-23 13:44 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, wsa

This commit assigns dev_alloc_name() call to 'ret' variable to
check it after instead of check directly the call in the if
condition. This improves a bit readability. It also add an empty
line before the new assignment to separate it from the previous
check statement block.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/ks7010/ks7010_sdio.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
index 130e0be..b29f48c 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -1021,7 +1021,9 @@ static int ks7010_sdio_probe(struct sdio_func *func,
 		dev_err(&card->func->dev, "Unable to alloc new net device\n");
 		goto err_release_irq;
 	}
-	if (dev_alloc_name(netdev, "wlan%d") < 0) {
+
+	ret = dev_alloc_name(netdev, "wlan%d");
+	if (ret < 0) {
 		dev_err(&card->func->dev, "Couldn't get name!\n");
 		goto err_free_netdev;
 	}
-- 
2.7.4

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

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

* [PATCH 15/24] staging: ks7010: change name and type for device_open_status field
  2018-04-23 13:44 [PATCH 00/24] staging: ks7010: remaining cleanups from previous series Sergio Paracuellos
                   ` (13 preceding siblings ...)
  2018-04-23 13:44 ` [PATCH 14/24] staging: ks7010: assign dev_alloc_name() result to variable before check it Sergio Paracuellos
@ 2018-04-23 13:44 ` Sergio Paracuellos
  2018-04-23 13:44 ` [PATCH 16/24] staging: ks7010: avoid one level indentation in devio_rec_ind function Sergio Paracuellos
                   ` (8 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Sergio Paracuellos @ 2018-04-23 13:44 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, wsa

This commit changes type for device_open_status field of ks_wlan_private
structure from int to bool. This variable is only be set to 1
on ks_wlan_net_start and set to 0 on ks_wlan_net_stop. For this
purpose it is not necessary at all to use an integer because a bool
is enough. This also renames field name from device_open_status to
is_device_open.

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

diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c
index d11b0a2..3b10f9a 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -1562,7 +1562,7 @@ void hostif_mic_failure_request(struct ks_wlan_private *priv,
 static void devio_rec_ind(struct ks_wlan_private *priv, unsigned char *p,
 			  unsigned int size)
 {
-	if (priv->device_open_status) {
+	if (priv->is_device_open) {
 		spin_lock(&priv->dev_read_lock);	/* request spin lock */
 		priv->dev_data[atomic_read(&priv->rec_count)] = p;
 		priv->dev_size[atomic_read(&priv->rec_count)] = size;
diff --git a/drivers/staging/ks7010/ks_wlan.h b/drivers/staging/ks7010/ks_wlan.h
index 615c42e..52de448 100644
--- a/drivers/staging/ks7010/ks_wlan.h
+++ b/drivers/staging/ks7010/ks_wlan.h
@@ -424,7 +424,7 @@ struct ks_wlan_private {
 	unsigned int need_commit;	/* for ioctl */
 
 	/* DeviceIoControl */
-	bool device_open_status;
+	bool is_device_open;
 	atomic_t event_count;
 	atomic_t rec_count;
 	int dev_count;
diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c
index 05f8216..76ed4ed9 100644
--- a/drivers/staging/ks7010/ks_wlan_net.c
+++ b/drivers/staging/ks7010/ks_wlan_net.c
@@ -2816,9 +2816,8 @@ int ks_wlan_net_start(struct net_device *dev)
 
 	priv = netdev_priv(dev);
 	priv->mac_address_valid = false;
-	priv->device_open_status = true;
+	priv->is_device_open = true;
 	priv->need_commit = 0;
-
 	/* phy information update timer */
 	atomic_set(&update_phyinfo, 0);
 	timer_setup(&update_phyinfo_timer, ks_wlan_update_phyinfo_timeout, 0);
@@ -2848,7 +2847,7 @@ int ks_wlan_net_stop(struct net_device *dev)
 {
 	struct ks_wlan_private *priv = netdev_priv(dev);
 
-	priv->device_open_status = false;
+	priv->is_device_open = false;
 	del_timer_sync(&update_phyinfo_timer);
 
 	if (netif_running(dev))
-- 
2.7.4

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

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

* [PATCH 16/24] staging: ks7010: avoid one level indentation in devio_rec_ind function
  2018-04-23 13:44 [PATCH 00/24] staging: ks7010: remaining cleanups from previous series Sergio Paracuellos
                   ` (14 preceding siblings ...)
  2018-04-23 13:44 ` [PATCH 15/24] staging: ks7010: change name and type for device_open_status field Sergio Paracuellos
@ 2018-04-23 13:44 ` Sergio Paracuellos
  2018-04-23 13:44 ` [PATCH 17/24] staging: ks7010: remove superfluous comments in ks_hostif source file Sergio Paracuellos
                   ` (7 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Sergio Paracuellos @ 2018-04-23 13:44 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, wsa

This commit changes logic to handle with the status of the device
at first checking for close state to return directly instead
of just do the stuff when device is open. This improves readability
avoiding one level indentation.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/ks7010/ks_hostif.c | 31 ++++++++++++++++---------------
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c
index 3b10f9a..156e732 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -1562,24 +1562,25 @@ void hostif_mic_failure_request(struct ks_wlan_private *priv,
 static void devio_rec_ind(struct ks_wlan_private *priv, unsigned char *p,
 			  unsigned int size)
 {
-	if (priv->is_device_open) {
-		spin_lock(&priv->dev_read_lock);	/* request spin lock */
-		priv->dev_data[atomic_read(&priv->rec_count)] = p;
-		priv->dev_size[atomic_read(&priv->rec_count)] = size;
-
-		if (atomic_read(&priv->event_count) != DEVICE_STOCK_COUNT) {
-			/* rx event count inc */
-			atomic_inc(&priv->event_count);
-		}
-		atomic_inc(&priv->rec_count);
-		if (atomic_read(&priv->rec_count) == DEVICE_STOCK_COUNT)
-			atomic_set(&priv->rec_count, 0);
+	if (!priv->is_device_open)
+		return;
 
-		wake_up_interruptible_all(&priv->devread_wait);
+	spin_lock(&priv->dev_read_lock);	/* request spin lock */
+	priv->dev_data[atomic_read(&priv->rec_count)] = p;
+	priv->dev_size[atomic_read(&priv->rec_count)] = size;
 
-		/* release spin lock */
-		spin_unlock(&priv->dev_read_lock);
+	if (atomic_read(&priv->event_count) != DEVICE_STOCK_COUNT) {
+		/* rx event count inc */
+		atomic_inc(&priv->event_count);
 	}
+	atomic_inc(&priv->rec_count);
+	if (atomic_read(&priv->rec_count) == DEVICE_STOCK_COUNT)
+		atomic_set(&priv->rec_count, 0);
+
+	wake_up_interruptible_all(&priv->devread_wait);
+
+	/* release spin lock */
+	spin_unlock(&priv->dev_read_lock);
 }
 
 void hostif_receive(struct ks_wlan_private *priv, unsigned char *p,
-- 
2.7.4

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

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

* [PATCH 17/24] staging: ks7010: remove superfluous comments in ks_hostif source file
  2018-04-23 13:44 [PATCH 00/24] staging: ks7010: remaining cleanups from previous series Sergio Paracuellos
                   ` (15 preceding siblings ...)
  2018-04-23 13:44 ` [PATCH 16/24] staging: ks7010: avoid one level indentation in devio_rec_ind function Sergio Paracuellos
@ 2018-04-23 13:44 ` Sergio Paracuellos
  2018-04-23 13:44 ` [PATCH 18/24] staging: ks7010: fix warning aout long line in init_request Sergio Paracuellos
                   ` (6 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Sergio Paracuellos @ 2018-04-23 13:44 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, wsa

This commit removes some comments which are not necessary at all
because code is clear enough to understand its intention.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/ks7010/ks_hostif.c | 39 +++++++-------------------------------
 1 file changed, 7 insertions(+), 32 deletions(-)

diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c
index 156e732..725e29a 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -17,9 +17,7 @@
 #include <linux/etherdevice.h>
 #include <linux/if_ether.h>
 #include <linux/if_arp.h>
-
-/* Include Wireless Extension definition and check version */
-#include <net/iw_handler.h>	/* New driver API */
+#include <net/iw_handler.h>
 
 static inline void inc_smeqhead(struct ks_wlan_private *priv)
 {
@@ -116,34 +114,24 @@ int get_current_ap(struct ks_wlan_private *priv, struct link_ap_info *ap_info)
 		return -EPERM;
 	}
 
-	/* bssid */
 	memcpy(ap->bssid, ap_info->bssid, ETH_ALEN);
-	/* essid */
 	memcpy(ap->ssid.body, priv->reg.ssid.body,
 	       priv->reg.ssid.size);
 	ap->ssid.size = priv->reg.ssid.size;
-	/* rate_set */
 	memcpy(ap->rate_set.body, ap_info->rate_set.body,
 	       ap_info->rate_set.size);
 	ap->rate_set.size = ap_info->rate_set.size;
 	if (ap_info->ext_rate_set.size != 0) {
-		/* rate_set */
 		memcpy(&ap->rate_set.body[ap->rate_set.size],
 		       ap_info->ext_rate_set.body,
 		       ap_info->ext_rate_set.size);
 		ap->rate_set.size += ap_info->ext_rate_set.size;
 	}
-	/* channel */
 	ap->channel = ap_info->ds_parameter.channel;
-	/* rssi */
 	ap->rssi = ap_info->rssi;
-	/* sq */
 	ap->sq = ap_info->sq;
-	/* noise */
 	ap->noise = ap_info->noise;
-	/* capability */
 	ap->capability = le16_to_cpu(ap_info->capability);
-	/* rsn */
 	if ((ap_info->rsn_mode & RSN_MODE_WPA2) &&
 	    (priv->wpa.version == IW_AUTH_WPA_VERSION_WPA2)) {
 		ap->rsn_ie.id = 0x30;
@@ -227,17 +215,11 @@ int get_ap_information(struct ks_wlan_private *priv, struct ap_info *ap_info,
 
 	memset(ap, 0, sizeof(struct local_ap));
 
-	/* bssid */
 	memcpy(ap->bssid, ap_info->bssid, ETH_ALEN);
-	/* rssi */
 	ap->rssi = ap_info->rssi;
-	/* sq */
 	ap->sq = ap_info->sq;
-	/* noise */
 	ap->noise = ap_info->noise;
-	/* capability */
 	ap->capability = le16_to_cpu(ap_info->capability);
-	/* channel */
 	ap->channel = ap_info->ch_info;
 
 	bp = ap_info->body;
@@ -505,7 +487,6 @@ void hostif_mib_get_confirm(struct ks_wlan_private *priv)
 	mib_val_type = get_word(priv);	/* MIB value type */
 
 	if (mib_status) {
-		/* in case of error */
 		netdev_err(priv->net_dev, "attribute=%08X, status=%08X\n",
 			   mib_attribute, mib_status);
 		return;
@@ -513,7 +494,6 @@ void hostif_mib_get_confirm(struct ks_wlan_private *priv)
 
 	switch (mib_attribute) {
 	case DOT11_MAC_ADDRESS:
-		/* MAC address */
 		hostif_sme_enqueue(priv, SME_GET_MAC_ADDRESS);
 		memcpy(priv->eth_addr, priv->rxp, ETH_ALEN);
 		priv->mac_address_valid = true;
@@ -528,7 +508,6 @@ void hostif_mib_get_confirm(struct ks_wlan_private *priv)
 		netdev_info(dev, "MAC ADDRESS = %pM\n", priv->eth_addr);
 		break;
 	case DOT11_PRODUCT_VERSION:
-		/* firmware version */
 		priv->version_size = priv->rx_size;
 		memcpy(priv->firmware_version, priv->rxp, priv->rx_size);
 		priv->firmware_version[priv->rx_size] = '\0';
@@ -713,13 +692,13 @@ void hostif_connect_indication(struct ks_wlan_private *priv)
 	connect_code = get_word(priv);
 
 	switch (connect_code) {
-	case RESULT_CONNECT:	/* connect */
+	case RESULT_CONNECT:
 		if (!(priv->connect_status & FORCE_DISCONNECT))
 			netif_carrier_on(netdev);
 		tmp = FORCE_DISCONNECT & priv->connect_status;
 		priv->connect_status = tmp + CONNECT_STATUS;
 		break;
-	case RESULT_DISCONNECT: /* disconnect */
+	case RESULT_DISCONNECT:
 		netif_carrier_off(netdev);
 		tmp = FORCE_DISCONNECT & priv->connect_status;
 		priv->connect_status = tmp + DISCONNECT_STATUS;
@@ -961,7 +940,7 @@ void hostif_event_check(struct ks_wlan_private *priv)
 {
 	unsigned short event;
 
-	event = get_word(priv);	/* get event */
+	event = get_word(priv);
 	switch (event) {
 	case HIF_DATA_IND:
 		hostif_data_indication(priv);
@@ -1565,7 +1544,7 @@ static void devio_rec_ind(struct ks_wlan_private *priv, unsigned char *p,
 	if (!priv->is_device_open)
 		return;
 
-	spin_lock(&priv->dev_read_lock);	/* request spin lock */
+	spin_lock(&priv->dev_read_lock);
 	priv->dev_data[atomic_read(&priv->rec_count)] = p;
 	priv->dev_size[atomic_read(&priv->rec_count)] = size;
 
@@ -1579,7 +1558,6 @@ static void devio_rec_ind(struct ks_wlan_private *priv, unsigned char *p,
 
 	wake_up_interruptible_all(&priv->devread_wait);
 
-	/* release spin lock */
 	spin_unlock(&priv->dev_read_lock);
 }
 
@@ -1591,8 +1569,8 @@ void hostif_receive(struct ks_wlan_private *priv, unsigned char *p,
 	priv->rxp = p;
 	priv->rx_size = size;
 
-	if (get_word(priv) == priv->rx_size) {	/* length check !! */
-		hostif_event_check(priv);	/* event check */
+	if (get_word(priv) == priv->rx_size) {
+		hostif_event_check(priv);
 	}
 }
 
@@ -1910,11 +1888,9 @@ void hostif_sme_mode_setup(struct ks_wlan_private *priv)
 
 	switch (priv->reg.operation_mode) {
 	case MODE_PSEUDO_ADHOC:
-		/* Pseudo Ad-Hoc mode */
 		hostif_ps_adhoc_set_request(priv);
 		break;
 	case MODE_INFRASTRUCTURE:
-		/* Infrastructure mode */
 		if (!is_valid_ether_addr((u8 *)priv->reg.bssid)) {
 			hostif_infrastructure_set_request(priv, HIF_INFRA_SET_REQ);
 		} else {
@@ -1924,7 +1900,6 @@ void hostif_sme_mode_setup(struct ks_wlan_private *priv)
 		}
 		break;
 	case MODE_ADHOC:
-		/* IEEE802.11 Ad-Hoc mode */
 		if (!is_valid_ether_addr((u8 *)priv->reg.bssid)) {
 			hostif_adhoc_set_request(priv);
 		} else {
-- 
2.7.4

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

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

* [PATCH 18/24] staging: ks7010: fix warning aout long line in init_request
  2018-04-23 13:44 [PATCH 00/24] staging: ks7010: remaining cleanups from previous series Sergio Paracuellos
                   ` (16 preceding siblings ...)
  2018-04-23 13:44 ` [PATCH 17/24] staging: ks7010: remove superfluous comments in ks_hostif source file Sergio Paracuellos
@ 2018-04-23 13:44 ` Sergio Paracuellos
  2018-04-23 13:44 ` [PATCH 19/24] staging: ks7010: avoid blank line between definitions in hostif_data_request Sergio Paracuellos
                   ` (5 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Sergio Paracuellos @ 2018-04-23 13:44 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, wsa

This commit fix length of the definition line of init_request
function. Warning from checkpatch script for this is fixed.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/ks7010/ks_hostif.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c
index 725e29a..cf79ba3 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -1278,7 +1278,8 @@ static __le16 ks_wlan_cap(struct ks_wlan_private *priv)
 	return cpu_to_le16((uint16_t)capability);
 }
 
-static void init_request(struct ks_wlan_private *priv, struct hostif_request *req)
+static void init_request(struct ks_wlan_private *priv,
+			 struct hostif_request *req)
 {
 	req->phy_type = cpu_to_le16((uint16_t)(priv->reg.phy_type));
 	req->cts_mode = cpu_to_le16((uint16_t)(priv->reg.cts_mode));
-- 
2.7.4

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

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

* [PATCH 19/24] staging: ks7010: avoid blank line between definitions in hostif_data_request
  2018-04-23 13:44 [PATCH 00/24] staging: ks7010: remaining cleanups from previous series Sergio Paracuellos
                   ` (17 preceding siblings ...)
  2018-04-23 13:44 ` [PATCH 18/24] staging: ks7010: fix warning aout long line in init_request Sergio Paracuellos
@ 2018-04-23 13:44 ` Sergio Paracuellos
  2018-04-23 13:44 ` [PATCH 20/24] staging: ks7010: remove two fields of ks_wlan_private struct Sergio Paracuellos
                   ` (4 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Sergio Paracuellos @ 2018-04-23 13:44 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, wsa

This commit removes a blank line between definition in
hostif_data_request function.

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

diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c
index cf79ba3..2d8f304 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -1024,7 +1024,6 @@ static void *hostif_generic_request(size_t size, int event)
 int hostif_data_request(struct ks_wlan_private *priv, struct sk_buff *skb)
 {
 	unsigned int skb_len = 0;
-
 	unsigned char *buffer = NULL;
 	unsigned int length = 0;
 	struct hostif_data_request *pp;
-- 
2.7.4

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

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

* [PATCH 20/24] staging: ks7010: remove two fields of ks_wlan_private struct
  2018-04-23 13:44 [PATCH 00/24] staging: ks7010: remaining cleanups from previous series Sergio Paracuellos
                   ` (18 preceding siblings ...)
  2018-04-23 13:44 ` [PATCH 19/24] staging: ks7010: avoid blank line between definitions in hostif_data_request Sergio Paracuellos
@ 2018-04-23 13:44 ` Sergio Paracuellos
  2018-04-23 13:44 ` [PATCH 21/24] staging: ks7010: removes data_buff field " Sergio Paracuellos
                   ` (3 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Sergio Paracuellos @ 2018-04-23 13:44 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, wsa

This commit removes l2_dev and l2_fd fields of ks_wlan_private
struct because they are not being used at all.

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

diff --git a/drivers/staging/ks7010/ks_wlan.h b/drivers/staging/ks7010/ks_wlan.h
index 52de448..a4d03f9 100644
--- a/drivers/staging/ks7010/ks_wlan.h
+++ b/drivers/staging/ks7010/ks_wlan.h
@@ -454,8 +454,6 @@ struct ks_wlan_private {
 	u8 scan_ssid[IW_ESSID_MAX_SIZE + 1];
 	struct local_gain gain;
 #ifdef WPS
-	struct net_device *l2_dev;
-	int l2_fd;
 	struct wps_status wps;
 #endif /* WPS */
 	u8 sleep_mode;
-- 
2.7.4

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

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

* [PATCH 21/24] staging: ks7010: removes data_buff field of ks_wlan_private struct
  2018-04-23 13:44 [PATCH 00/24] staging: ks7010: remaining cleanups from previous series Sergio Paracuellos
                   ` (19 preceding siblings ...)
  2018-04-23 13:44 ` [PATCH 20/24] staging: ks7010: remove two fields of ks_wlan_private struct Sergio Paracuellos
@ 2018-04-23 13:44 ` Sergio Paracuellos
  2018-04-23 13:44 ` [PATCH 22/24] staging: ks7010: review includes of ks_hostif file Sergio Paracuellos
                   ` (2 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Sergio Paracuellos @ 2018-04-23 13:44 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, wsa

This commit removes data_buff array field of ks_wlan_private
which is not being used at all.

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

diff --git a/drivers/staging/ks7010/ks_wlan.h b/drivers/staging/ks7010/ks_wlan.h
index a4d03f9..365001b 100644
--- a/drivers/staging/ks7010/ks_wlan.h
+++ b/drivers/staging/ks7010/ks_wlan.h
@@ -447,9 +447,6 @@ struct ks_wlan_private {
 #define CONNECT_STATUS_MASK 0x7FFFFFFF
 	u32 connect_status;	/* connect status */
 	int infra_status;	/* Infractructure status */
-
-	u8 data_buff[0x1000];
-
 	u8 scan_ssid_len;
 	u8 scan_ssid[IW_ESSID_MAX_SIZE + 1];
 	struct local_gain gain;
-- 
2.7.4

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

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

* [PATCH 22/24] staging: ks7010: review includes of ks_hostif file
  2018-04-23 13:44 [PATCH 00/24] staging: ks7010: remaining cleanups from previous series Sergio Paracuellos
                   ` (20 preceding siblings ...)
  2018-04-23 13:44 ` [PATCH 21/24] staging: ks7010: removes data_buff field " Sergio Paracuellos
@ 2018-04-23 13:44 ` Sergio Paracuellos
  2018-04-23 13:44 ` [PATCH 23/24] staging: ks7010: use IW_HANDLER macro in ks_wlan_handler Sergio Paracuellos
  2018-04-23 13:44 ` [PATCH 24/24] staging: ks7010: remove KSC_OPNOTSUPP related code Sergio Paracuellos
  23 siblings, 0 replies; 25+ messages in thread
From: Sergio Paracuellos @ 2018-04-23 13:44 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, wsa

This commit reviews includes of ks_hostif.c source file.
Those which are not being used at all have been removed.
Driver header includes have been moved after the kernel
header includes to make style consistent in different
files of the driver. The need of ks_wlan.h header include
is only because of some preprocessor conditional code
of WPS definition. This definition is in ks_wlan.h
so this one must be included before the ks_hostif.h header
file.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/ks7010/ks_hostif.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c
index 2d8f304..d46a955 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -9,15 +9,12 @@
  *   published by the Free Software Foundation.
  */
 
-#include "ks_wlan.h"
-#include "ks_hostif.h"
-#include "eap_packet.h"
-#include "michael_mic.h"
-
-#include <linux/etherdevice.h>
-#include <linux/if_ether.h>
 #include <linux/if_arp.h>
 #include <net/iw_handler.h>
+#include "eap_packet.h"
+#include "ks_wlan.h"
+#include "michael_mic.h"
+#include "ks_hostif.h"
 
 static inline void inc_smeqhead(struct ks_wlan_private *priv)
 {
-- 
2.7.4

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

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

* [PATCH 23/24] staging: ks7010: use IW_HANDLER macro in ks_wlan_handler
  2018-04-23 13:44 [PATCH 00/24] staging: ks7010: remaining cleanups from previous series Sergio Paracuellos
                   ` (21 preceding siblings ...)
  2018-04-23 13:44 ` [PATCH 22/24] staging: ks7010: review includes of ks_hostif file Sergio Paracuellos
@ 2018-04-23 13:44 ` Sergio Paracuellos
  2018-04-23 13:44 ` [PATCH 24/24] staging: ks7010: remove KSC_OPNOTSUPP related code Sergio Paracuellos
  23 siblings, 0 replies; 25+ messages in thread
From: Sergio Paracuellos @ 2018-04-23 13:44 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, wsa

This commit make use of IW_HANDLER to set wext operations
of the device. Using this, comments are not neccessary anymore
and also NULL entries so readability is clearly increased.
In order to avoid casting because of the use of a different
prototype in all related functions, those which are affected
have been updated also to make use of the  union iwreq_data
as third parameter updating code accordly.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/ks7010/ks_wlan_net.c | 446 +++++++++++++++++------------------
 1 file changed, 213 insertions(+), 233 deletions(-)

diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c
index 76ed4ed9..05cdeb1 100644
--- a/drivers/staging/ks7010/ks_wlan_net.c
+++ b/drivers/staging/ks7010/ks_wlan_net.c
@@ -160,7 +160,8 @@ int ks_wlan_setup_parameter(struct ks_wlan_private *priv,
  */
 
 static int ks_wlan_get_name(struct net_device *dev,
-			    struct iw_request_info *info, char *cwrq,
+			    struct iw_request_info *info,
+			    union iwreq_data *cwrq,
 			    char *extra)
 {
 	struct ks_wlan_private *priv = netdev_priv(dev);
@@ -170,20 +171,20 @@ static int ks_wlan_get_name(struct net_device *dev,
 
 	/* for SLEEP MODE */
 	if (priv->dev_state < DEVICE_STATE_READY)
-		strcpy(cwrq, "NOT READY!");
+		strcpy(cwrq->name, "NOT READY!");
 	else if (priv->reg.phy_type == D_11B_ONLY_MODE)
-		strcpy(cwrq, "IEEE 802.11b");
+		strcpy(cwrq->name, "IEEE 802.11b");
 	else if (priv->reg.phy_type == D_11G_ONLY_MODE)
-		strcpy(cwrq, "IEEE 802.11g");
+		strcpy(cwrq->name, "IEEE 802.11g");
 	else
-		strcpy(cwrq, "IEEE 802.11b/g");
+		strcpy(cwrq->name, "IEEE 802.11b/g");
 
 	return 0;
 }
 
 static int ks_wlan_set_freq(struct net_device *dev,
-			    struct iw_request_info *info, struct iw_freq *fwrq,
-			    char *extra)
+			    struct iw_request_info *info,
+			    union iwreq_data *fwrq, char *extra)
 {
 	struct ks_wlan_private *priv = netdev_priv(dev);
 	int channel;
@@ -193,28 +194,28 @@ static int ks_wlan_set_freq(struct net_device *dev,
 
 	/* for SLEEP MODE */
 	/* If setting by frequency, convert to a channel */
-	if ((fwrq->e == 1) &&
-	    (fwrq->m >= (int)2.412e8) && (fwrq->m <= (int)2.487e8)) {
-		int f = fwrq->m / 100000;
+	if ((fwrq->freq.e == 1) &&
+	    (fwrq->freq.m >= (int)2.412e8) && (fwrq->freq.m <= (int)2.487e8)) {
+		int f = fwrq->freq.m / 100000;
 		int c = 0;
 
 		while ((c < 14) && (f != frequency_list[c]))
 			c++;
 		/* Hack to fall through... */
-		fwrq->e = 0;
-		fwrq->m = c + 1;
+		fwrq->freq.e = 0;
+		fwrq->freq.m = c + 1;
 	}
 	/* Setting by channel number */
-	if ((fwrq->m > 1000) || (fwrq->e > 0))
+	if ((fwrq->freq.m > 1000) || (fwrq->freq.e > 0))
 		return -EOPNOTSUPP;
 
-	channel = fwrq->m;
+	channel = fwrq->freq.m;
 	/* We should do a better check than that,
 	 * based on the card capability !!!
 	 */
 	if ((channel < 1) || (channel > 14)) {
 		netdev_dbg(dev, "%s: New channel value of %d is invalid!\n",
-			   dev->name, fwrq->m);
+			   dev->name, fwrq->freq.m);
 		return -EINVAL;
 	}
 
@@ -226,8 +227,8 @@ static int ks_wlan_set_freq(struct net_device *dev,
 }
 
 static int ks_wlan_get_freq(struct net_device *dev,
-			    struct iw_request_info *info, struct iw_freq *fwrq,
-			    char *extra)
+			    struct iw_request_info *info,
+			    union iwreq_data *fwrq, char *extra)
 {
 	struct ks_wlan_private *priv = netdev_priv(dev);
 	int f;
@@ -241,15 +242,15 @@ static int ks_wlan_get_freq(struct net_device *dev,
 	else
 		f = (int)priv->reg.channel;
 
-	fwrq->m = frequency_list[f - 1] * 100000;
-	fwrq->e = 1;
+	fwrq->freq.m = frequency_list[f - 1] * 100000;
+	fwrq->freq.e = 1;
 
 	return 0;
 }
 
 static int ks_wlan_set_essid(struct net_device *dev,
 			     struct iw_request_info *info,
-			     struct iw_point *dwrq, char *extra)
+			     union iwreq_data *dwrq, char *extra)
 {
 	struct ks_wlan_private *priv = netdev_priv(dev);
 	size_t len;
@@ -259,12 +260,12 @@ static int ks_wlan_set_essid(struct net_device *dev,
 
 	/* for SLEEP MODE */
 	/* Check if we asked for `any' */
-	if (!dwrq->flags) {
+	if (!dwrq->essid.flags) {
 		/* Just send an empty SSID list */
 		memset(priv->reg.ssid.body, 0, sizeof(priv->reg.ssid.body));
 		priv->reg.ssid.size = 0;
 	} else {
-		len = dwrq->length;
+		len = dwrq->essid.length;
 		/* iwconfig uses nul termination in SSID.. */
 		if (len > 0 && extra[len - 1] == '\0')
 			len--;
@@ -288,7 +289,7 @@ static int ks_wlan_set_essid(struct net_device *dev,
 
 static int ks_wlan_get_essid(struct net_device *dev,
 			     struct iw_request_info *info,
-			     struct iw_point *dwrq, char *extra)
+			     union iwreq_data *dwrq, char *extra)
 {
 	struct ks_wlan_private *priv = netdev_priv(dev);
 
@@ -306,18 +307,18 @@ static int ks_wlan_get_essid(struct net_device *dev,
 		/* If none, we may want to get the one that was set */
 
 		/* Push it out ! */
-		dwrq->length = priv->reg.ssid.size;
-		dwrq->flags = 1;	/* active */
+		dwrq->essid.length = priv->reg.ssid.size;
+		dwrq->essid.flags = 1;	/* active */
 	} else {
-		dwrq->length = 0;
-		dwrq->flags = 0;	/* ANY */
+		dwrq->essid.length = 0;
+		dwrq->essid.flags = 0;	/* ANY */
 	}
 
 	return 0;
 }
 
 static int ks_wlan_set_wap(struct net_device *dev, struct iw_request_info *info,
-			   struct sockaddr *ap_addr, char *extra)
+			   union iwreq_data *awrq, char *extra)
 {
 	struct ks_wlan_private *priv = netdev_priv(dev);
 
@@ -327,7 +328,7 @@ static int ks_wlan_set_wap(struct net_device *dev, struct iw_request_info *info,
 	/* for SLEEP MODE */
 	if (priv->reg.operation_mode == MODE_ADHOC ||
 	    priv->reg.operation_mode == MODE_INFRASTRUCTURE) {
-		memcpy(priv->reg.bssid, &ap_addr->sa_data, ETH_ALEN);
+		memcpy(priv->reg.bssid, &awrq->ap_addr.sa_data, ETH_ALEN);
 
 		if (is_valid_ether_addr((u8 *)priv->reg.bssid))
 			priv->need_commit |= SME_MODE_SET;
@@ -348,7 +349,7 @@ static int ks_wlan_set_wap(struct net_device *dev, struct iw_request_info *info,
 }
 
 static int ks_wlan_get_wap(struct net_device *dev, struct iw_request_info *info,
-			   struct sockaddr *awrq, char *extra)
+			   union iwreq_data *awrq, char *extra)
 {
 	struct ks_wlan_private *priv = netdev_priv(dev);
 
@@ -357,18 +358,18 @@ static int ks_wlan_get_wap(struct net_device *dev, struct iw_request_info *info,
 
 	/* for SLEEP MODE */
 	if (is_connect_status(priv->connect_status))
-		memcpy(awrq->sa_data, priv->current_ap.bssid, ETH_ALEN);
+		memcpy(awrq->ap_addr.sa_data, priv->current_ap.bssid, ETH_ALEN);
 	else
-		eth_zero_addr(awrq->sa_data);
+		eth_zero_addr(awrq->ap_addr.sa_data);
 
-	awrq->sa_family = ARPHRD_ETHER;
+	awrq->ap_addr.sa_family = ARPHRD_ETHER;
 
 	return 0;
 }
 
 static int ks_wlan_set_nick(struct net_device *dev,
-			    struct iw_request_info *info, struct iw_point *dwrq,
-			    char *extra)
+			    struct iw_request_info *info,
+			    union iwreq_data *dwrq, char *extra)
 {
 	struct ks_wlan_private *priv = netdev_priv(dev);
 
@@ -377,18 +378,18 @@ static int ks_wlan_set_nick(struct net_device *dev,
 
 	/* for SLEEP MODE */
 	/* Check the size of the string */
-	if (dwrq->length > 16 + 1)
+	if (dwrq->data.length > 16 + 1)
 		return -E2BIG;
 
 	memset(priv->nick, 0, sizeof(priv->nick));
-	memcpy(priv->nick, extra, dwrq->length);
+	memcpy(priv->nick, extra, dwrq->data.length);
 
 	return -EINPROGRESS;	/* Call commit handler */
 }
 
 static int ks_wlan_get_nick(struct net_device *dev,
-			    struct iw_request_info *info, struct iw_point *dwrq,
-			    char *extra)
+			    struct iw_request_info *info,
+			    union iwreq_data *dwrq, char *extra)
 {
 	struct ks_wlan_private *priv = netdev_priv(dev);
 
@@ -398,14 +399,14 @@ static int ks_wlan_get_nick(struct net_device *dev,
 	/* for SLEEP MODE */
 	strncpy(extra, priv->nick, 16);
 	extra[16] = '\0';
-	dwrq->length = strlen(extra) + 1;
+	dwrq->data.length = strlen(extra) + 1;
 
 	return 0;
 }
 
 static int ks_wlan_set_rate(struct net_device *dev,
-			    struct iw_request_info *info, struct iw_param *vwrq,
-			    char *extra)
+			    struct iw_request_info *info,
+			    union iwreq_data *vwrq, char *extra)
 {
 	struct ks_wlan_private *priv = netdev_priv(dev);
 	int i = 0;
@@ -415,17 +416,17 @@ static int ks_wlan_set_rate(struct net_device *dev,
 
 	/* for SLEEP MODE */
 	if (priv->reg.phy_type == D_11B_ONLY_MODE) {
-		if (vwrq->fixed == 1) {
-			switch (vwrq->value) {
+		if (vwrq->bitrate.fixed == 1) {
+			switch (vwrq->bitrate.value) {
 			case 11000000:
 			case 5500000:
 				priv->reg.rate_set.body[0] =
-				    (uint8_t)(vwrq->value / 500000);
+				    (uint8_t)(vwrq->bitrate.value / 500000);
 				break;
 			case 2000000:
 			case 1000000:
 				priv->reg.rate_set.body[0] =
-				    ((uint8_t)(vwrq->value / 500000)) |
+				    ((uint8_t)(vwrq->bitrate.value / 500000)) |
 				    BASIC_RATE;
 				break;
 			default:
@@ -434,8 +435,8 @@ static int ks_wlan_set_rate(struct net_device *dev,
 			priv->reg.tx_rate = TX_RATE_FIXED;
 			priv->reg.rate_set.size = 1;
 		} else {	/* vwrq->fixed == 0 */
-			if (vwrq->value > 0) {
-				switch (vwrq->value) {
+			if (vwrq->bitrate.value > 0) {
+				switch (vwrq->bitrate.value) {
 				case 11000000:
 					priv->reg.rate_set.body[3] =
 					    TX_RATE_11M;
@@ -472,15 +473,15 @@ static int ks_wlan_set_rate(struct net_device *dev,
 			}
 		}
 	} else {	/* D_11B_ONLY_MODE or  D_11BG_COMPATIBLE_MODE */
-		if (vwrq->fixed == 1) {
-			switch (vwrq->value) {
+		if (vwrq->bitrate.fixed == 1) {
+			switch (vwrq->bitrate.value) {
 			case 54000000:
 			case 48000000:
 			case 36000000:
 			case 18000000:
 			case 9000000:
 				priv->reg.rate_set.body[0] =
-				    (uint8_t)(vwrq->value / 500000);
+				    (uint8_t)(vwrq->bitrate.value / 500000);
 				break;
 			case 24000000:
 			case 12000000:
@@ -490,7 +491,7 @@ static int ks_wlan_set_rate(struct net_device *dev,
 			case 2000000:
 			case 1000000:
 				priv->reg.rate_set.body[0] =
-				    ((uint8_t)(vwrq->value / 500000)) |
+				    ((uint8_t)(vwrq->bitrate.value / 500000)) |
 				    BASIC_RATE;
 				break;
 			default:
@@ -499,8 +500,8 @@ static int ks_wlan_set_rate(struct net_device *dev,
 			priv->reg.tx_rate = TX_RATE_FIXED;
 			priv->reg.rate_set.size = 1;
 		} else {	/* vwrq->fixed == 0 */
-			if (vwrq->value > 0) {
-				switch (vwrq->value) {
+			if (vwrq->bitrate.value > 0) {
+				switch (vwrq->bitrate.value) {
 				case 54000000:
 					priv->reg.rate_set.body[11] =
 					    TX_RATE_54M;
@@ -522,7 +523,7 @@ static int ks_wlan_set_rate(struct net_device *dev,
 				case 11000000:
 				case 9000000:
 				case 6000000:
-					if (vwrq->value == 24000000) {
+					if (vwrq->bitrate.value == 24000000) {
 						priv->reg.rate_set.body[8] =
 						    TX_RATE_18M;
 						i++;
@@ -541,7 +542,7 @@ static int ks_wlan_set_rate(struct net_device *dev,
 						priv->reg.rate_set.body[3] =
 						    TX_RATE_11M | BASIC_RATE;
 						i++;
-					} else if (vwrq->value == 18000000) {
+					} else if (vwrq->bitrate.value == 18000000) {
 						priv->reg.rate_set.body[7] =
 						    TX_RATE_18M;
 						i++;
@@ -557,7 +558,7 @@ static int ks_wlan_set_rate(struct net_device *dev,
 						priv->reg.rate_set.body[3] =
 						    TX_RATE_11M | BASIC_RATE;
 						i++;
-					} else if (vwrq->value == 12000000) {
+					} else if (vwrq->bitrate.value == 12000000) {
 						priv->reg.rate_set.body[6] =
 						    TX_RATE_9M;
 						i++;
@@ -570,7 +571,7 @@ static int ks_wlan_set_rate(struct net_device *dev,
 						priv->reg.rate_set.body[3] =
 						    TX_RATE_11M | BASIC_RATE;
 						i++;
-					} else if (vwrq->value == 11000000) {
+					} else if (vwrq->bitrate.value == 11000000) {
 						priv->reg.rate_set.body[5] =
 						    TX_RATE_9M;
 						i++;
@@ -580,7 +581,7 @@ static int ks_wlan_set_rate(struct net_device *dev,
 						priv->reg.rate_set.body[3] =
 						    TX_RATE_11M | BASIC_RATE;
 						i++;
-					} else if (vwrq->value == 9000000) {
+					} else if (vwrq->bitrate.value == 9000000) {
 						priv->reg.rate_set.body[4] =
 						    TX_RATE_9M;
 						i++;
@@ -645,8 +646,8 @@ static int ks_wlan_set_rate(struct net_device *dev,
 }
 
 static int ks_wlan_get_rate(struct net_device *dev,
-			    struct iw_request_info *info, struct iw_param *vwrq,
-			    char *extra)
+			    struct iw_request_info *info,
+			    union iwreq_data *vwrq, char *extra)
 {
 	struct ks_wlan_private *priv = netdev_priv(dev);
 
@@ -660,23 +661,23 @@ static int ks_wlan_get_rate(struct net_device *dev,
 	if (!atomic_read(&update_phyinfo))
 		ks_wlan_update_phy_information(priv);
 
-	vwrq->value = ((priv->current_rate) & RATE_MASK) * 500000;
-	vwrq->fixed = (priv->reg.tx_rate == TX_RATE_FIXED) ? 1 : 0;
+	vwrq->bitrate.value = ((priv->current_rate) & RATE_MASK) * 500000;
+	vwrq->bitrate.fixed = (priv->reg.tx_rate == TX_RATE_FIXED) ? 1 : 0;
 
 	return 0;
 }
 
 static int ks_wlan_set_rts(struct net_device *dev, struct iw_request_info *info,
-			   struct iw_param *vwrq, char *extra)
+			   union iwreq_data *vwrq, char *extra)
 {
 	struct ks_wlan_private *priv = netdev_priv(dev);
-	int rthr = vwrq->value;
+	int rthr = vwrq->rts.value;
 
 	if (priv->sleep_mode == SLP_SLEEP)
 		return -EPERM;
 
 	/* for SLEEP MODE */
-	if (vwrq->disabled)
+	if (vwrq->rts.disabled)
 		rthr = 2347;
 	if ((rthr < 0) || (rthr > 2347))
 		return -EINVAL;
@@ -688,7 +689,7 @@ static int ks_wlan_set_rts(struct net_device *dev, struct iw_request_info *info,
 }
 
 static int ks_wlan_get_rts(struct net_device *dev, struct iw_request_info *info,
-			   struct iw_param *vwrq, char *extra)
+			   union iwreq_data *vwrq, char *extra)
 {
 	struct ks_wlan_private *priv = netdev_priv(dev);
 
@@ -696,25 +697,25 @@ static int ks_wlan_get_rts(struct net_device *dev, struct iw_request_info *info,
 		return -EPERM;
 
 	/* for SLEEP MODE */
-	vwrq->value = priv->reg.rts;
-	vwrq->disabled = (vwrq->value >= 2347);
-	vwrq->fixed = 1;
+	vwrq->rts.value = priv->reg.rts;
+	vwrq->rts.disabled = (vwrq->rts.value >= 2347);
+	vwrq->rts.fixed = 1;
 
 	return 0;
 }
 
 static int ks_wlan_set_frag(struct net_device *dev,
-			    struct iw_request_info *info, struct iw_param *vwrq,
-			    char *extra)
+			    struct iw_request_info *info,
+			    union iwreq_data *vwrq, char *extra)
 {
 	struct ks_wlan_private *priv = netdev_priv(dev);
-	int fthr = vwrq->value;
+	int fthr = vwrq->frag.value;
 
 	if (priv->sleep_mode == SLP_SLEEP)
 		return -EPERM;
 
 	/* for SLEEP MODE */
-	if (vwrq->disabled)
+	if (vwrq->frag.disabled)
 		fthr = 2346;
 	if ((fthr < 256) || (fthr > 2346))
 		return -EINVAL;
@@ -727,8 +728,8 @@ static int ks_wlan_set_frag(struct net_device *dev,
 }
 
 static int ks_wlan_get_frag(struct net_device *dev,
-			    struct iw_request_info *info, struct iw_param *vwrq,
-			    char *extra)
+			    struct iw_request_info *info,
+			    union iwreq_data *vwrq, char *extra)
 {
 	struct ks_wlan_private *priv = netdev_priv(dev);
 
@@ -736,16 +737,16 @@ static int ks_wlan_get_frag(struct net_device *dev,
 		return -EPERM;
 
 	/* for SLEEP MODE */
-	vwrq->value = priv->reg.fragment;
-	vwrq->disabled = (vwrq->value >= 2346);
-	vwrq->fixed = 1;
+	vwrq->frag.value = priv->reg.fragment;
+	vwrq->frag.disabled = (vwrq->frag.value >= 2346);
+	vwrq->frag.fixed = 1;
 
 	return 0;
 }
 
 static int ks_wlan_set_mode(struct net_device *dev,
-			    struct iw_request_info *info, __u32 *uwrq,
-			    char *extra)
+			    struct iw_request_info *info,
+			    union iwreq_data *uwrq, char *extra)
 {
 	struct ks_wlan_private *priv = netdev_priv(dev);
 
@@ -753,7 +754,7 @@ static int ks_wlan_set_mode(struct net_device *dev,
 		return -EPERM;
 
 	/* for SLEEP MODE */
-	switch (*uwrq) {
+	switch (uwrq->mode) {
 	case IW_MODE_ADHOC:
 		priv->reg.operation_mode = MODE_ADHOC;
 		priv->need_commit |= SME_MODE_SET;
@@ -775,8 +776,8 @@ static int ks_wlan_set_mode(struct net_device *dev,
 }
 
 static int ks_wlan_get_mode(struct net_device *dev,
-			    struct iw_request_info *info, __u32 *uwrq,
-			    char *extra)
+			    struct iw_request_info *info,
+			    union iwreq_data *uwrq, char *extra)
 {
 	struct ks_wlan_private *priv = netdev_priv(dev);
 
@@ -787,13 +788,13 @@ static int ks_wlan_get_mode(struct net_device *dev,
 	/* If not managed, assume it's ad-hoc */
 	switch (priv->reg.operation_mode) {
 	case MODE_INFRASTRUCTURE:
-		*uwrq = IW_MODE_INFRA;
+		uwrq->mode = IW_MODE_INFRA;
 		break;
 	case MODE_ADHOC:
-		*uwrq = IW_MODE_ADHOC;
+		uwrq->mode = IW_MODE_ADHOC;
 		break;
 	default:
-		*uwrq = IW_MODE_ADHOC;
+		uwrq->mode = IW_MODE_ADHOC;
 	}
 
 	return 0;
@@ -801,16 +802,17 @@ static int ks_wlan_get_mode(struct net_device *dev,
 
 static int ks_wlan_set_encode(struct net_device *dev,
 			      struct iw_request_info *info,
-			      struct iw_point *dwrq, char *extra)
+			      union iwreq_data *dwrq, char *extra)
 {
 	struct ks_wlan_private *priv = netdev_priv(dev);
+	struct iw_point *enc = &dwrq->encoding;
 	struct wep_key key;
-	int index = (dwrq->flags & IW_ENCODE_INDEX);
+	int index = (enc->flags & IW_ENCODE_INDEX);
 
 	if (priv->sleep_mode == SLP_SLEEP)
 		return -EPERM;
 
-	if (dwrq->length > MAX_KEY_SIZE)
+	if (enc->length > MAX_KEY_SIZE)
 		return -EINVAL;
 
 	/* for SLEEP MODE */
@@ -821,21 +823,21 @@ static int ks_wlan_set_encode(struct net_device *dev,
 
 	/* Is WEP supported ? */
 	/* Basic checking: do we have a key to set ? */
-	if (dwrq->length > 0) {
-		key.len = (dwrq->length > MIN_KEY_SIZE) ?
+	if (enc->length > 0) {
+		key.len = (enc->length > MIN_KEY_SIZE) ?
 			   MAX_KEY_SIZE : MIN_KEY_SIZE;
 		priv->reg.privacy_invoked = 0x01;
 		priv->need_commit |= SME_WEP_FLAG;
-		wep_on_off = (dwrq->length > MIN_KEY_SIZE) ?
+		wep_on_off = (enc->length > MIN_KEY_SIZE) ?
 			      WEP_ON_128BIT : WEP_ON_64BIT;
 		/* Check if the key is not marked as invalid */
-		if (dwrq->flags & IW_ENCODE_NOKEY)
+		if (enc->flags & IW_ENCODE_NOKEY)
 			return 0;
 
 		/* Cleanup */
 		memset(key.key, 0, MAX_KEY_SIZE);
 		/* Copy the key in the driver */
-		if (copy_from_user(key.key, dwrq->pointer, dwrq->length)) {
+		if (copy_from_user(key.key, enc->pointer, enc->length)) {
 			key.len = 0;
 			return -EFAULT;
 		}
@@ -847,7 +849,7 @@ static int ks_wlan_set_encode(struct net_device *dev,
 		priv->reg.wep_index = index;
 		priv->need_commit |= SME_WEP_INDEX;
 	} else {
-		if (dwrq->flags & IW_ENCODE_DISABLED) {
+		if (enc->flags & IW_ENCODE_DISABLED) {
 			priv->reg.wep_key[0].size = 0;
 			priv->reg.wep_key[1].size = 0;
 			priv->reg.wep_key[2].size = 0;
@@ -869,15 +871,15 @@ static int ks_wlan_set_encode(struct net_device *dev,
 	}
 
 	/* Commit the changes if needed */
-	if (dwrq->flags & IW_ENCODE_MODE)
+	if (enc->flags & IW_ENCODE_MODE)
 		priv->need_commit |= SME_WEP_FLAG;
 
-	if (dwrq->flags & IW_ENCODE_OPEN) {
+	if (enc->flags & IW_ENCODE_OPEN) {
 		if (priv->reg.authenticate_type == AUTH_TYPE_SHARED_KEY)
 			priv->need_commit |= SME_MODE_SET;
 
 		priv->reg.authenticate_type = AUTH_TYPE_OPEN_SYSTEM;
-	} else if (dwrq->flags & IW_ENCODE_RESTRICTED) {
+	} else if (enc->flags & IW_ENCODE_RESTRICTED) {
 		if (priv->reg.authenticate_type == AUTH_TYPE_OPEN_SYSTEM)
 			priv->need_commit |= SME_MODE_SET;
 
@@ -892,24 +894,25 @@ static int ks_wlan_set_encode(struct net_device *dev,
 
 static int ks_wlan_get_encode(struct net_device *dev,
 			      struct iw_request_info *info,
-			      struct iw_point *dwrq, char *extra)
+			      union iwreq_data *dwrq, char *extra)
 {
 	struct ks_wlan_private *priv = netdev_priv(dev);
-	int index = (dwrq->flags & IW_ENCODE_INDEX) - 1;
+	struct iw_point *enc = &dwrq->encoding;
+	int index = (enc->flags & IW_ENCODE_INDEX) - 1;
 
 	if (priv->sleep_mode == SLP_SLEEP)
 		return -EPERM;
 
 	/* for SLEEP MODE */
-	dwrq->flags = IW_ENCODE_DISABLED;
+	enc->flags = IW_ENCODE_DISABLED;
 
 	/* Check encryption mode */
 	switch (priv->reg.authenticate_type) {
 	case AUTH_TYPE_OPEN_SYSTEM:
-		dwrq->flags = IW_ENCODE_OPEN;
+		enc->flags = IW_ENCODE_OPEN;
 		break;
 	case AUTH_TYPE_SHARED_KEY:
-		dwrq->flags = IW_ENCODE_RESTRICTED;
+		enc->flags = IW_ENCODE_RESTRICTED;
 		break;
 	}
 
@@ -917,15 +920,15 @@ static int ks_wlan_get_encode(struct net_device *dev,
 	if ((index < 0) || (index >= 4))
 		index = priv->reg.wep_index;
 	if (priv->reg.privacy_invoked) {
-		dwrq->flags &= ~IW_ENCODE_DISABLED;
+		enc->flags &= ~IW_ENCODE_DISABLED;
 		/* dwrq->flags |= IW_ENCODE_NOKEY; */
 	}
-	dwrq->flags |= index + 1;
+	enc->flags |= index + 1;
 	/* Copy the key to the user buffer */
 	if (index >= 0 && index < 4) {
-		dwrq->length = (priv->reg.wep_key[index].size <= 16) ?
+		enc->length = (priv->reg.wep_key[index].size <= 16) ?
 				priv->reg.wep_key[index].size : 0;
-		memcpy(extra, priv->reg.wep_key[index].val, dwrq->length);
+		memcpy(extra, priv->reg.wep_key[index].val, enc->length);
 	}
 
 	return 0;
@@ -934,52 +937,52 @@ static int ks_wlan_get_encode(struct net_device *dev,
 #ifndef KSC_OPNOTSUPP
 static int ks_wlan_set_txpow(struct net_device *dev,
 			     struct iw_request_info *info,
-			     struct iw_param *vwrq, char *extra)
+			     union iwreq_data *vwrq, char *extra)
 {
 	return -EOPNOTSUPP;	/* Not Support */
 }
 
 static int ks_wlan_get_txpow(struct net_device *dev,
 			     struct iw_request_info *info,
-			     struct iw_param *vwrq, char *extra)
+			     union iwreq_data *vwrq, char *extra)
 {
 	if (priv->sleep_mode == SLP_SLEEP)
 		return -EPERM;
 
 	/* for SLEEP MODE */
 	/* Not Support */
-	vwrq->value = 0;
-	vwrq->disabled = (vwrq->value == 0);
-	vwrq->fixed = 1;
+	vwrq->txpower.value = 0;
+	vwrq->txpower.disabled = (vwrq->txpower.value == 0);
+	vwrq->txpower.fixed = 1;
 	return 0;
 }
 
 static int ks_wlan_set_retry(struct net_device *dev,
 			     struct iw_request_info *info,
-			     struct iw_param *vwrq, char *extra)
+			     union iwreq_data *vwrq, char *extra)
 {
 	return -EOPNOTSUPP;	/* Not Support */
 }
 
 static int ks_wlan_get_retry(struct net_device *dev,
 			     struct iw_request_info *info,
-			     struct iw_param *vwrq, char *extra)
+			     union iwreq_data *vwrq, char *extra)
 {
 	if (priv->sleep_mode == SLP_SLEEP)
 		return -EPERM;
 
 	/* for SLEEP MODE */
 	/* Not Support */
-	vwrq->value = 0;
-	vwrq->disabled = (vwrq->value == 0);
-	vwrq->fixed = 1;
+	vwrq->retry.value = 0;
+	vwrq->retry.disabled = (vwrq->retry.value == 0);
+	vwrq->retry.fixed = 1;
 	return 0;
 }
 #endif /* KSC_OPNOTSUPP */
 
 static int ks_wlan_get_range(struct net_device *dev,
 			     struct iw_request_info *info,
-			     struct iw_point *dwrq, char *extra)
+			     union iwreq_data *dwrq, char *extra)
 {
 	struct ks_wlan_private *priv = netdev_priv(dev);
 	struct iw_range *range = (struct iw_range *)extra;
@@ -989,7 +992,7 @@ static int ks_wlan_get_range(struct net_device *dev,
 		return -EPERM;
 
 	/* for SLEEP MODE */
-	dwrq->length = sizeof(struct iw_range);
+	dwrq->data.length = sizeof(struct iw_range);
 	memset(range, 0, sizeof(*range));
 	range->min_nwid = 0x0000;
 	range->max_nwid = 0x0000;
@@ -1109,14 +1112,14 @@ static int ks_wlan_get_range(struct net_device *dev,
 
 static int ks_wlan_set_power(struct net_device *dev,
 			     struct iw_request_info *info,
-			     struct iw_param *vwrq, char *extra)
+			     union iwreq_data *vwrq, char *extra)
 {
 	struct ks_wlan_private *priv = netdev_priv(dev);
 
 	if (priv->sleep_mode == SLP_SLEEP)
 		return -EPERM;
 
-	if (vwrq->disabled) {
+	if (vwrq->power.disabled) {
 		priv->reg.power_mgmt = POWER_MGMT_ACTIVE;
 	} else {
 		if (priv->reg.operation_mode == MODE_INFRASTRUCTURE)
@@ -1132,7 +1135,7 @@ static int ks_wlan_set_power(struct net_device *dev,
 
 static int ks_wlan_get_power(struct net_device *dev,
 			     struct iw_request_info *info,
-			     struct iw_param *vwrq, char *extra)
+			     union iwreq_data *vwrq, char *extra)
 {
 	struct ks_wlan_private *priv = netdev_priv(dev);
 
@@ -1140,26 +1143,26 @@ static int ks_wlan_get_power(struct net_device *dev,
 		return -EPERM;
 	/* for SLEEP MODE */
 	if (priv->reg.power_mgmt > 0)
-		vwrq->disabled = 0;
+		vwrq->power.disabled = 0;
 	else
-		vwrq->disabled = 1;
+		vwrq->power.disabled = 1;
 
 	return 0;
 }
 
 static int ks_wlan_get_iwstats(struct net_device *dev,
 			       struct iw_request_info *info,
-			       struct iw_quality *vwrq, char *extra)
+			       union iwreq_data *vwrq, char *extra)
 {
 	struct ks_wlan_private *priv = netdev_priv(dev);
 
 	if (priv->sleep_mode == SLP_SLEEP)
 		return -EPERM;
 	/* for SLEEP MODE */
-	vwrq->qual = 0;	/* not supported */
-	vwrq->level = priv->wstats.qual.level;
-	vwrq->noise = 0;	/* not supported */
-	vwrq->updated = 0;
+	vwrq->qual.qual = 0;	/* not supported */
+	vwrq->qual.level = priv->wstats.qual.level;
+	vwrq->qual.noise = 0;	/* not supported */
+	vwrq->qual.updated = 0;
 
 	return 0;
 }
@@ -1167,20 +1170,20 @@ static int ks_wlan_get_iwstats(struct net_device *dev,
 #ifndef KSC_OPNOTSUPP
 
 static int ks_wlan_set_sens(struct net_device *dev,
-			    struct iw_request_info *info, struct iw_param *vwrq,
-			    char *extra)
+			    struct iw_request_info *info,
+			    union iwreq_data *vwrq, char *extra)
 {
 	return -EOPNOTSUPP;	/* Not Support */
 }
 
 static int ks_wlan_get_sens(struct net_device *dev,
-			    struct iw_request_info *info, struct iw_param *vwrq,
-			    char *extra)
+			    struct iw_request_info *info,
+			    union iwreq_data *vwrq, char *extra)
 {
 	/* Not Support */
-	vwrq->value = 0;
-	vwrq->disabled = (vwrq->value == 0);
-	vwrq->fixed = 1;
+	vwrq->sens.value = 0;
+	vwrq->sens.disabled = (vwrq->sens.value == 0);
+	vwrq->sens.fixed = 1;
 	return 0;
 }
 #endif /* KSC_OPNOTSUPP */
@@ -1188,7 +1191,7 @@ static int ks_wlan_get_sens(struct net_device *dev,
 /* Note : this is deprecated in favor of IWSCAN */
 static int ks_wlan_get_aplist(struct net_device *dev,
 			      struct iw_request_info *info,
-			      struct iw_point *dwrq, char *extra)
+			      union iwreq_data *dwrq, char *extra)
 {
 	struct ks_wlan_private *priv = netdev_priv(dev);
 	struct sockaddr *address = (struct sockaddr *)extra;
@@ -1209,11 +1212,11 @@ static int ks_wlan_get_aplist(struct net_device *dev,
 		qual[i].updated = 7;
 	}
 	if (i) {
-		dwrq->flags = 1;	/* Should be define'd */
+		dwrq->data.flags = 1;	/* Should be define'd */
 		memcpy(extra + sizeof(struct sockaddr) * i,
 		       &qual, sizeof(struct iw_quality) * i);
 	}
-	dwrq->length = i;
+	dwrq->data.length = i;
 
 	return 0;
 }
@@ -1410,8 +1413,8 @@ static inline char *ks_wlan_translate_scan(struct net_device *dev,
 }
 
 static int ks_wlan_get_scan(struct net_device *dev,
-			    struct iw_request_info *info, struct iw_point *dwrq,
-			    char *extra)
+			    struct iw_request_info *info,
+			    union iwreq_data *dwrq, char *extra)
 {
 	struct ks_wlan_private *priv = netdev_priv(dev);
 	int i;
@@ -1432,25 +1435,26 @@ static int ks_wlan_get_scan(struct net_device *dev,
 
 	/* Read and parse all entries */
 	for (i = 0; i < priv->aplist.size; i++) {
-		if ((extra + dwrq->length) - current_ev <= IW_EV_ADDR_LEN) {
-			dwrq->length = 0;
+		if ((extra + dwrq->data.length) - current_ev <= IW_EV_ADDR_LEN) {
+			dwrq->data.length = 0;
 			return -E2BIG;
 		}
 		/* Translate to WE format this entry */
 		current_ev = ks_wlan_translate_scan(dev, info, current_ev,
-						    extra + dwrq->length,
+						    extra + dwrq->data.length,
 						    &priv->aplist.ap[i]);
 	}
 	/* Length of data */
-	dwrq->length = (current_ev - extra);
-	dwrq->flags = 0;
+	dwrq->data.length = (current_ev - extra);
+	dwrq->data.flags = 0;
 
 	return 0;
 }
 
 /* called after a bunch of SET operations */
 static int ks_wlan_config_commit(struct net_device *dev,
-				 struct iw_request_info *info, void *zwrq,
+				 struct iw_request_info *info,
+				 union iwreq_data *zwrq,
 				 char *extra)
 {
 	struct ks_wlan_private *priv = netdev_priv(dev);
@@ -1466,7 +1470,7 @@ static int ks_wlan_config_commit(struct net_device *dev,
 /* set association ie params */
 static int ks_wlan_set_genie(struct net_device *dev,
 			     struct iw_request_info *info,
-			     struct iw_point *dwrq, char *extra)
+			     union iwreq_data *dwrq, char *extra)
 {
 	struct ks_wlan_private *priv = netdev_priv(dev);
 
@@ -1479,11 +1483,12 @@ static int ks_wlan_set_genie(struct net_device *dev,
 
 static int ks_wlan_set_auth_mode(struct net_device *dev,
 				 struct iw_request_info *info,
-				 struct iw_param *vwrq, char *extra)
+				 union iwreq_data *vwrq, char *extra)
 {
 	struct ks_wlan_private *priv = netdev_priv(dev);
-	int index = (vwrq->flags & IW_AUTH_INDEX);
-	int value = vwrq->value;
+	struct iw_param *param = &vwrq->param;
+	int index = (param->flags & IW_AUTH_INDEX);
+	int value = param->value;
 
 	if (priv->sleep_mode == SLP_SLEEP)
 		return -EPERM;
@@ -1611,10 +1616,11 @@ static int ks_wlan_set_auth_mode(struct net_device *dev,
 
 static int ks_wlan_get_auth_mode(struct net_device *dev,
 				 struct iw_request_info *info,
-				 struct iw_param *vwrq, char *extra)
+				 union iwreq_data *vwrq, char *extra)
 {
 	struct ks_wlan_private *priv = netdev_priv(dev);
-	int index = (vwrq->flags & IW_AUTH_INDEX);
+	struct iw_param *param = &vwrq->param;
+	int index = (param->flags & IW_AUTH_INDEX);
 
 	if (priv->sleep_mode == SLP_SLEEP)
 		return -EPERM;
@@ -1623,22 +1629,22 @@ static int ks_wlan_get_auth_mode(struct net_device *dev,
 	/*  WPA (not used ?? wpa_supplicant) */
 	switch (index) {
 	case IW_AUTH_WPA_VERSION:
-		vwrq->value = priv->wpa.version;
+		param->value = priv->wpa.version;
 		break;
 	case IW_AUTH_CIPHER_PAIRWISE:
-		vwrq->value = priv->wpa.pairwise_suite;
+		param->value = priv->wpa.pairwise_suite;
 		break;
 	case IW_AUTH_CIPHER_GROUP:
-		vwrq->value = priv->wpa.group_suite;
+		param->value = priv->wpa.group_suite;
 		break;
 	case IW_AUTH_KEY_MGMT:
-		vwrq->value = priv->wpa.key_mgmt_suite;
+		param->value = priv->wpa.key_mgmt_suite;
 		break;
 	case IW_AUTH_80211_AUTH_ALG:
-		vwrq->value = priv->wpa.auth_alg;
+		param->value = priv->wpa.auth_alg;
 		break;
 	case IW_AUTH_WPA_ENABLED:
-		vwrq->value = priv->wpa.rsn_enabled;
+		param->value = priv->wpa.rsn_enabled;
 		break;
 	case IW_AUTH_RX_UNENCRYPTED_EAPOL:	/* OK??? */
 	case IW_AUTH_TKIP_COUNTERMEASURES:
@@ -1653,11 +1659,11 @@ static int ks_wlan_get_auth_mode(struct net_device *dev,
 /* set encoding token & mode (WPA)*/
 static int ks_wlan_set_encode_ext(struct net_device *dev,
 				  struct iw_request_info *info,
-				  struct iw_point *dwrq, char *extra)
+				  union iwreq_data *dwrq, char *extra)
 {
 	struct ks_wlan_private *priv = netdev_priv(dev);
 	struct iw_encode_ext *enc;
-	int index = dwrq->flags & IW_ENCODE_INDEX;
+	int index = dwrq->encoding.flags & IW_ENCODE_INDEX;
 	unsigned int commit = 0;
 	struct wpa_key *key;
 
@@ -1674,7 +1680,7 @@ static int ks_wlan_set_encode_ext(struct net_device *dev,
 	index--;
 	key = &priv->wpa.key[index];
 
-	if (dwrq->flags & IW_ENCODE_DISABLED)
+	if (dwrq->encoding.flags & IW_ENCODE_DISABLED)
 		key->key_len = 0;
 
 	key->ext_flags = enc->ext_flags;
@@ -1746,7 +1752,7 @@ static int ks_wlan_set_encode_ext(struct net_device *dev,
 /* get encoding token & mode (WPA)*/
 static int ks_wlan_get_encode_ext(struct net_device *dev,
 				  struct iw_request_info *info,
-				  struct iw_point *dwrq, char *extra)
+				  union iwreq_data *dwrq, char *extra)
 {
 	struct ks_wlan_private *priv = netdev_priv(dev);
 
@@ -1766,7 +1772,7 @@ static int ks_wlan_get_encode_ext(struct net_device *dev,
 
 static int ks_wlan_set_pmksa(struct net_device *dev,
 			     struct iw_request_info *info,
-			     struct iw_point *dwrq, char *extra)
+			     union iwreq_data *dwrq, char *extra)
 {
 	struct ks_wlan_private *priv = netdev_priv(dev);
 	struct iw_pmksa *pmksa;
@@ -1906,8 +1912,8 @@ static int ks_wlan_set_stop_request(struct net_device *dev,
 
 #include <linux/ieee80211.h>
 static int ks_wlan_set_mlme(struct net_device *dev,
-			    struct iw_request_info *info, struct iw_point *dwrq,
-			    char *extra)
+			    struct iw_request_info *info,
+			    union iwreq_data *dwrq, char *extra)
 {
 	struct ks_wlan_private *priv = netdev_priv(dev);
 	struct iw_mlme *mlme = (struct iw_mlme *)extra;
@@ -2528,76 +2534,50 @@ static const struct iw_priv_args ks_wlan_private_args[] = {
 };
 
 static const iw_handler ks_wlan_handler[] = {
-	(iw_handler)ks_wlan_config_commit,	/* SIOCSIWCOMMIT */
-	(iw_handler)ks_wlan_get_name,	/* SIOCGIWNAME */
-	(iw_handler)NULL,	/* SIOCSIWNWID */
-	(iw_handler)NULL,	/* SIOCGIWNWID */
-	(iw_handler)ks_wlan_set_freq,	/* SIOCSIWFREQ */
-	(iw_handler)ks_wlan_get_freq,	/* SIOCGIWFREQ */
-	(iw_handler)ks_wlan_set_mode,	/* SIOCSIWMODE */
-	(iw_handler)ks_wlan_get_mode,	/* SIOCGIWMODE */
+	IW_HANDLER(SIOCSIWCOMMIT, ks_wlan_config_commit),
+	IW_HANDLER(SIOCGIWNAME, ks_wlan_get_name),
+	IW_HANDLER(SIOCSIWFREQ, ks_wlan_set_freq),
+	IW_HANDLER(SIOCGIWFREQ, ks_wlan_get_freq),
+	IW_HANDLER(SIOCSIWMODE, ks_wlan_set_mode),
+	IW_HANDLER(SIOCGIWMODE, ks_wlan_get_mode),
 #ifndef KSC_OPNOTSUPP
-	(iw_handler)ks_wlan_set_sens,	/* SIOCSIWSENS */
-	(iw_handler)ks_wlan_get_sens,	/* SIOCGIWSENS */
-#else /* KSC_OPNOTSUPP */
-	(iw_handler)NULL,	/* SIOCSIWSENS */
-	(iw_handler)NULL,	/* SIOCGIWSENS */
+	IW_HANDLER(SIOCSIWSENS, ks_wlan_set_sens),
+	IW_HANDLER(SIOCGIWSENS, ks_wlan_get_sens),
 #endif /* KSC_OPNOTSUPP */
-	(iw_handler)NULL,	/* SIOCSIWRANGE */
-	(iw_handler)ks_wlan_get_range,	/* SIOCGIWRANGE */
-	(iw_handler)NULL,	/* SIOCSIWPRIV */
-	(iw_handler)NULL,	/* SIOCGIWPRIV */
-	(iw_handler)NULL,	/* SIOCSIWSTATS */
-	(iw_handler)ks_wlan_get_iwstats,	/* SIOCGIWSTATS */
-	(iw_handler)NULL,	/* SIOCSIWSPY */
-	(iw_handler)NULL,	/* SIOCGIWSPY */
-	(iw_handler)NULL,	/* SIOCSIWTHRSPY */
-	(iw_handler)NULL,	/* SIOCGIWTHRSPY */
-	(iw_handler)ks_wlan_set_wap,	/* SIOCSIWAP */
-	(iw_handler)ks_wlan_get_wap,	/* SIOCGIWAP */
-//      (iw_handler)NULL,                      /* SIOCSIWMLME */
-	(iw_handler)ks_wlan_set_mlme,	/* SIOCSIWMLME */
-	(iw_handler)ks_wlan_get_aplist,	/* SIOCGIWAPLIST */
-	(iw_handler)ks_wlan_set_scan,	/* SIOCSIWSCAN */
-	(iw_handler)ks_wlan_get_scan,	/* SIOCGIWSCAN */
-	(iw_handler)ks_wlan_set_essid,	/* SIOCSIWESSID */
-	(iw_handler)ks_wlan_get_essid,	/* SIOCGIWESSID */
-	(iw_handler)ks_wlan_set_nick,	/* SIOCSIWNICKN */
-	(iw_handler)ks_wlan_get_nick,	/* SIOCGIWNICKN */
-	(iw_handler)NULL,	/* -- hole -- */
-	(iw_handler)NULL,	/* -- hole -- */
-	(iw_handler)ks_wlan_set_rate,	/* SIOCSIWRATE */
-	(iw_handler)ks_wlan_get_rate,	/* SIOCGIWRATE */
-	(iw_handler)ks_wlan_set_rts,	/* SIOCSIWRTS */
-	(iw_handler)ks_wlan_get_rts,	/* SIOCGIWRTS */
-	(iw_handler)ks_wlan_set_frag,	/* SIOCSIWFRAG */
-	(iw_handler)ks_wlan_get_frag,	/* SIOCGIWFRAG */
+	IW_HANDLER(SIOCGIWRANGE, ks_wlan_get_range),
+	IW_HANDLER(SIOCGIWSTATS, ks_wlan_get_iwstats),
+	IW_HANDLER(SIOCSIWAP, ks_wlan_set_wap),
+	IW_HANDLER(SIOCGIWAP, ks_wlan_get_wap),
+	IW_HANDLER(SIOCSIWMLME, ks_wlan_set_mlme),
+	IW_HANDLER(SIOCGIWAPLIST, ks_wlan_get_aplist),
+	IW_HANDLER(SIOCSIWSCAN, ks_wlan_set_scan),
+	IW_HANDLER(SIOCGIWSCAN, ks_wlan_get_scan),
+	IW_HANDLER(SIOCSIWESSID, ks_wlan_set_essid),
+	IW_HANDLER(SIOCGIWESSID, ks_wlan_get_essid),
+	IW_HANDLER(SIOCSIWNICKN, ks_wlan_set_nick),
+	IW_HANDLER(SIOCGIWNICKN, ks_wlan_get_nick),
+	IW_HANDLER(SIOCSIWRATE, ks_wlan_set_rate),
+	IW_HANDLER(SIOCGIWRATE, ks_wlan_get_rate),
+	IW_HANDLER(SIOCSIWRTS, ks_wlan_set_rts),
+	IW_HANDLER(SIOCGIWRTS, ks_wlan_get_rts),
+	IW_HANDLER(SIOCSIWFRAG, ks_wlan_set_frag),
+	IW_HANDLER(SIOCGIWFRAG, ks_wlan_get_frag),
 #ifndef KSC_OPNOTSUPP
-	(iw_handler)ks_wlan_set_txpow,	/* SIOCSIWTXPOW */
-	(iw_handler)ks_wlan_get_txpow,	/* SIOCGIWTXPOW */
-	(iw_handler)ks_wlan_set_retry,	/* SIOCSIWRETRY */
-	(iw_handler)ks_wlan_get_retry,	/* SIOCGIWRETRY */
-#else /* KSC_OPNOTSUPP */
-	(iw_handler)NULL,	/* SIOCSIWTXPOW */
-	(iw_handler)NULL,	/* SIOCGIWTXPOW */
-	(iw_handler)NULL,	/* SIOCSIWRETRY */
-	(iw_handler)NULL,	/* SIOCGIWRETRY */
+	IW_HANDLER(SIOCSIWTXPOW, ks_wlan_set_txpow),
+	IW_HANDLER(SIOCGIWTXPOW, ks_wlan_get_txpow),
+	IW_HANDLER(SIOCSIWRETRY, ks_wlan_set_retry),
+	IW_HANDLER(SIOCGIWRETRY, ks_wlan_get_retry),
 #endif /* KSC_OPNOTSUPP */
-	(iw_handler)ks_wlan_set_encode,	/* SIOCSIWENCODE */
-	(iw_handler)ks_wlan_get_encode,	/* SIOCGIWENCODE */
-	(iw_handler)ks_wlan_set_power,	/* SIOCSIWPOWER */
-	(iw_handler)ks_wlan_get_power,	/* SIOCGIWPOWER */
-	(iw_handler)NULL,	/* -- hole -- */
-	(iw_handler)NULL,	/* -- hole -- */
-//      (iw_handler)NULL,                      /* SIOCSIWGENIE */
-	(iw_handler)ks_wlan_set_genie,	/* SIOCSIWGENIE */
-	(iw_handler)NULL,	/* SIOCGIWGENIE */
-	(iw_handler)ks_wlan_set_auth_mode,	/* SIOCSIWAUTH */
-	(iw_handler)ks_wlan_get_auth_mode,	/* SIOCGIWAUTH */
-	(iw_handler)ks_wlan_set_encode_ext,	/* SIOCSIWENCODEEXT */
-	(iw_handler)ks_wlan_get_encode_ext,	/* SIOCGIWENCODEEXT */
-	(iw_handler)ks_wlan_set_pmksa,	/* SIOCSIWPMKSA */
-	(iw_handler)NULL,	/* -- hole -- */
+	IW_HANDLER(SIOCSIWENCODE, ks_wlan_set_encode),
+	IW_HANDLER(SIOCGIWENCODE, ks_wlan_get_encode),
+	IW_HANDLER(SIOCSIWPOWER, ks_wlan_set_power),
+	IW_HANDLER(SIOCGIWPOWER, ks_wlan_get_power),
+	IW_HANDLER(SIOCSIWGENIE, ks_wlan_set_genie),
+	IW_HANDLER(SIOCSIWAUTH, ks_wlan_set_auth_mode),
+	IW_HANDLER(SIOCGIWAUTH, ks_wlan_get_auth_mode),
+	IW_HANDLER(SIOCSIWENCODEEXT, ks_wlan_set_encode_ext),
+	IW_HANDLER(SIOCGIWENCODEEXT, ks_wlan_get_encode_ext),
+	IW_HANDLER(SIOCSIWPMKSA, ks_wlan_set_pmksa),
 };
 
 /* private_handler */
-- 
2.7.4

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

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

* [PATCH 24/24] staging: ks7010: remove KSC_OPNOTSUPP related code
  2018-04-23 13:44 [PATCH 00/24] staging: ks7010: remaining cleanups from previous series Sergio Paracuellos
                   ` (22 preceding siblings ...)
  2018-04-23 13:44 ` [PATCH 23/24] staging: ks7010: use IW_HANDLER macro in ks_wlan_handler Sergio Paracuellos
@ 2018-04-23 13:44 ` Sergio Paracuellos
  23 siblings, 0 replies; 25+ messages in thread
From: Sergio Paracuellos @ 2018-04-23 13:44 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, wsa

This commit reviews KSC_OPNOTSUPP related code. The
preprocessor KSC_OPNOTSUPP is defined by default so
related wext functions are not being used. Just clean
code removing all of this stuff.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/ks7010/ks_wlan_net.c | 79 ------------------------------------
 1 file changed, 79 deletions(-)

diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c
index 05cdeb1..2f79e6a 100644
--- a/drivers/staging/ks7010/ks_wlan_net.c
+++ b/drivers/staging/ks7010/ks_wlan_net.c
@@ -52,8 +52,6 @@ struct wep_key {
 /* List of Wireless Handlers (new API) */
 static const struct iw_handler_def ks_wlan_handler_def;
 
-#define KSC_OPNOTSUPP	/* Operation Not Support */
-
 /*
  *	function prototypes
  */
@@ -934,52 +932,6 @@ static int ks_wlan_get_encode(struct net_device *dev,
 	return 0;
 }
 
-#ifndef KSC_OPNOTSUPP
-static int ks_wlan_set_txpow(struct net_device *dev,
-			     struct iw_request_info *info,
-			     union iwreq_data *vwrq, char *extra)
-{
-	return -EOPNOTSUPP;	/* Not Support */
-}
-
-static int ks_wlan_get_txpow(struct net_device *dev,
-			     struct iw_request_info *info,
-			     union iwreq_data *vwrq, char *extra)
-{
-	if (priv->sleep_mode == SLP_SLEEP)
-		return -EPERM;
-
-	/* for SLEEP MODE */
-	/* Not Support */
-	vwrq->txpower.value = 0;
-	vwrq->txpower.disabled = (vwrq->txpower.value == 0);
-	vwrq->txpower.fixed = 1;
-	return 0;
-}
-
-static int ks_wlan_set_retry(struct net_device *dev,
-			     struct iw_request_info *info,
-			     union iwreq_data *vwrq, char *extra)
-{
-	return -EOPNOTSUPP;	/* Not Support */
-}
-
-static int ks_wlan_get_retry(struct net_device *dev,
-			     struct iw_request_info *info,
-			     union iwreq_data *vwrq, char *extra)
-{
-	if (priv->sleep_mode == SLP_SLEEP)
-		return -EPERM;
-
-	/* for SLEEP MODE */
-	/* Not Support */
-	vwrq->retry.value = 0;
-	vwrq->retry.disabled = (vwrq->retry.value == 0);
-	vwrq->retry.fixed = 1;
-	return 0;
-}
-#endif /* KSC_OPNOTSUPP */
-
 static int ks_wlan_get_range(struct net_device *dev,
 			     struct iw_request_info *info,
 			     union iwreq_data *dwrq, char *extra)
@@ -1167,27 +1119,6 @@ static int ks_wlan_get_iwstats(struct net_device *dev,
 	return 0;
 }
 
-#ifndef KSC_OPNOTSUPP
-
-static int ks_wlan_set_sens(struct net_device *dev,
-			    struct iw_request_info *info,
-			    union iwreq_data *vwrq, char *extra)
-{
-	return -EOPNOTSUPP;	/* Not Support */
-}
-
-static int ks_wlan_get_sens(struct net_device *dev,
-			    struct iw_request_info *info,
-			    union iwreq_data *vwrq, char *extra)
-{
-	/* Not Support */
-	vwrq->sens.value = 0;
-	vwrq->sens.disabled = (vwrq->sens.value == 0);
-	vwrq->sens.fixed = 1;
-	return 0;
-}
-#endif /* KSC_OPNOTSUPP */
-
 /* Note : this is deprecated in favor of IWSCAN */
 static int ks_wlan_get_aplist(struct net_device *dev,
 			      struct iw_request_info *info,
@@ -2540,10 +2471,6 @@ static const iw_handler ks_wlan_handler[] = {
 	IW_HANDLER(SIOCGIWFREQ, ks_wlan_get_freq),
 	IW_HANDLER(SIOCSIWMODE, ks_wlan_set_mode),
 	IW_HANDLER(SIOCGIWMODE, ks_wlan_get_mode),
-#ifndef KSC_OPNOTSUPP
-	IW_HANDLER(SIOCSIWSENS, ks_wlan_set_sens),
-	IW_HANDLER(SIOCGIWSENS, ks_wlan_get_sens),
-#endif /* KSC_OPNOTSUPP */
 	IW_HANDLER(SIOCGIWRANGE, ks_wlan_get_range),
 	IW_HANDLER(SIOCGIWSTATS, ks_wlan_get_iwstats),
 	IW_HANDLER(SIOCSIWAP, ks_wlan_set_wap),
@@ -2562,12 +2489,6 @@ static const iw_handler ks_wlan_handler[] = {
 	IW_HANDLER(SIOCGIWRTS, ks_wlan_get_rts),
 	IW_HANDLER(SIOCSIWFRAG, ks_wlan_set_frag),
 	IW_HANDLER(SIOCGIWFRAG, ks_wlan_get_frag),
-#ifndef KSC_OPNOTSUPP
-	IW_HANDLER(SIOCSIWTXPOW, ks_wlan_set_txpow),
-	IW_HANDLER(SIOCGIWTXPOW, ks_wlan_get_txpow),
-	IW_HANDLER(SIOCSIWRETRY, ks_wlan_set_retry),
-	IW_HANDLER(SIOCGIWRETRY, ks_wlan_get_retry),
-#endif /* KSC_OPNOTSUPP */
 	IW_HANDLER(SIOCSIWENCODE, ks_wlan_set_encode),
 	IW_HANDLER(SIOCGIWENCODE, ks_wlan_get_encode),
 	IW_HANDLER(SIOCSIWPOWER, ks_wlan_set_power),
-- 
2.7.4

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

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

end of thread, other threads:[~2018-04-23 13:45 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-23 13:44 [PATCH 00/24] staging: ks7010: remaining cleanups from previous series Sergio Paracuellos
2018-04-23 13:44 ` [PATCH 01/24] staging: ks7010: avoid casts in michael_mic_function calls Sergio Paracuellos
2018-04-23 13:44 ` [PATCH 02/24] staging: ks7010: move ROM_FILE definition into source file Sergio Paracuellos
2018-04-23 13:44 ` [PATCH 03/24] staging: ks7010: move sdio specific register definitions " Sergio Paracuellos
2018-04-23 13:44 ` [PATCH 04/24] staging: ks7010: delete not used definitions in ks7010_sdio source Sergio Paracuellos
2018-04-23 13:44 ` [PATCH 05/24] staging: ks7010: add REG suffix to sdio register definitions Sergio Paracuellos
2018-04-23 13:44 ` [PATCH 06/24] staging: ks7010: review comment style in ks7010_sdio source file Sergio Paracuellos
2018-04-23 13:44 ` [PATCH 07/24] staging: ks7010: review debug and error messages in ks7010_sdio source Sergio Paracuellos
2018-04-23 13:44 ` [PATCH 08/24] staging: ks7010: avoid one extra level indentation in ks_wlan_hw_rx function Sergio Paracuellos
2018-04-23 13:44 ` [PATCH 09/24] staging: ks7010: move MODULE_DEVICE_TABLE related code Sergio Paracuellos
2018-04-23 13:44 ` [PATCH 10/24] staging: ks7010: replace create_workqueue with alloc_workqueue Sergio Paracuellos
2018-04-23 13:44 ` [PATCH 11/24] staging: ks7010: check sdio_set_block_size return value Sergio Paracuellos
2018-04-23 13:44 ` [PATCH 12/24] staging: ks7010: fix error paths in ks7010_sdio_remove function Sergio Paracuellos
2018-04-23 13:44 ` [PATCH 13/24] staging: ks7010: use u8 instead of unsigned char for firmware buffers Sergio Paracuellos
2018-04-23 13:44 ` [PATCH 14/24] staging: ks7010: assign dev_alloc_name() result to variable before check it Sergio Paracuellos
2018-04-23 13:44 ` [PATCH 15/24] staging: ks7010: change name and type for device_open_status field Sergio Paracuellos
2018-04-23 13:44 ` [PATCH 16/24] staging: ks7010: avoid one level indentation in devio_rec_ind function Sergio Paracuellos
2018-04-23 13:44 ` [PATCH 17/24] staging: ks7010: remove superfluous comments in ks_hostif source file Sergio Paracuellos
2018-04-23 13:44 ` [PATCH 18/24] staging: ks7010: fix warning aout long line in init_request Sergio Paracuellos
2018-04-23 13:44 ` [PATCH 19/24] staging: ks7010: avoid blank line between definitions in hostif_data_request Sergio Paracuellos
2018-04-23 13:44 ` [PATCH 20/24] staging: ks7010: remove two fields of ks_wlan_private struct Sergio Paracuellos
2018-04-23 13:44 ` [PATCH 21/24] staging: ks7010: removes data_buff field " Sergio Paracuellos
2018-04-23 13:44 ` [PATCH 22/24] staging: ks7010: review includes of ks_hostif file Sergio Paracuellos
2018-04-23 13:44 ` [PATCH 23/24] staging: ks7010: use IW_HANDLER macro in ks_wlan_handler Sergio Paracuellos
2018-04-23 13:44 ` [PATCH 24/24] staging: ks7010: remove KSC_OPNOTSUPP related code 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.