linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] staging: wilc1000: change enum variable name with lower case
@ 2015-11-03  7:20 Glen Lee
  2015-11-03  7:20 ` [PATCH 2/5] staging: wilc1000: send_config_pkt: use netdev print Glen Lee
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Glen Lee @ 2015-11-03  7:20 UTC (permalink / raw)
  To: gregkh
  Cc: devel, linux-wireless, tony.cho, glen.lee, leo.kim, austin.shin,
	adel.noureldin, adham.abozaeid, Nicolas.FERRE

This patch changes WID_TYPE with wid_type which is preferred style.

Signed-off-by: Glen Lee <glen.lee@atmel.com>
---
 drivers/staging/wilc1000/coreconfigurator.h | 2 +-
 drivers/staging/wilc1000/wilc_wlan_if.h     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h
index 1ea5f47..7545856 100644
--- a/drivers/staging/wilc1000/coreconfigurator.h
+++ b/drivers/staging/wilc1000/coreconfigurator.h
@@ -72,7 +72,7 @@ typedef enum {
 
 struct wid {
 	u16 id;
-	enum WID_TYPE type;
+	enum wid_type type;
 	s32 size;
 	s8 *val;
 };
diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h b/drivers/staging/wilc1000/wilc_wlan_if.h
index 1170169..be90558 100644
--- a/drivers/staging/wilc1000/wilc_wlan_if.h
+++ b/drivers/staging/wilc1000/wilc_wlan_if.h
@@ -312,7 +312,7 @@ typedef enum {
 	SW_TRIGGER_ABORT,
 } TX_ABORT_OPTION_T;
 
-enum WID_TYPE {
+enum wid_type {
 	WID_CHAR		= 0,
 	WID_SHORT		= 1,
 	WID_INT			= 2,
-- 
1.9.1


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

* [PATCH 2/5] staging: wilc1000: send_config_pkt: use netdev print
  2015-11-03  7:20 [PATCH 1/5] staging: wilc1000: change enum variable name with lower case Glen Lee
@ 2015-11-03  7:20 ` Glen Lee
  2015-11-03  7:21 ` [PATCH 3/5] staging: wilc1000: send_config_pkt: return linux error number Glen Lee
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Glen Lee @ 2015-11-03  7:20 UTC (permalink / raw)
  To: gregkh
  Cc: devel, linux-wireless, tony.cho, glen.lee, leo.kim, austin.shin,
	adel.noureldin, adham.abozaeid, Nicolas.FERRE

This patch use netdev_xxx print format instead of custom print api and printk.

Signed-off-by: Glen Lee <glen.lee@atmel.com>
---
 drivers/staging/wilc1000/coreconfigurator.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
index 74fb556..637e8ca 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -593,15 +593,16 @@ s32 send_config_pkt(struct net_device *dev, u8 mode, struct wid *wids,
 
 	if (mode == GET_CFG) {
 		for (counter = 0; counter < count; counter++) {
-			PRINT_INFO(CORECONFIG_DBG, "Sending CFG packet [%d][%d]\n", !counter,
-				   (counter == count - 1));
+			netdev_info(dev, "Sending CFG packet [%d][%d]\n",
+				    !counter, (counter == count - 1));
 			if (!wilc_wlan_cfg_get(dev,
 					       !counter,
 					       wids[counter].id,
 					       (counter == count - 1),
 					       drv)) {
 				ret = -1;
-				printk("[Sendconfigpkt]Get Timed out\n");
+				netdev_err(dev,
+					   "[Sendconfigpkt]Get Timed out\n");
 				break;
 			}
 		}
@@ -615,7 +616,8 @@ s32 send_config_pkt(struct net_device *dev, u8 mode, struct wid *wids,
 		}
 	} else if (mode == SET_CFG) {
 		for (counter = 0; counter < count; counter++) {
-			PRINT_D(CORECONFIG_DBG, "Sending config SET PACKET WID:%x\n", wids[counter].id);
+			netdev_info(dev, "Sending config SET PACKET WID:%x\n",
+				    wids[counter].id);
 			if (!wilc_wlan_cfg_set(dev,
 					       !counter,
 					       wids[counter].id,
@@ -624,7 +626,8 @@ s32 send_config_pkt(struct net_device *dev, u8 mode, struct wid *wids,
 					       (counter == count - 1),
 					       drv)) {
 				ret = -1;
-				printk("[Sendconfigpkt]Set Timed out\n");
+				netdev_err(dev,
+					   "[Sendconfigpkt]Set Timed out\n");
 				break;
 			}
 		}
-- 
1.9.1


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

* [PATCH 3/5] staging: wilc1000: send_config_pkt: return linux error number
  2015-11-03  7:20 [PATCH 1/5] staging: wilc1000: change enum variable name with lower case Glen Lee
  2015-11-03  7:20 ` [PATCH 2/5] staging: wilc1000: send_config_pkt: use netdev print Glen Lee
@ 2015-11-03  7:21 ` Glen Lee
  2015-11-03  7:21 ` [PATCH 4/5] staging: wilc1000: send_config_pkt: remove unnecessary blank line Glen Lee
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Glen Lee @ 2015-11-03  7:21 UTC (permalink / raw)
  To: gregkh
  Cc: devel, linux-wireless, tony.cho, glen.lee, leo.kim, austin.shin,
	adel.noureldin, adham.abozaeid, Nicolas.FERRE

Use proper linux error number instead of -1.

Signed-off-by: Glen Lee <glen.lee@atmel.com>
---
 drivers/staging/wilc1000/coreconfigurator.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
index 637e8ca..1842f8f 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -600,7 +600,7 @@ s32 send_config_pkt(struct net_device *dev, u8 mode, struct wid *wids,
 					       wids[counter].id,
 					       (counter == count - 1),
 					       drv)) {
-				ret = -1;
+				ret = -EBUSY;
 				netdev_err(dev,
 					   "[Sendconfigpkt]Get Timed out\n");
 				break;
@@ -625,7 +625,7 @@ s32 send_config_pkt(struct net_device *dev, u8 mode, struct wid *wids,
 					       wids[counter].size,
 					       (counter == count - 1),
 					       drv)) {
-				ret = -1;
+				ret = -EBUSY;
 				netdev_err(dev,
 					   "[Sendconfigpkt]Set Timed out\n");
 				break;
-- 
1.9.1


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

* [PATCH 4/5] staging: wilc1000: send_config_pkt: remove unnecessary blank line
  2015-11-03  7:20 [PATCH 1/5] staging: wilc1000: change enum variable name with lower case Glen Lee
  2015-11-03  7:20 ` [PATCH 2/5] staging: wilc1000: send_config_pkt: use netdev print Glen Lee
  2015-11-03  7:21 ` [PATCH 3/5] staging: wilc1000: send_config_pkt: return linux error number Glen Lee
@ 2015-11-03  7:21 ` Glen Lee
  2015-11-03  7:21 ` [PATCH 5/5] staging: wilc1000: move send_config_pkt to wilc_wlan.c Glen Lee
  2015-11-04 20:52 ` [PATCH 1/5] staging: wilc1000: change enum variable name with lower case Greg KH
  4 siblings, 0 replies; 6+ messages in thread
From: Glen Lee @ 2015-11-03  7:21 UTC (permalink / raw)
  To: gregkh
  Cc: devel, linux-wireless, tony.cho, glen.lee, leo.kim, austin.shin,
	adel.noureldin, adham.abozaeid, Nicolas.FERRE

This patch remove unnecessary blank line which is reported by checkpatch.pl

Signed-off-by: Glen Lee <glen.lee@atmel.com>
---
 drivers/staging/wilc1000/coreconfigurator.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
index 1842f8f..3ddbe23 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -612,7 +612,6 @@ s32 send_config_pkt(struct net_device *dev, u8 mode, struct wid *wids,
 					wids[counter].id,
 					wids[counter].val,
 					wids[counter].size);
-
 		}
 	} else if (mode == SET_CFG) {
 		for (counter = 0; counter < count; counter++) {
-- 
1.9.1


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

* [PATCH 5/5] staging: wilc1000: move send_config_pkt to wilc_wlan.c
  2015-11-03  7:20 [PATCH 1/5] staging: wilc1000: change enum variable name with lower case Glen Lee
                   ` (2 preceding siblings ...)
  2015-11-03  7:21 ` [PATCH 4/5] staging: wilc1000: send_config_pkt: remove unnecessary blank line Glen Lee
@ 2015-11-03  7:21 ` Glen Lee
  2015-11-04 20:52 ` [PATCH 1/5] staging: wilc1000: change enum variable name with lower case Greg KH
  4 siblings, 0 replies; 6+ messages in thread
From: Glen Lee @ 2015-11-03  7:21 UTC (permalink / raw)
  To: gregkh
  Cc: devel, linux-wireless, tony.cho, glen.lee, leo.kim, austin.shin,
	adel.noureldin, adham.abozaeid, Nicolas.FERRE

send_config_pkt function and it's related structure wid_type is moved to
wilc_wlan.c because wilc_wlan.c handle message transport. the coreconfigurator
is all about frames, so it will be frame.[ch] later.

Signed-off-by: Glen Lee <glen.lee@atmel.com>
---
 drivers/staging/wilc1000/coreconfigurator.c | 64 -----------------------------
 drivers/staging/wilc1000/coreconfigurator.h |  9 ----
 drivers/staging/wilc1000/wilc_wlan.c        | 49 ++++++++++++++++++++++
 drivers/staging/wilc1000/wilc_wlan.h        |  9 ++++
 4 files changed, 58 insertions(+), 73 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
index 3ddbe23..1caa66e 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -570,67 +570,3 @@ s32 DeallocateAssocRespInfo(tstrConnectRespInfo *pstrConnectRespInfo)
 
 	return s32Error;
 }
-
-/**
- *  @brief              sends certain Configuration Packet based on the input WIDs pstrWIDs
- *  using driver config layer
- *
- *  @details
- *  @param[in]  pstrWIDs WIDs to be sent in the configuration packet
- *  @param[in]  u32WIDsCount number of WIDs to be sent in the configuration packet
- *  @param[out]         pu8RxResp The received Packet Response
- *  @param[out]         ps32RxRespLen Length of the received Packet Response
- *  @return     Error code indicating success/failure
- *  @note
- *  @author	mabubakr
- *  @date		1 Mar 2012
- *  @version	1.0
- */
-s32 send_config_pkt(struct net_device *dev, u8 mode, struct wid *wids,
-		    u32 count, u32 drv)
-{
-	s32 counter = 0, ret = 0;
-
-	if (mode == GET_CFG) {
-		for (counter = 0; counter < count; counter++) {
-			netdev_info(dev, "Sending CFG packet [%d][%d]\n",
-				    !counter, (counter == count - 1));
-			if (!wilc_wlan_cfg_get(dev,
-					       !counter,
-					       wids[counter].id,
-					       (counter == count - 1),
-					       drv)) {
-				ret = -EBUSY;
-				netdev_err(dev,
-					   "[Sendconfigpkt]Get Timed out\n");
-				break;
-			}
-		}
-		counter = 0;
-		for (counter = 0; counter < count; counter++) {
-			wids[counter].size = wilc_wlan_cfg_get_val(
-					wids[counter].id,
-					wids[counter].val,
-					wids[counter].size);
-		}
-	} else if (mode == SET_CFG) {
-		for (counter = 0; counter < count; counter++) {
-			netdev_info(dev, "Sending config SET PACKET WID:%x\n",
-				    wids[counter].id);
-			if (!wilc_wlan_cfg_set(dev,
-					       !counter,
-					       wids[counter].id,
-					       wids[counter].val,
-					       wids[counter].size,
-					       (counter == count - 1),
-					       drv)) {
-				ret = -EBUSY;
-				netdev_err(dev,
-					   "[Sendconfigpkt]Set Timed out\n");
-				break;
-			}
-		}
-	}
-
-	return ret;
-}
diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h
index 7545856..7702a0f 100644
--- a/drivers/staging/wilc1000/coreconfigurator.h
+++ b/drivers/staging/wilc1000/coreconfigurator.h
@@ -70,13 +70,6 @@ typedef enum {
 	CONNECT_STS_FORCE_16_BIT = 0xFFFF
 } tenuConnectSts;
 
-struct wid {
-	u16 id;
-	enum wid_type type;
-	s32 size;
-	s8 *val;
-};
-
 typedef struct {
 	u8 u8Full;
 	u8 u8Index;
@@ -127,8 +120,6 @@ typedef struct {
 	size_t ie_len;
 } tstrDisconnectNotifInfo;
 
-s32 send_config_pkt(struct net_device *dev, u8 mode, struct wid *wids,
-		    u32 count, u32 drv);
 s32 parse_network_info(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo);
 s32 DeallocateNetworkInfo(tstrNetworkInfo *pstrNetworkInfo);
 
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 152dba5..44787b0 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -2104,3 +2104,52 @@ u16 set_machw_change_vir_if(struct net_device *dev, bool bValue)
 
 	return ret;
 }
+
+s32 send_config_pkt(struct net_device *dev, u8 mode, struct wid *wids,
+		    u32 count, u32 drv)
+{
+	s32 counter = 0, ret = 0;
+
+	if (mode == GET_CFG) {
+		for (counter = 0; counter < count; counter++) {
+			netdev_info(dev, "Sending CFG packet [%d][%d]\n",
+				    !counter, (counter == count - 1));
+			if (!wilc_wlan_cfg_get(dev,
+					       !counter,
+					       wids[counter].id,
+					       (counter == count - 1),
+					       drv)) {
+				ret = -EBUSY;
+				netdev_err(dev,
+					   "[Sendconfigpkt]Get Timed out\n");
+				break;
+			}
+		}
+		counter = 0;
+		for (counter = 0; counter < count; counter++) {
+			wids[counter].size = wilc_wlan_cfg_get_val(
+					wids[counter].id,
+					wids[counter].val,
+					wids[counter].size);
+		}
+	} else if (mode == SET_CFG) {
+		for (counter = 0; counter < count; counter++) {
+			netdev_info(dev, "Sending config SET PACKET WID:%x\n",
+				    wids[counter].id);
+			if (!wilc_wlan_cfg_set(dev,
+					       !counter,
+					       wids[counter].id,
+					       wids[counter].val,
+					       wids[counter].size,
+					       (counter == count - 1),
+					       drv)) {
+				ret = -EBUSY;
+				netdev_err(dev,
+					   "[Sendconfigpkt]Set Timed out\n");
+				break;
+			}
+		}
+	}
+
+	return ret;
+}
diff --git a/drivers/staging/wilc1000/wilc_wlan.h b/drivers/staging/wilc1000/wilc_wlan.h
index 73e01a7..e5dcea9 100644
--- a/drivers/staging/wilc1000/wilc_wlan.h
+++ b/drivers/staging/wilc1000/wilc_wlan.h
@@ -295,6 +295,13 @@ typedef struct {
 	u32 seq_no;
 } wilc_cfg_rsp_t;
 
+struct wid {
+	u16 id;
+	enum wid_type type;
+	s32 size;
+	s8 *val;
+};
+
 int wilc_wlan_firmware_download(struct net_device *dev, const u8 *buffer,
 				u32 buffer_size);
 int wilc_wlan_start(struct net_device *dev);
@@ -312,4 +319,6 @@ int wilc_wlan_cfg_get_val(u32 wid, u8 *buffer, u32 buffer_size);
 int wilc_wlan_txq_add_mgmt_pkt(struct net_device *dev, void *priv, u8 *buffer,
 			       u32 buffer_size, wilc_tx_complete_func_t func);
 void chip_sleep_manually(struct net_device *dev, u32 u32SleepTime);
+s32 send_config_pkt(struct net_device *dev, u8 mode, struct wid *wids,
+		    u32 count, u32 drv);
 #endif
-- 
1.9.1


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

* Re: [PATCH 1/5] staging: wilc1000: change enum variable name with lower case
  2015-11-03  7:20 [PATCH 1/5] staging: wilc1000: change enum variable name with lower case Glen Lee
                   ` (3 preceding siblings ...)
  2015-11-03  7:21 ` [PATCH 5/5] staging: wilc1000: move send_config_pkt to wilc_wlan.c Glen Lee
@ 2015-11-04 20:52 ` Greg KH
  4 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2015-11-04 20:52 UTC (permalink / raw)
  To: Glen Lee
  Cc: devel, linux-wireless, tony.cho, leo.kim, austin.shin,
	adel.noureldin, adham.abozaeid, Nicolas.FERRE

On Tue, Nov 03, 2015 at 04:20:58PM +0900, Glen Lee wrote:
> This patch changes WID_TYPE with wid_type which is preferred style.
> 
> Signed-off-by: Glen Lee <glen.lee@atmel.com>
> ---
>  drivers/staging/wilc1000/coreconfigurator.h | 2 +-
>  drivers/staging/wilc1000/wilc_wlan_if.h     | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)

Some of these patches applied, some did not, please refresh and resend
the ones I didn't take.

thanks,

greg k-h

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

end of thread, other threads:[~2015-11-04 20:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-03  7:20 [PATCH 1/5] staging: wilc1000: change enum variable name with lower case Glen Lee
2015-11-03  7:20 ` [PATCH 2/5] staging: wilc1000: send_config_pkt: use netdev print Glen Lee
2015-11-03  7:21 ` [PATCH 3/5] staging: wilc1000: send_config_pkt: return linux error number Glen Lee
2015-11-03  7:21 ` [PATCH 4/5] staging: wilc1000: send_config_pkt: remove unnecessary blank line Glen Lee
2015-11-03  7:21 ` [PATCH 5/5] staging: wilc1000: move send_config_pkt to wilc_wlan.c Glen Lee
2015-11-04 20:52 ` [PATCH 1/5] staging: wilc1000: change enum variable name with lower case Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).