Re: [PATCH 4/5] ath10k: clean up cont frag desc init code

2016-01-20 Thread Michal Kazior
On 20 January 2016 at 20:34, Ben Greear  wrote:
> On 01/13/2016 06:01 AM, Michal Kazior wrote:
>>
>> This makes the code easier to extend and re-use.
>>
>> While at it fix _warn to _err. Other than that
>> there are no functional changes.
>>
>> Signed-off-by: Michal Kazior 
>> ---
>>   drivers/net/wireless/ath/ath10k/htt_tx.c | 58
>> ++--
>>   1 file changed, 41 insertions(+), 17 deletions(-)
>>
>> diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c
>> b/drivers/net/wireless/ath/ath10k/htt_tx.c
>> index b3adadb5f824..41a9811820e8 100644
>> --- a/drivers/net/wireless/ath/ath10k/htt_tx.c
>> +++ b/drivers/net/wireless/ath/ath10k/htt_tx.c
>> @@ -97,6 +97,41 @@ void ath10k_htt_tx_free_msdu_id(struct ath10k_htt *htt,
>> u16 msdu_id)
>> idr_remove(>pending_tx, msdu_id);
>>   }
>>
>> +static void ath10k_htt_tx_free_cont_frag_desc(struct ath10k_htt *htt)
>> +{
>> +   size_t size;
>> +
>> +   if (!htt->frag_desc.vaddr)
>> +   return;
>> +
>> +   size = htt->max_num_pending_tx * sizeof(struct htt_msdu_ext_desc);
>> +
>> +   dma_free_coherent(htt->ar->dev,
>> + size,
>> + htt->frag_desc.vaddr,
>> + htt->frag_desc.paddr);
>> +}
>> +
>> +static int ath10k_htt_tx_alloc_cont_frag_desc(struct ath10k_htt *htt)
>> +{
>> +   struct ath10k *ar = htt->ar;
>> +   size_t size;
>> +
>> +   if (!ar->hw_params.continuous_frag_desc)
>> +   return 0;
>> +
>> +   size = htt->max_num_pending_tx * sizeof(struct htt_msdu_ext_desc);
>> +   htt->frag_desc.vaddr = dma_alloc_coherent(ar->dev, size,
>> + >frag_desc.paddr,
>> + GFP_DMA);
>
>
> Did you mean to change GFP_KERNEL to GFP_DMA?

Ah, good catch! I obviously meant to keep GFP_KERNEL. I must've missed
that during a rebase at some point.


Michał
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 09/27] staging: wilc1000: rename u32ReceiversCount in struct message_queue

2016-01-20 Thread Chaehyun Lim
This patch renames u32ReceiversCount to recv_count to avoid camelcase.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/wilc_msgqueue.c | 10 +-
 drivers/staging/wilc1000/wilc_msgqueue.h |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c 
b/drivers/staging/wilc1000/wilc_msgqueue.c
index 47ba256..363e003 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -16,7 +16,7 @@ int wilc_mq_create(struct message_queue *pHandle)
spin_lock_init(>lock);
sema_init(>sem, 0);
pHandle->pstrMessageList = NULL;
-   pHandle->u32ReceiversCount = 0;
+   pHandle->recv_count = 0;
pHandle->exiting = false;
return 0;
 }
@@ -32,9 +32,9 @@ int wilc_mq_destroy(struct message_queue *pHandle)
pHandle->exiting = true;
 
/* Release any waiting receiver thread. */
-   while (pHandle->u32ReceiversCount > 0) {
+   while (pHandle->recv_count > 0) {
up(>sem);
-   pHandle->u32ReceiversCount--;
+   pHandle->recv_count--;
}
 
while (pHandle->pstrMessageList) {
@@ -129,7 +129,7 @@ int wilc_mq_recv(struct message_queue *pHandle,
}
 
spin_lock_irqsave(>lock, flags);
-   pHandle->u32ReceiversCount++;
+   pHandle->recv_count++;
spin_unlock_irqrestore(>lock, flags);
 
down(>sem);
@@ -150,7 +150,7 @@ int wilc_mq_recv(struct message_queue *pHandle,
}
 
/* consume the message */
-   pHandle->u32ReceiversCount--;
+   pHandle->recv_count--;
memcpy(pvRecvBuffer, pstrMessage->buf, pstrMessage->len);
*pu32ReceivedLength = pstrMessage->len;
 
diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h 
b/drivers/staging/wilc1000/wilc_msgqueue.h
index 2c21b3e..dcf54ea 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.h
+++ b/drivers/staging/wilc1000/wilc_msgqueue.h
@@ -23,7 +23,7 @@ struct message_queue {
struct semaphore sem;
spinlock_t lock;
bool exiting;
-   u32 u32ReceiversCount;
+   u32 recv_count;
struct message *pstrMessageList;
 };
 
-- 
2.6.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 11/27] staging: wilc1000: rename pHandle in wilc_mq_create

2016-01-20 Thread Chaehyun Lim
This patch renames pHandle to mq to avoid camelcase

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/wilc_msgqueue.c | 12 ++--
 drivers/staging/wilc1000/wilc_msgqueue.h |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c 
b/drivers/staging/wilc1000/wilc_msgqueue.c
index d13c9a7..453fa19 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -11,13 +11,13 @@
  *  @note  copied from FLO glue implementatuion
  *  @version   1.0
  */
-int wilc_mq_create(struct message_queue *pHandle)
+int wilc_mq_create(struct message_queue *mq)
 {
-   spin_lock_init(>lock);
-   sema_init(>sem, 0);
-   pHandle->msg_list = NULL;
-   pHandle->recv_count = 0;
-   pHandle->exiting = false;
+   spin_lock_init(>lock);
+   sema_init(>sem, 0);
+   mq->msg_list = NULL;
+   mq->recv_count = 0;
+   mq->exiting = false;
return 0;
 }
 
diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h 
b/drivers/staging/wilc1000/wilc_msgqueue.h
index 7e7ec06..bfd2347 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.h
+++ b/drivers/staging/wilc1000/wilc_msgqueue.h
@@ -40,7 +40,7 @@ struct message_queue {
  *  @date  30 Aug 2010
  *  @version   1.0
  */
-int wilc_mq_create(struct message_queue *pHandle);
+int wilc_mq_create(struct message_queue *mq);
 
 /*!
  *  @brief Sends a message
-- 
2.6.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 01/27] staging: wilc1000: rename struct __Message_struct

2016-01-20 Thread Chaehyun Lim
This patch renames typedef from struct __Message_struct and renames it
to struct message.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/wilc_msgqueue.c | 10 +-
 drivers/staging/wilc1000/wilc_msgqueue.h |  8 
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c 
b/drivers/staging/wilc1000/wilc_msgqueue.c
index abc780c..9b78fcd 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -38,7 +38,7 @@ int wilc_mq_destroy(WILC_MsgQueueHandle *pHandle)
}
 
while (pHandle->pstrMessageList) {
-   Message *pstrMessge = pHandle->pstrMessageList->pstrNext;
+   struct message *pstrMessge = pHandle->pstrMessageList->pstrNext;
 
kfree(pHandle->pstrMessageList);
pHandle->pstrMessageList = pstrMessge;
@@ -57,7 +57,7 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle,
 const void *pvSendBuffer, u32 u32SendBufferSize)
 {
unsigned long flags;
-   Message *pstrMessage = NULL;
+   struct message *pstrMessage = NULL;
 
if ((!pHandle) || (u32SendBufferSize == 0) || (!pvSendBuffer)) {
PRINT_ER("pHandle or pvSendBuffer is null\n");
@@ -70,7 +70,7 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle,
}
 
/* construct a new message */
-   pstrMessage = kmalloc(sizeof(Message), GFP_ATOMIC);
+   pstrMessage = kmalloc(sizeof(struct message), GFP_ATOMIC);
if (!pstrMessage)
return -ENOMEM;
 
@@ -89,7 +89,7 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle,
if (!pHandle->pstrMessageList) {
pHandle->pstrMessageList  = pstrMessage;
} else {
-   Message *pstrTailMsg = pHandle->pstrMessageList;
+   struct message *pstrTailMsg = pHandle->pstrMessageList;
 
while (pstrTailMsg->pstrNext)
pstrTailMsg = pstrTailMsg->pstrNext;
@@ -114,7 +114,7 @@ int wilc_mq_recv(WILC_MsgQueueHandle *pHandle,
 void *pvRecvBuffer, u32 u32RecvBufferSize,
 u32 *pu32ReceivedLength)
 {
-   Message *pstrMessage;
+   struct message *pstrMessage;
unsigned long flags;
 
if ((!pHandle) || (u32RecvBufferSize == 0)
diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h 
b/drivers/staging/wilc1000/wilc_msgqueue.h
index d7e0328..1a7c652 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.h
+++ b/drivers/staging/wilc1000/wilc_msgqueue.h
@@ -13,18 +13,18 @@
 #include 
 
 /* Message Queue type is a structure */
-typedef struct __Message_struct {
+struct message {
void *pvBuffer;
u32 u32Length;
-   struct __Message_struct *pstrNext;
-} Message;
+   struct message *pstrNext;
+};
 
 typedef struct __MessageQueue_struct {
struct semaphore hSem;
spinlock_t strCriticalSection;
bool bExiting;
u32 u32ReceiversCount;
-   Message *pstrMessageList;
+   struct message *pstrMessageList;
 } WILC_MsgQueueHandle;
 
 /*!
-- 
2.6.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 04/27] staging: wilc1000: rename pstrNext in struct message

2016-01-20 Thread Chaehyun Lim
This patch renames pstrNext to next to avoid camelcase.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/wilc_msgqueue.c | 12 ++--
 drivers/staging/wilc1000/wilc_msgqueue.h |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c 
b/drivers/staging/wilc1000/wilc_msgqueue.c
index 0e66a64..4d79a31 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -38,7 +38,7 @@ int wilc_mq_destroy(WILC_MsgQueueHandle *pHandle)
}
 
while (pHandle->pstrMessageList) {
-   struct message *pstrMessge = pHandle->pstrMessageList->pstrNext;
+   struct message *pstrMessge = pHandle->pstrMessageList->next;
 
kfree(pHandle->pstrMessageList);
pHandle->pstrMessageList = pstrMessge;
@@ -75,7 +75,7 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle,
return -ENOMEM;
 
pstrMessage->len = u32SendBufferSize;
-   pstrMessage->pstrNext = NULL;
+   pstrMessage->next = NULL;
pstrMessage->buf = kmemdup(pvSendBuffer, u32SendBufferSize,
   GFP_ATOMIC);
if (!pstrMessage->buf) {
@@ -91,10 +91,10 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle,
} else {
struct message *pstrTailMsg = pHandle->pstrMessageList;
 
-   while (pstrTailMsg->pstrNext)
-   pstrTailMsg = pstrTailMsg->pstrNext;
+   while (pstrTailMsg->next)
+   pstrTailMsg = pstrTailMsg->next;
 
-   pstrTailMsg->pstrNext = pstrMessage;
+   pstrTailMsg->next = pstrMessage;
}
 
spin_unlock_irqrestore(>strCriticalSection, flags);
@@ -154,7 +154,7 @@ int wilc_mq_recv(WILC_MsgQueueHandle *pHandle,
memcpy(pvRecvBuffer, pstrMessage->buf, pstrMessage->len);
*pu32ReceivedLength = pstrMessage->len;
 
-   pHandle->pstrMessageList = pstrMessage->pstrNext;
+   pHandle->pstrMessageList = pstrMessage->next;
 
kfree(pstrMessage->buf);
kfree(pstrMessage);
diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h 
b/drivers/staging/wilc1000/wilc_msgqueue.h
index b0ccd1d..ec503c3 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.h
+++ b/drivers/staging/wilc1000/wilc_msgqueue.h
@@ -16,7 +16,7 @@
 struct message {
void *buf;
u32 len;
-   struct message *pstrNext;
+   struct message *next;
 };
 
 typedef struct __MessageQueue_struct {
-- 
2.6.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 02/27] staging: wilc1000: rename pvBuffer in struct message

2016-01-20 Thread Chaehyun Lim
This patch renames pvBuffer to buf to avoid camelcase.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/wilc_msgqueue.c | 10 +-
 drivers/staging/wilc1000/wilc_msgqueue.h |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c 
b/drivers/staging/wilc1000/wilc_msgqueue.c
index 9b78fcd..a4e612d 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -76,9 +76,9 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle,
 
pstrMessage->u32Length = u32SendBufferSize;
pstrMessage->pstrNext = NULL;
-   pstrMessage->pvBuffer = kmemdup(pvSendBuffer, u32SendBufferSize,
-   GFP_ATOMIC);
-   if (!pstrMessage->pvBuffer) {
+   pstrMessage->buf = kmemdup(pvSendBuffer, u32SendBufferSize,
+  GFP_ATOMIC);
+   if (!pstrMessage->buf) {
kfree(pstrMessage);
return -ENOMEM;
}
@@ -151,12 +151,12 @@ int wilc_mq_recv(WILC_MsgQueueHandle *pHandle,
 
/* consume the message */
pHandle->u32ReceiversCount--;
-   memcpy(pvRecvBuffer, pstrMessage->pvBuffer, pstrMessage->u32Length);
+   memcpy(pvRecvBuffer, pstrMessage->buf, pstrMessage->u32Length);
*pu32ReceivedLength = pstrMessage->u32Length;
 
pHandle->pstrMessageList = pstrMessage->pstrNext;
 
-   kfree(pstrMessage->pvBuffer);
+   kfree(pstrMessage->buf);
kfree(pstrMessage);
 
spin_unlock_irqrestore(>strCriticalSection, flags);
diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h 
b/drivers/staging/wilc1000/wilc_msgqueue.h
index 1a7c652..848ed82 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.h
+++ b/drivers/staging/wilc1000/wilc_msgqueue.h
@@ -14,7 +14,7 @@
 
 /* Message Queue type is a structure */
 struct message {
-   void *pvBuffer;
+   void *buf;
u32 u32Length;
struct message *pstrNext;
 };
-- 
2.6.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 08/27] staging: wilc1000: rename bExiting in struct message_queue

2016-01-20 Thread Chaehyun Lim
This patch renames bExiting to exiting to avoid camelcase.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/wilc_msgqueue.c | 8 
 drivers/staging/wilc1000/wilc_msgqueue.h | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c 
b/drivers/staging/wilc1000/wilc_msgqueue.c
index 67bf147..47ba256 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -17,7 +17,7 @@ int wilc_mq_create(struct message_queue *pHandle)
sema_init(>sem, 0);
pHandle->pstrMessageList = NULL;
pHandle->u32ReceiversCount = 0;
-   pHandle->bExiting = false;
+   pHandle->exiting = false;
return 0;
 }
 
@@ -29,7 +29,7 @@ int wilc_mq_create(struct message_queue *pHandle)
  */
 int wilc_mq_destroy(struct message_queue *pHandle)
 {
-   pHandle->bExiting = true;
+   pHandle->exiting = true;
 
/* Release any waiting receiver thread. */
while (pHandle->u32ReceiversCount > 0) {
@@ -64,7 +64,7 @@ int wilc_mq_send(struct message_queue *pHandle,
return -EFAULT;
}
 
-   if (pHandle->bExiting) {
+   if (pHandle->exiting) {
PRINT_ER("pHandle fail\n");
return -EFAULT;
}
@@ -123,7 +123,7 @@ int wilc_mq_recv(struct message_queue *pHandle,
return -EINVAL;
}
 
-   if (pHandle->bExiting) {
+   if (pHandle->exiting) {
PRINT_ER("pHandle fail\n");
return -EFAULT;
}
diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h 
b/drivers/staging/wilc1000/wilc_msgqueue.h
index 6cdebbf..2c21b3e 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.h
+++ b/drivers/staging/wilc1000/wilc_msgqueue.h
@@ -22,7 +22,7 @@ struct message {
 struct message_queue {
struct semaphore sem;
spinlock_t lock;
-   bool bExiting;
+   bool exiting;
u32 u32ReceiversCount;
struct message *pstrMessageList;
 };
-- 
2.6.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 10/27] staging: wilc1000: rename pstrMessageList in struct message_queue

2016-01-20 Thread Chaehyun Lim
This patch renames pstrMessageList to msg_list to avoid camelcase.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/wilc_msgqueue.c | 20 ++--
 drivers/staging/wilc1000/wilc_msgqueue.h |  2 +-
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c 
b/drivers/staging/wilc1000/wilc_msgqueue.c
index 363e003..d13c9a7 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -15,7 +15,7 @@ int wilc_mq_create(struct message_queue *pHandle)
 {
spin_lock_init(>lock);
sema_init(>sem, 0);
-   pHandle->pstrMessageList = NULL;
+   pHandle->msg_list = NULL;
pHandle->recv_count = 0;
pHandle->exiting = false;
return 0;
@@ -37,11 +37,11 @@ int wilc_mq_destroy(struct message_queue *pHandle)
pHandle->recv_count--;
}
 
-   while (pHandle->pstrMessageList) {
-   struct message *pstrMessge = pHandle->pstrMessageList->next;
+   while (pHandle->msg_list) {
+   struct message *pstrMessge = pHandle->msg_list->next;
 
-   kfree(pHandle->pstrMessageList);
-   pHandle->pstrMessageList = pstrMessge;
+   kfree(pHandle->msg_list);
+   pHandle->msg_list = pstrMessge;
}
 
return 0;
@@ -86,10 +86,10 @@ int wilc_mq_send(struct message_queue *pHandle,
spin_lock_irqsave(>lock, flags);
 
/* add it to the message queue */
-   if (!pHandle->pstrMessageList) {
-   pHandle->pstrMessageList  = pstrMessage;
+   if (!pHandle->msg_list) {
+   pHandle->msg_list  = pstrMessage;
} else {
-   struct message *pstrTailMsg = pHandle->pstrMessageList;
+   struct message *pstrTailMsg = pHandle->msg_list;
 
while (pstrTailMsg->next)
pstrTailMsg = pstrTailMsg->next;
@@ -135,7 +135,7 @@ int wilc_mq_recv(struct message_queue *pHandle,
down(>sem);
spin_lock_irqsave(>lock, flags);
 
-   pstrMessage = pHandle->pstrMessageList;
+   pstrMessage = pHandle->msg_list;
if (!pstrMessage) {
spin_unlock_irqrestore(>lock, flags);
PRINT_ER("pstrMessage is null\n");
@@ -154,7 +154,7 @@ int wilc_mq_recv(struct message_queue *pHandle,
memcpy(pvRecvBuffer, pstrMessage->buf, pstrMessage->len);
*pu32ReceivedLength = pstrMessage->len;
 
-   pHandle->pstrMessageList = pstrMessage->next;
+   pHandle->msg_list = pstrMessage->next;
 
kfree(pstrMessage->buf);
kfree(pstrMessage);
diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h 
b/drivers/staging/wilc1000/wilc_msgqueue.h
index dcf54ea..7e7ec06 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.h
+++ b/drivers/staging/wilc1000/wilc_msgqueue.h
@@ -24,7 +24,7 @@ struct message_queue {
spinlock_t lock;
bool exiting;
u32 recv_count;
-   struct message *pstrMessageList;
+   struct message *msg_list;
 };
 
 /*!
-- 
2.6.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] net:mac80211:mesh_plink: remove redundant sta_info check

2016-01-20 Thread Sunil Shahu
Remove unnecessory "if" statement and club it with previos "if" block.

Signed-off-by: Sunil Shahu 
---
 net/mac80211/mesh_plink.c | 9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
index bd3d55e..e5851ae 100644
--- a/net/mac80211/mesh_plink.c
+++ b/net/mac80211/mesh_plink.c
@@ -976,6 +976,9 @@ mesh_plink_get_event(struct ieee80211_sub_if_data *sdata,
mpl_dbg(sdata, "Mesh plink error: no more free 
plinks\n");
goto out;
}
+   /* new matching peer */
+   event = OPN_ACPT;
+   goto out;
} else {
if (!test_sta_flag(sta, WLAN_STA_AUTH)) {
mpl_dbg(sdata, "Mesh plink: Action frame from 
non-authed peer\n");
@@ -985,12 +988,6 @@ mesh_plink_get_event(struct ieee80211_sub_if_data *sdata,
goto out;
}
 
-   /* new matching peer */
-   if (!sta) {
-   event = OPN_ACPT;
-   goto out;
-   }
-
switch (ftype) {
case WLAN_SP_MESH_PEERING_OPEN:
if (!matches_local)
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] rtlwifi: rtl8821ae: Fix 5G failure when EEPROM is incorrectly encoded

2016-01-20 Thread Larry Finger
Recently, it has been reported that D-Link DWA-582 cards, which use an
RTL8812AE chip are not able to scan for 5G networks. The problems started
with kernel 4.2, which is the first version that had commit d10101a60372
("rtlwifi: rtl8821ae: Fix problem with regulatory information"). With this
patch, the driver went from setting a default channel plan to using
the value derived from EEPROM.

Bug reports at https://bugzilla.kernel.org/show_bug.cgi?id=111031 and
https://bugzilla.redhat.com/show_bug.cgi?id=1279653 are examples of this
problem.

The problem was solved once I learned that the internal country code was
resulting in a regulatory set with only 2.4 GHz channels. With the RTL8821AE
chips available to me, the country code was such that both 2.4 and 5 GHz
channels are allowed. The fix is to allow both bands even when the EEPROM
is incorrectly encoded.

Fixes: d10101a60372 ("rtlwifi: rtl8821ae: Fix problem with regulatory 
information")
Signed-off-by: Larry Finger 
Cc: littlesmart...@gmail.com
Cc: g...@codehaus.org
Cc: Stable  [v4.2+]
---
 drivers/net/wireless/realtek/rtlwifi/regd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/regd.c 
b/drivers/net/wireless/realtek/rtlwifi/regd.c
index a62bf0a..5be3411 100644
--- a/drivers/net/wireless/realtek/rtlwifi/regd.c
+++ b/drivers/net/wireless/realtek/rtlwifi/regd.c
@@ -351,7 +351,6 @@ static const struct ieee80211_regdomain 
*_rtl_regdomain_select(
case COUNTRY_CODE_SPAIN:
case COUNTRY_CODE_FRANCE:
case COUNTRY_CODE_ISRAEL:
-   case COUNTRY_CODE_WORLD_WIDE_13:
return _regdom_12_13;
case COUNTRY_CODE_MKK:
case COUNTRY_CODE_MKK1:
@@ -360,6 +359,7 @@ static const struct ieee80211_regdomain 
*_rtl_regdomain_select(
return _regdom_14_60_64;
case COUNTRY_CODE_GLOBAL_DOMAIN:
return _regdom_14;
+   case COUNTRY_CODE_WORLD_WIDE_13:
case COUNTRY_CODE_WORLD_WIDE_13_5G_ALL:
return _regdom_12_13_5g_all;
default:
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 26/27] staging: wilc1000: fix logical continuations

2016-01-20 Thread Chaehyun Lim
This patch fixes logical continuations found by checkpatch
CHECK: Logical continuations should be on the previous line

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/wilc_msgqueue.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c 
b/drivers/staging/wilc1000/wilc_msgqueue.c
index c7a60f4..4493ca9 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -115,8 +115,7 @@ int wilc_mq_recv(struct message_queue *mq,
struct message *msg;
unsigned long flags;
 
-   if ((!mq) || (recv_buf_size == 0)
-   || (!recv_buf) || (!recv_len)) {
+   if ((!mq) || (recv_buf_size == 0) || (!recv_buf) || (!recv_len)) {
PRINT_ER("mq or recv_buf is null\n");
return -EINVAL;
}
-- 
2.6.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 27/27] staging: wilc1000: remove over-commenting

2016-01-20 Thread Chaehyun Lim
There are over-commenting in wilc_msgqueue.h file. This comment is not
explain exactly what codes do and make checkpatch warning about "line
over 80 charcters". If necessary, comment will be added later with
preferred coding style.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/wilc_msgqueue.h | 66 
 1 file changed, 66 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h 
b/drivers/staging/wilc1000/wilc_msgqueue.h
index 4f79ead..ddd09843 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.h
+++ b/drivers/staging/wilc1000/wilc_msgqueue.h
@@ -1,18 +1,8 @@
 #ifndef __WILC_MSG_QUEUE_H__
 #define __WILC_MSG_QUEUE_H__
 
-/*!
- *  @file  wilc_msgqueue.h
- *  @brief Message Queue OS wrapper functionality
- *  @authorsyounan
- *  @sawilc_oswrapper.h top level OS wrapper file
- *  @date  30 Aug 2010
- *  @version   1.0
- */
-
 #include 
 
-/* Message Queue type is a structure */
 struct message {
void *buf;
u32 len;
@@ -27,67 +17,11 @@ struct message_queue {
struct message *msg_list;
 };
 
-/*!
- *  @brief Creates a new Message queue
- *  @details   Creates a new Message queue, if the feature
- *  CONFIG_WILC_MSG_QUEUE_IPC_NAME is enabled and 
pstrAttrs->pcName
- *  is not Null, then this message queue can be 
used for IPC with
- *  any other message queue having the same name 
in the system
- *  @param[in,out] pHandle handle to the message queue object
- *  @param[in] pstrAttrs Optional attributes, NULL for default
- *  @returnError code indicating success/failure
- *  @authorsyounan
- *  @date  30 Aug 2010
- *  @version   1.0
- */
 int wilc_mq_create(struct message_queue *mq);
-
-/*!
- *  @brief Sends a message
- *  @details   Sends a message, this API will block until the message 
is
- *  actually sent or until it is timedout (as long 
as the feature
- *  CONFIG_WILC_MSG_QUEUE_TIMEOUT is enabled and 
pstrAttrs->u32Timeout
- *  is not set to WILC_OS_INFINITY), zero timeout 
is a valid value
- *  @param[in] pHandle handle to the message queue object
- *  @param[in] pvSendBuffer pointer to the data to send
- *  @param[in] u32SendBufferSize the size of the data to send
- *  @param[in] pstrAttrs Optional attributes, NULL for default
- *  @returnError code indicating success/failure
- *  @authorsyounan
- *  @date  30 Aug 2010
- *  @version   1.0
- */
 int wilc_mq_send(struct message_queue *mq,
 const void *send_buf, u32 send_buf_size);
-
-/*!
- *  @brief Receives a message
- *  @details   Receives a message, this API will block until a message 
is
- *  received or until it is timedout (as long as 
the feature
- *  CONFIG_WILC_MSG_QUEUE_TIMEOUT is enabled and 
pstrAttrs->u32Timeout
- *  is not set to WILC_OS_INFINITY), zero timeout 
is a valid value
- *  @param[in] pHandle handle to the message queue object
- *  @param[out]pvRecvBuffer pointer to a buffer to fill with the 
received message
- *  @param[in] u32RecvBufferSize the size of the receive buffer
- *  @param[out]pu32ReceivedLength the length of received data
- *  @param[in] pstrAttrs Optional attributes, NULL for default
- *  @returnError code indicating success/failure
- *  @authorsyounan
- *  @date  30 Aug 2010
- *  @version   1.0
- */
 int wilc_mq_recv(struct message_queue *mq,
 void *recv_buf, u32 recv_buf_size, u32 *recv_len);
-
-/*!
- *  @brief Destroys an existing  Message queue
- *  @param[in] pHandle handle to the message queue object
- *  @param[in] pstrAttrs Optional attributes, NULL for default
- *  @returnError code indicating success/failure
- *  @authorsyounan
- *  @date  30 Aug 2010
- *  @version   1.0
- */
 int wilc_mq_destroy(struct message_queue *mq);
 
 #endif
-- 
2.6.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 18/27] staging: wilc1000: rename tail_msg in wilc_mq_send

2016-01-20 Thread Chaehyun Lim
This patch renames pstrTailMsg to tail_msg to avoid camelcase.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/wilc_msgqueue.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c 
b/drivers/staging/wilc1000/wilc_msgqueue.c
index 9a80fe6..764723f 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -88,12 +88,12 @@ int wilc_mq_send(struct message_queue *mq,
if (!mq->msg_list) {
mq->msg_list  = new_msg;
} else {
-   struct message *pstrTailMsg = mq->msg_list;
+   struct message *tail_msg = mq->msg_list;
 
-   while (pstrTailMsg->next)
-   pstrTailMsg = pstrTailMsg->next;
+   while (tail_msg->next)
+   tail_msg = tail_msg->next;
 
-   pstrTailMsg->next = new_msg;
+   tail_msg->next = new_msg;
}
 
spin_unlock_irqrestore(>lock, flags);
-- 
2.6.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 24/27] staging: wilc1000: rename pstrMessage in wilc_mq_recv

2016-01-20 Thread Chaehyun Lim
This patch renames pstrMessage to msg to avoid camelcase.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/wilc_msgqueue.c | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c 
b/drivers/staging/wilc1000/wilc_msgqueue.c
index 5601de8..7107715 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -112,7 +112,7 @@ int wilc_mq_send(struct message_queue *mq,
 int wilc_mq_recv(struct message_queue *mq,
 void *recv_buf, u32 recv_buf_size, u32 *recv_len)
 {
-   struct message *pstrMessage;
+   struct message *msg;
unsigned long flags;
 
if ((!mq) || (recv_buf_size == 0)
@@ -133,14 +133,14 @@ int wilc_mq_recv(struct message_queue *mq,
down(>sem);
spin_lock_irqsave(>lock, flags);
 
-   pstrMessage = mq->msg_list;
-   if (!pstrMessage) {
+   msg = mq->msg_list;
+   if (!msg) {
spin_unlock_irqrestore(>lock, flags);
-   PRINT_ER("pstrMessage is null\n");
+   PRINT_ER("msg is null\n");
return -EFAULT;
}
/* check buffer size */
-   if (recv_buf_size < pstrMessage->len) {
+   if (recv_buf_size < msg->len) {
spin_unlock_irqrestore(>lock, flags);
up(>sem);
PRINT_ER("recv_buf_size overflow\n");
@@ -149,13 +149,13 @@ int wilc_mq_recv(struct message_queue *mq,
 
/* consume the message */
mq->recv_count--;
-   memcpy(recv_buf, pstrMessage->buf, pstrMessage->len);
-   *recv_len = pstrMessage->len;
+   memcpy(recv_buf, msg->buf, msg->len);
+   *recv_len = msg->len;
 
-   mq->msg_list = pstrMessage->next;
+   mq->msg_list = msg->next;
 
-   kfree(pstrMessage->buf);
-   kfree(pstrMessage);
+   kfree(msg->buf);
+   kfree(msg);
 
spin_unlock_irqrestore(>lock, flags);
 
-- 
2.6.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 19/27] staging: wilc1000: fix return error code

2016-01-20 Thread Chaehyun Lim
Three argument are checked at the beginning of wilc_mq_send whether
they are valid arguments or not. It is correct to use return error code
as -EINVAL, not -EFAULT.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/wilc_msgqueue.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c 
b/drivers/staging/wilc1000/wilc_msgqueue.c
index 764723f..361ca8f 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -61,7 +61,7 @@ int wilc_mq_send(struct message_queue *mq,
 
if ((!mq) || (send_buf_size == 0) || (!send_buf)) {
PRINT_ER("mq or send_buf is null\n");
-   return -EFAULT;
+   return -EINVAL;
}
 
if (mq->exiting) {
-- 
2.6.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 20/27] staging: wilc1000: rename pHandle in wilc_mq_recv

2016-01-20 Thread Chaehyun Lim
This patch renames pHandle to mq to avoid camelcase.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/wilc_msgqueue.c | 34 
 drivers/staging/wilc1000/wilc_msgqueue.h |  2 +-
 2 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c 
b/drivers/staging/wilc1000/wilc_msgqueue.c
index 361ca8f..d2df179 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -109,56 +109,56 @@ int wilc_mq_send(struct message_queue *mq,
  *  @note  copied from FLO glue implementatuion
  *  @version   1.0
  */
-int wilc_mq_recv(struct message_queue *pHandle,
+int wilc_mq_recv(struct message_queue *mq,
 void *pvRecvBuffer, u32 u32RecvBufferSize,
 u32 *pu32ReceivedLength)
 {
struct message *pstrMessage;
unsigned long flags;
 
-   if ((!pHandle) || (u32RecvBufferSize == 0)
+   if ((!mq) || (u32RecvBufferSize == 0)
|| (!pvRecvBuffer) || (!pu32ReceivedLength)) {
-   PRINT_ER("pHandle or pvRecvBuffer is null\n");
+   PRINT_ER("mq or pvRecvBuffer is null\n");
return -EINVAL;
}
 
-   if (pHandle->exiting) {
-   PRINT_ER("pHandle fail\n");
+   if (mq->exiting) {
+   PRINT_ER("mq fail\n");
return -EFAULT;
}
 
-   spin_lock_irqsave(>lock, flags);
-   pHandle->recv_count++;
-   spin_unlock_irqrestore(>lock, flags);
+   spin_lock_irqsave(>lock, flags);
+   mq->recv_count++;
+   spin_unlock_irqrestore(>lock, flags);
 
-   down(>sem);
-   spin_lock_irqsave(>lock, flags);
+   down(>sem);
+   spin_lock_irqsave(>lock, flags);
 
-   pstrMessage = pHandle->msg_list;
+   pstrMessage = mq->msg_list;
if (!pstrMessage) {
-   spin_unlock_irqrestore(>lock, flags);
+   spin_unlock_irqrestore(>lock, flags);
PRINT_ER("pstrMessage is null\n");
return -EFAULT;
}
/* check buffer size */
if (u32RecvBufferSize < pstrMessage->len) {
-   spin_unlock_irqrestore(>lock, flags);
-   up(>sem);
+   spin_unlock_irqrestore(>lock, flags);
+   up(>sem);
PRINT_ER("u32RecvBufferSize overflow\n");
return -EOVERFLOW;
}
 
/* consume the message */
-   pHandle->recv_count--;
+   mq->recv_count--;
memcpy(pvRecvBuffer, pstrMessage->buf, pstrMessage->len);
*pu32ReceivedLength = pstrMessage->len;
 
-   pHandle->msg_list = pstrMessage->next;
+   mq->msg_list = pstrMessage->next;
 
kfree(pstrMessage->buf);
kfree(pstrMessage);
 
-   spin_unlock_irqrestore(>lock, flags);
+   spin_unlock_irqrestore(>lock, flags);
 
return 0;
 }
diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h 
b/drivers/staging/wilc1000/wilc_msgqueue.h
index 70e1be1..0c1eead 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.h
+++ b/drivers/staging/wilc1000/wilc_msgqueue.h
@@ -76,7 +76,7 @@ int wilc_mq_send(struct message_queue *mq,
  *  @date  30 Aug 2010
  *  @version   1.0
  */
-int wilc_mq_recv(struct message_queue *pHandle,
+int wilc_mq_recv(struct message_queue *mq,
 void *pvRecvBuffer, u32 u32RecvBufferSize,
 u32 *pu32ReceivedLength);
 
-- 
2.6.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 22/27] staging: wilc1000: rename u32RecvBufferSize in wilc_mq_recv

2016-01-20 Thread Chaehyun Lim
This patch renames u32RecvBufferSize to recv_buf_size to avoid
camelcase.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/wilc_msgqueue.c | 8 
 drivers/staging/wilc1000/wilc_msgqueue.h | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c 
b/drivers/staging/wilc1000/wilc_msgqueue.c
index b836b2e..c86bd7c 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -110,13 +110,13 @@ int wilc_mq_send(struct message_queue *mq,
  *  @version   1.0
  */
 int wilc_mq_recv(struct message_queue *mq,
-void *recv_buf, u32 u32RecvBufferSize,
+void *recv_buf, u32 recv_buf_size,
 u32 *pu32ReceivedLength)
 {
struct message *pstrMessage;
unsigned long flags;
 
-   if ((!mq) || (u32RecvBufferSize == 0)
+   if ((!mq) || (recv_buf_size == 0)
|| (!recv_buf) || (!pu32ReceivedLength)) {
PRINT_ER("mq or recv_buf is null\n");
return -EINVAL;
@@ -141,10 +141,10 @@ int wilc_mq_recv(struct message_queue *mq,
return -EFAULT;
}
/* check buffer size */
-   if (u32RecvBufferSize < pstrMessage->len) {
+   if (recv_buf_size < pstrMessage->len) {
spin_unlock_irqrestore(>lock, flags);
up(>sem);
-   PRINT_ER("u32RecvBufferSize overflow\n");
+   PRINT_ER("recv_buf_size overflow\n");
return -EOVERFLOW;
}
 
diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h 
b/drivers/staging/wilc1000/wilc_msgqueue.h
index 81b51dd..3804b3b 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.h
+++ b/drivers/staging/wilc1000/wilc_msgqueue.h
@@ -77,7 +77,7 @@ int wilc_mq_send(struct message_queue *mq,
  *  @version   1.0
  */
 int wilc_mq_recv(struct message_queue *mq,
-void *recv_buf, u32 u32RecvBufferSize,
+void *recv_buf, u32 recv_buf_size,
 u32 *pu32ReceivedLength);
 
 /*!
-- 
2.6.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 17/27] staging: wilc1000: rename pstrMessage in wilc_mq_send

2016-01-20 Thread Chaehyun Lim
This patch renames pstrMessage to new_msg to avoid camelcase.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/wilc_msgqueue.c | 21 ++---
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c 
b/drivers/staging/wilc1000/wilc_msgqueue.c
index 8e37cff0..9a80fe6 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -57,7 +57,7 @@ int wilc_mq_send(struct message_queue *mq,
 const void *send_buf, u32 send_buf_size)
 {
unsigned long flags;
-   struct message *pstrMessage = NULL;
+   struct message *new_msg = NULL;
 
if ((!mq) || (send_buf_size == 0) || (!send_buf)) {
PRINT_ER("mq or send_buf is null\n");
@@ -70,16 +70,15 @@ int wilc_mq_send(struct message_queue *mq,
}
 
/* construct a new message */
-   pstrMessage = kmalloc(sizeof(struct message), GFP_ATOMIC);
-   if (!pstrMessage)
+   new_msg = kmalloc(sizeof(struct message), GFP_ATOMIC);
+   if (!new_msg)
return -ENOMEM;
 
-   pstrMessage->len = send_buf_size;
-   pstrMessage->next = NULL;
-   pstrMessage->buf = kmemdup(send_buf, send_buf_size,
-  GFP_ATOMIC);
-   if (!pstrMessage->buf) {
-   kfree(pstrMessage);
+   new_msg->len = send_buf_size;
+   new_msg->next = NULL;
+   new_msg->buf = kmemdup(send_buf, send_buf_size, GFP_ATOMIC);
+   if (!new_msg->buf) {
+   kfree(new_msg);
return -ENOMEM;
}
 
@@ -87,14 +86,14 @@ int wilc_mq_send(struct message_queue *mq,
 
/* add it to the message queue */
if (!mq->msg_list) {
-   mq->msg_list  = pstrMessage;
+   mq->msg_list  = new_msg;
} else {
struct message *pstrTailMsg = mq->msg_list;
 
while (pstrTailMsg->next)
pstrTailMsg = pstrTailMsg->next;
 
-   pstrTailMsg->next = pstrMessage;
+   pstrTailMsg->next = new_msg;
}
 
spin_unlock_irqrestore(>lock, flags);
-- 
2.6.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 21/27] staging: wilc1000: rename pvRecvBuffer in wilc_mq_recv

2016-01-20 Thread Chaehyun Lim
This patch renames pvRecvBuffer to recv_buf to avoid camelcase.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/wilc_msgqueue.c | 8 
 drivers/staging/wilc1000/wilc_msgqueue.h | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c 
b/drivers/staging/wilc1000/wilc_msgqueue.c
index d2df179..b836b2e 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -110,15 +110,15 @@ int wilc_mq_send(struct message_queue *mq,
  *  @version   1.0
  */
 int wilc_mq_recv(struct message_queue *mq,
-void *pvRecvBuffer, u32 u32RecvBufferSize,
+void *recv_buf, u32 u32RecvBufferSize,
 u32 *pu32ReceivedLength)
 {
struct message *pstrMessage;
unsigned long flags;
 
if ((!mq) || (u32RecvBufferSize == 0)
-   || (!pvRecvBuffer) || (!pu32ReceivedLength)) {
-   PRINT_ER("mq or pvRecvBuffer is null\n");
+   || (!recv_buf) || (!pu32ReceivedLength)) {
+   PRINT_ER("mq or recv_buf is null\n");
return -EINVAL;
}
 
@@ -150,7 +150,7 @@ int wilc_mq_recv(struct message_queue *mq,
 
/* consume the message */
mq->recv_count--;
-   memcpy(pvRecvBuffer, pstrMessage->buf, pstrMessage->len);
+   memcpy(recv_buf, pstrMessage->buf, pstrMessage->len);
*pu32ReceivedLength = pstrMessage->len;
 
mq->msg_list = pstrMessage->next;
diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h 
b/drivers/staging/wilc1000/wilc_msgqueue.h
index 0c1eead..81b51dd 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.h
+++ b/drivers/staging/wilc1000/wilc_msgqueue.h
@@ -77,7 +77,7 @@ int wilc_mq_send(struct message_queue *mq,
  *  @version   1.0
  */
 int wilc_mq_recv(struct message_queue *mq,
-void *pvRecvBuffer, u32 u32RecvBufferSize,
+void *recv_buf, u32 u32RecvBufferSize,
 u32 *pu32ReceivedLength);
 
 /*!
-- 
2.6.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 13/27] staging: wilc1000: rename pstrMessge in wilc_mq_destroy

2016-01-20 Thread Chaehyun Lim
This patch renames pstrMessge to msg to avoid camelcase.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/wilc_msgqueue.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c 
b/drivers/staging/wilc1000/wilc_msgqueue.c
index 103fcfd..a01420a 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -38,10 +38,10 @@ int wilc_mq_destroy(struct message_queue *mq)
}
 
while (mq->msg_list) {
-   struct message *pstrMessge = mq->msg_list->next;
+   struct message *msg = mq->msg_list->next;
 
kfree(mq->msg_list);
-   mq->msg_list = pstrMessge;
+   mq->msg_list = msg;
}
 
return 0;
-- 
2.6.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 16/27] staging: wilc1000: rename u32SendBufferSize in wilc_mq_send

2016-01-20 Thread Chaehyun Lim
This patch renames u32SendBufferSize to send_buf_size to avoid
camelcase.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/wilc_msgqueue.c | 8 
 drivers/staging/wilc1000/wilc_msgqueue.h | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c 
b/drivers/staging/wilc1000/wilc_msgqueue.c
index 5feb87c..8e37cff0 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -54,12 +54,12 @@ int wilc_mq_destroy(struct message_queue *mq)
  *  @version   1.0
  */
 int wilc_mq_send(struct message_queue *mq,
-const void *send_buf, u32 u32SendBufferSize)
+const void *send_buf, u32 send_buf_size)
 {
unsigned long flags;
struct message *pstrMessage = NULL;
 
-   if ((!mq) || (u32SendBufferSize == 0) || (!send_buf)) {
+   if ((!mq) || (send_buf_size == 0) || (!send_buf)) {
PRINT_ER("mq or send_buf is null\n");
return -EFAULT;
}
@@ -74,9 +74,9 @@ int wilc_mq_send(struct message_queue *mq,
if (!pstrMessage)
return -ENOMEM;
 
-   pstrMessage->len = u32SendBufferSize;
+   pstrMessage->len = send_buf_size;
pstrMessage->next = NULL;
-   pstrMessage->buf = kmemdup(send_buf, u32SendBufferSize,
+   pstrMessage->buf = kmemdup(send_buf, send_buf_size,
   GFP_ATOMIC);
if (!pstrMessage->buf) {
kfree(pstrMessage);
diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h 
b/drivers/staging/wilc1000/wilc_msgqueue.h
index 3adee90..70e1be1 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.h
+++ b/drivers/staging/wilc1000/wilc_msgqueue.h
@@ -58,7 +58,7 @@ int wilc_mq_create(struct message_queue *mq);
  *  @version   1.0
  */
 int wilc_mq_send(struct message_queue *mq,
-const void *send_buf, u32 u32SendBufferSize);
+const void *send_buf, u32 send_buf_size);
 
 /*!
  *  @brief Receives a message
-- 
2.6.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 15/27] staging: wilc1000: rename pvSendBuffer in wilc_mq_send

2016-01-20 Thread Chaehyun Lim
This patch renames pvSendBuffer to send_buf to avoid camelcase.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/wilc_msgqueue.c | 8 
 drivers/staging/wilc1000/wilc_msgqueue.h | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c 
b/drivers/staging/wilc1000/wilc_msgqueue.c
index 71ce1f5..5feb87c 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -54,13 +54,13 @@ int wilc_mq_destroy(struct message_queue *mq)
  *  @version   1.0
  */
 int wilc_mq_send(struct message_queue *mq,
-const void *pvSendBuffer, u32 u32SendBufferSize)
+const void *send_buf, u32 u32SendBufferSize)
 {
unsigned long flags;
struct message *pstrMessage = NULL;
 
-   if ((!mq) || (u32SendBufferSize == 0) || (!pvSendBuffer)) {
-   PRINT_ER("mq or pvSendBuffer is null\n");
+   if ((!mq) || (u32SendBufferSize == 0) || (!send_buf)) {
+   PRINT_ER("mq or send_buf is null\n");
return -EFAULT;
}
 
@@ -76,7 +76,7 @@ int wilc_mq_send(struct message_queue *mq,
 
pstrMessage->len = u32SendBufferSize;
pstrMessage->next = NULL;
-   pstrMessage->buf = kmemdup(pvSendBuffer, u32SendBufferSize,
+   pstrMessage->buf = kmemdup(send_buf, u32SendBufferSize,
   GFP_ATOMIC);
if (!pstrMessage->buf) {
kfree(pstrMessage);
diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h 
b/drivers/staging/wilc1000/wilc_msgqueue.h
index e6cdc10..3adee90 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.h
+++ b/drivers/staging/wilc1000/wilc_msgqueue.h
@@ -58,7 +58,7 @@ int wilc_mq_create(struct message_queue *mq);
  *  @version   1.0
  */
 int wilc_mq_send(struct message_queue *mq,
-const void *pvSendBuffer, u32 u32SendBufferSize);
+const void *send_buf, u32 u32SendBufferSize);
 
 /*!
  *  @brief Receives a message
-- 
2.6.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 06/27] staging: wilc1000: rename hSem in struct message_queue

2016-01-20 Thread Chaehyun Lim
This patch renames hSem to sem to avoid camelcase.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/wilc_msgqueue.c | 10 +-
 drivers/staging/wilc1000/wilc_msgqueue.h |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c 
b/drivers/staging/wilc1000/wilc_msgqueue.c
index 907bae1..b996c47 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -14,7 +14,7 @@
 int wilc_mq_create(struct message_queue *pHandle)
 {
spin_lock_init(>strCriticalSection);
-   sema_init(>hSem, 0);
+   sema_init(>sem, 0);
pHandle->pstrMessageList = NULL;
pHandle->u32ReceiversCount = 0;
pHandle->bExiting = false;
@@ -33,7 +33,7 @@ int wilc_mq_destroy(struct message_queue *pHandle)
 
/* Release any waiting receiver thread. */
while (pHandle->u32ReceiversCount > 0) {
-   up(>hSem);
+   up(>sem);
pHandle->u32ReceiversCount--;
}
 
@@ -99,7 +99,7 @@ int wilc_mq_send(struct message_queue *pHandle,
 
spin_unlock_irqrestore(>strCriticalSection, flags);
 
-   up(>hSem);
+   up(>sem);
 
return 0;
 }
@@ -132,7 +132,7 @@ int wilc_mq_recv(struct message_queue *pHandle,
pHandle->u32ReceiversCount++;
spin_unlock_irqrestore(>strCriticalSection, flags);
 
-   down(>hSem);
+   down(>sem);
spin_lock_irqsave(>strCriticalSection, flags);
 
pstrMessage = pHandle->pstrMessageList;
@@ -144,7 +144,7 @@ int wilc_mq_recv(struct message_queue *pHandle,
/* check buffer size */
if (u32RecvBufferSize < pstrMessage->len) {
spin_unlock_irqrestore(>strCriticalSection, flags);
-   up(>hSem);
+   up(>sem);
PRINT_ER("u32RecvBufferSize overflow\n");
return -EOVERFLOW;
}
diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h 
b/drivers/staging/wilc1000/wilc_msgqueue.h
index 111be46..3ea4068 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.h
+++ b/drivers/staging/wilc1000/wilc_msgqueue.h
@@ -20,7 +20,7 @@ struct message {
 };
 
 struct message_queue {
-   struct semaphore hSem;
+   struct semaphore sem;
spinlock_t strCriticalSection;
bool bExiting;
u32 u32ReceiversCount;
-- 
2.6.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 14/27] staging: wilc1000: rename pHandle in wilc_mq_send

2016-01-20 Thread Chaehyun Lim
This patch renames pHandle to mq to avoid camelcase.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/wilc_msgqueue.c | 22 +++---
 drivers/staging/wilc1000/wilc_msgqueue.h |  2 +-
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c 
b/drivers/staging/wilc1000/wilc_msgqueue.c
index a01420a..71ce1f5 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -53,19 +53,19 @@ int wilc_mq_destroy(struct message_queue *mq)
  *  @note  copied from FLO glue implementatuion
  *  @version   1.0
  */
-int wilc_mq_send(struct message_queue *pHandle,
+int wilc_mq_send(struct message_queue *mq,
 const void *pvSendBuffer, u32 u32SendBufferSize)
 {
unsigned long flags;
struct message *pstrMessage = NULL;
 
-   if ((!pHandle) || (u32SendBufferSize == 0) || (!pvSendBuffer)) {
-   PRINT_ER("pHandle or pvSendBuffer is null\n");
+   if ((!mq) || (u32SendBufferSize == 0) || (!pvSendBuffer)) {
+   PRINT_ER("mq or pvSendBuffer is null\n");
return -EFAULT;
}
 
-   if (pHandle->exiting) {
-   PRINT_ER("pHandle fail\n");
+   if (mq->exiting) {
+   PRINT_ER("mq fail\n");
return -EFAULT;
}
 
@@ -83,13 +83,13 @@ int wilc_mq_send(struct message_queue *pHandle,
return -ENOMEM;
}
 
-   spin_lock_irqsave(>lock, flags);
+   spin_lock_irqsave(>lock, flags);
 
/* add it to the message queue */
-   if (!pHandle->msg_list) {
-   pHandle->msg_list  = pstrMessage;
+   if (!mq->msg_list) {
+   mq->msg_list  = pstrMessage;
} else {
-   struct message *pstrTailMsg = pHandle->msg_list;
+   struct message *pstrTailMsg = mq->msg_list;
 
while (pstrTailMsg->next)
pstrTailMsg = pstrTailMsg->next;
@@ -97,9 +97,9 @@ int wilc_mq_send(struct message_queue *pHandle,
pstrTailMsg->next = pstrMessage;
}
 
-   spin_unlock_irqrestore(>lock, flags);
+   spin_unlock_irqrestore(>lock, flags);
 
-   up(>sem);
+   up(>sem);
 
return 0;
 }
diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h 
b/drivers/staging/wilc1000/wilc_msgqueue.h
index b91822e..e6cdc10 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.h
+++ b/drivers/staging/wilc1000/wilc_msgqueue.h
@@ -57,7 +57,7 @@ int wilc_mq_create(struct message_queue *mq);
  *  @date  30 Aug 2010
  *  @version   1.0
  */
-int wilc_mq_send(struct message_queue *pHandle,
+int wilc_mq_send(struct message_queue *mq,
 const void *pvSendBuffer, u32 u32SendBufferSize);
 
 /*!
-- 
2.6.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 07/27] staging: wilc1000: rename strCriticalSection in struct message_queue

2016-01-20 Thread Chaehyun Lim
This patch renames strCriticalSection to lock to avoid camelcase.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/wilc_msgqueue.c | 18 +-
 drivers/staging/wilc1000/wilc_msgqueue.h |  2 +-
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c 
b/drivers/staging/wilc1000/wilc_msgqueue.c
index b996c47..67bf147 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -13,7 +13,7 @@
  */
 int wilc_mq_create(struct message_queue *pHandle)
 {
-   spin_lock_init(>strCriticalSection);
+   spin_lock_init(>lock);
sema_init(>sem, 0);
pHandle->pstrMessageList = NULL;
pHandle->u32ReceiversCount = 0;
@@ -83,7 +83,7 @@ int wilc_mq_send(struct message_queue *pHandle,
return -ENOMEM;
}
 
-   spin_lock_irqsave(>strCriticalSection, flags);
+   spin_lock_irqsave(>lock, flags);
 
/* add it to the message queue */
if (!pHandle->pstrMessageList) {
@@ -97,7 +97,7 @@ int wilc_mq_send(struct message_queue *pHandle,
pstrTailMsg->next = pstrMessage;
}
 
-   spin_unlock_irqrestore(>strCriticalSection, flags);
+   spin_unlock_irqrestore(>lock, flags);
 
up(>sem);
 
@@ -128,22 +128,22 @@ int wilc_mq_recv(struct message_queue *pHandle,
return -EFAULT;
}
 
-   spin_lock_irqsave(>strCriticalSection, flags);
+   spin_lock_irqsave(>lock, flags);
pHandle->u32ReceiversCount++;
-   spin_unlock_irqrestore(>strCriticalSection, flags);
+   spin_unlock_irqrestore(>lock, flags);
 
down(>sem);
-   spin_lock_irqsave(>strCriticalSection, flags);
+   spin_lock_irqsave(>lock, flags);
 
pstrMessage = pHandle->pstrMessageList;
if (!pstrMessage) {
-   spin_unlock_irqrestore(>strCriticalSection, flags);
+   spin_unlock_irqrestore(>lock, flags);
PRINT_ER("pstrMessage is null\n");
return -EFAULT;
}
/* check buffer size */
if (u32RecvBufferSize < pstrMessage->len) {
-   spin_unlock_irqrestore(>strCriticalSection, flags);
+   spin_unlock_irqrestore(>lock, flags);
up(>sem);
PRINT_ER("u32RecvBufferSize overflow\n");
return -EOVERFLOW;
@@ -159,7 +159,7 @@ int wilc_mq_recv(struct message_queue *pHandle,
kfree(pstrMessage->buf);
kfree(pstrMessage);
 
-   spin_unlock_irqrestore(>strCriticalSection, flags);
+   spin_unlock_irqrestore(>lock, flags);
 
return 0;
 }
diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h 
b/drivers/staging/wilc1000/wilc_msgqueue.h
index 3ea4068..6cdebbf 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.h
+++ b/drivers/staging/wilc1000/wilc_msgqueue.h
@@ -21,7 +21,7 @@ struct message {
 
 struct message_queue {
struct semaphore sem;
-   spinlock_t strCriticalSection;
+   spinlock_t lock;
bool bExiting;
u32 u32ReceiversCount;
struct message *pstrMessageList;
-- 
2.6.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 05/27] staging: wilc1000: rename struct WILC_MsgQueueHandle

2016-01-20 Thread Chaehyun Lim
This patch removes typedef from struct WILC_MsgQueueHandle and renames
it to struct message_queue.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/host_interface.c |  2 +-
 drivers/staging/wilc1000/wilc_msgqueue.c  | 14 +++---
 drivers/staging/wilc1000/wilc_msgqueue.h  | 18 +-
 3 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 5fac516..98627a6 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -229,7 +229,7 @@ struct host_if_drv *terminated_handle;
 bool wilc_optaining_ip;
 static u8 P2P_LISTEN_STATE;
 static struct task_struct *hif_thread_handler;
-static WILC_MsgQueueHandle hif_msg_q;
+static struct message_queue hif_msg_q;
 static struct semaphore hif_sema_thread;
 static struct semaphore hif_sema_driver;
 static struct semaphore hif_sema_wait_response;
diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c 
b/drivers/staging/wilc1000/wilc_msgqueue.c
index 4d79a31..907bae1 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -11,7 +11,7 @@
  *  @note  copied from FLO glue implementatuion
  *  @version   1.0
  */
-int wilc_mq_create(WILC_MsgQueueHandle *pHandle)
+int wilc_mq_create(struct message_queue *pHandle)
 {
spin_lock_init(>strCriticalSection);
sema_init(>hSem, 0);
@@ -27,7 +27,7 @@ int wilc_mq_create(WILC_MsgQueueHandle *pHandle)
  *  @note  copied from FLO glue implementatuion
  *  @version   1.0
  */
-int wilc_mq_destroy(WILC_MsgQueueHandle *pHandle)
+int wilc_mq_destroy(struct message_queue *pHandle)
 {
pHandle->bExiting = true;
 
@@ -53,8 +53,8 @@ int wilc_mq_destroy(WILC_MsgQueueHandle *pHandle)
  *  @note  copied from FLO glue implementatuion
  *  @version   1.0
  */
-int wilc_mq_send(WILC_MsgQueueHandle *pHandle,
-const void *pvSendBuffer, u32 u32SendBufferSize)
+int wilc_mq_send(struct message_queue *pHandle,
+const void *pvSendBuffer, u32 u32SendBufferSize)
 {
unsigned long flags;
struct message *pstrMessage = NULL;
@@ -110,9 +110,9 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle,
  *  @note  copied from FLO glue implementatuion
  *  @version   1.0
  */
-int wilc_mq_recv(WILC_MsgQueueHandle *pHandle,
-void *pvRecvBuffer, u32 u32RecvBufferSize,
-u32 *pu32ReceivedLength)
+int wilc_mq_recv(struct message_queue *pHandle,
+void *pvRecvBuffer, u32 u32RecvBufferSize,
+u32 *pu32ReceivedLength)
 {
struct message *pstrMessage;
unsigned long flags;
diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h 
b/drivers/staging/wilc1000/wilc_msgqueue.h
index ec503c3..111be46 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.h
+++ b/drivers/staging/wilc1000/wilc_msgqueue.h
@@ -19,13 +19,13 @@ struct message {
struct message *next;
 };
 
-typedef struct __MessageQueue_struct {
+struct message_queue {
struct semaphore hSem;
spinlock_t strCriticalSection;
bool bExiting;
u32 u32ReceiversCount;
struct message *pstrMessageList;
-} WILC_MsgQueueHandle;
+};
 
 /*!
  *  @brief Creates a new Message queue
@@ -40,7 +40,7 @@ typedef struct __MessageQueue_struct {
  *  @date  30 Aug 2010
  *  @version   1.0
  */
-int wilc_mq_create(WILC_MsgQueueHandle *pHandle);
+int wilc_mq_create(struct message_queue *pHandle);
 
 /*!
  *  @brief Sends a message
@@ -57,8 +57,8 @@ int wilc_mq_create(WILC_MsgQueueHandle *pHandle);
  *  @date  30 Aug 2010
  *  @version   1.0
  */
-int wilc_mq_send(WILC_MsgQueueHandle *pHandle,
-const void *pvSendBuffer, u32 u32SendBufferSize);
+int wilc_mq_send(struct message_queue *pHandle,
+const void *pvSendBuffer, u32 u32SendBufferSize);
 
 /*!
  *  @brief Receives a message
@@ -76,9 +76,9 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle,
  *  @date  30 Aug 2010
  *  @version   1.0
  */
-int wilc_mq_recv(WILC_MsgQueueHandle *pHandle,
-void *pvRecvBuffer, u32 u32RecvBufferSize,
-u32 *pu32ReceivedLength);
+int wilc_mq_recv(struct message_queue *pHandle,
+void *pvRecvBuffer, u32 u32RecvBufferSize,
+u32 *pu32ReceivedLength);
 
 /*!
  *  @brief Destroys an existing  Message queue
@@ -89,6 +89,6 @@ int wilc_mq_recv(WILC_MsgQueueHandle *pHandle,
  *  @date  30 Aug 2010
  *  @version   1.0
  */
-int wilc_mq_destroy(WILC_MsgQueueHandle *pHandle);
+int wilc_mq_destroy(struct message_queue *pHandle);
 
 #endif
-- 
2.6.4

--
To unsubscribe from this list: send the line 

[PATCH 23/27] staging: wilc1000: rename pu32ReceivedLength in wilc_mq_recv

2016-01-20 Thread Chaehyun Lim
This patch renames pu32ReceivedLength to recv_len to avoid camelcase.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/wilc_msgqueue.c | 7 +++
 drivers/staging/wilc1000/wilc_msgqueue.h | 3 +--
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c 
b/drivers/staging/wilc1000/wilc_msgqueue.c
index c86bd7c..5601de8 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -110,14 +110,13 @@ int wilc_mq_send(struct message_queue *mq,
  *  @version   1.0
  */
 int wilc_mq_recv(struct message_queue *mq,
-void *recv_buf, u32 recv_buf_size,
-u32 *pu32ReceivedLength)
+void *recv_buf, u32 recv_buf_size, u32 *recv_len)
 {
struct message *pstrMessage;
unsigned long flags;
 
if ((!mq) || (recv_buf_size == 0)
-   || (!recv_buf) || (!pu32ReceivedLength)) {
+   || (!recv_buf) || (!recv_len)) {
PRINT_ER("mq or recv_buf is null\n");
return -EINVAL;
}
@@ -151,7 +150,7 @@ int wilc_mq_recv(struct message_queue *mq,
/* consume the message */
mq->recv_count--;
memcpy(recv_buf, pstrMessage->buf, pstrMessage->len);
-   *pu32ReceivedLength = pstrMessage->len;
+   *recv_len = pstrMessage->len;
 
mq->msg_list = pstrMessage->next;
 
diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h 
b/drivers/staging/wilc1000/wilc_msgqueue.h
index 3804b3b..4f79ead 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.h
+++ b/drivers/staging/wilc1000/wilc_msgqueue.h
@@ -77,8 +77,7 @@ int wilc_mq_send(struct message_queue *mq,
  *  @version   1.0
  */
 int wilc_mq_recv(struct message_queue *mq,
-void *recv_buf, u32 recv_buf_size,
-u32 *pu32ReceivedLength);
+void *recv_buf, u32 recv_buf_size, u32 *recv_len);
 
 /*!
  *  @brief Destroys an existing  Message queue
-- 
2.6.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 25/27] staging: wilc1000: fix coding style of kmalloc usage

2016-01-20 Thread Chaehyun Lim
This patch fixes coding style of kmalloc usage found by checkpatch.
CHECK: Prefer kmalloc(sizeof(*new_msg)...) over kmalloc(sizeof(struct 
message)...)

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/wilc_msgqueue.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c 
b/drivers/staging/wilc1000/wilc_msgqueue.c
index 7107715..c7a60f4 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -70,7 +70,7 @@ int wilc_mq_send(struct message_queue *mq,
}
 
/* construct a new message */
-   new_msg = kmalloc(sizeof(struct message), GFP_ATOMIC);
+   new_msg = kmalloc(sizeof(*new_msg), GFP_ATOMIC);
if (!new_msg)
return -ENOMEM;
 
-- 
2.6.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 12/27] staging: wilc1000: rename pHandle in wilc_mq_destroy

2016-01-20 Thread Chaehyun Lim
This patch renames pHandle to mq to avoid camelcase

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/wilc_msgqueue.c | 18 +-
 drivers/staging/wilc1000/wilc_msgqueue.h |  2 +-
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c 
b/drivers/staging/wilc1000/wilc_msgqueue.c
index 453fa19..103fcfd 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -27,21 +27,21 @@ int wilc_mq_create(struct message_queue *mq)
  *  @note  copied from FLO glue implementatuion
  *  @version   1.0
  */
-int wilc_mq_destroy(struct message_queue *pHandle)
+int wilc_mq_destroy(struct message_queue *mq)
 {
-   pHandle->exiting = true;
+   mq->exiting = true;
 
/* Release any waiting receiver thread. */
-   while (pHandle->recv_count > 0) {
-   up(>sem);
-   pHandle->recv_count--;
+   while (mq->recv_count > 0) {
+   up(>sem);
+   mq->recv_count--;
}
 
-   while (pHandle->msg_list) {
-   struct message *pstrMessge = pHandle->msg_list->next;
+   while (mq->msg_list) {
+   struct message *pstrMessge = mq->msg_list->next;
 
-   kfree(pHandle->msg_list);
-   pHandle->msg_list = pstrMessge;
+   kfree(mq->msg_list);
+   mq->msg_list = pstrMessge;
}
 
return 0;
diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h 
b/drivers/staging/wilc1000/wilc_msgqueue.h
index bfd2347..b91822e 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.h
+++ b/drivers/staging/wilc1000/wilc_msgqueue.h
@@ -89,6 +89,6 @@ int wilc_mq_recv(struct message_queue *pHandle,
  *  @date  30 Aug 2010
  *  @version   1.0
  */
-int wilc_mq_destroy(struct message_queue *pHandle);
+int wilc_mq_destroy(struct message_queue *mq);
 
 #endif
-- 
2.6.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [RFC V2 2/3] nl80211: add bss selection attribute to CONNECT command

2016-01-20 Thread Peer, Ilan
> -Original Message-
> From: Arend van Spriel [mailto:ar...@broadcom.com]
> Sent: Wednesday, January 20, 2016 23:54
> To: Johannes Berg
> Cc: linux-wireless; Peer, Ilan
> Subject: Re: [RFC V2 2/3] nl80211: add bss selection attribute to CONNECT
> command
> 
> 
> 
> On 20-1-2016 15:02, Johannes Berg wrote:
> > Ilan pointed me to this:
> >
> > http://androidxref.com/6.0.1_r10/xref/hardware/libhardware_legacy/incl
> > ude/hardware_legacy/gscan.h#351
> >
> >
> > I'd say that would just be a separate primitive, and then Android
> > would pick that in some way?
> 
> It was not part of my plan, but it seems to fit, yes. Android now uses vendor
> command with google oui for gscan if I am not mistaken.
> 

These do not need to necessarily be vendor commands :) We can extend your work 
to also support the android behavior (just pointed this out so we would not be 
blocked when wanting to extend it).

Regards,

Ilan.


[PATCH] brcmfmac: fix setting primary channel for 80 MHz width

2016-01-20 Thread Rafał Miłecki
First of all it changes the way we calculate primary channel offset. If
we use e.g. 80 MHz channel with primary frequency 5180 MHz (which means
center frequency is 5210 MHz) it makes sense to calculate primary offset
as -30 MHz.
Then it fixes values we compare primary_offset with. We were comparing
offset in MHz against -2 or 2 which was resulting in picking a wrong
primary channel.

Signed-off-by: Rafał Miłecki 
---
 .../broadcom/brcm80211/brcmfmac/cfg80211.c | 23 ++
 1 file changed, 10 insertions(+), 13 deletions(-)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c 
b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
index 8d9cff4..2b335de 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
@@ -247,7 +247,7 @@ static u16 chandef_to_chanspec(struct brcmu_d11inf *d11inf,
brcmf_dbg(TRACE, "chandef: control %d center %d width %d\n",
  ch->chan->center_freq, ch->center_freq1, ch->width);
ch_inf.chnum = ieee80211_frequency_to_channel(ch->center_freq1);
-   primary_offset = ch->center_freq1 - ch->chan->center_freq;
+   primary_offset = ch->chan->center_freq - ch->center_freq1;
switch (ch->width) {
case NL80211_CHAN_WIDTH_20:
case NL80211_CHAN_WIDTH_20_NOHT:
@@ -256,24 +256,21 @@ static u16 chandef_to_chanspec(struct brcmu_d11inf 
*d11inf,
break;
case NL80211_CHAN_WIDTH_40:
ch_inf.bw = BRCMU_CHAN_BW_40;
-   if (primary_offset < 0)
+   if (primary_offset > 0)
ch_inf.sb = BRCMU_CHAN_SB_U;
else
ch_inf.sb = BRCMU_CHAN_SB_L;
break;
case NL80211_CHAN_WIDTH_80:
ch_inf.bw = BRCMU_CHAN_BW_80;
-   if (primary_offset < 0) {
-   if (primary_offset < -CH_10MHZ_APART)
-   ch_inf.sb = BRCMU_CHAN_SB_UU;
-   else
-   ch_inf.sb = BRCMU_CHAN_SB_UL;
-   } else {
-   if (primary_offset > CH_10MHZ_APART)
-   ch_inf.sb = BRCMU_CHAN_SB_LL;
-   else
-   ch_inf.sb = BRCMU_CHAN_SB_LU;
-   }
+   if (primary_offset == -30)
+   ch_inf.sb = BRCMU_CHAN_SB_LL;
+   else if (primary_offset == -10)
+   ch_inf.sb = BRCMU_CHAN_SB_LU;
+   else if (primary_offset == 10)
+   ch_inf.sb = BRCMU_CHAN_SB_UL;
+   else
+   ch_inf.sb = BRCMU_CHAN_SB_UU;
break;
case NL80211_CHAN_WIDTH_80P80:
case NL80211_CHAN_WIDTH_160:
-- 
1.8.4.5

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH RFC] wireless:libertas: enable auto deep sleep

2016-01-20 Thread Andreas Kemnade
On Wed, 20 Jan 2016 14:42:47 +0200
Kalle Valo  wrote:

> Andreas Kemnade  writes:
> 
> > Enables auto deep sleep whenever the interface is up and
> > power managament is enabled, so there is also power management
> > when there is no connection
> > That reduces power consumption between scanning
> > intervals. Deep sleep mode is entered when there is
> > no activity for 1s.
> >
> > The code looks a bit different to how things were done
> > with the wext interface in earlier times.
> >
> > Signed-off-by: Andreas Kemnade 
> 
> Please use just "libertas: " as the prefix and drop the "wireless:".
> 
Hmm, is there any rule for that or do I just find that out
by analysing git log output?

BTW: That patch depends on my ieee80211 powersave mode series where I sent
a second version today. Has that series found the way into your review queue?

Regards,
Andreas Kemnade


pgpAl603_gccg.pgp
Description: OpenPGP digital signature


Re: [RFC V2 2/3] nl80211: add bss selection attribute to CONNECT command

2016-01-20 Thread Arend van Spriel


On 20-1-2016 15:02, Johannes Berg wrote:
> Ilan pointed me to this:
> 
> http://androidxref.com/6.0.1_r10/xref/hardware/libhardware_legacy/include/hardware_legacy/gscan.h#351
> 
> 
> I'd say that would just be a separate primitive, and then Android would
> pick that in some way?

It was not part of my plan, but it seems to fit, yes. Android now uses
vendor command with google oui for gscan if I am not mistaken.

Regards,
Arend
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH RFC] wireless:libertas: enable auto deep sleep

2016-01-20 Thread Kalle Valo
Andreas Kemnade  writes:

> On Wed, 20 Jan 2016 14:42:47 +0200
> Kalle Valo  wrote:
>
>> Andreas Kemnade  writes:
>> 
>> > Enables auto deep sleep whenever the interface is up and
>> > power managament is enabled, so there is also power management
>> > when there is no connection
>> > That reduces power consumption between scanning
>> > intervals. Deep sleep mode is entered when there is
>> > no activity for 1s.
>> >
>> > The code looks a bit different to how things were done
>> > with the wext interface in earlier times.
>> >
>> > Signed-off-by: Andreas Kemnade 
>> 
>> Please use just "libertas: " as the prefix and drop the "wireless:".
>> 
> Hmm, is there any rule for that or do I just find that out
> by analysing git log output?

No generic rule as far as I know. I recommend to use git log to see the
most common prefix:

git log --oneline --follow --no-merges -- drivers/net/wireless/libertas

> BTW: That patch depends on my ieee80211 powersave mode series where I sent
> a second version today.

It's a good idea to document that in the patch, for example after "---"
line.

> Has that series found the way into your review queue?

You can check the status from patchwork:

https://patchwork.kernel.org/project/linux-wireless/list/?state=*

I haven't opened wireless-drivers-next yet due to the merge window, I
will do that after -rc1 is released.

-- 
Kalle Valo
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html