[PATCH] ath10k: fix MSI-X registering for qca99x0

2015-09-17 Thread Janusz Dziedzic
In case of qca99x0 and MSI-X supported/enabled we
failed during interrupts registering with message:

ath10k_pci :04:00.0: failed to request MSI-X ce irq 50: -22

Issue/fix was reproduced/tested using Dell Latitude E6430 laptop.

Signed-off-by: Janusz Dziedzic 
---
 drivers/net/wireless/ath/ath10k/hw.h  | 10 --
 drivers/net/wireless/ath/ath10k/pci.c | 18 +-
 2 files changed, 5 insertions(+), 23 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/hw.h 
b/drivers/net/wireless/ath/ath10k/hw.h
index 23afcda..bc421a5 100644
--- a/drivers/net/wireless/ath/ath10k/hw.h
+++ b/drivers/net/wireless/ath/ath10k/hw.h
@@ -414,16 +414,6 @@ enum ath10k_hw_rate_cck {
 #define CE_COUNT ar->hw_values->ce_count
 
 /*
- * Total number of PCIe MSI interrupts requested for all interrupt sources.
- * PCIe standard forces this to be a power of 2.
- * Some Host OS's limit MSI requests that can be granted to 8
- * so for now we abide by this limit and avoid requesting more
- * than that.
- */
-#define MSI_NUM_REQUEST_LOG2   3
-#define MSI_NUM_REQUEST(1<num_msi_intrs = MSI_NUM_REQUEST;
+   ar_pci->num_msi_intrs = MSI_ASSIGN_CE_MAX + 1;
ret = pci_enable_msi_range(ar_pci->pdev, ar_pci->num_msi_intrs,
   ar_pci->num_msi_intrs);
if (ret > 0)
@@ -2705,18 +2702,13 @@ static int ath10k_pci_deinit_irq(struct ath10k *ar)
switch (ar_pci->num_msi_intrs) {
case 0:
ath10k_pci_deinit_irq_legacy(ar);
-   return 0;
-   case 1:
-   /* fall-through */
-   case MSI_NUM_REQUEST:
-   pci_disable_msi(ar_pci->pdev);
-   return 0;
+   break;
default:
pci_disable_msi(ar_pci->pdev);
+   break;
}
 
-   ath10k_warn(ar, "unknown irq configuration upon deinit\n");
-   return -EINVAL;
+   return 0;
 }
 
 static int ath10k_pci_wait_for_target_init(struct ath10k *ar)
-- 
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 V2 7/8] staging: wilc1000: remove useless comment

2015-09-17 Thread Chaehyun Lim
This patch removes useless comment that is included "BugID_"

Signed-off-by: Chaehyun Lim 
---
V2 : rebase latest staging-testing

 drivers/staging/wilc1000/host_interface.c | 36 ---
 drivers/staging/wilc1000/host_interface.h |  4 ---
 drivers/staging/wilc1000/linux_wlan.c |  8 -
 drivers/staging/wilc1000/linux_wlan_common.h  |  1 -
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 42 ---
 drivers/staging/wilc1000/wilc_wfi_netdevice.h |  1 -
 drivers/staging/wilc1000/wilc_wlan.c  | 26 ++
 drivers/staging/wilc1000/wilc_wlan.h  |  1 -
 drivers/staging/wilc1000/wilc_wlan_if.h   |  9 -
 9 files changed, 2 insertions(+), 126 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 6fdf392..c63c5ee 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -7,7 +7,6 @@ extern u8 connecting;
 extern struct timer_list hDuringIpTimer;
 #endif
 
-/*BugID_5137*/
 extern u8 g_wilc_initialized;
 /*/
 /* Macros  
 */
@@ -173,7 +172,6 @@ typedef struct _tstrHostIFscanAttr {
size_t IEsLen;
tWILCpfScanResult pfScanResult;
void *pvUserArg;
-   /*BugID_4189*/
tstrHiddenNetwork strHiddenNetwork;
 
 } tstrHostIFscanAttr;
@@ -563,7 +561,6 @@ static u32 gu32InactiveTime;
 static u8 gu8DelBcn;
 static u32 gu32WidConnRstHack;
 
-/*BugID_5137*/
 u8 *gu8FlushedJoinReq;
 u8 *gu8FlushedInfoElemAsoc;
 u8 gu8Flushed11iMode;
@@ -888,7 +885,6 @@ static s32 Handle_SetMacAddress(tstrWILC_WFIDrv 
*drvHandler, tstrHostIfSetMacAdd
 }
 
 
-/*BugID_5213*/
 /**
  *  @brief Handle_GetMacAddress
  *  @detailsGetting mac address
@@ -1330,7 +1326,6 @@ static s32 Handle_Scan(tstrWILC_WFIDrv *drvHandler, 
tstrHostIFscanAttr *pstrHost
 
pstrWFIDrv->strWILC_UsrScanReq.u32RcvdChCount = 0;
 
-   /*BugID_4189*/
strWIDList[u32WidsCount].u16WIDid = (u16)WID_SSID_PROBE_REQ;
strWIDList[u32WidsCount].enuWIDtype = WID_STR;
 
@@ -1474,7 +1469,6 @@ static s32 Handle_ScanDone(tstrWILC_WFIDrv *drvHandler, 
tenuScanEvent enuEvent)
 
PRINT_D(HOSTINF_DBG, "in Handle_ScanDone()\n");
 
-   /*BugID_4978*/
/*Ask FW to abort the running scan, if any*/
if (enuEvent == SCAN_EVENT_ABORTED) {
PRINT_D(GENERIC_DBG, "Abort running scan\n");
@@ -1772,7 +1766,6 @@ static s32 Handle_Connect(tstrWILC_WFIDrv *drvHandler, 
tstrHostIFconnectAttr *ps
strWIDList[u32WidsCount].s32ValueSize = 
pstrWFIDrv->strWILC_UsrConnReq.ConnReqIEsLen;
u32WidsCount++;
 
-   /*BugID_5137*/
if (memcmp("DIRECT-", pstrHostIFconnectAttr->pu8ssid, 7)) {
 
gu32FlushedInfoElemAsocSize = 
pstrWFIDrv->strWILC_UsrConnReq.ConnReqIEsLen;
@@ -1787,7 +1780,6 @@ static s32 Handle_Connect(tstrWILC_WFIDrv *drvHandler, 
tstrHostIFconnectAttr *ps
strWIDList[u32WidsCount].ps8WidVal = (s8 
*)(&(pstrWFIDrv->strWILC_UsrConnReq.u8security));
u32WidsCount++;
 
-   /*BugID_5137*/
if (memcmp("DIRECT-", pstrHostIFconnectAttr->pu8ssid, 7))
gu8Flushed11iMode = pstrWFIDrv->strWILC_UsrConnReq.u8security;
 
@@ -1800,7 +1792,6 @@ static s32 Handle_Connect(tstrWILC_WFIDrv *drvHandler, 
tstrHostIFconnectAttr *ps
strWIDList[u32WidsCount].ps8WidVal = (s8 
*)(>strWILC_UsrConnReq.tenuAuth_type);
u32WidsCount++;
 
-   /*BugID_5137*/
if (memcmp("DIRECT-", pstrHostIFconnectAttr->pu8ssid, 7))
gu8FlushedAuthType = 
(u8)pstrWFIDrv->strWILC_UsrConnReq.tenuAuth_type;
 
@@ -1857,7 +1848,6 @@ static s32 Handle_Connect(tstrWILC_WFIDrv *drvHandler, 
tstrHostIFconnectAttr *ps
strWIDList[u32WidsCount].s32ValueSize = 112; /* 79; */
strWIDList[u32WidsCount].ps8WidVal = 
kmalloc(strWIDList[u32WidsCount].s32ValueSize, GFP_KERNEL);
 
-   /*BugID_5137*/
if (memcmp("DIRECT-", pstrHostIFconnectAttr->pu8ssid, 7)) {
gu32FlushedJoinReqSize = strWIDList[u32WidsCount].s32ValueSize;
gu8FlushedJoinReq = kmalloc(gu32FlushedJoinReqSize, GFP_KERNEL);
@@ -1943,7 +1933,6 @@ static s32 Handle_Connect(tstrWILC_WFIDrv *drvHandler, 
tstrHostIFconnectAttr *ps
memcpy(pu8CurrByte, ptstrJoinBssParam->rsn_cap, 
sizeof(ptstrJoinBssParam->rsn_cap));
pu8CurrByte += sizeof(ptstrJoinBssParam->rsn_cap);
 
-   /*BugID_5137*/
*(pu8CurrByte++) = REAL_JOIN_REQ;
 
*(pu8CurrByte++) = ptstrJoinBssParam->u8NoaEnbaled;
@@ -1993,7 +1982,6 @@ static s32 Handle_Connect(tstrWILC_WFIDrv *drvHandler, 
tstrHostIFconnectAttr *ps
gu32WidConnRstHack = 0;
/* // */
 
-   

[PATCH V2 8/8] staging: wilc1000: remove declaration of wilc_get_chipid

2015-09-17 Thread Chaehyun Lim
This patch removes the declaration of wilc_get_chipid function.
It is included wilc_wlan_if.h that has declaration of wilc_get_chipid.

Signed-off-by: Chaehyun Lim 
---
V2 : rebase latest staging-testing

 drivers/staging/wilc1000/host_interface.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index c63c5ee..703712e 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1,5 +1,6 @@
 #include "host_interface.h"
 #include "coreconfigurator.h"
+#include "wilc_wlan_if.h"
 
 extern u8 connecting;
 
@@ -7211,8 +7212,6 @@ s32 host_int_edit_station(tstrWILC_WFIDrv *hWFIDrv, 
tstrWILC_AddStaParam *pstrSt
return s32Error;
 }
 
-u32 wilc_get_chipid(u8);
-
 s32 host_int_set_power_mgmt(tstrWILC_WFIDrv *hWFIDrv, bool bIsEnabled, u32 
u32Timeout)
 {
s32 s32Error = 0;
-- 
2.5.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


Re: [PATCH v2 1/2] Staging: wilc1000: Use NULL instead of zero

2015-09-17 Thread Sudip Mukherjee
On Thu, Sep 17, 2015 at 09:09:35AM +0530, Ronit Halder wrote:
> On Wed, 2015-09-16 at 20:15 -0700, Greg KH wrote:
> > On Thu, Sep 17, 2015 at 08:28:52AM +0530, roni wrote:

> > 
> > I don't remember, that was many hundreds of patches ago, sorry.  Try it
> > yourself to see if I messed up.  Perhaps someone else had already sent
> > in that same change before you did?
> 
> git-apply shows no error if I apply second patch on
> staging/staging-testing.
If you think your patch still applies properly then please resend it.

regards
sudip
--
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 V2 1/8] staging: wilc1000: remove INLINE macro

2015-09-17 Thread Chaehyun Lim
This patch removes INLINE macro that is used anymore.

Signed-off-by: Chaehyun Lim 
---
V2 : rebase latest staging-testing

 drivers/staging/wilc1000/coreconfigurator.c | 1 -
 drivers/staging/wilc1000/wilc_wlan.c| 1 -
 2 files changed, 2 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.c 
b/drivers/staging/wilc1000/coreconfigurator.c
index 2fa2790..14e8efc 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -17,7 +17,6 @@
 /*/
 /* Constants */
 /*/
-#define INLINE static __inline
 #define TAG_PARAM_OFFSET   (MAC_HDR_LEN + TIME_STAMP_LEN + \
BEACON_INTERVAL_LEN + 
CAP_INFO_LEN)
 
diff --git a/drivers/staging/wilc1000/wilc_wlan.c 
b/drivers/staging/wilc1000/wilc_wlan.c
index 4c25179..47fa0f3 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -9,7 +9,6 @@
 
 #include "wilc_wlan_if.h"
 #include "wilc_wlan.h"
-#define INLINE static __inline
 
 /
  *
-- 
2.5.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 V2 2/8] staging: wilc1000: replace __inline with inline

2015-09-17 Thread Chaehyun Lim
This patch replaces __inline with inline. plain inline is more
preferred than __inline.

Signed-off-by: Chaehyun Lim 
---
V2 : rebase latest staging-testing

 drivers/staging/wilc1000/wilc_wlan.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan.c 
b/drivers/staging/wilc1000/wilc_wlan.c
index 47fa0f3..1fe1ba5 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -316,13 +316,13 @@ u32 Pending_Acks;
 
 
 
-static __inline int Init_TCP_tracking(void)
+static inline int Init_TCP_tracking(void)
 {
 
return 0;
 
 }
-static __inline int add_TCP_track_session(u32 src_prt, u32 dst_prt, u32 seq)
+static inline int add_TCP_track_session(u32 src_prt, u32 dst_prt, u32 seq)
 {
Acks_keep_track_info[Opened_TCP_session].Ack_seq_num = seq;
Acks_keep_track_info[Opened_TCP_session].Bigger_Ack_num = 0;
@@ -334,7 +334,7 @@ static __inline int add_TCP_track_session(u32 src_prt, u32 
dst_prt, u32 seq)
return 0;
 }
 
-static __inline int Update_TCP_track_session(u32 index, u32 Ack)
+static inline int Update_TCP_track_session(u32 index, u32 Ack)
 {
 
if (Ack > Acks_keep_track_info[index].Bigger_Ack_num) {
@@ -343,7 +343,7 @@ static __inline int Update_TCP_track_session(u32 index, u32 
Ack)
return 0;
 
 }
-static __inline int add_TCP_Pending_Ack(u32 Ack, u32 Session_index, struct 
txq_entry_t  *txqe)
+static inline int add_TCP_Pending_Ack(u32 Ack, u32 Session_index, struct 
txq_entry_t  *txqe)
 {
Statisitcs_totalAcks++;
if (Pending_Acks < MAX_PENDING_ACKS) {
@@ -358,7 +358,7 @@ static __inline int add_TCP_Pending_Ack(u32 Ack, u32 
Session_index, struct txq_e
}
return 0;
 }
-static __inline int remove_TCP_related(void)
+static inline int remove_TCP_related(void)
 {
wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)_wlan;
unsigned long flags;
@@ -369,7 +369,7 @@ static __inline int remove_TCP_related(void)
return 0;
 }
 
-static __inline int tcp_process(struct txq_entry_t *tqe)
+static inline int tcp_process(struct txq_entry_t *tqe)
 {
int ret;
u8 *eth_hdr_ptr;
-- 
2.5.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 V2 4/8] staging: wilc1000: linux_wlan_spi.c: fix kzalloc error check

2015-09-17 Thread Chaehyun Lim
This patch fixes error check of kzalloc.
If kzalloc is failed, return type is used as -ENOMEM.

Signed-off-by: Chaehyun Lim 
---
V2 : rebase latest staging-testing

 drivers/staging/wilc1000/linux_wlan_spi.c | 22 --
 1 file changed, 8 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan_spi.c 
b/drivers/staging/wilc1000/linux_wlan_spi.c
index 3e24256..51bbd96 100644
--- a/drivers/staging/wilc1000/linux_wlan_spi.c
+++ b/drivers/staging/wilc1000/linux_wlan_spi.c
@@ -125,10 +125,8 @@ int linux_spi_write(u8 *b, u32 len)
int remainder = len % TXRX_PHASE_SIZE;
 
char *r_buffer = kzalloc(TXRX_PHASE_SIZE, GFP_KERNEL);
-
-   if (!r_buffer) {
-   PRINT_ER("Failed to allocate memory for r_buffer\n");
-   }
+   if (!r_buffer)
+   return -ENOMEM;
 
if (blk) {
while (i < blk) {
@@ -208,10 +206,9 @@ int linux_spi_write(u8 *b, u32 len)
.delay_usecs = 0,
};
char *r_buffer = kzalloc(len, GFP_KERNEL);
+   if (!r_buffer)
+   return -ENOMEM;
 
-   if (!r_buffer) {
-   PRINT_ER("Failed to allocate memory for r_buffer\n");
-   }
tr.rx_buf = r_buffer;
PRINT_D(BUS_DBG, "Request writing %d bytes\n", len);
 
@@ -257,10 +254,8 @@ int linux_spi_read(unsigned char *rb, unsigned long rlen)
int remainder = rlen % TXRX_PHASE_SIZE;
 
char *t_buffer = kzalloc(TXRX_PHASE_SIZE, GFP_KERNEL);
-
-   if (!t_buffer) {
-   PRINT_ER("Failed to allocate memory for t_buffer\n");
-   }
+   if (!t_buffer)
+   return -ENOMEM;
 
if (blk) {
while (i < blk) {
@@ -337,10 +332,9 @@ int linux_spi_read(unsigned char *rb, unsigned long rlen)
 
};
char *t_buffer = kzalloc(rlen, GFP_KERNEL);
+   if (!t_buffer)
+   return -ENOMEM;
 
-   if (!t_buffer) {
-   PRINT_ER("Failed to allocate memory for t_buffer\n");
-   }
tr.tx_buf = t_buffer;
 
memset(, 0, sizeof(msg));
-- 
2.5.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 V2 5/8] staging: wilc1000: remove unused defines

2015-09-17 Thread Chaehyun Lim
This patch removes unused defines.

Signed-off-by: Chaehyun Lim 
---
V2 : rebase latest staging-testing

 drivers/staging/wilc1000/wilc_platform.h | 4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_platform.h 
b/drivers/staging/wilc1000/wilc_platform.h
index 1e56973..5c867ec 100644
--- a/drivers/staging/wilc1000/wilc_platform.h
+++ b/drivers/staging/wilc1000/wilc_platform.h
@@ -41,8 +41,4 @@ typedef time_t WILC_Time;
  *  others
  /
 
-/* Generic printf function */
-#define __WILC_FILE__  __FILE__
-#define __WILC_FUNCTION__  __func__
-#define __WILC_LINE__  __LINE__
 #endif
-- 
2.5.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 V2 6/8] staging: wilc1000: remove WILC_TIME typedef

2015-09-17 Thread Chaehyun Lim
This patch removes WILC_TIME typedef that is not used anymore.

Signed-off-by: Chaehyun Lim 
---
V2 : rebase latest staging-testing

 drivers/staging/wilc1000/wilc_platform.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_platform.h 
b/drivers/staging/wilc1000/wilc_platform.h
index 5c867ec..b763616 100644
--- a/drivers/staging/wilc1000/wilc_platform.h
+++ b/drivers/staging/wilc1000/wilc_platform.h
@@ -33,8 +33,6 @@ typedef struct __MessageQueue_struct {
 
 
 
-/*Time represented in 64 bit format*/
-typedef time_t WILC_Time;
 
 
 /***
-- 
2.5.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 V2 3/8] staging: wilc1000: replace int8_t with int

2015-09-17 Thread Chaehyun Lim
This patch replaces int8_t with int. just use return type as int.

Signed-off-by: Chaehyun Lim 
---
V2 : rebase latest staging-testing

 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index a2c80db..e9e6d9c 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -272,9 +272,9 @@ static void clear_duringIP(unsigned long arg)
 }
 #endif
 
-int8_t is_network_in_shadow(tstrNetworkInfo *pstrNetworkInfo, void *pUserVoid)
+int is_network_in_shadow(tstrNetworkInfo *pstrNetworkInfo, void *pUserVoid)
 {
-   int8_t state = -1;
+   int state = -1;
int i;
 
if (u32LastScannedNtwrksCountShadow == 0) {
@@ -297,7 +297,7 @@ int8_t is_network_in_shadow(tstrNetworkInfo 
*pstrNetworkInfo, void *pUserVoid)
 
 void add_network_to_shadow(tstrNetworkInfo *pstrNetworkInfo, void *pUserVoid, 
void *pJoinParams)
 {
-   int8_t ap_found = is_network_in_shadow(pstrNetworkInfo, pUserVoid);
+   int ap_found = is_network_in_shadow(pstrNetworkInfo, pUserVoid);
u32 ap_index = 0;
u8 rssi_index = 0;
 
-- 
2.5.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 v2 4/4] staging: wilc1000: wilc_wlan_if.h align defines

2015-09-17 Thread Tony Cho
From: Leo Kim 

This patch fix alignment of some defines in wilc_wlan_if.h.

Signed-off-by: Leo Kim 
Signed-off-by: Tony Cho 
---
 drivers/staging/wilc1000/wilc_wlan_if.h | 580 
 1 file changed, 290 insertions(+), 290 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h 
b/drivers/staging/wilc1000/wilc_wlan_if.h
index 0da748a..93ab3c7 100644
--- a/drivers/staging/wilc1000/wilc_wlan_if.h
+++ b/drivers/staging/wilc1000/wilc_wlan_if.h
@@ -23,11 +23,11 @@
  *
  /
 
-#define N_INIT 0x0001
-#define N_ERR  0x0002
-#define N_TXQ  0x0004
-#define N_INTR 0x0008
-#define N_RXQ  0x0010
+#define N_INIT 0x0001
+#define N_ERR  0x0002
+#define N_TXQ  0x0004
+#define N_INTR 0x0008
+#define N_RXQ  0x0010
 
 /
  *
@@ -35,9 +35,9 @@
  *
  /
 
-#define HIF_SDIO   (0)
-#define HIF_SPIBIT(0)
-#define HIF_SDIO_GPIO_IRQ  BIT(2)
+#define HIF_SDIO   (0)
+#define HIF_SPIBIT(0)
+#define HIF_SDIO_GPIO_IRQ  BIT(2)
 
 /
  *
@@ -45,8 +45,8 @@
  *
  /
 
-#define CE_TX_BUFFER_SIZE (64 * 1024)
-#define CE_RX_BUFFER_SIZE (384 * 1024)
+#define CE_TX_BUFFER_SIZE  (64 * 1024)
+#define CE_RX_BUFFER_SIZE  (384 * 1024)
 
 /
  *
@@ -55,21 +55,21 @@
  /
 
 typedef struct {
-   u32 read_write: 1;
-   u32 function: 3;
-   u32 raw: 1;
-   u32 address: 17;
-   u32 data: 8;
+   u32 read_write: 1;
+   u32 function:   3;
+   u32 raw:1;
+   u32 address:17;
+   u32 data:   8;
 } sdio_cmd52_t;
 
 typedef struct {
/* struct { */
-   u32 read_write: 1;
-   u32 function: 3;
-   u32 block_mode: 1;
-   u32 increment: 1;
-   u32 address: 17;
-   u32 count: 9;
+   u32 read_write: 1;
+   u32 function:   3;
+   u32 block_mode: 1;
+   u32 increment:  1;
+   u32 address:17;
+   u32 count:  9;
/* } bit; */
u8 *buffer;
u32 block_size;
@@ -108,10 +108,10 @@ typedef struct {
 typedef struct {
void (*mac_indicate)(int);
 } wilc_wlan_indicate_func_t;
-#define WILC_MAC_INDICATE_STATUS   0x1
-#define WILC_MAC_STATUS_INIT   -1
-#define WILC_MAC_STATUS_READY 0
-#define WILC_MAC_STATUS_CONNECT 1
+#define WILC_MAC_INDICATE_STATUS   0x1
+#define WILC_MAC_STATUS_INIT   -1
+#define WILC_MAC_STATUS_READY  0
+#define WILC_MAC_STATUS_CONNECT1
 
 #define WILC_MAC_INDICATE_SCAN 0x2
 
@@ -154,7 +154,7 @@ struct tx_complete_data {
 
 typedef void (*wilc_tx_complete_func_t)(void *, int);
 
-#define WILC_TX_ERR_NO_BUF (-2)
+#define WILC_TX_ERR_NO_BUF (-2)
 
 typedef struct {
int (*wlan_firmware_download)(const u8 *, u32);
@@ -181,154 +181,154 @@ typedef struct {
 #define MAX_SSID_LEN33
 #define MAX_RATES_SUPPORTED 12
 
-#define INFINITE_SLEEP_TIME((u32)0x)
+#define INFINITE_SLEEP_TIME((u32)0x)
 
 #ifdef WILC_PARSE_SCAN_IN_HOST
 typedef enum {
-   SUPP_RATES_IE = 1,
-   EXT_SUPP_RATES_IE = 50,
-   HT_CAPABILITY_IE = 45,
-   RSN_IE = 48,
-   WPA_IE = 221,
-   WMM_IE = 221,
-   P2P_IE = 221,
+   SUPP_RATES_IE   = 1,
+   EXT_SUPP_RATES_IE   = 50,
+   HT_CAPABILITY_IE= 45,
+   RSN_IE  = 48,
+   WPA_IE  = 221,
+   WMM_IE  = 221,
+   P2P_IE  = 221,
 } BEACON_IE;
 #endif
 typedef enum {
-   INFRASTRUCTURE = 0,
+   INFRASTRUCTURE  = 0,
INDEPENDENT,
AP,
 } BSSTYPE_T;
 
 typedef enum {
-   RATE_AUTO = 0,
-   RATE_1MB = 1,
-   RATE_2MB = 2,
-   RATE_5MB = 5,
-   RATE_6MB = 6,
-   RATE_9MB = 9,
-   RATE_11MB = 11,
-   RATE_12MB = 12,
-   RATE_18MB = 18,
-   RATE_24MB = 24,
-   RATE_26MB = 36,
-   RATE_48MB = 48,
-   RATE_54MB = 54
+   RATE_AUTO   = 0,
+   RATE_1MB= 1,
+   RATE_2MB= 2,
+   RATE_5MB= 5,
+   RATE_6MB= 6,
+   RATE_9MB= 9,
+   RATE_11MB   = 11,
+   RATE_12MB   = 12,
+   RATE_18MB   = 18,
+   RATE_24MB   = 24,
+   RATE_26MB   = 36,
+   RATE_48MB   = 48,
+   RATE_54MB   = 54
 

[PATCH v2 2/4] staging: wilc1000: remove warnings on the multiple blank lines uses

2015-09-17 Thread Tony Cho
From: Leo Kim 

This patch removes the warnings reported by checkpatch.pl
for using multiple blank lines.

Signed-off-by: Leo Kim 
Signed-off-by: Tony Cho 
---
 drivers/staging/wilc1000/wilc_wlan_if.h | 12 
 1 file changed, 12 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h 
b/drivers/staging/wilc1000/wilc_wlan_if.h
index cc92dc9..9111491 100644
--- a/drivers/staging/wilc1000/wilc_wlan_if.h
+++ b/drivers/staging/wilc1000/wilc_wlan_if.h
@@ -7,7 +7,6 @@
 /*  */
 /* / */
 
-
 #ifndef WILC_WLAN_IF_H
 #define WILC_WLAN_IF_H
 
@@ -15,11 +14,9 @@
 /* #define MEMORY_STATIC */
 /* #define USE_OLD_SPI_SW */
 
-
 #include "wilc_oswrapper.h"
 #include "linux_wlan_common.h"
 
-
 /
  *
  *  Debug Flags
@@ -42,7 +39,6 @@
 #define HIF_SPIBIT(0)
 #define HIF_SDIO_GPIO_IRQ  BIT(2)
 
-
 /
  *
  *  Tx/Rx Buffer Size Defines
@@ -156,7 +152,6 @@ struct tx_complete_data {
struct sk_buff *skb;
 };
 
-
 typedef void (*wilc_tx_complete_func_t)(void *, int);
 
 #define WILC_TX_ERR_NO_BUF (-2)
@@ -392,7 +387,6 @@ typedef enum {
 typedef enum {
WID_NIL= 0x,
 
-
/*  BSS Type

*/
/*  --  
*/
/*  Configuration :  InfrastructureIndependent   Access Point   
*/
@@ -753,7 +747,6 @@ typedef enum {
/*  --  
*/
WID_11N_TXOP_PROT_DISABLE  = 0x00B0,
 
-
WID_TX_POWER_LEVEL_11N = 0x00B1,
 
/* Custom Character WID list */
@@ -827,7 +820,6 @@ typedef enum {
WID_MEMORY_ACCESS_32BIT= 0x201F,
WID_RF_REG_VAL = 0x2021,
 
-
/* NMAC Integer WID list */
WID_11N_PHY_ACTIVE_REG_VAL = 0x2080,
 
@@ -883,8 +875,6 @@ typedef enum {
/* BugID 4951: WID toset IP address in firmware */
WID_IP_ADDRESS  = 0x3999,
 
-
-
/* Custom String WID list */
 
/* EMAC Binary WID list */
@@ -899,7 +889,6 @@ typedef enum {
/* NMAC Binary WID list */
WID_11N_AUTORATE_TABLE = 0x4080,
 
-
/*Added here by Amr - BugID 4134*/
WID_SCAN_CHANNEL_LIST  = 0x4084,
 
@@ -926,5 +915,4 @@ void wilc_bus_set_max_speed(void);
 void wilc_bus_set_default_speed(void);
 u32 wilc_get_chipid(u8 update);
 
-
 #endif
-- 
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 v2 3/4] staging: wilc1000: remove warnings line over 80 characters

2015-09-17 Thread Tony Cho
From: Leo Kim 

This patch removes the warnings reported by checkpatch.pl
for line over 80 characters.

Signed-off-by: Leo Kim 
Signed-off-by: Tony Cho 
---
 drivers/staging/wilc1000/wilc_wlan_if.h | 650 ++--
 1 file changed, 374 insertions(+), 276 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h 
b/drivers/staging/wilc1000/wilc_wlan_if.h
index 9111491..0da748a 100644
--- a/drivers/staging/wilc1000/wilc_wlan_if.h
+++ b/drivers/staging/wilc1000/wilc_wlan_if.h
@@ -1,4 +1,4 @@
-/* // 
*/
+/* / */
 /*  */
 /* Copyright (c) Atmel Corporation.  All rights reserved. */
 /*  */
@@ -168,7 +168,8 @@ typedef struct {
int (*wlan_cfg_get)(int, u32, int, u32);
int (*wlan_cfg_get_value)(u32, u8 *, u32);
/*Bug3959: transmitting mgmt frames received from host*/
-   int (*wlan_add_mgmt_to_tx_que)(void *, u8 *, u32, 
wilc_tx_complete_func_t);
+   int (*wlan_add_mgmt_to_tx_que)(void *, u8 *, u32,
+  wilc_tx_complete_func_t);
 } wilc_wlan_oup_t;
 
 /
@@ -216,16 +217,16 @@ typedef enum {
 } TX_RATE_T;
 
 typedef enum {
-   B_ONLY_MODE = 0,/* basic rate: 1, 2 
Mbps, otherwise: 5, 11 Mbps */
-   G_ONLY_MODE,/* basic rate: 6, 12, 
24 Mbps, otherwise: 9, 18, 36, 48, 54 Mbps */
-   G_MIXED_11B_1_MODE, /* basic rate: 1, 2, 5.5, 11 Mbps, 
otherwise: all on */
-   G_MIXED_11B_2_MODE, /* basic rate: 1, 2, 5, 11, 6, 12, 24 
Mbps, otherwise: all on */
+   B_ONLY_MODE = 0,/* 1, 2 M, otherwise: 5, 11 M */
+   G_ONLY_MODE,/* 6, 12, 24 M, otherwise: 9, 18, 36, 48, 54 M */
+   G_MIXED_11B_1_MODE, /* 1, 2, 5.5, 11 M, otherwise: all on */
+   G_MIXED_11B_2_MODE, /* 1, 2, 5, 11, 6, 12, 24 M, otherwise: all on */
 } G_OPERATING_MODE_T;
 
 typedef enum {
-   G_SHORT_PREAMBLE = 0,   /* Short Preamble  */
-   G_LONG_PREAMBLE  = 1,   /* Long Preamble   */
-   G_AUTO_PREAMBLE  = 2,   /* Auto Preamble Selection */
+   G_SHORT_PREAMBLE = 0,   /* Short Preamble */
+   G_LONG_PREAMBLE  = 1,   /* Long Preamble */
+   G_AUTO_PREAMBLE  = 2,   /* Auto Preamble Selection */
 } G_PREAMBLE_T;
 
 #define MAC_CONNECTED1
@@ -349,10 +350,10 @@ typedef enum {
 } N_OBSS_DETECTION_T;
 
 typedef enum {
-   RTS_CTS_NONHT_PROT = 0, /* RTS-CTS at non-HT rate  
*/
-   FIRST_FRAME_NONHT_PROT, /* First frame at non-HT rate  */
-   LSIG_TXOP_PROT, /* LSIG TXOP Protection 
   */
-   FIRST_FRAME_MIXED_PROT, /* First frame at Mixed format */
+   RTS_CTS_NONHT_PROT = 0,/* RTS-CTS at non-HT rate */
+   FIRST_FRAME_NONHT_PROT, /* First frame at non-HT rate */
+   LSIG_TXOP_PROT,/* LSIG TXOP Protection */
+   FIRST_FRAME_MIXED_PROT,  /* First frame at Mixed format */
 } N_PROTECTION_TYPE_T;
 
 typedef enum {
@@ -387,237 +388,299 @@ typedef enum {
 typedef enum {
WID_NIL= 0x,
 
-   /*  BSS Type

*/
-   /*  --  
*/
-   /*  Configuration :  InfrastructureIndependent   Access Point   
*/
-   /*  Values to set : 0   12  

*/
-   /*  --  
*/
+   /*
+*  BSS Type
+*  ---
+*  Configuration :  InfrastructureIndependent   Access Point
+*  Values to set : 0   12
+*  ---
+   */
WID_BSS_TYPE= 0x,
 
-   /*  Transmit Rate   

*/
-   /*  --  
*/
-   /*  Configuration :  1  2  5.5  11  6  9  12  18  24  36  48  54
*/
-   /*  Values to set :  1  2  5  11  6  9  12  18  24  36  48  54

[PATCH v2 0/4] v2 of the series including the null check routin

2015-09-17 Thread Tony Cho
The previous series of 4 patches include a commit message ambiguous and
not enough to explain why the patch is made and needed. So, this version 2
includes the modification on the commit message of the patch for a null check
fix.

Leo Kim (4):
  staging: wilc1000: fix null check routine
  staging: wilc1000: remove warnings on the multiple blank lines uses
  staging: wilc1000: remove warnings line over 80 characters
  staging: wilc1000: wilc_wlan_if.h align defines

 drivers/staging/wilc1000/host_interface.c |4 +-
 drivers/staging/wilc1000/wilc_wlan_if.h   | 1324 +++--
 2 files changed, 708 insertions(+), 620 deletions(-)

-- 
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 v2 1/4] staging: wilc1000: fix null check routine

2015-09-17 Thread Tony Cho
From: Leo Kim 

This patch removes the potential faults which may happen when unexpectedly
getting access to invalid pointer. The pointer of pstrWFIDrv is unlikely
to be invalid. However, it is safer to return error when the invalid
memory is unfortunately accessed.

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

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 6fdf392..151e8c4 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -2403,8 +2403,10 @@ static s32 Handle_RcvdGnrlAsyncInfo(tstrWILC_WFIDrv 
*drvHandler, tstrRcvdGnrlAsy
s32 s32Err = 0;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *) drvHandler;
 
-   if (pstrWFIDrv == NULL)
+   if (unlikely(!pstrWFIDrv)) {
PRINT_ER("Driver handler is NULL\n");
+   return -EFAULT;
+   }
PRINT_D(GENERIC_DBG, "Current State = %d,Received state = %d\n", 
pstrWFIDrv->enuHostIFstate,
pstrRcvdGnrlAsyncInfo->pu8Buffer[7]);
 
-- 
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


Re: [PATCH V2 3/8] staging: wilc1000: replace int8_t with int

2015-09-17 Thread Chaehyun Lim
On Thu, Sep 17, 2015 at 7:34 PM, Sudip Mukherjee
 wrote:
> On Thu, Sep 17, 2015 at 04:48:44PM +0900, Chaehyun Lim wrote:
>> This patch replaces int8_t with int. just use return type as int.
>>
>> Signed-off-by: Chaehyun Lim 
>> ---
> but isn't int8_t is defined as char?
>

Even int8_t is defined as char, I think it's no problem to use int.
Is it need to change as char?

Regards
Chaehyun Lim

> regards
> sudip
--
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 v2] ath9k: Add support for OCB mode

2015-09-17 Thread Jan Kaisrlik
The patch adds support for "outside the context of a BSS"(OCB) mode
to ath9k driver and extends debugfs files by OCB ralated information.

This patch was tested on AR9380-AL1A cards.

Signed-off-by: Jan Kaisrlik 
Cc: Michal Sojka 
---
changes:
* OCB mode is treated like AP mode rather than like ad hoc mode.

Btw. I couldn't find any reasonable documentation about AR_STA_ID1_ADHOC
AR_STA_ID1_STA_AP bits. In my tests, OCB communication works in both
modes, but I'd like to understand the difference. Can somebody point me
to some information about these bits?

 drivers/net/wireless/ath/ath9k/ath9k.h| 1 +
 drivers/net/wireless/ath/ath9k/debug.c| 4 ++--
 drivers/net/wireless/ath/ath9k/htc_drv_init.c | 3 ++-
 drivers/net/wireless/ath/ath9k/hw.c   | 1 +
 drivers/net/wireless/ath/ath9k/init.c | 3 ++-
 drivers/net/wireless/ath/ath9k/main.c | 8 +++-
 drivers/net/wireless/ath/ath9k/recv.c | 2 +-
 7 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h 
b/drivers/net/wireless/ath/ath9k/ath9k.h
index c85c479..b42f4a9 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -635,6 +635,7 @@ struct ath9k_vif_iter_data {
int nstations; /* number of station vifs */
int nwds;  /* number of WDS vifs */
int nadhocs;   /* number of adhoc vifs */
+   int nocbs; /* number of OCB vifs */
struct ieee80211_vif *primary_sta;
 };
 
diff --git a/drivers/net/wireless/ath/ath9k/debug.c 
b/drivers/net/wireless/ath/ath9k/debug.c
index da32c8f..6de64cf 100644
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
@@ -741,8 +741,8 @@ static int read_file_misc(struct seq_file *file, void *data)
   i++, (int)(ctx->assigned), iter_data.naps,
   iter_data.nstations,
   iter_data.nmeshes, iter_data.nwds);
-   seq_printf(file, " ADHOC: %i TOTAL: %hi BEACON-VIF: %hi\n",
-  iter_data.nadhocs, sc->cur_chan->nvifs,
+   seq_printf(file, " ADHOC: %i OCB: %i TOTAL: %hi BEACON-VIF: 
%hi\n",
+  iter_data.nadhocs, iter_data.nocbs, 
sc->cur_chan->nvifs,
   sc->nbcnvifs);
}
 
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c 
b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
index 1e84882..5e53040 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
@@ -736,7 +736,8 @@ static void ath9k_set_hw_capab(struct ath9k_htc_priv *priv,
BIT(NL80211_IFTYPE_AP) |
BIT(NL80211_IFTYPE_P2P_GO) |
BIT(NL80211_IFTYPE_P2P_CLIENT) |
-   BIT(NL80211_IFTYPE_MESH_POINT);
+   BIT(NL80211_IFTYPE_MESH_POINT) |
+   BIT(NL80211_IFTYPE_OCB);
 
hw->wiphy->iface_combinations = _comb;
hw->wiphy->n_iface_combinations = 1;
diff --git a/drivers/net/wireless/ath/ath9k/hw.c 
b/drivers/net/wireless/ath/ath9k/hw.c
index 1dd0339..bdfff46 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -1241,6 +1241,7 @@ static void ath9k_hw_set_operating_mode(struct ath_hw 
*ah, int opmode)
break;
}
/* fall through */
+   case NL80211_IFTYPE_OCB:
case NL80211_IFTYPE_MESH_POINT:
case NL80211_IFTYPE_AP:
set |= AR_STA_ID1_STA_AP;
diff --git a/drivers/net/wireless/ath/ath9k/init.c 
b/drivers/net/wireless/ath/ath9k/init.c
index 57f95f2..5d532c7 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -855,7 +855,8 @@ static void ath9k_set_hw_capab(struct ath_softc *sc, struct 
ieee80211_hw *hw)
BIT(NL80211_IFTYPE_STATION) |
BIT(NL80211_IFTYPE_ADHOC) |
BIT(NL80211_IFTYPE_MESH_POINT) |
-   BIT(NL80211_IFTYPE_WDS);
+   BIT(NL80211_IFTYPE_WDS) |
+   BIT(NL80211_IFTYPE_OCB);
 
if (ath9k_is_chanctx_enabled())
hw->wiphy->interface_modes |=
diff --git a/drivers/net/wireless/ath/ath9k/main.c 
b/drivers/net/wireless/ath/ath9k/main.c
index c27143b..56abb9d 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -938,6 +938,9 @@ static void ath9k_vif_iter(struct ath9k_vif_iter_data 
*iter_data,
if (avp->assoc && !iter_data->primary_sta)
iter_data->primary_sta = vif;
break;
+   case NL80211_IFTYPE_OCB:
+   iter_data->nocbs++;
+   break;
case NL80211_IFTYPE_ADHOC:
iter_data->nadhocs++;
if (vif->bss_conf.enable_beacon)
@@ -,6 

Re: [PATCH V2 1/8] staging: wilc1000: remove INLINE macro

2015-09-17 Thread Sudip Mukherjee
On Thu, Sep 17, 2015 at 04:48:42PM +0900, Chaehyun Lim wrote:
> This patch removes INLINE macro that is used anymore.
used? if used then why are you removing it? :)

regards
sudip
--
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 V2 3/8] staging: wilc1000: replace int8_t with int

2015-09-17 Thread Sudip Mukherjee
On Thu, Sep 17, 2015 at 04:48:44PM +0900, Chaehyun Lim wrote:
> This patch replaces int8_t with int. just use return type as int.
> 
> Signed-off-by: Chaehyun Lim 
> ---
but isn't int8_t is defined as char?

regards
sudip
--
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] ath10k: move hw_scan worker queuing

2015-09-17 Thread Kalle Valo
Michal Kazior  writes:

> The remain_on_channel callback needs different
> timeout. Calling ieee80211_queue_work() with a
> shorter delay after calling it with a longer delay
> will not change the timer. This caused the
> offchannel timeout worker to not trigger in time
> and caused the device to stay on channel longer
> then expected. This could cause some problems and
> was be easily reproduced with `iw offchannel`
> command.
>
> Signed-off-by: Michal Kazior 

Thanks, applied.

-- 
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


Re: [PATCH 1/2] ath10k: split switch_vif_chanctx guts

2015-09-17 Thread Kalle Valo
Michal Kazior  writes:

> This is necessary to make vdev restarting logic
> reusable later.
>
> Signed-off-by: Michal Kazior 

Thanks, both patches applied.

-- 
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


Re: [PATCH] ath10k: add ATH10K_FW_FEATURE_RAW_MODE_SUPPORT to ath10k_core_fw_feature_str[]

2015-09-17 Thread Kalle Valo
Kalle Valo  writes:

> This was missed in the original commit adding the flag and ath10k only 
> printed "bit10":
>
> ath10k_pci :02:00.0: qca988x hw2.0 (0x4100016c, 0x043202ff) fw 
> 10.2.4.70.6-2 api 3
> htt-ver 2.1 wmi-op 5 htt-op 2 cal otp max-sta 128 raw 0 hwcrypto 1 features 
> no-p2p,bit10
>
> Also add a build test to avoid this happening again.
>
> Fixes: ccec9038c721 ("ath10k: enable raw encap mode and software crypto 
> engine")
> Signed-off-by: Kalle Valo 

Applied.

-- 
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


Re: [PATCH v3 1/3] ath10k: enable monitor when OTHER_BSS requested

2015-09-17 Thread Kalle Valo
Bob Copeland  writes:

> By default, ath10k restricts received frames to those matching BSSID.
> When other BSS frames are requested (e.g. in mesh mode), add an internal
> monitor device so those frames are not filtered.
>
> Signed-off-by: Bob Copeland 

Thanks, all three patches applied. In patch 3 I just changed the
firmware version in commit log to 10.2.4.70.6-2 as that one has the raw
mode feature flag enabled.

I also tested this myself and I was able to join to a mesh network I
created with ath9k and ping each other. In case someone cherry picks
these patches please take into account that these patches need quite a
few recent mac80211 patches from mac80211-next. The patches are also in
wireless-testing and ath.git master branch. Safest is to test with
ath.git master branch.

-- 
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


[PATCH v2 1/2] staging: wilc1000: remove define RX_BH_TYPE

2015-09-17 Thread Tony Cho
From: Glen Lee 

This patch removes the preprocessor definition, RX_BH_TYPE and uses the
request_threaded_irq instead of kernel thread to execute the interrupt
handler.

As a result, linux_wlan_enable_irq() and linux_wlan_disable_irq() are also
removed from the linux_wlan.c file.

Signed-off-by: Glen Lee 
Signed-off-by: Tony Cho 
---
 drivers/staging/wilc1000/linux_wlan.c | 139 --
 drivers/staging/wilc1000/linux_wlan_common.h  |   3 -
 drivers/staging/wilc1000/wilc_wfi_netdevice.h |  15 ---
 drivers/staging/wilc1000/wilc_wlan.c  |   3 -
 4 files changed, 160 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index a4f43d2..c7034648 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -297,89 +297,30 @@ static int dev_state_ev_handler(struct notifier_block 
*this, unsigned long event
 }
 #endif
 
-/*
- * Interrupt initialization and handling functions
- */
-
-void linux_wlan_enable_irq(void)
-{
-
-#if (RX_BH_TYPE != RX_BH_THREADED_IRQ)
-#if (defined WILC_SPI) || (defined WILC_SDIO_IRQ_GPIO)
-   PRINT_D(INT_DBG, "Enabling IRQ ...\n");
-   enable_irq(g_linux_wlan->dev_irq_num);
-#endif
-#endif
-}
-
-void linux_wlan_disable_irq(int wait)
-{
-#if (defined WILC_SPI) || (defined WILC_SDIO_IRQ_GPIO)
-   if (wait) {
-   PRINT_D(INT_DBG, "Disabling IRQ ...\n");
-   disable_irq(g_linux_wlan->dev_irq_num);
-   } else {
-   PRINT_D(INT_DBG, "Disabling IRQ ...\n");
-   disable_irq_nosync(g_linux_wlan->dev_irq_num);
-   }
-#endif
-}
-
 #if (defined WILC_SPI) || (defined WILC_SDIO_IRQ_GPIO)
 static irqreturn_t isr_uh_routine(int irq, void *user_data)
 {
-#if (RX_BH_TYPE != RX_BH_THREADED_IRQ)
-   linux_wlan_disable_irq(IRQ_NO_WAIT);
-#endif
PRINT_D(INT_DBG, "Interrupt received UH\n");
 
/*While mac is closing cacncel the handling of any interrupts received*/
if (g_linux_wlan->close) {
PRINT_ER("Driver is CLOSING: Can't handle UH interrupt\n");
-   #if (RX_BH_TYPE == RX_BH_THREADED_IRQ)
return IRQ_HANDLED;
-   #else
-   return IRQ_NONE;
-   #endif
-
}
-#if (RX_BH_TYPE == RX_BH_WORK_QUEUE)
-   schedule_work(_linux_wlan->rx_work_queue);
-   return IRQ_HANDLED;
-#elif (RX_BH_TYPE == RX_BH_KTHREAD)
-   up(_linux_wlan->rx_sem);
-   return IRQ_HANDLED;
-#elif (RX_BH_TYPE == RX_BH_THREADED_IRQ)
return IRQ_WAKE_THREAD;
-#endif
-
 }
 #endif
 
-#if (RX_BH_TYPE == RX_BH_WORK_QUEUE || RX_BH_TYPE == RX_BH_THREADED_IRQ)
-
-#if (RX_BH_TYPE == RX_BH_THREADED_IRQ)
 irqreturn_t isr_bh_routine(int irq, void *userdata)
 {
linux_wlan_t *nic;
 
nic = (linux_wlan_t *)userdata;
-#else
-static void isr_bh_routine(struct work_struct *work)
-{
-   perInterface_wlan_t *nic;
-
-   nic = (perInterface_wlan_t *)container_of(work, linux_wlan_t, 
rx_work_queue);
-#endif
 
/*While mac is closing cacncel the handling of any interrupts received*/
if (g_linux_wlan->close) {
PRINT_ER("Driver is CLOSING: Can't handle BH interrupt\n");
-   #if (RX_BH_TYPE == RX_BH_THREADED_IRQ)
return IRQ_HANDLED;
-   #else
-   return;
-   #endif
}
 
PRINT_D(INT_DBG, "Interrupt received BH\n");
@@ -388,36 +329,8 @@ static void isr_bh_routine(struct work_struct *work)
else
PRINT_ER("wlan_handle_rx_isr() hasn't been initialized\n");
 
-#if (RX_BH_TYPE == RX_BH_THREADED_IRQ)
return IRQ_HANDLED;
-#endif
 }
-#elif (RX_BH_TYPE == RX_BH_KTHREAD)
-static int isr_bh_routine(void *vp)
-{
-   linux_wlan_t *nic;
-
-   nic = (linux_wlan_t *)vp;
-
-   while (1) {
-   down(>rx_sem);
-   if (g_linux_wlan->close) {
-
-   while (!kthread_should_stop())
-   schedule();
-
-   break;
-   }
-   PRINT_D(INT_DBG, "Interrupt received BH\n");
-   if (g_linux_wlan->oup.wlan_handle_rx_isr != NULL)
-   g_linux_wlan->oup.wlan_handle_rx_isr();
-   else
-   PRINT_ER("wlan_handle_rx_isr() hasn't been 
initialized\n");
-   }
-
-   return 0;
-}
-#endif
 
 #if (defined WILC_SPI) || (defined WILC_SDIO_IRQ_GPIO)
 static int init_irq(linux_wlan_t *p_nic)
@@ -443,17 +356,10 @@ static int init_irq(linux_wlan_t *p_nic)
PRINT_ER("could not obtain gpio for WILC_INTR\n");
}
 
-#if (RX_BH_TYPE == RX_BH_THREADED_IRQ)
if ((ret != -1) && (request_threaded_irq(nic->dev_irq_num, 
isr_uh_routine, isr_bh_routine,
  IRQF_TRIGGER_LOW | 
IRQF_ONESHOT,   /*Without IRQF_ONESHOT the uh will remain kicked in 
and dont gave a 

[PATCH v2 0/2] resend version 2 for RX_BH_TYPE patch

2015-09-17 Thread Tony Cho
This series of patch is the version 2 for the RX_BH_TYPE patch before sent.

Glen Lee (2):
  staging: wilc1000: remove define RX_BH_TYPE
  staging: wilc1000: remove do-nothing ifdef statement

 drivers/staging/wilc1000/linux_wlan.c | 149 +-
 drivers/staging/wilc1000/linux_wlan_common.h  |   3 -
 drivers/staging/wilc1000/wilc_wfi_netdevice.h |  15 ---
 drivers/staging/wilc1000/wilc_wlan.c  |   3 -
 4 files changed, 2 insertions(+), 168 deletions(-)

-- 
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 v2 2/2] staging: wilc1000: remove do-nothing ifdef statement

2015-09-17 Thread Tony Cho
From: Glen Lee 

This patch removes do-nothing ifdef, else statement and add ifdef WILC_SDIO
for disable_sdio_interrupt().

Signed-off-by: Glen Lee 
Signed-off-by: Tony Cho 
---
 drivers/staging/wilc1000/linux_wlan.c | 10 ++
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index c7034648..7f4ee80 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -982,17 +982,11 @@ void wilc1000_wlan_deinit(linux_wlan_t *nic)
 #endif
 
PRINT_D(INIT_DBG, "Disabling IRQ\n");
-   #if (!defined WILC_SDIO) || (defined WILC_SDIO_IRQ_GPIO)
-   #else
- #if defined(PLAT_ALLWINNER_A20) || 
defined(PLAT_ALLWINNER_A23) || defined(PLAT_ALLWINNER_A31)
-
- #else
+#ifdef WILC_SDIO
mutex_lock(_linux_wlan->hif_cs);
disable_sdio_interrupt();
mutex_unlock(_linux_wlan->hif_cs);
- #endif
-   #endif
-
+#endif
if (_linux_wlan->txq_event != NULL)
up(_linux_wlan->txq_event);
 
-- 
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


Re: [PATCH 1/4] staging: wilc1000: Modify null check routine

2015-09-17 Thread Tony Cho



On 2015년 09월 17일 18:06, Nicolas Ferre wrote:

Le 17/09/2015 10:50, Tony Cho a écrit :

From: Leo Kim 

This patch modify null check routine.
- Null check error non return. (Handle_RcvdGnrlAsyncInfo)

It doesn't parse...

Is it fixing a bug? What were the consequences without the return?

Bye,


I think commit log is not enough to explain what this commit is.

I will resend this series of patch as v2. do you have any concern?
Thanks,
Tony.


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

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 6fdf392..a9eaa8f 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -2403,8 +2403,10 @@ static s32 Handle_RcvdGnrlAsyncInfo(tstrWILC_WFIDrv 
*drvHandler, tstrRcvdGnrlAsy
s32 s32Err = 0;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *) drvHandler;
 
-	if (pstrWFIDrv == NULL)

+   if (!pstrWFIDrv) {
PRINT_ER("Driver handler is NULL\n");
+   return -EFAULT;
+   }
PRINT_D(GENERIC_DBG, "Current State = %d,Received state = %d\n", 
pstrWFIDrv->enuHostIFstate,
pstrRcvdGnrlAsyncInfo->pu8Buffer[7]);
 





--
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 2/4] staging: wilc1000: remove warnings on the multiple blank lines uses

2015-09-17 Thread Tony Cho
From: Leo Kim 

This patch removes the warnings reported by checkpatch.pl
for using multiple blank lines.

Signed-off-by: Leo Kim 
Signed-off-by: Tony Cho 
---
 drivers/staging/wilc1000/wilc_wlan_if.h | 12 
 1 file changed, 12 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h 
b/drivers/staging/wilc1000/wilc_wlan_if.h
index cc92dc9..9111491 100644
--- a/drivers/staging/wilc1000/wilc_wlan_if.h
+++ b/drivers/staging/wilc1000/wilc_wlan_if.h
@@ -7,7 +7,6 @@
 /*  */
 /* / */
 
-
 #ifndef WILC_WLAN_IF_H
 #define WILC_WLAN_IF_H
 
@@ -15,11 +14,9 @@
 /* #define MEMORY_STATIC */
 /* #define USE_OLD_SPI_SW */
 
-
 #include "wilc_oswrapper.h"
 #include "linux_wlan_common.h"
 
-
 /
  *
  *  Debug Flags
@@ -42,7 +39,6 @@
 #define HIF_SPIBIT(0)
 #define HIF_SDIO_GPIO_IRQ  BIT(2)
 
-
 /
  *
  *  Tx/Rx Buffer Size Defines
@@ -156,7 +152,6 @@ struct tx_complete_data {
struct sk_buff *skb;
 };
 
-
 typedef void (*wilc_tx_complete_func_t)(void *, int);
 
 #define WILC_TX_ERR_NO_BUF (-2)
@@ -392,7 +387,6 @@ typedef enum {
 typedef enum {
WID_NIL= 0x,
 
-
/*  BSS Type

*/
/*  --  
*/
/*  Configuration :  InfrastructureIndependent   Access Point   
*/
@@ -753,7 +747,6 @@ typedef enum {
/*  --  
*/
WID_11N_TXOP_PROT_DISABLE  = 0x00B0,
 
-
WID_TX_POWER_LEVEL_11N = 0x00B1,
 
/* Custom Character WID list */
@@ -827,7 +820,6 @@ typedef enum {
WID_MEMORY_ACCESS_32BIT= 0x201F,
WID_RF_REG_VAL = 0x2021,
 
-
/* NMAC Integer WID list */
WID_11N_PHY_ACTIVE_REG_VAL = 0x2080,
 
@@ -883,8 +875,6 @@ typedef enum {
/* BugID 4951: WID toset IP address in firmware */
WID_IP_ADDRESS  = 0x3999,
 
-
-
/* Custom String WID list */
 
/* EMAC Binary WID list */
@@ -899,7 +889,6 @@ typedef enum {
/* NMAC Binary WID list */
WID_11N_AUTORATE_TABLE = 0x4080,
 
-
/*Added here by Amr - BugID 4134*/
WID_SCAN_CHANNEL_LIST  = 0x4084,
 
@@ -926,5 +915,4 @@ void wilc_bus_set_max_speed(void);
 void wilc_bus_set_default_speed(void);
 u32 wilc_get_chipid(u8 update);
 
-
 #endif
-- 
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 3/4] staging: wilc1000: remove warnings line over 80 characters

2015-09-17 Thread Tony Cho
From: Leo Kim 

This patch removes the warnings reported by checkpatch.pl
for line over 80 characters.

Signed-off-by: Leo Kim 
Signed-off-by: Tony Cho 
---
 drivers/staging/wilc1000/wilc_wlan_if.h | 650 ++--
 1 file changed, 374 insertions(+), 276 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h 
b/drivers/staging/wilc1000/wilc_wlan_if.h
index 9111491..0da748a 100644
--- a/drivers/staging/wilc1000/wilc_wlan_if.h
+++ b/drivers/staging/wilc1000/wilc_wlan_if.h
@@ -1,4 +1,4 @@
-/* // 
*/
+/* / */
 /*  */
 /* Copyright (c) Atmel Corporation.  All rights reserved. */
 /*  */
@@ -168,7 +168,8 @@ typedef struct {
int (*wlan_cfg_get)(int, u32, int, u32);
int (*wlan_cfg_get_value)(u32, u8 *, u32);
/*Bug3959: transmitting mgmt frames received from host*/
-   int (*wlan_add_mgmt_to_tx_que)(void *, u8 *, u32, 
wilc_tx_complete_func_t);
+   int (*wlan_add_mgmt_to_tx_que)(void *, u8 *, u32,
+  wilc_tx_complete_func_t);
 } wilc_wlan_oup_t;
 
 /
@@ -216,16 +217,16 @@ typedef enum {
 } TX_RATE_T;
 
 typedef enum {
-   B_ONLY_MODE = 0,/* basic rate: 1, 2 
Mbps, otherwise: 5, 11 Mbps */
-   G_ONLY_MODE,/* basic rate: 6, 12, 
24 Mbps, otherwise: 9, 18, 36, 48, 54 Mbps */
-   G_MIXED_11B_1_MODE, /* basic rate: 1, 2, 5.5, 11 Mbps, 
otherwise: all on */
-   G_MIXED_11B_2_MODE, /* basic rate: 1, 2, 5, 11, 6, 12, 24 
Mbps, otherwise: all on */
+   B_ONLY_MODE = 0,/* 1, 2 M, otherwise: 5, 11 M */
+   G_ONLY_MODE,/* 6, 12, 24 M, otherwise: 9, 18, 36, 48, 54 M */
+   G_MIXED_11B_1_MODE, /* 1, 2, 5.5, 11 M, otherwise: all on */
+   G_MIXED_11B_2_MODE, /* 1, 2, 5, 11, 6, 12, 24 M, otherwise: all on */
 } G_OPERATING_MODE_T;
 
 typedef enum {
-   G_SHORT_PREAMBLE = 0,   /* Short Preamble  */
-   G_LONG_PREAMBLE  = 1,   /* Long Preamble   */
-   G_AUTO_PREAMBLE  = 2,   /* Auto Preamble Selection */
+   G_SHORT_PREAMBLE = 0,   /* Short Preamble */
+   G_LONG_PREAMBLE  = 1,   /* Long Preamble */
+   G_AUTO_PREAMBLE  = 2,   /* Auto Preamble Selection */
 } G_PREAMBLE_T;
 
 #define MAC_CONNECTED1
@@ -349,10 +350,10 @@ typedef enum {
 } N_OBSS_DETECTION_T;
 
 typedef enum {
-   RTS_CTS_NONHT_PROT = 0, /* RTS-CTS at non-HT rate  
*/
-   FIRST_FRAME_NONHT_PROT, /* First frame at non-HT rate  */
-   LSIG_TXOP_PROT, /* LSIG TXOP Protection 
   */
-   FIRST_FRAME_MIXED_PROT, /* First frame at Mixed format */
+   RTS_CTS_NONHT_PROT = 0,/* RTS-CTS at non-HT rate */
+   FIRST_FRAME_NONHT_PROT, /* First frame at non-HT rate */
+   LSIG_TXOP_PROT,/* LSIG TXOP Protection */
+   FIRST_FRAME_MIXED_PROT,  /* First frame at Mixed format */
 } N_PROTECTION_TYPE_T;
 
 typedef enum {
@@ -387,237 +388,299 @@ typedef enum {
 typedef enum {
WID_NIL= 0x,
 
-   /*  BSS Type

*/
-   /*  --  
*/
-   /*  Configuration :  InfrastructureIndependent   Access Point   
*/
-   /*  Values to set : 0   12  

*/
-   /*  --  
*/
+   /*
+*  BSS Type
+*  ---
+*  Configuration :  InfrastructureIndependent   Access Point
+*  Values to set : 0   12
+*  ---
+   */
WID_BSS_TYPE= 0x,
 
-   /*  Transmit Rate   

*/
-   /*  --  
*/
-   /*  Configuration :  1  2  5.5  11  6  9  12  18  24  36  48  54
*/
-   /*  Values to set :  1  2  5  11  6  9  12  18  24  36  48  54

[PATCH 1/4] staging: wilc1000: Modify null check routine

2015-09-17 Thread Tony Cho
From: Leo Kim 

This patch modify null check routine.
- Null check error non return. (Handle_RcvdGnrlAsyncInfo)

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

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 6fdf392..a9eaa8f 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -2403,8 +2403,10 @@ static s32 Handle_RcvdGnrlAsyncInfo(tstrWILC_WFIDrv 
*drvHandler, tstrRcvdGnrlAsy
s32 s32Err = 0;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *) drvHandler;
 
-   if (pstrWFIDrv == NULL)
+   if (!pstrWFIDrv) {
PRINT_ER("Driver handler is NULL\n");
+   return -EFAULT;
+   }
PRINT_D(GENERIC_DBG, "Current State = %d,Received state = %d\n", 
pstrWFIDrv->enuHostIFstate,
pstrRcvdGnrlAsyncInfo->pu8Buffer[7]);
 
-- 
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 4/4] staging: wilc1000: wilc_wlan_if.h align defines

2015-09-17 Thread Tony Cho
From: Leo Kim 

This patch fix alignment of some defines in wilc_wlan_if.h.

Signed-off-by: Leo Kim 
Signed-off-by: Tony Cho 
---
 drivers/staging/wilc1000/wilc_wlan_if.h | 580 
 1 file changed, 290 insertions(+), 290 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h 
b/drivers/staging/wilc1000/wilc_wlan_if.h
index 0da748a..93ab3c7 100644
--- a/drivers/staging/wilc1000/wilc_wlan_if.h
+++ b/drivers/staging/wilc1000/wilc_wlan_if.h
@@ -23,11 +23,11 @@
  *
  /
 
-#define N_INIT 0x0001
-#define N_ERR  0x0002
-#define N_TXQ  0x0004
-#define N_INTR 0x0008
-#define N_RXQ  0x0010
+#define N_INIT 0x0001
+#define N_ERR  0x0002
+#define N_TXQ  0x0004
+#define N_INTR 0x0008
+#define N_RXQ  0x0010
 
 /
  *
@@ -35,9 +35,9 @@
  *
  /
 
-#define HIF_SDIO   (0)
-#define HIF_SPIBIT(0)
-#define HIF_SDIO_GPIO_IRQ  BIT(2)
+#define HIF_SDIO   (0)
+#define HIF_SPIBIT(0)
+#define HIF_SDIO_GPIO_IRQ  BIT(2)
 
 /
  *
@@ -45,8 +45,8 @@
  *
  /
 
-#define CE_TX_BUFFER_SIZE (64 * 1024)
-#define CE_RX_BUFFER_SIZE (384 * 1024)
+#define CE_TX_BUFFER_SIZE  (64 * 1024)
+#define CE_RX_BUFFER_SIZE  (384 * 1024)
 
 /
  *
@@ -55,21 +55,21 @@
  /
 
 typedef struct {
-   u32 read_write: 1;
-   u32 function: 3;
-   u32 raw: 1;
-   u32 address: 17;
-   u32 data: 8;
+   u32 read_write: 1;
+   u32 function:   3;
+   u32 raw:1;
+   u32 address:17;
+   u32 data:   8;
 } sdio_cmd52_t;
 
 typedef struct {
/* struct { */
-   u32 read_write: 1;
-   u32 function: 3;
-   u32 block_mode: 1;
-   u32 increment: 1;
-   u32 address: 17;
-   u32 count: 9;
+   u32 read_write: 1;
+   u32 function:   3;
+   u32 block_mode: 1;
+   u32 increment:  1;
+   u32 address:17;
+   u32 count:  9;
/* } bit; */
u8 *buffer;
u32 block_size;
@@ -108,10 +108,10 @@ typedef struct {
 typedef struct {
void (*mac_indicate)(int);
 } wilc_wlan_indicate_func_t;
-#define WILC_MAC_INDICATE_STATUS   0x1
-#define WILC_MAC_STATUS_INIT   -1
-#define WILC_MAC_STATUS_READY 0
-#define WILC_MAC_STATUS_CONNECT 1
+#define WILC_MAC_INDICATE_STATUS   0x1
+#define WILC_MAC_STATUS_INIT   -1
+#define WILC_MAC_STATUS_READY  0
+#define WILC_MAC_STATUS_CONNECT1
 
 #define WILC_MAC_INDICATE_SCAN 0x2
 
@@ -154,7 +154,7 @@ struct tx_complete_data {
 
 typedef void (*wilc_tx_complete_func_t)(void *, int);
 
-#define WILC_TX_ERR_NO_BUF (-2)
+#define WILC_TX_ERR_NO_BUF (-2)
 
 typedef struct {
int (*wlan_firmware_download)(const u8 *, u32);
@@ -181,154 +181,154 @@ typedef struct {
 #define MAX_SSID_LEN33
 #define MAX_RATES_SUPPORTED 12
 
-#define INFINITE_SLEEP_TIME((u32)0x)
+#define INFINITE_SLEEP_TIME((u32)0x)
 
 #ifdef WILC_PARSE_SCAN_IN_HOST
 typedef enum {
-   SUPP_RATES_IE = 1,
-   EXT_SUPP_RATES_IE = 50,
-   HT_CAPABILITY_IE = 45,
-   RSN_IE = 48,
-   WPA_IE = 221,
-   WMM_IE = 221,
-   P2P_IE = 221,
+   SUPP_RATES_IE   = 1,
+   EXT_SUPP_RATES_IE   = 50,
+   HT_CAPABILITY_IE= 45,
+   RSN_IE  = 48,
+   WPA_IE  = 221,
+   WMM_IE  = 221,
+   P2P_IE  = 221,
 } BEACON_IE;
 #endif
 typedef enum {
-   INFRASTRUCTURE = 0,
+   INFRASTRUCTURE  = 0,
INDEPENDENT,
AP,
 } BSSTYPE_T;
 
 typedef enum {
-   RATE_AUTO = 0,
-   RATE_1MB = 1,
-   RATE_2MB = 2,
-   RATE_5MB = 5,
-   RATE_6MB = 6,
-   RATE_9MB = 9,
-   RATE_11MB = 11,
-   RATE_12MB = 12,
-   RATE_18MB = 18,
-   RATE_24MB = 24,
-   RATE_26MB = 36,
-   RATE_48MB = 48,
-   RATE_54MB = 54
+   RATE_AUTO   = 0,
+   RATE_1MB= 1,
+   RATE_2MB= 2,
+   RATE_5MB= 5,
+   RATE_6MB= 6,
+   RATE_9MB= 9,
+   RATE_11MB   = 11,
+   RATE_12MB   = 12,
+   RATE_18MB   = 18,
+   RATE_24MB   = 24,
+   RATE_26MB   = 36,
+   RATE_48MB   = 48,
+   RATE_54MB   = 54
 

Re: [PATCH 1/4] staging: wilc1000: Modify null check routine

2015-09-17 Thread Nicolas Ferre
Le 17/09/2015 10:50, Tony Cho a écrit :
> From: Leo Kim 
> 
> This patch modify null check routine.
> - Null check error non return. (Handle_RcvdGnrlAsyncInfo)

It doesn't parse...

Is it fixing a bug? What were the consequences without the return?

Bye,

> Signed-off-by: Leo Kim 
> Signed-off-by: Tony Cho 
> ---
>  drivers/staging/wilc1000/host_interface.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/wilc1000/host_interface.c 
> b/drivers/staging/wilc1000/host_interface.c
> index 6fdf392..a9eaa8f 100644
> --- a/drivers/staging/wilc1000/host_interface.c
> +++ b/drivers/staging/wilc1000/host_interface.c
> @@ -2403,8 +2403,10 @@ static s32 Handle_RcvdGnrlAsyncInfo(tstrWILC_WFIDrv 
> *drvHandler, tstrRcvdGnrlAsy
>   s32 s32Err = 0;
>   tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *) drvHandler;
>  
> - if (pstrWFIDrv == NULL)
> + if (!pstrWFIDrv) {
>   PRINT_ER("Driver handler is NULL\n");
> + return -EFAULT;
> + }
>   PRINT_D(GENERIC_DBG, "Current State = %d,Received state = %d\n", 
> pstrWFIDrv->enuHostIFstate,
>   pstrRcvdGnrlAsyncInfo->pu8Buffer[7]);
>  
> 


-- 
Nicolas Ferre
--
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 v2] wil6210: remove MCS radiotap field

2015-09-17 Thread Johannes Berg
From: Johannes Berg 

The MCS radiotap field was really intended for HT MCS (and the
radiotap spec does indiciate that) and dissectors treat it as
meaning the frame was a HT frame. Therefore, inclusion of it
in a 60GHz device is misleading.

Cf. the thread at
http://mid.gmane.org/cacyxjpzq-epb1ux6wi_rv3onpkxomcjcm15xjwa51u0e4w2...@mail.gmail.com

Remove the field for now, until a proper 60 GHz PHY information
field is defined.

Signed-off-by: Johannes Berg 
---
 drivers/net/wireless/ath/wil6210/txrx.c | 11 +--
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/drivers/net/wireless/ath/wil6210/txrx.c 
b/drivers/net/wireless/ath/wil6210/txrx.c
index 6229110d558a..19bf5d4d3e44 100644
--- a/drivers/net/wireless/ath/wil6210/txrx.c
+++ b/drivers/net/wireless/ath/wil6210/txrx.c
@@ -270,10 +270,6 @@ static void wil_rx_add_radiotap_header(struct wil6210_priv 
*wil,
/* channel */
__le16 chnl_freq __aligned(2);
__le16 chnl_flags;
-   /* MCS */
-   u8 mcs_present;
-   u8 mcs_flags;
-   u8 mcs_index;
} __packed;
struct wil6210_rtap_vendor {
struct wil6210_rtap rtap;
@@ -329,18 +325,13 @@ static void wil_rx_add_radiotap_header(struct 
wil6210_priv *wil,
rtap_vendor->rtap.rthdr.it_len = cpu_to_le16(rtap_len);
rtap_vendor->rtap.rthdr.it_present = cpu_to_le32(
(1 << IEEE80211_RADIOTAP_FLAGS) |
-   (1 << IEEE80211_RADIOTAP_CHANNEL) |
-   (1 << IEEE80211_RADIOTAP_MCS));
+   (1 << IEEE80211_RADIOTAP_CHANNEL));
if (d->dma.status & RX_DMA_STATUS_ERROR)
rtap_vendor->rtap.flags |= IEEE80211_RADIOTAP_F_BADFCS;
 
rtap_vendor->rtap.chnl_freq = cpu_to_le16(ch ? ch->center_freq : 58320);
rtap_vendor->rtap.chnl_flags = cpu_to_le16(0);
 
-   rtap_vendor->rtap.mcs_present = IEEE80211_RADIOTAP_MCS_HAVE_MCS;
-   rtap_vendor->rtap.mcs_flags = 0;
-   rtap_vendor->rtap.mcs_index = wil_rxdesc_mcs(d);
-
if (rtap_include_phy_info) {
rtap_vendor->rtap.rthdr.it_present |= cpu_to_le32(1 <<
IEEE80211_RADIOTAP_VENDOR_NAMESPACE);
-- 
2.5.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] wil6210: remove MCS radiotap field

2015-09-17 Thread Johannes Berg
From: Johannes Berg 

The MCS radiotap field was really intended for HT MCS (and the
radiotap spec does indiciate that) and dissectors treat it as
meaning the frame was a HT frame. Therefore, inclusion of it
in a 60GHz device is misleading.

Cf. the thread at
http://mid.gmane.org/cacyxjpzq-epb1ux6wi_rv3onpkxomcjcm15xjwa51u0e4w2...@mail.gmail.com

Remove the field for now, until a proper 60 GHz PHY information
field is defined.

Signed-off-by: Johannes Berg 
---
 drivers/net/wireless/ath/wil6210/txrx.c | 11 +--
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/drivers/net/wireless/ath/wil6210/txrx.c 
b/drivers/net/wireless/ath/wil6210/txrx.c
index 6229110d558a..19bf5d4d3e44 100644
--- a/drivers/net/wireless/ath/wil6210/txrx.c
+++ b/drivers/net/wireless/ath/wil6210/txrx.c
@@ -270,10 +270,6 @@ static void wil_rx_add_radiotap_header(struct wil6210_priv 
*wil,
/* channel */
__le16 chnl_freq __aligned(2);
__le16 chnl_flags;
-   /* MCS */
-   u8 mcs_present;
-   u8 mcs_flags;
-   u8 mcs_index;
} __packed;
struct wil6210_rtap_vendor {
struct wil6210_rtap rtap;
@@ -329,18 +325,13 @@ static void wil_rx_add_radiotap_header(struct 
wil6210_priv *wil,
rtap_vendor->rtap.rthdr.it_len = cpu_to_le16(rtap_len);
rtap_vendor->rtap.rthdr.it_present = cpu_to_le32(
(1 << IEEE80211_RADIOTAP_FLAGS) |
-   (1 << IEEE80211_RADIOTAP_CHANNEL) |
-   (1 << IEEE80211_RADIOTAP_MCS));
+   (1 << IEEE80211_RADIOTAP_CHANNEL));
if (d->dma.status & RX_DMA_STATUS_ERROR)
rtap_vendor->rtap.flags |= IEEE80211_RADIOTAP_F_BADFCS;
 
rtap_vendor->rtap.chnl_freq = cpu_to_le16(ch ? ch->center_freq : 58320);
rtap_vendor->rtap.chnl_flags = cpu_to_le16(0);
 
-   rtap_vendor->rtap.mcs_present = IEEE80211_RADIOTAP_MCS_HAVE_MCS;
-   rtap_vendor->rtap.mcs_flags = 0;
-   rtap_vendor->rtap.mcs_index = wil_rxdesc_mcs(d);
-
if (rtap_include_phy_info) {
rtap_vendor->rtap.rthdr.it_present |= cpu_to_le32(1 <<
IEEE80211_RADIOTAP_VENDOR_NAMESPACE);
-- 
2.5.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


[RFC 7/7] mac80211: implement nan_change_conf

2015-09-17 Thread andrei . otcheretianski
From: Andrei Otcheretianski 

Add a trivial implementation for nan_change_conf by simply passing
everything directly to the driver.

Signed-off-by: Andrei Otcheretianski 
---
 net/mac80211/cfg.c| 18 ++
 net/mac80211/driver-ops.h | 21 +
 net/mac80211/trace.h  | 32 
 3 files changed, 71 insertions(+)

diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 8a504ae..d2726f1 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -191,6 +191,23 @@ static void ieee80211_rm_nan_func(struct wiphy *wiphy,
drv_rm_nan_func(sdata->local, sdata, instance_id);
 }
 
+static int ieee80211_nan_change_conf(struct wiphy *wiphy,
+struct wireless_dev *wdev,
+struct cfg80211_nan_conf *conf,
+u32 changes)
+{
+   struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
+
+   if (sdata->vif.type != NL80211_IFTYPE_NAN)
+   return -EOPNOTSUPP;
+
+   if (!ieee80211_sdata_running(sdata))
+   return -ENETDOWN;
+
+   return drv_nan_change_conf(sdata->local, sdata, conf, changes);
+}
+
+
 static int ieee80211_set_noack_map(struct wiphy *wiphy,
  struct net_device *dev,
  u16 noack_map)
@@ -3972,4 +3989,5 @@ const struct cfg80211_ops mac80211_config_ops = {
.stop_nan = ieee80211_stop_nan,
.add_nan_func = ieee80211_add_nan_func,
.rm_nan_func = ieee80211_rm_nan_func,
+   .nan_change_conf = ieee80211_nan_change_conf,
 };
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index 0d6c622..8d5349c 100644
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -1430,4 +1430,25 @@ static inline void drv_rm_nan_func(struct 
ieee80211_local *local,
local->ops->rm_nan_func(>hw, >vif, instance_id);
trace_drv_return_void(local);
 }
+
+static inline int drv_nan_change_conf(struct ieee80211_local *local,
+  struct ieee80211_sub_if_data *sdata,
+  struct cfg80211_nan_conf *conf,
+  u32 changes)
+{
+   int ret;
+
+   might_sleep();
+   check_sdata_in_driver(sdata);
+
+   if (!local->ops->add_nan_func)
+   return -EOPNOTSUPP;
+
+   trace_drv_nan_change_conf(local, sdata, conf, changes);
+   ret = local->ops->nan_change_conf(>hw, >vif, conf, 
changes);
+   trace_drv_return_int(local, ret);
+
+   return ret;
+}
+
 #endif /* __MAC80211_DRIVER_OPS */
diff --git a/net/mac80211/trace.h b/net/mac80211/trace.h
index ca79e83..7871d99 100644
--- a/net/mac80211/trace.h
+++ b/net/mac80211/trace.h
@@ -1791,6 +1791,38 @@ TRACE_EVENT(drv_rm_nan_func,
)
 );
 
+TRACE_EVENT(drv_nan_change_conf,
+   TP_PROTO(struct ieee80211_local *local,
+struct ieee80211_sub_if_data *sdata,
+struct cfg80211_nan_conf *conf,
+u32 changes),
+
+   TP_ARGS(local, sdata, conf, changes),
+   TP_STRUCT__entry(
+   LOCAL_ENTRY
+   VIF_ENTRY
+   __field(u8, master_pref)
+   __field(u16, cluster_id)
+   __field(u8, dual)
+   __field(u32, changes)
+   ),
+
+   TP_fast_assign(
+   LOCAL_ASSIGN;
+   VIF_ASSIGN;
+   __entry->master_pref = conf->master_pref;
+   __entry->cluster_id = conf->cluster_id;
+   __entry->dual = conf->dual;
+   __entry->changes = changes;
+   ),
+
+   TP_printk(
+   LOCAL_PR_FMT  VIF_PR_FMT
+   ", master preference: %u, cluster_id: %04x, dual: %d, changes: 
0x%x",
+   LOCAL_PR_ARG, VIF_PR_ARG, __entry->master_pref,
+__entry->cluster_id, __entry->dual, __entry->changes
+   )
+);
 
 /*
  * Tracing for API calls that drivers call.
-- 
1.8.3

--
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


[RFC 6/7] mac80211: Implement add_nan_func and rm_nan_func

2015-09-17 Thread andrei . otcheretianski
From: Andrei Otcheretianski 

Add a trivial implementation for  add/rm_nan_func functions.
Currently mac80211 just passes the configuration to the driver.

Signed-off-by: Andrei Otcheretianski 
---
 include/net/mac80211.h| 17 ++-
 net/mac80211/cfg.c| 30 +++
 net/mac80211/driver-ops.h | 31 +++
 net/mac80211/trace.h  | 53 +++
 4 files changed, 130 insertions(+), 1 deletion(-)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index c4d8f4a..ebe0921 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -3250,7 +3250,12 @@ enum ieee80211_reconfig_type {
  *
  * @start_nan: join an existing nan cluster, or create a new one.
  * @stop_nan: leave the nan cluster.
- */
+ * @add_nan_func: Add a nan function. Returns a stricly positive instance id
+ * upon success. The data in cfg80211_nan_func must not be referenced
+ * outside the scope of this call.
+ * @rm_nan_func: Remove a nan function.
+ * @nan_change_conf: changes NAN configuration.
+  */
 struct ieee80211_ops {
void (*tx)(struct ieee80211_hw *hw,
   struct ieee80211_tx_control *control,
@@ -3495,6 +3500,16 @@ struct ieee80211_ops {
 struct cfg80211_nan_conf *conf);
int (*stop_nan)(struct ieee80211_hw *hw,
struct ieee80211_vif *vif);
+   int (*add_nan_func)(struct ieee80211_hw *hw,
+   struct ieee80211_vif *vif,
+   const struct cfg80211_nan_func *nan_func);
+   void(*rm_nan_func)(struct ieee80211_hw *hw,
+  struct ieee80211_vif *vif,
+  u8 instance_id);
+   int (*nan_change_conf)(struct ieee80211_hw *hw,
+  struct ieee80211_vif *vif,
+  struct cfg80211_nan_conf *conf,
+  u32 changes);
 };
 
 /**
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index e36d542..8a504ae 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -163,6 +163,34 @@ static void ieee80211_stop_nan(struct wiphy *wiphy,
ieee80211_sdata_stop(sdata);
 }
 
+static int ieee80211_add_nan_func(struct wiphy *wiphy,
+ struct wireless_dev *wdev,
+ const struct cfg80211_nan_func *nan_func)
+{
+   struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
+
+   if (sdata->vif.type != NL80211_IFTYPE_NAN)
+   return -EOPNOTSUPP;
+
+   if (!ieee80211_sdata_running(sdata))
+   return -ENETDOWN;
+
+   return drv_add_nan_func(sdata->local, sdata, nan_func);
+}
+
+static void ieee80211_rm_nan_func(struct wiphy *wiphy,
+ struct wireless_dev *wdev,
+ u8 instance_id)
+{
+   struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
+
+   if (sdata->vif.type != NL80211_IFTYPE_NAN ||
+   !ieee80211_sdata_running(sdata))
+   return;
+
+   drv_rm_nan_func(sdata->local, sdata, instance_id);
+}
+
 static int ieee80211_set_noack_map(struct wiphy *wiphy,
  struct net_device *dev,
  u16 noack_map)
@@ -3942,4 +3970,6 @@ const struct cfg80211_ops mac80211_config_ops = {
.del_tx_ts = ieee80211_del_tx_ts,
.start_nan = ieee80211_start_nan,
.stop_nan = ieee80211_stop_nan,
+   .add_nan_func = ieee80211_add_nan_func,
+   .rm_nan_func = ieee80211_rm_nan_func,
 };
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index 2ef2997..0d6c622 100644
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -1399,4 +1399,35 @@ static inline void drv_stop_nan(struct ieee80211_local 
*local,
trace_drv_return_void(local);
 }
 
+static inline int drv_add_nan_func(struct ieee80211_local *local,
+  struct ieee80211_sub_if_data *sdata,
+  const struct cfg80211_nan_func *nan_func)
+{
+   int ret;
+
+   might_sleep();
+   check_sdata_in_driver(sdata);
+
+   if (!local->ops->add_nan_func)
+   return -EOPNOTSUPP;
+
+   trace_drv_add_nan_func(local, sdata, nan_func);
+   ret = local->ops->add_nan_func(>hw, >vif, nan_func);
+   trace_drv_return_int(local, ret);
+
+   return ret;
+}
+
+static inline void drv_rm_nan_func(struct ieee80211_local *local,
+  struct ieee80211_sub_if_data *sdata,
+  u8 instance_id)
+{
+   might_sleep();
+   check_sdata_in_driver(sdata);
+
+   trace_drv_rm_nan_func(local, sdata, instance_id);
+   if (local->ops->rm_nan_func)
+   

[RFC 1/7] cfg80211: add start / stop NAN commands

2015-09-17 Thread andrei . otcheretianski
From: Emmanuel Grumbach 

This allows user space to start/stop NAN interface.
A NAN interface is like P2P device in a few aspects: it
doesn't have a netdev associated to it.
Add the new interface type and prevent operations that
can't be executed on NAN interface like scan.
Define several attributes that may be configured by user space
when starting NAN functionality (master preference, cluster id
and dual band operation)

Signed-off-by: Emmanuel Grumbach 
Signed-off-by: Andrei Otcheretianski 
---
 include/net/cfg80211.h   | 31 +-
 include/uapi/linux/nl80211.h | 28 +
 net/mac80211/cfg.c   |  3 ++
 net/mac80211/chan.c  |  3 ++
 net/mac80211/iface.c |  4 ++
 net/mac80211/rx.c|  3 ++
 net/mac80211/util.c  |  1 +
 net/wireless/chan.c  |  2 +
 net/wireless/core.c  | 35 
 net/wireless/core.h  |  3 ++
 net/wireless/mlme.c  |  1 +
 net/wireless/nl80211.c   | 97 ++--
 net/wireless/rdev-ops.h  | 20 +
 net/wireless/trace.h | 29 +
 net/wireless/util.c  |  9 +++-
 15 files changed, 262 insertions(+), 7 deletions(-)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 0f54c9e..dcf8a74 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -5,6 +5,7 @@
  *
  * Copyright 2006-2010 Johannes Berg 
  * Copyright 2013-2014 Intel Mobile Communications GmbH
+ * Copyright(c) 2015 Intel Deutschland GmbH
  *
  * 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
@@ -2181,6 +2182,24 @@ struct cfg80211_qos_map {
 };
 
 /**
+ * struct cfg80211_nan_conf - nan configuration
+ *
+ * This struct defines nan configuration parameters
+ *
+ * @master_pref: master preference (2 -254)
+ * @cluster_id: optional cluster id, or 0 to let the device to generate.
+ * @dual: 0-default, 1 - 2.4Ghz Only, 2 - dual band operation.
+ *
+ * TODO: Add more parameters
+ */
+struct cfg80211_nan_conf {
+   u8 master_pref;
+   u16 cluster_id;
+   u8 dual;
+};
+
+
+/**
  * struct cfg80211_ops - backend description for wireless configuration
  *
  * This struct is registered by fullmac card drivers and/or wireless stacks
@@ -2447,7 +2466,11 @@ struct cfg80211_qos_map {
  * and returning to the base channel for communication with the AP.
  * @tdls_cancel_channel_switch: Stop channel-switching with a TDLS peer. Both
  * peers must be on the base channel when the call completes.
- */
+ *
+ * @start_nan: Start the NAN interface.
+ * @stop_nan: Stop the NAN interface.
+ *
+  */
 struct cfg80211_ops {
int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow);
int (*resume)(struct wiphy *wiphy);
@@ -2711,6 +2734,9 @@ struct cfg80211_ops {
void(*tdls_cancel_channel_switch)(struct wiphy *wiphy,
  struct net_device *dev,
  const u8 *addr);
+   int (*start_nan)(struct wiphy *wiphy, struct wireless_dev *wdev,
+struct cfg80211_nan_conf *conf);
+   void(*stop_nan)(struct wiphy *wiphy, struct wireless_dev *wdev);
 };
 
 /*
@@ -3423,6 +3449,7 @@ struct cfg80211_cached_keys;
  * beacons, 0 when not valid
  * @address: The address for this device, valid only if @netdev is %NULL
  * @p2p_started: true if this is a P2P Device that has been started
+ * @nan_started: true if this is a NAN interface that has been started
  * @cac_started: true if DFS channel availability check has been started
  * @cac_start_time: timestamp (jiffies) when the dfs state was entered.
  * @cac_time_ms: CAC time in ms
@@ -3453,7 +3480,7 @@ struct wireless_dev {
 
struct mutex mtx;
 
-   bool use_4addr, p2p_started;
+   bool use_4addr, p2p_started, nan_started;
 
u8 address[ETH_ALEN] __aligned(sizeof(u16));
 
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index c0ab6b0..16d9553 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -811,6 +811,16 @@
  * as an event to indicate changes for devices with wiphy-specific regdom
  * management.
  *
+ * @NL80211_CMD_START_NAN: Start NAN operation, identified by its
+ * %NL80211_ATTR_WDEV identifier. It must have been created with
+ * %NL80211_CMD_NEW_INTERFACE previously. After it has been started, the
+ * NAN interface will create or join a cluster. This command must have a
+ * valid %NL80211_ATTR_NAN_MASTER_PREF attribute and optional
+ * %NL80211_ATTR_NAN_CLUSTER_ID and %NL80211_ATTR_NAN_DUAL attributes.
+ * After this command NAN functions can be added.
+ * @NL80211_CMD_STOP_NAN: Stop the NAN operation, identified by
+ * its 

[RFC 2/7] mac80211: add boilerplate code for start / stop NAN

2015-09-17 Thread andrei . otcheretianski
From: Emmanuel Grumbach 

This codes doens't do much besides allowing to start and
stop the vif.

Signed-off-by: Emmanuel Grumbach 
Signed-off-by: Andrei Otcheretianski 
---
 include/net/mac80211.h|  9 
 net/mac80211/cfg.c| 35 +++
 net/mac80211/chan.c   |  3 +++
 net/mac80211/driver-ops.h | 29 +-
 net/mac80211/iface.c  |  8 ++--
 net/mac80211/main.c   |  4 
 net/mac80211/offchannel.c |  3 ++-
 net/mac80211/trace.h  | 52 +++
 net/mac80211/util.c   |  3 ++-
 9 files changed, 141 insertions(+), 5 deletions(-)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 3424ac6..c4d8f4a 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -3247,6 +3247,9 @@ enum ieee80211_reconfig_type {
  * the function call.
  *
  * @wake_tx_queue: Called when new packets have been added to the queue.
+ *
+ * @start_nan: join an existing nan cluster, or create a new one.
+ * @stop_nan: leave the nan cluster.
  */
 struct ieee80211_ops {
void (*tx)(struct ieee80211_hw *hw,
@@ -3486,6 +3489,12 @@ struct ieee80211_ops {
 
void (*wake_tx_queue)(struct ieee80211_hw *hw,
  struct ieee80211_txq *txq);
+
+   int (*start_nan)(struct ieee80211_hw *hw,
+struct ieee80211_vif *vif,
+struct cfg80211_nan_conf *conf);
+   int (*stop_nan)(struct ieee80211_hw *hw,
+   struct ieee80211_vif *vif);
 };
 
 /**
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 326fe0e..e36d542 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -130,6 +130,39 @@ static void ieee80211_stop_p2p_device(struct wiphy *wiphy,
ieee80211_sdata_stop(IEEE80211_WDEV_TO_SUB_IF(wdev));
 }
 
+static int ieee80211_start_nan(struct wiphy *wiphy,
+  struct wireless_dev *wdev,
+  struct cfg80211_nan_conf *conf)
+{
+   struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
+   int ret;
+
+   mutex_lock(>local->chanctx_mtx);
+   ret = ieee80211_check_combinations(sdata, NULL, 0, 0);
+   mutex_unlock(>local->chanctx_mtx);
+   if (ret < 0)
+   return ret;
+
+   ret = ieee80211_do_open(wdev, true);
+   if (ret)
+   return ret;
+
+   ret = drv_start_nan(sdata->local, sdata, conf);
+   if (ret)
+   ieee80211_sdata_stop(sdata);
+
+   return ret;
+}
+
+static void ieee80211_stop_nan(struct wiphy *wiphy,
+  struct wireless_dev *wdev)
+{
+   struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
+
+   drv_stop_nan(sdata->local, sdata);
+   ieee80211_sdata_stop(sdata);
+}
+
 static int ieee80211_set_noack_map(struct wiphy *wiphy,
  struct net_device *dev,
  u16 noack_map)
@@ -3907,4 +3940,6 @@ const struct cfg80211_ops mac80211_config_ops = {
.set_ap_chanwidth = ieee80211_set_ap_chanwidth,
.add_tx_ts = ieee80211_add_tx_ts,
.del_tx_ts = ieee80211_del_tx_ts,
+   .start_nan = ieee80211_start_nan,
+   .stop_nan = ieee80211_stop_nan,
 };
diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c
index 7fdc118..b33a749 100644
--- a/net/mac80211/chan.c
+++ b/net/mac80211/chan.c
@@ -645,6 +645,9 @@ static int ieee80211_assign_vif_chanctx(struct 
ieee80211_sub_if_data *sdata,
struct ieee80211_chanctx *curr_ctx = NULL;
int ret = 0;
 
+   if (WARN_ON(sdata->vif.type == NL80211_IFTYPE_NAN))
+   return 0;
+
conf = rcu_dereference_protected(sdata->vif.chanctx_conf,
 lockdep_is_held(>chanctx_mtx));
 
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index 31482e2..2ef2997 100644
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -219,7 +219,8 @@ static inline void drv_bss_info_changed(struct 
ieee80211_local *local,
return;
 
if (WARN_ON_ONCE(sdata->vif.type == NL80211_IFTYPE_P2P_DEVICE ||
-sdata->vif.type == NL80211_IFTYPE_MONITOR))
+sdata->vif.type == NL80211_IFTYPE_MONITOR ||
+sdata->vif.type == NL80211_IFTYPE_NAN))
return;
 
if (!check_sdata_in_driver(sdata))
@@ -1372,4 +1373,30 @@ static inline void drv_wake_tx_queue(struct 
ieee80211_local *local,
local->ops->wake_tx_queue(>hw, >txq);
 }
 
+static inline int drv_start_nan(struct ieee80211_local *local,
+   struct ieee80211_sub_if_data *sdata,
+   struct cfg80211_nan_conf *conf)
+{
+   int ret;
+
+   might_sleep();
+   check_sdata_in_driver(sdata);
+
+   

[RFC 3/7] cfg80211: add add_nan_func / rm_nan_func

2015-09-17 Thread andrei . otcheretianski
From: Emmanuel Grumbach 

A NAN function can be either publish, subscribe or follow
up. Make all the necessary verifications and just pass the
request to the driver.

Signed-off-by: Emmanuel Grumbach 
Signed-off-by: Andrei Otcheretianski 
---
 include/net/cfg80211.h   |  73 ++-
 include/uapi/linux/nl80211.h | 138 +++
 net/wireless/core.c  |   3 +-
 net/wireless/nl80211.c   | 306 +++
 net/wireless/rdev-ops.h  |  22 
 net/wireless/trace.h |  36 +
 6 files changed, 575 insertions(+), 3 deletions(-)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index dcf8a74..12203db 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -2198,6 +2198,68 @@ struct cfg80211_nan_conf {
u8 dual;
 };
 
+/**
+ * struct cfg80211_nan_func_filter - a NAN function Rx / Tx filter
+ *
+ * @filter: the content of the filter
+ * @len: the length of the filter
+ */
+struct cfg80211_nan_func_filter {
+   const u8 *filter;
+   u8 len;
+};
+
+/**
+ * struct cfg80211_nan_func - a NAN function
+ *
+ * @type:  nl80211_nan_function_type
+ * @service_id: the service ID of the function
+ * @publish_type: _nan_publish_type
+ * @discovery_range: if true, the range should be limited. Threshold is
+ * implementation specific.
+ * @publish_bcast: if true, the solicited publish should transmit BCAST
+ * @subscribe_active: if true, the subscribe is active
+ * @followup_id: the instance ID for follow up
+ * @followup_reqid: the requestor instance ID for follow up
+ * @followup_dest: MAC address of the recipient of the follow up
+ * @ttl: time to live
+ * @serv_spec_info: Service Specific Info
+ * @serv_spec_info_len: Service Specific Info length
+ * @srf_include: if true, SRF is inclusive
+ * @srf_bf: Bloom Filter
+ * @srf_bf_len: Bloom Filter length
+ * @srf_bf_idx: Blook Filter index
+ * @srf_macs: SRF MAC addresses
+ * @srf_num_macs: number of MAC addresses in SRF
+ * @rx_filters: points to an array of  cfg80211_nan_func_filter
+ * @tx_filters: points to an array of  cfg80211_nan_func_filter
+ * @num_rx_filters: size of _filters.
+ * @num_tx_filters: size of _filters.
+ */
+struct cfg80211_nan_func {
+   enum nl80211_nan_function_type type;
+   u8 service_id[NL80211_NAN_FUNC_SERVICE_ID_LEN];
+   u8 publish_type;
+   bool discovery_range;
+   bool publish_bcast;
+   bool subscribe_active;
+   u8 followup_id;
+   u8 followup_reqid;
+   struct mac_address followup_dest;
+   u32 ttl;
+   const u8 *serv_spec_info;
+   u8 serv_spec_info_len;
+   bool srf_include;
+   const u8 *srf_bf;
+   u8 srf_bf_len;
+   u8 srf_bf_idx;
+   struct mac_address *srf_macs;
+   int srf_num_macs;
+   struct cfg80211_nan_func_filter *rx_filters;
+   struct cfg80211_nan_func_filter *tx_filters;
+   unsigned int num_tx_filters;
+   unsigned int num_rx_filters;
+};
 
 /**
  * struct cfg80211_ops - backend description for wireless configuration
@@ -2469,8 +2531,11 @@ struct cfg80211_nan_conf {
  *
  * @start_nan: Start the NAN interface.
  * @stop_nan: Stop the NAN interface.
- *
-  */
+ * @add_nan_func: Add a nan function. Returns a stricly positive instance id
+ * upon success. The data in cfg80211_nan_func must not be referenced
+ * outside the scope of this call.
+ * @rm_nan_func: Remove a nan function.
+ */
 struct cfg80211_ops {
int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow);
int (*resume)(struct wiphy *wiphy);
@@ -2737,6 +2802,10 @@ struct cfg80211_ops {
int (*start_nan)(struct wiphy *wiphy, struct wireless_dev *wdev,
 struct cfg80211_nan_conf *conf);
void(*stop_nan)(struct wiphy *wiphy, struct wireless_dev *wdev);
+   int (*add_nan_func)(struct wiphy *wiphy, struct wireless_dev *wdev,
+   const struct cfg80211_nan_func *nan_func);
+   void(*rm_nan_func)(struct wiphy *wiphy, struct wireless_dev *wdev,
+  u8 instance_id);
 };
 
 /*
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 16d9553..699aa89 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -820,6 +820,12 @@
  * After this command NAN functions can be added.
  * @NL80211_CMD_STOP_NAN: Stop the NAN operation, identified by
  * its %NL80211_ATTR_WDEV identifier.
+ * @NL80211_CMD_ADD_NAN_FUNCTION: add a NAN function. The function a
+ * %NL80211_ATTR_NAN_FUNC attribute. When called, this operation returns
+ * the strictly positive instance id (%NL80211_ATTR_NAN_FUNC_INST_ID) of
+ * the function upon success.
+ * @NL80211_CMD_RM_NAN_FUNCTION: remove a NAN function based on its instance
+ * id.
  *
  * @NL80211_CMD_MAX: highest used command number
  

[RFC 5/7] cfg80211: provide a function to report a match for NAN

2015-09-17 Thread andrei . otcheretianski
From: Emmanuel Grumbach 

Provide a function the driver can call to report a match.
This will send the event to the user space.

Signed-off-by: Emmanuel Grumbach 
Signed-off-by: Andrei Otcheretianski 
---
 include/net/cfg80211.h   | 24 +
 include/uapi/linux/nl80211.h | 37 
 net/wireless/nl80211.c   | 82 
 3 files changed, 143 insertions(+)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 65970e3..34f6135 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -5347,6 +5347,30 @@ wiphy_ext_feature_isset(struct wiphy *wiphy,
return (ft_byte & BIT(ftidx % 8)) != 0;
 }
 
+/**
+ * cfg80211_nan_match - report a match for a NAN function.
+ * @wdev: the wireless device reporting the match
+ * @type: the type of the function that had a match. If it is
+ * %NL80211_NAN_FUNC_SUBSCRIBE it means that we heard a publisher.
+ * If it is %NL80211_NAN_FUNC_PUBLISH, it means that we replied to
+ * an active subscriber with a solicited publish.
+ * If it is %NL80211_NAN_FUNC_FOLLOW_UP, we received a follow up.
+ * @inst_id: the local instance id
+ * @peer_inst_id: the instance id of the peer's function
+ * @addr: the MAC address of the peer
+ * @info: the Service Specific Info from the peer (if any)
+ * @info_len: the length of the 
+ * @gfp: allocation flags
+ *
+ * This function reports that the a NAN function had a match. This
+ * can be a subscribe that had a match or a solicited publish that
+ * was sent. It can also be a follow up that was received.
+ */
+void cfg80211_nan_match(struct wireless_dev *wdev,
+   enum nl80211_nan_function_type type,
+   u8 inst_id, u8 peer_inst_id, const u8 *addr,
+   const u8 *info, u8 info_len, gfp_t gfp);
+
 /* ethtool helper */
 void cfg80211_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo 
*info);
 
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index dbc5631..bac369e 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -830,6 +830,8 @@
  * should be opeartional (%NL80211_CMD_START_NAN was executed).
  * It must contain at least one of the following attributes:
  * %NL80211_ATTR_NAN_MASTER_PREF, %NL80211_ATTR_NAN_DUAL.
+ * @NL80211_CMD_NAN_FUNC_MATCH: Notification sent when a match is reported.
+ * This will contain a %NL80211_ATTR_NAN_MATCH nested attribute.
  *
  * @NL80211_CMD_MAX: highest used command number
  * @__NL80211_CMD_AFTER_LAST: internal use
@@ -1022,6 +1024,7 @@ enum nl80211_commands {
NL80211_CMD_ADD_NAN_FUNCTION,
NL80211_CMD_RM_NAN_FUNCTION,
NL80211_CMD_CHANGE_NAN_CONFIG,
+   NL80211_CMD_NAN_MATCH,
 
/* add new commands above here */
 
@@ -1800,6 +1803,8 @@ enum nl80211_commands {
  * attribute.
  * @NL80211_ATTR_NAN_FUNC_INST_ID: the instance id of a %NL80211_ATTR_NAN_FUNC.
  * Its type is u8 and it cannot be 0.
+ * @NL80211_ATTR_NAN_MATCH: used to report a match. This is a nested attribute.
+ * See  nl80211_nan_match_attributes.
  *
  * @NUM_NL80211_ATTR: total number of nl80211_attrs available
  * @NL80211_ATTR_MAX: highest attribute number currently defined
@@ -2175,6 +2180,7 @@ enum nl80211_attrs {
NL80211_ATTR_NAN_DUAL,
NL80211_ATTR_NAN_FUNC,
NL80211_ATTR_NAN_FUNC_INST_ID,
+   NL80211_ATTR_NAN_MATCH,
 
/* add attributes here, update the policy in nl80211.c */
 
@@ -4760,4 +4766,35 @@ enum nl80211_nan_srf_attributes {
NL80211_NAN_SRF_ATTR_MAX = NUM_NL80211_NAN_SRF_ATTR - 1,
 };
 
+/**
+ * enum nl80211_nan_match_attributes - NAN match attributes
+ * @__NL80211_NAN_MATCH_INVALID: invalid
+ * @NL80211_NAN_MATCH_FUNC_TYPE:  nl80211_nan_function_type (u8). This is
+ * the type of the function which had a match.
+ * @NL80211_NAN_MATCH_INSTANCE_ID: The instance ID of the local function that
+ * had a match. This is a u8.
+ * @NL80211_NAN_MATCH_PEER_INSTANCE_ID: The instance ID of the peer's function
+ * that caused the match. This is a u8.
+ * specified in NAN spec. This is a binary attribute.
+ * @NL80211_NAN_MATCH_MAC: The MAC address of the peer. This attribute is
+ * binary.
+ * @NL80211_NAN_MATCH_SERVICE_INFO: array of bytes describing the peer's
+ * service specific info. This is a binary attribute.
+ *
+ * @NUM_NL80211_NAN_MATCH_ATTR: internal
+ * @NL80211_NAN_MATCH_ATTR_MAX: highest NAN match attribute
+ */
+enum nl80211_nan_match_attributes {
+   __NL80211_NAN_MATCH_INVALID,
+   NL80211_NAN_MATCH_FUNC_TYPE,
+   NL80211_NAN_MATCH_INSTANCE_ID,
+   NL80211_NAN_MATCH_PEER_INSTANCE_ID,
+   NL80211_NAN_MATCH_MAC,
+   NL80211_NAN_MATCH_SERVICE_INFO,
+
+   /* keep last */
+   NUM_NL80211_NAN_MATCH_ATTR,
+   NL80211_NAN_MATCH_ATTR_MAX = 

Re: [PATCH 1/1] New driver: rtl8xxxu (mac80211)

2015-09-17 Thread Johannes Berg
On Sat, 2015-09-05 at 09:32 +0530, Sujith Manoharan wrote:
> Jes Sorensen wrote:
> > > Ah, this makes sense. There's an rc_update call or something like 
> > > that,
> > > that might have the requisite information. Not really sure off 
> > > the top
> > > of my head.
> 
> ieee80211_sta doesn't contain the preamble information, though ?
> 
> The bss information holds the short preamble information, so that can
> probably be used - using BSS_CHANGED_ERP_PREAMBLE.

Yes, this is a good point, and the preamble can't really be different
for different stations since all the stations in the BSS (and even
outside it on the same channel) must be able to decode it.

So yeah - Jes, you can remove that and use the
BSS_CHANGED_ERP_PREAMBLE.


johannes
--
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 3/3] ath10k: implement mesh support

2015-09-17 Thread Yeoh Chun-Yeow
Hi, Bob

I have also tested with nwifi mode for non-secured mesh. It seems to
be worked for me with the following two test scenarios:

Node 1 [ath10k] <---> Node 2 [ath10k] <---> Node 3 [ath10k]
Node 1 [ath10k] <---> Node 2 [ath9k]

I am using the following:
compat-wireless-2015-07-21 from OpenWRT
firmware-5.bin_10.2.4.70.6-2

I just wondering whether using raw wifi is better for encrypted mesh later?


Chun-Yeow

On Wed, Sep 16, 2015 at 8:39 PM, Bob Copeland  wrote:
> On Mon, Aug 31, 2015 at 01:43:28AM +0800, Chun-Yeow Yeoh wrote:
>> Hi, Bob
>>
>> > Yes: you don't want to enable raw mode TX / RX decap in the normal
>> > case because it's fairly inefficient compared to "native" wifi mode,
>> > according to my understanding.  The latter doesn't support mesh framing
>> > however.
>> >
>>
>> The native WiFi mode doesn't support mesh framing. Can you elaborate
>> more on this?
>
> Sorry, missed this before -- the 'nwifi' mode which is the normal
> datapath for ath10k discards the QoS header and following mesh header
> when transmitting, if I recall correctly.  I also had some issues with the
> received frames when using nwifi RX decap with raw mode TX, but I don't
> recall exactly the problem.  I can retest with these modes if you really
> want the details.
>
> --
> Bob Copeland %% http://bobcopeland.com/
--
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


Use iw to disable all rates for a particular rateset?

2015-09-17 Thread Ben Greear

Is there any way to have iw configure to use *just* legacy
rates, for instance:

iw dev wlan0 bitrates legacy-2.4 1 2 5.5 11 [and disable all others, including 
HT and VHT] ?

From what I can tell, there is not.

I need a way to disable HT and VHT rates before a peer exists so that I can 
cause
probe requests to go out without any HT/VHT info in them, for instance.

Thanks,
Ben

--
Ben Greear 
Candela Technologies Inc  http://www.candelatech.com

--
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: Use iw to disable all rates for a particular rateset?

2015-09-17 Thread Ben Greear

On 09/17/2015 02:37 PM, Ben Greear wrote:

Is there any way to have iw configure to use *just* legacy
rates, for instance:

iw dev wlan0 bitrates legacy-2.4 1 2 5.5 11 [and disable all others, including 
HT and VHT] ?


Err, nevermind..I think this is the second time I thought this was broken,
but I just was not using things properly.

Thanks,
Ben



 From what I can tell, there is not.

I need a way to disable HT and VHT rates before a peer exists so that I can 
cause
probe requests to go out without any HT/VHT info in them, for instance.

Thanks,
Ben




--
Ben Greear 
Candela Technologies Inc  http://www.candelatech.com

--
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 3/3] ath10k: implement mesh support

2015-09-17 Thread Peter Oh


On 09/17/2015 10:48 AM, Yeoh Chun-Yeow wrote:

Hi, Bob

I have also tested with nwifi mode for non-secured mesh. It seems to
be worked for me with the following two test scenarios:

Node 1 [ath10k] <---> Node 2 [ath10k] <---> Node 3 [ath10k]
Node 1 [ath10k] <---> Node 2 [ath9k]

I am using the following:
compat-wireless-2015-07-21 from OpenWRT
firmware-5.bin_10.2.4.70.6-2

I just wondering whether using raw wifi is better for encrypted mesh
later?
nwifi mode will be in trouble when SNAP/LLC encapsulation used since 
firmware and hardware have no way to distinguish if it's SNAP header or 
Mesh Control field.


--
Peter



Chun-Yeow

On Wed, Sep 16, 2015 at 8:39 PM, Bob Copeland  wrote:

On Mon, Aug 31, 2015 at 01:43:28AM +0800, Chun-Yeow Yeoh wrote:

Hi, Bob


Yes: you don't want to enable raw mode TX / RX decap in the normal
case because it's fairly inefficient compared to "native" wifi mode,
according to my understanding.  The latter doesn't support mesh

framing

however.


The native WiFi mode doesn't support mesh framing. Can you elaborate
more on this?

Sorry, missed this before -- the 'nwifi' mode which is the normal
datapath for ath10k discards the QoS header and following mesh header
when transmitting, if I recall correctly.  I also had some issues with

the

received frames when using nwifi RX decap with raw mode TX, but I don't
recall exactly the problem.  I can retest with these modes if you really
want the details.

--
Bob Copeland %% http://bobcopeland.com/

___
ath10k mailing list
ath...@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k


--
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