All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/27] staging: add driver for KS7010 based SDIO cards
@ 2016-05-10 13:52 Wolfram Sang
  2016-05-10 13:52 ` [PATCH 02/27] staging: ks7010: remove non-SDIO code and #ifdefs Wolfram Sang
                   ` (27 more replies)
  0 siblings, 28 replies; 32+ messages in thread
From: Wolfram Sang @ 2016-05-10 13:52 UTC (permalink / raw)
  To: driverdev-devel; +Cc: Wolfram Sang, linux-renesas-soc

This driver can be used with later Spectec SDW-821 and all SDW-823 cards.
See patch 1 and README for more details about its origin. To have the card
working, you need another patch which is already in mmc/next:

https://patchwork.kernel.org/patch/9043341/

A working topic branch for the Renesas H3 can be found here:

git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git renesas/topic/gen3-sdio

This series only can be found here:

git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git staging/ks7010

Note: I needed this driver to verify SDIO capabilities for the new Renesas H3
SoC. The fact that the original KS7010 driver also comes from Renesas is a
coincidence. It does not mean official support for this driver. Parts of this
work were backed by the above mentioned SDIO verification task while other
parts were my personal interest. Future patches and reviews will also done by
me as a private person (unless something very surprising happens ;))

Please comment, review, apply...

Thanks,

   Wolfram

Wolfram Sang (27):
  staging: ks7010: add driver from Nanonote extra-repository
  staging: ks7010: remove non-SDIO code and #ifdefs
  staging: ks7010: remove custom firmware loader
  staging: ks7010: remove checks for WIRELESS_EXT version
  staging: ks7010: remove code for old kernel versions
  staging: ks7010: avoid workqueue races
  staging: ks7010: use long preamble as default
  staging: ks7010: use kernel helper to print buffer
  staging: ks7010: delete seperate debug header
  staging: ks7010: really iterate over multicast addresses
  staging: ks7010: make loading config file optional
  staging: ks7010: fix printk format warnings
  staging: ks7010: add example cfg file as a reference
  staging: ks7010: remove unecessary typedef
  staging: ks7010: indent eap_packet.h
  staging: ks7010: indent ks7010_config.c
  staging: ks7010: indent ks7010_sdio.h
  staging: ks7010: indent ks_hostif.c
  staging: ks7010: indent ks_hostif.h
  staging: ks7010: indent ks_wlan.h
  staging: ks7010: indent ks_wlan_ioctl.h
  staging: ks7010: indent ks_wlan_net.c
  staging: ks7010: indent michael_mic.c
  staging: ks7010: indent michael_mic.h
  staging: ks7010: indent ks7010_sdio.c
  staging: ks7010: remove supported card table with one element
  staging: ks7010: fix module annotations

 drivers/staging/Kconfig                |    2 +
 drivers/staging/Makefile               |    1 +
 drivers/staging/ks7010/Kconfig         |   10 +
 drivers/staging/ks7010/Makefile        |    5 +
 drivers/staging/ks7010/README          |   37 +
 drivers/staging/ks7010/eap_packet.h    |  135 ++
 drivers/staging/ks7010/ks7010_config.c |  500 +++++
 drivers/staging/ks7010/ks7010_sdio.c   | 1267 ++++++++++++
 drivers/staging/ks7010/ks7010_sdio.h   |  152 ++
 drivers/staging/ks7010/ks79xx.cfg      |  116 ++
 drivers/staging/ks7010/ks_hostif.c     | 2763 +++++++++++++++++++++++++
 drivers/staging/ks7010/ks_hostif.h     |  647 ++++++
 drivers/staging/ks7010/ks_wlan.h       |  508 +++++
 drivers/staging/ks7010/ks_wlan_ioctl.h |   70 +
 drivers/staging/ks7010/ks_wlan_net.c   | 3547 ++++++++++++++++++++++++++++++++
 drivers/staging/ks7010/michael_mic.c   |  142 ++
 drivers/staging/ks7010/michael_mic.h   |   29 +
 17 files changed, 9931 insertions(+)
 create mode 100644 drivers/staging/ks7010/Kconfig
 create mode 100644 drivers/staging/ks7010/Makefile
 create mode 100644 drivers/staging/ks7010/README
 create mode 100644 drivers/staging/ks7010/eap_packet.h
 create mode 100644 drivers/staging/ks7010/ks7010_config.c
 create mode 100644 drivers/staging/ks7010/ks7010_sdio.c
 create mode 100644 drivers/staging/ks7010/ks7010_sdio.h
 create mode 100644 drivers/staging/ks7010/ks79xx.cfg
 create mode 100644 drivers/staging/ks7010/ks_hostif.c
 create mode 100644 drivers/staging/ks7010/ks_hostif.h
 create mode 100644 drivers/staging/ks7010/ks_wlan.h
 create mode 100644 drivers/staging/ks7010/ks_wlan_ioctl.h
 create mode 100644 drivers/staging/ks7010/ks_wlan_net.c
 create mode 100644 drivers/staging/ks7010/michael_mic.c
 create mode 100644 drivers/staging/ks7010/michael_mic.h

-- 
2.8.1

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

* [PATCH 02/27] staging: ks7010: remove non-SDIO code and #ifdefs
  2016-05-10 13:52 [PATCH 00/27] staging: add driver for KS7010 based SDIO cards Wolfram Sang
@ 2016-05-10 13:52 ` Wolfram Sang
  2016-05-10 13:52 ` [PATCH 03/27] staging: ks7010: remove custom firmware loader Wolfram Sang
                   ` (26 subsequent siblings)
  27 siblings, 0 replies; 32+ messages in thread
From: Wolfram Sang @ 2016-05-10 13:52 UTC (permalink / raw)
  To: driverdev-devel; +Cc: Wolfram Sang, linux-renesas-soc

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

I couldn't find any trace of code or even products using ks7010 with
something else than SDIO. So, remove the conditionals.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/staging/ks7010/Makefile        |  2 +-
 drivers/staging/ks7010/ks7010_config.c |  6 ---
 drivers/staging/ks7010/ks_hostif.c     | 70 ----------------------------------
 drivers/staging/ks7010/ks_wlan.h       | 10 -----
 4 files changed, 1 insertion(+), 87 deletions(-)

diff --git a/drivers/staging/ks7010/Makefile b/drivers/staging/ks7010/Makefile
index 68b7ebf57bebd6..32b0efc7bd00e8 100644
--- a/drivers/staging/ks7010/Makefile
+++ b/drivers/staging/ks7010/Makefile
@@ -1,5 +1,5 @@
 obj-$(CONFIG_KS7010) += ks7010.o
 
-ccflags-y 	     += -D_SDIO_ -DKS_WLAN_DEBUG=0
+ccflags-y 	     += -DKS_WLAN_DEBUG=0
 ks7010-y	     := michael_mic.o ks_hostif.o ks_wlan_net.o ks_debug.o \
 					ks7010_sdio.o ks7010_config.o
diff --git a/drivers/staging/ks7010/ks7010_config.c b/drivers/staging/ks7010/ks7010_config.c
index 4a8098452cdd28..e8a42077a4b381 100644
--- a/drivers/staging/ks7010/ks7010_config.c
+++ b/drivers/staging/ks7010/ks7010_config.c
@@ -268,13 +268,7 @@ int ks_wlan_read_config_file(ks_wlan_private *priv)
 	priv->reg.rate_set.size = 12;
 
 #ifndef NO_FIRMWARE_CLASS
-#if (defined _PCMCIA_)
-	dev = &priv->ks_wlan_hw.pcmcia_dev->dev;
-#elif (defined _PCI_)
-	dev = &priv->ks_wlan_hw.pci_dev->dev;
-#elif (defined _SDIO_)
 	dev = &priv->ks_wlan_hw.sdio_card->func->dev;
-#endif
 	if((retval = request_firmware(&fw_entry, cfg_file, dev)) !=0 ){
 		DPRINTK(1, "error request_firmware() file=%s ret=%d\n", cfg_file, retval);
 		return 1;
diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c
index 402ddba400ffdd..0295bb4921fa20 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -108,51 +108,12 @@ int ks_wlan_do_power_save(ks_wlan_private *priv)
 
 	DPRINTK(4,"psstatus.status=%d\n",atomic_read(&priv->psstatus.status));
 
-#ifdef _SDIO_
 	if((priv->connect_status & CONNECT_STATUS_MASK) == CONNECT_STATUS){
 		hostif_sme_enqueue(priv, SME_POW_MNGMT_REQUEST);
 	}
 	else{
 		priv->dev_state = DEVICE_STATE_READY;
 	}
-#else
-	if((priv->connect_status & CONNECT_STATUS_MASK) == CONNECT_STATUS){
-		switch(atomic_read(&priv->psstatus.status)){
-		case PS_ACTIVE_SET:
-		case PS_WAKEUP:
-		case PS_SAVE_SET:
-		case PS_SNOOZE:
-			break;
-		case PS_CONF_WAIT:
-			atomic_set(&priv->psstatus.confirm_wait,0);
-			break;
-		case PS_NONE:
-		default:
-			hostif_sme_enqueue(priv, SME_POW_MNGMT_REQUEST);
-			break;
-		}
-
-	}
-	else{
-		switch(atomic_read(&priv->psstatus.status)){
-		case PS_ACTIVE_SET:
-		case PS_WAKEUP:
-		case PS_SAVE_SET:
-			break;
-		case PS_CONF_WAIT:
-			atomic_set(&priv->psstatus.confirm_wait,0);
-			atomic_set(&priv->psstatus.status, PS_WAKEUP);
-			break;
-		case PS_SNOOZE:
-			ks_wlan_hw_power_save(priv);
-			break;
-		case PS_NONE:
-		default:
-			hostif_sme_enqueue(priv, SME_POW_MNGMT_REQUEST);
-			break;
-		}
-	}
-#endif
 	return rc;
 }
 
@@ -750,17 +711,11 @@ void hostif_power_mngmt_confirm(ks_wlan_private *priv)
 
 	if(priv->reg.powermgt > POWMGT_ACTIVE_MODE &&
 	   priv->reg.operation_mode == MODE_INFRASTRUCTURE){
-#if !defined(_SDIO_)
-		atomic_set(&priv->psstatus.status,PS_SAVE_SET);
-#endif
 		atomic_set(&priv->psstatus.confirm_wait, 0);
 		priv->dev_state = DEVICE_STATE_SLEEP;
 		ks_wlan_hw_power_save(priv);
 	}else{
 		priv->dev_state = DEVICE_STATE_READY;
-#if !defined(_SDIO_)
-		atomic_set(&priv->psstatus.status,PS_ACTIVE_SET);
-#endif
 	}
 
 }
@@ -833,9 +788,6 @@ void hostif_connect_indication(ks_wlan_private *priv)
 		/* for power save */
 		atomic_set(&priv->psstatus.snooze_guard, 0);
 		atomic_set(&priv->psstatus.confirm_wait,0);
-#if !defined(_SDIO_)
-		atomic_set(&priv->psstatus.status, PS_NONE);
-#endif
 	}
 	ks_wlan_do_power_save(priv);
 
@@ -894,10 +846,8 @@ void hostif_stop_confirm(ks_wlan_private *priv)
 	union iwreq_data wrqu0;
 
 	DPRINTK(3,"\n");
-#ifdef _SDIO_
 	if(priv->dev_state == DEVICE_STATE_SLEEP)
 		priv->dev_state = DEVICE_STATE_READY;
-#endif
 
 	/* disconnect indication */
 	if( (priv->connect_status & CONNECT_STATUS_MASK)== CONNECT_STATUS){
@@ -1178,9 +1128,6 @@ int hostif_data_request(ks_wlan_private *priv, struct sk_buff *packet)
 	if(atomic_read(&priv->psstatus.status)==PS_SNOOZE){ /* power save wakeup */
 		if(!netif_queue_stopped(priv->net_dev))
 			netif_stop_queue(priv->net_dev);
-#if !defined(_SDIO_)
-		schedule_work(&priv->ks_wlan_wakeup_task);
-#endif
 	}
 
 	DPRINTK(4, "skb_buff length=%d\n", packet_len);
@@ -1302,14 +1249,10 @@ int hostif_data_request(ks_wlan_private *priv, struct sk_buff *packet)
 	return result;
 }
 
-#if defined(_SPI_)
-#define ps_confirm_wait_inc(priv)
-#else
 #define ps_confirm_wait_inc(priv)  do{if(atomic_read(&priv->psstatus.status) > PS_ACTIVE_SET){ \
                                                   atomic_inc(&priv->psstatus.confirm_wait); \
                                                   /* atomic_set(&priv->psstatus.status, PS_CONF_WAIT);*/ \
                                       } }while(0)
-#endif
 
 static
 void hostif_mib_get_request( ks_wlan_private *priv, unsigned long mib_attribute)
@@ -2509,9 +2452,6 @@ void hostif_sme_execute(ks_wlan_private *priv, int event)
 		/* for power save */
 		atomic_set(&priv->psstatus.snooze_guard, 0);
 		atomic_set(&priv->psstatus.confirm_wait,0);
-#if !defined(_SDIO_)
-		atomic_set(&priv->psstatus.status, PS_NONE);
-#endif
 		if ( priv->dev_state == DEVICE_STATE_PREINIT ){
 			priv->dev_state = DEVICE_STATE_INIT;
 		}
@@ -2571,16 +2511,6 @@ void hostif_sme_enqueue(ks_wlan_private *priv, unsigned short event)
 {
 	DPRINTK(3,"\n");
 
-#if !defined(_SDIO_)
-	if(atomic_read(&priv->psstatus.status)==PS_SNOOZE && event < SME_START_CONFIRM){ /* power save wakeup*/
-		schedule_work(&priv->ks_wlan_wakeup_task);
-		if(atomic_read(&priv->sme_task.count) <= 0){
-			/* schedule_work(&priv->ks_wlan_wakeup_task); */
-			DPRINTK(4,"sme task disable.\n");
-			tasklet_disable(&priv->sme_task);
-		}
-	}
-#endif
 
 
 	/* enqueue sme event */
diff --git a/drivers/staging/ks7010/ks_wlan.h b/drivers/staging/ks7010/ks_wlan.h
index c7cbde1e1d0a28..329a062419fe4a 100644
--- a/drivers/staging/ks7010/ks_wlan.h
+++ b/drivers/staging/ks7010/ks_wlan.h
@@ -62,17 +62,7 @@ typedef void irqreturn_t;
 #define pci_name(x) x->slot_name 
 #endif
 
-#if (defined _PCMCIA_)
-#include "pcmcia/ks7010_pcmcia.h"
-#elif (defined _PCI_)
-#include "pci/ks7010_pci.h"
-#elif (defined _SDIO_)
 #include "ks7010_sdio.h"
-#elif (defined _SPI_)
-#include "spi/ks7010_spi.h"
-#else
-#error not defined bus type !
-#endif
 
 struct ks_wlan_parameter {
 	uint8_t		operation_mode;	   /* Operation Mode */
-- 
2.8.1

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

* [PATCH 03/27] staging: ks7010: remove custom firmware loader
  2016-05-10 13:52 [PATCH 00/27] staging: add driver for KS7010 based SDIO cards Wolfram Sang
  2016-05-10 13:52 ` [PATCH 02/27] staging: ks7010: remove non-SDIO code and #ifdefs Wolfram Sang
@ 2016-05-10 13:52 ` Wolfram Sang
  2016-05-10 13:52 ` [PATCH 04/27] staging: ks7010: remove checks for WIRELESS_EXT version Wolfram Sang
                   ` (25 subsequent siblings)
  27 siblings, 0 replies; 32+ messages in thread
From: Wolfram Sang @ 2016-05-10 13:52 UTC (permalink / raw)
  To: driverdev-devel; +Cc: Wolfram Sang, linux-renesas-soc

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

FW_LOADER works fine, no need for a open coded fallback.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/staging/ks7010/Kconfig         |  1 +
 drivers/staging/ks7010/ks7010_config.c | 62 ----------------------------------
 drivers/staging/ks7010/ks7010_sdio.c   | 56 ------------------------------
 drivers/staging/ks7010/ks7010_sdio.h   |  5 ---
 4 files changed, 1 insertion(+), 123 deletions(-)

diff --git a/drivers/staging/ks7010/Kconfig b/drivers/staging/ks7010/Kconfig
index dfd4eed539bebc..0b9217674d5b54 100644
--- a/drivers/staging/ks7010/Kconfig
+++ b/drivers/staging/ks7010/Kconfig
@@ -3,6 +3,7 @@ config KS7010
 	depends on MMC && WIRELESS
 	select WIRELESS_EXT
 	select WEXT_PRIV
+	select FW_LOADER
 	help
 	  This is a driver for KeyStream KS7010 based SDIO WIFI cards. It is
 	  found on at least later Spectec SDW-821 (FCC-ID "S2Y-WLAN-11G-K" only,
diff --git a/drivers/staging/ks7010/ks7010_config.c b/drivers/staging/ks7010/ks7010_config.c
index e8a42077a4b381..7d33070b3428e7 100644
--- a/drivers/staging/ks7010/ks7010_config.c
+++ b/drivers/staging/ks7010/ks7010_config.c
@@ -169,11 +169,7 @@ int rate_set_configuration(ks_wlan_private *priv, char *value)
 	return rc;
 }
 
-#ifndef NO_FIRMWARE_CLASS
 #include <linux/firmware.h>
-#else
-#define MAX_CONFIG_FILE_SIZE (1024*10)
-#endif
 int ks_wlan_read_config_file(ks_wlan_private *priv)
 {
 	struct {
@@ -206,18 +202,9 @@ int ks_wlan_read_config_file(ks_wlan_private *priv)
 		{0,"",""},
 	};
 
-#ifndef NO_FIRMWARE_CLASS
 	const struct firmware *fw_entry;
 	struct device *dev = NULL;
 	int retval;
-#else
-	struct file     *srcf;
-	int nr_read ;
-	int retval;
-	char *cfg_buf=NULL;
-	int orgfsuid, orgfsgid;
-	mm_segment_t orgfs;
-#endif
 	char cfg_file[]=CFG_FILE;
 	char *cur_p, *end_p;
 	char wk_buff[256], *wk_p;
@@ -267,7 +254,6 @@ int ks_wlan_read_config_file(ks_wlan_private *priv)
 	priv->reg.tx_rate = TX_RATE_FULL_AUTO;
 	priv->reg.rate_set.size = 12;
 
-#ifndef NO_FIRMWARE_CLASS
 	dev = &priv->ks_wlan_hw.sdio_card->func->dev;
 	if((retval = request_firmware(&fw_entry, cfg_file, dev)) !=0 ){
 		DPRINTK(1, "error request_firmware() file=%s ret=%d\n", cfg_file, retval);
@@ -277,46 +263,6 @@ int ks_wlan_read_config_file(ks_wlan_private *priv)
 	DPRINTK(4, "success request_firmware() file=%s size=%d\n", cfg_file, fw_entry->size);
 	cur_p = fw_entry->data;
 	end_p = cur_p + fw_entry->size;
-#else
-	orgfsuid=current->fsuid;
-	orgfsgid=current->fsgid;
-	orgfs=get_fs();
-	set_fs(KERNEL_DS);
-
-	srcf = filp_open(cfg_file, O_RDONLY, 0);
-	if (IS_ERR(srcf)) {
-		printk(KERN_ERR "error %ld opening %s\n", -PTR_ERR(srcf),cfg_file);
-		goto no_config_file;
-	}
-
-		if (!(srcf->f_op && srcf->f_op->read)) {
-				printk(KERN_ERR "%s does not have a read method\n", cfg_file);
-		goto no_config_file;
-		}
-
-	cfg_buf = (char *)kzalloc(MAX_CONFIG_FILE_SIZE, GFP_ATOMIC);
-		if (!cfg_buf) {
-				printk(KERN_ERR "%s does not read : out of memory \n", cfg_file);
-		goto no_config_file;
-		}
-
-		nr_read = srcf->f_op->read(srcf, (unsigned char *)cfg_buf, MAX_CONFIG_FILE_SIZE, &srcf->f_pos);
-
-	DPRINTK(1, "read retval=%d  file=%s\n", nr_read, priv->reg.cfg_file);
-	retval=filp_close(srcf ,NULL);
-	if (retval)
-		DPRINTK(1, "error %d closing %s\n", -retval,priv->reg.cfg_file);
-
-		if (nr_read < 1) {
-				printk(KERN_ERR "%s does not read : file is empty  num=%d\n", cfg_file, nr_read);
-		goto no_config_file;
-		}else if(nr_read > MAX_CONFIG_FILE_SIZE){
-				printk(KERN_ERR "%s does not read : file is too big \n", cfg_file);
-		goto no_config_file;
-	}
-	cur_p = cfg_buf;
-	end_p = cur_p + nr_read;
-#endif
 	*end_p = '\0';
 
 	while (cur_p < end_p) {
@@ -524,15 +470,7 @@ int ks_wlan_read_config_file(ks_wlan_private *priv)
 		}
 
 	}
-#ifndef NO_FIRMWARE_CLASS
 	release_firmware(fw_entry);
-#else
-no_config_file:
-	kfree(cfg_buf);
-	set_fs(orgfs);
-	current->fsuid=orgfsuid;
-	current->fsgid=orgfsgid;
-#endif
 
 	DPRINTK(3,"\n    operation_mode = %d\n    channel = %d\n    ssid = %s\n    tx_rate = %d\n \
    preamble = %d\n    powermgt = %d\n    scan_type = %d\n    beacon_lost_count = %d\n    rts = %d\n \
diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
index 7cc49a4ccac549..9300658c4aed8d 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -56,10 +56,6 @@ static int ks7010_sdio_read( ks_wlan_private *priv, unsigned int address,
 			     unsigned char *buffer, int length );
 static int ks7010_sdio_write( ks_wlan_private *priv, unsigned int address,
 			      unsigned char *buffer, int length );
-#ifdef NO_FIRMWARE_CLASS
-static char *romfile = ROM_FILE;
-module_param(romfile, charp, S_IRUGO);
-#endif
 /* macro */
 
 #define inc_txqhead(priv) \
@@ -723,23 +719,15 @@ error_out:
 	if(read_buf) kfree(read_buf);
 	return rc;
 }
-#ifndef NO_FIRMWARE_CLASS
 #include <linux/firmware.h>
-#endif
 static int ks79xx_upload_firmware(ks_wlan_private *priv, struct ks_sdio_card *card)
 {
 	unsigned int	size, offset,  n = 0;
 	unsigned char	*rom_buf;
 	unsigned char rw_data =0;
 	int retval, rc=0;
-#ifndef NO_FIRMWARE_CLASS
 	int length;
 	const struct firmware *fw_entry = NULL;
-#else
-	int orgfsuid, orgfsgid;
-	struct file     *srcf;
-	mm_segment_t orgfs;
-#endif
 
 	rom_buf = NULL;
 
@@ -758,38 +746,16 @@ static int ks79xx_upload_firmware(ks_wlan_private *priv, struct ks_sdio_card *ca
 		goto error_out0;
 	}
 
-#ifndef NO_FIRMWARE_CLASS
 	if(request_firmware(&fw_entry, priv->reg.rom_file, &priv->ks_wlan_hw.sdio_card->func->dev)!=0){
 		DPRINTK(1,"error request_firmware() file=%s\n", priv->reg.rom_file);
 		return 1;
 	}
 	DPRINTK(4,"success request_firmware() file=%s size=%d\n", priv->reg.rom_file, fw_entry->size);
 	length = fw_entry->size;
-#else
-	orgfsuid=current->fsuid;
-	orgfsgid=current->fsgid;
-	current->fsuid=current->fsgid=0;
-	orgfs=get_fs();
-	set_fs(KERNEL_DS);
-
-	srcf = filp_open(romfile, O_RDONLY, 0);
-	if (IS_ERR(srcf)) {
-		DPRINTK(1, "error %ld opening %s\n", -PTR_ERR(srcf),romfile);
-		rc = 1;
-		goto error_out1;
-	}
-
-        if (!(srcf->f_op && srcf->f_op->read)) {
-                DPRINTK(1, "%s does not have a read method\n", romfile);
-                rc = 2;
-                goto error_out2;
-        }
-#endif
 
 	/* Load Program */
 	n = 0;
         do {
-#ifndef NO_FIRMWARE_CLASS
 		if(length >= ROM_BUFF_SIZE){
 			size = ROM_BUFF_SIZE;
 			length = length - ROM_BUFF_SIZE;
@@ -801,16 +767,6 @@ static int ks79xx_upload_firmware(ks_wlan_private *priv, struct ks_sdio_card *ca
 		DPRINTK(4, "size = %d\n",size);
 		if(size == 0) break;
 		memcpy(rom_buf,fw_entry->data+n,size);
-#else
-		/* The object must have a read method */
-		size = srcf->f_op->read(srcf, rom_buf, ROM_BUFF_SIZE, &srcf->f_pos);
-		if (size < 0) {
-			DPRINTK(1, "Read %s error %d\n", priv->reg.rom_file, -retval);
-			rc = 5;
-			goto error_out2;
-		}
-		else if (size == 0) break;
-#endif
 		/* Update write index */
 		offset = n;
 		retval = ks7010_sdio_update_index(priv, KS7010_IRAM_ADDRESS+offset);
@@ -852,20 +808,8 @@ static int ks79xx_upload_firmware(ks_wlan_private *priv, struct ks_sdio_card *ca
 
 	rc = 0;
 
-#ifdef NO_FIRMWARE_CLASS
- error_out2:
-	retval=filp_close(srcf ,NULL);
-	if (retval)
-		DPRINTK(1, "error %d closing %s\n", -retval,priv->reg.rom_file);
-
- error_out1:
-	set_fs(orgfs);
-	current->fsuid=orgfsuid;
-	current->fsgid=orgfsgid;
-#else
  error_out1:
 	release_firmware(fw_entry);
-#endif
  error_out0:
 	sdio_release_host(card->func);
 	if(rom_buf)
diff --git a/drivers/staging/ks7010/ks7010_sdio.h b/drivers/staging/ks7010/ks7010_sdio.h
index 3af742f1b79f93..5bf01abbf2ab6c 100644
--- a/drivers/staging/ks7010/ks7010_sdio.h
+++ b/drivers/staging/ks7010/ks7010_sdio.h
@@ -153,13 +153,8 @@ struct rx_device{
 	unsigned int	qtail; /* rx buffer queue last pointer */
 	spinlock_t  rx_dev_lock;
 };
-#ifndef NO_FIRMWARE_CLASS
 #define	ROM_FILE "ks7010sd.rom"
 #define	CFG_FILE "ks79xx.cfg"
-#else
-#define	ROM_FILE "/lib/firmware/ks7010sd.rom"
-#define	CFG_FILE "/lib/firmware/ks79xx.cfg"
-#endif
 #define	KS_WLAN_DRIVER_VERSION_INFO  "ks7010 sdio linux 007"
 
 #endif /* _KS7010_SDIO_H */
-- 
2.8.1

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

* [PATCH 04/27] staging: ks7010: remove checks for WIRELESS_EXT version
  2016-05-10 13:52 [PATCH 00/27] staging: add driver for KS7010 based SDIO cards Wolfram Sang
  2016-05-10 13:52 ` [PATCH 02/27] staging: ks7010: remove non-SDIO code and #ifdefs Wolfram Sang
  2016-05-10 13:52 ` [PATCH 03/27] staging: ks7010: remove custom firmware loader Wolfram Sang
@ 2016-05-10 13:52 ` Wolfram Sang
  2016-05-10 13:52 ` [PATCH 05/27] staging: ks7010: remove code for old kernel versions Wolfram Sang
                   ` (24 subsequent siblings)
  27 siblings, 0 replies; 32+ messages in thread
From: Wolfram Sang @ 2016-05-10 13:52 UTC (permalink / raw)
  To: driverdev-devel; +Cc: Wolfram Sang, linux-renesas-soc

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

We are by far newer than that anyhow.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/staging/ks7010/ks_hostif.c   | 23 -----------------------
 drivers/staging/ks7010/ks_wlan_net.c | 14 --------------
 2 files changed, 37 deletions(-)

diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c
index 0295bb4921fa20..6bea699655eec4 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -22,12 +22,7 @@
 #include <linux/if_arp.h>
 
 /* Include Wireless Extension definition and check version */
-#ifndef WIRELESS_EXT
-#include <linux/wireless.h>
-#endif /* WIRELESS_EXT */
-#if WIRELESS_EXT > 12
 #include <net/iw_handler.h>	/* New driver API */
-#endif	/* WIRELESS_EXT > 12 */
 
 extern int ks_wlan_hw_tx(ks_wlan_private *priv, void *p, unsigned long size,
 			 void (*complete_handler)(void *arg1, void *arg2),
@@ -121,10 +116,8 @@ static
 int get_current_ap(ks_wlan_private *priv, struct link_ap_info_t *ap_info)
 {
 	struct local_ap_t *ap;
-#if WIRELESS_EXT > 13
 	union iwreq_data wrqu;
 	struct net_device *netdev=priv->net_dev;
-#endif /* WIRELESS_EXT > 13 */
 	int rc=0;
 
 	DPRINTK(3,"\n");
@@ -190,7 +183,6 @@ int get_current_ap(ks_wlan_private *priv, struct link_ap_info_t *ap_info)
 		ap->wpa_ie.size = 0;
 	}
 
-#if WIRELESS_EXT > 13
 	wrqu.data.length = 0;
 	wrqu.data.flags = 0;
 	wrqu.ap_addr.sa_family = ARPHRD_ETHER;
@@ -203,7 +195,6 @@ int get_current_ap(ks_wlan_private *priv, struct link_ap_info_t *ap_info)
 			(unsigned char)wrqu.ap_addr.sa_data[4],(unsigned char)wrqu.ap_addr.sa_data[5]);
 		wireless_send_event(netdev, SIOCGIWAP, &wrqu, NULL);
 	}
-#endif
 	DPRINTK(4,"\n    Link AP\n");
 	DPRINTK(4,"    bssid=%02X:%02X:%02X:%02X:%02X:%02X\n \
    essid=%s\n    rate_set=%02X,%02X,%02X,%02X,%02X,%02X,%02X,%02X\n    channel=%d\n \
@@ -338,9 +329,7 @@ void hostif_data_indication(ks_wlan_private *priv)
 	struct ieee802_1x_hdr *aa1x_hdr;
 	struct wpa_eapol_key *eap_key;
 	struct michel_mic_t michel_mic;
-#if WIRELESS_EXT > 14
 	union iwreq_data wrqu;
-#endif /* WIRELESS_EXT > 14 */
 
 	DPRINTK(3,"\n");
 
@@ -412,7 +401,6 @@ void hostif_data_indication(ks_wlan_private *priv)
 							mic_failure->counter = 1;
 					}
 					priv->wpa.mic_failure.last_failure_time = now;
-#if WIRELESS_EXT > 14
 					/*  needed parameters: count, keyid, key type, TSC */
 					sprintf(buf, "MLME-MICHAELMICFAILURE.indication(keyid=%d %scast addr="
 						"%02x:%02x:%02x:%02x:%02x:%02x)",
@@ -424,7 +412,6 @@ void hostif_data_indication(ks_wlan_private *priv)
 					wrqu.data.length = strlen(buf);
 					DPRINTK(4,"IWEVENT:MICHAELMICFAILURE\n");
 					wireless_send_event(priv->net_dev, IWEVCUSTOM, &wrqu, buf);
-#endif /* WIRELESS_EXT > 14 */
 					return;
 				}
 			}
@@ -754,9 +741,7 @@ void hostif_connect_indication(ks_wlan_private *priv)
 	unsigned int tmp=0;
 	unsigned int old_status=priv->connect_status;
 	struct net_device *netdev=priv->net_dev;
-#if WIRELESS_EXT > 13
 	union iwreq_data wrqu0;
-#endif /* WIRELESS_EXT > 13 */
 	connect_code = get_WORD(priv);
 
 	switch(connect_code){
@@ -791,7 +776,6 @@ void hostif_connect_indication(ks_wlan_private *priv)
 	}
 	ks_wlan_do_power_save(priv);
 
-#if WIRELESS_EXT > 13
 	wrqu0.data.length = 0;
 	wrqu0.data.flags = 0;
 	wrqu0.ap_addr.sa_family = ARPHRD_ETHER;
@@ -802,7 +786,6 @@ void hostif_connect_indication(ks_wlan_private *priv)
 		DPRINTK(3,"disconnect :: scan_ind_count=%d\n",priv->scan_ind_count);
 		wireless_send_event(netdev, SIOCGIWAP, &wrqu0, NULL);
 	}
-#endif /* WIRELESS_EXT > 13 */
 	priv->scan_ind_count=0;
 }
 
@@ -904,7 +887,6 @@ void hostif_adhoc_set_confirm(ks_wlan_private *priv)
 static
 void hostif_associate_indication(ks_wlan_private *priv)
 {
-#if WIRELESS_EXT > 14
 	struct association_request_t *assoc_req;
 	struct association_response_t *assoc_resp;
 	unsigned char *pb;
@@ -944,29 +926,24 @@ void hostif_associate_indication(ks_wlan_private *priv)
 
 	DPRINTK(3,"IWEVENT:ASSOCINFO\n");
 	wireless_send_event(priv->net_dev, IWEVCUSTOM, &wrqu, buf);
-#endif /* WIRELESS_EXT > 14 */
 }
 
 static
 void hostif_bss_scan_confirm(ks_wlan_private *priv)
 {
 	unsigned int result_code;
-#if WIRELESS_EXT > 13
 	struct net_device *dev = priv->net_dev;
 	union iwreq_data wrqu;
-#endif /* WIRELESS_EXT > 13 */
 	result_code = get_DWORD(priv);
 	DPRINTK(2,"result=%d :: scan_ind_count=%d\n", result_code, priv->scan_ind_count);
 
 	priv->sme_i.sme_flag &= ~SME_AP_SCAN;
 	hostif_sme_enqueue(priv, SME_BSS_SCAN_CONFIRM);
 
-#if WIRELESS_EXT > 13
 	wrqu.data.length = 0;
 	wrqu.data.flags = 0;
 	DPRINTK(3,"IWEVENT: SCAN CONFIRM\n");
 	wireless_send_event(dev, SIOCGIWSCAN, &wrqu, NULL);
-#endif /* WIRELESS_EXT > 13 */
 	priv->scan_ind_count=0;
 }
 
diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c
index 546a256093978c..185630cb423d5e 100644
--- a/drivers/staging/ks7010/ks_wlan_net.c
+++ b/drivers/staging/ks7010/ks_wlan_net.c
@@ -50,7 +50,6 @@ static int wep_on_off;
 #define WIRELESS_SPY		/* enable iwspy support */
 #include <net/iw_handler.h>	/* New driver API */
 
-#ifdef WIRELESS_EXT
 /* Frequency list (map channels to frequencies) */
 static const long frequency_list[] = { 2412, 2417, 2422, 2427, 2432, 2437, 2442,
 				       2447, 2452, 2457, 2462, 2467, 2472, 2484 };
@@ -74,7 +73,6 @@ static const struct iw_handler_def	ks_wlan_handler_def;
 
 #define KSC_OPNOTSUPP /* Operation Not Support*/
 
-#endif /* WIRELESS_EXT */
 
 /*
  *	function prototypes
@@ -174,7 +172,6 @@ int ks_wlan_setup_parameter(ks_wlan_private *priv, unsigned int commit_flag)
 	return 0;
 }
 
-#ifdef WIRELESS_EXT
 /*
  * Initial Wireless Extension code for Ks_Wlannet driver by :
  *	Jean Tourrilhes <jt@hpl.hp.com> - HPL - 17 November 00
@@ -1090,7 +1087,6 @@ static int ks_wlan_get_range(struct net_device *dev, struct iw_request_info *inf
 	range->avg_qual.level = 186;	/* -70 dBm */
 	range->avg_qual.noise = 0;
 
-#if defined(WIRELESS_EXT)
 	/* Event capability (kernel + driver) */
 	range->event_capa[0] = (IW_EVENT_CAPA_K_0 |
 				IW_EVENT_CAPA_MASK(SIOCGIWAP) |
@@ -1104,7 +1100,6 @@ static int ks_wlan_get_range(struct net_device *dev, struct iw_request_info *inf
 			   IW_ENC_CAPA_WPA2 |
 			   IW_ENC_CAPA_CIPHER_TKIP |
 			   IW_ENC_CAPA_CIPHER_CCMP);
-#endif
 	return 0;
 }
 
@@ -1229,7 +1224,6 @@ static int ks_wlan_get_aplist(struct net_device *dev, struct iw_request_info *in
 	return 0;
 }
 
-#if defined(WIRELESS_EXT)
 /*------------------------------------------------------------------*/
 /* Wireless Handler : Initiate Scan */
 static int ks_wlan_set_scan(struct net_device *dev, struct iw_request_info *info,
@@ -1452,7 +1446,6 @@ DPRINTK(2,"aplist 0\n");
 
 	return 0;
 }
-#endif	/* WIRELESS_EXT  */
 
 /*------------------------------------------------------------------*/
 /* Commit handler : called after a bunch of SET operations */
@@ -1469,7 +1462,6 @@ static int ks_wlan_config_commit(struct net_device *dev, struct iw_request_info
 	return 0;
 }
 
-#ifdef WIRELESS_EXT
 /*------------------------------------------------------------------*/
 /* Wireless handler : set association ie params */
 static int ks_wlan_set_genie(struct net_device *dev, struct iw_request_info *info,
@@ -1951,7 +1943,6 @@ static int ks_wlan_set_mlme(struct net_device *dev, struct iw_request_info *info
 		return -EOPNOTSUPP;  /* Not Support */
 	}
 }
-#endif /* WIRELESS_EXT  */
 
 /*------------------------------------------------------------------*/
 /* Private handler : get driver version */
@@ -2915,20 +2906,15 @@ static const struct iw_handler_def	ks_wlan_handler_def =
 	.get_wireless_stats = ks_get_wireless_stats,
 };
 
-#endif /* WIRELESS_EXT */
 
 static int ks_wlan_netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
 	int rc = 0;
-#if defined(WIRELESS_EXT)
 	struct iwreq *wrq = (struct iwreq *) rq;
-#endif /* WIRELESS_EXT */
 	switch (cmd) {
-#if defined(WIRELESS_EXT)
 	case SIOCIWFIRSTPRIV+20: /* KS_WLAN_SET_STOP_REQ */
 		rc = ks_wlan_set_stop_request(dev, NULL, &(wrq->u.mode), NULL);
 		break;
-#endif /* WIRELESS_EXT >17 */
 	// All other calls are currently unsupported
 	default:
 		rc = -EOPNOTSUPP;
-- 
2.8.1

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

* [PATCH 05/27] staging: ks7010: remove code for old kernel versions
  2016-05-10 13:52 [PATCH 00/27] staging: add driver for KS7010 based SDIO cards Wolfram Sang
                   ` (2 preceding siblings ...)
  2016-05-10 13:52 ` [PATCH 04/27] staging: ks7010: remove checks for WIRELESS_EXT version Wolfram Sang
@ 2016-05-10 13:52 ` Wolfram Sang
  2016-05-10 13:52 ` [PATCH 06/27] staging: ks7010: avoid workqueue races Wolfram Sang
                   ` (23 subsequent siblings)
  27 siblings, 0 replies; 32+ messages in thread
From: Wolfram Sang @ 2016-05-10 13:52 UTC (permalink / raw)
  To: driverdev-devel; +Cc: Wolfram Sang, linux-renesas-soc

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

No need to be backwards compatible.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/staging/ks7010/ks_hostif.c   |  9 ---------
 drivers/staging/ks7010/ks_wlan.h     | 28 +---------------------------
 drivers/staging/ks7010/ks_wlan_net.c |  3 ---
 3 files changed, 1 insertion(+), 39 deletions(-)

diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c
index 6bea699655eec4..146a1357909b39 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -2103,11 +2103,7 @@ void hostif_sme_multicast_set(ks_wlan_private *priv)
 
         struct net_device *dev = priv->net_dev;
 	int mc_count;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)
 	struct netdev_hw_addr *ha;
-#else
-	struct dev_mc_list *mclist;
-#endif
 	char	set_address[NIC_MAX_MCAST_LIST*ETH_ALEN];
 	unsigned long filter_type;
 	int i;
@@ -2131,14 +2127,9 @@ void hostif_sme_multicast_set(ks_wlan_private *priv)
 	else {
 		if (priv->sme_i.sme_flag & SME_MULTICAST){
 			mc_count = netdev_mc_count(dev);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)
 			netdev_for_each_mc_addr(ha, dev) {
 				memcpy(&set_address[i*ETH_ALEN], ha->addr, ETH_ALEN);
 			}
-#else
-			for (i = 0, mclist = dev->mc_list; mclist && i < mc_count; i++, mclist = mclist->next)
-				memcpy(&set_address[i*ETH_ALEN], mclist->dmi_addr, ETH_ALEN);
-#endif
 			priv->sme_i.sme_flag &= ~SME_MULTICAST;
 			hostif_mib_set_request(priv, LOCAL_MULTICAST_ADDRESS,
 					       (ETH_ALEN*mc_count), MIB_VALUE_TYPE_OSTRING, &set_address[0]);
diff --git a/drivers/staging/ks7010/ks_wlan.h b/drivers/staging/ks7010/ks_wlan.h
index 329a062419fe4a..6bd016414a4f1d 100644
--- a/drivers/staging/ks7010/ks_wlan.h
+++ b/drivers/staging/ks7010/ks_wlan.h
@@ -18,9 +18,6 @@
 #define WPS
 
 #include <linux/version.h>
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)) 
-#include <linux/config.h>
-#endif
 #include <linux/interrupt.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
@@ -35,32 +32,9 @@
 #include <linux/timer.h>	/* struct timer_list */
 #include <linux/string.h>
 #include <linux/completion.h>   /* struct completion */
-
-#include <asm/io.h>
-
-/* Workqueue / task queue backwards compatibility stuff */
-#if ((LINUX_VERSION_CODE > KERNEL_VERSION(2,5,41)) || (defined _MVL31_) || (defined _CELF3_))
 #include <linux/workqueue.h>
-#else
-#include <linux/tqueue.h>
-#define work_struct tq_struct
-#define INIT_WORK INIT_TQUEUE
-#define schedule_work schedule_task
-#endif
 
-/* Interrupt handler backwards compatibility stuff */
-/*
-#ifndef IRQ_NONE
-#define IRQ_NONE
-#define IRQ_HANDLED
-typedef void irqreturn_t;
-#endif
-*/
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,23)
-#define free_netdev(x) kfree(x) 
-#define pci_name(x) x->slot_name 
-#endif
+#include <asm/io.h>
 
 #include "ks7010_sdio.h"
 
diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c
index 185630cb423d5e..776a544031495f 100644
--- a/drivers/staging/ks7010/ks_wlan_net.c
+++ b/drivers/staging/ks7010/ks_wlan_net.c
@@ -13,9 +13,6 @@
  */
 
 #include <linux/version.h>
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
-#include <linux/config.h>
-#endif
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/compiler.h>
-- 
2.8.1

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

* [PATCH 06/27] staging: ks7010: avoid workqueue races
  2016-05-10 13:52 [PATCH 00/27] staging: add driver for KS7010 based SDIO cards Wolfram Sang
                   ` (3 preceding siblings ...)
  2016-05-10 13:52 ` [PATCH 05/27] staging: ks7010: remove code for old kernel versions Wolfram Sang
@ 2016-05-10 13:52 ` Wolfram Sang
  2016-05-10 13:52 ` [PATCH 07/27] staging: ks7010: use long preamble as default Wolfram Sang
                   ` (22 subsequent siblings)
  27 siblings, 0 replies; 32+ messages in thread
From: Wolfram Sang @ 2016-05-10 13:52 UTC (permalink / raw)
  To: driverdev-devel; +Cc: Wolfram Sang, linux-renesas-soc

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

My Spectec SDW823 card oopsed when it was already inserted during boot.
When debugging this, I noticed that the card init was done in a seperate
workqueue which was only activated once in probe. After removing the
workqueue and calling the card init directly from probe, the OOPS went
away. It turned out this is the same OOPS which happened when removing
the card, so this seems possible now. Note: There is still a
not-understood card-removed event during boot, but at least it doesn't
crash anymore and the card will be re-probed right away.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/staging/ks7010/README        |  1 -
 drivers/staging/ks7010/ks7010_sdio.c | 28 ++--------------------------
 drivers/staging/ks7010/ks7010_sdio.h |  2 --
 3 files changed, 2 insertions(+), 29 deletions(-)

diff --git a/drivers/staging/ks7010/README b/drivers/staging/ks7010/README
index 390e821efc0bcf..5cbb4ca999747e 100644
--- a/drivers/staging/ks7010/README
+++ b/drivers/staging/ks7010/README
@@ -28,7 +28,6 @@ Now the TODOs:
   should understand the change you submit.
 - drop using a config file and use an upstream technique for configuration
 - fix the 'card removal' event when card is inserted when booting
-- driver crashes when removing the card
 - check what other upstream wireless mechanisms can be used instead of the
   custom ones here
 
diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
index 9300658c4aed8d..5b78522fad1ec1 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -817,14 +817,8 @@ static int ks79xx_upload_firmware(ks_wlan_private *priv, struct ks_sdio_card *ca
 	return rc;
 }
 
-static void card_init_task(struct work_struct *work)
+static void ks7010_card_init(struct ks_wlan_private *priv)
 {
-	struct hw_info_t *hw;
-	struct ks_wlan_private *priv;
-
-	hw = container_of(work, struct hw_info_t, init_task);
-	priv = container_of(hw, struct ks_wlan_private, ks_wlan_hw);
-
 	DPRINTK(5,"\ncard_init_task()\n");
 
 	/* init_waitqueue_head(&priv->confirm_wait); */
@@ -1052,23 +1046,11 @@ static int ks7910_sdio_probe(struct sdio_func *func, const struct sdio_device_id
 		goto error_free_read_buf;
 	}
 
-	priv->ks_wlan_hw.ks7010sdio_init = create_singlethread_workqueue("ks7010sdio_init");
-	if(!priv->ks_wlan_hw.ks7010sdio_init){
-		DPRINTK(1, "create_workqueue failed !!\n");
-		goto error_free_sdio_wq;
-	}
-
-	INIT_WORK(&priv->ks_wlan_hw.init_task, card_init_task);
 	INIT_DELAYED_WORK(&priv->ks_wlan_hw.rw_wq, ks7010_rw_function);
-
-	queue_work(priv->ks_wlan_hw.ks7010sdio_init, &priv->ks_wlan_hw.init_task);
+	ks7010_card_init(priv);
 
 	return 0;
 
-error_free_sdio_wq:
-	flush_workqueue(priv->ks_wlan_hw.ks7010sdio_wq);
-	destroy_workqueue(priv->ks_wlan_hw.ks7010sdio_wq);
-	priv->ks_wlan_hw.ks7010sdio_wq = NULL;
 error_free_read_buf:
 	kfree(priv->ks_wlan_hw.read_buf);
 	priv->ks_wlan_hw.read_buf = NULL;
@@ -1139,12 +1121,6 @@ static void ks7910_sdio_remove(struct sdio_func *func)
 		}
 		DPRINTK(1, "destroy_workqueue(priv->ks_wlan_hw.ks7010sdio_wq);\n");
 
-		if(priv->ks_wlan_hw.ks7010sdio_init){
-			flush_workqueue(priv->ks_wlan_hw.ks7010sdio_init);
-			destroy_workqueue(priv->ks_wlan_hw.ks7010sdio_init);
-		}
-		DPRINTK(1, "destroy_workqueue(priv->ks_wlan_hw.ks7010sdio_init);\n");
-
 		hostif_exit(priv);
 		DPRINTK(1, "hostif_exit\n");
 
diff --git a/drivers/staging/ks7010/ks7010_sdio.h b/drivers/staging/ks7010/ks7010_sdio.h
index 5bf01abbf2ab6c..93823837f19e65 100644
--- a/drivers/staging/ks7010/ks7010_sdio.h
+++ b/drivers/staging/ks7010/ks7010_sdio.h
@@ -96,8 +96,6 @@ struct hw_info_t {
 	struct ks_sdio_card *sdio_card;	
 	struct completion ks7010_sdio_wait;
 	struct workqueue_struct *ks7010sdio_wq;
-	struct workqueue_struct *ks7010sdio_init;
-	struct work_struct init_task;
 	struct delayed_work rw_wq;
 	unsigned char	*read_buf;
 	struct tasklet_struct rx_bh_task;
-- 
2.8.1

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

* [PATCH 07/27] staging: ks7010: use long preamble as default
  2016-05-10 13:52 [PATCH 00/27] staging: add driver for KS7010 based SDIO cards Wolfram Sang
                   ` (4 preceding siblings ...)
  2016-05-10 13:52 ` [PATCH 06/27] staging: ks7010: avoid workqueue races Wolfram Sang
@ 2016-05-10 13:52 ` Wolfram Sang
  2016-05-10 13:52 ` [PATCH 08/27] staging: ks7010: use kernel helper to print buffer Wolfram Sang
                   ` (21 subsequent siblings)
  27 siblings, 0 replies; 32+ messages in thread
From: Wolfram Sang @ 2016-05-10 13:52 UTC (permalink / raw)
  To: driverdev-devel; +Cc: Wolfram Sang, linux-renesas-soc

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

I had a problem connecting to a network with a short preamble, so let's
make the safer option the default.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/staging/ks7010/ks7010_config.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_config.c b/drivers/staging/ks7010/ks7010_config.c
index 7d33070b3428e7..abe99a52ae1ad8 100644
--- a/drivers/staging/ks7010/ks7010_config.c
+++ b/drivers/staging/ks7010/ks7010_config.c
@@ -193,7 +193,7 @@ int ks_wlan_read_config_file(ks_wlan_private *priv)
 		{8,"WepIndex","1"},				/* 13 */
 		{7,"WepType","STRING"},				/* 14 */
 		{3,"Wep","OFF"},				/* 15 */
-		{13,"PREAMBLE_TYPE","SHORT"},			/* 16 */
+		{13,"PREAMBLE_TYPE","LONG"},			/* 16 */
 		{8,"ScanType","ACTIVE_SCAN"},			/* 17 */
 		{8,"ROM_FILE", ROM_FILE},			/* 18 */
 		{7,"PhyType", "BG_MODE"},			/* 19 */
@@ -216,7 +216,7 @@ int ks_wlan_read_config_file(ks_wlan_private *priv)
 	priv->reg.ssid.body[0] = '\0';		        /* SSID */
 	priv->reg.ssid.size = 0;		        /* SSID size */
 	priv->reg.tx_rate = TX_RATE_AUTO;		/* TxRate Fully Auto */
-	priv->reg.preamble = SHORT_PREAMBLE;		/* Preamble = SHORT */
+	priv->reg.preamble = LONG_PREAMBLE;		/* Preamble = LONG */
 	priv->reg.powermgt = POWMGT_ACTIVE_MODE;        /* POWMGT_ACTIVE_MODE */
 	priv->reg.scan_type = ACTIVE_SCAN;              /* Active */
 	priv->reg.beacon_lost_count = 20;	        /* Beacon Lost Count */
-- 
2.8.1

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

* [PATCH 08/27] staging: ks7010: use kernel helper to print buffer
  2016-05-10 13:52 [PATCH 00/27] staging: add driver for KS7010 based SDIO cards Wolfram Sang
                   ` (5 preceding siblings ...)
  2016-05-10 13:52 ` [PATCH 07/27] staging: ks7010: use long preamble as default Wolfram Sang
@ 2016-05-10 13:52 ` Wolfram Sang
  2016-05-10 13:52 ` [PATCH 09/27] staging: ks7010: delete seperate debug header Wolfram Sang
                   ` (20 subsequent siblings)
  27 siblings, 0 replies; 32+ messages in thread
From: Wolfram Sang @ 2016-05-10 13:52 UTC (permalink / raw)
  To: driverdev-devel; +Cc: Wolfram Sang, linux-renesas-soc

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

No need for an open coded one.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/staging/ks7010/Makefile      |  2 +-
 drivers/staging/ks7010/ks7010_sdio.c |  9 +++++----
 drivers/staging/ks7010/ks_debug.c    | 30 ------------------------------
 drivers/staging/ks7010/ks_debug.h    |  2 --
 4 files changed, 6 insertions(+), 37 deletions(-)
 delete mode 100644 drivers/staging/ks7010/ks_debug.c

diff --git a/drivers/staging/ks7010/Makefile b/drivers/staging/ks7010/Makefile
index 32b0efc7bd00e8..f6a2cc8fd0276d 100644
--- a/drivers/staging/ks7010/Makefile
+++ b/drivers/staging/ks7010/Makefile
@@ -1,5 +1,5 @@
 obj-$(CONFIG_KS7010) += ks7010.o
 
 ccflags-y 	     += -DKS_WLAN_DEBUG=0
-ks7010-y	     := michael_mic.o ks_hostif.o ks_wlan_net.o ks_debug.o \
+ks7010-y	     := michael_mic.o ks_hostif.o ks_wlan_net.o \
 					ks7010_sdio.o ks7010_config.o
diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
index 5b78522fad1ec1..1a1a43ff306aae 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -441,10 +441,11 @@ static void ks_wlan_hw_rx(void *dev, uint16_t size)
 
 	/* length check */
 	if(size > 2046 || size == 0){
-
-		DPRINTK(5,"-INVAILED DATA dump\n");
-		print_buffer(&rx_buffer->data[0],32);
-
+#ifdef KS_WLAN_DEBUG
+		if (KS_WLAN_DEBUG > 5)
+			print_hex_dump_bytes("INVALID DATA dump: ", DUMP_PREFIX_OFFSET,
+					     rx_buffer->data, 32);
+#endif
 		/* rx_status update */
 		read_status = READ_STATUS_IDLE;
 		retval = ks7010_sdio_write(priv, READ_STATUS, &read_status, sizeof(read_status));
diff --git a/drivers/staging/ks7010/ks_debug.c b/drivers/staging/ks7010/ks_debug.c
deleted file mode 100644
index 009f5f6df8f4e6..00000000000000
--- a/drivers/staging/ks7010/ks_debug.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- *   Driver for KeyStream 11b/g wireless LAN cards.
- *   
- *   ks_debug.c
- *   $Id: ks_debug.c 991 2009-09-14 01:38:58Z sekine $
- *
- *   Copyright (C) 2005-2008 KeyStream Corp.
- *   Copyright (C) 2009 Renesas Technology Corp.
- *
- *   This program is free software; you can redistribute it and/or modify
- *   it undr the terms of the GNU General Public License version 2 as
- *   published by the Free Sotware Foundation.
- */
-#include "ks_wlan.h"
-#include "ks_debug.h"
-
-void print_buffer(unsigned char *p, int length)
-{
-#ifdef KS_WLAN_DEBUG
-        int i;
-#define HEX_OFFSET "\
-           +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F"
-        printk(HEX_OFFSET);
-        for (i=0; i<length; i++) {
-                if (i % 16 == 0) printk("\n%04X-%04X:", i, i+15);
-                printk(" %02X", *(p+i));
-        }
-        printk("\n");
-#endif
-}
diff --git a/drivers/staging/ks7010/ks_debug.h b/drivers/staging/ks7010/ks_debug.h
index 2fd5d8484b7f04..adad5f927dfda9 100644
--- a/drivers/staging/ks7010/ks_debug.h
+++ b/drivers/staging/ks7010/ks_debug.h
@@ -25,6 +25,4 @@
 #define DPRINTK(n, fmt, args...)
 #endif
 
-extern void print_buffer(unsigned char *p, int size);
-
 #endif /* _KS_DEBUG_H */
-- 
2.8.1

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

* [PATCH 09/27] staging: ks7010: delete seperate debug header
  2016-05-10 13:52 [PATCH 00/27] staging: add driver for KS7010 based SDIO cards Wolfram Sang
                   ` (6 preceding siblings ...)
  2016-05-10 13:52 ` [PATCH 08/27] staging: ks7010: use kernel helper to print buffer Wolfram Sang
@ 2016-05-10 13:52 ` Wolfram Sang
  2016-05-10 13:52 ` [PATCH 10/27] staging: ks7010: really iterate over multicast addresses Wolfram Sang
                   ` (19 subsequent siblings)
  27 siblings, 0 replies; 32+ messages in thread
From: Wolfram Sang @ 2016-05-10 13:52 UTC (permalink / raw)
  To: driverdev-devel; +Cc: Wolfram Sang, linux-renesas-soc

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

Move the one debug macro to the generic wlan header.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/staging/ks7010/ks7010_config.c |  1 -
 drivers/staging/ks7010/ks7010_sdio.c   |  1 -
 drivers/staging/ks7010/ks_debug.h      | 28 ----------------------------
 drivers/staging/ks7010/ks_hostif.c     |  1 -
 drivers/staging/ks7010/ks_wlan.h       |  7 +++++++
 drivers/staging/ks7010/ks_wlan_net.c   |  1 -
 6 files changed, 7 insertions(+), 32 deletions(-)
 delete mode 100644 drivers/staging/ks7010/ks_debug.h

diff --git a/drivers/staging/ks7010/ks7010_config.c b/drivers/staging/ks7010/ks7010_config.c
index abe99a52ae1ad8..7f273dafaf3583 100644
--- a/drivers/staging/ks7010/ks7010_config.c
+++ b/drivers/staging/ks7010/ks7010_config.c
@@ -4,7 +4,6 @@
 #include "ks_wlan.h"
 #include "ks_hostif.h"
 #include "ks_wlan_ioctl.h"
-#include "ks_debug.h"
 
 static int wep_on_off;
 #define	WEP_OFF		0
diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
index 1a1a43ff306aae..3fb432c9dd314d 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -19,7 +19,6 @@
 
 #include "ks_wlan.h"
 #include "ks_wlan_ioctl.h"
-#include "ks_debug.h"
 #include "ks_hostif.h"
 
 #include "ks7010_sdio.h"
diff --git a/drivers/staging/ks7010/ks_debug.h b/drivers/staging/ks7010/ks_debug.h
deleted file mode 100644
index adad5f927dfda9..00000000000000
--- a/drivers/staging/ks7010/ks_debug.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- *   Driver for KeyStream 11b/g wireless LAN cards.
- *   
- *   ks_debug.h
- *   $Id: ks_debug.h 991 2009-09-14 01:38:58Z sekine $
- *
- *   Copyright (C) 2005-2008 KeyStream Corp.
- *   Copyright (C) 2009 Renesas Technology Corp.
- *
- *   This program is free software; you can redistribute it and/or modify
- *   it undr the terms of the GNU General Public License version 2 as
- *   published by the Free Sotware Foundation.
- */
-
-#ifndef _KS_DEBUG_H
-#define _KS_DEBUG_H
-
-#include <linux/kernel.h>
-
-
-#ifdef KS_WLAN_DEBUG
-#define DPRINTK(n, fmt, args...) \
-                 if (KS_WLAN_DEBUG>(n)) printk(KERN_NOTICE "%s: "fmt, __FUNCTION__, ## args)
-#else
-#define DPRINTK(n, fmt, args...)
-#endif
-
-#endif /* _KS_DEBUG_H */
diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c
index 146a1357909b39..367d487cef1ba8 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -13,7 +13,6 @@
  */
 
 #include "ks_wlan.h"
-#include "ks_debug.h"
 #include "ks_hostif.h"
 #include "eap_packet.h"
 #include "michael_mic.h"
diff --git a/drivers/staging/ks7010/ks_wlan.h b/drivers/staging/ks7010/ks_wlan.h
index 6bd016414a4f1d..c460741c6606ee 100644
--- a/drivers/staging/ks7010/ks_wlan.h
+++ b/drivers/staging/ks7010/ks_wlan.h
@@ -38,6 +38,13 @@
 
 #include "ks7010_sdio.h"
 
+#ifdef KS_WLAN_DEBUG
+#define DPRINTK(n, fmt, args...) \
+                 if (KS_WLAN_DEBUG>(n)) printk(KERN_NOTICE "%s: "fmt, __FUNCTION__, ## args)
+#else
+#define DPRINTK(n, fmt, args...)
+#endif
+
 struct ks_wlan_parameter {
 	uint8_t		operation_mode;	   /* Operation Mode */
 	uint8_t		channel;	   /*  Channel */
diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c
index 776a544031495f..1da2768ea9f31b 100644
--- a/drivers/staging/ks7010/ks_wlan_net.c
+++ b/drivers/staging/ks7010/ks_wlan_net.c
@@ -40,7 +40,6 @@ static int wep_on_off;
 #include "ks_wlan.h"
 #include "ks_hostif.h"
 #include "ks_wlan_ioctl.h"
-#include "ks_debug.h"
 
 /* Include Wireless Extension definition and check version */
 #include <linux/wireless.h>
-- 
2.8.1

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

* [PATCH 10/27] staging: ks7010: really iterate over multicast addresses
  2016-05-10 13:52 [PATCH 00/27] staging: add driver for KS7010 based SDIO cards Wolfram Sang
                   ` (7 preceding siblings ...)
  2016-05-10 13:52 ` [PATCH 09/27] staging: ks7010: delete seperate debug header Wolfram Sang
@ 2016-05-10 13:52 ` Wolfram Sang
  2016-05-10 13:52 ` [PATCH 11/27] staging: ks7010: make loading config file optional Wolfram Sang
                   ` (18 subsequent siblings)
  27 siblings, 0 replies; 32+ messages in thread
From: Wolfram Sang @ 2016-05-10 13:52 UTC (permalink / raw)
  To: driverdev-devel; +Cc: Wolfram Sang, linux-renesas-soc

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

The loop variable was defined but not really used. Fix this.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.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 367d487cef1ba8..b0a0a53d3a00bf 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -2105,7 +2105,7 @@ void hostif_sme_multicast_set(ks_wlan_private *priv)
 	struct netdev_hw_addr *ha;
 	char	set_address[NIC_MAX_MCAST_LIST*ETH_ALEN];
 	unsigned long filter_type;
-	int i;
+	int i = 0;
 
 	DPRINTK(3,"\n");
 
@@ -2128,6 +2128,7 @@ void hostif_sme_multicast_set(ks_wlan_private *priv)
 			mc_count = netdev_mc_count(dev);
 			netdev_for_each_mc_addr(ha, dev) {
 				memcpy(&set_address[i*ETH_ALEN], ha->addr, ETH_ALEN);
+				i++;
 			}
 			priv->sme_i.sme_flag &= ~SME_MULTICAST;
 			hostif_mib_set_request(priv, LOCAL_MULTICAST_ADDRESS,
-- 
2.8.1

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

* [PATCH 11/27] staging: ks7010: make loading config file optional
  2016-05-10 13:52 [PATCH 00/27] staging: add driver for KS7010 based SDIO cards Wolfram Sang
                   ` (8 preceding siblings ...)
  2016-05-10 13:52 ` [PATCH 10/27] staging: ks7010: really iterate over multicast addresses Wolfram Sang
@ 2016-05-10 13:52 ` Wolfram Sang
  2016-05-10 13:52 ` [PATCH 12/27] staging: ks7010: fix printk format warnings Wolfram Sang
                   ` (17 subsequent siblings)
  27 siblings, 0 replies; 32+ messages in thread
From: Wolfram Sang @ 2016-05-10 13:52 UTC (permalink / raw)
  To: driverdev-devel; +Cc: Wolfram Sang, linux-renesas-soc

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

We have sane defaults, so we don't need to bail out if there is no
config file. Note that the config file should go away completely in
favour of configuration mechanisms already upstream.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/staging/ks7010/ks7010_config.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_config.c b/drivers/staging/ks7010/ks7010_config.c
index 7f273dafaf3583..06ff8852e17f33 100644
--- a/drivers/staging/ks7010/ks7010_config.c
+++ b/drivers/staging/ks7010/ks7010_config.c
@@ -203,7 +203,6 @@ int ks_wlan_read_config_file(ks_wlan_private *priv)
 
 	const struct firmware *fw_entry;
 	struct device *dev = NULL;
-	int retval;
 	char cfg_file[]=CFG_FILE;
 	char *cur_p, *end_p;
 	char wk_buff[256], *wk_p;
@@ -254,10 +253,9 @@ int ks_wlan_read_config_file(ks_wlan_private *priv)
 	priv->reg.rate_set.size = 12;
 
 	dev = &priv->ks_wlan_hw.sdio_card->func->dev;
-	if((retval = request_firmware(&fw_entry, cfg_file, dev)) !=0 ){
-		DPRINTK(1, "error request_firmware() file=%s ret=%d\n", cfg_file, retval);
-		return 1;
-	}
+	/* If no cfg file, stay with the defaults */
+	if (request_firmware_direct(&fw_entry, cfg_file, dev))
+		return 0;
 
 	DPRINTK(4, "success request_firmware() file=%s size=%d\n", cfg_file, fw_entry->size);
 	cur_p = fw_entry->data;
-- 
2.8.1

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

* [PATCH 12/27] staging: ks7010: fix printk format warnings
  2016-05-10 13:52 [PATCH 00/27] staging: add driver for KS7010 based SDIO cards Wolfram Sang
                   ` (9 preceding siblings ...)
  2016-05-10 13:52 ` [PATCH 11/27] staging: ks7010: make loading config file optional Wolfram Sang
@ 2016-05-10 13:52 ` Wolfram Sang
  2016-05-10 13:52 ` [PATCH 13/27] staging: ks7010: add example cfg file as a reference Wolfram Sang
                   ` (16 subsequent siblings)
  27 siblings, 0 replies; 32+ messages in thread
From: Wolfram Sang @ 2016-05-10 13:52 UTC (permalink / raw)
  To: driverdev-devel; +Cc: Wolfram Sang, linux-renesas-soc

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

Use proper type for size_t.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/staging/ks7010/ks7010_config.c | 2 +-
 drivers/staging/ks7010/ks7010_sdio.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_config.c b/drivers/staging/ks7010/ks7010_config.c
index 06ff8852e17f33..4b00d25cd8f575 100644
--- a/drivers/staging/ks7010/ks7010_config.c
+++ b/drivers/staging/ks7010/ks7010_config.c
@@ -257,7 +257,7 @@ int ks_wlan_read_config_file(ks_wlan_private *priv)
 	if (request_firmware_direct(&fw_entry, cfg_file, dev))
 		return 0;
 
-	DPRINTK(4, "success request_firmware() file=%s size=%d\n", cfg_file, fw_entry->size);
+	DPRINTK(4, "success request_firmware() file=%s size=%zu\n", cfg_file, fw_entry->size);
 	cur_p = fw_entry->data;
 	end_p = cur_p + fw_entry->size;
 	*end_p = '\0';
diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
index 3fb432c9dd314d..50364909449aec 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -750,7 +750,7 @@ static int ks79xx_upload_firmware(ks_wlan_private *priv, struct ks_sdio_card *ca
 		DPRINTK(1,"error request_firmware() file=%s\n", priv->reg.rom_file);
 		return 1;
 	}
-	DPRINTK(4,"success request_firmware() file=%s size=%d\n", priv->reg.rom_file, fw_entry->size);
+	DPRINTK(4,"success request_firmware() file=%s size=%zu\n", priv->reg.rom_file, fw_entry->size);
 	length = fw_entry->size;
 
 	/* Load Program */
-- 
2.8.1

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

* [PATCH 13/27] staging: ks7010: add example cfg file as a reference
  2016-05-10 13:52 [PATCH 00/27] staging: add driver for KS7010 based SDIO cards Wolfram Sang
                   ` (10 preceding siblings ...)
  2016-05-10 13:52 ` [PATCH 12/27] staging: ks7010: fix printk format warnings Wolfram Sang
@ 2016-05-10 13:52 ` Wolfram Sang
  2016-05-10 13:52 ` [PATCH 14/27] staging: ks7010: remove unecessary typedef Wolfram Sang
                   ` (15 subsequent siblings)
  27 siblings, 0 replies; 32+ messages in thread
From: Wolfram Sang @ 2016-05-10 13:52 UTC (permalink / raw)
  To: driverdev-devel; +Cc: Wolfram Sang, linux-renesas-soc

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

We want to remove it, but to do so properly, it is good to have a
working example. Needs to be copied to /lib/firmware in order to be
used.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/staging/ks7010/ks79xx.cfg | 116 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 116 insertions(+)
 create mode 100644 drivers/staging/ks7010/ks79xx.cfg

diff --git a/drivers/staging/ks7010/ks79xx.cfg b/drivers/staging/ks7010/ks79xx.cfg
new file mode 100644
index 00000000000000..0f2d24d4e66a89
--- /dev/null
+++ b/drivers/staging/ks7010/ks79xx.cfg
@@ -0,0 +1,116 @@
+#ks79xx.cfg
+#KS79xx configuration file
+#
+
+#
+#BeaconLostCount	default 20
+BeaconLostCount=20
+#
+
+#
+#Ap List Scan Type default ACTIVE_SCAN ACTIVE_SCAN or PASSIVE_SCAN
+ScanType=ACTIVE_SCAN
+#
+
+#
+#Channel		default 10		min 1 	max 14
+Channel=10
+#
+
+#
+#FragmentThreshold	default 2346		min 256	max 2346
+FragmentThreshold=2346
+#
+
+#
+#OperationMode		default Infrastructure	Pseudo-Ad-Hoc or 802.11-Ad-Hoc or Infrastructure
+OperationMode=Infrastructure
+#
+
+#
+#PowerManagementMode	default ACTIVE     ACTIVE or SAVE1 or SAVE2
+PowerManagementMode=ACTIVE
+#
+
+#
+#RTSThreshold		default 2347		min 0	max 2347
+RTSThreshold=2347
+#
+
+#
+#SSID			default ""		max 32 character
+SSID="default"
+#
+
+#
+#TxRate			default Auto		1, 2, 5.5, 11	ex. TxRate=1,2 TxRate=11 TxRate=Auto ...
+TxRate=Auto
+#
+
+#
+#Wep			default OFF		OFF or 64bit or 128bit
+Wep=OFF
+#
+
+#
+#WepType		default STRING		STRING or HEX
+WepType=STRING
+#
+
+#
+#WepIndex=1
+#
+
+#
+#WepKeyValue1
+#	character_wep_key:64bit key_length = 5;  128bit key_length = 13
+#	      hex_wep_key:64bit key_length = 10; 128bit key_length = 26
+#
+
+#
+#WepKeyValue2
+#	character_wep_key:64bit key_length = 5;  128bit key_length = 13
+#	      hex_wep_key:64bit key_length = 10; 128bit key_length = 26
+#
+
+#
+#WepKeyValue3
+#	character_wep_key:64bit key_length = 5;  128bit key_length = 13
+#	      hex_wep_key:64bit key_length = 10; 128bit key_length = 26
+#
+
+#
+#WepKeyValue4
+#	character_wep_key:64bit key_length = 5;  128bit key_length = 13
+#	      hex_wep_key:64bit key_length = 10; 128bit key_length = 26
+#
+
+#
+#AuthenticationAlgorithm default OPEN_SYSTEM	OPEN_SYSTEM or  SHARED_KEY
+AuthenticationAlgorithm=OPEN_SYSTEM
+#
+
+#
+#PREAMBLE_TYPE default LONG	LONG or  SHORT
+PREAMBLE_TYPE=SHORT
+#
+
+#
+# PhyType default BG_MODE	B_MODE, G_MODE or BG_MODE
+PhyType=BG_MODE
+#
+
+#
+# CtsMode defalut FALSE		TURE or FALSE
+CtsMode=FALSE
+#
+
+#
+# PhyInformationTimer defalut 0  uint 100msec 
+PhyInformationTimer=0
+#
+
+#
+#ROM_FILE default "ks7010sd.rom"
+ROM_FILE="ks7010sd.rom"
+#
-- 
2.8.1

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

* [PATCH 14/27] staging: ks7010: remove unecessary typedef
  2016-05-10 13:52 [PATCH 00/27] staging: add driver for KS7010 based SDIO cards Wolfram Sang
                   ` (11 preceding siblings ...)
  2016-05-10 13:52 ` [PATCH 13/27] staging: ks7010: add example cfg file as a reference Wolfram Sang
@ 2016-05-10 13:52 ` Wolfram Sang
  2016-05-10 13:52 ` [PATCH 15/27] staging: ks7010: indent eap_packet.h Wolfram Sang
                   ` (14 subsequent siblings)
  27 siblings, 0 replies; 32+ messages in thread
From: Wolfram Sang @ 2016-05-10 13:52 UTC (permalink / raw)
  To: driverdev-devel; +Cc: Wolfram Sang, linux-renesas-soc

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

Let's simply specify the struct to keep in sync with kernel coding
style.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/staging/ks7010/ks7010_config.c |   4 +-
 drivers/staging/ks7010/ks7010_sdio.c   |  44 ++++-----
 drivers/staging/ks7010/ks7010_sdio.h   |   2 +-
 drivers/staging/ks7010/ks_hostif.c     | 114 +++++++++++-----------
 drivers/staging/ks7010/ks_hostif.h     |  10 +-
 drivers/staging/ks7010/ks_wlan.h       |   4 +-
 drivers/staging/ks7010/ks_wlan_ioctl.h |   4 +-
 drivers/staging/ks7010/ks_wlan_net.c   | 168 ++++++++++++++++-----------------
 8 files changed, 175 insertions(+), 175 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_config.c b/drivers/staging/ks7010/ks7010_config.c
index 4b00d25cd8f575..48809bcc779739 100644
--- a/drivers/staging/ks7010/ks7010_config.c
+++ b/drivers/staging/ks7010/ks7010_config.c
@@ -87,7 +87,7 @@ void analyze_hex_wep_key(struct ks_wlan_parameter *param, int wep_key_index, cha
 }
 
 static
-int rate_set_configuration(ks_wlan_private *priv, char *value)
+int rate_set_configuration(struct ks_wlan_private *priv, char *value)
 {
 	int rc=0;
 
@@ -169,7 +169,7 @@ int rate_set_configuration(ks_wlan_private *priv, char *value)
 }
 
 #include <linux/firmware.h>
-int ks_wlan_read_config_file(ks_wlan_private *priv)
+int ks_wlan_read_config_file(struct ks_wlan_private *priv)
 {
 	struct {
 		const int key_len;
diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
index 50364909449aec..fb9f0b533d867e 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -51,9 +51,9 @@ static struct ks_sdio_model ks_sdio_models[] = {
 static int ks7910_sdio_probe(struct sdio_func *function, const struct sdio_device_id *device);
 static void ks7910_sdio_remove(struct sdio_func *function);
 static void ks7010_rw_function(struct work_struct *work);
-static int ks7010_sdio_read( ks_wlan_private *priv, unsigned int address,
+static int ks7010_sdio_read( struct ks_wlan_private *priv, unsigned int address,
 			     unsigned char *buffer, int length );
-static int ks7010_sdio_write( ks_wlan_private *priv, unsigned int address,
+static int ks7010_sdio_write( struct ks_wlan_private *priv, unsigned int address,
 			      unsigned char *buffer, int length );
 /* macro */
 
@@ -71,7 +71,7 @@ static int ks7010_sdio_write( ks_wlan_private *priv, unsigned int address,
 #define cnt_rxqbody(priv) \
         (((priv->rx_dev.qtail + RX_DEVICE_BUFF_SIZE) - (priv->rx_dev.qhead)) % RX_DEVICE_BUFF_SIZE )
 
-void ks_wlan_hw_sleep_doze_request(ks_wlan_private *priv)
+void ks_wlan_hw_sleep_doze_request(struct ks_wlan_private *priv)
 {
 	unsigned char rw_data;
 	int retval;
@@ -102,7 +102,7 @@ out:
 	return;
 }
 
-void ks_wlan_hw_sleep_wakeup_request(ks_wlan_private *priv)
+void ks_wlan_hw_sleep_wakeup_request(struct ks_wlan_private *priv)
 {
 	unsigned char rw_data;
 	int retval;
@@ -134,7 +134,7 @@ out:
 }
 
 
-void ks_wlan_hw_wakeup_request(ks_wlan_private *priv)
+void ks_wlan_hw_wakeup_request(struct ks_wlan_private *priv)
 {
 	unsigned char rw_data;
 	int retval;
@@ -155,7 +155,7 @@ void ks_wlan_hw_wakeup_request(ks_wlan_private *priv)
 	}
 }
 
-int _ks_wlan_hw_power_save(ks_wlan_private *priv)
+int _ks_wlan_hw_power_save(struct ks_wlan_private *priv)
 {
 	int rc=0;
 	unsigned char rw_data;
@@ -220,13 +220,13 @@ int _ks_wlan_hw_power_save(ks_wlan_private *priv)
 	return rc;
 }
 
-int ks_wlan_hw_power_save(ks_wlan_private *priv)
+int ks_wlan_hw_power_save(struct ks_wlan_private *priv)
 {
 	queue_delayed_work(priv->ks_wlan_hw.ks7010sdio_wq,&priv->ks_wlan_hw.rw_wq, 1);
 	return 0;
 }
 
-static int ks7010_sdio_read(ks_wlan_private *priv, unsigned int address,
+static int ks7010_sdio_read(struct ks_wlan_private *priv, unsigned int address,
 			    unsigned char *buffer, int length)
 {
 	int rc = -1;
@@ -249,7 +249,7 @@ static int ks7010_sdio_read(ks_wlan_private *priv, unsigned int address,
 	return rc;
 }
 
-static int ks7010_sdio_write(ks_wlan_private *priv, unsigned int address,
+static int ks7010_sdio_write(struct ks_wlan_private *priv, unsigned int address,
 			     unsigned char *buffer, int length)
 {
 	int rc = -1;
@@ -272,7 +272,7 @@ static int ks7010_sdio_write(ks_wlan_private *priv, unsigned int address,
 	return rc;
 }
 
-static int enqueue_txdev(ks_wlan_private *priv, unsigned char *p, unsigned long size,
+static int enqueue_txdev(struct ks_wlan_private *priv, unsigned char *p, unsigned long size,
 		  void (*complete_handler)(void *arg1, void *arg2),
 		  void *arg1, void *arg2 )
 {
@@ -306,7 +306,7 @@ static int enqueue_txdev(ks_wlan_private *priv, unsigned char *p, unsigned long
 }
 
 /* write data */
-static int write_to_device(ks_wlan_private *priv, unsigned char *buffer, unsigned long size )
+static int write_to_device(struct ks_wlan_private *priv, unsigned char *buffer, unsigned long size )
 {
 	int rc,retval;
 	unsigned char rw_data;
@@ -338,7 +338,7 @@ static int write_to_device(ks_wlan_private *priv, unsigned char *buffer, unsigne
 
 static void tx_device_task(void *dev)
 {
-	ks_wlan_private	*priv = (ks_wlan_private *)dev;
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)dev;
 	struct tx_device_buffer	*sp;
 	int rc = 0;
 
@@ -366,7 +366,7 @@ static void tx_device_task(void *dev)
 	return;
 }
 
-int ks_wlan_hw_tx( ks_wlan_private *priv, void *p, unsigned long size,
+int ks_wlan_hw_tx( struct ks_wlan_private *priv, void *p, unsigned long size,
 		   void (*complete_handler)(void *arg1, void *arg2),
 		   void *arg1, void *arg2 )
 {
@@ -396,7 +396,7 @@ int ks_wlan_hw_tx( ks_wlan_private *priv, void *p, unsigned long size,
 
 static void rx_event_task(unsigned long dev)
 {
-        ks_wlan_private *priv = (ks_wlan_private *)dev;
+        struct ks_wlan_private *priv = (struct ks_wlan_private *)dev;
 	struct rx_device_buffer	*rp;
 
 	DPRINTK(4,"\n");
@@ -416,7 +416,7 @@ static void rx_event_task(unsigned long dev)
 
 static void ks_wlan_hw_rx(void *dev, uint16_t size)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)dev;
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)dev;
 	int retval;
 	struct rx_device_buffer *rx_buffer;
 	struct hostif_hdr *hdr;
@@ -560,7 +560,7 @@ static void ks_sdio_interrupt(struct sdio_func *func)
 {
 	int retval;
 	struct ks_sdio_card *card;
-	ks_wlan_private *priv;
+	struct ks_wlan_private *priv;
 	unsigned char status, rsize, rw_data;
 
 	card = sdio_get_drvdata(func);
@@ -643,7 +643,7 @@ intr_out:
 	return;
 }
 
-static int trx_device_init( ks_wlan_private *priv )
+static int trx_device_init( struct ks_wlan_private *priv )
 {
 	/* initialize values (tx) */
 	priv->tx_dev.qtail = priv->tx_dev.qhead = 0;
@@ -660,7 +660,7 @@ static int trx_device_init( ks_wlan_private *priv )
 	return 0;
 }
 
-static void trx_device_exit( ks_wlan_private *priv )
+static void trx_device_exit( struct ks_wlan_private *priv )
 {
 	struct tx_device_buffer	*sp;
 
@@ -677,7 +677,7 @@ static void trx_device_exit( ks_wlan_private *priv )
 
 	return;
 }
-static int ks7010_sdio_update_index(ks_wlan_private *priv, u32 index)
+static int ks7010_sdio_update_index(struct ks_wlan_private *priv, u32 index)
 {
 	int rc=0;
 	int retval;
@@ -699,7 +699,7 @@ error_out:
 }
 
 #define ROM_BUFF_SIZE (64*1024)
-static int ks7010_sdio_data_compare(ks_wlan_private *priv, u32 address,
+static int ks7010_sdio_data_compare(struct ks_wlan_private *priv, u32 address,
 				    unsigned char *data, unsigned int size)
 {
 	int rc=0;
@@ -720,7 +720,7 @@ error_out:
 	return rc;
 }
 #include <linux/firmware.h>
-static int ks79xx_upload_firmware(ks_wlan_private *priv, struct ks_sdio_card *card)
+static int ks79xx_upload_firmware(struct ks_wlan_private *priv, struct ks_sdio_card *card)
 {
 	unsigned int	size, offset,  n = 0;
 	unsigned char	*rom_buf;
@@ -886,7 +886,7 @@ extern int ks_wlan_net_stop(struct net_device *dev);
 
 static int ks7910_sdio_probe(struct sdio_func *func, const struct sdio_device_id *device)
 {
-	ks_wlan_private *priv;
+	struct ks_wlan_private *priv;
 	struct ks_sdio_card *card;
 	struct net_device *netdev;
 	unsigned char rw_data;
diff --git a/drivers/staging/ks7010/ks7010_sdio.h b/drivers/staging/ks7010/ks7010_sdio.h
index 93823837f19e65..1d16673e5dae02 100644
--- a/drivers/staging/ks7010/ks7010_sdio.h
+++ b/drivers/staging/ks7010/ks7010_sdio.h
@@ -110,7 +110,7 @@ struct ks_sdio_packet {
 
 struct ks_sdio_card {
 	struct sdio_func	*func;
-	struct ks_wlan_private	*priv;
+	struct ks_wlan_private *priv;
 	int			model;
 	const char		*firmware;
         spinlock_t              lock;
diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c
index b0a0a53d3a00bf..497b8aaf6daef8 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -23,13 +23,13 @@
 /* Include Wireless Extension definition and check version */
 #include <net/iw_handler.h>	/* New driver API */
 
-extern int ks_wlan_hw_tx(ks_wlan_private *priv, void *p, unsigned long size,
+extern int ks_wlan_hw_tx(struct ks_wlan_private *priv, void *p, unsigned long size,
 			 void (*complete_handler)(void *arg1, void *arg2),
 			 void *arg1, void *arg2 );
 extern void send_packet_complete(void *, void *);
 
-extern void ks_wlan_hw_wakeup_request(ks_wlan_private *priv);
-extern int ks_wlan_hw_power_save(ks_wlan_private *priv);
+extern void ks_wlan_hw_wakeup_request(struct ks_wlan_private *priv);
+extern int ks_wlan_hw_power_save(struct ks_wlan_private *priv);
 
 /* macro */
 #define inc_smeqhead(priv) \
@@ -42,7 +42,7 @@ extern int ks_wlan_hw_power_save(ks_wlan_private *priv);
 #define KS_WLAN_MEM_FLAG (GFP_ATOMIC)
 
 static
-inline u8 get_BYTE(ks_wlan_private *priv)
+inline u8 get_BYTE(struct ks_wlan_private *priv)
 {
 	u8 data;
 	data = *(priv->rxp)++;
@@ -52,7 +52,7 @@ inline u8 get_BYTE(ks_wlan_private *priv)
 }
 
 static
-inline u16 get_WORD(ks_wlan_private *priv)
+inline u16 get_WORD(struct ks_wlan_private *priv)
 {
 	u16 data;
 	data  = (get_BYTE(priv) & 0xff);
@@ -61,7 +61,7 @@ inline u16 get_WORD(ks_wlan_private *priv)
 }
 
 static
-inline u32 get_DWORD(ks_wlan_private *priv)
+inline u32 get_DWORD(struct ks_wlan_private *priv)
 {
 	u32 data;
 	data  = (get_BYTE(priv) & 0xff);
@@ -73,7 +73,7 @@ inline u32 get_DWORD(ks_wlan_private *priv)
 
 void ks_wlan_hw_wakeup_task(struct work_struct *work)
 {
-	ks_wlan_private *priv = container_of(work, struct ks_wlan_private, ks_wlan_wakeup_task);
+	struct ks_wlan_private *priv = container_of(work, struct ks_wlan_private, ks_wlan_wakeup_task);
 	int ps_status = atomic_read(&priv->psstatus.status);
 
 	if(ps_status==PS_SNOOZE){
@@ -96,7 +96,7 @@ void ks_wlan_hw_wakeup_task(struct work_struct *work)
 }
 
 static
-int ks_wlan_do_power_save(ks_wlan_private *priv)
+int ks_wlan_do_power_save(struct ks_wlan_private *priv)
 {
 	int rc=0;
 
@@ -112,7 +112,7 @@ int ks_wlan_do_power_save(ks_wlan_private *priv)
 }
 
 static
-int get_current_ap(ks_wlan_private *priv, struct link_ap_info_t *ap_info)
+int get_current_ap(struct ks_wlan_private *priv, struct link_ap_info_t *ap_info)
 {
 	struct local_ap_t *ap;
 	union iwreq_data wrqu;
@@ -213,7 +213,7 @@ int get_current_ap(ks_wlan_private *priv, struct link_ap_info_t *ap_info)
 }
 
 static
-int get_ap_information(ks_wlan_private *priv, struct ap_info_t *ap_info, struct local_ap_t *ap)
+int get_ap_information(struct ks_wlan_private *priv, struct ap_info_t *ap_info, struct local_ap_t *ap)
 {
 	unsigned char *bp;
 	int bsize,offset;
@@ -312,7 +312,7 @@ int get_ap_information(ks_wlan_private *priv, struct ap_info_t *ap_info, struct
 }
 
 static
-void hostif_data_indication(ks_wlan_private *priv)
+void hostif_data_indication(struct ks_wlan_private *priv)
 {
 	unsigned int	rx_ind_size;	/* indicate data size */
 	struct sk_buff *skb;
@@ -491,7 +491,7 @@ void hostif_data_indication(ks_wlan_private *priv)
 }
 
 static
-void hostif_mib_get_confirm(ks_wlan_private *priv)
+void hostif_mib_get_confirm(struct ks_wlan_private *priv)
 {
 	struct net_device *dev=priv->net_dev;
 	uint32_t	mib_status;
@@ -570,7 +570,7 @@ void hostif_mib_get_confirm(ks_wlan_private *priv)
 }
 
 static
-void hostif_mib_set_confirm(ks_wlan_private *priv)
+void hostif_mib_set_confirm(struct ks_wlan_private *priv)
 {
 	uint32_t	mib_status;	/* +04 MIB Status */
 	uint32_t	mib_attribute;	/* +08 MIB attribute */
@@ -691,7 +691,7 @@ void hostif_mib_set_confirm(ks_wlan_private *priv)
 }
 
 static
-void hostif_power_mngmt_confirm(ks_wlan_private *priv)
+void hostif_power_mngmt_confirm(struct ks_wlan_private *priv)
 {
 	DPRINTK(3,"\n");
 
@@ -707,7 +707,7 @@ void hostif_power_mngmt_confirm(ks_wlan_private *priv)
 }
 
 static
-void hostif_sleep_confirm(ks_wlan_private *priv)
+void hostif_sleep_confirm(struct ks_wlan_private *priv)
 {
 	DPRINTK(3,"\n");
 
@@ -716,7 +716,7 @@ void hostif_sleep_confirm(ks_wlan_private *priv)
 }
 
 static
-void hostif_start_confirm(ks_wlan_private *priv)
+void hostif_start_confirm(struct ks_wlan_private *priv)
 {
 #ifdef  WPS
        union iwreq_data        wrqu;
@@ -734,7 +734,7 @@ void hostif_start_confirm(ks_wlan_private *priv)
 }
 
 static
-void hostif_connect_indication(ks_wlan_private *priv)
+void hostif_connect_indication(struct ks_wlan_private *priv)
 {
 	unsigned short connect_code;
 	unsigned int tmp=0;
@@ -789,7 +789,7 @@ void hostif_connect_indication(ks_wlan_private *priv)
 }
 
 static
-void hostif_scan_indication(ks_wlan_private *priv)
+void hostif_scan_indication(struct ks_wlan_private *priv)
 {
 	int i;
 	struct ap_info_t *ap_info;
@@ -820,7 +820,7 @@ void hostif_scan_indication(ks_wlan_private *priv)
 }
 
 static
-void hostif_stop_confirm(ks_wlan_private *priv)
+void hostif_stop_confirm(struct ks_wlan_private *priv)
 {
 	unsigned int tmp=0;
 	unsigned int old_status=priv->connect_status;
@@ -856,7 +856,7 @@ void hostif_stop_confirm(ks_wlan_private *priv)
 }
 
 static
-void hostif_ps_adhoc_set_confirm(ks_wlan_private *priv)
+void hostif_ps_adhoc_set_confirm(struct ks_wlan_private *priv)
 {
 	DPRINTK(3,"\n");
 	priv->infra_status = 0; /* infrastructure mode cancel */
@@ -865,7 +865,7 @@ void hostif_ps_adhoc_set_confirm(ks_wlan_private *priv)
 }
 
 static
-void hostif_infrastructure_set_confirm(ks_wlan_private *priv)
+void hostif_infrastructure_set_confirm(struct ks_wlan_private *priv)
 {
 	uint16_t result_code;
 	DPRINTK(3,"\n");
@@ -876,7 +876,7 @@ void hostif_infrastructure_set_confirm(ks_wlan_private *priv)
 }
 
 static
-void hostif_adhoc_set_confirm(ks_wlan_private *priv)
+void hostif_adhoc_set_confirm(struct ks_wlan_private *priv)
 {
 	DPRINTK(3,"\n");
 	priv->infra_status = 1; /* infrastructure mode set */
@@ -884,7 +884,7 @@ void hostif_adhoc_set_confirm(ks_wlan_private *priv)
 }
 
 static
-void hostif_associate_indication(ks_wlan_private *priv)
+void hostif_associate_indication(struct ks_wlan_private *priv)
 {
 	struct association_request_t *assoc_req;
 	struct association_response_t *assoc_resp;
@@ -928,7 +928,7 @@ void hostif_associate_indication(ks_wlan_private *priv)
 }
 
 static
-void hostif_bss_scan_confirm(ks_wlan_private *priv)
+void hostif_bss_scan_confirm(struct ks_wlan_private *priv)
 {
 	unsigned int result_code;
 	struct net_device *dev = priv->net_dev;
@@ -947,7 +947,7 @@ void hostif_bss_scan_confirm(ks_wlan_private *priv)
 }
 
 static
-void hostif_phy_information_confirm(ks_wlan_private *priv)
+void hostif_phy_information_confirm(struct ks_wlan_private *priv)
 {
 	struct iw_statistics *wstats = &priv->wstats;
 	unsigned char rssi,signal,noise;
@@ -983,7 +983,7 @@ void hostif_phy_information_confirm(ks_wlan_private *priv)
 }
 
 static
-void hostif_mic_failure_confirm(ks_wlan_private *priv)
+void hostif_mic_failure_confirm(struct ks_wlan_private *priv)
 {
 	DPRINTK(3,"mic_failure=%u\n",priv->wpa.mic_failure.failure);
 	hostif_sme_enqueue(priv, SME_MIC_FAILURE_CONFIRM);
@@ -991,7 +991,7 @@ void hostif_mic_failure_confirm(ks_wlan_private *priv)
 
 
 static
-void hostif_event_check(ks_wlan_private *priv)
+void hostif_event_check(struct ks_wlan_private *priv)
 {
 	unsigned short event;
 
@@ -1065,7 +1065,7 @@ void hostif_event_check(ks_wlan_private *priv)
 
 #define CHECK_ALINE(size) (size%4 ? (size+(4-(size%4))):size)
 
-int hostif_data_request(ks_wlan_private *priv, struct sk_buff *packet)
+int hostif_data_request(struct ks_wlan_private *priv, struct sk_buff *packet)
 {
 	unsigned int		packet_len=0;
 
@@ -1231,7 +1231,7 @@ int hostif_data_request(ks_wlan_private *priv, struct sk_buff *packet)
                                       } }while(0)
 
 static
-void hostif_mib_get_request( ks_wlan_private *priv, unsigned long mib_attribute)
+void hostif_mib_get_request( struct ks_wlan_private *priv, unsigned long mib_attribute)
 {
 	struct hostif_mib_get_request_t *pp;
 
@@ -1253,7 +1253,7 @@ void hostif_mib_get_request( ks_wlan_private *priv, unsigned long mib_attribute)
 }
 
 static
-void hostif_mib_set_request( ks_wlan_private *priv, unsigned long mib_attribute,
+void hostif_mib_set_request( struct ks_wlan_private *priv, unsigned long mib_attribute,
 			     unsigned short size, unsigned short type,
 			     void *vp )
 {
@@ -1286,7 +1286,7 @@ void hostif_mib_set_request( ks_wlan_private *priv, unsigned long mib_attribute,
 }
 
 static
-void hostif_start_request( ks_wlan_private *priv, unsigned char mode )
+void hostif_start_request( struct ks_wlan_private *priv, unsigned char mode )
 {
 	struct hostif_start_request_t *pp;
 
@@ -1311,7 +1311,7 @@ void hostif_start_request( ks_wlan_private *priv, unsigned char mode )
 }
 
 static
-void hostif_ps_adhoc_set_request(ks_wlan_private *priv)
+void hostif_ps_adhoc_set_request(struct ks_wlan_private *priv)
 {
 	struct hostif_ps_adhoc_set_request_t *pp;
 	uint16_t capability;
@@ -1352,7 +1352,7 @@ void hostif_ps_adhoc_set_request(ks_wlan_private *priv)
 }
 
 static
-void hostif_infrastructure_set_request(ks_wlan_private *priv)
+void hostif_infrastructure_set_request(struct ks_wlan_private *priv)
 {
 	struct hostif_infrastructure_set_request_t *pp;
 	uint16_t capability;
@@ -1415,7 +1415,7 @@ void hostif_infrastructure_set_request(ks_wlan_private *priv)
 	ks_wlan_hw_tx( priv, pp, hif_align_size(sizeof(*pp)),NULL, NULL, NULL);
 }
 
-void hostif_infrastructure_set2_request(ks_wlan_private *priv)
+void hostif_infrastructure_set2_request(struct ks_wlan_private *priv)
 {
 	struct hostif_infrastructure_set2_request_t *pp;
 	uint16_t capability;
@@ -1481,7 +1481,7 @@ void hostif_infrastructure_set2_request(ks_wlan_private *priv)
 }
 
 static
-void hostif_adhoc_set_request(ks_wlan_private *priv)
+void hostif_adhoc_set_request(struct ks_wlan_private *priv)
 {
 	struct hostif_adhoc_set_request_t *pp;
 	uint16_t capability;
@@ -1524,7 +1524,7 @@ void hostif_adhoc_set_request(ks_wlan_private *priv)
 }
 
 static
-void hostif_adhoc_set2_request(ks_wlan_private *priv)
+void hostif_adhoc_set2_request(struct ks_wlan_private *priv)
 {
 	struct hostif_adhoc_set2_request_t *pp;
 	uint16_t capability;
@@ -1570,7 +1570,7 @@ void hostif_adhoc_set2_request(ks_wlan_private *priv)
 }
 
 static
-void hostif_stop_request( ks_wlan_private *priv )
+void hostif_stop_request( struct ks_wlan_private *priv )
 {
 	struct hostif_stop_request_t *pp;
 
@@ -1591,7 +1591,7 @@ void hostif_stop_request( ks_wlan_private *priv )
 }
 
 static
-void hostif_phy_information_request( ks_wlan_private *priv )
+void hostif_phy_information_request( struct ks_wlan_private *priv )
 {
 	struct hostif_phy_information_request_t *pp;
 
@@ -1619,7 +1619,7 @@ void hostif_phy_information_request( ks_wlan_private *priv )
 }
 
 static
-void hostif_power_mngmt_request( ks_wlan_private *priv, unsigned long mode,
+void hostif_power_mngmt_request( struct ks_wlan_private *priv, unsigned long mode,
 				 unsigned long wake_up, unsigned long receiveDTIMs )
 {
 	struct hostif_power_mngmt_request_t *pp;
@@ -1643,7 +1643,7 @@ void hostif_power_mngmt_request( ks_wlan_private *priv, unsigned long mode,
 }
 
 static
-void hostif_sleep_request( ks_wlan_private *priv, unsigned long mode)
+void hostif_sleep_request( struct ks_wlan_private *priv, unsigned long mode)
 {
 	struct hostif_sleep_request_t *pp;
 
@@ -1673,7 +1673,7 @@ void hostif_sleep_request( ks_wlan_private *priv, unsigned long mode)
 
 
 static
-void hostif_bss_scan_request( ks_wlan_private *priv, unsigned long scan_type , uint8_t *scan_ssid, uint8_t scan_ssid_len)
+void hostif_bss_scan_request( struct ks_wlan_private *priv, unsigned long scan_type , uint8_t *scan_ssid, uint8_t scan_ssid_len)
 {
 	struct hostif_bss_scan_request_t *pp;
 
@@ -1727,7 +1727,7 @@ void hostif_bss_scan_request( ks_wlan_private *priv, unsigned long scan_type , u
 }
 
 static
-void hostif_mic_failure_request( ks_wlan_private *priv, unsigned short failure_count,
+void hostif_mic_failure_request( struct ks_wlan_private *priv, unsigned short failure_count,
 				 unsigned short timer )
 {
 	struct hostif_mic_failure_request_t *pp;
@@ -1750,7 +1750,7 @@ void hostif_mic_failure_request( ks_wlan_private *priv, unsigned short failure_c
 }
 
 /* Device I/O Recieve indicate */
-static void devio_rec_ind(ks_wlan_private *priv, unsigned char *p, unsigned int size)
+static void devio_rec_ind(struct ks_wlan_private *priv, unsigned char *p, unsigned int size)
 {
 	if (priv->device_open_status) {
 		spin_lock(&priv->dev_read_lock); /* request spin lock */
@@ -1772,7 +1772,7 @@ static void devio_rec_ind(ks_wlan_private *priv, unsigned char *p, unsigned int
 	}
 }
 
-void hostif_receive( ks_wlan_private *priv, unsigned char *p, unsigned int size )
+void hostif_receive( struct ks_wlan_private *priv, unsigned char *p, unsigned int size )
 {
 	DPRINTK(4,"\n");
 
@@ -1788,7 +1788,7 @@ void hostif_receive( ks_wlan_private *priv, unsigned char *p, unsigned int size
 
 
 static
-void hostif_sme_set_wep(ks_wlan_private *priv, int type)
+void hostif_sme_set_wep(struct ks_wlan_private *priv, int type)
 {
 	uint32_t val;
 	switch(type){
@@ -1844,7 +1844,7 @@ struct rsn_mode_t {
 } __attribute__((packed));
 
 static
-void hostif_sme_set_rsn(ks_wlan_private *priv, int type)
+void hostif_sme_set_rsn(struct ks_wlan_private *priv, int type)
 {
 	struct wpa_suite_t wpa_suite;
 	struct rsn_mode_t rsn_mode;
@@ -1991,7 +1991,7 @@ void hostif_sme_set_rsn(ks_wlan_private *priv, int type)
 }
 
 static
-void hostif_sme_mode_setup(ks_wlan_private *priv)
+void hostif_sme_mode_setup(struct ks_wlan_private *priv)
 {
 	unsigned char rate_size;
 	unsigned char rate_octet[RATE_SET_MAX_SIZE];
@@ -2097,7 +2097,7 @@ void hostif_sme_mode_setup(ks_wlan_private *priv)
 }
 
 static
-void hostif_sme_multicast_set(ks_wlan_private *priv)
+void hostif_sme_multicast_set(struct ks_wlan_private *priv)
 {
 
         struct net_device *dev = priv->net_dev;
@@ -2146,7 +2146,7 @@ void hostif_sme_multicast_set(ks_wlan_private *priv)
 }
 
 static
-void hostif_sme_powermgt_set(ks_wlan_private *priv)
+void hostif_sme_powermgt_set(struct ks_wlan_private *priv)
 {
 	unsigned long mode,wake_up,receiveDTIMs ;
 
@@ -2191,7 +2191,7 @@ void hostif_sme_powermgt_set(ks_wlan_private *priv)
 }
 
 static
-void hostif_sme_sleep_set(ks_wlan_private *priv)
+void hostif_sme_sleep_set(struct ks_wlan_private *priv)
 {
 	DPRINTK(3,"\n");
 	switch(priv->sleep_mode){
@@ -2209,7 +2209,7 @@ void hostif_sme_sleep_set(ks_wlan_private *priv)
 }
 
 static
-void hostif_sme_set_key(ks_wlan_private *priv, int type)
+void hostif_sme_set_key(struct ks_wlan_private *priv, int type)
 {
 	uint32_t val;
 	switch(type){
@@ -2265,7 +2265,7 @@ void hostif_sme_set_key(ks_wlan_private *priv, int type)
 }
 
 static
-void hostif_sme_set_pmksa(ks_wlan_private *priv)
+void hostif_sme_set_pmksa(struct ks_wlan_private *priv)
 {
 	struct pmk_cache_t {
 		uint16_t size;
@@ -2296,7 +2296,7 @@ void hostif_sme_set_pmksa(ks_wlan_private *priv)
 
 /* execute sme */
 static
-void hostif_sme_execute(ks_wlan_private *priv, int event)
+void hostif_sme_execute(struct ks_wlan_private *priv, int event)
 {
 	uint32_t val;
 
@@ -2459,7 +2459,7 @@ void hostif_sme_execute(ks_wlan_private *priv, int event)
 static
 void hostif_sme_task( unsigned long dev )
 {
-	ks_wlan_private	*priv = (ks_wlan_private *)dev;
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)dev;
 
 	DPRINTK(3,"\n");
 
@@ -2475,7 +2475,7 @@ void hostif_sme_task( unsigned long dev )
 }
 
 /* send to Station Management Entity module */
-void hostif_sme_enqueue(ks_wlan_private *priv, unsigned short event)
+void hostif_sme_enqueue(struct ks_wlan_private *priv, unsigned short event)
 {
 	DPRINTK(3,"\n");
 
@@ -2500,7 +2500,7 @@ void hostif_sme_enqueue(ks_wlan_private *priv, unsigned short event)
 
 }
 
-int hostif_init( ks_wlan_private *priv )
+int hostif_init( struct ks_wlan_private *priv )
 {
 	int rc=0;
 	int i;
@@ -2555,7 +2555,7 @@ int hostif_init( ks_wlan_private *priv )
 	return rc;
 }
 
-void hostif_exit( ks_wlan_private *priv )
+void hostif_exit( struct ks_wlan_private *priv )
 {
 	tasklet_kill(&priv->sme_task);
 	return;
diff --git a/drivers/staging/ks7010/ks_hostif.h b/drivers/staging/ks7010/ks_hostif.h
index 24ebf1ded78e44..c333ce1a4baa6e 100644
--- a/drivers/staging/ks7010/ks_hostif.h
+++ b/drivers/staging/ks7010/ks_hostif.h
@@ -623,11 +623,11 @@ enum {
 #include "ks_wlan.h"
 
 /* function prototype */
-extern int hostif_data_request( ks_wlan_private *priv, struct sk_buff *packet );
-extern void hostif_receive( ks_wlan_private *priv, unsigned char *p, unsigned int size );
-extern void hostif_sme_enqueue(ks_wlan_private *priv, uint16_t event);
-extern int hostif_init( ks_wlan_private *priv );
-extern void hostif_exit( ks_wlan_private *priv );
+extern int hostif_data_request( struct ks_wlan_private *priv, struct sk_buff *packet );
+extern void hostif_receive( struct ks_wlan_private *priv, unsigned char *p, unsigned int size );
+extern void hostif_sme_enqueue(struct ks_wlan_private *priv, uint16_t event);
+extern int hostif_init( struct ks_wlan_private *priv );
+extern void hostif_exit( struct ks_wlan_private *priv );
 
 static
 inline int hif_align_size(int size)
diff --git a/drivers/staging/ks7010/ks_wlan.h b/drivers/staging/ks7010/ks_wlan.h
index c460741c6606ee..58e3a5a6b44472 100644
--- a/drivers/staging/ks7010/ks_wlan.h
+++ b/drivers/staging/ks7010/ks_wlan.h
@@ -414,7 +414,7 @@ struct wps_status_t {
 };
 #endif /* WPS */
 
-typedef struct ks_wlan_private{
+struct ks_wlan_private {
 
 	struct hw_info_t ks_wlan_hw;  /* hardware information */
 
@@ -505,7 +505,7 @@ typedef struct ks_wlan_private{
 	uint   sdio_error_count;  /* SDIO error */
 	uint   wakeup_count;      /* for detect wakeup loop */
 	
-} ks_wlan_private; 
+};
 
 
 
diff --git a/drivers/staging/ks7010/ks_wlan_ioctl.h b/drivers/staging/ks7010/ks_wlan_ioctl.h
index e27f8fb5d8eeb2..e7469f7338f7af 100644
--- a/drivers/staging/ks7010/ks_wlan_ioctl.h
+++ b/drivers/staging/ks7010/ks_wlan_ioctl.h
@@ -61,8 +61,8 @@
 #include "ks_wlan.h"
 #include <linux/netdevice.h>
 
-extern int ks_wlan_read_config_file(ks_wlan_private *priv);
-extern int ks_wlan_setup_parameter(ks_wlan_private *priv, unsigned int commit_flag);
+extern int ks_wlan_read_config_file(struct ks_wlan_private *priv);
+extern int ks_wlan_setup_parameter(struct ks_wlan_private *priv, unsigned int commit_flag);
 
 #endif /* __KERNEL__ */
 
diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c
index 1da2768ea9f31b..ec5c452f367262 100644
--- a/drivers/staging/ks7010/ks_wlan_net.c
+++ b/drivers/staging/ks7010/ks_wlan_net.c
@@ -73,7 +73,7 @@ static const struct iw_handler_def	ks_wlan_handler_def;
 /*
  *	function prototypes
  */
-extern int ks_wlan_hw_tx(ks_wlan_private *priv, void *p, unsigned long size,
+extern int ks_wlan_hw_tx(struct ks_wlan_private *priv, void *p, unsigned long size,
 			void (*complete_handler)(void *arg1, void *arg2),
 			void *arg1,
 			void *arg2 );
@@ -89,7 +89,7 @@ static int ks_wlan_netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cm
 static atomic_t update_phyinfo;
 static struct timer_list update_phyinfo_timer;
 static
-int ks_wlan_update_phy_information(ks_wlan_private *priv)
+int ks_wlan_update_phy_information(struct ks_wlan_private *priv)
 {
 		struct iw_statistics *wstats = &priv->wstats;
 
@@ -126,7 +126,7 @@ void ks_wlan_update_phyinfo_timeout(unsigned long ptr)
 	atomic_set(&update_phyinfo,0);
 }
 
-int ks_wlan_setup_parameter(ks_wlan_private *priv, unsigned int commit_flag)
+int ks_wlan_setup_parameter(struct ks_wlan_private *priv, unsigned int commit_flag)
 {
 	DPRINTK(2,"\n");
 
@@ -183,7 +183,7 @@ int ks_wlan_setup_parameter(ks_wlan_private *priv, unsigned int commit_flag)
 static int ks_wlan_get_name(struct net_device *dev, struct iw_request_info *info,
 				char *cwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *) netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *) netdev_priv(dev);
 
 	if (priv->sleep_mode == SLP_SLEEP){ return -EPERM; }  /* for SLEEP MODE */
 
@@ -208,7 +208,7 @@ static int ks_wlan_get_name(struct net_device *dev, struct iw_request_info *info
 static int ks_wlan_set_freq(struct net_device *dev, struct iw_request_info *info,
 				struct iw_freq *fwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 	int rc = -EINPROGRESS;		/* Call commit handler */
 
 	if (priv->sleep_mode == SLP_SLEEP){ return -EPERM; }  /* for SLEEP MODE */
@@ -250,7 +250,7 @@ static int ks_wlan_set_freq(struct net_device *dev, struct iw_request_info *info
 static int ks_wlan_get_freq(struct net_device *dev, struct iw_request_info *info,
 				struct iw_freq *fwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 	int f;
 
 	if (priv->sleep_mode == SLP_SLEEP){ return -EPERM; }  /* for SLEEP MODE */
@@ -271,7 +271,7 @@ static int ks_wlan_get_freq(struct net_device *dev, struct iw_request_info *info
 static int ks_wlan_set_essid(struct net_device *dev, struct iw_request_info *info,
 				 struct iw_point *dwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 	size_t len;
 
 	DPRINTK(2," %d\n", dwrq->flags);
@@ -326,7 +326,7 @@ static int ks_wlan_set_essid(struct net_device *dev, struct iw_request_info *inf
 static int ks_wlan_get_essid(struct net_device *dev, struct iw_request_info *info,
 				 struct iw_point *dwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 
 	if (priv->sleep_mode == SLP_SLEEP){ return -EPERM; }  /* for SLEEP MODE */
 
@@ -366,7 +366,7 @@ static int ks_wlan_get_essid(struct net_device *dev, struct iw_request_info *inf
 static int ks_wlan_set_wap(struct net_device *dev, struct iw_request_info *info,
 			   struct sockaddr *ap_addr, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 
 	DPRINTK(2,"\n");
 
@@ -402,7 +402,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)
 {
-		ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+		struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 
 	if (priv->sleep_mode == SLP_SLEEP){ return -EPERM; }  /* for SLEEP MODE */
 
@@ -423,7 +423,7 @@ static int ks_wlan_get_wap(struct net_device *dev, struct iw_request_info *info,
 static int ks_wlan_set_nick(struct net_device *dev, struct iw_request_info *info,
 				struct iw_point *dwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 
 	if (priv->sleep_mode == SLP_SLEEP){ return -EPERM; }  /* for SLEEP MODE */
 
@@ -442,7 +442,7 @@ static int ks_wlan_set_nick(struct net_device *dev, struct iw_request_info *info
 static int ks_wlan_get_nick(struct net_device *dev, struct iw_request_info *info,
 				struct iw_point *dwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 
 	if (priv->sleep_mode == SLP_SLEEP){ return -EPERM; }  /* for SLEEP MODE */
 
@@ -458,7 +458,7 @@ static int ks_wlan_get_nick(struct net_device *dev, struct iw_request_info *info
 static int ks_wlan_set_rate(struct net_device *dev, struct iw_request_info *info,
 				struct iw_param *vwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 	int i = 0;
 
 	if (priv->sleep_mode == SLP_SLEEP){ return -EPERM; }  /* for SLEEP MODE */
@@ -609,7 +609,7 @@ static int ks_wlan_set_rate(struct net_device *dev, struct iw_request_info *info
 static int ks_wlan_get_rate(struct net_device *dev, struct iw_request_info *info,
 				struct iw_param *vwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 
 	DPRINTK(2, "in_interrupt = %ld update_phyinfo = %d\n",
 		in_interrupt(),atomic_read(&update_phyinfo));
@@ -633,7 +633,7 @@ static int ks_wlan_get_rate(struct net_device *dev, struct iw_request_info *info
 static int ks_wlan_set_rts(struct net_device *dev, struct iw_request_info *info,
 			   struct iw_param *vwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 	int rthr = vwrq->value;
 
 	if (priv->sleep_mode == SLP_SLEEP){ return -EPERM; }  /* for SLEEP MODE */
@@ -654,7 +654,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)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 
 	if (priv->sleep_mode == SLP_SLEEP){ return -EPERM; }  /* for SLEEP MODE */
 
@@ -670,7 +670,7 @@ static int ks_wlan_get_rts(struct net_device *dev, struct iw_request_info *info,
 static int ks_wlan_set_frag(struct net_device *dev, struct iw_request_info *info,
 				struct iw_param *vwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 	int fthr = vwrq->value;
 
 	if (priv->sleep_mode == SLP_SLEEP){ return -EPERM; }  /* for SLEEP MODE */
@@ -692,7 +692,7 @@ static int ks_wlan_set_frag(struct net_device *dev, struct iw_request_info *info
 static int ks_wlan_get_frag(struct net_device *dev, struct iw_request_info *info,
 				struct iw_param *vwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 
 	if (priv->sleep_mode == SLP_SLEEP){ return -EPERM; }  /* for SLEEP MODE */
 
@@ -708,7 +708,7 @@ static int ks_wlan_get_frag(struct net_device *dev, struct iw_request_info *info
 static int ks_wlan_set_mode(struct net_device *dev, struct iw_request_info *info,
 				__u32 *uwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 
 	DPRINTK(2,"mode=%d\n",*uwrq);
 
@@ -740,7 +740,7 @@ static int ks_wlan_set_mode(struct net_device *dev, struct iw_request_info *info
 static int ks_wlan_get_mode(struct net_device *dev, struct iw_request_info *info,
 				__u32 *uwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 
 	if (priv->sleep_mode == SLP_SLEEP){ return -EPERM; }  /* for SLEEP MODE */
 
@@ -764,7 +764,7 @@ static int ks_wlan_get_mode(struct net_device *dev, struct iw_request_info *info
 static int ks_wlan_set_encode(struct net_device *dev, struct iw_request_info *info,
 				  struct iw_point *dwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 
 	wep_key_t key;
 	int index = (dwrq->flags & IW_ENCODE_INDEX);
@@ -878,7 +878,7 @@ static int ks_wlan_set_encode(struct net_device *dev, struct iw_request_info *in
 static int ks_wlan_get_encode(struct net_device *dev, struct iw_request_info *info,
 				  struct iw_point *dwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 	char zeros[16];
 	int index = (dwrq->flags & IW_ENCODE_INDEX) - 1;
 
@@ -974,7 +974,7 @@ static int ks_wlan_get_retry(struct net_device *dev, struct iw_request_info *inf
 static int ks_wlan_get_range(struct net_device *dev, struct iw_request_info *info,
 				 struct iw_point *dwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 	struct iw_range *range = (struct iw_range *) extra;
 	int i,k;
 
@@ -1105,7 +1105,7 @@ static int ks_wlan_get_range(struct net_device *dev, struct iw_request_info *inf
 static int ks_wlan_set_power(struct net_device *dev, struct iw_request_info *info,
 				 struct iw_param *vwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 	short enabled;
 
 	if (priv->sleep_mode == SLP_SLEEP){ return -EPERM; }  /* for SLEEP MODE */
@@ -1136,7 +1136,7 @@ static int ks_wlan_set_power(struct net_device *dev, struct iw_request_info *inf
 static int ks_wlan_get_power(struct net_device *dev, struct iw_request_info *info,
 				 struct iw_param *vwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 
 	if (priv->sleep_mode == SLP_SLEEP){ return -EPERM; }  /* for SLEEP MODE */
 
@@ -1153,7 +1153,7 @@ static int ks_wlan_get_power(struct net_device *dev, struct iw_request_info *inf
 static int ks_wlan_get_iwstats(struct net_device *dev, struct iw_request_info *info,
 				 struct iw_quality *vwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 
 	if (priv->sleep_mode == SLP_SLEEP){ return -EPERM; }  /* for SLEEP MODE */
 
@@ -1194,7 +1194,7 @@ static int ks_wlan_get_sens(struct net_device *dev, struct iw_request_info *info
 static int ks_wlan_get_aplist(struct net_device *dev, struct iw_request_info *info,
 				  struct iw_point *dwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 	struct sockaddr *address = (struct sockaddr *) extra;
 	struct iw_quality qual[LOCAL_APLIST_MAX];
 
@@ -1225,7 +1225,7 @@ static int ks_wlan_get_aplist(struct net_device *dev, struct iw_request_info *in
 static int ks_wlan_set_scan(struct net_device *dev, struct iw_request_info *info,
 				union iwreq_data *wrqu, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 	struct iw_scan_req *req = NULL;
 	DPRINTK(2,"\n");
 
@@ -1257,7 +1257,7 @@ static int ks_wlan_set_scan(struct net_device *dev, struct iw_request_info *info
 static inline char *ks_wlan_translate_scan(struct net_device *dev, struct iw_request_info *info, char *current_ev,
 					   char *end_buf, struct local_ap_t *ap)
 {
-	/* ks_wlan_private *priv = (ks_wlan_private *)dev->priv; */
+	/* struct ks_wlan_private *priv = (struct ks_wlan_private *)dev->priv; */
 	struct iw_event	iwe;		/* Temporary buffer */
 	u16 capabilities;
 	char *current_val;	/* For rates */
@@ -1393,7 +1393,7 @@ static inline char *ks_wlan_translate_scan(struct net_device *dev, struct iw_req
 static int ks_wlan_get_scan(struct net_device *dev, struct iw_request_info *info,
 				struct iw_point *dwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 	int i;
 	char *current_ev = extra;
 	DPRINTK(2,"\n");
@@ -1448,7 +1448,7 @@ DPRINTK(2,"aplist 0\n");
 static int ks_wlan_config_commit(struct net_device *dev, struct iw_request_info *info,
 				 void *zwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 
 	if (!priv->need_commit)
 		return 0;
@@ -1463,7 +1463,7 @@ static int ks_wlan_config_commit(struct net_device *dev, struct iw_request_info
 static int ks_wlan_set_genie(struct net_device *dev, struct iw_request_info *info,
 				 struct iw_point *dwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 
 	DPRINTK(2, "\n");
 
@@ -1478,7 +1478,7 @@ static int ks_wlan_set_genie(struct net_device *dev, struct iw_request_info *inf
 static int ks_wlan_set_auth_mode(struct net_device *dev, struct iw_request_info *info,
 				 struct iw_param *vwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 	int index = (vwrq->flags & IW_AUTH_INDEX);
 	int value = vwrq->value;
 
@@ -1614,7 +1614,7 @@ static int ks_wlan_set_auth_mode(struct net_device *dev, struct iw_request_info
 static int ks_wlan_get_auth_mode(struct net_device *dev, struct iw_request_info *info,
 				 struct iw_param *vwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 	int index = (vwrq->flags & IW_AUTH_INDEX);
 	DPRINTK(2,"index=%d\n",index);
 
@@ -1655,7 +1655,7 @@ static int ks_wlan_get_auth_mode(struct net_device *dev, struct iw_request_info
 static int ks_wlan_set_encode_ext(struct net_device *dev, struct iw_request_info *info,
 				  struct iw_point *dwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 	struct iw_encode_ext *enc;
 	int index = dwrq->flags & IW_ENCODE_INDEX;
 	unsigned int commit=0;
@@ -1761,12 +1761,12 @@ static int ks_wlan_set_encode_ext(struct net_device *dev, struct iw_request_info
 static int ks_wlan_get_encode_ext(struct net_device *dev, struct iw_request_info *info,
 				  struct iw_point *dwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 
 	if (priv->sleep_mode == SLP_SLEEP){ return -EPERM; }  /* for SLEEP MODE */
 
 	/*  WPA (not used ?? wpa_supplicant)
-	ks_wlan_private *priv = (ks_wlan_private *)dev->priv;
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)dev->priv;
 	struct iw_encode_ext *enc;
 	enc = (struct iw_encode_ext *)extra;
 	int index = dwrq->flags & IW_ENCODE_INDEX;
@@ -1779,7 +1779,7 @@ static int ks_wlan_get_encode_ext(struct net_device *dev, struct iw_request_info
 static int ks_wlan_set_pmksa(struct net_device *dev, struct iw_request_info *info,
 				 struct iw_point *dwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 	struct iw_pmksa *pmksa ;
 	int i;
 	struct pmk_t *pmk;
@@ -1874,7 +1874,7 @@ static int ks_wlan_set_pmksa(struct net_device *dev, struct iw_request_info *inf
 static struct iw_statistics *ks_get_wireless_stats(struct net_device *dev)
 {
 
-	ks_wlan_private *priv = (ks_wlan_private *) netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *) netdev_priv(dev);
 		struct iw_statistics *wstats = &priv->wstats;
 
 	if(!atomic_read(&update_phyinfo)){
@@ -1901,7 +1901,7 @@ static struct iw_statistics *ks_get_wireless_stats(struct net_device *dev)
 static int ks_wlan_set_stop_request(struct net_device *dev, struct iw_request_info *info,
 				    __u32 *uwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 	DPRINTK(2,"\n");
 
 	if (priv->sleep_mode == SLP_SLEEP){ return -EPERM; }  /* for SLEEP MODE */
@@ -1919,7 +1919,7 @@ static int ks_wlan_set_stop_request(struct net_device *dev, struct iw_request_in
 static int ks_wlan_set_mlme(struct net_device *dev, struct iw_request_info *info,
 				  struct iw_point *dwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 	struct iw_mlme *mlme = (struct iw_mlme *)extra;
 	__u32 mode;
 
@@ -1955,7 +1955,7 @@ static int ks_wlan_get_driver_version(struct net_device *dev, struct iw_request_
 static int ks_wlan_get_firmware_version(struct net_device *dev, struct iw_request_info *info,
 					struct iw_point *dwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 	strcpy(extra, &(priv->firmware_version[0]));
 	dwrq->length = priv->version_size+1;
 	return 0;
@@ -1967,7 +1967,7 @@ static int ks_wlan_get_firmware_version(struct net_device *dev, struct iw_reques
 static int ks_wlan_set_detach(struct net_device *dev, struct iw_request_info *info,
 				  __u32 *uwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)dev->priv;
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)dev->priv;
 
 	if (priv->sleep_mode == SLP_SLEEP){ return -EPERM; }  /* for SLEEP MODE */
 
@@ -1988,7 +1988,7 @@ static int ks_wlan_set_detach(struct net_device *dev, struct iw_request_info *in
 static int ks_wlan_get_detach(struct net_device *dev, struct iw_request_info *info,
 				  __u32 *uwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)dev->priv;
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)dev->priv;
 
 	if (priv->sleep_mode == SLP_SLEEP){ return -EPERM; }  /* for SLEEP MODE */
 
@@ -2001,7 +2001,7 @@ static int ks_wlan_get_detach(struct net_device *dev, struct iw_request_info *in
 static int ks_wlan_get_connect(struct net_device *dev, struct iw_request_info *info,
 				   __u32 *uwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)dev->priv;
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)dev->priv;
 
 	if (priv->sleep_mode == SLP_SLEEP){ return -EPERM; }  /* for SLEEP MODE */
 
@@ -2015,7 +2015,7 @@ static int ks_wlan_get_connect(struct net_device *dev, struct iw_request_info *i
 static int ks_wlan_set_preamble(struct net_device *dev, struct iw_request_info *info,
 				__u32 *uwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 
 	if (priv->sleep_mode == SLP_SLEEP){ return -EPERM; }  /* for SLEEP MODE */
 
@@ -2036,7 +2036,7 @@ static int ks_wlan_set_preamble(struct net_device *dev, struct iw_request_info *
 static int ks_wlan_get_preamble(struct net_device *dev, struct iw_request_info *info,
 				__u32 *uwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 
 	if (priv->sleep_mode == SLP_SLEEP){ return -EPERM; }  /* for SLEEP MODE */
 
@@ -2049,7 +2049,7 @@ static int ks_wlan_get_preamble(struct net_device *dev, struct iw_request_info *
 static int ks_wlan_set_powermgt(struct net_device *dev, struct iw_request_info *info,
 				__u32 *uwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 
 	if (priv->sleep_mode == SLP_SLEEP){ return -EPERM; }  /* for SLEEP MODE */
 
@@ -2078,7 +2078,7 @@ static int ks_wlan_set_powermgt(struct net_device *dev, struct iw_request_info *
 static int ks_wlan_get_powermgt(struct net_device *dev, struct iw_request_info *info,
 				__u32 *uwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 
 	if (priv->sleep_mode == SLP_SLEEP){ return -EPERM; }  /* for SLEEP MODE */
 
@@ -2091,7 +2091,7 @@ static int ks_wlan_get_powermgt(struct net_device *dev, struct iw_request_info *
 static int ks_wlan_set_scan_type(struct net_device *dev, struct iw_request_info *info,
 				 __u32 *uwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 
 	if (priv->sleep_mode == SLP_SLEEP){ return -EPERM; }  /* for SLEEP MODE */
 
@@ -2110,7 +2110,7 @@ static int ks_wlan_set_scan_type(struct net_device *dev, struct iw_request_info
 static int ks_wlan_get_scan_type(struct net_device *dev, struct iw_request_info *info,
 				 __u32 *uwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 
 	if (priv->sleep_mode == SLP_SLEEP){ return -EPERM; }  /* for SLEEP MODE */
 
@@ -2123,7 +2123,7 @@ static int ks_wlan_get_scan_type(struct net_device *dev, struct iw_request_info
 static int ks_wlan_data_write(struct net_device *dev, struct iw_request_info *info,
 				  struct iw_point *dwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)dev->priv;
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)dev->priv;
 	unsigned char *wbuff = NULL;
 
 	if (priv->sleep_mode == SLP_SLEEP){ return -EPERM; }  /* for SLEEP MODE */
@@ -2144,7 +2144,7 @@ static int ks_wlan_data_write(struct net_device *dev, struct iw_request_info *in
 static int ks_wlan_data_read(struct net_device *dev, struct iw_request_info *info,
 				 struct iw_point *dwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)dev->priv;
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)dev->priv;
 	unsigned short read_length;
 
 	if (priv->sleep_mode == SLP_SLEEP){ return -EPERM; }  /* for SLEEP MODE */
@@ -2200,7 +2200,7 @@ static int ks_wlan_data_read(struct net_device *dev, struct iw_request_info *inf
 static int ks_wlan_get_wep_ascii(struct net_device *dev, struct iw_request_info *info,
 				 struct iw_point *dwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)dev->priv;
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)dev->priv;
 	int i,j,len=0;
 	char tmp[WEP_ASCII_BUFF_SIZE];
 
@@ -2242,7 +2242,7 @@ static int ks_wlan_get_wep_ascii(struct net_device *dev, struct iw_request_info
 static int ks_wlan_set_beacon_lost(struct net_device *dev, struct iw_request_info *info,
 				   __u32 *uwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 
 	if (priv->sleep_mode == SLP_SLEEP){ return -EPERM; }  /* for SLEEP MODE */
 
@@ -2265,7 +2265,7 @@ static int ks_wlan_set_beacon_lost(struct net_device *dev, struct iw_request_inf
 static int ks_wlan_get_beacon_lost(struct net_device *dev, struct iw_request_info *info,
 				   __u32 *uwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 
 	if (priv->sleep_mode == SLP_SLEEP){ return -EPERM; }  /* for SLEEP MODE */
 
@@ -2278,7 +2278,7 @@ static int ks_wlan_get_beacon_lost(struct net_device *dev, struct iw_request_inf
 static int ks_wlan_set_phy_type(struct net_device *dev, struct iw_request_info *info,
 				__u32 *uwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 
 	if (priv->sleep_mode == SLP_SLEEP){ return -EPERM; }  /* for SLEEP MODE */
 
@@ -2300,7 +2300,7 @@ static int ks_wlan_set_phy_type(struct net_device *dev, struct iw_request_info *
 static int ks_wlan_get_phy_type(struct net_device *dev, struct iw_request_info *info,
 				__u32 *uwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 
 	if (priv->sleep_mode == SLP_SLEEP){ return -EPERM; }  /* for SLEEP MODE */
 
@@ -2313,7 +2313,7 @@ static int ks_wlan_get_phy_type(struct net_device *dev, struct iw_request_info *
 static int ks_wlan_set_cts_mode(struct net_device *dev, struct iw_request_info *info,
 				__u32 *uwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 
 	if (priv->sleep_mode == SLP_SLEEP){ return -EPERM; }  /* for SLEEP MODE */
 
@@ -2337,7 +2337,7 @@ static int ks_wlan_set_cts_mode(struct net_device *dev, struct iw_request_info *
 static int ks_wlan_get_cts_mode(struct net_device *dev, struct iw_request_info *info,
 				__u32 *uwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 
 	if (priv->sleep_mode == SLP_SLEEP){ return -EPERM; }  /* for SLEEP MODE */
 
@@ -2351,7 +2351,7 @@ static int ks_wlan_set_sleep_mode(struct net_device *dev,
 				     struct iw_request_info *info,
 				     __u32 *uwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 
 	DPRINTK(2,"\n");
 
@@ -2379,7 +2379,7 @@ static int ks_wlan_get_sleep_mode(struct net_device *dev,
 				     struct iw_request_info *info,
 				     __u32 *uwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 
 	DPRINTK(2, "GET_SLEEP_MODE %d\n", priv->sleep_mode);
 	*uwrq = priv->sleep_mode;
@@ -2393,7 +2393,7 @@ static int ks_wlan_get_sleep_mode(struct net_device *dev,
 static int ks_wlan_set_phy_information_timer(struct net_device *dev, struct iw_request_info *info,
 					     __u32 *uwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)dev->priv;
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)dev->priv;
 
 	if (priv->sleep_mode == SLP_SLEEP){ return -EPERM; }  /* for SLEEP MODE */
 
@@ -2412,7 +2412,7 @@ static int ks_wlan_set_phy_information_timer(struct net_device *dev, struct iw_r
 static int ks_wlan_get_phy_information_timer(struct net_device *dev, struct iw_request_info *info,
 					     __u32 *uwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)dev->priv;
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)dev->priv;
 
 	if (priv->sleep_mode == SLP_SLEEP){ return -EPERM; }  /* for SLEEP MODE */
 
@@ -2427,7 +2427,7 @@ static int ks_wlan_get_phy_information_timer(struct net_device *dev, struct iw_r
 static int ks_wlan_set_wps_enable(struct net_device *dev, struct iw_request_info *info,
 				  __u32 *uwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 	DPRINTK(2,"\n");
 
 	if (priv->sleep_mode == SLP_SLEEP){ return -EPERM; }  /* for SLEEP MODE */
@@ -2446,7 +2446,7 @@ static int ks_wlan_set_wps_enable(struct net_device *dev, struct iw_request_info
 static int ks_wlan_get_wps_enable(struct net_device *dev, struct iw_request_info *info,
 				  __u32 *uwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 	DPRINTK(2,"\n");
 
 	if (priv->sleep_mode == SLP_SLEEP){ return -EPERM; }  /* for SLEEP MODE */
@@ -2464,7 +2464,7 @@ static int ks_wlan_set_wps_probe_req(struct net_device *dev,
 {
 	uint8_t *p = extra;
 	unsigned char len;
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 
 	DPRINTK(2,"\n");
 
@@ -2498,7 +2498,7 @@ static int ks_wlan_get_wps_probe_req(struct net_device *dev,
 				     struct iw_request_info *info,
 				     __u32 *uwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)dev->priv;
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)dev->priv;
 	DPRINTK(2,"\n");
 
 	if (priv->sleep_mode == SLP_SLEEP){ return -EPERM; }  /* for SLEEP MODE */
@@ -2513,7 +2513,7 @@ static int ks_wlan_get_wps_probe_req(struct net_device *dev,
 static int ks_wlan_set_tx_gain(struct net_device *dev, struct iw_request_info *info,
 					     __u32 *uwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 
 	if (priv->sleep_mode == SLP_SLEEP){ return -EPERM; }  /* for SLEEP MODE */
 
@@ -2537,7 +2537,7 @@ static int ks_wlan_set_tx_gain(struct net_device *dev, struct iw_request_info *i
 static int ks_wlan_get_tx_gain(struct net_device *dev, struct iw_request_info *info,
 					     __u32 *uwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 
 	if (priv->sleep_mode == SLP_SLEEP){ return -EPERM; }  /* for SLEEP MODE */
 
@@ -2551,7 +2551,7 @@ static int ks_wlan_get_tx_gain(struct net_device *dev, struct iw_request_info *i
 static int ks_wlan_set_rx_gain(struct net_device *dev, struct iw_request_info *info,
 					     __u32 *uwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 
 	if (priv->sleep_mode == SLP_SLEEP){ return -EPERM; }  /* for SLEEP MODE */
 
@@ -2574,7 +2574,7 @@ static int ks_wlan_set_rx_gain(struct net_device *dev, struct iw_request_info *i
 static int ks_wlan_get_rx_gain(struct net_device *dev, struct iw_request_info *info,
 					     __u32 *uwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 
 	if (priv->sleep_mode == SLP_SLEEP){ return -EPERM; }  /* for SLEEP MODE */
 
@@ -2588,7 +2588,7 @@ static int ks_wlan_get_rx_gain(struct net_device *dev, struct iw_request_info *i
 static int ks_wlan_set_region(struct net_device *dev, struct iw_request_info *info,
 					     __u32 *uwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)dev->priv;
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)dev->priv;
 
 	if (priv->sleep_mode == SLP_SLEEP){ return -EPERM; }  /* for SLEEP MODE */
 
@@ -2607,7 +2607,7 @@ static int ks_wlan_set_region(struct net_device *dev, struct iw_request_info *in
 static int ks_wlan_get_eeprom_cksum(struct net_device *dev, struct iw_request_info *info,
 					     __u32 *uwrq, char *extra)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 
 	*uwrq = priv->eeprom_checksum;
 	return 0;
@@ -2732,7 +2732,7 @@ static int ks_wlan_hostt(struct net_device *dev, struct iw_request_info *info,
 					     __u32 *uwrq, char *extra)
 {
 	int i,event;
-	ks_wlan_private *priv = (ks_wlan_private *)netdev_priv(dev);
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)netdev_priv(dev);
 
 	for(i = 63; i >= 0; i--){
 		event =	priv->hostt.buff[(priv->hostt.qtail -1 -i)%SME_EVENT_BUFF_SIZE] ;
@@ -2924,7 +2924,7 @@ static int ks_wlan_netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cm
 static
 struct net_device_stats *ks_wlan_get_stats(struct net_device *dev)
 {
-	ks_wlan_private *priv = netdev_priv(dev);
+	struct ks_wlan_private *priv = netdev_priv(dev);
 
 	if (priv->dev_state < DEVICE_STATE_READY) {
 				return NULL; /* not finished initialize */
@@ -2936,7 +2936,7 @@ struct net_device_stats *ks_wlan_get_stats(struct net_device *dev)
 static
 int ks_wlan_set_mac_address(struct net_device *dev, void *addr)
 {
-	ks_wlan_private *priv = netdev_priv(dev);
+	struct ks_wlan_private *priv = netdev_priv(dev);
 	struct sockaddr *mac_addr=(struct sockaddr *)addr;
 	if (netif_running(dev))
 		return -EBUSY;
@@ -2955,7 +2955,7 @@ int ks_wlan_set_mac_address(struct net_device *dev, void *addr)
 static
 void ks_wlan_tx_timeout(struct net_device *dev)
 {
-		ks_wlan_private *priv = netdev_priv(dev);
+		struct ks_wlan_private *priv = netdev_priv(dev);
 
 	DPRINTK(1,"head(%d) tail(%d)!!\n",priv->tx_dev.qhead, priv->tx_dev.qtail);
 	if(!netif_queue_stopped(dev)){
@@ -2970,7 +2970,7 @@ void ks_wlan_tx_timeout(struct net_device *dev)
 static
 int ks_wlan_start_xmit(struct sk_buff *skb, struct net_device *dev)
 {
-	ks_wlan_private *priv = netdev_priv(dev);
+	struct ks_wlan_private *priv = netdev_priv(dev);
 	int rc = 0;
 
 	DPRINTK(3,"in_interrupt()=%ld\n",in_interrupt());
@@ -3000,7 +3000,7 @@ int ks_wlan_start_xmit(struct sk_buff *skb, struct net_device *dev)
 
 void send_packet_complete(void *arg1, void *arg2)
 {
-	ks_wlan_private *priv = (ks_wlan_private *)arg1;
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)arg1;
 	struct sk_buff *packet = (struct sk_buff *)arg2;
 
 		DPRINTK(3,"\n");
@@ -3023,7 +3023,7 @@ void send_packet_complete(void *arg1, void *arg2)
 static
 void ks_wlan_set_multicast_list(struct net_device *dev)
 {
-	ks_wlan_private *priv = netdev_priv(dev);
+	struct ks_wlan_private *priv = netdev_priv(dev);
 
 	DPRINTK(4,"\n");
 	if (priv->dev_state < DEVICE_STATE_READY) {
@@ -3037,7 +3037,7 @@ void ks_wlan_set_multicast_list(struct net_device *dev)
 static
 int ks_wlan_open(struct net_device *dev)
 {
-	ks_wlan_private *priv = netdev_priv(dev);
+	struct ks_wlan_private *priv = netdev_priv(dev);
 
 	priv->cur_rx = 0;
 
@@ -3082,7 +3082,7 @@ static const struct net_device_ops ks_wlan_netdev_ops = {
 
 int ks_wlan_net_start(struct net_device *dev)
 {
-	ks_wlan_private *priv;
+	struct ks_wlan_private *priv;
 	/* int rc; */
 
 	priv = netdev_priv(dev);
@@ -3121,7 +3121,7 @@ int ks_wlan_net_start(struct net_device *dev)
 
 int ks_wlan_net_stop(struct net_device *dev)
 {
-	ks_wlan_private *priv = netdev_priv(dev);
+	struct ks_wlan_private *priv = netdev_priv(dev);
 
 	int ret = 0;
 	priv->device_open_status = 0;
-- 
2.8.1

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

* [PATCH 15/27] staging: ks7010: indent eap_packet.h
  2016-05-10 13:52 [PATCH 00/27] staging: add driver for KS7010 based SDIO cards Wolfram Sang
                   ` (12 preceding siblings ...)
  2016-05-10 13:52 ` [PATCH 14/27] staging: ks7010: remove unecessary typedef Wolfram Sang
@ 2016-05-10 13:52 ` Wolfram Sang
  2016-05-10 13:52 ` [PATCH 16/27] staging: ks7010: indent ks7010_config.c Wolfram Sang
                   ` (13 subsequent siblings)
  27 siblings, 0 replies; 32+ messages in thread
From: Wolfram Sang @ 2016-05-10 13:52 UTC (permalink / raw)
  To: driverdev-devel; +Cc: Wolfram Sang, linux-renesas-soc

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/staging/ks7010/eap_packet.h | 49 ++++++++++++++++++-------------------
 1 file changed, 24 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/ks7010/eap_packet.h b/drivers/staging/ks7010/eap_packet.h
index b664bdd8c961db..88384fb19d9580 100644
--- a/drivers/staging/ks7010/eap_packet.h
+++ b/drivers/staging/ks7010/eap_packet.h
@@ -14,13 +14,13 @@
 #endif
 
 struct ether_hdr {
-	unsigned char	h_dest[ETH_ALEN];	/* destination eth addr	*/
-	unsigned char	h_source[ETH_ALEN];	/* source ether addr	*/
-	unsigned char   h_dest_snap;
-	unsigned char   h_source_snap;
-	unsigned char   h_command;
-	unsigned char   h_vendor_id[3];
-	unsigned short	h_proto;		/* packet type ID field	*/
+	unsigned char h_dest[ETH_ALEN];	/* destination eth addr */
+	unsigned char h_source[ETH_ALEN];	/* source ether addr    */
+	unsigned char h_dest_snap;
+	unsigned char h_source_snap;
+	unsigned char h_command;
+	unsigned char h_vendor_id[3];
+	unsigned short h_proto;	/* packet type ID field */
 #define ETHER_PROTOCOL_TYPE_EAP		0x888e
 #define ETHER_PROTOCOL_TYPE_IP		0x0800
 #define ETHER_PROTOCOL_TYPE_ARP		0x0806
@@ -37,15 +37,15 @@ struct ieee802_1x_hdr {
 #define EAPOL_VERSION 2
 
 enum { IEEE802_1X_TYPE_EAP_PACKET = 0,
-       IEEE802_1X_TYPE_EAPOL_START = 1,
-       IEEE802_1X_TYPE_EAPOL_LOGOFF = 2,
-       IEEE802_1X_TYPE_EAPOL_KEY = 3,
-       IEEE802_1X_TYPE_EAPOL_ENCAPSULATED_ASF_ALERT = 4
+	IEEE802_1X_TYPE_EAPOL_START = 1,
+	IEEE802_1X_TYPE_EAPOL_LOGOFF = 2,
+	IEEE802_1X_TYPE_EAPOL_KEY = 3,
+	IEEE802_1X_TYPE_EAPOL_ENCAPSULATED_ASF_ALERT = 4
 };
 
 enum { EAPOL_KEY_TYPE_RC4 = 1, EAPOL_KEY_TYPE_RSN = 2,
-       EAPOL_KEY_TYPE_WPA = 254 };
-
+	EAPOL_KEY_TYPE_WPA = 254
+};
 
 #define IEEE8021X_REPLAY_COUNTER_LEN 8
 #define IEEE8021X_KEY_SIGN_LEN 16
@@ -60,11 +60,11 @@ struct ieee802_1x_eapol_key {
 	/* does not repeat within the life of the keying material used to
 	 * encrypt the Key field; 64-bit NTP timestamp MAY be used here */
 	unsigned char replay_counter[IEEE8021X_REPLAY_COUNTER_LEN];
-	unsigned char key_iv[IEEE8021X_KEY_IV_LEN]; /* cryptographically random number */
-	unsigned char key_index; /* key flag in the most significant bit:
-		       * 0 = broadcast (default key),
-		       * 1 = unicast (key mapping key); key index is in the
-		       * 7 least significant bits */
+	unsigned char key_iv[IEEE8021X_KEY_IV_LEN];	/* cryptographically random number */
+	unsigned char key_index;	/* key flag in the most significant bit:
+					 * 0 = broadcast (default key),
+					 * 1 = unicast (key mapping key); key index is in the
+					 * 7 least significant bits */
 	/* HMAC-MD5 message integrity check computed with MS-MPPE-Send-Key as
 	 * the key */
 	unsigned char key_signature[IEEE8021X_KEY_SIGN_LEN];
@@ -77,19 +77,18 @@ struct ieee802_1x_eapol_key {
 	 * RC4 key used in encryption = Key-IV + MS-MPPE-Recv-Key */
 } __attribute__ ((packed));
 
-
 #define WPA_NONCE_LEN 32
 #define WPA_REPLAY_COUNTER_LEN 8
 
 struct wpa_eapol_key {
 	unsigned char type;
- 	unsigned short key_info;
+	unsigned short key_info;
 	unsigned short key_length;
 	unsigned char replay_counter[WPA_REPLAY_COUNTER_LEN];
 	unsigned char key_nonce[WPA_NONCE_LEN];
 	unsigned char key_iv[16];
 	unsigned char key_rsc[8];
-	unsigned char key_id[8]; /* Reserved in IEEE 802.11i/RSN */
+	unsigned char key_id[8];	/* Reserved in IEEE 802.11i/RSN */
 	unsigned char key_mic[16];
 	unsigned short key_data_length;
 	/* followed by key_data_length bytes of key_data */
@@ -98,18 +97,18 @@ struct wpa_eapol_key {
 #define WPA_KEY_INFO_TYPE_MASK (WBIT(0) | WBIT(1) | WBIT(2))
 #define WPA_KEY_INFO_TYPE_HMAC_MD5_RC4 WBIT(0)
 #define WPA_KEY_INFO_TYPE_HMAC_SHA1_AES WBIT(1)
-#define WPA_KEY_INFO_KEY_TYPE WBIT(3) /* 1 = Pairwise, 0 = Group key */
+#define WPA_KEY_INFO_KEY_TYPE WBIT(3)	/* 1 = Pairwise, 0 = Group key */
 /* bit4..5 is used in WPA, but is reserved in IEEE 802.11i/RSN */
 #define WPA_KEY_INFO_KEY_INDEX_MASK (WBIT(4) | WBIT(5))
 #define WPA_KEY_INFO_KEY_INDEX_SHIFT 4
-#define WPA_KEY_INFO_INSTALL WBIT(6) /* pairwise */
-#define WPA_KEY_INFO_TXRX WBIT(6) /* group */
+#define WPA_KEY_INFO_INSTALL WBIT(6)	/* pairwise */
+#define WPA_KEY_INFO_TXRX WBIT(6)	/* group */
 #define WPA_KEY_INFO_ACK WBIT(7)
 #define WPA_KEY_INFO_MIC WBIT(8)
 #define WPA_KEY_INFO_SECURE WBIT(9)
 #define WPA_KEY_INFO_ERROR WBIT(10)
 #define WPA_KEY_INFO_REQUEST WBIT(11)
-#define WPA_KEY_INFO_ENCR_KEY_DATA WBIT(12) /* IEEE 802.11i/RSN only */
+#define WPA_KEY_INFO_ENCR_KEY_DATA WBIT(12)	/* IEEE 802.11i/RSN only */
 
 #define WPA_CAPABILITY_PREAUTH WBIT(0)
 
-- 
2.8.1

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

* [PATCH 16/27] staging: ks7010: indent ks7010_config.c
  2016-05-10 13:52 [PATCH 00/27] staging: add driver for KS7010 based SDIO cards Wolfram Sang
                   ` (13 preceding siblings ...)
  2016-05-10 13:52 ` [PATCH 15/27] staging: ks7010: indent eap_packet.h Wolfram Sang
@ 2016-05-10 13:52 ` Wolfram Sang
  2016-05-10 13:52 ` [PATCH 17/27] staging: ks7010: indent ks7010_sdio.h Wolfram Sang
                   ` (12 subsequent siblings)
  27 siblings, 0 replies; 32+ messages in thread
From: Wolfram Sang @ 2016-05-10 13:52 UTC (permalink / raw)
  To: driverdev-devel; +Cc: Wolfram Sang, linux-renesas-soc

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/staging/ks7010/ks7010_config.c | 353 +++++++++++++++++----------------
 1 file changed, 184 insertions(+), 169 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_config.c b/drivers/staging/ks7010/ks7010_config.c
index 48809bcc779739..4b495cbef48165 100644
--- a/drivers/staging/ks7010/ks7010_config.c
+++ b/drivers/staging/ks7010/ks7010_config.c
@@ -15,7 +15,8 @@ static int wep_type;
 #define	WEP_KEY_HEX	  1
 
 static
-void analyze_character_wep_key(struct ks_wlan_parameter *param, int wep_key_index, char *value)
+void analyze_character_wep_key(struct ks_wlan_parameter *param,
+			       int wep_key_index, char *value)
 {
 	int i;
 	unsigned char wep_key[26], key_length;
@@ -23,64 +24,69 @@ void analyze_character_wep_key(struct ks_wlan_parameter *param, int wep_key_inde
 	key_length = (wep_on_off == WEP_ON_64BIT) ? 5 : 13;
 	/* 64bit key_length = 5; 128bit key_length = 13; */
 
-	for (i=0; i<key_length; i++) {
+	for (i = 0; i < key_length; i++) {
 		wep_key[i] = value[i];
 	}
 
-	if(wep_key_index < 0 ||  wep_key_index > 3)
+	if (wep_key_index < 0 || wep_key_index > 3)
 		return;
 
 	param->wep_key[wep_key_index].size = key_length;
-	for (i=0; i<(param->wep_key[wep_key_index].size); i++) {
+	for (i = 0; i < (param->wep_key[wep_key_index].size); i++) {
 		param->wep_key[wep_key_index].val[i] = wep_key[i];
 	}
 }
 
 static
-void analyze_hex_wep_key(struct ks_wlan_parameter *param, int wep_key_index, char *value)
+void analyze_hex_wep_key(struct ks_wlan_parameter *param, int wep_key_index,
+			 char *value)
 {
 	unsigned char wep_end[26], i, j, key_length;
 
 	key_length = (wep_on_off == WEP_ON_64BIT) ? 10 : 26;
 	/* 64bit key_length = 10; 128bit key_length = 26; */
 
-	for (i=0; i<key_length; i++) {
+	for (i = 0; i < key_length; i++) {
 		wep_end[i] = value[i];
 		if (i % 2) {
 			/* Odd */
-			for (j=0x00; j<0x10; j++) {
-				if (j<0x0a) {
-					if (wep_end[i] == j+0x30)
+			for (j = 0x00; j < 0x10; j++) {
+				if (j < 0x0a) {
+					if (wep_end[i] == j + 0x30)
 						wep_end[i] = j;
 				} else {
-					if ((wep_end[i] == j+0x37) | (wep_end[i] == j+0x57))
+					if ((wep_end[i] ==
+					     j + 0x37) | (wep_end[i] ==
+							  j + 0x57))
 						wep_end[i] = j;
 				}
 			}
 		} else {
 			/* Even */
-			for (j=0x00; j<0x10; j++) {
-				if (j<0x0a) {
-					if (wep_end[i] == j+0x30) {
-						wep_end[i] = j*16;
+			for (j = 0x00; j < 0x10; j++) {
+				if (j < 0x0a) {
+					if (wep_end[i] == j + 0x30) {
+						wep_end[i] = j * 16;
 					}
 				} else {
-					if ((wep_end[i] == j+0x37) | (wep_end[i] == j+0x57))
-						wep_end[i] = j*16;
+					if ((wep_end[i] ==
+					     j + 0x37) | (wep_end[i] ==
+							  j + 0x57))
+						wep_end[i] = j * 16;
 				}
 			}
 		}
 	}
 
-	for (i=0; i<key_length/2; i++) {
-		wep_end[i] = wep_end[i*2] + wep_end[(i*2)+1];
+	for (i = 0; i < key_length / 2; i++) {
+		wep_end[i] = wep_end[i * 2] + wep_end[(i * 2) + 1];
 	}
 
-	if(wep_key_index < 0 ||  wep_key_index > 3)
-		return ;
+	if (wep_key_index < 0 || wep_key_index > 3)
+		return;
 
-	param->wep_key[wep_key_index].size = key_length/2;
-	for (i=0; i<(param->wep_key[wep_key_index].size); i++) {
+	param->wep_key[wep_key_index].size = key_length / 2;
+	for (i = 0; i < (param->wep_key[wep_key_index].size); i++) {
 		param->wep_key[wep_key_index].val[i] = wep_end[i];
 	}
 
@@ -89,62 +95,57 @@ void analyze_hex_wep_key(struct ks_wlan_parameter *param, int wep_key_index, cha
 static
 int rate_set_configuration(struct ks_wlan_private *priv, char *value)
 {
-	int rc=0;
+	int rc = 0;
 
 	priv->reg.tx_rate = TX_RATE_FIXED;
 	priv->reg.rate_set.size = 1;
 
-	switch(*value){
-	case '1': /* 1M 11M 12M 18M */
-		if(*(value+1) == '8'){
+	switch (*value) {
+	case '1':	/* 1M 11M 12M 18M */
+		if (*(value + 1) == '8') {
 			priv->reg.rate_set.body[0] = TX_RATE_18M;
-		}
-		else if(*(value+1) == '2'){
-			priv->reg.rate_set.body[0] = TX_RATE_12M|BASIC_RATE;
-		}
-		else if(*(value+1) == '1'){
-			priv->reg.rate_set.body[0] = TX_RATE_11M|BASIC_RATE;
-		}
-		else{
-			priv->reg.rate_set.body[0] = TX_RATE_1M|BASIC_RATE;
+		} else if (*(value + 1) == '2') {
+			priv->reg.rate_set.body[0] = TX_RATE_12M | BASIC_RATE;
+		} else if (*(value + 1) == '1') {
+			priv->reg.rate_set.body[0] = TX_RATE_11M | BASIC_RATE;
+		} else {
+			priv->reg.rate_set.body[0] = TX_RATE_1M | BASIC_RATE;
 		}
 		break;
-	case '2': /* 2M 24M */
-		if(*(value+1) == '4'){
-			priv->reg.rate_set.body[0] = TX_RATE_24M|BASIC_RATE;
-		}
-		else{
-			priv->reg.rate_set.body[0] = TX_RATE_2M|BASIC_RATE;
+	case '2':	/* 2M 24M */
+		if (*(value + 1) == '4') {
+			priv->reg.rate_set.body[0] = TX_RATE_24M | BASIC_RATE;
+		} else {
+			priv->reg.rate_set.body[0] = TX_RATE_2M | BASIC_RATE;
 		}
 		break;
-	case '3': /* 36M */
+	case '3':	/* 36M */
 		priv->reg.rate_set.body[0] = TX_RATE_36M;
 		break;
-	case '4': /* 48M */
+	case '4':	/* 48M */
 		priv->reg.rate_set.body[0] = TX_RATE_48M;
 		break;
-	case '5': /* 5.5M 54M */
-		if(*(value+1) == '4'){
+	case '5':	/* 5.5M 54M */
+		if (*(value + 1) == '4') {
 			priv->reg.rate_set.body[0] = TX_RATE_54M;
-		}
-		else{
-			priv->reg.rate_set.body[0] = TX_RATE_5M|BASIC_RATE;
+		} else {
+			priv->reg.rate_set.body[0] = TX_RATE_5M | BASIC_RATE;
 		}
 		break;
-	case '6': /* 6M */
-		priv->reg.rate_set.body[0] = TX_RATE_6M|BASIC_RATE;
+	case '6':	/* 6M */
+		priv->reg.rate_set.body[0] = TX_RATE_6M | BASIC_RATE;
 		break;
-	case '9': /* 9M */
+	case '9':	/* 9M */
 		priv->reg.rate_set.body[0] = TX_RATE_9M;
 		break;
 	case 'K':
 		priv->reg.rate_set.body[6] = TX_RATE_36M;
 		priv->reg.rate_set.body[5] = TX_RATE_18M;
-		priv->reg.rate_set.body[4] = TX_RATE_24M|BASIC_RATE;
-		priv->reg.rate_set.body[3] = TX_RATE_12M|BASIC_RATE;
-		priv->reg.rate_set.body[2] = TX_RATE_6M|BASIC_RATE;
-		priv->reg.rate_set.body[1] = TX_RATE_11M|BASIC_RATE;
-		priv->reg.rate_set.body[0] = TX_RATE_2M|BASIC_RATE;
+		priv->reg.rate_set.body[4] = TX_RATE_24M | BASIC_RATE;
+		priv->reg.rate_set.body[3] = TX_RATE_12M | BASIC_RATE;
+		priv->reg.rate_set.body[2] = TX_RATE_6M | BASIC_RATE;
+		priv->reg.rate_set.body[1] = TX_RATE_11M | BASIC_RATE;
+		priv->reg.rate_set.body[0] = TX_RATE_2M | BASIC_RATE;
 		priv->reg.tx_rate = TX_RATE_FULL_AUTO;
 		priv->reg.rate_set.size = 7;
 		break;
@@ -154,13 +155,13 @@ int rate_set_configuration(struct ks_wlan_private *priv, char *value)
 		priv->reg.rate_set.body[9] = TX_RATE_36M;
 		priv->reg.rate_set.body[8] = TX_RATE_18M;
 		priv->reg.rate_set.body[7] = TX_RATE_9M;
-		priv->reg.rate_set.body[6] = TX_RATE_24M|BASIC_RATE;
-		priv->reg.rate_set.body[5] = TX_RATE_12M|BASIC_RATE;
-		priv->reg.rate_set.body[4] = TX_RATE_6M|BASIC_RATE;
-		priv->reg.rate_set.body[3] = TX_RATE_11M|BASIC_RATE;
-		priv->reg.rate_set.body[2] = TX_RATE_5M|BASIC_RATE;
-		priv->reg.rate_set.body[1] = TX_RATE_2M|BASIC_RATE;
-		priv->reg.rate_set.body[0] = TX_RATE_1M|BASIC_RATE;
+		priv->reg.rate_set.body[6] = TX_RATE_24M | BASIC_RATE;
+		priv->reg.rate_set.body[5] = TX_RATE_12M | BASIC_RATE;
+		priv->reg.rate_set.body[4] = TX_RATE_6M | BASIC_RATE;
+		priv->reg.rate_set.body[3] = TX_RATE_11M | BASIC_RATE;
+		priv->reg.rate_set.body[2] = TX_RATE_5M | BASIC_RATE;
+		priv->reg.rate_set.body[1] = TX_RATE_2M | BASIC_RATE;
+		priv->reg.rate_set.body[0] = TX_RATE_1M | BASIC_RATE;
 		priv->reg.tx_rate = TX_RATE_FULL_AUTO;
 		priv->reg.rate_set.size = 12;
 		break;
@@ -176,63 +177,63 @@ int ks_wlan_read_config_file(struct ks_wlan_private *priv)
 		const char *key;
 		const char *val;
 	} cfg_tbl[] = {
-		{15,"BeaconLostCount", "20"},			/* 0 */
-		{7,"Channel", "1"},				/* 1 */
-		{17,"FragmentThreshold","2346"},		/* 2 */
-		{13,"OperationMode","Infrastructure"},		/* 3 */
-		{19,"PowerManagementMode","ACTIVE"},     	/* 4 */
-		{12,"RTSThreshold","2347"},			/* 5 */
-		{4,"SSID","default"},				/* 6 */
-		{6,"TxRate","Auto"},				/* 7 */
-		{23,"AuthenticationAlgorithm",""},		/* 8 */
-		{12,"WepKeyValue1",""},				/* 9 */
-		{12,"WepKeyValue2",""},				/* 10 */
-		{12,"WepKeyValue3",""},				/* 11 */
-		{12,"WepKeyValue4",""},				/* 12 */
-		{8,"WepIndex","1"},				/* 13 */
-		{7,"WepType","STRING"},				/* 14 */
-		{3,"Wep","OFF"},				/* 15 */
-		{13,"PREAMBLE_TYPE","LONG"},			/* 16 */
-		{8,"ScanType","ACTIVE_SCAN"},			/* 17 */
-		{8,"ROM_FILE", ROM_FILE},			/* 18 */
-		{7,"PhyType", "BG_MODE"},			/* 19 */
-		{7,"CtsMode", "FALSE"},				/* 20 */
-		{19,"PhyInformationTimer", "0"},		/* 21 */
-		{0,"",""},
+		{15, "BeaconLostCount", "20"}, 			/* 0 */
+		{7, "Channel", "1"}, 				/* 1 */
+		{17, "FragmentThreshold", "2346"}, 		/* 2 */
+		{13, "OperationMode", "Infrastructure"},	/* 3 */
+		{19, "PowerManagementMode", "ACTIVE"},	 	/* 4 */
+		{12, "RTSThreshold", "2347"}, 			/* 5 */
+		{4, "SSID", "default"}, 			/* 6 */
+		{6, "TxRate", "Auto"}, 				/* 7 */
+		{23, "AuthenticationAlgorithm", ""}, 		/* 8 */
+		{12, "WepKeyValue1", ""}, 			/* 9 */
+		{12, "WepKeyValue2", ""}, 			/* 10 */
+		{12, "WepKeyValue3", ""}, 			/* 11 */
+		{12, "WepKeyValue4", ""}, 			/* 12 */
+		{8, "WepIndex", "1"}, 				/* 13 */
+		{7, "WepType", "STRING"}, 			/* 14 */
+		{3, "Wep", "OFF"}, 				/* 15 */
+		{13, "PREAMBLE_TYPE", "LONG"}, 			/* 16 */
+		{8, "ScanType", "ACTIVE_SCAN"}, 		/* 17 */
+		{8, "ROM_FILE", ROM_FILE}, 			/* 18 */
+		{7, "PhyType", "BG_MODE"}, 			/* 19 */
+		{7, "CtsMode", "FALSE"}, 			/* 20 */
+		{19, "PhyInformationTimer", "0"}, 		/* 21 */
+		{0, "", ""},
 	};
 
 	const struct firmware *fw_entry;
 	struct device *dev = NULL;
-	char cfg_file[]=CFG_FILE;
+	char cfg_file[] = CFG_FILE;
 	char *cur_p, *end_p;
 	char wk_buff[256], *wk_p;
 
 	/* Initialize Variable */
 	priv->reg.operation_mode = MODE_INFRASTRUCTURE;	/* Infrastructure */
-	priv->reg.channel = 10;		                /* 10 */
-	memset(priv->reg.bssid, 0x0, ETH_ALEN);	    /* BSSID */
-	priv->reg.ssid.body[0] = '\0';		        /* SSID */
-	priv->reg.ssid.size = 0;		        /* SSID size */
-	priv->reg.tx_rate = TX_RATE_AUTO;		/* TxRate Fully Auto */
-	priv->reg.preamble = LONG_PREAMBLE;		/* Preamble = LONG */
-	priv->reg.powermgt = POWMGT_ACTIVE_MODE;        /* POWMGT_ACTIVE_MODE */
-	priv->reg.scan_type = ACTIVE_SCAN;              /* Active */
-	priv->reg.beacon_lost_count = 20;	        /* Beacon Lost Count */
-	priv->reg.rts = 2347UL;                         /* RTS Threashold */
-	priv->reg.fragment = 2346UL;                    /* Fragmentation Threashold */
+	priv->reg.channel = 10;	/* 10 */
+	memset(priv->reg.bssid, 0x0, ETH_ALEN);	/* BSSID */
+	priv->reg.ssid.body[0] = '\0';	/* SSID */
+	priv->reg.ssid.size = 0;	/* SSID size */
+	priv->reg.tx_rate = TX_RATE_AUTO;	/* TxRate Fully Auto */
+	priv->reg.preamble = LONG_PREAMBLE;	/* Preamble = LONG */
+	priv->reg.powermgt = POWMGT_ACTIVE_MODE;	/* POWMGT_ACTIVE_MODE */
+	priv->reg.scan_type = ACTIVE_SCAN;	/* Active */
+	priv->reg.beacon_lost_count = 20;	/* Beacon Lost Count */
+	priv->reg.rts = 2347UL;	/* RTS Threashold */
+	priv->reg.fragment = 2346UL;	/* Fragmentation Threashold */
 
 	strcpy(&priv->reg.rom_file[0], ROM_FILE);
 
 	priv->skb = NULL;
 
-	priv->reg.authenticate_type = AUTH_TYPE_OPEN_SYSTEM; /* AuthenticationAlgorithm */
+	priv->reg.authenticate_type = AUTH_TYPE_OPEN_SYSTEM;	/* AuthenticationAlgorithm */
 
-	priv->reg.privacy_invoked = 0x00; /* WEP */
-	priv->reg.wep_index=0;
-	memset(&priv->reg.wep_key[0],0,sizeof(priv->reg.wep_key[0]));
-	memset(&priv->reg.wep_key[1],0,sizeof(priv->reg.wep_key[0]));
-	memset(&priv->reg.wep_key[2],0,sizeof(priv->reg.wep_key[0]));
-	memset(&priv->reg.wep_key[3],0,sizeof(priv->reg.wep_key[0]));
+	priv->reg.privacy_invoked = 0x00;	/* WEP */
+	priv->reg.wep_index = 0;
+	memset(&priv->reg.wep_key[0], 0, sizeof(priv->reg.wep_key[0]));
+	memset(&priv->reg.wep_key[1], 0, sizeof(priv->reg.wep_key[0]));
+	memset(&priv->reg.wep_key[2], 0, sizeof(priv->reg.wep_key[0]));
+	memset(&priv->reg.wep_key[3], 0, sizeof(priv->reg.wep_key[0]));
 
 	priv->reg.phy_type = D_11BG_COMPATIBLE_MODE;
 	priv->reg.cts_mode = CTS_MODE_FALSE;
@@ -242,13 +243,13 @@ int ks_wlan_read_config_file(struct ks_wlan_private *priv)
 	priv->reg.rate_set.body[9] = TX_RATE_36M;
 	priv->reg.rate_set.body[8] = TX_RATE_18M;
 	priv->reg.rate_set.body[7] = TX_RATE_9M;
-	priv->reg.rate_set.body[6] = TX_RATE_24M|BASIC_RATE;
-	priv->reg.rate_set.body[5] = TX_RATE_12M|BASIC_RATE;
-	priv->reg.rate_set.body[4] = TX_RATE_6M|BASIC_RATE;
-	priv->reg.rate_set.body[3] = TX_RATE_11M|BASIC_RATE;
-	priv->reg.rate_set.body[2] = TX_RATE_5M|BASIC_RATE;
-	priv->reg.rate_set.body[1] = TX_RATE_2M|BASIC_RATE;
-	priv->reg.rate_set.body[0] = TX_RATE_1M|BASIC_RATE;
+	priv->reg.rate_set.body[6] = TX_RATE_24M | BASIC_RATE;
+	priv->reg.rate_set.body[5] = TX_RATE_12M | BASIC_RATE;
+	priv->reg.rate_set.body[4] = TX_RATE_6M | BASIC_RATE;
+	priv->reg.rate_set.body[3] = TX_RATE_11M | BASIC_RATE;
+	priv->reg.rate_set.body[2] = TX_RATE_5M | BASIC_RATE;
+	priv->reg.rate_set.body[1] = TX_RATE_2M | BASIC_RATE;
+	priv->reg.rate_set.body[0] = TX_RATE_1M | BASIC_RATE;
 	priv->reg.tx_rate = TX_RATE_FULL_AUTO;
 	priv->reg.rate_set.size = 12;
 
@@ -257,7 +258,8 @@ int ks_wlan_read_config_file(struct ks_wlan_private *priv)
 	if (request_firmware_direct(&fw_entry, cfg_file, dev))
 		return 0;
 
-	DPRINTK(4, "success request_firmware() file=%s size=%zu\n", cfg_file, fw_entry->size);
+	DPRINTK(4, "success request_firmware() file=%s size=%zu\n", cfg_file,
+		fw_entry->size);
 	cur_p = fw_entry->data;
 	end_p = cur_p + fw_entry->size;
 	*end_p = '\0';
@@ -266,7 +268,7 @@ int ks_wlan_read_config_file(struct ks_wlan_private *priv)
 		int i, j, len;
 
 		len = end_p - cur_p;
-		for (i=0; cfg_tbl[i].key_len != 0; i++) {
+		for (i = 0; cfg_tbl[i].key_len != 0; i++) {
 			if (*cur_p == '#') {
 				break;
 			}
@@ -298,58 +300,64 @@ int ks_wlan_read_config_file(struct ks_wlan_private *priv)
 			}
 			cur_p++;
 
-			for (j=0,wk_p=cur_p; *wk_p != '\n' && wk_p < end_p; j++,wk_p++) {
+			for (j = 0, wk_p = cur_p; *wk_p != '\n' && wk_p < end_p;
+			     j++, wk_p++) {
 				wk_buff[j] = *wk_p;
 			}
 			wk_buff[j] = '\0';
 			cur_p = wk_p;
-			DPRINTK(4,"%s=%s\n",cfg_tbl[i].key, wk_buff);
+			DPRINTK(4, "%s=%s\n", cfg_tbl[i].key, wk_buff);
 			wk_p = wk_buff;
 
 			switch (i) {
-			case  0: /* "BeaconLostCount", "10" */
-				priv->reg.beacon_lost_count = simple_strtol(wk_buff, NULL, 10);
+			case 0:	/* "BeaconLostCount", "10" */
+				priv->reg.beacon_lost_count =
+				    simple_strtol(wk_buff, NULL, 10);
 				break;
-			case  1: /* "Channel", "1" */
-				priv->reg.channel = simple_strtol(wk_buff, NULL, 10);
+			case 1:	/* "Channel", "1" */
+				priv->reg.channel =
+				    simple_strtol(wk_buff, NULL, 10);
 				break;
-			case  2: /* "FragmentThreshold","2346" */
+			case 2:	/* "FragmentThreshold","2346" */
 				j = simple_strtol(wk_buff, NULL, 10);
 				priv->reg.fragment = (unsigned long)j;
 				break;
-			case  3: /* "OperationMode","Infrastructure" */
+			case 3:	/* "OperationMode","Infrastructure" */
 				switch (*wk_buff) {
 				case 'P':
-					priv->reg.operation_mode = MODE_PSEUDO_ADHOC;
+					priv->reg.operation_mode =
+					    MODE_PSEUDO_ADHOC;
 					break;
 				case 'I':
-					priv->reg.operation_mode = MODE_INFRASTRUCTURE;
+					priv->reg.operation_mode =
+					    MODE_INFRASTRUCTURE;
 					break;
 				case '8':
 					priv->reg.operation_mode = MODE_ADHOC;
 					break;
 				default:
-					priv->reg.operation_mode = MODE_INFRASTRUCTURE;
+					priv->reg.operation_mode =
+					    MODE_INFRASTRUCTURE;
 				}
 				break;
-			case  4: /* "PowerManagementMode","POWER_ACTIVE" */
+			case 4:	/* "PowerManagementMode","POWER_ACTIVE" */
 				if (!strncmp(wk_buff, "SAVE1", 5)) {
 					priv->reg.powermgt = POWMGT_SAVE1_MODE;
-				} else if (!strncmp(wk_buff, "SAVE2", 5)){
+				} else if (!strncmp(wk_buff, "SAVE2", 5)) {
 					priv->reg.powermgt = POWMGT_SAVE2_MODE;
 				} else {
 					priv->reg.powermgt = POWMGT_ACTIVE_MODE;
 				}
 				break;
-			case  5: /* "RTSThreshold","2347" */
+			case 5:	/* "RTSThreshold","2347" */
 				j = simple_strtol(wk_buff, NULL, 10);
 				priv->reg.rts = (unsigned long)j;
 				break;
-			case  6: /* "SSID","" */
+			case 6:	/* "SSID","" */
 				if (*wk_p != '"')
 					break;
 				wk_p++;
-				for (j=0; *wk_p != '"'; j++) {
+				for (j = 0; *wk_p != '"'; j++) {
 					if (wk_p == '\0') {
 						break;
 					}
@@ -359,45 +367,51 @@ int ks_wlan_read_config_file(struct ks_wlan_private *priv)
 				priv->reg.ssid.size = j;
 				wk_p++;
 				break;
-			case  7: /* "TxRate","Auto" */
+			case 7:	/* "TxRate","Auto" */
 				rate_set_configuration(priv, wk_p);
 				break;
-			case  8: /* "AuthenticationAlgorithm","OPEN_SYSTEM" */
+			case 8:	/* "AuthenticationAlgorithm","OPEN_SYSTEM" */
 				switch (*wk_p) {
-				case 'O': /* Authenticate System : Open System */
-					priv->reg.authenticate_type = AUTH_TYPE_OPEN_SYSTEM;
+				case 'O':	/* Authenticate System : Open System */
+					priv->reg.authenticate_type =
+					    AUTH_TYPE_OPEN_SYSTEM;
 					break;
-				case 'S': /* Authenticate System : Shared Key */
-					priv->reg.authenticate_type = AUTH_TYPE_SHARED_KEY;
+				case 'S':	/* Authenticate System : Shared Key */
+					priv->reg.authenticate_type =
+					    AUTH_TYPE_SHARED_KEY;
 					break;
 				}
 				break;
-			case 9:  /* "WepKeyValue1","" */
-			case 10: /* "WepKeyValue2","" */
-			case 11: /* "WepKeyValue3","" */
-			case 12: /* "WepKeyValue4","" */
+			case 9:	/* "WepKeyValue1","" */
+			case 10:	/* "WepKeyValue2","" */
+			case 11:	/* "WepKeyValue3","" */
+			case 12:	/* "WepKeyValue4","" */
 				if (wep_on_off != WEP_OFF) {
 					switch (wep_type) {
 					case WEP_KEY_CHARACTER:
-						analyze_character_wep_key(&priv->reg, (i-9), wk_p);
+						analyze_character_wep_key
+						    (&priv->reg, (i - 9), wk_p);
 						break;
 					case WEP_KEY_HEX:
-						analyze_hex_wep_key(&priv->reg, (i-9), wk_p);
+						analyze_hex_wep_key(&priv->reg,
+								    (i - 9),
+								    wk_p);
 						break;
 					}
 				}
 				break;
-			case 13: /* "WepIndex","1"->0 (So, Zero Origin) */
-				priv->reg.wep_index = simple_strtol(wk_buff, NULL, 10) - 1;
+			case 13:	/* "WepIndex","1"->0 (So, Zero Origin) */
+				priv->reg.wep_index =
+				    simple_strtol(wk_buff, NULL, 10) - 1;
 				break;
-			case 14: /* "WepType","STRING" */
+			case 14:	/* "WepType","STRING" */
 				if (!strncmp(wk_buff, "STRING", 6)) {
 					wep_type = WEP_KEY_CHARACTER;
 				} else {
 					wep_type = WEP_KEY_HEX;
 				}
 				break;
-			case 15: /* "Wep","OFF" */
+			case 15:	/* "Wep","OFF" */
 				if (!strncmp(wk_buff, "OFF", 3)) {
 					priv->reg.privacy_invoked = 0x00;
 					wep_on_off = WEP_OFF;
@@ -405,30 +419,30 @@ int ks_wlan_read_config_file(struct ks_wlan_private *priv)
 					priv->reg.privacy_invoked = 0x01;
 					if (*wk_buff == '6') {	/* 64bit */
 						wep_on_off = WEP_ON_64BIT;
-					} else { 		/* 128bit */
+					} else {	/* 128bit */
 						wep_on_off = WEP_ON_128BIT;
 					}
 				}
 				break;
-			case 16: /* "PREAMBLE_TYPE","LONG" */
+			case 16:	/* "PREAMBLE_TYPE","LONG" */
 				if (!strncmp(wk_buff, "SHORT", 5)) {
 					priv->reg.preamble = SHORT_PREAMBLE;
-				} else {		/* "LONG" */
+				} else {	/* "LONG" */
 					priv->reg.preamble = LONG_PREAMBLE;
 				}
 				break;
-			case 17: /* "ScanType","ACTIVE_SCAN" */
+			case 17:	/* "ScanType","ACTIVE_SCAN" */
 				if (!strncmp(wk_buff, "PASSIVE_SCAN", 12)) {
 					priv->reg.scan_type = PASSIVE_SCAN;
-				} else {		/* "ACTIVE_SCAN" */
+				} else {	/* "ACTIVE_SCAN" */
 					priv->reg.scan_type = ACTIVE_SCAN;
 				}
 				break;
-			case 18: // "ROM_FILE",ROMFILE
+			case 18:	// "ROM_FILE",ROMFILE
 				if (*wk_p != '"')
 					break;
 				wk_p++;
-				for (j=0; *wk_p != '"'; j++) {
+				for (j = 0; *wk_p != '"'; j++) {
 					if (wk_p == '\0') {
 						break;
 					}
@@ -437,25 +451,26 @@ int ks_wlan_read_config_file(struct ks_wlan_private *priv)
 				priv->reg.rom_file[j] = '\0';
 				wk_p++;
 				break;
-			case 19: /*"PhyType", "BG_MODE" */
+			case 19:	/*"PhyType", "BG_MODE" */
 				if (!strncmp(wk_buff, "B_MODE", 6)) {
 					priv->reg.phy_type = D_11B_ONLY_MODE;
 				} else if (!strncmp(wk_buff, "G_MODE", 6)) {
 					priv->reg.phy_type = D_11G_ONLY_MODE;
 				} else {
-					priv->reg.phy_type = D_11BG_COMPATIBLE_MODE;
+					priv->reg.phy_type =
+					    D_11BG_COMPATIBLE_MODE;
 				}
 				break;
-			case 20: /* "CtsMode", "FALSE" */
+			case 20:	/* "CtsMode", "FALSE" */
 				if (!strncmp(wk_buff, "TRUE", 4)) {
 					priv->reg.cts_mode = CTS_MODE_TRUE;
 				} else {
 					priv->reg.cts_mode = CTS_MODE_FALSE;
 				}
 				break;
-			case 21: /* "PhyInformationTimer", "0" */
+			case 21:	/* "PhyInformationTimer", "0" */
 				j = simple_strtol(wk_buff, NULL, 10);
-				priv->reg.phy_info_timer = (uint16_t)j;
+				priv->reg.phy_info_timer = (uint16_t) j;
 				break;
 			default:
 				break;
@@ -469,17 +484,17 @@ int ks_wlan_read_config_file(struct ks_wlan_private *priv)
 	}
 	release_firmware(fw_entry);
 
-	DPRINTK(3,"\n    operation_mode = %d\n    channel = %d\n    ssid = %s\n    tx_rate = %d\n \
+	DPRINTK(3,
+		"\n    operation_mode = %d\n    channel = %d\n    ssid = %s\n    tx_rate = %d\n \
    preamble = %d\n    powermgt = %d\n    scan_type = %d\n    beacon_lost_count = %d\n    rts = %d\n \
    fragment = %d\n    privacy_invoked = %d\n    wep_type = %d\n    wep_on_off = %d\n    wep_index = %d\n    romfile = %s\n",
-		priv->reg.operation_mode,priv->reg.channel,&priv->reg.ssid.body[0],priv->reg.tx_rate,
-		priv->reg.preamble,priv->reg.powermgt,priv->reg.scan_type,priv->reg.beacon_lost_count,
-		priv->reg.rts,priv->reg.fragment,priv->reg.privacy_invoked,wep_type,wep_on_off,priv->reg.wep_index,
-		&priv->reg.rom_file[0]
-		);
-	DPRINTK(3,"\n    phy_type = %d\n    cts_mode = %d\n    tx_rate = %d\n    phy_info_timer = %d\n",
-		priv->reg.phy_type,priv->reg.cts_mode,priv->reg.tx_rate,priv->reg.phy_info_timer );
-
-	return(0);
+		priv->reg.operation_mode, priv->reg.channel, &priv->reg.ssid.body[0], priv->reg.tx_rate, priv->reg.preamble, priv->reg.powermgt, priv->reg.scan_type, priv->reg.beacon_lost_count, priv->reg.rts, priv->reg.fragment, priv->reg.privacy_invoked, wep_type, wep_on_off,
+		priv->reg.wep_index, &priv->reg.rom_file[0]
+	    );
+	DPRINTK(3,
+		"\n    phy_type = %d\n    cts_mode = %d\n    tx_rate = %d\n    phy_info_timer = %d\n",
+		priv->reg.phy_type, priv->reg.cts_mode, priv->reg.tx_rate,
+		priv->reg.phy_info_timer);
+
+	return (0);
 }
-
-- 
2.8.1

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

* [PATCH 17/27] staging: ks7010: indent ks7010_sdio.h
  2016-05-10 13:52 [PATCH 00/27] staging: add driver for KS7010 based SDIO cards Wolfram Sang
                   ` (14 preceding siblings ...)
  2016-05-10 13:52 ` [PATCH 16/27] staging: ks7010: indent ks7010_config.c Wolfram Sang
@ 2016-05-10 13:52 ` Wolfram Sang
  2016-05-10 13:52 ` [PATCH 19/27] staging: ks7010: indent ks_hostif.h Wolfram Sang
                   ` (11 subsequent siblings)
  27 siblings, 0 replies; 32+ messages in thread
From: Wolfram Sang @ 2016-05-10 13:52 UTC (permalink / raw)
  To: driverdev-devel; +Cc: Wolfram Sang, linux-renesas-soc

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/staging/ks7010/ks7010_sdio.h | 64 +++++++++++++++++-------------------
 1 file changed, 30 insertions(+), 34 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.h b/drivers/staging/ks7010/ks7010_sdio.h
index 1d16673e5dae02..aea3727caf483b 100644
--- a/drivers/staging/ks7010/ks7010_sdio.h
+++ b/drivers/staging/ks7010/ks7010_sdio.h
@@ -21,7 +21,7 @@
 #define DEVICE_ALIGNMENT 32
 
 /*  SDIO KeyStream vendor and device */
-#define SDIO_VENDOR_ID_KS_CODE_A	0x005b 
+#define SDIO_VENDOR_ID_KS_CODE_A	0x005b
 #define SDIO_VENDOR_ID_KS_CODE_B	0x0023
 #define SDIO_DEVICE_ID_KS_7010		0x7910
 
@@ -48,8 +48,8 @@
  * 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] */
+#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
@@ -88,52 +88,48 @@
 
 #define KS7010_IRAM_ADDRESS	0x06000000
 
-
 /* 
  * struct define
  */
 struct hw_info_t {
-	struct ks_sdio_card *sdio_card;	
+	struct ks_sdio_card *sdio_card;
 	struct completion ks7010_sdio_wait;
 	struct workqueue_struct *ks7010sdio_wq;
 	struct delayed_work rw_wq;
-	unsigned char	*read_buf;
+	unsigned char *read_buf;
 	struct tasklet_struct rx_bh_task;
 };
 
 struct ks_sdio_packet {
-        struct ks_sdio_packet   *next;
-        u16                     nb;
-        u8                      buffer[0] __attribute__((aligned(4)));
+	struct ks_sdio_packet *next;
+	u16 nb;
+	u8 buffer[0] __attribute__ ((aligned(4)));
 };
 
-
 struct ks_sdio_card {
-	struct sdio_func	*func;
+	struct sdio_func *func;
 	struct ks_wlan_private *priv;
-	int			model;
-	const char		*firmware;
-        spinlock_t              lock;
+	int model;
+	const char *firmware;
+	spinlock_t lock;
 };
 
-
-
 /* Tx Device struct */
-#define	TX_DEVICE_BUFF_SIZE	1024 
+#define	TX_DEVICE_BUFF_SIZE	1024
 
 struct tx_device_buffer {
-        unsigned char *sendp;		/* pointer of send req data */
-        unsigned int  size;
-	void	(*complete_handler)(void *arg1, void *arg2);
-	void	*arg1;
-	void	*arg2;
+	unsigned char *sendp;	/* pointer of send req data */
+	unsigned int size;
+	void (*complete_handler) (void *arg1, void *arg2);
+	void *arg1;
+	void *arg2;
 };
 
-struct tx_device{
-        struct tx_device_buffer tx_dev_buff[TX_DEVICE_BUFF_SIZE];
-        unsigned int	qhead; /* tx buffer queue first pointer */
-        unsigned int	qtail; /* tx buffer queue last pointer */
-        spinlock_t  tx_dev_lock;
+struct tx_device {
+	struct tx_device_buffer tx_dev_buff[TX_DEVICE_BUFF_SIZE];
+	unsigned int qhead;	/* tx buffer queue first pointer */
+	unsigned int qtail;	/* tx buffer queue last pointer */
+	spinlock_t tx_dev_lock;
 };
 
 /* Rx Device struct */
@@ -141,15 +137,15 @@ struct tx_device{
 #define	RX_DEVICE_BUFF_SIZE	32
 
 struct rx_device_buffer {
-       unsigned char	data[RX_DATA_SIZE];
-       unsigned int	size;
+	unsigned char data[RX_DATA_SIZE];
+	unsigned int size;
 };
 
-struct rx_device{
-        struct rx_device_buffer rx_dev_buff[RX_DEVICE_BUFF_SIZE];
-        unsigned int	qhead; /* rx buffer queue first pointer */
-	unsigned int	qtail; /* rx buffer queue last pointer */
-	spinlock_t  rx_dev_lock;
+struct rx_device {
+	struct rx_device_buffer rx_dev_buff[RX_DEVICE_BUFF_SIZE];
+	unsigned int qhead;	/* rx buffer queue first pointer */
+	unsigned int qtail;	/* rx buffer queue last pointer */
+	spinlock_t rx_dev_lock;
 };
 #define	ROM_FILE "ks7010sd.rom"
 #define	CFG_FILE "ks79xx.cfg"
-- 
2.8.1

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

* [PATCH 19/27] staging: ks7010: indent ks_hostif.h
  2016-05-10 13:52 [PATCH 00/27] staging: add driver for KS7010 based SDIO cards Wolfram Sang
                   ` (15 preceding siblings ...)
  2016-05-10 13:52 ` [PATCH 17/27] staging: ks7010: indent ks7010_sdio.h Wolfram Sang
@ 2016-05-10 13:52 ` Wolfram Sang
  2016-05-10 13:52 ` [PATCH 20/27] staging: ks7010: indent ks_wlan.h Wolfram Sang
                   ` (10 subsequent siblings)
  27 siblings, 0 replies; 32+ messages in thread
From: Wolfram Sang @ 2016-05-10 13:52 UTC (permalink / raw)
  To: driverdev-devel; +Cc: Wolfram Sang, linux-renesas-soc

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/staging/ks7010/ks_hostif.h | 525 ++++++++++++++++++-------------------
 1 file changed, 262 insertions(+), 263 deletions(-)

diff --git a/drivers/staging/ks7010/ks_hostif.h b/drivers/staging/ks7010/ks_hostif.h
index c333ce1a4baa6e..01de478d45ea60 100644
--- a/drivers/staging/ks7010/ks_hostif.h
+++ b/drivers/staging/ks7010/ks_hostif.h
@@ -62,141 +62,140 @@
  */
 
 struct hostif_hdr {
-	uint16_t	size;
-	uint16_t	event;
-} __attribute__((packed));
+	uint16_t size;
+	uint16_t event;
+} __attribute__ ((packed));
 
 struct hostif_data_request_t {
 	struct hostif_hdr header;
-	uint16_t	auth_type;
+	uint16_t auth_type;
 #define TYPE_DATA 0x0000
 #define TYPE_AUTH 0x0001
-	uint16_t	reserved;
-	uint8_t		data[0];
-} __attribute__((packed));
+	uint16_t reserved;
+	uint8_t data[0];
+} __attribute__ ((packed));
 
 struct hostif_data_indication_t {
 	struct hostif_hdr header;
-	uint16_t	auth_type;
+	uint16_t auth_type;
 /* #define TYPE_DATA 0x0000 */
 #define TYPE_PMK1 0x0001
 #define TYPE_GMK1 0x0002
 #define TYPE_GMK2 0x0003
-	uint16_t	reserved;
-	uint8_t		data[0];
-} __attribute__((packed));
+	uint16_t reserved;
+	uint8_t data[0];
+} __attribute__ ((packed));
 
 #define CHANNEL_LIST_MAX_SIZE 14
 struct channel_list_t {
-	uint8_t	size;
-	uint8_t	body[CHANNEL_LIST_MAX_SIZE];
-	uint8_t	pad;
-} __attribute__((packed));
+	uint8_t size;
+	uint8_t body[CHANNEL_LIST_MAX_SIZE];
+	uint8_t pad;
+} __attribute__ ((packed));
 
 /* MIB Attribute */
-#define DOT11_MAC_ADDRESS                 0x21010100 /* MAC Address (R) */
-#define DOT11_PRODUCT_VERSION             0x31024100 /* FirmWare Version (R)*/
-#define DOT11_RTS_THRESHOLD               0x21020100 /* RTS Threshold (R/W) */
-#define DOT11_FRAGMENTATION_THRESHOLD     0x21050100 /* Fragment Threshold (R/W) */
-#define DOT11_PRIVACY_INVOKED             0x15010100 /* WEP ON/OFF (W) */
-#define DOT11_WEP_DEFAULT_KEY_ID          0x15020100 /* WEP Index (W) */
-#define DOT11_WEP_DEFAULT_KEY_VALUE1      0x13020101 /* WEP Key#1(TKIP AES: PairwiseTemporalKey) (W) */
-#define DOT11_WEP_DEFAULT_KEY_VALUE2      0x13020102 /* WEP Key#2(TKIP AES: GroupKey1) (W) */
-#define DOT11_WEP_DEFAULT_KEY_VALUE3      0x13020103 /* WEP Key#3(TKIP AES: GroupKey2) (W) */
-#define DOT11_WEP_DEFAULT_KEY_VALUE4      0x13020104 /* WEP Key#4 (W) */
-#define DOT11_WEP_LIST                    0x13020100 /* WEP LIST */
-#define	DOT11_DESIRED_SSID		  0x11090100 /* SSID */
-#define	DOT11_CURRENT_CHANNEL		  0x45010100 /* channel set */
-#define	DOT11_OPERATION_RATE_SET	  0x11110100 /* rate set */
-
-#define LOCAL_AP_SEARCH_INTEAVAL          0xF1010100 /* AP search interval (R/W) */
-#define LOCAL_CURRENTADDRESS              0xF1050100 /* MAC Adress change (W) */
-#define LOCAL_MULTICAST_ADDRESS           0xF1060100 /* Multicast Adress (W) */
-#define LOCAL_MULTICAST_FILTER            0xF1060200 /* Multicast Adress Filter enable/disable (W) */
-#define LOCAL_SEARCHED_AP_LIST            0xF1030100 /* AP list (R) */
-#define LOCAL_LINK_AP_STATUS              0xF1040100 /* Link AP status (R) */
-#define	LOCAL_PACKET_STATISTICS		  0xF1020100 /* tx,rx packets statistics */
-#define LOCAL_AP_SCAN_LIST_TYPE_SET	  0xF1030200 /* AP_SCAN_LIST_TYPE */
-
-#define DOT11_RSN_ENABLED                 0x15070100 /* WPA enable/disable (W) */
-#define LOCAL_RSN_MODE                    0x56010100 /* RSN mode WPA/WPA2 (W) */
-#define DOT11_RSN_CONFIG_MULTICAST_CIPHER 0x51040100 /* GroupKeyCipherSuite (W) */
-#define DOT11_RSN_CONFIG_UNICAST_CIPHER   0x52020100 /* PairwiseKeyCipherSuite (W) */
-#define DOT11_RSN_CONFIG_AUTH_SUITE       0x53020100 /* AuthenticationKeyManagementSuite (W) */
-#define DOT11_RSN_CONFIG_VERSION          0x51020100 /* RSN version (W) */
-#define LOCAL_RSN_CONFIG_ALL              0x5F010100 /* RSN CONFIG ALL (W) */
-#define DOT11_PMK_TSC                     0x55010100 /* PMK_TSC (W) */
-#define DOT11_GMK1_TSC                    0x55010101 /* GMK1_TSC (W) */
-#define DOT11_GMK2_TSC                    0x55010102 /* GMK2_TSC (W) */
-#define DOT11_GMK3_TSC   		  0x55010103 /* GMK3_TSC */
-#define LOCAL_PMK                         0x58010100 /* Pairwise Master Key cache (W) */
-
-#define LOCAL_REGION                      0xF10A0100 /* Region setting */
+#define DOT11_MAC_ADDRESS                 0x21010100	/* MAC Address (R) */
+#define DOT11_PRODUCT_VERSION             0x31024100	/* FirmWare Version (R) */
+#define DOT11_RTS_THRESHOLD               0x21020100	/* RTS Threshold (R/W) */
+#define DOT11_FRAGMENTATION_THRESHOLD     0x21050100	/* Fragment Threshold (R/W) */
+#define DOT11_PRIVACY_INVOKED             0x15010100	/* WEP ON/OFF (W) */
+#define DOT11_WEP_DEFAULT_KEY_ID          0x15020100	/* WEP Index (W) */
+#define DOT11_WEP_DEFAULT_KEY_VALUE1      0x13020101	/* WEP Key#1(TKIP AES: PairwiseTemporalKey) (W) */
+#define DOT11_WEP_DEFAULT_KEY_VALUE2      0x13020102	/* WEP Key#2(TKIP AES: GroupKey1) (W) */
+#define DOT11_WEP_DEFAULT_KEY_VALUE3      0x13020103	/* WEP Key#3(TKIP AES: GroupKey2) (W) */
+#define DOT11_WEP_DEFAULT_KEY_VALUE4      0x13020104	/* WEP Key#4 (W) */
+#define DOT11_WEP_LIST                    0x13020100	/* WEP LIST */
+#define	DOT11_DESIRED_SSID		  0x11090100	/* SSID */
+#define	DOT11_CURRENT_CHANNEL		  0x45010100	/* channel set */
+#define	DOT11_OPERATION_RATE_SET	  0x11110100	/* rate set */
+
+#define LOCAL_AP_SEARCH_INTEAVAL          0xF1010100	/* AP search interval (R/W) */
+#define LOCAL_CURRENTADDRESS              0xF1050100	/* MAC Adress change (W) */
+#define LOCAL_MULTICAST_ADDRESS           0xF1060100	/* Multicast Adress (W) */
+#define LOCAL_MULTICAST_FILTER            0xF1060200	/* Multicast Adress Filter enable/disable (W) */
+#define LOCAL_SEARCHED_AP_LIST            0xF1030100	/* AP list (R) */
+#define LOCAL_LINK_AP_STATUS              0xF1040100	/* Link AP status (R) */
+#define	LOCAL_PACKET_STATISTICS		  0xF1020100	/* tx,rx packets statistics */
+#define LOCAL_AP_SCAN_LIST_TYPE_SET	  0xF1030200	/* AP_SCAN_LIST_TYPE */
+
+#define DOT11_RSN_ENABLED                 0x15070100	/* WPA enable/disable (W) */
+#define LOCAL_RSN_MODE                    0x56010100	/* RSN mode WPA/WPA2 (W) */
+#define DOT11_RSN_CONFIG_MULTICAST_CIPHER 0x51040100	/* GroupKeyCipherSuite (W) */
+#define DOT11_RSN_CONFIG_UNICAST_CIPHER   0x52020100	/* PairwiseKeyCipherSuite (W) */
+#define DOT11_RSN_CONFIG_AUTH_SUITE       0x53020100	/* AuthenticationKeyManagementSuite (W) */
+#define DOT11_RSN_CONFIG_VERSION          0x51020100	/* RSN version (W) */
+#define LOCAL_RSN_CONFIG_ALL              0x5F010100	/* RSN CONFIG ALL (W) */
+#define DOT11_PMK_TSC                     0x55010100	/* PMK_TSC (W) */
+#define DOT11_GMK1_TSC                    0x55010101	/* GMK1_TSC (W) */
+#define DOT11_GMK2_TSC                    0x55010102	/* GMK2_TSC (W) */
+#define DOT11_GMK3_TSC   		  0x55010103	/* GMK3_TSC */
+#define LOCAL_PMK                         0x58010100	/* Pairwise Master Key cache (W) */
+
+#define LOCAL_REGION                      0xF10A0100	/* Region setting */
 
 #ifdef WPS
-#define LOCAL_WPS_ENABLE                  0xF10B0100 /* WiFi Protected Setup */
-#define LOCAL_WPS_PROBE_REQ               0xF10C0100 /* WPS Probe Request */
+#define LOCAL_WPS_ENABLE                  0xF10B0100	/* WiFi Protected Setup */
+#define LOCAL_WPS_PROBE_REQ               0xF10C0100	/* WPS Probe Request */
 #endif /* WPS */
 
-#define LOCAL_GAIN                        0xF10D0100 /* Carrer sense threshold for demo ato show */
-#define LOCAL_EEPROM_SUM                  0xF10E0100 /* EEPROM checksum information */
+#define LOCAL_GAIN                        0xF10D0100	/* Carrer sense threshold for demo ato show */
+#define LOCAL_EEPROM_SUM                  0xF10E0100	/* EEPROM checksum information */
 
 struct hostif_mib_get_request_t {
 	struct hostif_hdr header;
-	uint32_t	mib_attribute;
-} __attribute__((packed));
-
+	uint32_t mib_attribute;
+} __attribute__ ((packed));
 
 struct hostif_mib_value_t {
-	uint16_t	size;
-	uint16_t	type;
+	uint16_t size;
+	uint16_t type;
 #define MIB_VALUE_TYPE_NULL     0
 #define MIB_VALUE_TYPE_INT      1
 #define MIB_VALUE_TYPE_BOOL     2
 #define MIB_VALUE_TYPE_COUNT32  3
 #define MIB_VALUE_TYPE_OSTRING  4
-	uint8_t	body[0];
-} __attribute__((packed));
+	uint8_t body[0];
+} __attribute__ ((packed));
 
 struct hostif_mib_get_confirm_t {
 	struct hostif_hdr header;
-	uint32_t	mib_status;
+	uint32_t mib_status;
 #define MIB_SUCCESS    0
 #define MIB_INVALID    1
 #define MIB_READ_ONLY  2
 #define MIB_WRITE_ONLY 3
-	uint32_t	mib_attribute;
+	uint32_t mib_attribute;
 	struct hostif_mib_value_t mib_value;
-} __attribute__((packed));
+} __attribute__ ((packed));
 
 struct hostif_mib_set_request_t {
 	struct hostif_hdr header;
-	uint32_t	mib_attribute;
+	uint32_t mib_attribute;
 	struct hostif_mib_value_t mib_value;
-} __attribute__((packed));
+} __attribute__ ((packed));
 
 struct hostif_mib_set_confirm_t {
 	struct hostif_hdr header;
-	uint32_t	mib_status;
-	uint32_t	mib_attribute;
-} __attribute__((packed));
+	uint32_t mib_status;
+	uint32_t mib_attribute;
+} __attribute__ ((packed));
 
 struct hostif_power_mngmt_request_t {
 	struct hostif_hdr header;
-	uint32_t	mode;
+	uint32_t mode;
 #define POWER_ACTIVE  1
 #define POWER_SAVE    2
-	uint32_t	wake_up;
+	uint32_t wake_up;
 #define SLEEP_FALSE 0
-#define SLEEP_TRUE  1 /* not used */
-	uint32_t	receiveDTIMs;
+#define SLEEP_TRUE  1	/* not used */
+	uint32_t receiveDTIMs;
 #define DTIM_FALSE 0
 #define DTIM_TRUE  1
-} __attribute__((packed));
+} __attribute__ ((packed));
 
 /* power management mode */
 enum {
-	POWMGT_ACTIVE_MODE=0,
+	POWMGT_ACTIVE_MODE = 0,
 	POWMGT_SAVE1_MODE,
 	POWMGT_SAVE2_MODE
 };
@@ -209,84 +208,83 @@ enum {
 
 struct hostif_power_mngmt_confirm_t {
 	struct hostif_hdr header;
-	uint16_t	result_code;
-} __attribute__((packed));
+	uint16_t result_code;
+} __attribute__ ((packed));
 
 struct hostif_start_request_t {
 	struct hostif_hdr header;
-	uint16_t	mode;
+	uint16_t mode;
 #define MODE_PSEUDO_ADHOC   0
 #define MODE_INFRASTRUCTURE 1
-#define MODE_AP             2 /* not used */
+#define MODE_AP             2	/* not used */
 #define MODE_ADHOC          3
-} __attribute__((packed));
+} __attribute__ ((packed));
 
 struct hostif_start_confirm_t {
 	struct hostif_hdr header;
-	uint16_t	result_code;
-} __attribute__((packed));
+	uint16_t result_code;
+} __attribute__ ((packed));
 
 #define SSID_MAX_SIZE 32
 struct ssid_t {
-	uint8_t	size;
-	uint8_t	body[SSID_MAX_SIZE];
-	uint8_t	ssid_pad;
-} __attribute__((packed));
+	uint8_t size;
+	uint8_t body[SSID_MAX_SIZE];
+	uint8_t ssid_pad;
+} __attribute__ ((packed));
 
 #define RATE_SET_MAX_SIZE 16
 struct rate_set8_t {
-	uint8_t	size;
-	uint8_t	body[8];
-	uint8_t	rate_pad;
-} __attribute__((packed));
+	uint8_t size;
+	uint8_t body[8];
+	uint8_t rate_pad;
+} __attribute__ ((packed));
 
 struct FhParms_t {
-	uint16_t	dwellTime;
-	uint8_t		hopSet;
-	uint8_t		hopPattern;
-	uint8_t		hopIndex;
-} __attribute__((packed));
+	uint16_t dwellTime;
+	uint8_t hopSet;
+	uint8_t hopPattern;
+	uint8_t hopIndex;
+} __attribute__ ((packed));
 
 struct DsParms_t {
-	uint8_t	channel;
-} __attribute__((packed));
+	uint8_t channel;
+} __attribute__ ((packed));
 
 struct CfParms_t {
-	uint8_t		count;
-	uint8_t		period;
-	uint16_t	maxDuration;
-	uint16_t	durRemaining;
-} __attribute__((packed));
+	uint8_t count;
+	uint8_t period;
+	uint16_t maxDuration;
+	uint16_t durRemaining;
+} __attribute__ ((packed));
 
 struct IbssParms_t {
-	uint16_t	atimWindow;
-} __attribute__((packed));
-
+	uint16_t atimWindow;
+} __attribute__ ((packed));
 
 struct rsn_t {
-	uint8_t	size;
+	uint8_t size;
 #define RSN_BODY_SIZE 64
-	uint8_t	body[RSN_BODY_SIZE];
-} __attribute__((packed));
+	uint8_t body[RSN_BODY_SIZE];
+} __attribute__ ((packed));
 
 struct ErpParams_t {
 	uint8_t erp_info;
-} __attribute__((packed));
-
-struct rate_set16_t{
-	uint8_t	size;
-	uint8_t	body[16];
-	uint8_t	rate_pad;
-} __attribute__((packed));
-
-struct	ap_info_t{
-	uint8_t		bssid[6];		/* +00 */
-	uint8_t		rssi;			/* +06 */
-	uint8_t		sq;			/* +07 */
-	uint8_t		noise;			/* +08 */
-	uint8_t		pad0;			/* +09 */
-	uint16_t	beacon_period;		/* +10 */
-	uint16_t	capability;		/* +12 */
+} __attribute__ ((packed));
+
+struct rate_set16_t {
+	uint8_t size;
+	uint8_t body[16];
+	uint8_t rate_pad;
+} __attribute__ ((packed));
+
+struct ap_info_t {
+	uint8_t bssid[6];	/* +00 */
+	uint8_t rssi;	/* +06 */
+	uint8_t sq;	/* +07 */
+	uint8_t noise;	/* +08 */
+	uint8_t pad0;	/* +09 */
+	uint16_t beacon_period;	/* +10 */
+	uint16_t capability;	/* +12 */
 #define BSS_CAP_ESS             (1<<0)
 #define BSS_CAP_IBSS            (1<<1)
 #define BSS_CAP_CF_POLABLE      (1<<2)
@@ -297,178 +295,176 @@ struct	ap_info_t{
 #define BSS_CAP_CHANNEL_AGILITY (1<<7)
 #define BSS_CAP_SHORT_SLOT_TIME (1<<10)
 #define BSS_CAP_DSSS_OFDM       (1<<13)
-	uint8_t		frame_type;		/* +14 */
-	uint8_t		ch_info;		/* +15 */
+	uint8_t frame_type;	/* +14 */
+	uint8_t ch_info;	/* +15 */
 #define FRAME_TYPE_BEACON	0x80
 #define FRAME_TYPE_PROBE_RESP	0x50
-	uint16_t	body_size;		/* +16 */
-	uint8_t		body[1024];		/* +18 */
-						/* +1032 */
-} __attribute__((packed));
-
-struct	link_ap_info_t{
-	uint8_t		bssid[6];		/* +00 */
-	uint8_t		rssi;			/* +06 */
-	uint8_t		sq;			/* +07 */
-	uint8_t		noise;			/* +08 */
-	uint8_t		pad0;			/* +09 */
-	uint16_t	beacon_period;		/* +10 */
-	uint16_t	capability;		/* +12 */
-	struct rate_set8_t  rate_set;		/* +14 */
-	struct FhParms_t   fh_parameter;	/* +24 */
-	struct DsParms_t   ds_parameter;	/* +29 */
-	struct CfParms_t   cf_parameter;	/* +30 */
+	uint16_t body_size;	/* +16 */
+	uint8_t body[1024];	/* +18 */
+	/* +1032 */
+} __attribute__ ((packed));
+
+struct link_ap_info_t {
+	uint8_t bssid[6];	/* +00 */
+	uint8_t rssi;	/* +06 */
+	uint8_t sq;	/* +07 */
+	uint8_t noise;	/* +08 */
+	uint8_t pad0;	/* +09 */
+	uint16_t beacon_period;	/* +10 */
+	uint16_t capability;	/* +12 */
+	struct rate_set8_t rate_set;	/* +14 */
+	struct FhParms_t fh_parameter;	/* +24 */
+	struct DsParms_t ds_parameter;	/* +29 */
+	struct CfParms_t cf_parameter;	/* +30 */
 	struct IbssParms_t ibss_parameter;	/* +36 */
 	struct ErpParams_t erp_parameter;	/* +38 */
-	uint8_t		   pad1;		/* +39 */
-	struct rate_set8_t  ext_rate_set;	/* +40 */
-	uint8_t	DTIM_period;			/* +50 */
-	uint8_t rsn_mode;			/* +51 */
+	uint8_t pad1;	/* +39 */
+	struct rate_set8_t ext_rate_set;	/* +40 */
+	uint8_t DTIM_period;	/* +50 */
+	uint8_t rsn_mode;	/* +51 */
 #define RSN_MODE_NONE	0
 #define RSN_MODE_WPA	1
 #define RSN_MODE_WPA2	2
 	struct {
-		uint8_t size;			/* +52 */
-		uint8_t body[128];		/* +53 */
-	} __attribute__((packed)) rsn;
-} __attribute__((packed));
+		uint8_t size;	/* +52 */
+		uint8_t body[128];	/* +53 */
+	} __attribute__ ((packed)) rsn;
+} __attribute__ ((packed));
 
 struct hostif_connect_indication_t {
 	struct hostif_hdr header;
-	uint16_t	connect_code;
+	uint16_t connect_code;
 #define RESULT_CONNECT    0
 #define RESULT_DISCONNECT 1
 	struct link_ap_info_t link_ap_info;
-} __attribute__((packed));
+} __attribute__ ((packed));
 
 struct hostif_stop_request_t {
 	struct hostif_hdr header;
-} __attribute__((packed));
+} __attribute__ ((packed));
 
 struct hostif_stop_confirm_t {
 	struct hostif_hdr header;
-	uint16_t	result_code;
-} __attribute__((packed));
+	uint16_t result_code;
+} __attribute__ ((packed));
 
 struct hostif_ps_adhoc_set_request_t {
 	struct hostif_hdr header;
-	uint16_t	phy_type;
+	uint16_t phy_type;
 #define D_11B_ONLY_MODE		0
 #define D_11G_ONLY_MODE		1
 #define D_11BG_COMPATIBLE_MODE	2
 #define D_11A_ONLY_MODE		3
-	uint16_t	cts_mode;
+	uint16_t cts_mode;
 #define CTS_MODE_FALSE	0
 #define CTS_MODE_TRUE	1
-	uint16_t	channel;
+	uint16_t channel;
 	struct rate_set16_t rate_set;
-	uint16_t	capability; /* bit5:preamble bit6:pbcc pbcc not supported always 0 
-				     * bit10:ShortSlotTime bit13:DSSS-OFDM DSSS-OFDM not supported always 0 */
-	uint16_t	scan_type;
-} __attribute__((packed));
+	uint16_t capability;	/* bit5:preamble bit6:pbcc pbcc not supported always 0 
+				 * bit10:ShortSlotTime bit13:DSSS-OFDM DSSS-OFDM not supported always 0 */
+	uint16_t scan_type;
+} __attribute__ ((packed));
 
 struct hostif_ps_adhoc_set_confirm_t {
 	struct hostif_hdr header;
-	uint16_t	result_code;
-} __attribute__((packed));
+	uint16_t result_code;
+} __attribute__ ((packed));
 
 struct hostif_infrastructure_set_request_t {
 	struct hostif_hdr header;
-	uint16_t	phy_type;
-	uint16_t	cts_mode;
+	uint16_t phy_type;
+	uint16_t cts_mode;
 	struct rate_set16_t rate_set;
 	struct ssid_t ssid;
-	uint16_t	capability;  /* bit5:preamble bit6:pbcc pbcc not supported always 0 
-				      * bit10:ShortSlotTime bit13:DSSS-OFDM DSSS-OFDM not supported always 0 */
-	uint16_t	beacon_lost_count;
-	uint16_t	auth_type;
+	uint16_t capability;	/* bit5:preamble bit6:pbcc pbcc not supported always 0 
+				 * bit10:ShortSlotTime bit13:DSSS-OFDM DSSS-OFDM not supported always 0 */
+	uint16_t beacon_lost_count;
+	uint16_t auth_type;
 #define AUTH_TYPE_OPEN_SYSTEM 0
 #define AUTH_TYPE_SHARED_KEY  1
 	struct channel_list_t channel_list;
-	uint16_t	scan_type;
-} __attribute__((packed));
+	uint16_t scan_type;
+} __attribute__ ((packed));
 
 struct hostif_infrastructure_set2_request_t {
 	struct hostif_hdr header;
-	uint16_t	phy_type;
-	uint16_t	cts_mode;
+	uint16_t phy_type;
+	uint16_t cts_mode;
 	struct rate_set16_t rate_set;
 	struct ssid_t ssid;
-	uint16_t	capability;  /* bit5:preamble bit6:pbcc pbcc not supported always 0 
-				      * bit10:ShortSlotTime bit13:DSSS-OFDM DSSS-OFDM not supported always 0 */
-	uint16_t	beacon_lost_count;
-	uint16_t	auth_type;
+	uint16_t capability;	/* bit5:preamble bit6:pbcc pbcc not supported always 0 
+				 * bit10:ShortSlotTime bit13:DSSS-OFDM DSSS-OFDM not supported always 0 */
+	uint16_t beacon_lost_count;
+	uint16_t auth_type;
 #define AUTH_TYPE_OPEN_SYSTEM 0
 #define AUTH_TYPE_SHARED_KEY  1
 	struct channel_list_t channel_list;
-	uint16_t	scan_type;
-	uint8_t		bssid[ETH_ALEN];
-} __attribute__((packed));
-
+	uint16_t scan_type;
+	uint8_t bssid[ETH_ALEN];
+} __attribute__ ((packed));
 
 struct hostif_infrastructure_set_confirm_t {
 	struct hostif_hdr header;
-	uint16_t	result_code;
-} __attribute__((packed));
+	uint16_t result_code;
+} __attribute__ ((packed));
 
 struct hostif_adhoc_set_request_t {
 	struct hostif_hdr header;
-	uint16_t	phy_type;
-	uint16_t	cts_mode;
-	uint16_t	channel;
+	uint16_t phy_type;
+	uint16_t cts_mode;
+	uint16_t channel;
 	struct rate_set16_t rate_set;
 	struct ssid_t ssid;
-	uint16_t	capability; /* bit5:preamble bit6:pbcc pbcc not supported always 0 
-				     * bit10:ShortSlotTime bit13:DSSS-OFDM DSSS-OFDM not supported always 0 */
-	uint16_t	scan_type;
-} __attribute__((packed));
+	uint16_t capability;	/* bit5:preamble bit6:pbcc pbcc not supported always 0 
+				 * bit10:ShortSlotTime bit13:DSSS-OFDM DSSS-OFDM not supported always 0 */
+	uint16_t scan_type;
+} __attribute__ ((packed));
 
 struct hostif_adhoc_set2_request_t {
 	struct hostif_hdr header;
-	uint16_t	phy_type;
-	uint16_t	cts_mode;
-	uint16_t	reserved;
+	uint16_t phy_type;
+	uint16_t cts_mode;
+	uint16_t reserved;
 	struct rate_set16_t rate_set;
 	struct ssid_t ssid;
-	uint16_t	capability; /* bit5:preamble bit6:pbcc pbcc not supported always 0 
-				     * bit10:ShortSlotTime bit13:DSSS-OFDM DSSS-OFDM not supported always 0 */
-	uint16_t	scan_type;
+	uint16_t capability;	/* bit5:preamble bit6:pbcc pbcc not supported always 0 
+				 * bit10:ShortSlotTime bit13:DSSS-OFDM DSSS-OFDM not supported always 0 */
+	uint16_t scan_type;
 	struct channel_list_t channel_list;
-	uint8_t		bssid[ETH_ALEN];
-} __attribute__((packed));
+	uint8_t bssid[ETH_ALEN];
+} __attribute__ ((packed));
 
 struct hostif_adhoc_set_confirm_t {
 	struct hostif_hdr header;
-	uint16_t	result_code;
-} __attribute__((packed));
-
+	uint16_t result_code;
+} __attribute__ ((packed));
 
 struct last_associate_t {
-	uint8_t	type;
-	uint8_t	status;
-} __attribute__((packed));
+	uint8_t type;
+	uint8_t status;
+} __attribute__ ((packed));
 
 struct association_request_t {
-	uint8_t		type;
+	uint8_t type;
 #define FRAME_TYPE_ASSOC_REQ	0x00
 #define FRAME_TYPE_REASSOC_REQ	0x20
-	uint8_t		pad;
-	uint16_t	capability;
-	uint16_t	listen_interval;
-	uint8_t		ap_address[6];
-	uint16_t	reqIEs_size;
-} __attribute__((packed));
+	uint8_t pad;
+	uint16_t capability;
+	uint16_t listen_interval;
+	uint8_t ap_address[6];
+	uint16_t reqIEs_size;
+} __attribute__ ((packed));
 
 struct association_response_t {
-	uint8_t		type;
+	uint8_t type;
 #define FRAME_TYPE_ASSOC_RESP	0x10
 #define FRAME_TYPE_REASSOC_RESP	0x30
-	uint8_t		pad;
-	uint16_t	capability;
-	uint16_t	status;
-	uint16_t	association_id;
-	uint16_t	respIEs_size;
-} __attribute__((packed));
+	uint8_t pad;
+	uint16_t capability;
+	uint16_t status;
+	uint16_t association_id;
+	uint16_t respIEs_size;
+} __attribute__ ((packed));
 
 struct hostif_associate_indication_t {
 	struct hostif_hdr header;
@@ -476,68 +472,68 @@ struct hostif_associate_indication_t {
 	struct association_response_t assoc_resp;
 	/* followed by (reqIEs_size + respIEs_size) octets of data */
 	/* reqIEs data *//* respIEs data */
-} __attribute__((packed));
+} __attribute__ ((packed));
 
 struct hostif_bss_scan_request_t {
 	struct hostif_hdr header;
-	uint8_t	scan_type;
+	uint8_t scan_type;
 #define ACTIVE_SCAN  0
 #define PASSIVE_SCAN 1
-	uint8_t	pad[3];
+	uint8_t pad[3];
 	uint32_t ch_time_min;
 	uint32_t ch_time_max;
 	struct channel_list_t channel_list;
 	struct ssid_t ssid;
-} __attribute__((packed));
+} __attribute__ ((packed));
 
 struct hostif_bss_scan_confirm_t {
 	struct hostif_hdr header;
-	uint16_t	result_code;
-	uint16_t	reserved;
-} __attribute__((packed));
+	uint16_t result_code;
+	uint16_t reserved;
+} __attribute__ ((packed));
 
 struct hostif_phy_information_request_t {
 	struct hostif_hdr header;
-	uint16_t	type;
+	uint16_t type;
 #define NORMAL_TYPE	0
 #define TIME_TYPE	1
-	uint16_t	time; /* unit 100ms */
-} __attribute__((packed));
+	uint16_t time;	/* unit 100ms */
+} __attribute__ ((packed));
 
 struct hostif_phy_information_confirm_t {
 	struct hostif_hdr header;
-	uint8_t	rssi;
-	uint8_t	sq;
-	uint8_t	noise;
-	uint8_t	link_speed;
-	uint32_t	tx_frame;
-	uint32_t	rx_frame;
-	uint32_t	tx_error;
-	uint32_t	rx_error;
-} __attribute__((packed));
+	uint8_t rssi;
+	uint8_t sq;
+	uint8_t noise;
+	uint8_t link_speed;
+	uint32_t tx_frame;
+	uint32_t rx_frame;
+	uint32_t tx_error;
+	uint32_t rx_error;
+} __attribute__ ((packed));
 
 /* sleep mode */
 #define SLP_ACTIVE  0
 #define SLP_SLEEP   1
 struct hostif_sleep_request_t {
 	struct hostif_hdr header;
-} __attribute__((packed));
+} __attribute__ ((packed));
 
 struct hostif_sleep_confirm_t {
 	struct hostif_hdr header;
-	uint16_t	result_code;
-} __attribute__((packed));
+	uint16_t result_code;
+} __attribute__ ((packed));
 
 struct hostif_mic_failure_request_t {
 	struct hostif_hdr header;
-	uint16_t	failure_count;
-	uint16_t	timer;
-} __attribute__((packed));
+	uint16_t failure_count;
+	uint16_t timer;
+} __attribute__ ((packed));
 
 struct hostif_mic_failure_confirm_t {
 	struct hostif_hdr header;
-	uint16_t	result_code;
-} __attribute__((packed));
+	uint16_t result_code;
+} __attribute__ ((packed));
 
 #define BASIC_RATE	0x80
 #define RATE_MASK	0x7F
@@ -557,13 +553,13 @@ struct hostif_mic_failure_confirm_t {
 #define TX_RATE_FIXED		5
 
 /* 11b rate */
-#define TX_RATE_1M	(uint8_t)(10/5)		/* 11b 11g basic rate */
-#define TX_RATE_2M	(uint8_t)(20/5)		/* 11b 11g basic rate */
-#define TX_RATE_5M	(uint8_t)(55/5)		/* 11g basic rate */
+#define TX_RATE_1M	(uint8_t)(10/5)	/* 11b 11g basic rate */
+#define TX_RATE_2M	(uint8_t)(20/5)	/* 11b 11g basic rate */
+#define TX_RATE_5M	(uint8_t)(55/5)	/* 11g basic rate */
 #define TX_RATE_11M	(uint8_t)(110/5)	/* 11g basic rate */
 
 /* 11g rate */
-#define TX_RATE_6M	(uint8_t)(60/5)		/* 11g basic rate */
+#define TX_RATE_6M	(uint8_t)(60/5)	/* 11g basic rate */
 #define TX_RATE_12M	(uint8_t)(120/5)	/* 11g basic rate */
 #define TX_RATE_24M	(uint8_t)(240/5)	/* 11g basic rate */
 #define TX_RATE_9M	(uint8_t)(90/5)
@@ -587,13 +583,13 @@ struct hostif_mic_failure_confirm_t {
                              ((A&RATE_MASK)==TX_RATE_54M))
 
 enum {
-	CONNECT_STATUS=0,
+	CONNECT_STATUS = 0,
 	DISCONNECT_STATUS
 };
 
 /* preamble type */
 enum {
-	LONG_PREAMBLE=0,
+	LONG_PREAMBLE = 0,
 	SHORT_PREAMBLE
 };
 
@@ -623,26 +619,29 @@ enum {
 #include "ks_wlan.h"
 
 /* function prototype */
-extern int hostif_data_request( struct ks_wlan_private *priv, struct sk_buff *packet );
-extern void hostif_receive( struct ks_wlan_private *priv, unsigned char *p, unsigned int size );
+extern int hostif_data_request(struct ks_wlan_private *priv,
+			       struct sk_buff *packet);
+extern void hostif_receive(struct ks_wlan_private *priv, unsigned char *p,
+			   unsigned int size);
 extern void hostif_sme_enqueue(struct ks_wlan_private *priv, uint16_t event);
-extern int hostif_init( struct ks_wlan_private *priv );
-extern void hostif_exit( struct ks_wlan_private *priv );
+extern int hostif_init(struct ks_wlan_private *priv);
+extern void hostif_exit(struct ks_wlan_private *priv);
 
 static
 inline int hif_align_size(int size)
 {
 #ifdef	KS_ATOM
-	if( size < 1024 )
+	if (size < 1024)
 		size = 1024;
 #endif
 #ifdef	DEVICE_ALIGNMENT
-	return (size%DEVICE_ALIGNMENT) ?  size + DEVICE_ALIGNMENT - (size % DEVICE_ALIGNMENT) : size;
+	return (size % DEVICE_ALIGNMENT) ? size + DEVICE_ALIGNMENT -
+	    (size % DEVICE_ALIGNMENT) : size;
 #else
 	return size;
 #endif
 }
 
-#endif  /* __KERNEL__ */
+#endif /* __KERNEL__ */
 
 #endif /* _KS_HOSTIF_H_ */
-- 
2.8.1

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

* [PATCH 20/27] staging: ks7010: indent ks_wlan.h
  2016-05-10 13:52 [PATCH 00/27] staging: add driver for KS7010 based SDIO cards Wolfram Sang
                   ` (16 preceding siblings ...)
  2016-05-10 13:52 ` [PATCH 19/27] staging: ks7010: indent ks_hostif.h Wolfram Sang
@ 2016-05-10 13:52 ` Wolfram Sang
  2016-05-10 13:52 ` [PATCH 21/27] staging: ks7010: indent ks_wlan_ioctl.h Wolfram Sang
                   ` (9 subsequent siblings)
  27 siblings, 0 replies; 32+ messages in thread
From: Wolfram Sang @ 2016-05-10 13:52 UTC (permalink / raw)
  To: driverdev-devel; +Cc: Wolfram Sang, linux-renesas-soc

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/staging/ks7010/ks_wlan.h | 246 +++++++++++++++++++--------------------
 1 file changed, 121 insertions(+), 125 deletions(-)

diff --git a/drivers/staging/ks7010/ks_wlan.h b/drivers/staging/ks7010/ks_wlan.h
index 58e3a5a6b44472..f0f9f8ef7d6185 100644
--- a/drivers/staging/ks7010/ks_wlan.h
+++ b/drivers/staging/ks7010/ks_wlan.h
@@ -22,16 +22,16 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 
-#include <linux/spinlock.h>	/* spinlock_t					*/
-#include <linux/sched.h>	/* wait_queue_head_t				*/
-#include <linux/types.h>	/* pid_t					*/
-#include <linux/netdevice.h>	/* struct net_device_stats,  struct sk_buff	*/
+#include <linux/spinlock.h>	/* spinlock_t                                   */
+#include <linux/sched.h>	/* wait_queue_head_t                            */
+#include <linux/types.h>	/* pid_t                                        */
+#include <linux/netdevice.h>	/* struct net_device_stats,  struct sk_buff     */
 #include <linux/etherdevice.h>
 #include <linux/wireless.h>
-#include <asm/atomic.h> 	/* struct atmic_t				*/
+#include <asm/atomic.h>	/* struct atmic_t                               */
 #include <linux/timer.h>	/* struct timer_list */
 #include <linux/string.h>
-#include <linux/completion.h>   /* struct completion */
+#include <linux/completion.h>	/* struct completion */
 #include <linux/workqueue.h>
 
 #include <asm/io.h>
@@ -46,37 +46,37 @@
 #endif
 
 struct ks_wlan_parameter {
-	uint8_t		operation_mode;	   /* Operation Mode */
-	uint8_t		channel;	   /*  Channel */
-	uint8_t		tx_rate;	   /*  Transmit Rate */
+	uint8_t operation_mode;	/* Operation Mode */
+	uint8_t channel;	/*  Channel */
+	uint8_t tx_rate;	/*  Transmit Rate */
 	struct {
 		uint8_t size;
 		uint8_t body[16];
 	} rate_set;
-	uint8_t		bssid[ETH_ALEN];	/* BSSID */
+	uint8_t bssid[ETH_ALEN];	/* BSSID */
 	struct {
 		uint8_t size;
-		uint8_t body[32+1];
-	} ssid;				   /*  SSID */
-	uint8_t		preamble;	   /*  Preamble */
-	uint8_t		powermgt;	   /*  PowerManagementMode */
-	uint32_t	scan_type;         /*  AP List Scan Type */
+		uint8_t body[32 + 1];
+	} ssid;	/*  SSID */
+	uint8_t preamble;	/*  Preamble */
+	uint8_t powermgt;	/*  PowerManagementMode */
+	uint32_t scan_type;	/*  AP List Scan Type */
 #define BEACON_LOST_COUNT_MIN 0
 #define BEACON_LOST_COUNT_MAX 65535
-	uint32_t	beacon_lost_count; /*  Beacon Lost Count */
-	uint32_t	rts;		   /*  RTS Threashold */
-	uint32_t	fragment;	   /*  Fragmentation Threashold */
-	uint32_t	privacy_invoked;
-	uint32_t	wep_index;
+	uint32_t beacon_lost_count;	/*  Beacon Lost Count */
+	uint32_t rts;	/*  RTS Threashold */
+	uint32_t fragment;	/*  Fragmentation Threashold */
+	uint32_t privacy_invoked;
+	uint32_t wep_index;
 	struct {
 		uint8_t size;
-		uint8_t val[13*2+1];
+		uint8_t val[13 * 2 + 1];
 	} wep_key[4];
-	uint16_t	authenticate_type;	
-	uint16_t	phy_type; /* 11b/11g/11bg mode type*/
-	uint16_t	cts_mode; /* for 11g/11bg mode cts mode */
-	uint16_t	phy_info_timer; /* phy information timer */
-	char		rom_file[256];
+	uint16_t authenticate_type;
+	uint16_t phy_type;	/* 11b/11g/11bg mode type */
+	uint16_t cts_mode;	/* for 11g/11bg mode cts mode */
+	uint16_t phy_info_timer;	/* phy information timer */
+	char rom_file[256];
 };
 
 enum {
@@ -157,7 +157,6 @@ enum {
 	SME_START_REQUEST,
 	SME_GET_EEPROM_CKSUM,
 
-
 	SME_MIC_FAILURE_CONFIRM,
 	SME_START_CONFIRM,
 
@@ -187,7 +186,7 @@ enum {
 	SME_WEP_SET_CONFIRM,
 	SME_TERMINATE,
 
-	SME_EVENT_SIZE        /* end */
+	SME_EVENT_SIZE	/* end */
 };
 
 /* SME Status */
@@ -200,58 +199,58 @@ enum {
 
 #define	SME_EVENT_BUFF_SIZE	128
 
-struct	sme_info{
-	int	sme_status;
-	int	event_buff[SME_EVENT_BUFF_SIZE];
-	unsigned int	qhead;
-	unsigned int	qtail;
+struct sme_info {
+	int sme_status;
+	int event_buff[SME_EVENT_BUFF_SIZE];
+	unsigned int qhead;
+	unsigned int qtail;
 #ifdef KS_WLAN_DEBUG
-  /* for debug */
+	/* for debug */
 	unsigned int max_event_count;
 #endif
-	spinlock_t    sme_spin;
+	spinlock_t sme_spin;
 	unsigned long sme_flag;
 };
 
-struct	hostt_t{
-	int	buff[SME_EVENT_BUFF_SIZE];
-	unsigned int	qhead;
-	unsigned int	qtail;
+struct hostt_t {
+	int buff[SME_EVENT_BUFF_SIZE];
+	unsigned int qhead;
+	unsigned int qtail;
 };
 
 #define RSN_IE_BODY_MAX 64
 struct rsn_ie_t {
-	uint8_t	id; /* 0xdd = WPA or 0x30 = RSN */
-	uint8_t	size; /* max ? 255 ? */
-	uint8_t	body[RSN_IE_BODY_MAX];
-} __attribute__((packed));
+	uint8_t id;	/* 0xdd = WPA or 0x30 = RSN */
+	uint8_t size;	/* max ? 255 ? */
+	uint8_t body[RSN_IE_BODY_MAX];
+} __attribute__ ((packed));
 
 #ifdef WPS
 #define WPS_IE_BODY_MAX 255
 struct wps_ie_t {
-	uint8_t id; /* 221 'dd <len> 00 50 F2 04' */
-	uint8_t size; /* max ? 255 ? */
+	uint8_t id;	/* 221 'dd <len> 00 50 F2 04' */
+	uint8_t size;	/* max ? 255 ? */
 	uint8_t body[WPS_IE_BODY_MAX];
-} __attribute__((packed));
+} __attribute__ ((packed));
 #endif /* WPS */
 
 struct local_ap_t {
-	uint8_t	bssid[6];
-	uint8_t	rssi;
-	uint8_t	sq;
+	uint8_t bssid[6];
+	uint8_t rssi;
+	uint8_t sq;
 	struct {
-		uint8_t	size;
-		uint8_t	body[32];
-		uint8_t	ssid_pad;
+		uint8_t size;
+		uint8_t body[32];
+		uint8_t ssid_pad;
 	} ssid;
 	struct {
-		uint8_t	size;
-		uint8_t	body[16];
-		uint8_t	rate_pad;
+		uint8_t size;
+		uint8_t body[16];
+		uint8_t rate_pad;
 	} rate_set;
-	uint16_t	capability;
-	uint8_t	channel;
-	uint8_t	noise;
+	uint16_t capability;
+	uint8_t channel;
+	uint8_t noise;
 	struct rsn_ie_t wpa_ie;
 	struct rsn_ie_t rsn_ie;
 #ifdef WPS
@@ -263,19 +262,19 @@ struct local_ap_t {
 #define LOCAL_CURRENT_AP LOCAL_APLIST_MAX
 struct local_aplist_t {
 	int size;
-	struct local_ap_t ap[LOCAL_APLIST_MAX+1];
+	struct local_ap_t ap[LOCAL_APLIST_MAX + 1];
 };
 
-struct local_gain_t{
-	uint8_t	TxMode;
-	uint8_t	RxMode;
-	uint8_t	TxGain;
-	uint8_t	RxGain;
+struct local_gain_t {
+	uint8_t TxMode;
+	uint8_t RxMode;
+	uint8_t TxGain;
+	uint8_t RxGain;
 };
 
-struct local_eeprom_sum_t{
-	uint8_t	type;
-	uint8_t	result;
+struct local_eeprom_sum_t {
+	uint8_t type;
+	uint8_t result;
 };
 
 enum {
@@ -285,7 +284,6 @@ enum {
 	EEPROM_NG,
 };
 
-
 /* Power Save Status */
 enum {
 	PS_NONE,
@@ -297,22 +295,22 @@ enum {
 };
 
 struct power_save_status_t {
-        atomic_t	  status;      	/* initialvalue 0 */
+	atomic_t status;	/* initialvalue 0 */
 	struct completion wakeup_wait;
-	atomic_t	  confirm_wait;
-	atomic_t	  snooze_guard;
+	atomic_t confirm_wait;
+	atomic_t snooze_guard;
 };
 
 struct sleep_status_t {
-        atomic_t	  status;      	/* initialvalue 0 */
-	atomic_t	  doze_request;
-	atomic_t	  wakeup_request;
+	atomic_t status;	/* initialvalue 0 */
+	atomic_t doze_request;
+	atomic_t wakeup_request;
 };
 
 /* WPA */
 struct scan_ext_t {
 	unsigned int flag;
-	char ssid[IW_ESSID_MAX_SIZE+1];
+	char ssid[IW_ESSID_MAX_SIZE + 1];
 };
 
 enum {
@@ -337,7 +335,7 @@ enum {
 
 #define CIPHER_ID_LEN    4
 
-enum { 
+enum {
 	KEY_MGMT_802_1X,
 	KEY_MGMT_PSK,
 	KEY_MGMT_WPANONE,
@@ -358,26 +356,26 @@ enum {
 #define MIC_KEY_SIZE 8
 
 struct wpa_key_t {
-	uint32_t	ext_flags; /* IW_ENCODE_EXT_xxx */
-	uint8_t	tx_seq[IW_ENCODE_SEQ_MAX_SIZE]; /* LSB first */
-	uint8_t	rx_seq[IW_ENCODE_SEQ_MAX_SIZE]; /* LSB first */
-	struct sockaddr	addr; /* ff:ff:ff:ff:ff:ff for broadcast/multicast
-			       * (group) keys or unicast address for
-			       * individual keys */
-	uint16_t	alg;
-	uint16_t	key_len; /* WEP: 5 or 13, TKIP: 32, CCMP: 16 */
-	uint8_t	key_val[IW_ENCODING_TOKEN_MAX];
-	uint8_t	tx_mic_key[MIC_KEY_SIZE];
-	uint8_t	rx_mic_key[MIC_KEY_SIZE];
+	uint32_t ext_flags;	/* IW_ENCODE_EXT_xxx */
+	uint8_t tx_seq[IW_ENCODE_SEQ_MAX_SIZE];	/* LSB first */
+	uint8_t rx_seq[IW_ENCODE_SEQ_MAX_SIZE];	/* LSB first */
+	struct sockaddr addr;	/* ff:ff:ff:ff:ff:ff for broadcast/multicast
+				 * (group) keys or unicast address for
+				 * individual keys */
+	uint16_t alg;
+	uint16_t key_len;	/* WEP: 5 or 13, TKIP: 32, CCMP: 16 */
+	uint8_t key_val[IW_ENCODING_TOKEN_MAX];
+	uint8_t tx_mic_key[MIC_KEY_SIZE];
+	uint8_t rx_mic_key[MIC_KEY_SIZE];
 };
 #define WPA_KEY_INDEX_MAX 4
 #define WPA_RX_SEQ_LEN 6
 
 struct mic_failure_t {
-	uint16_t	failure; /* MIC Failure counter 0 or 1 or 2 */
-	uint16_t	counter; /* 1sec counter 0-60 */
-	uint32_t	last_failure_time;
-	int stop; /* stop flag */
+	uint16_t failure;	/* MIC Failure counter 0 or 1 or 2 */
+	uint16_t counter;	/* 1sec counter 0-60 */
+	uint32_t last_failure_time;
+	int stop;	/* stop flag */
 };
 
 struct wpa_status_t {
@@ -401,36 +399,36 @@ struct pmk_list_t {
 	struct list_head head;
 	struct pmk_t {
 		struct list_head list;
-		uint8_t	bssid[ETH_ALEN];
-		uint8_t	pmkid[IW_PMKID_LEN];
+		uint8_t bssid[ETH_ALEN];
+		uint8_t pmkid[IW_PMKID_LEN];
 	} pmk[PMK_LIST_MAX];
 };
 
 #ifdef WPS
 struct wps_status_t {
-       int wps_enabled;
-       int ielen;
-       uint8_t ie[255];
+	int wps_enabled;
+	int ielen;
+	uint8_t ie[255];
 };
 #endif /* WPS */
 
 struct ks_wlan_private {
 
-	struct hw_info_t ks_wlan_hw;  /* hardware information */
+	struct hw_info_t ks_wlan_hw;	/* hardware information */
 
 	struct net_device *net_dev;
-	int reg_net; /* register_netdev */
+	int reg_net;	/* register_netdev */
 	struct net_device_stats nstats;
 	struct iw_statistics wstats;
 
 	struct completion confirm_wait;
 
-        /* trx device & sme */
+	/* trx device & sme */
 	struct tx_device tx_dev;
 	struct rx_device rx_dev;
-	struct sme_info  sme_i;
+	struct sme_info sme_i;
 	u8 *rxp;
-	unsigned int  rx_size;
+	unsigned int rx_size;
 	struct tasklet_struct sme_task;
 	struct work_struct ks_wlan_wakeup_task;
 	int scan_ind_count;
@@ -443,33 +441,33 @@ struct ks_wlan_private {
 	struct sleep_status_t sleepstatus;
 	struct wpa_status_t wpa;
 	struct pmk_list_t pmklist;
-        /* wireless parameter */
+	/* wireless parameter */
 	struct ks_wlan_parameter reg;
 	uint8_t current_rate;
 
-	char nick[IW_ESSID_MAX_SIZE+1];
-	
-        spinlock_t multicast_spin;
+	char nick[IW_ESSID_MAX_SIZE + 1];
+
+	spinlock_t multicast_spin;
 
 	spinlock_t dev_read_lock;
-        wait_queue_head_t devread_wait;
+	wait_queue_head_t devread_wait;
 
-	unsigned int need_commit; /* for ioctl */
+	unsigned int need_commit;	/* for ioctl */
 
-        /* DeviceIoControl */
+	/* DeviceIoControl */
 	int device_open_status;
 	atomic_t event_count;
-        atomic_t rec_count;
-        int dev_count; 
+	atomic_t rec_count;
+	int dev_count;
 #define DEVICE_STOCK_COUNT 20
 	unsigned char *dev_data[DEVICE_STOCK_COUNT];
 	int dev_size[DEVICE_STOCK_COUNT];
 
-        /* ioctl : IOCTL_FIRMWARE_VERSION */
-	unsigned char firmware_version[128+1];
+	/* ioctl : IOCTL_FIRMWARE_VERSION */
+	unsigned char firmware_version[128 + 1];
 	int version_size;
 
-	int mac_address_valid; /* Mac Address Status */
+	int mac_address_valid;	/* Mac Address Status */
 
 	int dev_state;
 
@@ -478,35 +476,33 @@ struct ks_wlan_private {
 	/* spinlock_t lock; */
 #define FORCE_DISCONNECT    0x80000000
 #define CONNECT_STATUS_MASK 0x7FFFFFFF
-	uint32_t connect_status;    /* connect status */
-	int infra_status;  /* Infractructure status */
+	uint32_t connect_status;	/* connect status */
+	int infra_status;	/* Infractructure status */
 
-        uint8_t data_buff[0x1000];
+	uint8_t data_buff[0x1000];
 
 	uint8_t scan_ssid_len;
-	uint8_t scan_ssid[IW_ESSID_MAX_SIZE+1];
+	uint8_t scan_ssid[IW_ESSID_MAX_SIZE + 1];
 	struct local_gain_t gain;
 #ifdef WPS
 	struct net_device *l2_dev;
-	int l2_fd;      
+	int l2_fd;
 	struct wps_status_t wps;
 #endif /* WPS */
- 	uint8_t sleep_mode;
+	uint8_t sleep_mode;
 
 	uint8_t region;
 	struct local_eeprom_sum_t eeprom_sum;
 	uint8_t eeprom_checksum;
 
-	struct hostt_t  hostt;
+	struct hostt_t hostt;
 
 	unsigned long last_doze;
 	unsigned long last_wakeup;
 
-	uint   sdio_error_count;  /* SDIO error */
-	uint   wakeup_count;      /* for detect wakeup loop */
-	
-};
-
+	uint sdio_error_count;	/* SDIO error */
+	uint wakeup_count;	/* for detect wakeup loop */
 
+};
 
 #endif /* _KS_WLAN_H */
-- 
2.8.1

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

* [PATCH 21/27] staging: ks7010: indent ks_wlan_ioctl.h
  2016-05-10 13:52 [PATCH 00/27] staging: add driver for KS7010 based SDIO cards Wolfram Sang
                   ` (17 preceding siblings ...)
  2016-05-10 13:52 ` [PATCH 20/27] staging: ks7010: indent ks_wlan.h Wolfram Sang
@ 2016-05-10 13:52 ` Wolfram Sang
  2016-05-10 13:52 ` [PATCH 23/27] staging: ks7010: indent michael_mic.c Wolfram Sang
                   ` (8 subsequent siblings)
  27 siblings, 0 replies; 32+ messages in thread
From: Wolfram Sang @ 2016-05-10 13:52 UTC (permalink / raw)
  To: driverdev-devel; +Cc: Wolfram Sang, linux-renesas-soc

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/staging/ks7010/ks_wlan_ioctl.h | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/ks7010/ks_wlan_ioctl.h b/drivers/staging/ks7010/ks_wlan_ioctl.h
index e7469f7338f7af..cc4669eddcc1f7 100644
--- a/drivers/staging/ks7010/ks_wlan_ioctl.h
+++ b/drivers/staging/ks7010/ks_wlan_ioctl.h
@@ -36,8 +36,8 @@
 #define KS_WLAN_GET_SCAN_TYPE		SIOCIWFIRSTPRIV+13
 #define KS_WLAN_SET_RX_GAIN		SIOCIWFIRSTPRIV+14
 #define KS_WLAN_GET_RX_GAIN		SIOCIWFIRSTPRIV+15
-#define KS_WLAN_HOSTT			SIOCIWFIRSTPRIV+16  /* unused */
-//#define KS_WLAN_SET_REGION		SIOCIWFIRSTPRIV+17
+#define KS_WLAN_HOSTT			SIOCIWFIRSTPRIV+16	/* unused */
+//#define KS_WLAN_SET_REGION            SIOCIWFIRSTPRIV+17
 #define KS_WLAN_SET_BEACON_LOST		SIOCIWFIRSTPRIV+18
 #define KS_WLAN_GET_BEACON_LOST		SIOCIWFIRSTPRIV+19
 
@@ -51,8 +51,8 @@
 #define KS_WLAN_GET_CTS_MODE		SIOCIWFIRSTPRIV+25
 /*					SIOCIWFIRSTPRIV+26 */
 /*					SIOCIWFIRSTPRIV+27 */
-#define KS_WLAN_SET_SLEEP_MODE		SIOCIWFIRSTPRIV+28 /* sleep mode */
-#define KS_WLAN_GET_SLEEP_MODE		SIOCIWFIRSTPRIV+29 /* sleep mode */
+#define KS_WLAN_SET_SLEEP_MODE		SIOCIWFIRSTPRIV+28	/* sleep mode */
+#define KS_WLAN_GET_SLEEP_MODE		SIOCIWFIRSTPRIV+29	/* sleep mode */
 /*					SIOCIWFIRSTPRIV+30 */
 /*					SIOCIWFIRSTPRIV+31 */
 
@@ -62,7 +62,8 @@
 #include <linux/netdevice.h>
 
 extern int ks_wlan_read_config_file(struct ks_wlan_private *priv);
-extern int ks_wlan_setup_parameter(struct ks_wlan_private *priv, unsigned int commit_flag);
+extern int ks_wlan_setup_parameter(struct ks_wlan_private *priv,
+				   unsigned int commit_flag);
 
 #endif /* __KERNEL__ */
 
-- 
2.8.1

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

* [PATCH 23/27] staging: ks7010: indent michael_mic.c
  2016-05-10 13:52 [PATCH 00/27] staging: add driver for KS7010 based SDIO cards Wolfram Sang
                   ` (18 preceding siblings ...)
  2016-05-10 13:52 ` [PATCH 21/27] staging: ks7010: indent ks_wlan_ioctl.h Wolfram Sang
@ 2016-05-10 13:52 ` Wolfram Sang
  2016-05-10 13:52 ` [PATCH 24/27] staging: ks7010: indent michael_mic.h Wolfram Sang
                   ` (7 subsequent siblings)
  27 siblings, 0 replies; 32+ messages in thread
From: Wolfram Sang @ 2016-05-10 13:52 UTC (permalink / raw)
  To: driverdev-devel; +Cc: Wolfram Sang, linux-renesas-soc

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/staging/ks7010/michael_mic.c | 43 ++++++++++++++++++------------------
 1 file changed, 21 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/ks7010/michael_mic.c b/drivers/staging/ks7010/michael_mic.c
index ec8769a974427a..adb17df46f939b 100644
--- a/drivers/staging/ks7010/michael_mic.c
+++ b/drivers/staging/ks7010/michael_mic.c
@@ -34,11 +34,11 @@
 				A->nBytesInM = 0;
 
 static
-void MichaelInitializeFunction( struct michel_mic_t *Mic, uint8_t *key )
+void MichaelInitializeFunction(struct michel_mic_t *Mic, uint8_t * key)
 {
 	// Set the key
-	Mic->K0 = getUInt32( key , 0 );
-	Mic->K1 = getUInt32( key , 4 );
+	Mic->K0 = getUInt32(key, 0);
+	Mic->K1 = getUInt32(key, 4);
 
 	//clear();
 	MichaelClear(Mic);
@@ -56,11 +56,10 @@ do{								\
 	L += R;							\
 }while(0)
 
-
 static
-void MichaelAppend( struct michel_mic_t *Mic, uint8_t *src, int nBytes )
+void MichaelAppend(struct michel_mic_t *Mic, uint8_t * src, int nBytes)
 {
-	int addlen ;
+	int addlen;
 	if (Mic->nBytesInM) {
 		addlen = 4 - Mic->nBytesInM;
 		if (addlen > nBytes)
@@ -73,13 +72,13 @@ void MichaelAppend( struct michel_mic_t *Mic, uint8_t *src, int nBytes )
 		if (Mic->nBytesInM < 4)
 			return;
 
-		Mic->L ^= getUInt32(Mic->M,0);
+		Mic->L ^= getUInt32(Mic->M, 0);
 		MichaelBlockFunction(Mic->L, Mic->R);
 		Mic->nBytesInM = 0;
 	}
 
-	while(nBytes >= 4){
-		Mic->L ^= getUInt32(src,0);
+	while (nBytes >= 4) {
+		Mic->L ^= getUInt32(src, 0);
 		MichaelBlockFunction(Mic->L, Mic->R);
 		src += 4;
 		nBytes -= 4;
@@ -92,7 +91,7 @@ void MichaelAppend( struct michel_mic_t *Mic, uint8_t *src, int nBytes )
 }
 
 static
-void MichaelGetMIC( struct michel_mic_t *Mic, uint8_t *dst )
+void MichaelGetMIC(struct michel_mic_t *Mic, uint8_t * dst)
 {
 	uint8_t *data = Mic->M;
 	switch (Mic->nBytesInM) {
@@ -107,24 +106,24 @@ void MichaelGetMIC( struct michel_mic_t *Mic, uint8_t *dst )
 		break;
 	case 3:
 		Mic->L ^= data[0] | (data[1] << 8) | (data[2] << 16) |
-			0x5a000000;
+		    0x5a000000;
 		break;
 	}
 	MichaelBlockFunction(Mic->L, Mic->R);
 	MichaelBlockFunction(Mic->L, Mic->R);
 	// The appendByte function has already computed the result.
-	putUInt32( dst, 0, Mic->L );
-	putUInt32( dst, 4, Mic->R );
+	putUInt32(dst, 0, Mic->L);
+	putUInt32(dst, 4, Mic->R);
 
 	// Reset to the empty message.
 	MichaelClear(Mic);
 }
 
-void MichaelMICFunction( struct michel_mic_t *Mic, uint8_t *Key,
-			 uint8_t *Data, int Len, uint8_t priority,
-			 uint8_t *Result )
+void MichaelMICFunction(struct michel_mic_t *Mic, uint8_t * Key,
+			uint8_t * Data, int Len, uint8_t priority,
+			uint8_t * Result)
 {
-	uint8_t pad_data[4] = {priority,0,0,0};
+	uint8_t pad_data[4] = { priority, 0, 0, 0 };
 	// Compute the MIC value
 	/*
 	 * IEEE802.11i  page 47
@@ -135,9 +134,9 @@ void MichaelMICFunction( struct michel_mic_t *Mic, uint8_t *Key,
 	 * |DA|SA|Priority|0 |Data|M0|M1|M2|M3|M4|M5|M6|M7|
 	 * +--+--+--------+--+----+--+--+--+--+--+--+--+--+
 	 */
-	MichaelInitializeFunction( Mic, Key ) ;
-	MichaelAppend( Mic, (uint8_t*)Data, 12 ); /* |DA|SA| */
-	MichaelAppend( Mic, pad_data, 4 ); /* |Priority|0|0|0| */
-	MichaelAppend( Mic, (uint8_t*)(Data+12), Len -12 ); /* |Data| */
-	MichaelGetMIC( Mic, Result ) ;
+	MichaelInitializeFunction(Mic, Key);
+	MichaelAppend(Mic, (uint8_t *) Data, 12);	/* |DA|SA| */
+	MichaelAppend(Mic, pad_data, 4);	/* |Priority|0|0|0| */
+	MichaelAppend(Mic, (uint8_t *) (Data + 12), Len - 12);	/* |Data| */
+	MichaelGetMIC(Mic, Result);
 }
-- 
2.8.1

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

* [PATCH 24/27] staging: ks7010: indent michael_mic.h
  2016-05-10 13:52 [PATCH 00/27] staging: add driver for KS7010 based SDIO cards Wolfram Sang
                   ` (19 preceding siblings ...)
  2016-05-10 13:52 ` [PATCH 23/27] staging: ks7010: indent michael_mic.c Wolfram Sang
@ 2016-05-10 13:52 ` Wolfram Sang
  2016-05-10 13:52 ` [PATCH 25/27] staging: ks7010: indent ks7010_sdio.c Wolfram Sang
                   ` (6 subsequent siblings)
  27 siblings, 0 replies; 32+ messages in thread
From: Wolfram Sang @ 2016-05-10 13:52 UTC (permalink / raw)
  To: driverdev-devel; +Cc: Wolfram Sang, linux-renesas-soc

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/staging/ks7010/michael_mic.h | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/ks7010/michael_mic.h b/drivers/staging/ks7010/michael_mic.h
index f14f160ad46549..57ecbe34153202 100644
--- a/drivers/staging/ks7010/michael_mic.h
+++ b/drivers/staging/ks7010/michael_mic.h
@@ -16,14 +16,14 @@
 struct michel_mic_t {
 	uint32_t K0;	// Key 
 	uint32_t K1;	// Key 
-	uint32_t L;		// Current state 
-	uint32_t R;		// Current state 
-	uint8_t M[4];		// Message accumulator (single word) 
-	int		nBytesInM; 	// # bytes in M 
-	uint8_t 	Result[8];
+	uint32_t L;	// Current state 
+	uint32_t R;	// Current state 
+	uint8_t M[4];	// Message accumulator (single word) 
+	int nBytesInM;	// # bytes in M 
+	uint8_t Result[8];
 };
 
 extern
-void MichaelMICFunction( struct michel_mic_t *Mic, uint8_t *Key, 
-			 uint8_t *Data, int Len, uint8_t priority, 
-			 uint8_t *Result );
+void MichaelMICFunction(struct michel_mic_t *Mic, uint8_t * Key,
+			uint8_t * Data, int Len, uint8_t priority,
+			uint8_t * Result);
-- 
2.8.1

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

* [PATCH 25/27] staging: ks7010: indent ks7010_sdio.c
  2016-05-10 13:52 [PATCH 00/27] staging: add driver for KS7010 based SDIO cards Wolfram Sang
                   ` (20 preceding siblings ...)
  2016-05-10 13:52 ` [PATCH 24/27] staging: ks7010: indent michael_mic.h Wolfram Sang
@ 2016-05-10 13:52 ` Wolfram Sang
  2016-05-10 13:52 ` [PATCH 26/27] staging: ks7010: remove supported card table with one element Wolfram Sang
                   ` (5 subsequent siblings)
  27 siblings, 0 replies; 32+ messages in thread
From: Wolfram Sang @ 2016-05-10 13:52 UTC (permalink / raw)
  To: driverdev-devel; +Cc: Wolfram Sang, linux-renesas-soc

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

Unlike the previous patches which are plain indent outcomes, this has
some manual fixups to be not overly strict with the 80 char limit.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/staging/ks7010/ks7010_sdio.c | 807 ++++++++++++++++++++---------------
 1 file changed, 460 insertions(+), 347 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
index fb9f0b533d867e..ed4d579300ad96 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -30,31 +30,32 @@
 static int reg_net = 0;
 
 static const struct sdio_device_id if_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) },
+	{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 */ }
 };
 
 struct ks_sdio_model {
-        int model;
-        const char *firmware;
+	int model;
+	const char *firmware;
 };
 
 static struct ks_sdio_model ks_sdio_models[] = {
-        {
-                /* ks7010 */
-                .model = 0x10,
-                .firmware = "ks7010sd.rom",
-        },
+	{
+		/* ks7010 */
+		.model = 0x10,
+		.firmware = "ks7010sd.rom",
+	},
 };
 
-static int ks7910_sdio_probe(struct sdio_func *function, const struct sdio_device_id *device);
+static int ks7910_sdio_probe(struct sdio_func *function,
+			     const struct sdio_device_id *device);
 static void ks7910_sdio_remove(struct sdio_func *function);
 static void ks7010_rw_function(struct work_struct *work);
-static int ks7010_sdio_read( struct ks_wlan_private *priv, unsigned int address,
-			     unsigned char *buffer, int length );
-static int ks7010_sdio_write( struct ks_wlan_private *priv, unsigned int address,
-			      unsigned char *buffer, int length );
+static int ks7010_sdio_read(struct ks_wlan_private *priv, unsigned int address,
+			    unsigned char *buffer, int length);
+static int ks7010_sdio_write(struct ks_wlan_private *priv, unsigned int address,
+			     unsigned char *buffer, int length);
 /* macro */
 
 #define inc_txqhead(priv) \
@@ -79,25 +80,25 @@ void ks_wlan_hw_sleep_doze_request(struct ks_wlan_private *priv)
 	DPRINTK(4, "\n");
 
 	/* clear request */
-	atomic_set(&priv->sleepstatus.doze_request,0);
+	atomic_set(&priv->sleepstatus.doze_request, 0);
 
-	if( atomic_read(&priv->sleepstatus.status) == 0){
+	if (atomic_read(&priv->sleepstatus.status) == 0) {
 		rw_data = GCR_B_DOZE;
-		retval = ks7010_sdio_write(priv, GCR_B, &rw_data, sizeof(rw_data));
-		if(retval){
+		retval =
+		    ks7010_sdio_write(priv, GCR_B, &rw_data, sizeof(rw_data));
+		if (retval) {
 			DPRINTK(1, " error : GCR_B=%02X\n", rw_data);
 			goto out;
 		}
 		DPRINTK(4, "PMG SET!! : GCR_B=%02X\n", rw_data);
-		DPRINTK(3,"sleep_mode=SLP_SLEEP\n");
+		DPRINTK(3, "sleep_mode=SLP_SLEEP\n");
 		atomic_set(&priv->sleepstatus.status, 1);
- 		priv->last_doze = jiffies;
-	}
-	else{
-		DPRINTK(1,"sleep_mode=%d\n",priv->sleep_mode);
+		priv->last_doze = jiffies;
+	} else {
+		DPRINTK(1, "sleep_mode=%d\n", priv->sleep_mode);
 	}
 
-out:
+ out:
 	priv->sleep_mode = atomic_read(&priv->sleepstatus.status);
 	return;
 }
@@ -110,110 +111,126 @@ void ks_wlan_hw_sleep_wakeup_request(struct ks_wlan_private *priv)
 	DPRINTK(4, "\n");
 
 	/* clear request */
-	atomic_set(&priv->sleepstatus.wakeup_request,0);
+	atomic_set(&priv->sleepstatus.wakeup_request, 0);
 
-	if( atomic_read(&priv->sleepstatus.status) == 1){
+	if (atomic_read(&priv->sleepstatus.status) == 1) {
 		rw_data = WAKEUP_REQ;
-		retval = ks7010_sdio_write(priv, WAKEUP, &rw_data, sizeof(rw_data));
-		if(retval){
+		retval =
+		    ks7010_sdio_write(priv, WAKEUP, &rw_data, sizeof(rw_data));
+		if (retval) {
 			DPRINTK(1, " error : WAKEUP=%02X\n", rw_data);
 			goto out;
 		}
 		DPRINTK(4, "wake up : WAKEUP=%02X\n", rw_data);
 		atomic_set(&priv->sleepstatus.status, 0);
- 		priv->last_wakeup = jiffies;
+		priv->last_wakeup = jiffies;
 		++priv->wakeup_count;
-	}
-	else{
-		DPRINTK(1,"sleep_mode=%d\n",priv->sleep_mode);
+	} else {
+		DPRINTK(1, "sleep_mode=%d\n", priv->sleep_mode);
 	}
 
-out:
+ out:
 	priv->sleep_mode = atomic_read(&priv->sleepstatus.status);
 	return;
 }
 
-
 void ks_wlan_hw_wakeup_request(struct ks_wlan_private *priv)
 {
 	unsigned char rw_data;
 	int retval;
 
 	DPRINTK(4, "\n");
-	if(atomic_read(&priv->psstatus.status)==PS_SNOOZE){
+	if (atomic_read(&priv->psstatus.status) == PS_SNOOZE) {
 		rw_data = WAKEUP_REQ;
-		retval = ks7010_sdio_write(priv, WAKEUP, &rw_data, sizeof(rw_data));
-		if(retval){
+		retval =
+		    ks7010_sdio_write(priv, WAKEUP, &rw_data, sizeof(rw_data));
+		if (retval) {
 			DPRINTK(1, " error : WAKEUP=%02X\n", rw_data);
 		}
 		DPRINTK(4, "wake up : WAKEUP=%02X\n", rw_data);
- 		priv->last_wakeup = jiffies;
+		priv->last_wakeup = jiffies;
 		++priv->wakeup_count;
-	}
-	else{
-		DPRINTK(1,"psstatus=%d\n",atomic_read(&priv->psstatus.status));
+	} else {
+		DPRINTK(1, "psstatus=%d\n",
+			atomic_read(&priv->psstatus.status));
 	}
 }
 
 int _ks_wlan_hw_power_save(struct ks_wlan_private *priv)
 {
-	int rc=0;
+	int rc = 0;
 	unsigned char rw_data;
 	int retval;
 
-	if(priv->reg.powermgt == POWMGT_ACTIVE_MODE)
+	if (priv->reg.powermgt == POWMGT_ACTIVE_MODE)
 		return rc;
 
-	if(priv->reg.operation_mode == MODE_INFRASTRUCTURE &&
-	   (priv->connect_status & CONNECT_STATUS_MASK)== CONNECT_STATUS){
+	if (priv->reg.operation_mode == MODE_INFRASTRUCTURE &&
+	    (priv->connect_status & CONNECT_STATUS_MASK) == CONNECT_STATUS) {
 
 		//DPRINTK(1,"psstatus.status=%d\n",atomic_read(&priv->psstatus.status));
-	if (priv->dev_state == DEVICE_STATE_SLEEP) {
-		switch(atomic_read(&priv->psstatus.status)){
-		case PS_SNOOZE: /* 4 */
-			break;
-		default:
-			DPRINTK(5,"\n\
-				psstatus.status=%d\n\
-				psstatus.confirm_wait=%d\n\
-				psstatus.snooze_guard=%d\n\
-				cnt_txqbody=%d\n",
-				atomic_read(&priv->psstatus.status),
-				atomic_read(&priv->psstatus.confirm_wait),
-				atomic_read(&priv->psstatus.snooze_guard),
-				cnt_txqbody(priv));
-
-			if(!atomic_read(&priv->psstatus.confirm_wait)&&
-			   !atomic_read(&priv->psstatus.snooze_guard)&&
-			   !cnt_txqbody(priv)){
-				retval = ks7010_sdio_read(priv, INT_PENDING, &rw_data, sizeof(rw_data));
-				if(retval){
-					DPRINTK(1, " error : INT_PENDING=%02X\n", rw_data);
-					queue_delayed_work(priv->ks_wlan_hw.ks7010sdio_wq,&priv->ks_wlan_hw.rw_wq, 1);
-					break;
-				}
-				if(!rw_data){
-					rw_data = GCR_B_DOZE;
-					retval = ks7010_sdio_write(priv, GCR_B, &rw_data, sizeof(rw_data));
-					if(retval){
-						DPRINTK(1, " error : GCR_B=%02X\n", rw_data);
-						queue_delayed_work(priv->ks_wlan_hw.ks7010sdio_wq,&priv->ks_wlan_hw.rw_wq, 1);
+		if (priv->dev_state == DEVICE_STATE_SLEEP) {
+			switch (atomic_read(&priv->psstatus.status)) {
+			case PS_SNOOZE:	/* 4 */
+				break;
+			default:
+				DPRINTK(5, "\npsstatus.status=%d\npsstatus.confirm_wait=%d\npsstatus.snooze_guard=%d\ncnt_txqbody=%d\n",
+					atomic_read(&priv->psstatus.status),
+					atomic_read(&priv->psstatus.confirm_wait),
+					atomic_read(&priv->psstatus.snooze_guard),
+					cnt_txqbody(priv));
+
+				if (!atomic_read(&priv->psstatus.confirm_wait)
+				    && !atomic_read(&priv->psstatus.snooze_guard)
+				    && !cnt_txqbody(priv)) {
+					retval =
+					    ks7010_sdio_read(priv, INT_PENDING,
+							     &rw_data,
+							     sizeof(rw_data));
+					if (retval) {
+						DPRINTK(1,
+							" error : INT_PENDING=%02X\n",
+							rw_data);
+						queue_delayed_work(priv->ks_wlan_hw.ks7010sdio_wq,
+								   &priv->ks_wlan_hw.rw_wq, 1);
 						break;
 					}
-					DPRINTK(4, "PMG SET!! : GCR_B=%02X\n", rw_data);
-					atomic_set(&priv->psstatus.status, PS_SNOOZE);
-					DPRINTK(3,"psstatus.status=PS_SNOOZE\n");
-				}
-				else{
-					queue_delayed_work(priv->ks_wlan_hw.ks7010sdio_wq,&priv->ks_wlan_hw.rw_wq, 1);
+					if (!rw_data) {
+						rw_data = GCR_B_DOZE;
+						retval =
+						    ks7010_sdio_write(priv,
+								      GCR_B,
+								      &rw_data,
+								      sizeof(rw_data));
+						if (retval) {
+							DPRINTK(1,
+								" error : GCR_B=%02X\n",
+								rw_data);
+							queue_delayed_work
+							    (priv->ks_wlan_hw.ks7010sdio_wq,
+							     &priv->ks_wlan_hw.rw_wq, 1);
+							break;
+						}
+						DPRINTK(4,
+							"PMG SET!! : GCR_B=%02X\n",
+							rw_data);
+						atomic_set(&priv->psstatus.
+							   status, PS_SNOOZE);
+						DPRINTK(3,
+							"psstatus.status=PS_SNOOZE\n");
+					} else {
+						queue_delayed_work(priv->ks_wlan_hw.ks7010sdio_wq,
+								   &priv->ks_wlan_hw.rw_wq, 1);
+					}
+				} else {
+					queue_delayed_work(priv->ks_wlan_hw.
+							   ks7010sdio_wq,
+							   &priv->ks_wlan_hw.rw_wq,
+							   0);
 				}
+				break;
 			}
-			else{
-				queue_delayed_work(priv->ks_wlan_hw.ks7010sdio_wq,&priv->ks_wlan_hw.rw_wq, 0);
-			}
-			break;
 		}
-	}
 
 	}
 
@@ -222,7 +239,8 @@ int _ks_wlan_hw_power_save(struct ks_wlan_private *priv)
 
 int ks_wlan_hw_power_save(struct ks_wlan_private *priv)
 {
-	queue_delayed_work(priv->ks_wlan_hw.ks7010sdio_wq,&priv->ks_wlan_hw.rw_wq, 1);
+	queue_delayed_work(priv->ks_wlan_hw.ks7010sdio_wq,
+			   &priv->ks_wlan_hw.rw_wq, 1);
 	return 0;
 }
 
@@ -234,16 +252,16 @@ static int ks7010_sdio_read(struct ks_wlan_private *priv, unsigned int address,
 
 	card = priv->ks_wlan_hw.sdio_card;
 
-	if (length == 1) /* CMD52 */
+	if (length == 1)	/* CMD52 */
 		*buffer = sdio_readb(card->func, address, &rc);
-	else /* CMD53 multi-block transfer */
+	else	/* CMD53 multi-block transfer */
 		rc = sdio_memcpy_fromio(card->func, buffer, address, length);
 
-	if(rc != 0){
+	if (rc != 0) {
 		printk("sdio error erorr=%d size=%d\n", rc, length);
 		++priv->sdio_error_count;
-	}else{
-		priv->sdio_error_count=0;
+	} else {
+		priv->sdio_error_count = 0;
 	}
 
 	return rc;
@@ -257,40 +275,42 @@ static int ks7010_sdio_write(struct ks_wlan_private *priv, unsigned int address,
 
 	card = priv->ks_wlan_hw.sdio_card;
 
-	if (length == 1) /* CMD52 */
-		sdio_writeb(card->func, *buffer, (unsigned int) address,  &rc);
-	else 		 /* CMD53 */
-		rc = sdio_memcpy_toio(card->func, (unsigned int) address, buffer, length);
+	if (length == 1)	/* CMD52 */
+		sdio_writeb(card->func, *buffer, (unsigned int)address, &rc);
+	else	/* CMD53 */
+		rc = sdio_memcpy_toio(card->func, (unsigned int)address, buffer,
+				      length);
 
-	if(rc != 0){
+	if (rc != 0) {
 		printk("sdio error erorr=%d size=%d\n", rc, length);
 		++priv->sdio_error_count;
-	}else{
-		priv->sdio_error_count=0;
+	} else {
+		priv->sdio_error_count = 0;
 	}
 
 	return rc;
 }
 
-static int enqueue_txdev(struct ks_wlan_private *priv, unsigned char *p, unsigned long size,
-		  void (*complete_handler)(void *arg1, void *arg2),
-		  void *arg1, void *arg2 )
+static int enqueue_txdev(struct ks_wlan_private *priv, unsigned char *p,
+			 unsigned long size,
+			 void (*complete_handler) (void *arg1, void *arg2),
+			 void *arg1, void *arg2)
 {
 	struct tx_device_buffer *sp;
 
 	if (priv->dev_state < DEVICE_STATE_BOOT) {
 		kfree(p);
 		if (complete_handler != NULL)
-			(*complete_handler)(arg1, arg2);
+			(*complete_handler) (arg1, arg2);
 		return 1;
 	}
 
-	if ((TX_DEVICE_BUFF_SIZE - 1) <=  cnt_txqbody(priv)) {
+	if ((TX_DEVICE_BUFF_SIZE - 1) <= cnt_txqbody(priv)) {
 		/* in case of buffer overflow */
-		DPRINTK(1,"tx buffer overflow\n");
+		DPRINTK(1, "tx buffer overflow\n");
 		kfree(p);
 		if (complete_handler != NULL)
-			(*complete_handler)(arg1, arg2);
+			(*complete_handler) (arg1, arg2);
 		return 1;
 	}
 
@@ -306,29 +326,31 @@ static int enqueue_txdev(struct ks_wlan_private *priv, unsigned char *p, unsigne
 }
 
 /* write data */
-static int write_to_device(struct ks_wlan_private *priv, unsigned char *buffer, unsigned long size )
+static int write_to_device(struct ks_wlan_private *priv, unsigned char *buffer,
+			   unsigned long size)
 {
-	int rc,retval;
+	int rc, retval;
 	unsigned char rw_data;
 	struct hostif_hdr *hdr;
 	hdr = (struct hostif_hdr *)buffer;
-	rc=0;
+	rc = 0;
 
-	DPRINTK(4,"size=%d\n", hdr->size);
-	if(hdr->event < HIF_DATA_REQ || HIF_REQ_MAX < hdr->event){
-		DPRINTK(1,"unknown event=%04X\n",hdr->event);
+	DPRINTK(4, "size=%d\n", hdr->size);
+	if (hdr->event < HIF_DATA_REQ || HIF_REQ_MAX < hdr->event) {
+		DPRINTK(1, "unknown event=%04X\n", hdr->event);
 		return 0;
 	}
 
 	retval = ks7010_sdio_write(priv, DATA_WINDOW, buffer, size);
-	if(retval){
+	if (retval) {
 		DPRINTK(1, " write error : retval=%d\n", retval);
 		return -4;
 	}
 
 	rw_data = WRITE_STATUS_BUSY;
-	retval = ks7010_sdio_write(priv, WRITE_STATUS, &rw_data, sizeof(rw_data));
-	if(retval){
+	retval =
+	    ks7010_sdio_write(priv, WRITE_STATUS, &rw_data, sizeof(rw_data));
+	if (retval) {
 		DPRINTK(1, " error : WRITE_STATUS=%02X\n", rw_data);
 		return -3;
 	}
@@ -339,74 +361,80 @@ static int write_to_device(struct ks_wlan_private *priv, unsigned char *buffer,
 static void tx_device_task(void *dev)
 {
 	struct ks_wlan_private *priv = (struct ks_wlan_private *)dev;
-	struct tx_device_buffer	*sp;
+	struct tx_device_buffer *sp;
 	int rc = 0;
 
 	DPRINTK(4, "\n");
-	if(cnt_txqbody(priv)>0 && atomic_read(&priv->psstatus.status) != PS_SNOOZE){
+	if (cnt_txqbody(priv) > 0
+	    && atomic_read(&priv->psstatus.status) != PS_SNOOZE) {
 		sp = &priv->tx_dev.tx_dev_buff[priv->tx_dev.qhead];
-		if(priv->dev_state >= DEVICE_STATE_BOOT){
+		if (priv->dev_state >= DEVICE_STATE_BOOT) {
 			rc = write_to_device(priv, sp->sendp, sp->size);
-			if(rc){
-				DPRINTK(1, "write_to_device error !!(%d)\n", rc);
-				queue_delayed_work(priv->ks_wlan_hw.ks7010sdio_wq,&priv->ks_wlan_hw.rw_wq, 1);
+			if (rc) {
+				DPRINTK(1, "write_to_device error !!(%d)\n",
+					rc);
+				queue_delayed_work(priv->ks_wlan_hw.
+						   ks7010sdio_wq,
+						   &priv->ks_wlan_hw.rw_wq, 1);
 				return;
 			}
 
 		}
-		kfree(sp->sendp); /* allocated memory free */
-		if(sp->complete_handler != NULL) /* TX Complete */
-			(*sp->complete_handler)(sp->arg1, sp->arg2);
+		kfree(sp->sendp);	/* allocated memory free */
+		if (sp->complete_handler != NULL)	/* TX Complete */
+			(*sp->complete_handler) (sp->arg1, sp->arg2);
 		inc_txqhead(priv);
 
-		if(cnt_txqbody(priv)>0){
-			queue_delayed_work(priv->ks_wlan_hw.ks7010sdio_wq,&priv->ks_wlan_hw.rw_wq, 0);
+		if (cnt_txqbody(priv) > 0) {
+			queue_delayed_work(priv->ks_wlan_hw.ks7010sdio_wq,
+					   &priv->ks_wlan_hw.rw_wq, 0);
 		}
 	}
 	return;
 }
 
-int ks_wlan_hw_tx( struct ks_wlan_private *priv, void *p, unsigned long size,
-		   void (*complete_handler)(void *arg1, void *arg2),
-		   void *arg1, void *arg2 )
+int ks_wlan_hw_tx(struct ks_wlan_private *priv, void *p, unsigned long size,
+		  void (*complete_handler) (void *arg1, void *arg2),
+		  void *arg1, void *arg2)
 {
-	int result=0;
+	int result = 0;
 	struct hostif_hdr *hdr;
 	hdr = (struct hostif_hdr *)p;
 
-	if(hdr->event < HIF_DATA_REQ || HIF_REQ_MAX < hdr->event){
-		DPRINTK(1,"unknown event=%04X\n",hdr->event);
+	if (hdr->event < HIF_DATA_REQ || HIF_REQ_MAX < hdr->event) {
+		DPRINTK(1, "unknown event=%04X\n", hdr->event);
 		return 0;
 	}
 
 	/* add event to hostt buffer */
 	priv->hostt.buff[priv->hostt.qtail] = hdr->event;
-        priv->hostt.qtail = (priv->hostt.qtail + 1) % SME_EVENT_BUFF_SIZE;
+	priv->hostt.qtail = (priv->hostt.qtail + 1) % SME_EVENT_BUFF_SIZE;
 
-	DPRINTK(4, "event=%04X\n",hdr->event);
+	DPRINTK(4, "event=%04X\n", hdr->event);
 	spin_lock(&priv->tx_dev.tx_dev_lock);
 	result = enqueue_txdev(priv, p, size, complete_handler, arg1, arg2);
 	spin_unlock(&priv->tx_dev.tx_dev_lock);
 
-	if(cnt_txqbody(priv)>0){
-		queue_delayed_work(priv->ks_wlan_hw.ks7010sdio_wq,&priv->ks_wlan_hw.rw_wq, 0);
+	if (cnt_txqbody(priv) > 0) {
+		queue_delayed_work(priv->ks_wlan_hw.ks7010sdio_wq,
+				   &priv->ks_wlan_hw.rw_wq, 0);
 	}
 	return result;
 }
 
 static void rx_event_task(unsigned long dev)
 {
-        struct ks_wlan_private *priv = (struct ks_wlan_private *)dev;
-	struct rx_device_buffer	*rp;
+	struct ks_wlan_private *priv = (struct ks_wlan_private *)dev;
+	struct rx_device_buffer *rp;
 
-	DPRINTK(4,"\n");
+	DPRINTK(4, "\n");
 
-	if(cnt_rxqbody(priv) > 0 && priv->dev_state >= DEVICE_STATE_BOOT){
+	if (cnt_rxqbody(priv) > 0 && priv->dev_state >= DEVICE_STATE_BOOT) {
 		rp = &priv->rx_dev.rx_dev_buff[priv->rx_dev.qhead];
 		hostif_receive(priv, rp->data, rp->size);
 		inc_rxqhead(priv);
 
-		if(cnt_rxqbody(priv) > 0){
+		if (cnt_rxqbody(priv) > 0) {
 			tasklet_schedule(&priv->ks_wlan_hw.rx_bh_task);
 		}
 	}
@@ -420,35 +448,40 @@ static void ks_wlan_hw_rx(void *dev, uint16_t size)
 	int retval;
 	struct rx_device_buffer *rx_buffer;
 	struct hostif_hdr *hdr;
-	unsigned char	read_status;
-	unsigned short event=0;
+	unsigned char read_status;
+	unsigned short event = 0;
 
-	DPRINTK(4,"\n");
+	DPRINTK(4, "\n");
 
 	/* receive data */
-	if (cnt_rxqbody(priv) >= (RX_DEVICE_BUFF_SIZE-1)) {
+	if (cnt_rxqbody(priv) >= (RX_DEVICE_BUFF_SIZE - 1)) {
 		/* in case of buffer overflow */
-		DPRINTK(1,"rx buffer overflow \n");
+		DPRINTK(1, "rx buffer overflow \n");
 		goto error_out;
 	}
 	rx_buffer = &priv->rx_dev.rx_dev_buff[priv->rx_dev.qtail];
 
-	retval = ks7010_sdio_read(priv, DATA_WINDOW, &rx_buffer->data[0], hif_align_size(size));
-	if(retval){
+	retval =
+	    ks7010_sdio_read(priv, DATA_WINDOW, &rx_buffer->data[0],
+			     hif_align_size(size));
+	if (retval) {
 		goto error_out;
 	}
 
 	/* length check */
-	if(size > 2046 || size == 0){
+	if (size > 2046 || size == 0) {
 #ifdef KS_WLAN_DEBUG
 		if (KS_WLAN_DEBUG > 5)
-			print_hex_dump_bytes("INVALID DATA dump: ", DUMP_PREFIX_OFFSET,
+			print_hex_dump_bytes("INVALID DATA dump: ",
+					     DUMP_PREFIX_OFFSET,
 					     rx_buffer->data, 32);
 #endif
 		/* rx_status update */
 		read_status = READ_STATUS_IDLE;
-		retval = ks7010_sdio_write(priv, READ_STATUS, &read_status, sizeof(read_status));
-		if(retval){
+		retval =
+		    ks7010_sdio_write(priv, READ_STATUS, &read_status,
+				      sizeof(read_status));
+		if (retval) {
 			DPRINTK(1, " error : READ_STATUS=%02X\n", read_status);
 		}
 		goto error_out;
@@ -461,14 +494,16 @@ static void ks_wlan_hw_rx(void *dev, uint16_t size)
 
 	/* read status update */
 	read_status = READ_STATUS_IDLE;
-	retval = ks7010_sdio_write(priv, READ_STATUS, &read_status, sizeof(read_status));
-	if(retval){
+	retval =
+	    ks7010_sdio_write(priv, READ_STATUS, &read_status,
+			      sizeof(read_status));
+	if (retval) {
 		DPRINTK(1, " error : READ_STATUS=%02X\n", read_status);
 	}
 	DPRINTK(4, "READ_STATUS=%02X\n", read_status);
 
-	if(atomic_read(&priv->psstatus.confirm_wait)){
-		if(IS_HIF_CONF(event)){
+	if (atomic_read(&priv->psstatus.confirm_wait)) {
+		if (IS_HIF_CONF(event)) {
 			DPRINTK(4, "IS_HIF_CONF true !!\n");
 			atomic_dec(&priv->psstatus.confirm_wait);
 		}
@@ -477,7 +512,7 @@ static void ks_wlan_hw_rx(void *dev, uint16_t size)
 	/* rx_event_task((void *)priv); */
 	tasklet_schedule(&priv->ks_wlan_hw.rx_bh_task);
 
-error_out:
+ error_out:
 	return;
 }
 
@@ -491,71 +526,74 @@ static void ks7010_rw_function(struct work_struct *work)
 	hw = container_of(work, struct hw_info_t, rw_wq.work);
 	priv = container_of(hw, struct ks_wlan_private, ks_wlan_hw);
 
-	DPRINTK(4,"\n");
-
+	DPRINTK(4, "\n");
 
- 	/* wiat after DOZE */
- 	if(time_after(priv->last_doze + ((30*HZ)/1000), jiffies )){
- 		DPRINTK(4, "wait after DOZE \n");
-		queue_delayed_work(priv->ks_wlan_hw.ks7010sdio_wq,&priv->ks_wlan_hw.rw_wq, 1);
+	/* wiat after DOZE */
+	if (time_after(priv->last_doze + ((30 * HZ) / 1000), jiffies)) {
+		DPRINTK(4, "wait after DOZE \n");
+		queue_delayed_work(priv->ks_wlan_hw.ks7010sdio_wq,
+				   &priv->ks_wlan_hw.rw_wq, 1);
 		return;
 	}
 
 	/* wiat after WAKEUP */
-	while(time_after(priv->last_wakeup + ((30*HZ)/1000), jiffies )){
+	while (time_after(priv->last_wakeup + ((30 * HZ) / 1000), jiffies)) {
 		DPRINTK(4, "wait after WAKEUP \n");
 /*		queue_delayed_work(priv->ks_wlan_hw.ks7010sdio_wq,&priv->ks_wlan_hw.rw_wq,
 		(priv->last_wakeup + ((30*HZ)/1000) - jiffies));*/
-		printk("wake: %lu %lu\n", priv->last_wakeup + (30* HZ)/1000, jiffies);
+		printk("wake: %lu %lu\n", priv->last_wakeup + (30 * HZ) / 1000,
+		       jiffies);
 		msleep(30);
 	}
 
 	sdio_claim_host(priv->ks_wlan_hw.sdio_card->func);
 
 	/* power save wakeup */
-	if(atomic_read(&priv->psstatus.status)==PS_SNOOZE){
-		if(cnt_txqbody(priv)>0){
+	if (atomic_read(&priv->psstatus.status) == PS_SNOOZE) {
+		if (cnt_txqbody(priv) > 0) {
 			ks_wlan_hw_wakeup_request(priv);
-			queue_delayed_work(priv->ks_wlan_hw.ks7010sdio_wq,&priv->ks_wlan_hw.rw_wq, 1);
+			queue_delayed_work(priv->ks_wlan_hw.ks7010sdio_wq,
+					   &priv->ks_wlan_hw.rw_wq, 1);
 		}
 		goto err_out;
 	}
 
 	/* sleep mode doze */
-	if(atomic_read(&priv->sleepstatus.doze_request)==1){
+	if (atomic_read(&priv->sleepstatus.doze_request) == 1) {
 		ks_wlan_hw_sleep_doze_request(priv);
 		goto err_out;
 	}
 	/* sleep mode wakeup */
-	if(atomic_read(&priv->sleepstatus.wakeup_request)==1){
+	if (atomic_read(&priv->sleepstatus.wakeup_request) == 1) {
 		ks_wlan_hw_sleep_wakeup_request(priv);
 		goto err_out;
 	}
 
 	/* read (WriteStatus/ReadDataSize FN1:00_0014) */
-	retval = ks7010_sdio_read(priv, WSTATUS_RSIZE, &rw_data, sizeof(rw_data));
-	if(retval){
-		DPRINTK(1, " error : WSTATUS_RSIZE=%02X psstatus=%d\n", rw_data,atomic_read(&priv->psstatus.status));
+	retval =
+	    ks7010_sdio_read(priv, WSTATUS_RSIZE, &rw_data, sizeof(rw_data));
+	if (retval) {
+		DPRINTK(1, " error : WSTATUS_RSIZE=%02X psstatus=%d\n", rw_data,
+			atomic_read(&priv->psstatus.status));
 		goto err_out;
 	}
 	DPRINTK(4, "WSTATUS_RSIZE=%02X\n", rw_data);
 
-	if(rw_data&RSIZE_MASK){ /* Read schedule */
-		ks_wlan_hw_rx((void *)priv, (uint16_t)(((rw_data&RSIZE_MASK)<<4)));
+	if (rw_data & RSIZE_MASK) {	/* Read schedule */
+		ks_wlan_hw_rx((void *)priv,
+			      (uint16_t) (((rw_data & RSIZE_MASK) << 4)));
 	}
-	if((rw_data&WSTATUS_MASK)){
+	if ((rw_data & WSTATUS_MASK)) {
 		tx_device_task((void *)priv);
 	}
 	_ks_wlan_hw_power_save(priv);
 
-err_out:
+ err_out:
 	sdio_release_host(priv->ks_wlan_hw.sdio_card->func);
 
 	return;
 }
 
-
-
 static void ks_sdio_interrupt(struct sdio_func *func)
 {
 	int retval;
@@ -567,10 +605,12 @@ static void ks_sdio_interrupt(struct sdio_func *func)
 	priv = card->priv;
 	DPRINTK(4, "\n");
 
-	if(priv->dev_state >= DEVICE_STATE_BOOT){
-		retval = ks7010_sdio_read(priv, INT_PENDING, &status, sizeof(status));
-		if(retval){
-			DPRINTK(1, "read INT_PENDING Failed!!(%d)\n",retval);
+	if (priv->dev_state >= DEVICE_STATE_BOOT) {
+		retval =
+		    ks7010_sdio_read(priv, INT_PENDING, &status,
+				     sizeof(status));
+		if (retval) {
+			DPRINTK(1, "read INT_PENDING Failed!!(%d)\n", retval);
 			goto intr_out;
 		}
 		DPRINTK(4, "INT_PENDING=%02X\n", rw_data);
@@ -580,70 +620,89 @@ static void ks_sdio_interrupt(struct sdio_func *func)
 		/* read (General Communication B register) */
 		/* bit5 -> Write Status Idle */
 		/* bit2 -> Read Status Busy  */
-		if(status&INT_GCR_B || atomic_read(&priv->psstatus.status)==PS_SNOOZE){
-			retval = ks7010_sdio_read(priv, GCR_B, &rw_data, sizeof(rw_data));
-			if(retval){
+		if (status & INT_GCR_B
+		    || atomic_read(&priv->psstatus.status) == PS_SNOOZE) {
+			retval =
+			    ks7010_sdio_read(priv, GCR_B, &rw_data,
+					     sizeof(rw_data));
+			if (retval) {
 				DPRINTK(1, " error : GCR_B=%02X\n", rw_data);
 				goto intr_out;
 			}
 			/* DPRINTK(1, "GCR_B=%02X\n", rw_data); */
-			if(rw_data == GCR_B_ACTIVE){
-				if(atomic_read(&priv->psstatus.status)==PS_SNOOZE){
-					atomic_set(&priv->psstatus.status, PS_WAKEUP);
-					priv->wakeup_count=0;
+			if (rw_data == GCR_B_ACTIVE) {
+				if (atomic_read(&priv->psstatus.status) ==
+				    PS_SNOOZE) {
+					atomic_set(&priv->psstatus.status,
+						   PS_WAKEUP);
+					priv->wakeup_count = 0;
 				}
 				complete(&priv->psstatus.wakeup_wait);
 			}
 
-
 		}
 
-		do{
+		do {
 			/* read (WriteStatus/ReadDataSize FN1:00_0014) */
-			retval = ks7010_sdio_read(priv, WSTATUS_RSIZE, &rw_data, sizeof(rw_data));
-			if(retval){
-				DPRINTK(1, " error : WSTATUS_RSIZE=%02X\n", rw_data);
+			retval =
+			    ks7010_sdio_read(priv, WSTATUS_RSIZE, &rw_data,
+					     sizeof(rw_data));
+			if (retval) {
+				DPRINTK(1, " error : WSTATUS_RSIZE=%02X\n",
+					rw_data);
 				goto intr_out;
 			}
 			DPRINTK(4, "WSTATUS_RSIZE=%02X\n", rw_data);
-			rsize=rw_data&RSIZE_MASK;
-			if(rsize){ /* Read schedule */
-				ks_wlan_hw_rx((void *)priv, (uint16_t)(((rsize)<<4)));
+			rsize = rw_data & RSIZE_MASK;
+			if (rsize) {	/* Read schedule */
+				ks_wlan_hw_rx((void *)priv,
+					      (uint16_t) (((rsize) << 4)));
 			}
-			if(rw_data&WSTATUS_MASK){
+			if (rw_data & WSTATUS_MASK) {
 #if 0
-				if(status&INT_WRITE_STATUS && !cnt_txqbody(priv)){
+				if (status & INT_WRITE_STATUS
+				    && !cnt_txqbody(priv)) {
 					/* dummy write for interrupt clear */
-					rw_data =0;
-					retval = ks7010_sdio_write(priv, DATA_WINDOW, &rw_data, sizeof(rw_data));
+					rw_data = 0;
+					retval =
+					    ks7010_sdio_write(priv, DATA_WINDOW,
+							      &rw_data,
+							      sizeof(rw_data));
 					if (retval) {
-						DPRINTK(1, "write DATA_WINDOW Failed!!(%d)\n",retval);
+						DPRINTK(1,
+							"write DATA_WINDOW Failed!!(%d)\n",
+							retval);
 					}
 					status &= ~INT_WRITE_STATUS;
-				}
-				else{
+				} else {
 #endif
-					if(atomic_read(&priv->psstatus.status)==PS_SNOOZE){
-						if(cnt_txqbody(priv)){
+					if (atomic_read(&priv->psstatus.status) == PS_SNOOZE) {
+						if (cnt_txqbody(priv)) {
 							ks_wlan_hw_wakeup_request(priv);
-							queue_delayed_work(priv->ks_wlan_hw.ks7010sdio_wq, &priv->ks_wlan_hw.rw_wq, 1);
+							queue_delayed_work
+							    (priv->ks_wlan_hw.
+							     ks7010sdio_wq,
+							     &priv->ks_wlan_hw.
+							     rw_wq, 1);
 							return;
 						}
-					}
-					else{
+					} else {
 						tx_device_task((void *)priv);
 					}
-//				}
+#if 0
+				}
+#endif
 			}
-		}while(rsize);
+		} while (rsize);
 	}
 
-intr_out:
-	queue_delayed_work(priv->ks_wlan_hw.ks7010sdio_wq,&priv->ks_wlan_hw.rw_wq, 0);
+ intr_out:
+	queue_delayed_work(priv->ks_wlan_hw.ks7010sdio_wq,
+			   &priv->ks_wlan_hw.rw_wq, 0);
 	return;
 }
 
-static int trx_device_init( struct ks_wlan_private *priv )
+static int trx_device_init(struct ks_wlan_private *priv)
 {
 	/* initialize values (tx) */
 	priv->tx_dev.qtail = priv->tx_dev.qhead = 0;
@@ -655,21 +714,22 @@ static int trx_device_init( struct ks_wlan_private *priv )
 	spin_lock_init(&priv->tx_dev.tx_dev_lock);
 	spin_lock_init(&priv->rx_dev.rx_dev_lock);
 
-	tasklet_init(&priv->ks_wlan_hw.rx_bh_task, rx_event_task, (unsigned long)priv);
+	tasklet_init(&priv->ks_wlan_hw.rx_bh_task, rx_event_task,
+		     (unsigned long)priv);
 
 	return 0;
 }
 
-static void trx_device_exit( struct ks_wlan_private *priv )
+static void trx_device_exit(struct ks_wlan_private *priv)
 {
-	struct tx_device_buffer	*sp;
+	struct tx_device_buffer *sp;
 
 	/* tx buffer clear */
-	while (cnt_txqbody(priv)>0) {
+	while (cnt_txqbody(priv) > 0) {
 		sp = &priv->tx_dev.tx_dev_buff[priv->tx_dev.qhead];
-		kfree(sp->sendp); /* allocated memory free */
-		if (sp->complete_handler != NULL) /* TX Complete */
-			(*sp->complete_handler)(sp->arg1, sp->arg2);
+		kfree(sp->sendp);	/* allocated memory free */
+		if (sp->complete_handler != NULL)	/* TX Complete */
+			(*sp->complete_handler) (sp->arg1, sp->arg2);
 		inc_txqhead(priv);
 	}
 
@@ -677,24 +737,35 @@ static void trx_device_exit( struct ks_wlan_private *priv )
 
 	return;
 }
+
 static int ks7010_sdio_update_index(struct ks_wlan_private *priv, u32 index)
 {
-	int rc=0;
+	int rc = 0;
 	int retval;
 	unsigned char *data_buf;
 	data_buf = NULL;
 
 	data_buf = kmalloc(sizeof(u32), GFP_KERNEL);
-	if(!data_buf){ rc = 1; goto error_out; }
+	if (!data_buf) {
+		rc = 1;
+		goto error_out;
+	}
 
 	memcpy(data_buf, &index, sizeof(index));
 	retval = ks7010_sdio_write(priv, WRITE_INDEX, data_buf, sizeof(index));
-	if(retval){ rc = 2; goto error_out; }
+	if (retval) {
+		rc = 2;
+		goto error_out;
+	}
 
 	retval = ks7010_sdio_write(priv, READ_INDEX, data_buf, sizeof(index));
-	if(retval){ rc = 3; goto error_out; }
-error_out:
-	if(data_buf) kfree(data_buf);
+	if (retval) {
+		rc = 3;
+		goto error_out;
+	}
+ error_out:
+	if (data_buf)
+		kfree(data_buf);
 	return rc;
 }
 
@@ -702,30 +773,41 @@ error_out:
 static int ks7010_sdio_data_compare(struct ks_wlan_private *priv, u32 address,
 				    unsigned char *data, unsigned int size)
 {
-	int rc=0;
+	int rc = 0;
 	int retval;
 	unsigned char *read_buf;
 	read_buf = NULL;
 	read_buf = kmalloc(ROM_BUFF_SIZE, GFP_KERNEL);
-	if(!read_buf){ rc = 1; goto error_out; }
+	if (!read_buf) {
+		rc = 1;
+		goto error_out;
+	}
 	retval = ks7010_sdio_read(priv, address, read_buf, size);
-	if(retval){ rc = 2; goto error_out; }
+	if (retval) {
+		rc = 2;
+		goto error_out;
+	}
 	retval = memcmp(data, read_buf, size);
 
-	if(retval){
-		DPRINTK(0, "data compare error (%d) \n",retval); rc = 3; goto error_out;
+	if (retval) {
+		DPRINTK(0, "data compare error (%d) \n", retval);
+		rc = 3;
+		goto error_out;
 	}
-error_out:
-	if(read_buf) kfree(read_buf);
+ error_out:
+	if (read_buf)
+		kfree(read_buf);
 	return rc;
 }
+
 #include <linux/firmware.h>
-static int ks79xx_upload_firmware(struct ks_wlan_private *priv, struct ks_sdio_card *card)
+static int ks79xx_upload_firmware(struct ks_wlan_private *priv,
+				  struct ks_sdio_card *card)
 {
-	unsigned int	size, offset,  n = 0;
-	unsigned char	*rom_buf;
-	unsigned char rw_data =0;
-	int retval, rc=0;
+	unsigned int size, offset, n = 0;
+	unsigned char *rom_buf;
+	unsigned char rw_data = 0;
+	int retval, rc = 0;
 	int length;
 	const struct firmware *fw_entry = NULL;
 
@@ -733,76 +815,99 @@ static int ks79xx_upload_firmware(struct ks_wlan_private *priv, struct ks_sdio_c
 
 	/* buffer allocate */
 	rom_buf = kmalloc(ROM_BUFF_SIZE, GFP_KERNEL);
-	if(!rom_buf){ rc = 3; goto error_out0; }
-
+	if (!rom_buf) {
+		rc = 3;
+		goto error_out0;
+	}
 
 	sdio_claim_host(card->func);
 
 	/* Firmware running ? */
 	retval = ks7010_sdio_read(priv, GCR_A, &rw_data, sizeof(rw_data));
-	if(rw_data == GCR_A_RUN){
-		DPRINTK( 0, "MAC firmware running ...\n");
+	if (rw_data == GCR_A_RUN) {
+		DPRINTK(0, "MAC firmware running ...\n");
 		rc = 0;
 		goto error_out0;
 	}
 
-	if(request_firmware(&fw_entry, priv->reg.rom_file, &priv->ks_wlan_hw.sdio_card->func->dev)!=0){
-		DPRINTK(1,"error request_firmware() file=%s\n", priv->reg.rom_file);
+	if (request_firmware
+	    (&fw_entry, priv->reg.rom_file,
+	     &priv->ks_wlan_hw.sdio_card->func->dev) != 0) {
+		DPRINTK(1, "error request_firmware() file=%s\n",
+			priv->reg.rom_file);
 		return 1;
 	}
-	DPRINTK(4,"success request_firmware() file=%s size=%zu\n", priv->reg.rom_file, fw_entry->size);
+	DPRINTK(4, "success request_firmware() file=%s size=%zu\n",
+		priv->reg.rom_file, fw_entry->size);
 	length = fw_entry->size;
 
 	/* Load Program */
 	n = 0;
-        do {
-		if(length >= ROM_BUFF_SIZE){
+	do {
+		if (length >= ROM_BUFF_SIZE) {
 			size = ROM_BUFF_SIZE;
 			length = length - ROM_BUFF_SIZE;
+		} else {
+			size = length;
+			length = 0;
 		}
-		else{
-			size=length;
-			length=0;
-		}
-		DPRINTK(4, "size = %d\n",size);
-		if(size == 0) break;
-		memcpy(rom_buf,fw_entry->data+n,size);
+		DPRINTK(4, "size = %d\n", size);
+		if (size == 0)
+			break;
+		memcpy(rom_buf, fw_entry->data + n, size);
 		/* Update write index */
 		offset = n;
-		retval = ks7010_sdio_update_index(priv, KS7010_IRAM_ADDRESS+offset);
-		if(retval){ rc = 6; goto error_out1; }
+		retval =
+		    ks7010_sdio_update_index(priv,
+					     KS7010_IRAM_ADDRESS + offset);
+		if (retval) {
+			rc = 6;
+			goto error_out1;
+		}
 
 		/* Write data */
 		retval = ks7010_sdio_write(priv, DATA_WINDOW, rom_buf, size);
-		if(retval){ rc = 8; goto error_out1; }
+		if (retval) {
+			rc = 8;
+			goto error_out1;
+		}
 
 		/* compare */
-		retval = ks7010_sdio_data_compare(priv, DATA_WINDOW, rom_buf, size);
-		if(retval){ rc = 9; goto error_out1; }
+		retval =
+		    ks7010_sdio_data_compare(priv, DATA_WINDOW, rom_buf, size);
+		if (retval) {
+			rc = 9;
+			goto error_out1;
+		}
 		n += size;
 
-       }while(size);
+	} while (size);
 
 	/* Remap request */
 	rw_data = GCR_A_REMAP;
 	retval = ks7010_sdio_write(priv, GCR_A, &rw_data, sizeof(rw_data));
-	if(retval){
+	if (retval) {
 		rc = 11;
 		goto error_out1;
 	}
-	DPRINTK( 4, " REMAP Request : GCR_A=%02X\n", rw_data);
+	DPRINTK(4, " REMAP Request : GCR_A=%02X\n", rw_data);
 
 	/* Firmware running check */
 	for (n = 0; n < 50; ++n) {
-		mdelay(10);/* wait_ms(10); */
-		retval = ks7010_sdio_read(priv, GCR_A, &rw_data, sizeof(rw_data));
-		if(retval){ rc = 11; goto error_out1; }
-		if(rw_data == GCR_A_RUN) break;
+		mdelay(10);	/* wait_ms(10); */
+		retval =
+		    ks7010_sdio_read(priv, GCR_A, &rw_data, sizeof(rw_data));
+		if (retval) {
+			rc = 11;
+			goto error_out1;
+		}
+		if (rw_data == GCR_A_RUN)
+			break;
 	}
-	DPRINTK(4, "firmware wakeup (%d)!!!!\n",n);
+	DPRINTK(4, "firmware wakeup (%d)!!!!\n", n);
 	if ((50) <= n) {
 		DPRINTK(1, "firmware can't start\n");
-                rc = 12;
+		rc = 12;
 		goto error_out1;
 	}
 
@@ -812,30 +917,31 @@ static int ks79xx_upload_firmware(struct ks_wlan_private *priv, struct ks_sdio_c
 	release_firmware(fw_entry);
  error_out0:
 	sdio_release_host(card->func);
-	if(rom_buf)
+	if (rom_buf)
 		kfree(rom_buf);
 	return rc;
 }
 
 static void ks7010_card_init(struct ks_wlan_private *priv)
 {
-	DPRINTK(5,"\ncard_init_task()\n");
+	DPRINTK(5, "\ncard_init_task()\n");
 
 	/* init_waitqueue_head(&priv->confirm_wait); */
 	init_completion(&priv->confirm_wait);
 
-	DPRINTK(5,"init_completion()\n");
+	DPRINTK(5, "init_completion()\n");
 
 	/* get mac address & firmware version */
 	hostif_sme_enqueue(priv, SME_START);
 
-	DPRINTK(5,"hostif_sme_enqueu()\n");
+	DPRINTK(5, "hostif_sme_enqueu()\n");
 
-	if(!wait_for_completion_interruptible_timeout(&priv->confirm_wait,5*HZ)){
-		DPRINTK(1,"wait time out!! SME_START\n");
+	if (!wait_for_completion_interruptible_timeout
+	    (&priv->confirm_wait, 5 * HZ)) {
+		DPRINTK(1, "wait time out!! SME_START\n");
 	}
 
-	if(priv->mac_address_valid && priv->version_size){
+	if (priv->mac_address_valid && priv->version_size) {
 		priv->dev_state = DEVICE_STATE_PREINIT;
 	}
 
@@ -858,57 +964,56 @@ static void ks7010_card_init(struct ks_wlan_private *priv)
 	hostif_sme_enqueue(priv, SME_MODE_SET_REQUEST);
 	hostif_sme_enqueue(priv, SME_START_REQUEST);
 
-	if(!wait_for_completion_interruptible_timeout(&priv->confirm_wait,5*HZ)){
-		DPRINTK(1,"wait time out!! wireless parameter set\n");
+	if (!wait_for_completion_interruptible_timeout
+	    (&priv->confirm_wait, 5 * HZ)) {
+		DPRINTK(1, "wait time out!! wireless parameter set\n");
 	}
 
-	if(priv->dev_state >= DEVICE_STATE_PREINIT){
+	if (priv->dev_state >= DEVICE_STATE_PREINIT) {
 		DPRINTK(1, "DEVICE READY!!\n");
 		priv->dev_state = DEVICE_STATE_READY;
-		reg_net = register_netdev (priv->net_dev);
-		DPRINTK(3, "register_netdev=%d\n",reg_net);
-	}
-	else {
-		DPRINTK(1, "dev_state=%d\n",priv->dev_state);
+		reg_net = register_netdev(priv->net_dev);
+		DPRINTK(3, "register_netdev=%d\n", reg_net);
+	} else {
+		DPRINTK(1, "dev_state=%d\n", priv->dev_state);
 	}
 }
 
 static struct sdio_driver ks7010_sdio_driver = {
-	.name		= "ks7910_sdio",
-	.id_table	= if_sdio_ids,
-	.probe		= ks7910_sdio_probe,
-	.remove		= ks7910_sdio_remove,
+	.name = "ks7910_sdio",
+	.id_table = if_sdio_ids,
+	.probe = ks7910_sdio_probe,
+	.remove = ks7910_sdio_remove,
 };
 
-
 extern int ks_wlan_net_start(struct net_device *dev);
 extern int ks_wlan_net_stop(struct net_device *dev);
 
-static int ks7910_sdio_probe(struct sdio_func *func, const struct sdio_device_id *device)
+static int ks7910_sdio_probe(struct sdio_func *func,
+			     const struct sdio_device_id *device)
 {
 	struct ks_wlan_private *priv;
 	struct ks_sdio_card *card;
 	struct net_device *netdev;
 	unsigned char rw_data;
-	int i=0, ret;
+	int i = 0, ret;
 
 	DPRINTK(5, "ks7910_sdio_probe()\n");
 
 	priv = NULL;
-	netdev=NULL;
-
+	netdev = NULL;
 
 	/* initilize ks_sdio_card */
 	card = kzalloc(sizeof(struct ks_sdio_card), GFP_KERNEL);
 	if (!card)
 		return -ENOMEM;
 
-	card->func  = func;
+	card->func = func;
 	card->model = 0x10;
 	spin_lock_init(&card->lock);
 
 	/* select model */
-	for (i = 0;i < ARRAY_SIZE(ks_sdio_models);i++) {
+	for (i = 0; i < ARRAY_SIZE(ks_sdio_models); i++) {
 		if (card->model == ks_sdio_models[i].model)
 			break;
 	}
@@ -920,7 +1025,6 @@ static int ks7910_sdio_probe(struct sdio_func *func, const struct sdio_device_id
 
 	card->firmware = ks_sdio_models[i].firmware;
 
-
 	/*** Initialize  SDIO ***/
 	sdio_claim_host(func);
 
@@ -929,7 +1033,8 @@ static int ks7910_sdio_probe(struct sdio_func *func, const struct sdio_device_id
 
 	/* function blocksize set */
 	ret = sdio_set_block_size(func, KS7010_IO_BLOCK_SIZE);
-	DPRINTK(5, "multi_block=%d sdio_set_block_size()=%d %d\n", func->card->cccr.multi_block, func->cur_blksize,  ret);
+	DPRINTK(5, "multi_block=%d sdio_set_block_size()=%d %d\n",
+		func->card->cccr.multi_block, func->cur_blksize, ret);
 
 	/* Allocate the slot current */
 
@@ -940,10 +1045,10 @@ static int ks7910_sdio_probe(struct sdio_func *func, const struct sdio_device_id
 		goto error_free_card;
 
 	/* interrupt disable */
-	sdio_writeb(func, 0, INT_ENABLE,  &ret);
+	sdio_writeb(func, 0, INT_ENABLE, &ret);
 	if (ret)
 		goto error_free_card;
-	sdio_writeb(func, 0xff, INT_PENDING,  &ret);
+	sdio_writeb(func, 0xff, INT_PENDING, &ret);
 	if (ret)
 		goto error_disable_func;
 
@@ -957,18 +1062,16 @@ static int ks7910_sdio_probe(struct sdio_func *func, const struct sdio_device_id
 	sdio_set_drvdata(func, card);
 
 	DPRINTK(5, "class = 0x%X, vendor = 0x%X, "
-		"device = 0x%X\n",
-		func->class, func->vendor, func->device);
-
+		"device = 0x%X\n", func->class, func->vendor, func->device);
 
 	/* private memory allocate */
 	netdev = alloc_etherdev(sizeof(*priv));
 	if (netdev == NULL) {
-		printk (KERN_ERR "ks79xx : Unable to alloc new net device\n");
+		printk(KERN_ERR "ks79xx : Unable to alloc new net device\n");
 		goto error_release_irq;
 	}
 	if (dev_alloc_name(netdev, netdev->name) < 0) {
-		printk (KERN_ERR "ks79xx :  Couldn't get name!\n");
+		printk(KERN_ERR "ks79xx :  Couldn't get name!\n");
 		goto error_free_netdev;
 	}
 
@@ -982,7 +1085,7 @@ static int ks7910_sdio_probe(struct sdio_func *func, const struct sdio_device_id
 	init_completion(&priv->ks_wlan_hw.ks7010_sdio_wait);
 	priv->ks_wlan_hw.read_buf = NULL;
 	priv->ks_wlan_hw.read_buf = kmalloc(RX_DATA_SIZE, GFP_KERNEL);
-	if(!priv->ks_wlan_hw.read_buf){
+	if (!priv->ks_wlan_hw.read_buf) {
 		goto error_free_netdev;
 	}
 	priv->dev_state = DEVICE_STATE_PREBOOT;
@@ -995,25 +1098,29 @@ static int ks7910_sdio_probe(struct sdio_func *func, const struct sdio_device_id
 	memset(&priv->wstats, 0, sizeof(priv->wstats));
 
 	/* sleep mode */
-	atomic_set(&priv->sleepstatus.doze_request,0);
-	atomic_set(&priv->sleepstatus.wakeup_request,0);
-	atomic_set(&priv->sleepstatus.wakeup_request,0);
+	atomic_set(&priv->sleepstatus.doze_request, 0);
+	atomic_set(&priv->sleepstatus.wakeup_request, 0);
+	atomic_set(&priv->sleepstatus.wakeup_request, 0);
 
 	trx_device_init(priv);
 	hostif_init(priv);
-        ks_wlan_net_start(netdev);
+	ks_wlan_net_start(netdev);
 
 	/* Read config file */
 	ret = ks_wlan_read_config_file(priv);
 	if (ret) {
-		printk(KERN_ERR "ks79xx: read configuration file failed !! retern code = %d\n", ret);
+		printk(KERN_ERR
+		       "ks79xx: read configuration file failed !! retern code = %d\n",
+		       ret);
 		goto error_free_read_buf;
 	}
 
 	/* Upload firmware */
-	ret = ks79xx_upload_firmware(priv, card); /* firmware load */
-	if(ret){
-		printk(KERN_ERR "ks79xx: firmware load failed !! retern code = %d\n", ret);
+	ret = ks79xx_upload_firmware(priv, card);	/* firmware load */
+	if (ret) {
+		printk(KERN_ERR
+		       "ks79xx: firmware load failed !! retern code = %d\n",
+		       ret);
 		goto error_free_read_buf;
 	}
 
@@ -1023,25 +1130,24 @@ static int ks7910_sdio_probe(struct sdio_func *func, const struct sdio_device_id
 	sdio_claim_host(func);
 	ret = ks7010_sdio_write(priv, INT_PENDING, &rw_data, sizeof(rw_data));
 	sdio_release_host(func);
-	if(ret){
+	if (ret) {
 		DPRINTK(1, " error : INT_PENDING=%02X\n", rw_data);
 	}
 	DPRINTK(4, " clear Interrupt : INT_PENDING=%02X\n", rw_data);
 
-
 	/* enable ks7010sdio interrupt (INT_GCR_B|INT_READ_STATUS|INT_WRITE_STATUS) */
-	rw_data = (INT_GCR_B|INT_READ_STATUS|INT_WRITE_STATUS);
+	rw_data = (INT_GCR_B | INT_READ_STATUS | INT_WRITE_STATUS);
 	sdio_claim_host(func);
 	ret = ks7010_sdio_write(priv, INT_ENABLE, &rw_data, sizeof(rw_data));
 	sdio_release_host(func);
-	if(ret){
+	if (ret) {
 		DPRINTK(1, " error : INT_ENABLE=%02X\n", rw_data);
 	}
 	DPRINTK(4, " enable Interrupt : INT_ENABLE=%02X\n", rw_data);
 	priv->dev_state = DEVICE_STATE_BOOT;
 
 	priv->ks_wlan_hw.ks7010sdio_wq = create_workqueue("ks7010sdio_wq");
-	if(!priv->ks_wlan_hw.ks7010sdio_wq){
+	if (!priv->ks_wlan_hw.ks7010sdio_wq) {
 		DPRINTK(1, "create_workqueue failed !!\n");
 		goto error_free_read_buf;
 	}
@@ -1051,22 +1157,22 @@ static int ks7910_sdio_probe(struct sdio_func *func, const struct sdio_device_id
 
 	return 0;
 
-error_free_read_buf:
+ error_free_read_buf:
 	kfree(priv->ks_wlan_hw.read_buf);
 	priv->ks_wlan_hw.read_buf = NULL;
-error_free_netdev:
+ error_free_netdev:
 	free_netdev(priv->net_dev);
 	card->priv = NULL;
-error_release_irq:
+ error_release_irq:
 	sdio_claim_host(func);
 	sdio_release_irq(func);
-error_disable_func:
+ error_disable_func:
 	sdio_disable_func(func);
-error_free_card:
+ error_free_card:
 	sdio_release_host(func);
 	sdio_set_drvdata(func, NULL);
 	kfree(card);
-error:
+ error:
 	return -ENODEV;
 }
 
@@ -1080,56 +1186,62 @@ static void ks7910_sdio_remove(struct sdio_func *func)
 
 	card = sdio_get_drvdata(func);
 
-	if(card == NULL)
+	if (card == NULL)
 		return;
 
 	DPRINTK(1, "priv = card->priv\n");
 	priv = card->priv;
 	netdev = priv->net_dev;
-	if(priv){
+	if (priv) {
 		ks_wlan_net_stop(netdev);
 		DPRINTK(1, "ks_wlan_net_stop\n");
 
 		/* 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, &ret);
+		sdio_writeb(func, 0xff, INT_PENDING, &ret);
 		sdio_release_host(func);
 		DPRINTK(1, "interrupt disable\n");
 
 		/* send stop request to MAC */
 		{
 			struct hostif_stop_request_t *pp;
-			pp = (struct hostif_stop_request_t *)kzalloc(hif_align_size(sizeof(*pp)), GFP_KERNEL );
-			if (pp==NULL) {
-				DPRINTK(3,"allocate memory failed..\n");
-				return; /* to do goto ni suru*/
+			pp = (struct hostif_stop_request_t *)
+			    kzalloc(hif_align_size(sizeof(*pp)), GFP_KERNEL);
+			if (pp == NULL) {
+				DPRINTK(3, "allocate memory failed..\n");
+				return;	/* to do goto ni suru */
 			}
-			pp->header.size	= cpu_to_le16((uint16_t)(sizeof(*pp)-sizeof(pp->header.size)));
-			pp->header.event = cpu_to_le16((uint16_t)HIF_STOP_REQ);
+			pp->header.size =
+			    cpu_to_le16((uint16_t)
+					(sizeof(*pp) -
+					 sizeof(pp->header.size)));
+			pp->header.event = cpu_to_le16((uint16_t) HIF_STOP_REQ);
 
 			sdio_claim_host(func);
-			write_to_device(priv, (unsigned char *) pp, hif_align_size(sizeof(*pp)));
+			write_to_device(priv, (unsigned char *)pp,
+					hif_align_size(sizeof(*pp)));
 			sdio_release_host(func);
 			kfree(pp);
 		}
 		DPRINTK(1, "STOP Req\n");
 
-		if(priv->ks_wlan_hw.ks7010sdio_wq){
+		if (priv->ks_wlan_hw.ks7010sdio_wq) {
 			flush_workqueue(priv->ks_wlan_hw.ks7010sdio_wq);
 			destroy_workqueue(priv->ks_wlan_hw.ks7010sdio_wq);
 		}
-		DPRINTK(1, "destroy_workqueue(priv->ks_wlan_hw.ks7010sdio_wq);\n");
+		DPRINTK(1,
+			"destroy_workqueue(priv->ks_wlan_hw.ks7010sdio_wq);\n");
 
 		hostif_exit(priv);
 		DPRINTK(1, "hostif_exit\n");
 
-		if(!reg_net)
+		if (!reg_net)
 			unregister_netdev(netdev);
 		DPRINTK(1, "unregister_netdev\n");
 
 		trx_device_exit(priv);
-		if(priv->ks_wlan_hw.read_buf){
+		if (priv->ks_wlan_hw.read_buf) {
 			kfree(priv->ks_wlan_hw.read_buf);
 		}
 		free_netdev(priv->net_dev);
@@ -1148,26 +1260,27 @@ static void ks7910_sdio_remove(struct sdio_func *func)
 	kfree(card);
 	DPRINTK(1, "kfree()\n");
 
-
-	DPRINTK(5," Bye !!\n");
+	DPRINTK(5, " Bye !!\n");
 	return;
 }
 
-static int __init ks7010_sdio_init( void )
+static int __init ks7010_sdio_init(void)
 {
 	int status;
 
 	/* register with bus driver core */
 	status = sdio_register_driver(&ks7010_sdio_driver);
-	if(status != 0){
-		DPRINTK(1,"ks79xx_sdio : failed to register with bus driver, %d\n", status );
+	if (status != 0) {
+		DPRINTK(1,
+			"ks79xx_sdio : failed to register with bus driver, %d\n",
+			status);
 	}
 	return status;
 }
 
-static void __exit ks7010_sdio_exit( void )
+static void __exit ks7010_sdio_exit(void)
 {
-	DPRINTK(5," \n");
+	DPRINTK(5, " \n");
 	sdio_unregister_driver(&ks7010_sdio_driver);
 	return;
 }
-- 
2.8.1

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

* [PATCH 26/27] staging: ks7010: remove supported card table with one element
  2016-05-10 13:52 [PATCH 00/27] staging: add driver for KS7010 based SDIO cards Wolfram Sang
                   ` (21 preceding siblings ...)
  2016-05-10 13:52 ` [PATCH 25/27] staging: ks7010: indent ks7010_sdio.c Wolfram Sang
@ 2016-05-10 13:52 ` Wolfram Sang
  2016-05-10 13:52 ` [PATCH 27/27] staging: ks7010: fix module annotations Wolfram Sang
                   ` (4 subsequent siblings)
  27 siblings, 0 replies; 32+ messages in thread
From: Wolfram Sang @ 2016-05-10 13:52 UTC (permalink / raw)
  To: driverdev-devel; +Cc: Wolfram Sang, linux-renesas-soc

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

There is only this card supported, no need to iterate over the table.
The resulting firmware filename wasn't used anyway, but came from the
config file or hardcoded default.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/staging/ks7010/ks7010_sdio.c | 31 ++-----------------------------
 drivers/staging/ks7010/ks7010_sdio.h |  2 --
 2 files changed, 2 insertions(+), 31 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
index ed4d579300ad96..8e8476b52cedbc 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -35,19 +35,6 @@ static const struct sdio_device_id if_sdio_ids[] = {
 	{ /* all zero */ }
 };
 
-struct ks_sdio_model {
-	int model;
-	const char *firmware;
-};
-
-static struct ks_sdio_model ks_sdio_models[] = {
-	{
-		/* ks7010 */
-		.model = 0x10,
-		.firmware = "ks7010sd.rom",
-	},
-};
-
 static int ks7910_sdio_probe(struct sdio_func *function,
 			     const struct sdio_device_id *device);
 static void ks7910_sdio_remove(struct sdio_func *function);
@@ -996,7 +983,7 @@ static int ks7910_sdio_probe(struct sdio_func *func,
 	struct ks_sdio_card *card;
 	struct net_device *netdev;
 	unsigned char rw_data;
-	int i = 0, ret;
+	int ret;
 
 	DPRINTK(5, "ks7910_sdio_probe()\n");
 
@@ -1009,22 +996,8 @@ static int ks7910_sdio_probe(struct sdio_func *func,
 		return -ENOMEM;
 
 	card->func = func;
-	card->model = 0x10;
 	spin_lock_init(&card->lock);
 
-	/* select model */
-	for (i = 0; i < ARRAY_SIZE(ks_sdio_models); i++) {
-		if (card->model == ks_sdio_models[i].model)
-			break;
-	}
-
-	if (i == ARRAY_SIZE(ks_sdio_models)) {
-		DPRINTK(5, "unkown card model 0x%x\n", card->model);
-		goto error;
-	}
-
-	card->firmware = ks_sdio_models[i].firmware;
-
 	/*** Initialize  SDIO ***/
 	sdio_claim_host(func);
 
@@ -1172,7 +1145,7 @@ static int ks7910_sdio_probe(struct sdio_func *func,
 	sdio_release_host(func);
 	sdio_set_drvdata(func, NULL);
 	kfree(card);
- error:
+
 	return -ENODEV;
 }
 
diff --git a/drivers/staging/ks7010/ks7010_sdio.h b/drivers/staging/ks7010/ks7010_sdio.h
index aea3727caf483b..2d7be5dae157c7 100644
--- a/drivers/staging/ks7010/ks7010_sdio.h
+++ b/drivers/staging/ks7010/ks7010_sdio.h
@@ -109,8 +109,6 @@ struct ks_sdio_packet {
 struct ks_sdio_card {
 	struct sdio_func *func;
 	struct ks_wlan_private *priv;
-	int model;
-	const char *firmware;
 	spinlock_t lock;
 };
 
-- 
2.8.1

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

* [PATCH 27/27] staging: ks7010: fix module annotations
  2016-05-10 13:52 [PATCH 00/27] staging: add driver for KS7010 based SDIO cards Wolfram Sang
                   ` (22 preceding siblings ...)
  2016-05-10 13:52 ` [PATCH 26/27] staging: ks7010: remove supported card table with one element Wolfram Sang
@ 2016-05-10 13:52 ` Wolfram Sang
  2016-05-10 21:05 ` [PATCH 00/27] staging: add driver for KS7010 based SDIO cards Greg KH
                   ` (3 subsequent siblings)
  27 siblings, 0 replies; 32+ messages in thread
From: Wolfram Sang @ 2016-05-10 13:52 UTC (permalink / raw)
  To: driverdev-devel; +Cc: Wolfram Sang, linux-renesas-soc

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

List all authors, beautify description, match license to what is stated
in file headers, add firmware information.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/staging/ks7010/ks7010_sdio.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
index 8e8476b52cedbc..8c0d1bb58dcd9c 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -1261,9 +1261,7 @@ static void __exit ks7010_sdio_exit(void)
 module_init(ks7010_sdio_init);
 module_exit(ks7010_sdio_exit);
 
-MODULE_AUTHOR("Qi-Hardware based on KeyStream driver");
-MODULE_DESCRIPTION("Driver for KeyStream, KS7010 based SDIO cards. ");
-#ifdef MODULE_LICENSE
-MODULE_LICENSE("GPL");
-#endif
-MODULE_SUPPORTED_DEVICE("KS7910");
+MODULE_AUTHOR("Sang Engineering, Qi-Hardware, KeyStream");
+MODULE_DESCRIPTION("Driver for KeyStream KS7010 based SDIO cards");
+MODULE_LICENSE("GPL v2");
+MODULE_FIRMWARE(ROM_FILE);
-- 
2.8.1

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

* Re: [PATCH 00/27] staging: add driver for KS7010 based SDIO cards
  2016-05-10 13:52 [PATCH 00/27] staging: add driver for KS7010 based SDIO cards Wolfram Sang
                   ` (23 preceding siblings ...)
  2016-05-10 13:52 ` [PATCH 27/27] staging: ks7010: fix module annotations Wolfram Sang
@ 2016-05-10 21:05 ` Greg KH
  2016-05-11  6:06   ` Wolfram Sang
  2016-05-11 12:49 ` [PATCH] staging: ks7010: rename README to TODO Wolfram Sang
                   ` (2 subsequent siblings)
  27 siblings, 1 reply; 32+ messages in thread
From: Greg KH @ 2016-05-10 21:05 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: driverdev-devel, linux-renesas-soc

On Tue, May 10, 2016 at 03:52:13PM +0200, Wolfram Sang wrote:
> This driver can be used with later Spectec SDW-821 and all SDW-823 cards.
> See patch 1 and README for more details about its origin. To have the card
> working, you need another patch which is already in mmc/next:
> 
> https://patchwork.kernel.org/patch/9043341/
> 
> A working topic branch for the Renesas H3 can be found here:
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git renesas/topic/gen3-sdio
> 
> This series only can be found here:
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git staging/ks7010
> 
> Note: I needed this driver to verify SDIO capabilities for the new Renesas H3
> SoC. The fact that the original KS7010 driver also comes from Renesas is a
> coincidence. It does not mean official support for this driver. Parts of this
> work were backed by the above mentioned SDIO verification task while other
> parts were my personal interest. Future patches and reviews will also done by
> me as a private person (unless something very surprising happens ;))
> 
> Please comment, review, apply...

Can you change the README file to be named TODO to match all of the
other staging driver files?  That way people can look at them by just
doing a staging/*/TODO match.

thanks

greg k-h

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

* Re: [PATCH 00/27] staging: add driver for KS7010 based SDIO cards
  2016-05-10 21:05 ` [PATCH 00/27] staging: add driver for KS7010 based SDIO cards Greg KH
@ 2016-05-11  6:06   ` Wolfram Sang
  2016-05-11  8:37     ` Greg KH
  0 siblings, 1 reply; 32+ messages in thread
From: Wolfram Sang @ 2016-05-11  6:06 UTC (permalink / raw)
  To: Greg KH; +Cc: driverdev-devel, linux-renesas-soc

[-- Attachment #1: Type: text/plain, Size: 1537 bytes --]

On Tue, May 10, 2016 at 11:05:34PM +0200, Greg KH wrote:
> On Tue, May 10, 2016 at 03:52:13PM +0200, Wolfram Sang wrote:
> > This driver can be used with later Spectec SDW-821 and all SDW-823 cards.
> > See patch 1 and README for more details about its origin. To have the card
> > working, you need another patch which is already in mmc/next:
> > 
> > https://patchwork.kernel.org/patch/9043341/
> > 
> > A working topic branch for the Renesas H3 can be found here:
> > 
> > git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git renesas/topic/gen3-sdio
> > 
> > This series only can be found here:
> > 
> > git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git staging/ks7010
> > 
> > Note: I needed this driver to verify SDIO capabilities for the new Renesas H3
> > SoC. The fact that the original KS7010 driver also comes from Renesas is a
> > coincidence. It does not mean official support for this driver. Parts of this
> > work were backed by the above mentioned SDIO verification task while other
> > parts were my personal interest. Future patches and reviews will also done by
> > me as a private person (unless something very surprising happens ;))
> > 
> > Please comment, review, apply...
> 
> Can you change the README file to be named TODO to match all of the
> other staging driver files?  That way people can look at them by just
> doing a staging/*/TODO match.

Will do. Do you want a) an incremental patch, b) and updated branch to
pull from, or c) the whole series resend?


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH 00/27] staging: add driver for KS7010 based SDIO cards
  2016-05-11  6:06   ` Wolfram Sang
@ 2016-05-11  8:37     ` Greg KH
  2016-05-20  6:32       ` Wolfram Sang
  0 siblings, 1 reply; 32+ messages in thread
From: Greg KH @ 2016-05-11  8:37 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: driverdev-devel, linux-renesas-soc

On Wed, May 11, 2016 at 08:06:15AM +0200, Wolfram Sang wrote:
> On Tue, May 10, 2016 at 11:05:34PM +0200, Greg KH wrote:
> > On Tue, May 10, 2016 at 03:52:13PM +0200, Wolfram Sang wrote:
> > > This driver can be used with later Spectec SDW-821 and all SDW-823 cards.
> > > See patch 1 and README for more details about its origin. To have the card
> > > working, you need another patch which is already in mmc/next:
> > > 
> > > https://patchwork.kernel.org/patch/9043341/
> > > 
> > > A working topic branch for the Renesas H3 can be found here:
> > > 
> > > git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git renesas/topic/gen3-sdio
> > > 
> > > This series only can be found here:
> > > 
> > > git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git staging/ks7010
> > > 
> > > Note: I needed this driver to verify SDIO capabilities for the new Renesas H3
> > > SoC. The fact that the original KS7010 driver also comes from Renesas is a
> > > coincidence. It does not mean official support for this driver. Parts of this
> > > work were backed by the above mentioned SDIO verification task while other
> > > parts were my personal interest. Future patches and reviews will also done by
> > > me as a private person (unless something very surprising happens ;))
> > > 
> > > Please comment, review, apply...
> > 
> > Can you change the README file to be named TODO to match all of the
> > other staging driver files?  That way people can look at them by just
> > doing a staging/*/TODO match.
> 
> Will do. Do you want a) an incremental patch, b) and updated branch to
> pull from, or c) the whole series resend?

An add-on patch is probably easiest for everyone involved here.

thanks,

greg k-h

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

* [PATCH] staging: ks7010: rename README to TODO
  2016-05-10 13:52 [PATCH 00/27] staging: add driver for KS7010 based SDIO cards Wolfram Sang
                   ` (24 preceding siblings ...)
  2016-05-10 21:05 ` [PATCH 00/27] staging: add driver for KS7010 based SDIO cards Greg KH
@ 2016-05-11 12:49 ` Wolfram Sang
  2016-05-11 12:51 ` [PATCH v2] " Wolfram Sang
  2016-05-11 12:54 ` [PATCH] staging: ks7010: adapt to new trans_start handling Wolfram Sang
  27 siblings, 0 replies; 32+ messages in thread
From: Wolfram Sang @ 2016-05-11 12:49 UTC (permalink / raw)
  To: driverdev-devel; +Cc: Wolfram Sang, linux-renesas-soc

From: Wolfram Sang <wsa@sang-engineering.com>

To follow common pattern for staging/.

Signed-off-by: Wolfram Sang <wsa@sang-engineering.com>
---
 drivers/staging/ks7010/{README => TODO} | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename drivers/staging/ks7010/{README => TODO} (100%)

diff --git a/drivers/staging/ks7010/README b/drivers/staging/ks7010/TODO
similarity index 100%
rename from drivers/staging/ks7010/README
rename to drivers/staging/ks7010/TODO
-- 
2.8.1

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

* [PATCH v2] staging: ks7010: rename README to TODO
  2016-05-10 13:52 [PATCH 00/27] staging: add driver for KS7010 based SDIO cards Wolfram Sang
                   ` (25 preceding siblings ...)
  2016-05-11 12:49 ` [PATCH] staging: ks7010: rename README to TODO Wolfram Sang
@ 2016-05-11 12:51 ` Wolfram Sang
  2016-05-11 12:54 ` [PATCH] staging: ks7010: adapt to new trans_start handling Wolfram Sang
  27 siblings, 0 replies; 32+ messages in thread
From: Wolfram Sang @ 2016-05-11 12:51 UTC (permalink / raw)
  To: driverdev-devel; +Cc: Wolfram Sang, linux-renesas-soc

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

To follow common pattern for staging/.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---

Change in V2: correct authorship, sorry for the noise!

 drivers/staging/ks7010/{README => TODO} | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename drivers/staging/ks7010/{README => TODO} (100%)

diff --git a/drivers/staging/ks7010/README b/drivers/staging/ks7010/TODO
similarity index 100%
rename from drivers/staging/ks7010/README
rename to drivers/staging/ks7010/TODO
-- 
2.8.1

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

* [PATCH] staging: ks7010: adapt to new trans_start handling
  2016-05-10 13:52 [PATCH 00/27] staging: add driver for KS7010 based SDIO cards Wolfram Sang
                   ` (26 preceding siblings ...)
  2016-05-11 12:51 ` [PATCH v2] " Wolfram Sang
@ 2016-05-11 12:54 ` Wolfram Sang
  27 siblings, 0 replies; 32+ messages in thread
From: Wolfram Sang @ 2016-05-11 12:54 UTC (permalink / raw)
  To: driverdev-devel; +Cc: Wolfram Sang, linux-renesas-soc

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

trans_start is gone from netdevice, so use the new helper function to
set the mark.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---

This fixup is needed to build with linux/next because it contains a patch
dropping trans_start. But the new helper is not there in current linux master.

 drivers/staging/ks7010/ks_wlan_net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c
index 3e282833372305..ac3354bf6f8c8a 100644
--- a/drivers/staging/ks7010/ks_wlan_net.c
+++ b/drivers/staging/ks7010/ks_wlan_net.c
@@ -3398,7 +3398,7 @@ int ks_wlan_start_xmit(struct sk_buff *skb, struct net_device *dev)
 		netif_stop_queue(dev);
 
 	rc = hostif_data_request(priv, skb);
-	dev->trans_start = jiffies;
+	netif_trans_update(dev);
 
 	DPRINTK(4, "rc=%d\n", rc);
 	if (rc) {
-- 
2.8.1

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

* Re: [PATCH 00/27] staging: add driver for KS7010 based SDIO cards
  2016-05-11  8:37     ` Greg KH
@ 2016-05-20  6:32       ` Wolfram Sang
  0 siblings, 0 replies; 32+ messages in thread
From: Wolfram Sang @ 2016-05-20  6:32 UTC (permalink / raw)
  To: Greg KH; +Cc: driverdev-devel, linux-renesas-soc

[-- Attachment #1: Type: text/plain, Size: 148 bytes --]

Hi Greg,

> An add-on patch is probably easiest for everyone involved here.

Any chance for the new-driver-rule for this one?

Thanks,

   Wolfram


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

end of thread, other threads:[~2016-05-20  6:32 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-10 13:52 [PATCH 00/27] staging: add driver for KS7010 based SDIO cards Wolfram Sang
2016-05-10 13:52 ` [PATCH 02/27] staging: ks7010: remove non-SDIO code and #ifdefs Wolfram Sang
2016-05-10 13:52 ` [PATCH 03/27] staging: ks7010: remove custom firmware loader Wolfram Sang
2016-05-10 13:52 ` [PATCH 04/27] staging: ks7010: remove checks for WIRELESS_EXT version Wolfram Sang
2016-05-10 13:52 ` [PATCH 05/27] staging: ks7010: remove code for old kernel versions Wolfram Sang
2016-05-10 13:52 ` [PATCH 06/27] staging: ks7010: avoid workqueue races Wolfram Sang
2016-05-10 13:52 ` [PATCH 07/27] staging: ks7010: use long preamble as default Wolfram Sang
2016-05-10 13:52 ` [PATCH 08/27] staging: ks7010: use kernel helper to print buffer Wolfram Sang
2016-05-10 13:52 ` [PATCH 09/27] staging: ks7010: delete seperate debug header Wolfram Sang
2016-05-10 13:52 ` [PATCH 10/27] staging: ks7010: really iterate over multicast addresses Wolfram Sang
2016-05-10 13:52 ` [PATCH 11/27] staging: ks7010: make loading config file optional Wolfram Sang
2016-05-10 13:52 ` [PATCH 12/27] staging: ks7010: fix printk format warnings Wolfram Sang
2016-05-10 13:52 ` [PATCH 13/27] staging: ks7010: add example cfg file as a reference Wolfram Sang
2016-05-10 13:52 ` [PATCH 14/27] staging: ks7010: remove unecessary typedef Wolfram Sang
2016-05-10 13:52 ` [PATCH 15/27] staging: ks7010: indent eap_packet.h Wolfram Sang
2016-05-10 13:52 ` [PATCH 16/27] staging: ks7010: indent ks7010_config.c Wolfram Sang
2016-05-10 13:52 ` [PATCH 17/27] staging: ks7010: indent ks7010_sdio.h Wolfram Sang
2016-05-10 13:52 ` [PATCH 19/27] staging: ks7010: indent ks_hostif.h Wolfram Sang
2016-05-10 13:52 ` [PATCH 20/27] staging: ks7010: indent ks_wlan.h Wolfram Sang
2016-05-10 13:52 ` [PATCH 21/27] staging: ks7010: indent ks_wlan_ioctl.h Wolfram Sang
2016-05-10 13:52 ` [PATCH 23/27] staging: ks7010: indent michael_mic.c Wolfram Sang
2016-05-10 13:52 ` [PATCH 24/27] staging: ks7010: indent michael_mic.h Wolfram Sang
2016-05-10 13:52 ` [PATCH 25/27] staging: ks7010: indent ks7010_sdio.c Wolfram Sang
2016-05-10 13:52 ` [PATCH 26/27] staging: ks7010: remove supported card table with one element Wolfram Sang
2016-05-10 13:52 ` [PATCH 27/27] staging: ks7010: fix module annotations Wolfram Sang
2016-05-10 21:05 ` [PATCH 00/27] staging: add driver for KS7010 based SDIO cards Greg KH
2016-05-11  6:06   ` Wolfram Sang
2016-05-11  8:37     ` Greg KH
2016-05-20  6:32       ` Wolfram Sang
2016-05-11 12:49 ` [PATCH] staging: ks7010: rename README to TODO Wolfram Sang
2016-05-11 12:51 ` [PATCH v2] " Wolfram Sang
2016-05-11 12:54 ` [PATCH] staging: ks7010: adapt to new trans_start handling Wolfram Sang

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.