[PATCH RESEND 10/10] staging: wilc1000: removes linux_wlan_common.h file

2016-02-21 Thread Leo Kim
From: Chris Park 

This patch removes linux_wlan_common.h file and also removes the following
preprocessor at files that include it:
 - #include 'linux_wlan_common.h'

Signed-off-by: Chris Park 
Signed-off-by: Leo Kim 
---
 drivers/staging/wilc1000/linux_mon.c | 1 -
 drivers/staging/wilc1000/linux_wlan.c| 1 -
 drivers/staging/wilc1000/linux_wlan_common.h | 3 ---
 drivers/staging/wilc1000/wilc_msgqueue.c | 1 -
 drivers/staging/wilc1000/wilc_spi.c  | 1 -
 drivers/staging/wilc1000/wilc_wlan_if.h  | 1 -
 6 files changed, 8 deletions(-)
 delete mode 100644 drivers/staging/wilc1000/linux_wlan_common.h

diff --git a/drivers/staging/wilc1000/linux_mon.c 
b/drivers/staging/wilc1000/linux_mon.c
index 6347471..7d9e5de 100644
--- a/drivers/staging/wilc1000/linux_mon.c
+++ b/drivers/staging/wilc1000/linux_mon.c
@@ -7,7 +7,6 @@
  *  @version   1.0
  */
 #include "wilc_wfi_cfgoperations.h"
-#include "linux_wlan_common.h"
 #include "wilc_wlan_if.h"
 #include "wilc_wlan.h"
 
diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index 912e8ec..eafde6f 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -1,5 +1,4 @@
 #include "wilc_wfi_cfgoperations.h"
-#include "linux_wlan_common.h"
 #include "wilc_wlan_if.h"
 #include "wilc_wlan.h"
 
diff --git a/drivers/staging/wilc1000/linux_wlan_common.h 
b/drivers/staging/wilc1000/linux_wlan_common.h
deleted file mode 100644
index 18d902b..000
--- a/drivers/staging/wilc1000/linux_wlan_common.h
+++ /dev/null
@@ -1,3 +0,0 @@
-#ifndef LINUX_WLAN_COMMON_H
-#define LINUX_WLAN_COMMON_H
-#endif
diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c 
b/drivers/staging/wilc1000/wilc_msgqueue.c
index 780ddd3..6cb894e 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -1,7 +1,6 @@
 
 #include "wilc_msgqueue.h"
 #include 
-#include "linux_wlan_common.h"
 #include 
 #include 
 
diff --git a/drivers/staging/wilc1000/wilc_spi.c 
b/drivers/staging/wilc1000/wilc_spi.c
index b55a0c3f..eb1e76d 100644
--- a/drivers/staging/wilc1000/wilc_spi.c
+++ b/drivers/staging/wilc1000/wilc_spi.c
@@ -18,7 +18,6 @@
 #include 
 #include 
 
-#include "linux_wlan_common.h"
 #include 
 #include "wilc_wlan_if.h"
 #include "wilc_wlan.h"
diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h 
b/drivers/staging/wilc1000/wilc_wlan_if.h
index c33f7a6..fbe34eb 100644
--- a/drivers/staging/wilc1000/wilc_wlan_if.h
+++ b/drivers/staging/wilc1000/wilc_wlan_if.h
@@ -11,7 +11,6 @@
 #define WILC_WLAN_IF_H
 
 #include 
-#include "linux_wlan_common.h"
 #include 
 
 /
-- 
1.9.1

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


[PATCH RESEND 09/10] staging: wilc1000: remove useless define in linux_wlan_common.h file

2016-02-21 Thread Leo Kim
From: Chris Park 

This patch removes useless define in linux_wlan_common.h file

Signed-off-by: Chris Park 
Signed-off-by: Leo Kim 
---
 drivers/staging/wilc1000/linux_wlan_common.h | 32 
 1 file changed, 32 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan_common.h 
b/drivers/staging/wilc1000/linux_wlan_common.h
index 37848c0..18d902b 100644
--- a/drivers/staging/wilc1000/linux_wlan_common.h
+++ b/drivers/staging/wilc1000/linux_wlan_common.h
@@ -1,35 +1,3 @@
 #ifndef LINUX_WLAN_COMMON_H
 #define LINUX_WLAN_COMMON_H
-
-#if defined(BEAGLE_BOARD)
-   #define SPI_CHANNEL 4
-
-   #if SPI_CHANNEL == 4
-   #define MODALIAS"wilc_spi4"
-   #define GPIO_NUM162
-   #else
-   #define MODALIAS"wilc_spi3"
-   #define GPIO_NUM133
-   #endif
-#elif defined(PLAT_WMS8304) /* rachel */
-   #define MODALIAS"wilc_spi"
-   #define GPIO_NUM139
-#elif defined(PLAT_RK)
- #define MODALIAS  "WILC_IRQ"
- #define GPIO_NUM  RK30_PIN3_PD2 /* RK30_PIN3_PA1 */
-/* RK30_PIN3_PD2 */
-/* RK2928_PIN1_PA7 */
-
-#elif defined(CUSTOMER_PLATFORM)
-/*
- TODO : specify MODALIAS name and GPIO number. This is certainly necessary for 
SPI interface.
- *
- * ex)
- * #define MODALIAS  "WILC_SPI"
- * #define GPIO_NUM  139
- */
-
-#else
-/* base on SAMA5D3_Xplained Board */
-#endif
 #endif
-- 
1.9.1

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


[PATCH RESEND 08/10] staging: wilc1000: move MODALIS and GPIO_NUM define to wilc_wlan.h file

2016-02-21 Thread Leo Kim
From: Chris Park 

This patch moves MODALIS and GPIO_NUM define to wilc_wlan.h file.
MODALIS and GPIO_NUM define are used to two files (wilc_sdio.c,
wilc_spi.c), these files already include wilc_wlan.h file in common.

Signed-off-by: Chris Park 
Signed-off-by: Leo Kim 
---
 drivers/staging/wilc1000/linux_wlan_common.h | 2 --
 drivers/staging/wilc1000/wilc_wlan.h | 2 ++
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan_common.h 
b/drivers/staging/wilc1000/linux_wlan_common.h
index 5a53512..37848c0 100644
--- a/drivers/staging/wilc1000/linux_wlan_common.h
+++ b/drivers/staging/wilc1000/linux_wlan_common.h
@@ -31,7 +31,5 @@
 
 #else
 /* base on SAMA5D3_Xplained Board */
-   #define MODALIAS"WILC_SPI"
-   #define GPIO_NUM0x44
 #endif
 #endif
diff --git a/drivers/staging/wilc1000/wilc_wlan.h 
b/drivers/staging/wilc1000/wilc_wlan.h
index 792d338..bcd4bfa 100644
--- a/drivers/staging/wilc1000/wilc_wlan.h
+++ b/drivers/staging/wilc1000/wilc_wlan.h
@@ -131,6 +131,8 @@
 #define LINUX_RX_SIZE  (96 * 1024)
 #define LINUX_TX_SIZE  (64 * 1024)
 
+#define MODALIAS   "WILC_SPI"
+#define GPIO_NUM   0x44
 /***/
 /*E0 and later Interrupt flags.*/
 /***/
-- 
1.9.1

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


[PATCH RESEND 07/10] staging: wilc1000: move WILC_MULTICAST_TABLE_SIZE define to wilc_wlan_if.h file

2016-02-21 Thread Leo Kim
From: Chris Park 

This patch moves WILC_MULTICAST_TABLE_SIZE define to wilc_wlan_if.h file.
This define is used to three files(host_interface.c,host_interface.h,
linux_wlan.c) these files already include wilc_wlan_if.h file in common.

Signed-off-by: Chris Park 
Signed-off-by: Leo Kim 
---
 drivers/staging/wilc1000/linux_wlan_common.h | 2 --
 drivers/staging/wilc1000/wilc_wlan_if.h  | 2 +-
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan_common.h 
b/drivers/staging/wilc1000/linux_wlan_common.h
index aa2c026..5a53512 100644
--- a/drivers/staging/wilc1000/linux_wlan_common.h
+++ b/drivers/staging/wilc1000/linux_wlan_common.h
@@ -1,8 +1,6 @@
 #ifndef LINUX_WLAN_COMMON_H
 #define LINUX_WLAN_COMMON_H
 
-#define WILC_MULTICAST_TABLE_SIZE  8
-
 #if defined(BEAGLE_BOARD)
#define SPI_CHANNEL 4
 
diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h 
b/drivers/staging/wilc1000/wilc_wlan_if.h
index 269c56e..c33f7a6 100644
--- a/drivers/staging/wilc1000/wilc_wlan_if.h
+++ b/drivers/staging/wilc1000/wilc_wlan_if.h
@@ -95,7 +95,7 @@ typedef void (*wilc_tx_complete_func_t)(void *, int);
  *  Wlan Configuration ID
  *
  /
-
+#define WILC_MULTICAST_TABLE_SIZE  8
 #define MAX_SSID_LEN33
 #define MAX_RATES_SUPPORTED 12
 
-- 
1.9.1

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


[PATCH RESEND 04/10] staging: wilc1000: removes unnecessary wilc_debug print log

2016-02-21 Thread Leo Kim
This patch removes unnecessary wilc_debug print log.
The print log was written when if condition fail.
The condition is chip-id check function.
Also, replaces this condition with normal function.

Signed-off-by: Leo Kim 
---
 drivers/staging/wilc1000/wilc_wlan.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan.c 
b/drivers/staging/wilc1000/wilc_wlan.c
index f0ac47f..34018a1 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -502,9 +502,7 @@ void chip_wakeup(struct wilc *wilc)
 
do {
usleep_range(2 * 1000, 2 * 1000);
-   if ((wilc_get_chipid(wilc, true) == 0))
-   wilc_debug(N_ERR, "Couldn't read chip 
id. Wake up failed\n");
-
+   wilc_get_chipid(wilc, true);
} while ((wilc_get_chipid(wilc, true) == 0) && 
((++trials % 3) == 0));
 
} while (wilc_get_chipid(wilc, true) == 0);
-- 
1.9.1

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


[PATCH RESEND 05/10] staging: wilc1000: removes unnecessary variable of wilc_mac_cfg_t structure

2016-02-21 Thread Leo Kim
This patch removes unnecessary variable of wilc_mac_cfg_t structure.
The variable is debug print function pointer.
Removes all what used this variable.

Signed-off-by: Leo Kim 
---
 drivers/staging/wilc1000/wilc_wlan_cfg.c | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan_cfg.c 
b/drivers/staging/wilc1000/wilc_wlan_cfg.c
index 56455f4..deff886 100644
--- a/drivers/staging/wilc1000/wilc_wlan_cfg.c
+++ b/drivers/staging/wilc1000/wilc_wlan_cfg.c
@@ -20,8 +20,6 @@
  /
 
 struct wilc_mac_cfg {
-   wilc_debug_func dPrint;
-
int mac_status;
u8 mac_address[7];
u8 ip_address[5];
@@ -389,8 +387,6 @@ int wilc_wlan_cfg_set_wid(u8 *frame, u32 offset, u16 id, u8 
*buf, int size)
ret = wilc_wlan_cfg_set_str(frame, offset, id, buf, size);
} else if (type == 4) { /* binary command */
ret = wilc_wlan_cfg_set_bin(frame, offset, id, buf, size);
-   } else {
-   g_mac.dPrint(N_ERR, "illegal id\n");
}
 
return ret;
@@ -481,8 +477,6 @@ int wilc_wlan_cfg_get_wid_value(u16 wid, u8 *buffer, u32 
buffer_size)
}
i++;
} while (1);
-   } else {
-   g_mac.dPrint(N_ERR, "[CFG]: illegal type (%08x)\n", wid);
}
 
return ret;
@@ -540,6 +534,5 @@ int wilc_wlan_cfg_indicate_rx(struct wilc *wilc, u8 *frame, 
int size,
 int wilc_wlan_cfg_init(wilc_debug_func func)
 {
memset((void *)_mac, 0, sizeof(struct wilc_mac_cfg));
-   g_mac.dPrint = func;
return 1;
 }
-- 
1.9.1

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


[PATCH RESEND 06/10] staging: wilc1000: wilc_wlan_cfg_init: changes unused argument

2016-02-21 Thread Leo Kim
This patch changes the argument of the wilc_wlan_cfg_init function,
wilc_debug to void type because wilc_debug function is not used any more.
In addition, finally removes wilc_debug and related variables.

Signed-off-by: Leo Kim 
---
 drivers/staging/wilc1000/wilc_wlan.c | 17 +
 drivers/staging/wilc1000/wilc_wlan_cfg.c |  2 +-
 drivers/staging/wilc1000/wilc_wlan_cfg.h |  2 +-
 3 files changed, 3 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan.c 
b/drivers/staging/wilc1000/wilc_wlan.c
index 34018a1..d50ddc6 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -3,21 +3,6 @@
 #include "wilc_wfi_netdevice.h"
 #include "wilc_wlan_cfg.h"
 
-static u32 dbgflag = N_INIT | N_ERR | N_INTR | N_TXQ | N_RXQ;
-
-/* FIXME: replace with dev_debug() */
-static void wilc_debug(u32 flag, char *fmt, ...)
-{
-   char buf[256];
-   va_list args;
-
-   if (flag & dbgflag) {
-   va_start(args, fmt);
-   vsprintf(buf, fmt, args);
-   va_end(args);
-   }
-}
-
 static CHIP_PS_STATE_T chip_ps_state = CHIP_WAKEDUP;
 
 static inline void acquire_bus(struct wilc *wilc, BUS_ACQUIRE_T acquire)
@@ -1448,7 +1433,7 @@ int wilc_wlan_init(struct net_device *dev)
goto _fail_;
}
 
-   if (!wilc_wlan_cfg_init(wilc_debug)) {
+   if (!wilc_wlan_cfg_init()) {
ret = -ENOBUFS;
goto _fail_;
}
diff --git a/drivers/staging/wilc1000/wilc_wlan_cfg.c 
b/drivers/staging/wilc1000/wilc_wlan_cfg.c
index deff886..b992243 100644
--- a/drivers/staging/wilc1000/wilc_wlan_cfg.c
+++ b/drivers/staging/wilc1000/wilc_wlan_cfg.c
@@ -531,7 +531,7 @@ int wilc_wlan_cfg_indicate_rx(struct wilc *wilc, u8 *frame, 
int size,
return ret;
 }
 
-int wilc_wlan_cfg_init(wilc_debug_func func)
+int wilc_wlan_cfg_init(void)
 {
memset((void *)_mac, 0, sizeof(struct wilc_mac_cfg));
return 1;
diff --git a/drivers/staging/wilc1000/wilc_wlan_cfg.h 
b/drivers/staging/wilc1000/wilc_wlan_cfg.h
index 9b74cc3..b8641a2 100644
--- a/drivers/staging/wilc1000/wilc_wlan_cfg.h
+++ b/drivers/staging/wilc1000/wilc_wlan_cfg.h
@@ -36,6 +36,6 @@ int wilc_wlan_cfg_get_wid(u8 *frame, u32 offset, u16 id);
 int wilc_wlan_cfg_get_wid_value(u16 wid, u8 *buffer, u32 buffer_size);
 int wilc_wlan_cfg_indicate_rx(struct wilc *wilc, u8 *frame, int size,
  struct wilc_cfg_rsp *rsp);
-int wilc_wlan_cfg_init(wilc_debug_func func);
+int wilc_wlan_cfg_init(void);
 
 #endif
-- 
1.9.1

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


Re: [PATCH] staging: xgifb: Fix comment style

2016-02-21 Thread Bo YU
Hi,
On Sun, Feb 21, 2016 at 11:33:48AM -0800, Kroah-Hartman wrote:
>On Sun, Feb 21, 2016 at 04:59:17PM +0800, Bo YU wrote:
>> Hello,
>>
>> On Sat, Feb 20, 2016 at 03:38:15PM -0800, Kroah-Hartman wrote:

>> >Patch doesn't apply :(
>> I don't know that whether i am doing wrong something with git.
>> Because when i run `git am the-codingfixed-patch` ,it reports error.
>
>Yes, that is the problem, please work on fixing that.  I don't have the
>time to determine exactly what the error is, sorry.
>
I will fix that :)
Thanks a lot for your patience and help.
>greg k-h

--
Best Regards
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH V3 24/24] staging: wilc1000: moves LINUX_RX_SIZE, LINUX_TX_SIZE

2016-02-21 Thread Leo Kim
From: Chris Park 

This patch moves LINUX_RX_SIZE and LINUX_TX_SIZE to wilc_wlan.h file
because there are only used to wilc_wlan.c file.

Signed-off-by: Chris Park 
Signed-off-by: Leo Kim 
---
 drivers/staging/wilc1000/linux_wlan_common.h | 4 
 drivers/staging/wilc1000/wilc_wlan.h | 3 +++
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan_common.h 
b/drivers/staging/wilc1000/linux_wlan_common.h
index 51601aa..aa2c026 100644
--- a/drivers/staging/wilc1000/linux_wlan_common.h
+++ b/drivers/staging/wilc1000/linux_wlan_common.h
@@ -1,10 +1,6 @@
 #ifndef LINUX_WLAN_COMMON_H
 #define LINUX_WLAN_COMMON_H
 
-#define LINUX_RX_SIZE  (96 * 1024)
-#define LINUX_TX_SIZE  (64 * 1024)
-
-
 #define WILC_MULTICAST_TABLE_SIZE  8
 
 #if defined(BEAGLE_BOARD)
diff --git a/drivers/staging/wilc1000/wilc_wlan.h 
b/drivers/staging/wilc1000/wilc_wlan.h
index 06d02ab..792d338 100644
--- a/drivers/staging/wilc1000/wilc_wlan.h
+++ b/drivers/staging/wilc1000/wilc_wlan.h
@@ -128,6 +128,9 @@
 #define WILC_PLL_TO_SPI2
 #define ABORT_INT  BIT(31)
 
+#define LINUX_RX_SIZE  (96 * 1024)
+#define LINUX_TX_SIZE  (64 * 1024)
+
 /***/
 /*E0 and later Interrupt flags.*/
 /***/
-- 
1.9.1

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


[PATCH V3 23/24] staging: wilc1000: moves to define values

2016-02-21 Thread Leo Kim
From: Chris Park 

This patch moves DEBUG, INFO, WRN and ERR values to wilc_debugfs.c file
because this is only used to wilc_debugfs.c file.
And, removes unnecessary WILC_DEBUGFS and else-case variables.

Signed-off-by: Chris Park 
Signed-off-by: Leo Kim 
---
 drivers/staging/wilc1000/linux_wlan_common.h | 11 ---
 drivers/staging/wilc1000/wilc_debugfs.c  |  4 
 2 files changed, 4 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan_common.h 
b/drivers/staging/wilc1000/linux_wlan_common.h
index 2e2109c..51601aa 100644
--- a/drivers/staging/wilc1000/linux_wlan_common.h
+++ b/drivers/staging/wilc1000/linux_wlan_common.h
@@ -1,17 +1,6 @@
 #ifndef LINUX_WLAN_COMMON_H
 #define LINUX_WLAN_COMMON_H
 
-#if defined(WILC_DEBUGFS)
-#define DEBUG   BIT(0)
-#define INFOBIT(1)
-#define WRN BIT(2)
-#define ERR BIT(3)
-#else
-#define DEBUG   1
-#define INFO0
-#define WRN 0
-#endif
-
 #define LINUX_RX_SIZE  (96 * 1024)
 #define LINUX_TX_SIZE  (64 * 1024)
 
diff --git a/drivers/staging/wilc1000/wilc_debugfs.c 
b/drivers/staging/wilc1000/wilc_debugfs.c
index 215e2f0..fcbc95d 100644
--- a/drivers/staging/wilc1000/wilc_debugfs.c
+++ b/drivers/staging/wilc1000/wilc_debugfs.c
@@ -23,6 +23,10 @@ static struct dentry *wilc_dir;
 /*
  * 

  */
+#define DEBUG   BIT(0)
+#define INFOBIT(1)
+#define WRN BIT(2)
+#define ERR BIT(3)
 
 #define DBG_LEVEL_ALL  (DEBUG | INFO | WRN | ERR)
 atomic_t WILC_DEBUG_LEVEL = ATOMIC_INIT(ERR);
-- 
1.9.1

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


[PATCH V3 22/24] staging: wilc1000: removes usused PRINT_XX(region...)

2016-02-21 Thread Leo Kim
From: Chris Park 

This patch removes unused PRINT_XX(region...)
because already removed in used to region feature of whole wilc source.
Also, removes unnecessary related region extern variable.

Signed-off-by: Chris Park 
Signed-off-by: Leo Kim 
---
 drivers/staging/wilc1000/linux_wlan_common.h | 69 
 1 file changed, 69 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan_common.h 
b/drivers/staging/wilc1000/linux_wlan_common.h
index 57d3901..2e2109c 100644
--- a/drivers/staging/wilc1000/linux_wlan_common.h
+++ b/drivers/staging/wilc1000/linux_wlan_common.h
@@ -2,83 +2,14 @@
 #define LINUX_WLAN_COMMON_H
 
 #if defined(WILC_DEBUGFS)
-extern atomic_t WILC_DEBUG_LEVEL;
-
 #define DEBUG   BIT(0)
 #define INFOBIT(1)
 #define WRN BIT(2)
 #define ERR BIT(3)
-
-#define PRINT_D(region, ...)   \
-   do {\
-   if ((atomic_read(_DEBUG_LEVEL) & DEBUG)) { \
-   printk("DBG [%s: %d]", __func__, __LINE__); \
-   printk(__VA_ARGS__);\
-   }   \
-   } while (0)
-
-#define PRINT_INFO(region, ...)
\
-   do {\
-   if ((atomic_read(_DEBUG_LEVEL) & INFO)) {  \
-   printk("INFO [%s]", __func__);  \
-   printk(__VA_ARGS__);\
-   }   \
-   } while (0)
-
-#define PRINT_WRN(region, ...) \
-   do {\
-   if ((atomic_read(_DEBUG_LEVEL) & WRN)) {   \
-   printk("WRN [%s: %d]", __func__, __LINE__); \
-   printk(__VA_ARGS__);\
-   }   \
-   } while (0)
-
-#define PRINT_ER(...)  \
-   do {\
-   if ((atomic_read(_DEBUG_LEVEL) & ERR)) {   \
-   printk("ERR [%s: %d]", __func__, __LINE__); \
-   printk(__VA_ARGS__);\
-   }   \
-   } while (0)
-
 #else
-
-#define REGION  (INIT_DBG | GENERIC_DBG | CFG80211_DBG | FIRM_DBG | 
HOSTAPD_DBG)
-
 #define DEBUG   1
 #define INFO0
 #define WRN 0
-
-#define PRINT_D(region, ...)   \
-   do {\
-   if (DEBUG == 1 && ((REGION)&(region))) {\
-   printk("DBG [%s: %d]", __func__, __LINE__); \
-   printk(__VA_ARGS__);\
-   }   \
-   } while (0)
-
-#define PRINT_INFO(region, ...)
\
-   do {\
-   if (INFO == 1 && ((REGION)&(region))) { \
-   printk("INFO [%s]", __func__);  \
-   printk(__VA_ARGS__);\
-   }   \
-   } while (0)
-
-#define PRINT_WRN(region, ...) \
-   do {\
-   if (WRN == 1 && ((REGION)&(region))) {  \
-   printk("WRN [%s: %d]", __func__, __LINE__); \
-   printk(__VA_ARGS__);\
-   }   \
-   } while (0)
-
-#define PRINT_ER(...)  \
-   do {\
-   printk("ERR [%s: %d]", __func__, __LINE__); \
-   printk(__VA_ARGS__);\
-   } while (0)
-
 #endif
 
 #define LINUX_RX_SIZE  (96 * 1024)
-- 
1.9.1

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


[PATCH V3 21/24] staging: wilc1000: removes unused region feature

2016-02-21 Thread Leo Kim
From: Chris Park 

This patch removes unused region feature on debug message.
Also, removes the functions of related in this feature.

Signed-off-by: Chris Park 
Signed-off-by: Leo Kim 
---
 drivers/staging/wilc1000/linux_wlan_common.h | 17 ++-
 drivers/staging/wilc1000/wilc_debugfs.c  | 42 
 2 files changed, 3 insertions(+), 56 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan_common.h 
b/drivers/staging/wilc1000/linux_wlan_common.h
index e408631..57d3901 100644
--- a/drivers/staging/wilc1000/linux_wlan_common.h
+++ b/drivers/staging/wilc1000/linux_wlan_common.h
@@ -1,15 +1,7 @@
 #ifndef LINUX_WLAN_COMMON_H
 #define LINUX_WLAN_COMMON_H
 
-enum debug_region {
-   Init_debug = 0,
-   COMP = 0x,
-};
-
-#define INIT_DBG(1 << Init_debug)
-
 #if defined(WILC_DEBUGFS)
-extern atomic_t WILC_REGION;
 extern atomic_t WILC_DEBUG_LEVEL;
 
 #define DEBUG   BIT(0)
@@ -19,8 +11,7 @@ extern atomic_t WILC_DEBUG_LEVEL;
 
 #define PRINT_D(region, ...)   \
do {\
-   if ((atomic_read(_DEBUG_LEVEL) & DEBUG) && \
-  ((atomic_read(_REGION)) & (region))) {  \
+   if ((atomic_read(_DEBUG_LEVEL) & DEBUG)) { \
printk("DBG [%s: %d]", __func__, __LINE__); \
printk(__VA_ARGS__);\
}   \
@@ -28,8 +19,7 @@ extern atomic_t WILC_DEBUG_LEVEL;
 
 #define PRINT_INFO(region, ...)
\
do {\
-   if ((atomic_read(_DEBUG_LEVEL) & INFO) &&  \
-  ((atomic_read(_REGION)) & (region))) {  \
+   if ((atomic_read(_DEBUG_LEVEL) & INFO)) {  \
printk("INFO [%s]", __func__);  \
printk(__VA_ARGS__);\
}   \
@@ -37,8 +27,7 @@ extern atomic_t WILC_DEBUG_LEVEL;
 
 #define PRINT_WRN(region, ...) \
do {\
-   if ((atomic_read(_DEBUG_LEVEL) & WRN) &&   \
-  ((atomic_read(_REGION)) & (region))) {  \
+   if ((atomic_read(_DEBUG_LEVEL) & WRN)) {   \
printk("WRN [%s: %d]", __func__, __LINE__); \
printk(__VA_ARGS__);\
}   \
diff --git a/drivers/staging/wilc1000/wilc_debugfs.c 
b/drivers/staging/wilc1000/wilc_debugfs.c
index 266d96b..215e2f0 100644
--- a/drivers/staging/wilc1000/wilc_debugfs.c
+++ b/drivers/staging/wilc1000/wilc_debugfs.c
@@ -24,10 +24,7 @@ static struct dentry *wilc_dir;
  * 

  */
 
-#define DBG_REGION_ALL (INIT_DBG)
 #define DBG_LEVEL_ALL  (DEBUG | INFO | WRN | ERR)
-atomic_t WILC_REGION = ATOMIC_INIT(INIT_DBG);
-EXPORT_SYMBOL_GPL(WILC_REGION);
 atomic_t WILC_DEBUG_LEVEL = ATOMIC_INIT(ERR);
 EXPORT_SYMBOL_GPL(WILC_DEBUG_LEVEL);
 
@@ -75,44 +72,6 @@ static ssize_t wilc_debug_level_write(struct file *filp, 
const char __user *buf,
return count;
 }
 
-static ssize_t wilc_debug_region_read(struct file *file, char __user *userbuf, 
size_t count, loff_t *ppos)
-{
-   char buf[128];
-   int res = 0;
-
-   /* only allow read from start */
-   if (*ppos > 0)
-   return 0;
-
-   res = scnprintf(buf, sizeof(buf), "Debug region: %x\n", 
atomic_read(_REGION));
-
-   return simple_read_from_buffer(userbuf, count, ppos, buf, res);
-}
-
-static ssize_t wilc_debug_region_write(struct file *filp, const char __user 
*buf, size_t count, loff_t *ppos)
-{
-   char buffer[128] = {};
-   int flag;
-
-   if (count > sizeof(buffer))
-   return -EINVAL;
-
-   if (copy_from_user(buffer, buf, count))
-   return -EFAULT;
-
-   flag = buffer[0] - '0';
-
-   if (flag > DBG_REGION_ALL) {
-   printk("%s, value (0x%08x) is out of range, stay previous flag 
(0x%08x)\n", __func__, flag, atomic_read(_REGION));
-   return -EFAULT;
-   }
-
-   atomic_set(_REGION, (int)flag);
-   printk("new debug-region is %x\n", atomic_read(_REGION));
-
-   return count;
-}
-
 /*
  * 

  */
@@ -134,7 +93,6 @@ struct wilc_debugfs_info_t {
 
 static struct wilc_debugfs_info_t debugfs_info[] = {
{ "wilc_debug_level",   0666,   (DEBUG | ERR), FOPS(NULL, 
wilc_debug_level_read, 

[PATCH V3 20/24] staging: wilc1000: wilc_wlan.c: removes unnecessary log messages

2016-02-21 Thread Leo Kim
From: Chris Park 

This patch removes unnecessary log messages.

Signed-off-by: Chris Park 
Signed-off-by: Leo Kim 
---
 drivers/staging/wilc1000/wilc_wlan.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan.c 
b/drivers/staging/wilc1000/wilc_wlan.c
index c6d206d..e7ae359 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -1022,7 +1022,6 @@ int wilc_wlan_firmware_download(struct wilc *wilc, const 
u8 *buffer,
ret = -EIO;
goto _fail_;
}
-   PRINT_D(INIT_DBG, "Offset = %d\n", offset);
} while (offset < buffer_size);
 
 _fail_:
@@ -1449,8 +1448,6 @@ int wilc_wlan_init(struct net_device *dev)
 
wilc = vif->wilc;
 
-   PRINT_D(INIT_DBG, "Initializing WILC_Wlan ...\n");
-
wilc->quit = 0;
 
if (!wilc->hif_func->hif_init(wilc, false)) {
-- 
1.9.1

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


[PATCH V3 19/24] staging: wilc1000: wilc_wfi_cfgoperations.c: removes unnecessary log messages

2016-02-21 Thread Leo Kim
From: Chris Park 

This patch removes unnecessary log messages.

Signed-off-by: Chris Park 
Signed-off-by: Leo Kim 
---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 14 +++---
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 75a45df..a7aa3d2 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -2315,7 +2315,6 @@ int wilc_init_host_int(struct net_device *net)
 
struct wilc_priv *priv;
 
-   PRINT_D(INIT_DBG, "Host[%p][%p]\n", net, net->ieee80211_ptr);
priv = wdev_priv(net->ieee80211_ptr);
if (op_ifcs == 0) {
setup_timer(, remove_network_from_shadow, 0);
@@ -2364,24 +2363,17 @@ int wilc_deinit_host_int(struct net_device *net)
 
 void wilc_free_wiphy(struct net_device *net)
 {
-   if (!net) {
-   PRINT_D(INIT_DBG, "net_device is NULL\n");
+   if (!net)
return;
-   }
 
-   if (!net->ieee80211_ptr) {
-   PRINT_D(INIT_DBG, "ieee80211_ptr is NULL\n");
+   if (!net->ieee80211_ptr)
return;
-   }
 
-   if (!net->ieee80211_ptr->wiphy) {
-   PRINT_D(INIT_DBG, "wiphy is NULL\n");
+   if (!net->ieee80211_ptr->wiphy)
return;
-   }
 
wiphy_unregister(net->ieee80211_ptr->wiphy);
 
-   PRINT_D(INIT_DBG, "Freeing wiphy\n");
wiphy_free(net->ieee80211_ptr->wiphy);
kfree(net->ieee80211_ptr);
 }
-- 
1.9.1

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


[PATCH V3 18/24] staging: wilc1000: linux_wlan.c: removes unnecessary log messages

2016-02-21 Thread Leo Kim
From: Chris Park 

This patch removes unnecessary log messages.

Signed-off-by: Chris Park 
Signed-off-by: Leo Kim 
---
 drivers/staging/wilc1000/linux_wlan.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index 274f468..749dfc74 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -226,7 +226,6 @@ static void deinit_irq(struct net_device *dev)
 
 void wilc_dbg(u8 *buff)
 {
-   PRINT_D(INIT_DBG, "%d\n", *buff);
 }
 
 int wilc_lock_timeout(struct wilc *nic, void *vp, u32 timeout)
-- 
1.9.1

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


[PATCH V3 17/24] staging: wilc1000: host_interface.c: replace PRINT_ER with netdev_err

2016-02-21 Thread Leo Kim
From: Chris Park 

This patch replaces PRINT_ER with netdev_err.

Signed-off-by: Chris Park 
Signed-off-by: Leo Kim 
---
 drivers/staging/wilc1000/host_interface.c | 284 +++---
 1 file changed, 142 insertions(+), 142 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index a827e06..0c09df4 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -335,7 +335,7 @@ static s32 handle_set_wfi_drv_handler(struct wilc_vif *vif,
up(_sema_driver);
 
if (result) {
-   PRINT_ER("Failed to set driver handler\n");
+   netdev_err(vif->ndev, "Failed to set driver handler\n");
return -EINVAL;
}
 
@@ -360,7 +360,7 @@ static s32 handle_set_operation_mode(struct wilc_vif *vif,
up(_sema_driver);
 
if (result) {
-   PRINT_ER("Failed to set driver handler\n");
+   netdev_err(vif->ndev, "Failed to set driver handler\n");
return -EINVAL;
}
 
@@ -389,7 +389,7 @@ static s32 handle_set_ip_address(struct wilc_vif *vif, u8 
*ip_addr, u8 idx)
host_int_get_ipaddress(vif, firmware_ip_addr, idx);
 
if (result) {
-   PRINT_ER("Failed to set IP address\n");
+   netdev_err(vif->ndev, "Failed to set IP address\n");
return -EINVAL;
}
 
@@ -417,7 +417,7 @@ static s32 handle_get_ip_address(struct wilc_vif *vif, u8 
idx)
wilc_setup_ipaddress(vif, set_ip[idx], idx);
 
if (result != 0) {
-   PRINT_ER("Failed to get IP address\n");
+   netdev_err(vif->ndev, "Failed to get IP address\n");
return -EINVAL;
}
 
@@ -462,7 +462,7 @@ static s32 handle_get_mac_address(struct wilc_vif *vif,
  wilc_get_vif_idx(vif));
 
if (result) {
-   PRINT_ER("Failed to get mac address\n");
+   netdev_err(vif->ndev, "Failed to get mac address\n");
result = -EFAULT;
}
up(_sema_wait_response);
@@ -488,7 +488,7 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
wid_list[wid_cnt].size = sizeof(char);
hif_drv->cfg_values.bss_type = 
(u8)cfg_param_attr->cfg_attr_info.bss_type;
} else {
-   PRINT_ER("check value 6 over\n");
+   netdev_err(vif->ndev, "check value 6 over\n");
result = -EINVAL;
goto ERRORHANDLER;
}
@@ -504,7 +504,7 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
wid_list[wid_cnt].size = sizeof(char);
hif_drv->cfg_values.auth_type = 
(u8)cfg_param_attr->cfg_attr_info.auth_type;
} else {
-   PRINT_ER("Impossible value \n");
+   netdev_err(vif->ndev, "Impossible value \n");
result = -EINVAL;
goto ERRORHANDLER;
}
@@ -519,7 +519,7 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
wid_list[wid_cnt].size = sizeof(u16);
hif_drv->cfg_values.auth_timeout = 
cfg_param_attr->cfg_attr_info.auth_timeout;
} else {
-   PRINT_ER("Range(1 ~ 65535) over\n");
+   netdev_err(vif->ndev, "Range(1 ~ 65535) over\n");
result = -EINVAL;
goto ERRORHANDLER;
}
@@ -533,7 +533,7 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
wid_list[wid_cnt].size = sizeof(char);
hif_drv->cfg_values.power_mgmt_mode = 
(u8)cfg_param_attr->cfg_attr_info.power_mgmt_mode;
} else {
-   PRINT_ER("Invalid power mode\n");
+   netdev_err(vif->ndev, "Invalid power mode\n");
result = -EINVAL;
goto ERRORHANDLER;
}
@@ -548,7 +548,7 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
wid_list[wid_cnt].size = sizeof(u16);
hif_drv->cfg_values.short_retry_limit = 
cfg_param_attr->cfg_attr_info.short_retry_limit;
} else {
-   PRINT_ER("Range(1~256) over\n");
+   netdev_err(vif->ndev, "Range(1~256) over\n");
result = -EINVAL;
goto ERRORHANDLER;
}
@@ -563,7 +563,7 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
wid_list[wid_cnt].size = sizeof(u16);
hif_drv->cfg_values.long_retry_limit = 
cfg_param_attr->cfg_attr_info.long_retry_limit;
} else {
- 

[PATCH V3 15/24] staging: wilc1000: coreconfigurator.c: removes unnecessary log messages

2016-02-21 Thread Leo Kim
From: Chris Park 

This patch removes unnecessary log messages.

Signed-off-by: Chris Park 
Signed-off-by: Leo Kim 
---
 drivers/staging/wilc1000/coreconfigurator.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.c 
b/drivers/staging/wilc1000/coreconfigurator.c
index 3a76586..25dc108 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -284,10 +284,8 @@ s32 wilc_parse_network_info(u8 *msg_buffer,
 
msg_type = msg_buffer[0];
 
-   if ('N' != msg_type) {
-   PRINT_ER("Received Message format incorrect.\n");
+   if ('N' != msg_type)
return -EFAULT;
-   }
 
msg_id = msg_buffer[1];
msg_len = MAKE_WORD16(msg_buffer[2], msg_buffer[3]);
-- 
1.9.1

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


[PATCH V3 16/24] staging: wilc1000: host_interface.c: removes unnecessary log messages

2016-02-21 Thread Leo Kim
From: Chris Park 

This patch removes unnecessary log messages.

Signed-off-by: Chris Park 
Signed-off-by: Leo Kim 
---
 drivers/staging/wilc1000/host_interface.c | 12 ++--
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index eddc0d6..a827e06 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1637,11 +1637,8 @@ static int Handle_Key(struct wilc_vif *vif,
 
pu8keybuf = kmalloc(pstrHostIFkeyAttr->attr.wep.key_len 
+ 2,
GFP_KERNEL);
-
-   if (pu8keybuf == NULL) {
-   PRINT_ER("No buffer to send Key\n");
+   if (!pu8keybuf)
return -ENOMEM;
-   }
 
pu8keybuf[0] = pstrHostIFkeyAttr->attr.wep.index;
pu8keybuf[1] = pstrHostIFkeyAttr->attr.wep.key_len;
@@ -1662,10 +1659,8 @@ static int Handle_Key(struct wilc_vif *vif,
kfree(pu8keybuf);
} else if (pstrHostIFkeyAttr->action & ADDKEY) {
pu8keybuf = kmalloc(pstrHostIFkeyAttr->attr.wep.key_len 
+ 2, GFP_KERNEL);
-   if (!pu8keybuf) {
-   PRINT_ER("No buffer to send Key\n");
+   if (!pu8keybuf)
return -ENOMEM;
-   }
pu8keybuf[0] = pstrHostIFkeyAttr->attr.wep.index;
memcpy(pu8keybuf + 1, 
>attr.wep.key_len, 1);
memcpy(pu8keybuf + 2, pstrHostIFkeyAttr->attr.wep.key,
@@ -1709,7 +1704,6 @@ static int Handle_Key(struct wilc_vif *vif,
if (pstrHostIFkeyAttr->action & ADDKEY_AP) {
pu8keybuf = kzalloc(RX_MIC_KEY_MSG_LEN, GFP_KERNEL);
if (!pu8keybuf) {
-   PRINT_ER("No buffer to send RxGTK Key\n");
ret = -ENOMEM;
goto _WPARxGtk_end_case_;
}
@@ -1741,7 +1735,6 @@ static int Handle_Key(struct wilc_vif *vif,
} else if (pstrHostIFkeyAttr->action & ADDKEY) {
pu8keybuf = kzalloc(RX_MIC_KEY_MSG_LEN, GFP_KERNEL);
if (pu8keybuf == NULL) {
-   PRINT_ER("No buffer to send RxGTK Key\n");
ret = -ENOMEM;
goto _WPARxGtk_end_case_;
}
@@ -1781,7 +1774,6 @@ _WPARxGtk_end_case_:
if (pstrHostIFkeyAttr->action & ADDKEY_AP) {
pu8keybuf = kmalloc(PTK_KEY_MSG_LEN + 1, GFP_KERNEL);
if (!pu8keybuf) {
-   PRINT_ER("No buffer to send PTK Key\n");
ret = -ENOMEM;
goto _WPAPtk_end_case_;
}
-- 
1.9.1

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


[PATCH V3 14/24] staging: wilc1000: removes unused CFG80211_DBG tag

2016-02-21 Thread Leo Kim
From: Chris Park 

This patch removes unused CFG80211_DBG tag.

Signed-off-by: Chris Park 
Signed-off-by: Leo Kim 
---
 drivers/staging/wilc1000/linux_wlan_common.h | 4 +---
 drivers/staging/wilc1000/wilc_debugfs.c  | 6 +++---
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan_common.h 
b/drivers/staging/wilc1000/linux_wlan_common.h
index 1f7d806..e408631 100644
--- a/drivers/staging/wilc1000/linux_wlan_common.h
+++ b/drivers/staging/wilc1000/linux_wlan_common.h
@@ -2,12 +2,10 @@
 #define LINUX_WLAN_COMMON_H
 
 enum debug_region {
-   CFG80211_debug = 0,
-   Init_debug,
+   Init_debug = 0,
COMP = 0x,
 };
 
-#define CFG80211_DBG(1 << CFG80211_debug)
 #define INIT_DBG(1 << Init_debug)
 
 #if defined(WILC_DEBUGFS)
diff --git a/drivers/staging/wilc1000/wilc_debugfs.c 
b/drivers/staging/wilc1000/wilc_debugfs.c
index fafe7cc..266d96b 100644
--- a/drivers/staging/wilc1000/wilc_debugfs.c
+++ b/drivers/staging/wilc1000/wilc_debugfs.c
@@ -24,9 +24,9 @@ static struct dentry *wilc_dir;
  * 

  */
 
-#define DBG_REGION_ALL (CFG80211_DBG | INIT_DBG)
+#define DBG_REGION_ALL (INIT_DBG)
 #define DBG_LEVEL_ALL  (DEBUG | INFO | WRN | ERR)
-atomic_t WILC_REGION = ATOMIC_INIT(INIT_DBG | CFG80211_DBG);
+atomic_t WILC_REGION = ATOMIC_INIT(INIT_DBG);
 EXPORT_SYMBOL_GPL(WILC_REGION);
 atomic_t WILC_DEBUG_LEVEL = ATOMIC_INIT(ERR);
 EXPORT_SYMBOL_GPL(WILC_DEBUG_LEVEL);
@@ -134,7 +134,7 @@ struct wilc_debugfs_info_t {
 
 static struct wilc_debugfs_info_t debugfs_info[] = {
{ "wilc_debug_level",   0666,   (DEBUG | ERR), FOPS(NULL, 
wilc_debug_level_read, wilc_debug_level_write, NULL), },
-   { "wilc_debug_region",  0666,   (INIT_DBG | CFG80211_DBG), FOPS(NULL, 
wilc_debug_region_read, wilc_debug_region_write, NULL), },
+   { "wilc_debug_region",  0666,   (INIT_DBG), FOPS(NULL, 
wilc_debug_region_read, wilc_debug_region_write, NULL), },
 };
 
 static int __init wilc_debugfs_init(void)
-- 
1.9.1

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


[PATCH V3 13/24] staging: wilc1000: wilc_wfi_cfgoperations.c: removes unnecessary log messages

2016-02-21 Thread Leo Kim
From: Chris Park 

This patch removes unnecessary log messages.
And, it adds a 'break' statement in accordance with the switch-case rule.

Signed-off-by: Chris Park 
Signed-off-by: Leo Kim 
---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index bbb64ca..75a45df 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -798,7 +798,7 @@ static int connect(struct wiphy *wiphy, struct net_device 
*dev,
break;
 
default:
-   PRINT_D(CFG80211_DBG, "Automatic Authentation type = %d\n", 
sme->auth_type);
+   break;
}
 
if (sme->crypto.n_akm_suites) {
-- 
1.9.1

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


[PATCH V3 10/24] staging: wilc1000: removes unused HOSTAPD_DBG tag

2016-02-21 Thread Leo Kim
From: Chris Park 

This patch removes unused HOSTAPD_DBG tag.

Signed-off-by: Chris Park 
Signed-off-by: Leo Kim 
---
 drivers/staging/wilc1000/linux_wlan_common.h | 4 +---
 drivers/staging/wilc1000/wilc_debugfs.c  | 5 ++---
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan_common.h 
b/drivers/staging/wilc1000/linux_wlan_common.h
index 0d9a71f..1f7d806 100644
--- a/drivers/staging/wilc1000/linux_wlan_common.h
+++ b/drivers/staging/wilc1000/linux_wlan_common.h
@@ -2,13 +2,11 @@
 #define LINUX_WLAN_COMMON_H
 
 enum debug_region {
-   Hostapd_debug = 0,
-   CFG80211_debug,
+   CFG80211_debug = 0,
Init_debug,
COMP = 0x,
 };
 
-#define HOSTAPD_DBG (1 << Hostapd_debug)
 #define CFG80211_DBG(1 << CFG80211_debug)
 #define INIT_DBG(1 << Init_debug)
 
diff --git a/drivers/staging/wilc1000/wilc_debugfs.c 
b/drivers/staging/wilc1000/wilc_debugfs.c
index a27b077..fafe7cc 100644
--- a/drivers/staging/wilc1000/wilc_debugfs.c
+++ b/drivers/staging/wilc1000/wilc_debugfs.c
@@ -24,10 +24,9 @@ static struct dentry *wilc_dir;
  * 

  */
 
-#define DBG_REGION_ALL (HOSTAPD_DBG | CFG80211_DBG | INIT_DBG)
+#define DBG_REGION_ALL (CFG80211_DBG | INIT_DBG)
 #define DBG_LEVEL_ALL  (DEBUG | INFO | WRN | ERR)
-atomic_t WILC_REGION = ATOMIC_INIT(INIT_DBG | CFG80211_DBG |
-  HOSTAPD_DBG);
+atomic_t WILC_REGION = ATOMIC_INIT(INIT_DBG | CFG80211_DBG);
 EXPORT_SYMBOL_GPL(WILC_REGION);
 atomic_t WILC_DEBUG_LEVEL = ATOMIC_INIT(ERR);
 EXPORT_SYMBOL_GPL(WILC_DEBUG_LEVEL);
-- 
1.9.1

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


[PATCH V3 09/24] staging: wilc1000: wilc_wfi_cfgoperations.c: removes unnecessary log messages

2016-02-21 Thread Leo Kim
From: Chris Park 

This patch removes the unnecessary log messages which is used with
the HOSTAPD_DBG tag.

Signed-off-by: Chris Park 
Signed-off-by: Leo Kim 
---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 90 +--
 1 file changed, 2 insertions(+), 88 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 8a3da2d..c989d42 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -1361,10 +1361,6 @@ static int get_station(struct wiphy *wiphy, struct 
net_device *dev,
vif = netdev_priv(dev);
 
if (vif->iftype == AP_MODE || vif->iftype == GO_MODE) {
-   PRINT_D(HOSTAPD_DBG, "Getting station parameters\n");
-
-   PRINT_INFO(HOSTAPD_DBG, ": %x%x%x%x%x\n", mac[0], mac[1], 
mac[2], mac[3], mac[4]);
-
for (i = 0; i < NUM_STA_ASSOCIATED; i++) {
if (!(memcmp(mac, 
priv->assoc_stainfo.au8Sta_AssociatedBss[i], ETH_ALEN))) {
associatedsta = i;
@@ -2042,9 +2038,6 @@ static int change_virtual_intf(struct wiphy *wiphy, 
struct net_device *dev,
vif = netdev_priv(dev);
priv = wiphy_priv(wiphy);
wl = vif->wilc;
-
-   PRINT_D(HOSTAPD_DBG, "In Change virtual interface function\n");
-   PRINT_D(HOSTAPD_DBG, "Wireless interface name =%s\n", dev->name);
p2p_local_random = 0x01;
p2p_recv_random = 0x00;
wilc_ie = false;
@@ -2054,8 +2047,6 @@ static int change_virtual_intf(struct wiphy *wiphy, 
struct net_device *dev,
switch (type) {
case NL80211_IFTYPE_STATION:
wilc_connecting = 0;
-   PRINT_D(HOSTAPD_DBG, "Interface type = 
NL80211_IFTYPE_STATION\n");
-
dev->ieee80211_ptr->iftype = type;
priv->wdev->iftype = type;
vif->monitor_flag = 0;
@@ -2070,8 +2061,6 @@ static int change_virtual_intf(struct wiphy *wiphy, 
struct net_device *dev,
 
case NL80211_IFTYPE_P2P_CLIENT:
wilc_connecting = 0;
-   PRINT_D(HOSTAPD_DBG, "Interface type = 
NL80211_IFTYPE_P2P_CLIENT\n");
-
dev->ieee80211_ptr->iftype = type;
priv->wdev->iftype = type;
vif->monitor_flag = 0;
@@ -2084,7 +2073,6 @@ static int change_virtual_intf(struct wiphy *wiphy, 
struct net_device *dev,
 
case NL80211_IFTYPE_AP:
wilc_enable_ps = false;
-   PRINT_D(HOSTAPD_DBG, "Interface type = NL80211_IFTYPE_AP %d\n", 
type);
dev->ieee80211_ptr->iftype = type;
priv->wdev->iftype = type;
vif->iftype = AP_MODE;
@@ -2101,8 +2089,6 @@ static int change_virtual_intf(struct wiphy *wiphy, 
struct net_device *dev,
wilc_optaining_ip = true;
mod_timer(_during_ip_timer,
  jiffies + msecs_to_jiffies(during_ip_time));
-   PRINT_D(HOSTAPD_DBG, "Interface type = NL80211_IFTYPE_GO\n");
-
wilc_set_operation_mode(vif, AP_MODE);
dev->ieee80211_ptr->iftype = type;
priv->wdev->iftype = type;
@@ -2131,11 +2117,7 @@ static int start_ap(struct wiphy *wiphy, struct 
net_device *dev,
 
priv = wiphy_priv(wiphy);
vif = netdev_priv(dev);
-   wl = vif->wilc;
-   PRINT_D(HOSTAPD_DBG, "Starting ap\n");
-
-   PRINT_D(HOSTAPD_DBG, "Interval = %d\n DTIM period = %d\n Head length = 
%zu Tail length = %zu\n",
-   settings->beacon_interval, settings->dtim_period, 
beacon->head_len, beacon->tail_len);
+   wl = vif ->wilc;
 
s32Error = set_channel(wiphy, >chandef);
 
@@ -2162,8 +2144,6 @@ static int change_beacon(struct wiphy *wiphy, struct 
net_device *dev,
 
priv = wiphy_priv(wiphy);
vif = netdev_priv(priv->dev);
-   PRINT_D(HOSTAPD_DBG, "Setting beacon\n");
-
 
s32Error = wilc_add_beacon(vif, 0, 0, beacon->head_len,
   (u8 *)beacon->head, beacon->tail_len,
@@ -2185,8 +2165,6 @@ static int stop_ap(struct wiphy *wiphy, struct net_device 
*dev)
priv = wiphy_priv(wiphy);
vif = netdev_priv(priv->dev);
 
-   PRINT_D(HOSTAPD_DBG, "Deleting beacon\n");
-
wilc_wlan_set_bssid(dev, NullBssid, AP_MODE);
 
s32Error = wilc_del_beacon(vif);
@@ -,9 +2200,6 @@ static int add_station(struct wiphy *wiphy, struct 
net_device *dev,
 
PRINT_D(CFG80211_DBG, "BSSID = %x%x%x%x%x%x\n", 
priv->assoc_stainfo.au8Sta_AssociatedBss[params->aid][0], 
priv->assoc_stainfo.au8Sta_AssociatedBss[params->aid][1], 
priv->assoc_stainfo.au8Sta_AssociatedBss[params->aid][2], 
priv->assoc_stainfo.au8Sta_AssociatedBss[params->aid][3], 
priv->assoc_stainfo.au8Sta_AssociatedBss[params->aid][4],


[PATCH V3 12/24] staging: wilc1000: wilc_wfi_cfgoperations.c: removes unnecessary log messages

2016-02-21 Thread Leo Kim
From: Chris Park 

This patch removes unnecessary log messages and relate variables.

Signed-off-by: Chris Park 
Signed-off-by: Leo Kim 
---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 233 +-
 1 file changed, 11 insertions(+), 222 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index c989d42..bbb64ca 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -290,9 +290,6 @@ static void remove_network_from_shadow(unsigned long arg)
for (i = 0; i < last_scanned_cnt; i++) {
if (time_after(now, last_scanned_shadow[i].time_scan +
   (unsigned long)(SCAN_RESULT_EXPIRE))) {
-   PRINT_D(CFG80211_DBG, "Network expired ScanShadow:%s\n",
-   last_scanned_shadow[i].ssid);
-
kfree(last_scanned_shadow[i].ies);
last_scanned_shadow[i].ies = NULL;
 
@@ -305,13 +302,9 @@ static void remove_network_from_shadow(unsigned long arg)
}
}
 
-   PRINT_D(CFG80211_DBG, "Number of cached networks: %d\n",
-   last_scanned_cnt);
if (last_scanned_cnt != 0) {
hAgingTimer.data = arg;
mod_timer(, jiffies + msecs_to_jiffies(AGING_TIME));
-   } else {
-   PRINT_D(CFG80211_DBG, "No need to restart Aging timer\n");
}
 }
 
@@ -327,7 +320,6 @@ static int is_network_in_shadow(struct network_info 
*pstrNetworkInfo,
int i;
 
if (last_scanned_cnt == 0) {
-   PRINT_D(CFG80211_DBG, "Starting Aging timer\n");
hAgingTimer.data = (unsigned long)user_void;
mod_timer(, jiffies + msecs_to_jiffies(AGING_TIME));
state = -1;
@@ -350,10 +342,9 @@ static void add_network_to_shadow(struct network_info 
*pstrNetworkInfo,
u32 ap_index = 0;
u8 rssi_index = 0;
 
-   if (last_scanned_cnt >= MAX_NUM_SCANNED_NETWORKS_SHADOW) {
-   PRINT_D(CFG80211_DBG, "Shadow network reached its maximum 
limit\n");
+   if (last_scanned_cnt >= MAX_NUM_SCANNED_NETWORKS_SHADOW)
return;
-   }
+
if (ap_found == -1) {
ap_index = last_scanned_cnt;
last_scanned_cnt++;
@@ -424,21 +415,8 @@ static void CfgScanResult(enum scan_event scan_event,
if (!channel)
return;
 
-   PRINT_INFO(CFG80211_DBG, "Network Info::"
-  "CHANNEL Frequency: %d,"
-  "RSSI: %d,"
-  "Capability Info: %d,"
-  "Beacon Period: %d\n",
-  channel->center_freq,
-  (s32)network_info->rssi * 100,
-  network_info->cap_info,
-  network_info->beacon_period);
-
if (network_info->new_network) {
if (priv->u32RcvdChCount < 
MAX_NUM_SCANNED_NETWORKS) {
-   PRINT_D(CFG80211_DBG,
-   "Network %s found\n",
-   network_info->ssid);
priv->u32RcvdChCount++;
 

add_network_to_shadow(network_info, priv, join_params);
@@ -463,8 +441,6 @@ static void CfgScanResult(enum scan_event scan_event,
 
for (i = 0; i < priv->u32RcvdChCount; 
i++) {
if 
(memcmp(last_scanned_shadow[i].bssid, network_info->bssid, 6) == 0) {
-   PRINT_D(CFG80211_DBG, 
"Update RSSI of %s\n", last_scanned_shadow[i].ssid);
-

last_scanned_shadow[i].rssi = network_info->rssi;

last_scanned_shadow[i].time_scan = jiffies;
break;
@@ -473,15 +449,8 @@ static void CfgScanResult(enum scan_event scan_event,
}
}
} else if (scan_event == SCAN_EVENT_DONE) {
-   PRINT_D(CFG80211_DBG, "Scan Done[%p]\n", priv->dev);
-   PRINT_D(CFG80211_DBG, "Refreshing Scan ...\n");
refresh_scan(priv, 1, false);
 
-   if (priv->u32RcvdChCount > 0)
-   

[PATCH V3 08/24] staging: wilc1000: linux_mon.c: removes comments

2016-02-21 Thread Leo Kim
From: Chris Park 

This patch removes unnecessary comments.

Signed-off-by: Chris Park 
Signed-off-by: Leo Kim 
---
 drivers/staging/wilc1000/linux_mon.c | 4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_mon.c 
b/drivers/staging/wilc1000/linux_mon.c
index f6349e5..6347471 100644
--- a/drivers/staging/wilc1000/linux_mon.c
+++ b/drivers/staging/wilc1000/linux_mon.c
@@ -191,8 +191,6 @@ static netdev_tx_t WILC_WFI_mon_xmit(struct sk_buff *skb,
if (skb->len < rtap_len)
return -1;
 
-   /* skip the radiotap header */
-   /* Skip the ratio tap header */
skb_pull(skb, rtap_len);
 
if (skb->data[0] == 0xc0 && (!(memcmp(broadcast, >data[4], 6 {
@@ -227,8 +225,6 @@ static netdev_tx_t WILC_WFI_mon_xmit(struct sk_buff *skb,
}
skb->dev = mon_priv->real_ndev;
 
-   /* actual deliver of data is device-specific, and not shown here */
-
/* Identify if Ethernet or MAC header (data or mgmt) */
memcpy(srcAdd, >data[10], 6);
memcpy(bssid, >data[16], 6);
-- 
1.9.1

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


[PATCH V3 11/24] staging: wilc1000: host_interface.c: removes unnecessary log messages

2016-02-21 Thread Leo Kim
From: Chris Park 

This patch removes unnecessary log message and relate variables.

Signed-off-by: Chris Park 
Signed-off-by: Leo Kim 
---
 drivers/staging/wilc1000/host_interface.c | 31 ---
 1 file changed, 4 insertions(+), 27 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 035f6f5..eddc0d6 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -2095,8 +2095,6 @@ static s32 Handle_Get_InActiveTime(struct wilc_vif *vif,
stamac = wid.val;
memcpy(stamac, strHostIfStaInactiveT->mac, ETH_ALEN);
 
-   PRINT_D(CFG80211_DBG, "SETING STA inactive time\n");
-
result = wilc_send_config_pkt(vif, SET_CFG, , 1,
  wilc_get_vif_idx(vif));
 
@@ -2118,8 +2116,6 @@ static s32 Handle_Get_InActiveTime(struct wilc_vif *vif,
return -EFAULT;
}
 
-   PRINT_D(CFG80211_DBG, "Getting inactive time : %d\n", inactive_time);
-
up(_drv->sem_inactive_time);
 
return result;
@@ -3037,7 +3033,6 @@ int wilc_add_ptk(struct wilc_vif *vif, const u8 *ptk, u8 
ptk_key_len,
struct host_if_msg msg;
struct host_if_drv *hif_drv = vif->hif_drv;
u8 key_len = ptk_key_len;
-   int i;
 
if (!hif_drv) {
PRINT_ER("driver is null\n");
@@ -3065,20 +3060,11 @@ int wilc_add_ptk(struct wilc_vif *vif, const u8 *ptk, 
u8 ptk_key_len,
if (!msg.body.key_info.attr.wpa.key)
return -ENOMEM;
 
-   if (rx_mic) {
+   if (rx_mic)
memcpy(msg.body.key_info.attr.wpa.key + 16, rx_mic, 
RX_MIC_KEY_LEN);
-   if (INFO) {
-   for (i = 0; i < RX_MIC_KEY_LEN; i++)
-   PRINT_INFO(CFG80211_DBG, "PairwiseRx[%d] = 
%x\n", i, rx_mic[i]);
-   }
-   }
-   if (tx_mic) {
+
+   if (tx_mic)
memcpy(msg.body.key_info.attr.wpa.key + 24, tx_mic, 
TX_MIC_KEY_LEN);
-   if (INFO) {
-   for (i = 0; i < TX_MIC_KEY_LEN; i++)
-   PRINT_INFO(CFG80211_DBG, "PairwiseTx[%d] = 
%x\n", i, tx_mic[i]);
-   }
-   }
 
msg.body.key_info.attr.wpa.key_len = key_len;
msg.body.key_info.attr.wpa.mac_addr = mac_addr;
@@ -4083,20 +4069,11 @@ int wilc_del_allstation(struct wilc_vif *vif, u8 
mac_addr[][ETH_ALEN])
for (i = 0; i < MAX_NUM_STA; i++) {
if (memcmp(mac_addr[i], zero_addr, ETH_ALEN)) {
memcpy(del_all_sta_info->del_all_sta[i], mac_addr[i], 
ETH_ALEN);
-   PRINT_D(CFG80211_DBG, "BSSID = %x%x%x%x%x%x\n",
-   del_all_sta_info->del_all_sta[i][0],
-   del_all_sta_info->del_all_sta[i][1],
-   del_all_sta_info->del_all_sta[i][2],
-   del_all_sta_info->del_all_sta[i][3],
-   del_all_sta_info->del_all_sta[i][4],
-   del_all_sta_info->del_all_sta[i][5]);
assoc_sta++;
}
}
-   if (!assoc_sta) {
-   PRINT_D(CFG80211_DBG, "NO ASSOCIATED STAS\n");
+   if (!assoc_sta)
return result;
-   }
 
del_all_sta_info->assoc_sta = assoc_sta;
result = wilc_mq_send(_msg_q, , sizeof(struct host_if_msg));
-- 
1.9.1

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


[PATCH V3 06/24] staging: wilc1000: host_interface.c: removes unnecessary log message

2016-02-21 Thread Leo Kim
From: Chris Park 

This patch removes unnecessary log message and relate variables.

Signed-off-by: Chris Park 
Signed-off-by: Leo Kim 
---
 drivers/staging/wilc1000/host_interface.c | 5 -
 1 file changed, 5 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 3de4f99..035f6f5 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -2999,7 +2999,6 @@ int wilc_add_wep_key_bss_ap(struct wilc_vif *vif, const 
u8 *key, u8 len,
int result = 0;
struct host_if_msg msg;
struct host_if_drv *hif_drv = vif->hif_drv;
-   int i;
 
if (!hif_drv) {
PRINT_ER("driver is null\n");
@@ -3008,10 +3007,6 @@ int wilc_add_wep_key_bss_ap(struct wilc_vif *vif, const 
u8 *key, u8 len,
 
memset(, 0, sizeof(struct host_if_msg));
 
-   if (INFO) {
-   for (i = 0; i < len; i++)
-   PRINT_INFO(HOSTAPD_DBG, "KEY is %x\n", key[i]);
-   }
msg.id = HOST_IF_MSG_KEY;
msg.body.key_info.type = WEP;
msg.body.key_info.action = ADDKEY_AP;
-- 
1.9.1

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


[PATCH V3 05/24] staging: wilc1000: removes potential null dereference

2016-02-21 Thread Leo Kim
This patch removes the error reported by smatch.
 - wilc_wfi_cfgoperations.c:674 scan() error:
   potential null dereference 'strHiddenNetwork.net_info'.  (kmalloc returns 
null)

Signed-off-by: Leo Kim 
---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 76f4375..8a3da2d 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -668,6 +668,8 @@ static int scan(struct wiphy *wiphy, struct 
cfg80211_scan_request *request)
kmalloc_array(request->n_ssids,
  sizeof(struct hidden_network),
  GFP_KERNEL);
+   if (!strHiddenNetwork.net_info)
+   return -ENOMEM;
strHiddenNetwork.n_ssids = request->n_ssids;
 
 
-- 
1.9.1

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


[PATCH V3 04/24] staging: wilc1000: linux_mon.c: add to check routine

2016-02-21 Thread Leo Kim
This patch adds the return value which needs the check and
prints the error message when it fails.

Signed-off-by: Leo Kim 
---
 drivers/staging/wilc1000/linux_mon.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/linux_mon.c 
b/drivers/staging/wilc1000/linux_mon.c
index 2b575d1..dd9e4b2 100644
--- a/drivers/staging/wilc1000/linux_mon.c
+++ b/drivers/staging/wilc1000/linux_mon.c
@@ -266,7 +266,9 @@ static netdev_tx_t WILC_WFI_mon_xmit(struct sk_buff *skb,
/* if source address and bssid fields are equal>>Mac header */
/*send it to mgmt frames handler */
if (!(memcmp(srcAdd, bssid, 6))) {
-   mon_mgmt_tx(mon_priv->real_ndev, skb->data, skb->len);
+   ret = mon_mgmt_tx(mon_priv->real_ndev, skb->data, skb->len);
+   if (ret)
+   netdev_err(dev, "fail to mgmt tx\n");
dev_kfree_skb(skb);
} else {
ret = wilc_mac_xmit(skb, mon_priv->real_ndev);
-- 
1.9.1

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


[PATCH V3 02/24] staging: wilc1000: linux_mon.c: removes debug logs

2016-02-21 Thread Leo Kim
This patches removes unnecessary debug logs.

Signed-off-by: Leo Kim 
---
 drivers/staging/wilc1000/linux_mon.c | 24 ++--
 1 file changed, 6 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_mon.c 
b/drivers/staging/wilc1000/linux_mon.c
index 9fcb497..558fb50 100644
--- a/drivers/staging/wilc1000/linux_mon.c
+++ b/drivers/staging/wilc1000/linux_mon.c
@@ -157,10 +157,8 @@ static int mon_mgmt_tx(struct net_device *dev, const u8 
*buf, size_t len)
 {
struct tx_complete_mon_data *mgmt_tx = NULL;
 
-   if (!dev) {
-   PRINT_D(HOSTAPD_DBG, "ERROR: dev == NULL\n");
+   if (!dev)
return -EFAULT;
-   }
 
netif_stop_queue(dev);
mgmt_tx = kmalloc(sizeof(*mgmt_tx), GFP_ATOMIC);
@@ -205,17 +203,12 @@ static netdev_tx_t WILC_WFI_mon_xmit(struct sk_buff *skb,
return -EFAULT;
 
mon_priv = netdev_priv(wilc_wfi_mon);
-
-   if (!mon_priv) {
-   PRINT_ER("Monitor interface private structure is NULL\n");
+   if (!mon_priv)
return -EFAULT;
-   }
-
rtap_len = ieee80211_get_radiotap_len(skb->data);
-   if (skb->len < rtap_len) {
-   PRINT_ER("Error in radiotap header\n");
+   if (skb->len < rtap_len)
return -1;
-   }
+
/* skip the radiotap header */
PRINT_INFO(HOSTAPD_DBG, "Radiotap len: %d\n", rtap_len);
 
@@ -306,11 +299,8 @@ struct net_device *WILC_WFI_init_mon_interface(const char 
*name, struct net_devi
return wilc_wfi_mon;
 
wilc_wfi_mon = alloc_etherdev(sizeof(struct WILC_WFI_mon_priv));
-   if (!wilc_wfi_mon) {
-   PRINT_ER("failed to allocate memory\n");
+   if (!wilc_wfi_mon)
return NULL;
-   }
-
wilc_wfi_mon->type = ARPHRD_IEEE80211_RADIOTAP;
strncpy(wilc_wfi_mon->name, name, IFNAMSIZ);
wilc_wfi_mon->name[IFNAMSIZ - 1] = 0;
@@ -322,10 +312,8 @@ struct net_device *WILC_WFI_init_mon_interface(const char 
*name, struct net_devi
return NULL;
}
priv = netdev_priv(wilc_wfi_mon);
-   if (!priv) {
-   PRINT_ER("private structure is NULL\n");
+   if (!priv)
return NULL;
-   }
 
priv->real_ndev = real_dev;
 
-- 
1.9.1

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


[PATCH V3 07/24] staging: wilc1000: linux_mon.c: removes unnecessary log message

2016-02-21 Thread Leo Kim
From: Chris Park 

This patch removes unnecessary log message and relate variables.

Signed-off-by: Chris Park 
Signed-off-by: Leo Kim 
---
 drivers/staging/wilc1000/linux_mon.c | 42 
 1 file changed, 4 insertions(+), 38 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_mon.c 
b/drivers/staging/wilc1000/linux_mon.c
index dd9e4b2..f6349e5 100644
--- a/drivers/staging/wilc1000/linux_mon.c
+++ b/drivers/staging/wilc1000/linux_mon.c
@@ -52,15 +52,11 @@ void WILC_WFI_monitor_rx(u8 *buff, u32 size)
struct wilc_wfi_radiotap_hdr *hdr;
struct wilc_wfi_radiotap_cb_hdr *cb_hdr;
 
-   PRINT_INFO(HOSTAPD_DBG, "In monitor interface receive function\n");
-
if (!wilc_wfi_mon)
return;
 
-   if (!netif_running(wilc_wfi_mon)) {
-   PRINT_INFO(HOSTAPD_DBG, "Monitor interface already RUNNING\n");
+   if (!netif_running(wilc_wfi_mon))
return;
-   }
 
/* Get WILC header */
memcpy(, (buff - HOST_HDR_OFFSET), HOST_HDR_OFFSET);
@@ -73,10 +69,8 @@ void WILC_WFI_monitor_rx(u8 *buff, u32 size)
/* hostapd callback mgmt frame */
 
skb = dev_alloc_skb(size + sizeof(struct 
wilc_wfi_radiotap_cb_hdr));
-   if (!skb) {
-   PRINT_INFO(HOSTAPD_DBG, "Monitor if : No memory to 
allocate skb");
+   if (!skb)
return;
-   }
 
memcpy(skb_put(skb, size), buff, size);
 
@@ -103,20 +97,16 @@ void WILC_WFI_monitor_rx(u8 *buff, u32 size)
} else {
skb = dev_alloc_skb(size + sizeof(struct 
wilc_wfi_radiotap_hdr));
 
-   if (!skb) {
-   PRINT_INFO(HOSTAPD_DBG, "Monitor if : No memory to 
allocate skb");
+   if (!skb)
return;
-   }
 
memcpy(skb_put(skb, size), buff, size);
hdr = (struct wilc_wfi_radiotap_hdr *)skb_push(skb, 
sizeof(*hdr));
memset(hdr, 0, sizeof(struct wilc_wfi_radiotap_hdr));
hdr->hdr.it_version = 0; /* PKTHDR_RADIOTAP_VERSION; */
hdr->hdr.it_len = cpu_to_le16(sizeof(struct 
wilc_wfi_radiotap_hdr));
-   PRINT_INFO(HOSTAPD_DBG, "Radiotap len %d\n", hdr->hdr.it_len);
hdr->hdr.it_present = cpu_to_le32
(1 << IEEE80211_RADIOTAP_RATE); 
  /* | */
-   PRINT_INFO(HOSTAPD_DBG, "Presentflags %d\n", 
hdr->hdr.it_present);
hdr->rate = 5; /* txrate->bitrate / 5; */
}
 
@@ -138,14 +128,6 @@ struct tx_complete_mon_data {
 static void mgmt_tx_complete(void *priv, int status)
 {
struct tx_complete_mon_data *pv_data = priv;
-   u8 *buf =  pv_data->buff;
-
-   if (status == 1) {
-   if (INFO || buf[0] == 0x10 || buf[0] == 0xb0)
-   PRINT_INFO(HOSTAPD_DBG, "Packet sent successfully - 
Size = %d - Address = %p.\n", pv_data->size, pv_data->buff);
-   } else {
-   PRINT_INFO(HOSTAPD_DBG, "Couldn't send packet - Size = %d - 
Address = %p.\n", pv_data->size, pv_data->buff);
-   }
 
/* incase of fully hosting mode, the freeing will be done in response 
to the cfg packet */
kfree(pv_data->buff);
@@ -193,7 +175,7 @@ static int mon_mgmt_tx(struct net_device *dev, const u8 
*buf, size_t len)
 static netdev_tx_t WILC_WFI_mon_xmit(struct sk_buff *skb,
 struct net_device *dev)
 {
-   u32 rtap_len, i, ret = 0;
+   u32 rtap_len, ret = 0;
struct WILC_WFI_mon_priv  *mon_priv;
 
struct sk_buff *skb2;
@@ -210,18 +192,9 @@ static netdev_tx_t WILC_WFI_mon_xmit(struct sk_buff *skb,
return -1;
 
/* skip the radiotap header */
-   PRINT_INFO(HOSTAPD_DBG, "Radiotap len: %d\n", rtap_len);
-
-   if (INFO) {
-   for (i = 0; i < rtap_len; i++)
-   PRINT_INFO(HOSTAPD_DBG, "Radiotap_hdr[%d] %02x\n", i, 
skb->data[i]);
-   }
/* Skip the ratio tap header */
skb_pull(skb, rtap_len);
 
-   if (skb->data[0] == 0xc0)
-   PRINT_INFO(HOSTAPD_DBG, "%x:%x:%x:%x:%x%x\n", skb->data[4], 
skb->data[5], skb->data[6], skb->data[7], skb->data[8], skb->data[9]);
-
if (skb->data[0] == 0xc0 && (!(memcmp(broadcast, >data[4], 6 {
skb2 = dev_alloc_skb(skb->len + sizeof(struct 
wilc_wfi_radiotap_cb_hdr));
 
@@ -254,11 +227,7 @@ static netdev_tx_t WILC_WFI_mon_xmit(struct sk_buff *skb,
}
skb->dev = mon_priv->real_ndev;
 
-   PRINT_INFO(HOSTAPD_DBG, "Skipping the radiotap header\n");
-
/* actual deliver of data is device-specific, and not shown here */
-   PRINT_INFO(HOSTAPD_DBG, "SKB netdevice name = %s\n", skb->dev->name);
-   PRINT_INFO(HOSTAPD_DBG, "MONITOR real dev name = %s\n", 

[PATCH V3 03/24] staging: wilc1000: linux_mon.c: replaces PRINT_ER with netdev_err

2016-02-21 Thread Leo Kim
This patches replaces PRINT_ER with netdev_err.

Signed-off-by: Leo Kim 
---
 drivers/staging/wilc1000/linux_mon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/linux_mon.c 
b/drivers/staging/wilc1000/linux_mon.c
index 558fb50..2b575d1 100644
--- a/drivers/staging/wilc1000/linux_mon.c
+++ b/drivers/staging/wilc1000/linux_mon.c
@@ -308,7 +308,7 @@ struct net_device *WILC_WFI_init_mon_interface(const char 
*name, struct net_devi
 
ret = register_netdevice(wilc_wfi_mon);
if (ret) {
-   PRINT_ER(" register_netdevice failed (%d)\n", ret);
+   netdev_err(real_dev, "register_netdevice failed\n");
return NULL;
}
priv = netdev_priv(wilc_wfi_mon);
-- 
1.9.1

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


[PATCH V3 00/24] staging: wilc1000: Resend V3

2016-02-21 Thread Leo Kim
Dear Greg

This is the 3rd of the patch series about the other reason why V1 and V2.

V1 : first patch send.
After a little time has elapsed, received a error message from "kbuild test 
robot". 
===
[auto build test WARNING on staging/staging-testing] [also build test WARNING 
on next-20160217] [cannot apply to v4.5-rc4] [if your patch is applied to the 
wrong git tree, please drop us a note to help improving the system]

url:
https://github.com/0day-ci/linux/commits/Leo-Kim/staging-wilc1000-wilc_wlan-c-removes-PRINT_ER/20160218-153737

coccinelle warnings: (new ones prefixed by >>)

>> drivers/staging/wilc1000/wilc_wfi_cfgoperations.c:1153:6-35: alloc 
>> with no test, possible model on line 1158
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c:1192:6-35: alloc with no 
test, possible model on line 1197
===

I had think that this patch does not apply.
So, send V2 patch after fixed a error.

V2: fixed a build error from kbuild test robot
===
staging: wilc1000: removes potential null dereference
===

Please let me know if I mistake from a git patch process.
 
Thank you and Best Regards.
Leo

Chris Park (19):
  staging: wilc1000: host_interface.c: removes unnecessary log message
  staging: wilc1000: linux_mon.c: removes unnecessary log message
  staging: wilc1000: linux_mon.c: removes comments
  staging: wilc1000: wilc_wfi_cfgoperations.c: removes unnecessary log
messages
  staging: wilc1000: removes unused HOSTAPD_DBG tag
  staging: wilc1000: host_interface.c: removes unnecessary log messages
  staging: wilc1000: wilc_wfi_cfgoperations.c: removes unnecessary log
messages
  staging: wilc1000: wilc_wfi_cfgoperations.c: removes unnecessary log
messages
  staging: wilc1000: removes unused CFG80211_DBG tag
  staging: wilc1000: coreconfigurator.c: removes unnecessary log
messages
  staging: wilc1000: host_interface.c: removes unnecessary log messages
  staging: wilc1000: host_interface.c: replace PRINT_ER with netdev_err
  staging: wilc1000: linux_wlan.c: removes unnecessary log messages
  staging: wilc1000: wilc_wfi_cfgoperations.c: removes unnecessary log
messages
  staging: wilc1000: wilc_wlan.c: removes unnecessary log messages
  staging: wilc1000: removes unused region feature
  staging: wilc1000: removes usused PRINT_XX(region...)
  staging: wilc1000: moves to define values
  staging: wilc1000: moves LINUX_RX_SIZE, LINUX_TX_SIZE

Leo Kim (5):
  staging: wilc1000: wilc_wlan.c: removes PRINT_ER
  staging: wilc1000: linux_mon.c: removes debug logs
  staging: wilc1000: linux_mon.c: replaces PRINT_ER with netdev_err
  staging: wilc1000: linux_mon.c: add to check routine
  staging: wilc1000: removes potential null dereference

 drivers/staging/wilc1000/coreconfigurator.c   |   4 +-
 drivers/staging/wilc1000/host_interface.c | 332 ++---
 drivers/staging/wilc1000/linux_mon.c  |  74 +
 drivers/staging/wilc1000/linux_wlan.c |   1 -
 drivers/staging/wilc1000/linux_wlan_common.h  |  99 ---
 drivers/staging/wilc1000/wilc_debugfs.c   |  47 +--
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 341 ++
 drivers/staging/wilc1000/wilc_wlan.c  |   5 -
 drivers/staging/wilc1000/wilc_wlan.h  |   3 +
 9 files changed, 188 insertions(+), 718 deletions(-)

-- 
1.9.1

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


[PATCH V3 01/24] staging: wilc1000: wilc_wlan.c: removes PRINT_ER

2016-02-21 Thread Leo Kim
This patches removes PRINT_ER that is unnecessary debug logs.

Signed-off-by: Leo Kim 
---
 drivers/staging/wilc1000/wilc_wlan.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan.c 
b/drivers/staging/wilc1000/wilc_wlan.c
index 391173b..c6d206d 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -1468,7 +1468,6 @@ int wilc_wlan_init(struct net_device *dev)
 
if (!wilc->tx_buffer) {
ret = -ENOBUFS;
-   PRINT_ER("Can't allocate Tx Buffer");
goto _fail_;
}
 
@@ -1477,7 +1476,6 @@ int wilc_wlan_init(struct net_device *dev)
 
if (!wilc->rx_buffer) {
ret = -ENOBUFS;
-   PRINT_ER("Can't allocate Rx Buffer");
goto _fail_;
}
 
-- 
1.9.1

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


Re: [PATCH v2 3/3] iio: hmc5843: Move hmc5843 out of staging

2016-02-21 Thread Jonathan Cameron
On 14/02/16 22:37, Cristina Moraru wrote:
> This patch moves hmc5843 driver from staging/iio/magnetometer
> to iio/magnetometer, updates the corresponding Makefiles and
> moves the hmc5843* entries to the 'Industrial I/O support ->
> Magnetometer sensors' menu.
> 
> Signed-off-by: Cristina Moraru 
> Cc: Daniel Baluta 
For some reason I couldn't immediately identify this patch wouldn't
apply to my tree. I hand applied it and all seemed fine, but please do
sanity check the result - shortly to be in the testing branch of iio.git

Applied.  Thanks,

Jonathan
> ---
> Changes since v1:
> No change since v1
>  drivers/iio/magnetometer/Kconfig|  33 ++
>  drivers/iio/magnetometer/Makefile   |   4 +
>  drivers/iio/magnetometer/hmc5843.h  |  65 +++
>  drivers/iio/magnetometer/hmc5843_core.c | 686 
> 
>  drivers/iio/magnetometer/hmc5843_i2c.c  | 103 
>  drivers/iio/magnetometer/hmc5843_spi.c  | 100 
>  drivers/staging/iio/magnetometer/Kconfig|  32 --
>  drivers/staging/iio/magnetometer/Makefile   |   4 +-
>  drivers/staging/iio/magnetometer/hmc5843.h  |  65 ---
>  drivers/staging/iio/magnetometer/hmc5843_core.c | 686 
> 
>  drivers/staging/iio/magnetometer/hmc5843_i2c.c  | 103 
>  drivers/staging/iio/magnetometer/hmc5843_spi.c  | 100 
>  12 files changed, 992 insertions(+), 989 deletions(-)
>  create mode 100644 drivers/iio/magnetometer/hmc5843.h
>  create mode 100644 drivers/iio/magnetometer/hmc5843_core.c
>  create mode 100644 drivers/iio/magnetometer/hmc5843_i2c.c
>  create mode 100644 drivers/iio/magnetometer/hmc5843_spi.c
>  delete mode 100644 drivers/staging/iio/magnetometer/hmc5843.h
>  delete mode 100644 drivers/staging/iio/magnetometer/hmc5843_core.c
>  delete mode 100644 drivers/staging/iio/magnetometer/hmc5843_i2c.c
>  delete mode 100644 drivers/staging/iio/magnetometer/hmc5843_spi.c
> 
> diff --git a/drivers/iio/magnetometer/Kconfig 
> b/drivers/iio/magnetometer/Kconfig
> index 868abad..021dc53 100644
> --- a/drivers/iio/magnetometer/Kconfig
> +++ b/drivers/iio/magnetometer/Kconfig
> @@ -105,4 +105,37 @@ config IIO_ST_MAGN_SPI_3AXIS
>   depends on IIO_ST_MAGN_3AXIS
>   depends on IIO_ST_SENSORS_SPI
>  
> +config SENSORS_HMC5843
> + tristate
> + select IIO_BUFFER
> + select IIO_TRIGGERED_BUFFER
> +
> +config SENSORS_HMC5843_I2C
> + tristate "Honeywell HMC5843/5883/5883L 3-Axis Magnetometer (I2C)"
> + depends on I2C
> + select SENSORS_HMC5843
> + select REGMAP_I2C
> + help
> +   Say Y here to add support for the Honeywell HMC5843, HMC5883 and
> +   HMC5883L 3-Axis Magnetometer (digital compass).
> +
> +   This driver can also be compiled as a set of modules.
> +   If so, these modules will be created:
> +   - hmc5843_core (core functions)
> +   - hmc5843_i2c (support for HMC5843, HMC5883, HMC5883L and HMC5983)
> +
> +config SENSORS_HMC5843_SPI
> + tristate "Honeywell HMC5983 3-Axis Magnetometer (SPI)"
> + depends on SPI_MASTER
> + select SENSORS_HMC5843
> + select REGMAP_SPI
> + help
> +   Say Y here to add support for the Honeywell HMC5983 3-Axis 
> Magnetometer
> +   (digital compass).
> +
> +   This driver can also be compiled as a set of modules.
> +   If so, these modules will be created:
> +   - hmc5843_core (core functions)
> +   - hmc5843_spi (support for HMC5983)
> +
>  endmenu
> diff --git a/drivers/iio/magnetometer/Makefile 
> b/drivers/iio/magnetometer/Makefile
> index 2c72df4..dd03fe5 100644
> --- a/drivers/iio/magnetometer/Makefile
> +++ b/drivers/iio/magnetometer/Makefile
> @@ -15,3 +15,7 @@ st_magn-$(CONFIG_IIO_BUFFER) += st_magn_buffer.o
>  
>  obj-$(CONFIG_IIO_ST_MAGN_I2C_3AXIS) += st_magn_i2c.o
>  obj-$(CONFIG_IIO_ST_MAGN_SPI_3AXIS) += st_magn_spi.o
> +
> +obj-$(CONFIG_SENSORS_HMC5843)+= hmc5843_core.o
> +obj-$(CONFIG_SENSORS_HMC5843_I2C)+= hmc5843_i2c.o
> +obj-$(CONFIG_SENSORS_HMC5843_SPI)+= hmc5843_spi.o
> diff --git a/drivers/iio/magnetometer/hmc5843.h 
> b/drivers/iio/magnetometer/hmc5843.h
> new file mode 100644
> index 000..76a5d74
> --- /dev/null
> +++ b/drivers/iio/magnetometer/hmc5843.h
> @@ -0,0 +1,65 @@
> +/*
> + * Header file for hmc5843 driver
> + *
> + * Split from hmc5843.c
> + * Copyright (C) Josef Gajdusek 
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +
> +#ifndef HMC5843_CORE_H
> +#define HMC5843_CORE_H
> +
> +#include 
> +#include 
> +
> +#define HMC5843_CONFIG_REG_A 0x00
> +#define HMC5843_CONFIG_REG_B 0x01
> +#define HMC5843_MODE_REG 0x02
> +#define HMC5843_DATA_OUT_MSB_REGS0x03
> +#define 

Re: [PATCH v2 2/3] iio: hmc5843: Add ABI documentation file for hmc5843

2016-02-21 Thread Jonathan Cameron
On 14/02/16 22:37, Cristina Moraru wrote:
> Add ABI file documenting hmc5843 non-standard attributes
> meas_conf and meas_conf_available for bias current
> configuration.
> 
> Signed-off-by: Cristina Moraru 
> Cc: Daniel Baluta 
Applied.
> ---
> Changes since v1:
> Changed API from integer values to string values
>  .../ABI/testing/sysfs-bus-iio-magnetometer-hmc5843| 15 
> +++
>  1 file changed, 15 insertions(+)
>  create mode 100644 
> Documentation/ABI/testing/sysfs-bus-iio-magnetometer-hmc5843
> 
> diff --git a/Documentation/ABI/testing/sysfs-bus-iio-magnetometer-hmc5843 
> b/Documentation/ABI/testing/sysfs-bus-iio-magnetometer-hmc5843
> new file mode 100644
> index 000..6275e9f
> --- /dev/null
> +++ b/Documentation/ABI/testing/sysfs-bus-iio-magnetometer-hmc5843
> @@ -0,0 +1,15 @@
> +What:   /sys/bus/iio/devices/iio:deviceX/meas_conf
> +What:   /sys/bus/iio/devices/iio:deviceX/meas_conf_available
> +KernelVersion:  4.5
> +Contact:linux-...@vger.kernel.org
> +Description:
> +Current configuration and available configurations
> + for the bias current.
> + normal  - Normal measurement configurations (default)
> + positivebias- Positive bias configuration
> + negativebias- Negative bias configuration
> + disabled- Only available on HMC5983. Disables magnetic
> +   sensor and enables temperature sensor.
> + Note: The effect of this configuration may vary
> + according to the device. For exact documentation
> + check the device's datasheet.
> 

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


Re: [PATCH v2 1/3] iio: hmc5843: Add attributes for measurement config of bias current

2016-02-21 Thread Jonathan Cameron
On 14/02/16 22:37, Cristina Moraru wrote:
> Change static attribute meas_conf for bias current configuration
> to channel attribute in_magn_meas_conf and also add
> in_magn_meas_conf_available attribute to view available configurations.
> 
> This patch solves functionality bug: driver was using same function
> hmc5843_set_measurement_configuration for setting bias current config
> for all device types but the function was returning -EINVAL for any
> setting >= 0x03 although, for sensor HMC5983, value 3 is valid.
> 
> API for setting bias measurement configuration:
> 
> normal -  Normal measurement configuration (default):
>   In normal measurement configuration the device
>   follows normal measurement flow. Pins BP and BN
>   are left floating and high impedance.
> 
> positivebias -Positive bias configuration: In positive bias
>   configuration, a positive current is forced across
>   the resistive load on pins BP and BN.
> 
> negativebias -Negative bias configuration. In negative bias
>   configuration, a negative current is forced across
>   the resistive load on pins BP and BN.
> 
> disabled -Only available on HMC5983. Magnetic sensor is disabled.
>   Temperature sensor is enabled.
> 
> Signed-off-by: Cristina Moraru 
> Cc: Daniel Baluta 
Hmm. I do slightly wonder if we can come up with a more generic name for this
as I doubt this will be the last magnetometer we ever see with this sort
of functionality.

Lets leave it be for now as it is not too much a burden to support a more
generic interface in addition to this one in the future.

Applied to the togreg branch of iio.git - initialy pushed out as testing for
the auto builders to play with it.

Thanks,

Jonathan
> ---
> Changes since v1:
> Changed user interface for bias configuration from
> integer values to string values in order to make it
> more suggestive.
> Used iio_enum from implementation.
>  drivers/staging/iio/magnetometer/hmc5843_core.c | 133 
> 
>  1 file changed, 87 insertions(+), 46 deletions(-)
> 
> diff --git a/drivers/staging/iio/magnetometer/hmc5843_core.c 
> b/drivers/staging/iio/magnetometer/hmc5843_core.c
> index e270ea1..77882b4 100644
> --- a/drivers/staging/iio/magnetometer/hmc5843_core.c
> +++ b/drivers/staging/iio/magnetometer/hmc5843_core.c
> @@ -65,6 +65,33 @@
>  #define HMC5843_MEAS_CONF_NEGATIVE_BIAS  0x02
>  #define HMC5843_MEAS_CONF_MASK   0x03
>  
> +/*
> + * API for setting the measurement configuration to
> + * Normal, Positive bias and Negative bias
> + *
> + * From the datasheet:
> + * 0 - Normal measurement configuration (default): In normal measurement
> + * configuration the device follows normal measurement flow. Pins BP
> + * and BN are left floating and high impedance.
> + *
> + * 1 - Positive bias configuration: In positive bias configuration, a
> + * positive current is forced across the resistive load on pins BP
> + * and BN.
> + *
> + * 2 - Negative bias configuration. In negative bias configuration, a
> + * negative current is forced across the resistive load on pins BP
> + * and BN.
> + *
> + * 3 - Only available on HMC5983. Magnetic sensor is disabled.
> + * Temperature sensor is enabled.
> + */
> +
> +static const char *const hmc5843_meas_conf_modes[] = {"normal", 
> "positivebias",
> +   "negativebias"};
> +
> +static const char *const hmc5983_meas_conf_modes[] = {"normal", 
> "positivebias",
> +   "negativebias",
> +   "disabled"};
>  /* Scaling factors: 1000/Gain */
>  static const int hmc5843_regval_to_nanoscale[] = {
>   6173, 7692, 10309, 12821, 18868, 21739, 25641, 35714
> @@ -173,24 +200,6 @@ static int hmc5843_read_measurement(struct hmc5843_data 
> *data,
>   return IIO_VAL_INT;
>  }
>  
> -/*
> - * API for setting the measurement configuration to
> - * Normal, Positive bias and Negative bias
> - *
> - * From the datasheet:
> - * 0 - Normal measurement configuration (default): In normal measurement
> - * configuration the device follows normal measurement flow. Pins BP
> - * and BN are left floating and high impedance.
> - *
> - * 1 - Positive bias configuration: In positive bias configuration, a
> - * positive current is forced across the resistive load on pins BP
> - * and BN.
> - *
> - * 2 - Negative bias configuration. In negative bias configuration, a
> - * negative current is forced across the resistive load on pins BP
> - * and BN.
> - *
> - */
>  static int hmc5843_set_meas_conf(struct hmc5843_data *data, u8 meas_conf)
>  {
>   int ret;
> @@ -204,48 +213,55 @@ static int hmc5843_set_meas_conf(struct 

Re: [PATCH] staging: xgifb: Fix comment style

2016-02-21 Thread Kroah-Hartman
On Sun, Feb 21, 2016 at 04:59:17PM +0800, Bo YU wrote:
> Hello,
> 
> On Sat, Feb 20, 2016 at 03:38:15PM -0800, Kroah-Hartman wrote:
> >On Wed, Feb 17, 2016 at 02:53:34PM +0800, Bo YU wrote:
> >> Fix comments to use trailing */ on separate lines.
> >>
> >> Signed-off-by: YU BO 
> >> ---
> >>   drivers/staging/xgifb/vb_init.c |   10 +-
> >>   1 file changed, 5 insertions(+), 5 deletions(-)
> >
> >Patch doesn't apply :(
> I don't know that whether i am doing wrong something with git.
> Because when i run `git am the-codingfixed-patch` ,it reports error.

Yes, that is the problem, please work on fixing that.  I don't have the
time to determine exactly what the error is, sorry.

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: rdma: hfi1: verbs_mcast: fixed a brace coding style issue

2016-02-21 Thread Jannik Becher
Fixed a coding style issue.

Signed-off-by: Jannik Becher 
---
 drivers/staging/rdma/hfi1/verbs_mcast.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rdma/hfi1/verbs_mcast.c 
b/drivers/staging/rdma/hfi1/verbs_mcast.c
index afc6b4c..c45d4b1 100644
--- a/drivers/staging/rdma/hfi1/verbs_mcast.c
+++ b/drivers/staging/rdma/hfi1/verbs_mcast.c
@@ -140,11 +140,11 @@ struct hfi1_mcast *hfi1_mcast_find(struct hfi1_ibport 
*ibp, union ib_gid *mgid)
 
ret = memcmp(mgid->raw, mcast->mgid.raw,
 sizeof(union ib_gid));
-   if (ret < 0)
+   if (ret < 0) {
n = n->rb_left;
-   else if (ret > 0)
+   } else if (ret > 0) {
n = n->rb_right;
-   else {
+   } else {
atomic_inc(>refcount);
spin_unlock_irqrestore(>lock, flags);
goto bail;
-- 
2.5.0

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


Re: [PATCH] staging: xgifb: Fix comment style

2016-02-21 Thread Roger H Newell
Hello:

I think you need to make sure your staging-testing tree is current
before creating a patch.

git checkout staging-testing && git fetch origin
git checkout my-branch && git rebase origin/staging-testing

As I understand it any patch you create after those commands will be
on-top of the current state of Gregs tree and should apply.

Regards:
Roger H. Newell

On Sun, Feb 21, 2016 at 5:29 AM, Bo YU  wrote:
> Hello,
>
> On Sat, Feb 20, 2016 at 03:38:15PM -0800, Kroah-Hartman wrote:
>>On Wed, Feb 17, 2016 at 02:53:34PM +0800, Bo YU wrote:
>>> Fix comments to use trailing */ on separate lines.
>>>
>>> Signed-off-by: YU BO 
>>> ---
>>>   drivers/staging/xgifb/vb_init.c |   10 +-
>>>   1 file changed, 5 insertions(+), 5 deletions(-)
>>
>>Patch doesn't apply :(
> I don't know that whether i am doing wrong something with git.
> Because when i run `git am the-codingfixed-patch` ,it reports error.
> But run `patch -p1 the-codingfixed-patch` it is ok.
>
> Perhaps i am wrong with others.
>
> Could you tell me a little hit?
>
> Sorry for the noisy.:)
> --
> Best Regards
> ___
> devel mailing list
> de...@linuxdriverproject.org
> http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: xgifb: Fix comment style

2016-02-21 Thread Bo YU
Hello,

On Sat, Feb 20, 2016 at 03:38:15PM -0800, Kroah-Hartman wrote:
>On Wed, Feb 17, 2016 at 02:53:34PM +0800, Bo YU wrote:
>> Fix comments to use trailing */ on separate lines.
>>
>> Signed-off-by: YU BO 
>> ---
>>   drivers/staging/xgifb/vb_init.c |   10 +-
>>   1 file changed, 5 insertions(+), 5 deletions(-)
>
>Patch doesn't apply :(
I don't know that whether i am doing wrong something with git.
Because when i run `git am the-codingfixed-patch` ,it reports error.
But run `patch -p1 the-codingfixed-patch` it is ok.

Perhaps i am wrong with others.

Could you tell me a little hit?

Sorry for the noisy.:)
--
Best Regards
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel