Re: ATH10 firmware question

2015-11-24 Thread Ben Greear



On 11/24/2015 08:19 PM, Michal Kazior wrote:

On 24 November 2015 at 22:29, Ben Greear  wrote:

On 11/24/2015 10:07 AM, Cedric VONCKEN wrote:


 Hi,

 I have a simple test platform.
 One PC connected to an equipment. This equipment is set in AP
mode.
 Another PC connected to another equipment. This equipment is set
in STA + WDS mode.

 Both equipment use the same openwrt Firmware (compat
2015-07-21), I only changed the ath10k firmware (in
/lib/firmware/ath10k/...).
 Both equipment has the same hardware.
 I used a clear channel, and VHT80.
 The radio was connected with a coaxial cable and I placed 40 dBm
attenuation per Rf chain.
 I used the WLN350NX radio card from compex.

 First test : ATH10K firmware 10.2.4.70-2 on both equipment
 An iperf from PC connected to the AP to the PC connected
to the STA give 919 Mbps.
 An iperf from PC connected to the STA to the PC
connected to the AP give 500 Mbps.

 Second test : ATHK firmware 10.2.4.70.10-2 on both equipment
 An iperf from PC connected to the AP to the PC connected
to the STA give 921 Mbps.
 An iperf from PC connected to the STA to the PC
connected to the AP give 441 Mbps.

 If I cross the computer I have the same result. I did several
time these test and I always have the same result.



We see similar.  One thing we notice is that if you actually try to send
less
throughput, then you get better overall throughput.

In other words, trying to send 1Gbps UDP frames will give you more poor
throughput than trying to send 650Mbps (in the upload direction).

I thought it might be a poor interaction regarding backoff in the
ath10k driver/firmware (see the congestion bins in firmware for why
this is the case), but even fixing that in firmware didn't improve
the situation in my testing.


If CPU is the bottleneck on DUT than overcommiting the UDP traffic at
the source may lead the ethernet driver to waste CPU cycles on the
DUT.


You are correct about the overcommit in general, but our systems are quite
overpowered.

We are testing with 3.5Ghz E5 quad-core systems...it is not just a CPU usage
issue.  And, exact same hardware runs great (close to 900Mbps) in AP download 
mode.

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: ATH10 firmware question

2015-11-24 Thread Michal Kazior
On 24 November 2015 at 22:29, Ben Greear  wrote:
> On 11/24/2015 10:07 AM, Cedric VONCKEN wrote:
>>
>> Hi,
>>
>> I have a simple test platform.
>> One PC connected to an equipment. This equipment is set in AP
>> mode.
>> Another PC connected to another equipment. This equipment is set
>> in STA + WDS mode.
>>
>> Both equipment use the same openwrt Firmware (compat
>> 2015-07-21), I only changed the ath10k firmware (in
>> /lib/firmware/ath10k/...).
>> Both equipment has the same hardware.
>> I used a clear channel, and VHT80.
>> The radio was connected with a coaxial cable and I placed 40 dBm
>> attenuation per Rf chain.
>> I used the WLN350NX radio card from compex.
>>
>> First test : ATH10K firmware 10.2.4.70-2 on both equipment
>> An iperf from PC connected to the AP to the PC connected
>> to the STA give 919 Mbps.
>> An iperf from PC connected to the STA to the PC
>> connected to the AP give 500 Mbps.
>>
>> Second test : ATHK firmware 10.2.4.70.10-2 on both equipment
>> An iperf from PC connected to the AP to the PC connected
>> to the STA give 921 Mbps.
>> An iperf from PC connected to the STA to the PC
>> connected to the AP give 441 Mbps.
>>
>> If I cross the computer I have the same result. I did several
>> time these test and I always have the same result.
>
>
> We see similar.  One thing we notice is that if you actually try to send
> less
> throughput, then you get better overall throughput.
>
> In other words, trying to send 1Gbps UDP frames will give you more poor
> throughput than trying to send 650Mbps (in the upload direction).
>
> I thought it might be a poor interaction regarding backoff in the
> ath10k driver/firmware (see the congestion bins in firmware for why
> this is the case), but even fixing that in firmware didn't improve
> the situation in my testing.

If CPU is the bottleneck on DUT than overcommiting the UDP traffic at
the source may lead the ethernet driver to waste CPU cycles on the
DUT.


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


[PATCH 08/10] staging: wilc1000: Handle_AddBASession: remove unused function

2015-11-24 Thread Glen Lee
From: Leo Kim 

This patch removes unused a function Handle_AddBASession.
And, removes the relation define.

Signed-off-by: Leo Kim 
Signed-off-by: Glen Lee 
---
 drivers/staging/wilc1000/host_interface.c | 69 ---
 1 file changed, 69 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 8f27227..0b85640 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -43,7 +43,6 @@
 #define HOST_IF_MSG_FLUSH_CONNECT   30
 #define HOST_IF_MSG_GET_STATISTICS  31
 #define HOST_IF_MSG_SET_MULTICAST_FILTER32
-#define HOST_IF_MSG_ADD_BA_SESSION  33
 #define HOST_IF_MSG_DEL_BA_SESSION  34
 #define HOST_IF_MSG_Q_IDLE  35
 #define HOST_IF_MSG_DEL_ALL_STA 36
@@ -2741,70 +2740,6 @@ ERRORHANDLER:
kfree(wid.val);
 }
 
-static s32 Handle_AddBASession(struct host_if_drv *hif_drv,
-  struct ba_session_info *strHostIfBASessionInfo)
-{
-   s32 result = 0;
-   struct wid wid;
-   int AddbaTimeout = 100;
-   char *ptr = NULL;
-
-   PRINT_D(HOSTINF_DBG, "Opening Block Ack session with\nBSSID = 
%.2x:%.2x:%.2x\nTID=%d\nBufferSize == %d\nSessionTimeOut = %d\n",
-   strHostIfBASessionInfo->bssid[0],
-   strHostIfBASessionInfo->bssid[1],
-   strHostIfBASessionInfo->bssid[2],
-   strHostIfBASessionInfo->buf_size,
-   strHostIfBASessionInfo->time_out,
-   strHostIfBASessionInfo->tid);
-
-   wid.id = (u16)WID_11E_P_ACTION_REQ;
-   wid.type = WID_STR;
-   wid.val = kmalloc(BLOCK_ACK_REQ_SIZE, GFP_KERNEL);
-   wid.size = BLOCK_ACK_REQ_SIZE;
-   ptr = wid.val;
-   *ptr++ = 0x14;
-   *ptr++ = 0x3;
-   *ptr++ = 0x0;
-   memcpy(ptr, strHostIfBASessionInfo->bssid, ETH_ALEN);
-   ptr += ETH_ALEN;
-   *ptr++ = strHostIfBASessionInfo->tid;
-   *ptr++ = 1;
-   *ptr++ = (strHostIfBASessionInfo->buf_size & 0xFF);
-   *ptr++ = ((strHostIfBASessionInfo->buf_size >> 16) & 0xFF);
-   *ptr++ = (strHostIfBASessionInfo->time_out & 0xFF);
-   *ptr++ = ((strHostIfBASessionInfo->time_out >> 16) & 0xFF);
-   *ptr++ = (AddbaTimeout & 0xFF);
-   *ptr++ = ((AddbaTimeout >> 16) & 0xFF);
-   *ptr++ = 8;
-   *ptr++ = 0;
-
-   result = wilc_send_config_pkt(hif_drv->wilc, SET_CFG, &wid, 1,
-get_id_from_handler(hif_drv));
-   if (result)
-   PRINT_D(HOSTINF_DBG, "Couldn't open BA Session\n");
-
-   wid.id = (u16)WID_11E_P_ACTION_REQ;
-   wid.type = WID_STR;
-   wid.size = 15;
-   ptr = wid.val;
-   *ptr++ = 15;
-   *ptr++ = 7;
-   *ptr++ = 0x2;
-   memcpy(ptr, strHostIfBASessionInfo->bssid, ETH_ALEN);
-   ptr += ETH_ALEN;
-   *ptr++ = strHostIfBASessionInfo->tid;
-   *ptr++ = 8;
-   *ptr++ = (strHostIfBASessionInfo->buf_size & 0xFF);
-   *ptr++ = ((strHostIfBASessionInfo->time_out >> 16) & 0xFF);
-   *ptr++ = 3;
-   result = wilc_send_config_pkt(hif_drv->wilc, SET_CFG, &wid, 1,
-get_id_from_handler(hif_drv));
-
-   kfree(wid.val);
-
-   return result;
-}
-
 static s32 Handle_DelAllRxBASessions(struct host_if_drv *hif_drv,
 struct ba_session_info 
*strHostIfBASessionInfo)
 {
@@ -3035,10 +2970,6 @@ static int hostIFthread(void *pvArg)
Handle_SetMulticastFilter(msg.drv, 
&msg.body.multicast_info);
break;
 
-   case HOST_IF_MSG_ADD_BA_SESSION:
-   Handle_AddBASession(msg.drv, &msg.body.session_info);
-   break;
-
case HOST_IF_MSG_DEL_ALL_RX_BA_SESSIONS:
Handle_DelAllRxBASessions(msg.drv, 
&msg.body.session_info);
break;
-- 
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 10/10] staging: wilc1000: Handle_SetMulticastFilter(): fixes right shifting more than type allows

2015-11-24 Thread Glen Lee
From: Leo Kim 

This patch fixes the warning reported by smatch.
 - Handle_SetMulticastFilter() warn: right shifting more than type allows

That is unnecessary action of boolean type. just assign 0.

Signed-off-by: Leo Kim 
Signed-off-by: Glen Lee 
---
 drivers/staging/wilc1000/host_interface.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index c309deb..3b986cb 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -2713,9 +2713,9 @@ static void Handle_SetMulticastFilter(struct host_if_drv 
*hif_drv,
 
pu8CurrByte = wid.val;
*pu8CurrByte++ = (strHostIfSetMulti->enabled & 0xFF);
-   *pu8CurrByte++ = ((strHostIfSetMulti->enabled >> 8) & 0xFF);
-   *pu8CurrByte++ = ((strHostIfSetMulti->enabled >> 16) & 0xFF);
-   *pu8CurrByte++ = ((strHostIfSetMulti->enabled >> 24) & 0xFF);
+   *pu8CurrByte++ = 0;
+   *pu8CurrByte++ = 0;
+   *pu8CurrByte++ = 0;
 
*pu8CurrByte++ = (strHostIfSetMulti->cnt & 0xFF);
*pu8CurrByte++ = ((strHostIfSetMulti->cnt >> 8) & 0xFF);
-- 
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 09/10] staging: wilc1000: change if with else if

2015-11-24 Thread Glen Lee
From: Leo Kim 

The if statement should be else if since it is part of whole if condition.

Signed-off-by: Leo Kim 
Signed-off-by: Glen Lee 
---
 drivers/staging/wilc1000/host_interface.c | 11 +++
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 0b85640..c309deb 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1764,9 +1764,7 @@ static int Handle_Key(struct host_if_drv *hif_drv,
strWIDList, 4,
get_id_from_handler(hif_drv));
kfree(pu8keybuf);
-   }
-
-   if (pstrHostIFkeyAttr->action & ADDKEY) {
+   } else if (pstrHostIFkeyAttr->action & ADDKEY) {
PRINT_D(HOSTINF_DBG, "Handling WEP key\n");
pu8keybuf = kmalloc(pstrHostIFkeyAttr->attr.wep.key_len 
+ 2, GFP_KERNEL);
if (!pu8keybuf) {
@@ -1848,9 +1846,7 @@ static int Handle_Key(struct host_if_drv *hif_drv,
 
kfree(pu8keybuf);
up(&hif_drv->sem_test_key_block);
-   }
-
-   if (pstrHostIFkeyAttr->action & ADDKEY) {
+   } else if (pstrHostIFkeyAttr->action & ADDKEY) {
PRINT_D(HOSTINF_DBG, "Handling group key(Rx) 
function\n");
 
pu8keybuf = kzalloc(RX_MIC_KEY_MSG_LEN, GFP_KERNEL);
@@ -1921,8 +1917,7 @@ _WPARxGtk_end_case_:
get_id_from_handler(hif_drv));
kfree(pu8keybuf);
up(&hif_drv->sem_test_key_block);
-   }
-   if (pstrHostIFkeyAttr->action & ADDKEY) {
+   } else if (pstrHostIFkeyAttr->action & ADDKEY) {
pu8keybuf = kmalloc(PTK_KEY_MSG_LEN, GFP_KERNEL);
if (!pu8keybuf) {
PRINT_ER("No buffer to send PTK Key\n");
-- 
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 07/10] staging: wilc1000: wilc_deinit(): fixes inconsistent returns

2015-11-24 Thread Glen Lee
From: Leo Kim 

This patch fixes the warning reported by smatch.
 - wilc_deinit() warn: inconsistent returns 'sem:&hif_drv->sem_cfg_values'

This semaphore protect a cfg_values variable but cfg_values variables was not
used here. So, just remove this line.

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

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 3aea6ec..8f27227 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -4007,8 +4007,6 @@ s32 wilc_deinit(struct host_if_drv *hif_drv)
wilc_mq_destroy(&hif_msg_q);
}
 
-   down(&hif_drv->sem_cfg_values);
-
ret = remove_handler_in_list(hif_drv);
if (ret)
result = -ENOENT;
-- 
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 02/10] staging: wilc1000: wilc_wfi_cfgoperations.c: remove over-commenting

2015-11-24 Thread Glen Lee
From: Leo Kim 

There are over-commenting in the wilc_wfi_cfgoperations.c file and most of them
are not helpful to explain what the code does and generate 80 ending
line over warnings. So, all of comments are removed in this patch and the
comments will later be added if necessary with the preferred Linux style.

Signed-off-by: Leo Kim 
Signed-off-by: Glen Lee 
---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 681 +-
 1 file changed, 23 insertions(+), 658 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index bcfddbf..bfef022 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -1,20 +1,7 @@
-/*!
- *  @file  wilc_wfi_cfgopertaions.c
- *  @brief CFG80211 Function Implementation functionality
- *  @authoraabouzaeid
- *  mabubakr
- *  mdaftedar
- *  zsalah
- *  @sawilc_wfi_cfgopertaions.h top level OS wrapper file
- *  @date  31 Aug 2010
- *  @version   1.0
- */
-
 #include "wilc_wfi_cfgoperations.h"
 #include "host_interface.h"
 #include 
 
-/* The following macros describe the bitfield map used by the firmware to 
determine its 11i mode */
 #define NO_ENCRYPT 0
 #define ENCRYPT_ENABLEDBIT(0)
 #define WEPBIT(1)
@@ -24,13 +11,11 @@
 #define AESBIT(5)
 #define TKIP   BIT(6)
 
-/*Public action frame index IDs*/
 #define FRAME_TYPE_ID  0
 #define ACTION_CAT_ID  24
 #define ACTION_SUBTYPE_ID  25
 #define P2P_PUB_ACTION_SUBTYPE 30
 
-/*Public action frame Attribute IDs*/
 #define ACTION_FRAME   0xd0
 #define GO_INTENT_ATTR_ID  0x04
 #define CHANLIST_ATTR_ID   0x0b
@@ -38,7 +23,6 @@
 #define PUB_ACTION_ATTR_ID 0x04
 #define P2PELEM_ATTR_ID0xdd
 
-/*Public action subtype values*/
 #define GO_NEG_REQ 0x00
 #define GO_NEG_RSP 0x01
 #define GO_NEG_CONF0x02
@@ -90,7 +74,6 @@ static const struct ieee80211_txrx_stypes
}
 };
 
-/* Time to stay on the channel */
 #define WILC_WFI_DWELL_PASSIVE 100
 #define WILC_WFI_DWELL_ACTIVE  40
 
@@ -123,7 +106,6 @@ u8 wilc_initialized = 1;
.max_power= 30,  \
 }
 
-/*Frequency range for channels*/
 static struct ieee80211_channel ieee80211_2ghz_channels[] = {
CHAN2G(1,  2412, 0),
CHAN2G(2,  2417, 0),
@@ -147,8 +129,6 @@ static struct ieee80211_channel ieee80211_2ghz_channels[] = 
{
.flags= (_flags),   \
 }
 
-
-/* Table 6 in section 3.2.1.1 */
 static struct ieee80211_rate ieee80211_bitrates[] = {
RATETAB_ENT(10,  0,  0),
RATETAB_ENT(20,  1,  0),
@@ -342,7 +322,6 @@ static int is_network_in_shadow(tstrNetworkInfo 
*pstrNetworkInfo,
mod_timer(&hAgingTimer, jiffies + msecs_to_jiffies(AGING_TIME));
state = -1;
} else {
-   /* Linear search for now */
for (i = 0; i < last_scanned_cnt; i++) {
if (memcmp(last_scanned_shadow[i].au8bssid,
   pstrNetworkInfo->au8bssid, 6) == 0) {
@@ -394,7 +373,7 @@ static void add_network_to_shadow(tstrNetworkInfo 
*pstrNetworkInfo,
if (ap_found != -1)
kfree(last_scanned_shadow[ap_index].pu8IEs);
last_scanned_shadow[ap_index].pu8IEs =
-   kmalloc(pstrNetworkInfo->u16IEsLen, GFP_KERNEL);/* will 
be deallocated by the WILC_WFI_CfgScan() function */
+   kmalloc(pstrNetworkInfo->u16IEsLen, GFP_KERNEL);
memcpy(last_scanned_shadow[ap_index].pu8IEs,
   pstrNetworkInfo->pu8IEs, pstrNetworkInfo->u16IEsLen);
last_scanned_shadow[ap_index].u32TimeRcvdInScan = jiffies;
@@ -405,20 +384,6 @@ static void add_network_to_shadow(tstrNetworkInfo 
*pstrNetworkInfo,
last_scanned_shadow[ap_index].pJoinParams = pJoinParams;
 }
 
-
-/**
- *  @brief  CfgScanResult
- *  @details  Callback function which returns the scan results found
- *
- *  @param[in] tenuScanEvent enuScanEvent: enum, indicating the scan event 
triggered, whether that is
- *SCAN_EVENT_NETWORK_FOUND or SCAN_EVENT_DONE
- *tstrNetworkInfo* pstrNetworkInfo: structure holding 
the scan results information
- *void* pUserVoid: Private structure associated with 
the wireless interface
- *  @return NONE
- *  @authormabubakr
- *  @date
- *  @version   1.0
- */
 static void CfgScanResult(enum scan_event scan_event,
  tstrNetworkInfo *network_info,
  void *user_void,
@@ -457,7 +422,7 @@ static void CfgScanResult(enum scan_event scan_event

[PATCH 05/10] staging: wilc1000: fixes potential null dereference 'wid.val'

2015-11-24 Thread Glen Lee
From: Leo Kim 

This patch fixes the error reported by smatch.
 - Handle_ListenStateExpired() error: potential null dereference 'wid.val'
If kmalloc failed, referenced to a NULL pointer.

Signed-off-by: Leo Kim 
Signed-off-by: Glen Lee 
---
 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 aae5a03..da4f4c6 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -2629,8 +2629,10 @@ static u32 Handle_ListenStateExpired(struct host_if_drv 
*hif_drv,
wid.size = 2;
wid.val = kmalloc(wid.size, GFP_KERNEL);
 
-   if (!wid.val)
+   if (!wid.val) {
PRINT_ER("Failed to allocate memory\n");
+   return -ENOMEM;
+   }
 
wid.val[0] = u8remain_on_chan_flag;
wid.val[1] = FALSE_FRMWR_CHANNEL;
-- 
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 06/10] staging: wilc1000: wilc_init(): fixes inconsistent returns

2015-11-24 Thread Glen Lee
From: Leo Kim 

This patch fixes the warning reported by smatch.
 - wilc_init() warn: inconsistent returns 'sem:&hif_drv->sem_cfg_values'

No need to up the sema here since down was not called before get here.

Signed-off-by: Leo Kim 
Signed-off-by: Glen Lee 
---
 drivers/staging/wilc1000/host_interface.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index da4f4c6..3aea6ec 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -3940,7 +3940,6 @@ s32 wilc_init(struct net_device *dev, struct host_if_drv 
**hif_drv_handler)
return result;
 
 _fail_timer_2:
-   up(&hif_drv->sem_cfg_values);
del_timer_sync(&hif_drv->connect_timer);
del_timer_sync(&hif_drv->scan_timer);
kthread_stop(hif_thread_handler);
-- 
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 01/10] staging: wilc1000: fix rmmod failure

2015-11-24 Thread Glen Lee
This patch fixes rmmod failure. wilc->firmware needs to be set to NULL because
it is used again to check firmware is released when module exit.

Fixes: 8b8ad7bc90bc ("staging: wilc1000: rename wilc_firmware in the struct 
wilc")
Signed-off-by: Glen Lee 
---
 drivers/staging/wilc1000/linux_wlan.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index 7ccc9b0..92ca072 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -506,6 +506,7 @@ static int wilc1000_firmware_download(struct net_device 
*dev)
PRINT_D(INIT_DBG, "Freeing FW buffer ...\n");
PRINT_D(INIT_DBG, "Releasing firmware\n");
release_firmware(wilc->firmware);
+   wilc->firmware = NULL;
 
PRINT_D(INIT_DBG, "Download Succeeded\n");
 
-- 
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 04/10] staging: wilc1000: replace explicit NULL comparisons with !

2015-11-24 Thread Glen Lee
From: Leo Kim 

This patch replace explicit NULL comparison with ! operator to simplify code.
Reported by checkpatch.pl for Comparison to NULL could be written !XXX" or 
"XXX".

Signed-off-by: Leo Kim 
Signed-off-by: Glen Lee 
---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 31 ---
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 71038b1..bdc4537 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -463,7 +463,7 @@ static void CfgScanResult(enum scan_event scan_event,
 
down(&(priv->hSemScanReq));
 
-   if (priv->pstrScanReq != NULL) {
+   if (priv->pstrScanReq) {
cfg80211_scan_done(priv->pstrScanReq, false);
priv->u32RcvdChCount = 0;
priv->bCfgScanning = false;
@@ -474,7 +474,7 @@ static void CfgScanResult(enum scan_event scan_event,
down(&(priv->hSemScanReq));
 
PRINT_D(CFG80211_DBG, "Scan Aborted\n");
-   if (priv->pstrScanReq != NULL) {
+   if (priv->pstrScanReq) {
update_scan_time();
refresh_scan(priv, 1, false);
 
@@ -645,7 +645,8 @@ static int scan(struct wiphy *wiphy, struct 
cfg80211_scan_request *request)
 
 
for (i = 0; i < request->n_ssids; i++) {
-   if (request->ssids[i].ssid != NULL && 
request->ssids[i].ssid_len != 0) {
+   if (request->ssids[i].ssid &&
+   request->ssids[i].ssid_len != 0) {

strHiddenNetwork.pstrHiddenNetworkInfo[i].pu8ssid = 
kmalloc(request->ssids[i].ssid_len, GFP_KERNEL);

memcpy(strHiddenNetwork.pstrHiddenNetworkInfo[i].pu8ssid, 
request->ssids[i].ssid, request->ssids[i].ssid_len);

strHiddenNetwork.pstrHiddenNetworkInfo[i].u8ssidlen = 
request->ssids[i].ssid_len;
@@ -716,7 +717,7 @@ static int connect(struct wiphy *wiphy, struct net_device 
*dev,
   sme->ssid,
   sme->ssid_len) == 0) {
PRINT_INFO(CFG80211_DBG, "Network with required SSID is 
found %s\n", sme->ssid);
-   if (sme->bssid == NULL) {
+   if (!sme->bssid) {
PRINT_INFO(CFG80211_DBG, "BSSID is not passed 
from the user\n");
break;
} else {
@@ -1009,12 +1010,12 @@ static int add_key(struct wiphy *wiphy, struct 
net_device *netdev, u8 key_index,
case WLAN_CIPHER_SUITE_TKIP:
case WLAN_CIPHER_SUITE_CCMP:
if (priv->wdev->iftype == NL80211_IFTYPE_AP || 
priv->wdev->iftype == NL80211_IFTYPE_P2P_GO) {
-   if (priv->wilc_gtk[key_index] == NULL) {
+   if (!priv->wilc_gtk[key_index]) {
priv->wilc_gtk[key_index] = 
kmalloc(sizeof(struct wilc_wfi_key), GFP_KERNEL);
priv->wilc_gtk[key_index]->key = NULL;
priv->wilc_gtk[key_index]->seq = NULL;
}
-   if (priv->wilc_ptk[key_index] == NULL) {
+   if (!priv->wilc_ptk[key_index]) {
priv->wilc_ptk[key_index] = 
kmalloc(sizeof(struct wilc_wfi_key), GFP_KERNEL);
priv->wilc_ptk[key_index]->key = NULL;
priv->wilc_ptk[key_index]->seq = NULL;
@@ -1828,12 +1829,12 @@ static int mgmt_tx(struct wiphy *wiphy,
 
if (ieee80211_is_mgmt(mgmt->frame_control)) {
mgmt_tx = kmalloc(sizeof(struct p2p_mgmt_data), GFP_KERNEL);
-   if (mgmt_tx == NULL) {
+   if (!mgmt_tx) {
PRINT_ER("Failed to allocate memory for mgmt_tx 
structure\n");
return -EFAULT;
}
mgmt_tx->buff = kmalloc(buf_len, GFP_KERNEL);
-   if (mgmt_tx->buff == NULL) {
+   if (!mgmt_tx->buff) {
PRINT_ER("Failed to allocate memory for mgmt_tx 
buff\n");
kfree(mgmt_tx);
return -EFAULT;
@@ -2037,11 +2038,11 @@ static int set_power_mgmt(struct wiphy *wiphy, struct 
net_device *dev,
 
PRINT_D(CFG80211_DBG, " Power save Enabled= %d , TimeOut = %d\n", 
enabled, timeout);
 
-   if (wiphy == NULL)
+   if (!wiphy)
return -ENOENT;
 
priv = wiphy_priv(wiphy);
-   if (priv->hWILCWFIDrv == NULL) {
+   if (!priv->hWIL

[PATCH 03/10] staging: wilc1000: fixes blank lines aren't necessary brace

2015-11-24 Thread Glen Lee
From: Leo Kim 

This patch fixes the checks reported by checkpatch.pl
for Blank lines aren't necessary after an open brace '{' and
Blank lines aren't necessary before a close brace '}'.

Signed-off-by: Leo Kim 
Signed-off-by: Glen Lee 
---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 50 ---
 1 file changed, 50 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index bfef022..71038b1 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -201,7 +201,6 @@ static void clear_shadow_scan(void)
}
last_scanned_cnt = 0;
}
-
 }
 
 static u32 get_rssi_avg(tstrNetworkInfo *network_info)
@@ -250,10 +249,8 @@ static void refresh_scan(void *user_void, u8 all, bool 
direct_scan)
cfg80211_put_bss(wiphy, bss);
}
}
-
}
}
-
 }
 
 static void reset_shadow_found(void)
@@ -347,7 +344,6 @@ static void add_network_to_shadow(tstrNetworkInfo 
*pstrNetworkInfo,
if (ap_found == -1) {
ap_index = last_scanned_cnt;
last_scanned_cnt++;
-
} else {
ap_index = ap_found;
}
@@ -590,9 +586,7 @@ static void CfgConnectResult(enum conn_event 
enuConnDisconnEvent,
cfg80211_disconnected(dev, pstrDisconnectNotifInfo->u16reason, 
pstrDisconnectNotifInfo->ie,
  pstrDisconnectNotifInfo->ie_len, false,
  GFP_KERNEL);
-
}
-
 }
 
 static int set_channel(struct wiphy *wiphy,
@@ -646,14 +640,11 @@ static int scan(struct wiphy *wiphy, struct 
cfg80211_scan_request *request)
PRINT_D(CFG80211_DBG, "Number of SSIDs %d\n", request->n_ssids);
 
if (request->n_ssids >= 1) {
-
-
strHiddenNetwork.pstrHiddenNetworkInfo = 
kmalloc(request->n_ssids * sizeof(struct hidden_network), GFP_KERNEL);
strHiddenNetwork.u8ssidnum = request->n_ssids;
 
 
for (i = 0; i < request->n_ssids; i++) {
-
if (request->ssids[i].ssid != NULL && 
request->ssids[i].ssid_len != 0) {

strHiddenNetwork.pstrHiddenNetworkInfo[i].pu8ssid = 
kmalloc(request->ssids[i].ssid_len, GFP_KERNEL);

memcpy(strHiddenNetwork.pstrHiddenNetworkInfo[i].pu8ssid, 
request->ssids[i].ssid, request->ssids[i].ssid_len);
@@ -675,7 +666,6 @@ static int scan(struct wiphy *wiphy, struct 
cfg80211_scan_request *request)
 (const u8 *)request->ie, 
request->ie_len,
 CfgScanResult, (void *)priv, 
NULL);
}
-
} else {
PRINT_ER("Requested num of scanned channels is greater than the 
max, supported"
 " channels\n");
@@ -835,7 +825,6 @@ static int connect(struct wiphy *wiphy, struct net_device 
*dev,
u8security = ENCRYPT_ENABLED | WPA | AES;
pcgroup_encrypt_val = "WPA_AES";
pccipher_group = "AES";
-
}
pcwpa_version = "WPA_VERSION_1";
 
@@ -845,7 +834,6 @@ static int connect(struct wiphy *wiphy, struct net_device 
*dev,
 
goto done;
}
-
}
 
if ((sme->crypto.wpa_versions & NL80211_WPA_VERSION_1)
@@ -982,7 +970,6 @@ static int add_key(struct wiphy *wiphy, struct net_device 
*netdev, u8 key_index,
case WLAN_CIPHER_SUITE_WEP40:
case WLAN_CIPHER_SUITE_WEP104:
if (priv->wdev->iftype == NL80211_IFTYPE_AP) {
-
priv->WILC_WFI_wep_default = key_index;
priv->WILC_WFI_wep_key_len[key_index] = params->key_len;
memcpy(priv->WILC_WFI_wep_key[key_index], params->key, 
params->key_len);
@@ -1022,12 +1009,10 @@ static int add_key(struct wiphy *wiphy, struct 
net_device *netdev, u8 key_index,
case WLAN_CIPHER_SUITE_TKIP:
case WLAN_CIPHER_SUITE_CCMP:
if (priv->wdev->iftype == NL80211_IFTYPE_AP || 
priv->wdev->iftype == NL80211_IFTYPE_P2P_GO) {
-
if (priv->wilc_gtk[key_index] == NULL) {
priv->wilc_gtk[key_index] = 
kmalloc(sizeof(struct wilc_wfi_key), GFP_KERNEL);
priv->wilc_gtk[key_index]->key = NULL;
priv->wilc_gtk[key_index]->seq = NULL;
-
}
if (priv->wilc_ptk[key_index] == NULL) {
priv->wilc_ptk[key_index] = 
kmalloc(sizeof(struct wilc_wfi_key), GFP_KERNEL);
@@ -

Re: [PATCH 1/3] ath10k: update WMI 10.x service map

2015-11-24 Thread Peter Oh

I believe the robot report is false.
Am I right?

Thanks,
Peter
On 11/24/2015 01:19 PM, kbuild test robot wrote:

Hi Peter,

[auto build test WARNING on net-next/master]
[also build test WARNING on v4.4-rc2 next-20151124]

url:
https://github.com/0day-ci/linux/commits/Peter-Oh/ath10k-introduce-Mesh-su
pport-in-native-WiFi-mode-for-QCA988X/20151125-014059
config: m68k-allmodconfig (attached as .config)
reproduce:
 wget
https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/
make.cross -O ~/bin/make.cross
 chmod +x ~/bin/make.cross
 # save the attached .config to linux build tree
 make.cross ARCH=m68k

All warnings (new ones prefixed by >>):

In file included from include/linux/bitops.h:36:0,
 from include/linux/kernel.h:10,
 from include/asm-generic/bug.h:13,
 from arch/m68k/include/asm/bug.h:28,
 from include/linux/bug.h:4,
 from include/net/mac80211.h:18,
 from drivers/net/wireless/ath/ath10k/mac.h:21,
 from drivers/net/wireless/ath/ath10k/mac.c:18:
drivers/net/wireless/ath/ath10k/wmi.h: In function 'wmi_10x_svc_map':
drivers/net/wireless/ath/ath10k/wmi.h:457:9: error: 'WMI_SERVICE_MESH'
undeclared (first use in this function)
 WMI_SERVICE_MESH, len);
 ^
arch/m68k/include/asm/bitops.h:63:50: note: in definition of macro
'set_bit'
 #define set_bit(nr, vaddr) (__builtin_constant_p(nr) ? \
  ^

drivers/net/wireless/ath/ath10k/wmi.h:398:4: note: in expansion of

macro '__set_bit'
__set_bit(y, out); \
^

drivers/net/wireless/ath/ath10k/wmi.h:456:2: note: in expansion of

macro 'SVCMAP'
  SVCMAP(WMI_10X_SERVICE_MESH,
  ^
drivers/net/wireless/ath/ath10k/wmi.h:457:9: note: each undeclared
identifier is reported only once for each function it appears in
 WMI_SERVICE_MESH, len);
 ^
arch/m68k/include/asm/bitops.h:63:50: note: in definition of macro
'set_bit'
 #define set_bit(nr, vaddr) (__builtin_constant_p(nr) ? \
  ^

drivers/net/wireless/ath/ath10k/wmi.h:398:4: note: in expansion of

macro '__set_bit'
__set_bit(y, out); \
^

drivers/net/wireless/ath/ath10k/wmi.h:456:2: note: in expansion of

macro 'SVCMAP'
  SVCMAP(WMI_10X_SERVICE_MESH,
  ^
drivers/net/wireless/ath/ath10k/wmi.h:459:9: error:
'WMI_SERVICE_EXT_RES_CFG_SUPPORT' undeclared (first use in this function)
 WMI_SERVICE_EXT_RES_CFG_SUPPORT, len);
 ^
arch/m68k/include/asm/bitops.h:63:50: note: in definition of macro
'set_bit'
 #define set_bit(nr, vaddr) (__builtin_constant_p(nr) ? \
  ^

drivers/net/wireless/ath/ath10k/wmi.h:398:4: note: in expansion of

macro '__set_bit'
__set_bit(y, out); \
^
drivers/net/wireless/ath/ath10k/wmi.h:458:2: note: in expansion of
macro 'SVCMAP'
  SVCMAP(WMI_10X_SERVICE_EXT_RES_CFG_SUPPORT,
  ^

vim +/__set_bit +398 drivers/net/wireless/ath/ath10k/wmi.h

37b9f933 Michal Kazior 2014-11-27  392
__le32_to_cpu((wmi_svc_bmap)[(svc_id)/(sizeof(u32))]) & \
cff990ce Michal Kazior 2014-08-04  393
BIT((svc_id)%(sizeof(u32
cff990ce Michal Kazior 2014-08-04  394
37b9f933 Michal Kazior 2014-11-27  395  #define SVCMAP(x, y, len) \
cff990ce Michal Kazior 2014-08-04  396  do { \
37b9f933 Michal Kazior 2014-11-27  397  if
(WMI_SERVICE_IS_ENABLED((in), (x), (len))) \
cff990ce Michal Kazior 2014-08-04 @398
__set_bit(y, out); \
cff990ce Michal Kazior 2014-08-04  399  } while (0)
cff990ce Michal Kazior 2014-08-04  400
37b9f933 Michal Kazior 2014-11-27  401  static inline void
wmi_10x_svc_map(const __le32 *in, unsigned long *out,
37b9f933 Michal Kazior 2014-11-27  402
size_t len)
cff990ce Michal Kazior 2014-08-04  403  {
cff990ce Michal Kazior 2014-08-04  404
SVCMAP(WMI_10X_SERVICE_BEACON_OFFLOAD,
37b9f933 Michal Kazior 2014-11-27  405
WMI_SERVICE_BEACON_OFFLOAD, len);
cff990ce Michal Kazior 2014-08-04  406
SVCMAP(WMI_10X_SERVICE_SCAN_OFFLOAD,
37b9f933 Michal Kazior 2014-11-27  407
WMI_SERVICE_SCAN_OFFLOAD, len);
cff990ce Michal Kazior 2014-08-04  408
SVCMAP(WMI_10X_SERVICE_ROAM_OFFLOAD,
37b9f933 Michal Kazior 2014-11-27  409
WMI_SERVICE_ROAM_OFFLOAD, len);
cff990ce Michal Kazior 2014-08-04  410
SVCMAP(WMI_10X_SERVICE_BCN_MISS_OFFLOAD,
37b9f933 Michal Kazior 2014-11-27  411
WMI_SERVICE_BCN_MISS_OFFLOAD, len);
cff990ce Michal Kazior 2014-08-04  412
SVCMAP(WMI_10X_SERVICE_STA_PWRSAVE,
37b9f933 Michal Kazior 2014-11-27  413
WMI_SERVICE_STA_PWRSAVE, len);
cff990ce Michal Kazior 2014-08-04  414
SVCMAP(WMI_10X_SERVICE_STA_ADVANCED_PWRSAVE,
37b9f933 Michal Kaz

Re: iw: add VHT80 support for 802.11s

2015-11-24 Thread Julian Calaby
Hi Sven,

On Wed, Nov 25, 2015 at 4:42 AM, Sven Eckelmann  wrote:
> iw mesh supports non-HT and HT channel widths like HT20 or NOHT. But the
> Linux 802.11s implementation also supports VHT80 which can be specified
> during the mesh join.
>
> iw dev mesh0 mesh join "meshnet" freq 5180 80MHz
>
> Signed-off-by: Sven Eckelmann 
> ---
>  ibss.c | 33 -
>  iw.h   |  9 +
>  mesh.c | 16 
>  util.c | 26 ++
>  4 files changed, 43 insertions(+), 41 deletions(-)
>
> diff --git a/mesh.c b/mesh.c
> index 0090530..930d58f 100644
> --- a/mesh.c
> +++ b/mesh.c
> @@ -439,12 +439,8 @@ static int join_mesh(struct nl80211_state *state,
> int bintval, dtim_period, i, n_rates = 0;
> char *end, *value = NULL, *sptr = NULL;
> unsigned long freq = 0;
> -   static const struct {
> -   const char *name;
> -   unsigned int width;
> -   int freq1_diff;
> -   int chantype; /* for older kernel */
> -   } *chanmode_selected = NULL, chanmode[] = {
> +   const struct chanmode *chanmode_selected = NULL;
> +   static const struct chanmode chanmode[] = {

You might want to make this change in a separate patch.

> { .name = "HT20",
>   .width = NL80211_CHAN_WIDTH_20,
>   .freq1_diff = 0,
> @@ -599,7 +599,7 @@ static int join_mesh(struct nl80211_state *state,
>   nla_put_failure:
> return -ENOBUFS;
>  }
> -COMMAND(mesh, join, " [[freq  ]"
> +COMMAND(mesh, join, " [[freq  
> ]"

Should NOHT remain last in the list?

> " [basic-rates ]], [mcast-rate  Mbps>]"
> " [beacon-interval ] [dtim-period ]"
> " [vendor_sync on|off] [=]*",

Thanks,

-- 
Julian Calaby

Email: julian.cal...@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/
--
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: ATH10 firmware question

2015-11-24 Thread Ben Greear

On 11/24/2015 10:07 AM, Cedric VONCKEN wrote:

Hi,

I have a simple test platform.
One PC connected to an equipment. This equipment is set in AP
mode.
Another PC connected to another equipment. This equipment is set
in STA + WDS mode.

Both equipment use the same openwrt Firmware (compat
2015-07-21), I only changed the ath10k firmware (in
/lib/firmware/ath10k/...).
Both equipment has the same hardware.
I used a clear channel, and VHT80.
The radio was connected with a coaxial cable and I placed 40 dBm
attenuation per Rf chain.
I used the WLN350NX radio card from compex.

First test : ATH10K firmware 10.2.4.70-2 on both equipment
An iperf from PC connected to the AP to the PC connected
to the STA give 919 Mbps.
An iperf from PC connected to the STA to the PC
connected to the AP give 500 Mbps.

Second test : ATHK firmware 10.2.4.70.10-2 on both equipment
An iperf from PC connected to the AP to the PC connected
to the STA give 921 Mbps.
An iperf from PC connected to the STA to the PC
connected to the AP give 441 Mbps.

If I cross the computer I have the same result. I did several
time these test and I always have the same result.


We see similar.  One thing we notice is that if you actually try to send less
throughput, then you get better overall throughput.

In other words, trying to send 1Gbps UDP frames will give you more poor
throughput than trying to send 650Mbps (in the upload direction).

I thought it might be a poor interaction regarding backoff in the
ath10k driver/firmware (see the congestion bins in firmware for why
this is the case), but even fixing that in firmware didn't improve
the situation in my testing.

Thanks,
Ben



Is it the expected result?
What is the recommanded firmware version for each mode?

Thanks for your help.

Cedric Voncken.







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




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


ATH10 firmware question

2015-11-24 Thread Cedric VONCKEN
Hi, 

I have a simple test platform. 
One PC connected to an equipment. This equipment is set in AP
mode.
Another PC connected to another equipment. This equipment is set
in STA + WDS mode.

Both equipment use the same openwrt Firmware (compat
2015-07-21), I only changed the ath10k firmware (in
/lib/firmware/ath10k/...).
Both equipment has the same hardware.
I used a clear channel, and VHT80.
The radio was connected with a coaxial cable and I placed 40 dBm
attenuation per Rf chain.
I used the WLN350NX radio card from compex.

First test : ATH10K firmware 10.2.4.70-2 on both equipment
An iperf from PC connected to the AP to the PC connected
to the STA give 919 Mbps.
An iperf from PC connected to the STA to the PC
connected to the AP give 500 Mbps.

Second test : ATHK firmware 10.2.4.70.10-2 on both equipment
An iperf from PC connected to the AP to the PC connected
to the STA give 921 Mbps.
An iperf from PC connected to the STA to the PC
connected to the AP give 441 Mbps.

If I cross the computer I have the same result. I did several
time these test and I always have the same result.

Is it the expected result?
What is the recommanded firmware version for each mode?

Thanks for your help.

Cedric Voncken.







--
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/3] ath10k: update WMI 10.x service map

2015-11-24 Thread kbuild test robot
Hi Peter,

[auto build test WARNING on net-next/master]
[also build test WARNING on v4.4-rc2 next-20151124]

url:
https://github.com/0day-ci/linux/commits/Peter-Oh/ath10k-introduce-Mesh-support-in-native-WiFi-mode-for-QCA988X/20151125-014059
config: m68k-allmodconfig (attached as .config)
reproduce:
wget 
https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
 -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=m68k 

All warnings (new ones prefixed by >>):

   In file included from include/linux/bitops.h:36:0,
from include/linux/kernel.h:10,
from include/asm-generic/bug.h:13,
from arch/m68k/include/asm/bug.h:28,
from include/linux/bug.h:4,
from include/net/mac80211.h:18,
from drivers/net/wireless/ath/ath10k/mac.h:21,
from drivers/net/wireless/ath/ath10k/mac.c:18:
   drivers/net/wireless/ath/ath10k/wmi.h: In function 'wmi_10x_svc_map':
   drivers/net/wireless/ath/ath10k/wmi.h:457:9: error: 'WMI_SERVICE_MESH' 
undeclared (first use in this function)
WMI_SERVICE_MESH, len);
^
   arch/m68k/include/asm/bitops.h:63:50: note: in definition of macro 'set_bit'
#define set_bit(nr, vaddr) (__builtin_constant_p(nr) ? \
 ^
>> drivers/net/wireless/ath/ath10k/wmi.h:398:4: note: in expansion of macro 
>> '__set_bit'
   __set_bit(y, out); \
   ^
>> drivers/net/wireless/ath/ath10k/wmi.h:456:2: note: in expansion of macro 
>> 'SVCMAP'
 SVCMAP(WMI_10X_SERVICE_MESH,
 ^
   drivers/net/wireless/ath/ath10k/wmi.h:457:9: note: each undeclared 
identifier is reported only once for each function it appears in
WMI_SERVICE_MESH, len);
^
   arch/m68k/include/asm/bitops.h:63:50: note: in definition of macro 'set_bit'
#define set_bit(nr, vaddr) (__builtin_constant_p(nr) ? \
 ^
>> drivers/net/wireless/ath/ath10k/wmi.h:398:4: note: in expansion of macro 
>> '__set_bit'
   __set_bit(y, out); \
   ^
>> drivers/net/wireless/ath/ath10k/wmi.h:456:2: note: in expansion of macro 
>> 'SVCMAP'
 SVCMAP(WMI_10X_SERVICE_MESH,
 ^
   drivers/net/wireless/ath/ath10k/wmi.h:459:9: error: 
'WMI_SERVICE_EXT_RES_CFG_SUPPORT' undeclared (first use in this function)
WMI_SERVICE_EXT_RES_CFG_SUPPORT, len);
^
   arch/m68k/include/asm/bitops.h:63:50: note: in definition of macro 'set_bit'
#define set_bit(nr, vaddr) (__builtin_constant_p(nr) ? \
 ^
>> drivers/net/wireless/ath/ath10k/wmi.h:398:4: note: in expansion of macro 
>> '__set_bit'
   __set_bit(y, out); \
   ^
   drivers/net/wireless/ath/ath10k/wmi.h:458:2: note: in expansion of macro 
'SVCMAP'
 SVCMAP(WMI_10X_SERVICE_EXT_RES_CFG_SUPPORT,
 ^

vim +/__set_bit +398 drivers/net/wireless/ath/ath10k/wmi.h

37b9f933 Michal Kazior 2014-11-27  392   
__le32_to_cpu((wmi_svc_bmap)[(svc_id)/(sizeof(u32))]) & \
cff990ce Michal Kazior 2014-08-04  393   BIT((svc_id)%(sizeof(u32
cff990ce Michal Kazior 2014-08-04  394  
37b9f933 Michal Kazior 2014-11-27  395  #define SVCMAP(x, y, len) \
cff990ce Michal Kazior 2014-08-04  396  do { \
37b9f933 Michal Kazior 2014-11-27  397  if 
(WMI_SERVICE_IS_ENABLED((in), (x), (len))) \
cff990ce Michal Kazior 2014-08-04 @398  __set_bit(y, 
out); \
cff990ce Michal Kazior 2014-08-04  399  } while (0)
cff990ce Michal Kazior 2014-08-04  400  
37b9f933 Michal Kazior 2014-11-27  401  static inline void 
wmi_10x_svc_map(const __le32 *in, unsigned long *out,
37b9f933 Michal Kazior 2014-11-27  402 
size_t len)
cff990ce Michal Kazior 2014-08-04  403  {
cff990ce Michal Kazior 2014-08-04  404  
SVCMAP(WMI_10X_SERVICE_BEACON_OFFLOAD,
37b9f933 Michal Kazior 2014-11-27  405 
WMI_SERVICE_BEACON_OFFLOAD, len);
cff990ce Michal Kazior 2014-08-04  406  
SVCMAP(WMI_10X_SERVICE_SCAN_OFFLOAD,
37b9f933 Michal Kazior 2014-11-27  407 
WMI_SERVICE_SCAN_OFFLOAD, len);
cff990ce Michal Kazior 2014-08-04  408  
SVCMAP(WMI_10X_SERVICE_ROAM_OFFLOAD,
37b9f933 Michal Kazior 2014-11-27  409 
WMI_SERVICE_ROAM_OFFLOAD, len);
cff990ce Michal Kazior 2014-08-04  410  
SVCMAP(WMI_10X_SERVICE_BCN_MISS_OFFLOAD,
37b9f933 Michal Kazior 2014-11-27  411 
WMI_SERVICE_BCN_MISS_OFFLOAD, len);
cff990ce Michal Kazior 2014-08-04  412  
SVCMAP(WMI_10X_SERVICE_STA_PWRSAVE,
37b9f933 Michal Kazior 2014-1

Re: [PATCH 3/3] ath10k: apply Mesh subtype when Mesh interface created.

2015-11-24 Thread kbuild test robot
Hi Peter,

[auto build test WARNING on net-next/master]
[also build test WARNING on v4.4-rc2 next-20151124]

url:
https://github.com/0day-ci/linux/commits/Peter-Oh/ath10k-introduce-Mesh-support-in-native-WiFi-mode-for-QCA988X/20151125-014059
config: x86_64-randconfig-s5-11250138 (attached as .config)
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64 

All warnings (new ones prefixed by >>):

   In file included from drivers/net/wireless/ath/ath10k/core.h:32:0,
from drivers/net/wireless/ath/ath10k/mac.h:22,
from drivers/net/wireless/ath/ath10k/mac.c:18:
   drivers/net/wireless/ath/ath10k/wmi.h: In function 'wmi_10x_svc_map':
   drivers/net/wireless/ath/ath10k/wmi.h:457:9: error: 'WMI_SERVICE_MESH' 
undeclared (first use in this function)
WMI_SERVICE_MESH, len);
^
   drivers/net/wireless/ath/ath10k/wmi.h:398:14: note: in definition of macro 
'SVCMAP'
   __set_bit(y, out); \
 ^
   drivers/net/wireless/ath/ath10k/wmi.h:457:9: note: each undeclared 
identifier is reported only once for each function it appears in
WMI_SERVICE_MESH, len);
^
   drivers/net/wireless/ath/ath10k/wmi.h:398:14: note: in definition of macro 
'SVCMAP'
   __set_bit(y, out); \
 ^
   drivers/net/wireless/ath/ath10k/wmi.h:459:9: error: 
'WMI_SERVICE_EXT_RES_CFG_SUPPORT' undeclared (first use in this function)
WMI_SERVICE_EXT_RES_CFG_SUPPORT, len);
^
   drivers/net/wireless/ath/ath10k/wmi.h:398:14: note: in definition of macro 
'SVCMAP'
   __set_bit(y, out); \
 ^
   In file included from include/asm-generic/bug.h:4:0,
from arch/x86/include/asm/bug.h:35,
from include/linux/bug.h:4,
from include/net/mac80211.h:18,
from drivers/net/wireless/ath/ath10k/mac.h:21,
from drivers/net/wireless/ath/ath10k/mac.c:18:
   drivers/net/wireless/ath/ath10k/mac.c: In function 'ath10k_add_interface':
   drivers/net/wireless/ath/ath10k/mac.c:4353:16: error: 'WMI_SERVICE_MESH' 
undeclared (first use in this function)
  if (test_bit(WMI_SERVICE_MESH, ar->wmi.svc_map)) {
   ^
   include/linux/compiler.h:147:28: note: in definition of macro '__trace_if'
 if (__builtin_constant_p((cond)) ? !!(cond) :   \
   ^
>> drivers/net/wireless/ath/ath10k/mac.c:4353:3: note: in expansion of macro 
>> 'if'
  if (test_bit(WMI_SERVICE_MESH, ar->wmi.svc_map)) {
  ^
>> drivers/net/wireless/ath/ath10k/mac.c:4353:7: note: in expansion of macro 
>> 'test_bit'
  if (test_bit(WMI_SERVICE_MESH, ar->wmi.svc_map)) {
  ^

vim +/if +4353 drivers/net/wireless/ath/ath10k/mac.c

  4337  
  4338  switch (vif->type) {
  4339  case NL80211_IFTYPE_P2P_DEVICE:
  4340  arvif->vdev_type = WMI_VDEV_TYPE_STA;
  4341  arvif->vdev_subtype = WMI_VDEV_SUBTYPE_P2P_DEVICE;
  4342  break;
  4343  case NL80211_IFTYPE_UNSPECIFIED:
  4344  case NL80211_IFTYPE_STATION:
  4345  arvif->vdev_type = WMI_VDEV_TYPE_STA;
  4346  if (vif->p2p)
  4347  arvif->vdev_subtype = 
WMI_VDEV_SUBTYPE_P2P_CLIENT;
  4348  break;
  4349  case NL80211_IFTYPE_ADHOC:
  4350  arvif->vdev_type = WMI_VDEV_TYPE_IBSS;
  4351  break;
  4352  case NL80211_IFTYPE_MESH_POINT:
> 4353  if (test_bit(WMI_SERVICE_MESH, ar->wmi.svc_map)) {
  4354  arvif->vdev_subtype = WMI_VDEV_SUBTYPE_MESH;
  4355  } else if (!test_bit(ATH10K_FLAG_RAW_MODE, 
&ar->dev_flags)) {
  4356  ret = -EINVAL;
  4357  ath10k_warn(ar, "must load driver with 
rawmode=1 to add mesh interfaces\n");
  4358  goto err;
  4359  }
  4360  arvif->vdev_type = WMI_VDEV_TYPE_AP;
  4361  break;

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: Binary data


Re: [PATCH 1/3] ath10k: update WMI 10.x service map

2015-11-24 Thread kbuild test robot
Hi Peter,

[auto build test ERROR on net-next/master]
[also build test ERROR on v4.4-rc2 next-20151124]

url:
https://github.com/0day-ci/linux/commits/Peter-Oh/ath10k-introduce-Mesh-support-in-native-WiFi-mode-for-QCA988X/20151125-014059
config: x86_64-randconfig-x006-11230704 (attached as .config)
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64 

All errors (new ones prefixed by >>):

   In file included from drivers/net/wireless/ath/ath10k/core.h:32:0,
from drivers/net/wireless/ath/ath10k/mac.h:22,
from drivers/net/wireless/ath/ath10k/mac.c:18:
   drivers/net/wireless/ath/ath10k/wmi.h: In function 'wmi_10x_svc_map':
>> drivers/net/wireless/ath/ath10k/wmi.h:457:9: error: 'WMI_SERVICE_MESH' 
>> undeclared (first use in this function)
WMI_SERVICE_MESH, len);
^
   drivers/net/wireless/ath/ath10k/wmi.h:398:14: note: in definition of macro 
'SVCMAP'
   __set_bit(y, out); \
 ^
   drivers/net/wireless/ath/ath10k/wmi.h:457:9: note: each undeclared 
identifier is reported only once for each function it appears in
WMI_SERVICE_MESH, len);
^
   drivers/net/wireless/ath/ath10k/wmi.h:398:14: note: in definition of macro 
'SVCMAP'
   __set_bit(y, out); \
 ^
>> drivers/net/wireless/ath/ath10k/wmi.h:459:9: error: 
>> 'WMI_SERVICE_EXT_RES_CFG_SUPPORT' undeclared (first use in this function)
WMI_SERVICE_EXT_RES_CFG_SUPPORT, len);
^
   drivers/net/wireless/ath/ath10k/wmi.h:398:14: note: in definition of macro 
'SVCMAP'
   __set_bit(y, out); \
 ^

vim +/WMI_SERVICE_MESH +457 drivers/net/wireless/ath/ath10k/wmi.h

   392   __le32_to_cpu((wmi_svc_bmap)[(svc_id)/(sizeof(u32))]) & \
   393   BIT((svc_id)%(sizeof(u32
   394  
   395  #define SVCMAP(x, y, len) \
   396  do { \
   397  if (WMI_SERVICE_IS_ENABLED((in), (x), (len))) \
 > 398  __set_bit(y, out); \
   399  } while (0)
   400  
   401  static inline void wmi_10x_svc_map(const __le32 *in, unsigned long *out,
   402 size_t len)
   403  {
   404  SVCMAP(WMI_10X_SERVICE_BEACON_OFFLOAD,
   405 WMI_SERVICE_BEACON_OFFLOAD, len);
   406  SVCMAP(WMI_10X_SERVICE_SCAN_OFFLOAD,
   407 WMI_SERVICE_SCAN_OFFLOAD, len);
   408  SVCMAP(WMI_10X_SERVICE_ROAM_OFFLOAD,
   409 WMI_SERVICE_ROAM_OFFLOAD, len);
   410  SVCMAP(WMI_10X_SERVICE_BCN_MISS_OFFLOAD,
   411 WMI_SERVICE_BCN_MISS_OFFLOAD, len);
   412  SVCMAP(WMI_10X_SERVICE_STA_PWRSAVE,
   413 WMI_SERVICE_STA_PWRSAVE, len);
   414  SVCMAP(WMI_10X_SERVICE_STA_ADVANCED_PWRSAVE,
   415 WMI_SERVICE_STA_ADVANCED_PWRSAVE, len);
   416  SVCMAP(WMI_10X_SERVICE_AP_UAPSD,
   417 WMI_SERVICE_AP_UAPSD, len);
   418  SVCMAP(WMI_10X_SERVICE_AP_DFS,
   419 WMI_SERVICE_AP_DFS, len);
   420  SVCMAP(WMI_10X_SERVICE_11AC,
   421 WMI_SERVICE_11AC, len);
   422  SVCMAP(WMI_10X_SERVICE_BLOCKACK,
   423 WMI_SERVICE_BLOCKACK, len);
   424  SVCMAP(WMI_10X_SERVICE_PHYERR,
   425 WMI_SERVICE_PHYERR, len);
   426  SVCMAP(WMI_10X_SERVICE_BCN_FILTER,
   427 WMI_SERVICE_BCN_FILTER, len);
   428  SVCMAP(WMI_10X_SERVICE_RTT,
   429 WMI_SERVICE_RTT, len);
   430  SVCMAP(WMI_10X_SERVICE_RATECTRL,
   431 WMI_SERVICE_RATECTRL, len);
   432  SVCMAP(WMI_10X_SERVICE_WOW,
   433 WMI_SERVICE_WOW, len);
   434  SVCMAP(WMI_10X_SERVICE_RATECTRL_CACHE,
   435 WMI_SERVICE_RATECTRL_CACHE, len);
   436  SVCMAP(WMI_10X_SERVICE_IRAM_TIDS,
   437 WMI_SERVICE_IRAM_TIDS, len);
   438  SVCMAP(WMI_10X_SERVICE_BURST,
   439 WMI_SERVICE_BURST, len);
   440  SVCMAP(WMI_10X_SERVICE_SMART_ANTENNA_SW_SUPPORT,
   441 WMI_SERVICE_SMART_ANTENNA_SW_SUPPORT, len);
   442  SVCMAP(WMI_10X_SERVICE_FORCE_FW_HANG,
   443 WMI_SERVICE_FORCE_FW_HANG, len);
   444  SVCMAP(WMI_10X_SERVICE_SMART_ANTENNA_HW_SUPPORT,
   445 WMI_SERVICE_SMART_ANTENNA_HW_SUPPORT, len);
   446  SVCMAP(WMI_10X_SERVICE_ATF,
   447 WMI_SERVICE_ATF, len);
   448  SVCMAP(WMI_10X_SERVICE_COEX_GPIO,
   449 WMI_SERVICE_COEX_GPIO, len);
   450  SVCMAP(WMI_10X_SERVICE_AUX_SPECTRAL_INTF,
   451 WMI_SERVICE_AUX_SPECTRAL_INTF, len);
   452  SVCMAP(WMI_10X_SERVICE_AUX_CHAN_LOAD_INTF,
   453 WMI_SER

Re: [PATCH 3/3] ath10k: apply Mesh subtype when Mesh interface created.

2015-11-24 Thread kbuild test robot
Hi Peter,

[auto build test ERROR on net-next/master]
[also build test ERROR on v4.4-rc2 next-20151124]

url:
https://github.com/0day-ci/linux/commits/Peter-Oh/ath10k-introduce-Mesh-support-in-native-WiFi-mode-for-QCA988X/20151125-014059
config: x86_64-randconfig-x006-11230704 (attached as .config)
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64 

All errors (new ones prefixed by >>):

   In file included from drivers/net/wireless/ath/ath10k/core.h:32:0,
from drivers/net/wireless/ath/ath10k/mac.h:22,
from drivers/net/wireless/ath/ath10k/mac.c:18:
   drivers/net/wireless/ath/ath10k/wmi.h: In function 'wmi_10x_svc_map':
   drivers/net/wireless/ath/ath10k/wmi.h:457:9: error: 'WMI_SERVICE_MESH' 
undeclared (first use in this function)
WMI_SERVICE_MESH, len);
^
   drivers/net/wireless/ath/ath10k/wmi.h:398:14: note: in definition of macro 
'SVCMAP'
   __set_bit(y, out); \
 ^
   drivers/net/wireless/ath/ath10k/wmi.h:457:9: note: each undeclared 
identifier is reported only once for each function it appears in
WMI_SERVICE_MESH, len);
^
   drivers/net/wireless/ath/ath10k/wmi.h:398:14: note: in definition of macro 
'SVCMAP'
   __set_bit(y, out); \
 ^
   drivers/net/wireless/ath/ath10k/wmi.h:459:9: error: 
'WMI_SERVICE_EXT_RES_CFG_SUPPORT' undeclared (first use in this function)
WMI_SERVICE_EXT_RES_CFG_SUPPORT, len);
^
   drivers/net/wireless/ath/ath10k/wmi.h:398:14: note: in definition of macro 
'SVCMAP'
   __set_bit(y, out); \
 ^
   In file included from include/linux/bitops.h:36:0,
from include/linux/kernel.h:10,
from include/asm-generic/bug.h:13,
from arch/x86/include/asm/bug.h:35,
from include/linux/bug.h:4,
from include/net/mac80211.h:18,
from drivers/net/wireless/ath/ath10k/mac.h:21,
from drivers/net/wireless/ath/ath10k/mac.c:18:
   drivers/net/wireless/ath/ath10k/mac.c: In function 'ath10k_add_interface':
>> drivers/net/wireless/ath/ath10k/mac.c:4353:16: error: 'WMI_SERVICE_MESH' 
>> undeclared (first use in this function)
  if (test_bit(WMI_SERVICE_MESH, ar->wmi.svc_map)) {
   ^
   arch/x86/include/asm/bitops.h:336:25: note: in definition of macro 'test_bit'
 (__builtin_constant_p((nr))  \
^

vim +/WMI_SERVICE_MESH +4353 drivers/net/wireless/ath/ath10k/mac.c

  4347  arvif->vdev_subtype = 
WMI_VDEV_SUBTYPE_P2P_CLIENT;
  4348  break;
  4349  case NL80211_IFTYPE_ADHOC:
  4350  arvif->vdev_type = WMI_VDEV_TYPE_IBSS;
  4351  break;
  4352  case NL80211_IFTYPE_MESH_POINT:
> 4353  if (test_bit(WMI_SERVICE_MESH, ar->wmi.svc_map)) {
  4354  arvif->vdev_subtype = WMI_VDEV_SUBTYPE_MESH;
  4355  } else if (!test_bit(ATH10K_FLAG_RAW_MODE, 
&ar->dev_flags)) {
  4356  ret = -EINVAL;

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: Binary data


[PATCH v2] iw: add VHT80 support for 802.11s

2015-11-24 Thread Sven Eckelmann
iw mesh supports non-HT and HT channel widths like HT20 or NOHT. But the
Linux 802.11s implementation also supports VHT80 which can be specified
during the mesh join.

iw dev mesh0 mesh join "meshnet" freq 5180 80MHz

Signed-off-by: Sven Eckelmann 
---
v2: rebased from v4.3 to current master

 ibss.c | 33 -
 iw.h   |  9 +
 mesh.c | 16 
 util.c | 26 ++
 4 files changed, 43 insertions(+), 41 deletions(-)

diff --git a/ibss.c b/ibss.c
index 024981a..a761794 100644
--- a/ibss.c
+++ b/ibss.c
@@ -16,39 +16,6 @@
 
 SECTION(ibss);
 
-struct chanmode {
-   const char *name;
-   unsigned int width;
-   int freq1_diff;
-   int chantype; /* for older kernel */
-};
-
-static int get_cf1(const struct chanmode *chanmode, unsigned long freq)
-{
-   unsigned int cf1 = freq, j;
-   unsigned int vht80[] = { 5180, 5260, 5500, 5580, 5660, 5745 };
-
-   switch (chanmode->width) {
-   case NL80211_CHAN_WIDTH_80:
-   /* setup center_freq1 */
-   for (j = 0; j < ARRAY_SIZE(vht80); j++) {
-   if (freq >= vht80[j] && freq < vht80[j] + 80)
-   break;
-   }
-
-   if (j == ARRAY_SIZE(vht80))
-   break;
-
-   cf1 = vht80[j] + 30;
-   break;
-   default:
-   cf1 = freq + chanmode->freq1_diff;
-   break;
-   }
-
-   return cf1;
-}
-
 static int join_ibss(struct nl80211_state *state,
 struct nl_msg *msg,
 int argc, char **argv,
diff --git a/iw.h b/iw.h
index 263e8b1..d91a33e 100644
--- a/iw.h
+++ b/iw.h
@@ -59,6 +59,13 @@ struct cmd {
const struct cmd *parent;
 };
 
+struct chanmode {
+   const char *name;
+   unsigned int width;
+   int freq1_diff;
+   int chantype; /* for older kernel */
+};
+
 #define ARRAY_SIZE(ar) (sizeof(ar)/sizeof(ar[0]))
 #define DIV_ROUND_UP(x, y) (((x) + (y - 1)) / (y))
 
@@ -174,6 +181,8 @@ void print_ies(unsigned char *ie, int ielen, bool unknown,
 void parse_bitrate(struct nlattr *bitrate_attr, char *buf, int buflen);
 void iw_hexdump(const char *prefix, const __u8 *data, size_t len);
 
+int get_cf1(const struct chanmode *chanmode, unsigned long freq);
+
 #define SCHED_SCAN_OPTIONS "interval  [delay ] " \
"[freqs +] [matches [ssid ]+]] [active [ssid 
]+|passive] [randomise[=/]]"
 int parse_sched_scan(struct nl_msg *msg, int *argc, char ***argv);
diff --git a/mesh.c b/mesh.c
index f2415f3..d674d61 100644
--- a/mesh.c
+++ b/mesh.c
@@ -448,12 +448,8 @@ static int join_mesh(struct nl80211_state *state,
char *end, *value = NULL, *sptr = NULL;
unsigned int i;
unsigned long freq = 0;
-   static const struct {
-   const char *name;
-   unsigned int width;
-   int freq1_diff;
-   int chantype; /* for older kernel */
-   } *chanmode_selected = NULL, chanmode[] = {
+   const struct chanmode *chanmode_selected = NULL;
+   static const struct chanmode chanmode[] = {
{ .name = "HT20",
  .width = NL80211_CHAN_WIDTH_20,
  .freq1_diff = 0,
@@ -470,6 +466,10 @@ static int join_mesh(struct nl80211_state *state,
  .width = NL80211_CHAN_WIDTH_20_NOHT,
  .freq1_diff = 0,
  .chantype = NL80211_CHAN_NO_HT },
+   { .name = "80MHz",
+ .width = NL80211_CHAN_WIDTH_80,
+ .freq1_diff = 0,
+ .chantype = -1 },
};
 
if (argc < 1)
@@ -506,7 +506,7 @@ static int join_mesh(struct nl80211_state *state,
NLA_PUT_U32(msg, NL80211_ATTR_CHANNEL_WIDTH,
chanmode_selected->width);
NLA_PUT_U32(msg, NL80211_ATTR_CENTER_FREQ1,
-   freq + chanmode_selected->freq1_diff);
+   get_cf1(chanmode_selected, freq));
if (chanmode_selected->chantype != -1)
NLA_PUT_U32(msg,
NL80211_ATTR_WIPHY_CHANNEL_TYPE,
@@ -608,7 +608,7 @@ static int join_mesh(struct nl80211_state *state,
  nla_put_failure:
return -ENOBUFS;
 }
-COMMAND(mesh, join, " [[freq  ]"
+COMMAND(mesh, join, " [[freq  
]"
" [basic-rates ]], [mcast-rate ]"
" [beacon-interval ] [dtim-period ]"
" [vendor_sync on|off] [=]*",
diff --git a/util.c b/util.c
index 55e1e26..da3be32 100644
--- a/util.c
+++ b/util.c
@@ -726,3 +726,29 @@ void iw_hexdump(const char *prefix, const __u8 *buf, 
size_t size)
}
printf("\n\n");
 }
+
+int get_cf1(const struct chanmode *chanmode, unsigned long freq)
+{
+   unsigned int cf1 = freq, j;
+   unsigned int vht80[] = { 5180, 5260, 5500, 5580, 5660, 5745 };
+
+   switch (chan

iw: add VHT80 support for 802.11s

2015-11-24 Thread Sven Eckelmann
iw mesh supports non-HT and HT channel widths like HT20 or NOHT. But the
Linux 802.11s implementation also supports VHT80 which can be specified
during the mesh join.

iw dev mesh0 mesh join "meshnet" freq 5180 80MHz

Signed-off-by: Sven Eckelmann 
---
 ibss.c | 33 -
 iw.h   |  9 +
 mesh.c | 16 
 util.c | 26 ++
 4 files changed, 43 insertions(+), 41 deletions(-)

diff --git a/ibss.c b/ibss.c
index 23bda70..ac06fc5 100644
--- a/ibss.c
+++ b/ibss.c
@@ -16,39 +16,6 @@
 
 SECTION(ibss);
 
-struct chanmode {
-   const char *name;
-   unsigned int width;
-   int freq1_diff;
-   int chantype; /* for older kernel */
-};
-
-static int get_cf1(const struct chanmode *chanmode, unsigned long freq)
-{
-   int cf1 = freq, j;
-   int vht80[] = { 5180, 5260, 5500, 5580, 5660, 5745 };
-
-   switch (chanmode->width) {
-   case NL80211_CHAN_WIDTH_80:
-   /* setup center_freq1 */
-   for (j = 0; j < ARRAY_SIZE(vht80); j++) {
-   if (freq >= vht80[j] && freq < vht80[j] + 80)
-   break;
-   }
-
-   if (j == ARRAY_SIZE(vht80))
-   break;
-
-   cf1 = vht80[j] + 30;
-   break;
-   default:
-   cf1 = freq + chanmode->freq1_diff;
-   break;
-   }
-
-   return cf1;
-}
-
 static int join_ibss(struct nl80211_state *state,
 struct nl_msg *msg,
 int argc, char **argv,
diff --git a/iw.h b/iw.h
index cef9da8..8e1a37a 100644
--- a/iw.h
+++ b/iw.h
@@ -59,6 +59,13 @@ struct cmd {
const struct cmd *parent;
 };
 
+struct chanmode {
+   const char *name;
+   unsigned int width;
+   int freq1_diff;
+   int chantype; /* for older kernel */
+};
+
 #define ARRAY_SIZE(ar) (sizeof(ar)/sizeof(ar[0]))
 #define DIV_ROUND_UP(x, y) (((x) + (y - 1)) / (y))
 
@@ -174,6 +181,8 @@ void print_ies(unsigned char *ie, int ielen, bool unknown,
 void parse_bitrate(struct nlattr *bitrate_attr, char *buf, int buflen);
 void iw_hexdump(const char *prefix, const __u8 *data, size_t len);
 
+int get_cf1(const struct chanmode *chanmode, unsigned long freq);
+
 #define SCHED_SCAN_OPTIONS "interval  [delay ] " \
"[freqs +] [matches [ssid ]+]] [active [ssid 
]+|passive] [randomise[=/]]"
 int parse_sched_scan(struct nl_msg *msg, int *argc, char ***argv);
diff --git a/mesh.c b/mesh.c
index 0090530..930d58f 100644
--- a/mesh.c
+++ b/mesh.c
@@ -439,12 +439,8 @@ static int join_mesh(struct nl80211_state *state,
int bintval, dtim_period, i, n_rates = 0;
char *end, *value = NULL, *sptr = NULL;
unsigned long freq = 0;
-   static const struct {
-   const char *name;
-   unsigned int width;
-   int freq1_diff;
-   int chantype; /* for older kernel */
-   } *chanmode_selected = NULL, chanmode[] = {
+   const struct chanmode *chanmode_selected = NULL;
+   static const struct chanmode chanmode[] = {
{ .name = "HT20",
  .width = NL80211_CHAN_WIDTH_20,
  .freq1_diff = 0,
@@ -461,6 +457,10 @@ static int join_mesh(struct nl80211_state *state,
  .width = NL80211_CHAN_WIDTH_20_NOHT,
  .freq1_diff = 0,
  .chantype = NL80211_CHAN_NO_HT },
+   { .name = "80MHz",
+ .width = NL80211_CHAN_WIDTH_80,
+ .freq1_diff = 0,
+ .chantype = -1 },
};
 
if (argc < 1)
@@ -497,7 +497,7 @@ static int join_mesh(struct nl80211_state *state,
NLA_PUT_U32(msg, NL80211_ATTR_CHANNEL_WIDTH,
chanmode_selected->width);
NLA_PUT_U32(msg, NL80211_ATTR_CENTER_FREQ1,
-   freq + chanmode_selected->freq1_diff);
+   get_cf1(chanmode_selected, freq));
if (chanmode_selected->chantype != -1)
NLA_PUT_U32(msg,
NL80211_ATTR_WIPHY_CHANNEL_TYPE,
@@ -599,7 +599,7 @@ static int join_mesh(struct nl80211_state *state,
  nla_put_failure:
return -ENOBUFS;
 }
-COMMAND(mesh, join, " [[freq  ]"
+COMMAND(mesh, join, " [[freq  
]"
" [basic-rates ]], [mcast-rate ]"
" [beacon-interval ] [dtim-period ]"
" [vendor_sync on|off] [=]*",
diff --git a/util.c b/util.c
index 4efc4c8..d75ffe0 100644
--- a/util.c
+++ b/util.c
@@ -728,3 +728,29 @@ void iw_hexdump(const char *prefix, const __u8 *buf, 
size_t size)
}
printf("\n\n");
 }
+
+int get_cf1(const struct chanmode *chanmode, unsigned long freq)
+{
+   int cf1 = freq, j;
+   int vht80[] = { 5180, 5260, 5500, 5580, 5660, 5745 };
+
+   switch (chanmode->width) {
+   case NL80211_CHAN_WIDTH_80:

[PATCH 2/3] ath10k: introduce new subtypes for proxy STA and Mesh

2015-11-24 Thread Peter Oh
QCA988X firmware starting from 10.2.4.70.12-2 supports new
vdev subtypes for proxy STA and Mesh, hence add them to be used
as needed.

Signed-off-by: Peter Oh 
---
 drivers/net/wireless/ath/ath10k/wmi.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/wmi.h 
b/drivers/net/wireless/ath/ath10k/wmi.h
index 0747055..d85ad78 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.h
+++ b/drivers/net/wireless/ath/ath10k/wmi.h
@@ -4274,6 +4274,8 @@ enum wmi_vdev_subtype {
WMI_VDEV_SUBTYPE_P2P_DEVICE = 1,
WMI_VDEV_SUBTYPE_P2P_CLIENT = 2,
WMI_VDEV_SUBTYPE_P2P_GO = 3,
+   WMI_VDEV_SUBTYPE_PROXY_STA  = 4,
+   WMI_VDEV_SUBTYPE_MESH   = 5,
 };
 
 /* values for vdev_subtype */
-- 
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/3] ath10k: apply Mesh subtype when Mesh interface created.

2015-11-24 Thread Peter Oh
QCA988X firmware starting from 10.2.4.70.12-2 has capability to support
Mesh Control Field Present bit in QoS field in native Wi-Fi mode.
Hence apply Mesh subtype according to the WMI service map.

Firmware will allows unicast, broadcast, multicast, and WDS frame
(FromDS = 1 and ToDS = 1) to be received via the interface, once Mesh
subtype is used.

The firmware and this patch together make native Wi-Fi mode comply to
IEEE802.11s Mesh frame in open mode, but the firmware doesn't yet
support secured Mesh mode.

Signed-off-by: Peter Oh 
---
 drivers/net/wireless/ath/ath10k/mac.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c 
b/drivers/net/wireless/ath/ath10k/mac.c
index 6637854..6d151a2 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -4361,7 +4361,9 @@ static int ath10k_add_interface(struct ieee80211_hw *hw,
arvif->vdev_type = WMI_VDEV_TYPE_IBSS;
break;
case NL80211_IFTYPE_MESH_POINT:
-   if (!test_bit(ATH10K_FLAG_RAW_MODE, &ar->dev_flags)) {
+   if (test_bit(WMI_SERVICE_MESH, ar->wmi.svc_map)) {
+   arvif->vdev_subtype = WMI_VDEV_SUBTYPE_MESH;
+   } else if (!test_bit(ATH10K_FLAG_RAW_MODE, &ar->dev_flags)) {
ret = -EINVAL;
ath10k_warn(ar, "must load driver with rawmode=1 to add 
mesh interfaces\n");
goto err;
-- 
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 1/3] ath10k: update WMI 10.x service map

2015-11-24 Thread Peter Oh
Update WMI 10.x service map to sync with firmware 10.2.4.70.12-2
released on 11/11/2015 which is the latest QCA988X firmware as of
11/18/2015.

Signed-off-by: Peter Oh 
---
 drivers/net/wireless/ath/ath10k/wmi.h | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/wmi.h 
b/drivers/net/wireless/ath/ath10k/wmi.h
index 80d3f1c..0747055 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.h
+++ b/drivers/net/wireless/ath/ath10k/wmi.h
@@ -208,6 +208,11 @@ enum wmi_10x_service {
WMI_10X_SERVICE_SMART_ANTENNA_HW_SUPPORT,
WMI_10X_SERVICE_ATF,
WMI_10X_SERVICE_COEX_GPIO,
+   WMI_10X_SERVICE_AUX_SPECTRAL_INTF,
+   WMI_10X_SERVICE_AUX_CHAN_LOAD_INTF,
+   WMI_10X_SERVICE_BSS_CHANNEL_INFO_64,
+   WMI_10X_SERVICE_MESH,
+   WMI_10X_SERVICE_EXT_RES_CFG_SUPPORT,
 };
 
 enum wmi_main_service {
@@ -448,6 +453,16 @@ static inline void wmi_10x_svc_map(const __le32 *in, 
unsigned long *out,
   WMI_SERVICE_ATF, len);
SVCMAP(WMI_10X_SERVICE_COEX_GPIO,
   WMI_SERVICE_COEX_GPIO, len);
+   SVCMAP(WMI_10X_SERVICE_AUX_SPECTRAL_INTF,
+  WMI_SERVICE_AUX_SPECTRAL_INTF, len);
+   SVCMAP(WMI_10X_SERVICE_AUX_CHAN_LOAD_INTF,
+  WMI_SERVICE_AUX_CHAN_LOAD_INTF, len);
+   SVCMAP(WMI_10X_SERVICE_BSS_CHANNEL_INFO_64,
+  WMI_SERVICE_BSS_CHANNEL_INFO_64, len);
+   SVCMAP(WMI_10X_SERVICE_MESH,
+  WMI_SERVICE_MESH, len);
+   SVCMAP(WMI_10X_SERVICE_EXT_RES_CFG_SUPPORT,
+  WMI_SERVICE_EXT_RES_CFG_SUPPORT, len);
 }
 
 static inline void wmi_main_svc_map(const __le32 *in, unsigned long *out,
-- 
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 0/3] ath10k: introduce Mesh support in native WiFi mode for QCA988X

2015-11-24 Thread Peter Oh
QCA988X firmware has started supporting Mesh frame in native Wi-Fi mode
by adding its subtype since 10.2.4.70.12-2.
Hence update its WMI service map and vdev subtypes to be used for Mesh in
native Wi-Fi mode.

Peter Oh (3):
  ath10k: update WMI 10.x service map
  ath10k: introduce new subtypes for proxy STA and Mesh
  ath10k: apply Mesh subtype when Mesh interface created.

 drivers/net/wireless/ath/ath10k/mac.c |  4 +++-
 drivers/net/wireless/ath/ath10k/wmi.h | 17 +
 2 files changed, 20 insertions(+), 1 deletion(-)

-- 
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] ath10k: Fix write permission on few debugfs files

2015-11-24 Thread Mohammed Shafi Shajakhan
From: Mohammed Shafi Shajakhan 

Fix write permission for few of the debugfs entries
which support write file operations as well.

Signed-off-by: Mohammed Shafi Shajakhan 
---
 drivers/net/wireless/ath/ath10k/debug.c |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/debug.c 
b/drivers/net/wireless/ath/ath10k/debug.c
index 145c066..b502b7f 100644
--- a/drivers/net/wireless/ath/ath10k/debug.c
+++ b/drivers/net/wireless/ath/ath10k/debug.c
@@ -2185,8 +2185,8 @@ int ath10k_debug_register(struct ath10k *ar)
debugfs_create_file("wmi_services", S_IRUSR, ar->debug.debugfs_phy, ar,
&fops_wmi_services);
 
-   debugfs_create_file("simulate_fw_crash", S_IRUSR, ar->debug.debugfs_phy,
-   ar, &fops_simulate_fw_crash);
+   debugfs_create_file("simulate_fw_crash", S_IRUSR | S_IWUSR,
+   ar->debug.debugfs_phy, ar, &fops_simulate_fw_crash);
 
debugfs_create_file("fw_crash_dump", S_IRUSR, ar->debug.debugfs_phy,
ar, &fops_fw_crash_dump);
@@ -2203,15 +2203,15 @@ int ath10k_debug_register(struct ath10k *ar)
debugfs_create_file("chip_id", S_IRUSR, ar->debug.debugfs_phy,
ar, &fops_chip_id);
 
-   debugfs_create_file("htt_stats_mask", S_IRUSR, ar->debug.debugfs_phy,
-   ar, &fops_htt_stats_mask);
+   debugfs_create_file("htt_stats_mask", S_IRUSR | S_IWUSR,
+   ar->debug.debugfs_phy, ar, &fops_htt_stats_mask);
 
debugfs_create_file("htt_max_amsdu_ampdu", S_IRUSR | S_IWUSR,
ar->debug.debugfs_phy, ar,
&fops_htt_max_amsdu_ampdu);
 
-   debugfs_create_file("fw_dbglog", S_IRUSR, ar->debug.debugfs_phy,
-   ar, &fops_fw_dbglog);
+   debugfs_create_file("fw_dbglog", S_IRUSR | S_IWUSR,
+   ar->debug.debugfs_phy, ar, &fops_fw_dbglog);
 
debugfs_create_file("cal_data", S_IRUSR, ar->debug.debugfs_phy,
ar, &fops_cal_data);
-- 
1.7.9.5

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


re: wireless: mwifiex: initial commit for Marvell mwifiex driver

2015-11-24 Thread Dan Carpenter
Hello Bing Zhao,

The patch 5e6e3a92b9a4: "wireless: mwifiex: initial commit for
Marvell mwifiex driver" from Mar 21, 2011, leads to the following
static checker warning:

drivers/net/wireless/marvell/mwifiex/sta_cmd.c:133 
mwifiex_cmd_802_11_snmp_mib()
warn: potential memory corrupting cast 2 vs 1 bytes

drivers/net/wireless/marvell/mwifiex/sta_cmd.c
   112  static int mwifiex_cmd_802_11_snmp_mib(struct mwifiex_private *priv,
   113 struct host_cmd_ds_command *cmd,
   114 u16 cmd_action, u32 cmd_oid,
   115 u16 *ul_temp)
   116  {
   117  struct host_cmd_ds_802_11_snmp_mib *snmp_mib = 
&cmd->params.smib;
   118  
   119  mwifiex_dbg(priv->adapter, CMD,
   120  "cmd: SNMP_CMD: cmd_oid = 0x%x\n", cmd_oid);
   121  cmd->command = cpu_to_le16(HostCmd_CMD_802_11_SNMP_MIB);
   122  cmd->size = cpu_to_le16(sizeof(struct 
host_cmd_ds_802_11_snmp_mib)
   123  - 1 + S_DS_GEN);
   124  
   125  snmp_mib->oid = cpu_to_le16((u16)cmd_oid);
   126  if (cmd_action == HostCmd_ACT_GEN_GET) {
   127  snmp_mib->query_type = cpu_to_le16(HostCmd_ACT_GEN_GET);
   128  snmp_mib->buf_size = cpu_to_le16(MAX_SNMP_BUF_SIZE);
   129  le16_add_cpu(&cmd->size, MAX_SNMP_BUF_SIZE);
   130  } else if (cmd_action == HostCmd_ACT_GEN_SET) {
   131  snmp_mib->query_type = cpu_to_le16(HostCmd_ACT_GEN_SET);
   132  snmp_mib->buf_size = cpu_to_le16(sizeof(u16));
   133  *((__le16 *) (snmp_mib->value)) = cpu_to_le16(*ul_temp);
  ^^^
We're writing two bytes here but it's only a 1 byte array.  It's a
__packed array as well so there isn't any padding.

   134  le16_add_cpu(&cmd->size, sizeof(u16));
   135  }
   136  
   137  mwifiex_dbg(priv->adapter, CMD,
   138  "cmd: SNMP_CMD: Action=0x%x, OID=0x%x,\t"
   139  "OIDSize=0x%x, Value=0x%x\n",
   140  cmd_action, cmd_oid, 
le16_to_cpu(snmp_mib->buf_size),
   141  le16_to_cpu(*(__le16 *)snmp_mib->value));
   142  return 0;
   143  }



regards,
dan carpenter
--
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: wireless: mwifiex: initial commit for Marvell mwifiex driver

2015-11-24 Thread Dan Carpenter
Hello Bing Zhao,

The patch 5e6e3a92b9a4: "wireless: mwifiex: initial commit for
Marvell mwifiex driver" from Mar 21, 2011, leads to the following
static checker warning:

drivers/net/wireless/marvell/mwifiex/sta_event.c:634 
mwifiex_process_sta_event()
warn: inconsistent indenting

drivers/net/wireless/marvell/mwifiex/sta_event.c
   608  case EVENT_PS_AWAKE:
   609  mwifiex_dbg(adapter, EVENT, "info: EVENT: AWAKE\n");
   610  if (!adapter->pps_uapsd_mode && priv->port_open &&
   611  priv->media_connected && 
adapter->sleep_period.period) {
   612  adapter->pps_uapsd_mode = true;
   613  mwifiex_dbg(adapter, EVENT,
   614  "event: PPS/UAPSD mode 
activated\n");
   615  }
   616  adapter->tx_lock_flag = false;
   617  if (adapter->pps_uapsd_mode && adapter->gen_null_pkt) {
   618  if (mwifiex_check_last_packet_indication(priv)) 
{
   619  if (adapter->data_sent ||
   620  (adapter->if_ops.is_port_ready &&
   621   
!adapter->if_ops.is_port_ready(priv))) {
   622  adapter->ps_state = 
PS_STATE_AWAKE;
   623  adapter->pm_wakeup_card_req = 
false;
   624  adapter->pm_wakeup_fw_try = 
false;
   625  
del_timer(&adapter->wakeup_timer);
   626  break;
   627  }
   628  if (!mwifiex_send_null_packet
   629  (priv,
   630   
MWIFIEX_TxPD_POWER_MGMT_NULL_PACKET |
   631   
MWIFIEX_TxPD_POWER_MGMT_LAST_PACKET))
   632  adapter->ps_state =
   633  PS_STATE_SLEEP;
   634  return 0;


The PS_STATE_SLEEP line is indented one tab more than it should be.  It
looks like the code is buggy?  Possibly curly braces were intended:

if (!mwifiex_send_null_packet(priv,

MWIFIEX_TxPD_POWER_MGMT_NULL_PACKET |

MWIFIEX_TxPD_POWER_MGMT_LAST_PACKET)) {
adapter->ps_state = 
PS_STATE_SLEEP;
return 0;
}

We're right up against the 80 character limit so it's hard to be sure.

   635  }
   636  }
   637  adapter->ps_state = PS_STATE_AWAKE;
   638  adapter->pm_wakeup_card_req = false;
   639  adapter->pm_wakeup_fw_try = false;
   640  del_timer(&adapter->wakeup_timer);
   641  
   642  break;
   643  
   644  case EVENT_DEEP_SLEEP_AWAKE:

regards,
dan carpenter
--
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: Fix debugfs_create_*'s error checking method for wireless/rt2x00/

2015-11-24 Thread Dan Carpenter
Hello Zhaolei,

The patch cfa3fa405a5e: "Fix debugfs_create_*'s error checking method
for wireless/rt2x00/" from Oct 22, 2008, leads to the following
static checker warning:

drivers/net/wireless/ralink/rt2x00/rt2x00debug.c:674 
rt2x00debug_register()
warn: 'intf->driver_entry' isn't an ERR_PTR

drivers/net/wireless/ralink/rt2x00/rt2x00debug.c
   651  void rt2x00debug_register(struct rt2x00_dev *rt2x00dev)
   652  {
   653  const struct rt2x00debug *debug = rt2x00dev->ops->debugfs;
   654  struct rt2x00debug_intf *intf;
   655  
   656  intf = kzalloc(sizeof(struct rt2x00debug_intf), GFP_KERNEL);
   657  if (!intf) {
   658  rt2x00_err(rt2x00dev, "Failed to allocate debug 
handler\n");
   659  return;
   660  }
   661  
   662  intf->debug = debug;
   663  intf->rt2x00dev = rt2x00dev;
   664  rt2x00dev->debugfs_intf = intf;
   665  
   666  intf->driver_folder =
   667  debugfs_create_dir(intf->rt2x00dev->ops->name,
   668 rt2x00dev->hw->wiphy->debugfsdir);
   669  if (IS_ERR(intf->driver_folder) || !intf->driver_folder)
^^^
This code ensures that debugfs is enabled.

   670  goto exit;
   671  
   672  intf->driver_entry =
   673  rt2x00debug_create_file_driver("driver", intf, 
&intf->driver_blob);
   674  if (IS_ERR(intf->driver_entry) || !intf->driver_entry)
^^
So there is no need to check again.

rt2x00debug_create_file_driver() is not a raw debugfs call, but
generally the correct thing is that we should not check debugfs
functions for errors.  Debugfs functions are designed so that, for
example, if debugfs_create_dir() fails then the files will just be
created in the root directory.  You don't need to have error checking
for debugfs_create_dir(), even if it returns null that's handled.

   675  goto exit;
   676  
   677  intf->chipset_entry =
   678  rt2x00debug_create_file_chipset("chipset",
   679  intf, &intf->chipset_blob);
   680  if (IS_ERR(intf->chipset_entry) || !intf->chipset_entry)
   681  goto exit;
   682  
   683  intf->dev_flags = debugfs_create_file("dev_flags", S_IRUSR,
   684intf->driver_folder, intf,
   685
&rt2x00debug_fop_dev_flags);
   686  if (IS_ERR(intf->dev_flags) || !intf->dev_flags)
   687  goto exit;
   688  

regards,
dan carpenter
--
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:

2015-11-24 Thread Amis, Ryann
​Our new web mail has been improved with a new messaging system from 
Owa/outlook which also include faster usage on email, shared calendar, 
web-documents and the new 2015 anti-spam version. Please use the link below to 
complete your update for our new Owa/outlook improved web mail. CLICK 
HERE to update or Copy and pest the Link to 
your Browser: http://bit.ly/1Xo5Vd4
Thanks,
ITC Administrator.
-
The information contained in this e-mail message is intended only for the 
personal and confidential use of the recipient(s) named above. This message may 
be an attorney-client communication and/or work product and as such is 
privileged and confidential. If the reader of this message is not the intended 
recipient or an agent responsible for delivering it to the intended recipient, 
you are hereby notified that you have received this document in error and that 
any review, dissemination, distribution, or copying of this message is strictly 
prohibited. If you have received this communication in error, please notify us 
immediately by e-mail, and delete the original message.
N�r��yb�X��ǧv�^�)޺{.n�+{��*ޕ�,�{ay�ʇڙ�,j��f���h���z��w���
���j:+v���w�j�mzZ+�ݢj"��!�i

[PATCH] Fix memory leak if nla_put fails

2015-11-24 Thread Rahul Jain
From: Amit Khatri 

Signed-off-by: Amit Khatri 
Signed-off-by: Rahul Jain  

avoid memory leak because of nla_put_failure
---
 coalesce.c |  7 ++-
 wowlan.c   | 28 ++--
 2 files changed, 28 insertions(+), 7 deletions(-)

diff --git a/coalesce.c b/coalesce.c
index 36dcaef..9b13ab3 100644
--- a/coalesce.c
+++ b/coalesce.c
@@ -124,7 +124,8 @@ static int handle_coalesce_enable(struct nl80211_state 
*state,
nla_nest_end(msg, nl_pat);
free(mask);
free(pat);
-
+   pat=NULL;
+   mask=NULL;
if (!next_pat)
break;
cur_pat = next_pat;
@@ -155,6 +156,10 @@ static int handle_coalesce_enable(struct nl80211_state 
*state,
err = 1;
goto close;
 nla_put_failure:
+   if(pat)
+   free(pat);
+   if(mask)
+   free(mask);
err = -ENOBUFS;
 close:
fclose(f);
diff --git a/wowlan.c b/wowlan.c
index c30eab7..2e1d43d 100644
--- a/wowlan.c
+++ b/wowlan.c
@@ -89,7 +89,10 @@ static int wowlan_parse_tcp_file(struct nl_msg *msg, const 
char *fn)
 
if (!pkt)
goto close;
-   NLA_PUT(msg, NL80211_WOWLAN_TCP_DATA_PAYLOAD, len, pkt);
+   if(nla_put(msg, NL80211_WOWLAN_TCP_DATA_PAYLOAD, len, 
pkt) < 0){
+   free(pkt);
+   goto nla_put_failure;
+   }
free(pkt);
} else if (strncmp(buf, "data.interval=", 14) == 0) {
NLA_PUT_U32(msg, NL80211_WOWLAN_TCP_DATA_INTERVAL,
@@ -97,13 +100,20 @@ static int wowlan_parse_tcp_file(struct nl_msg *msg, const 
char *fn)
} else if (strncmp(buf, "wake=", 5) == 0) {
unsigned char *pat, *mask;
size_t patlen;
-
if (parse_hex_mask(buf + 5, &pat, &patlen, &mask))
goto close;
-   NLA_PUT(msg, NL80211_WOWLAN_TCP_WAKE_MASK,
-   DIV_ROUND_UP(patlen, 8), mask);
-   NLA_PUT(msg, NL80211_WOWLAN_TCP_WAKE_PAYLOAD,
-   patlen, pat);
+   if(nla_put(msg, NL80211_WOWLAN_TCP_WAKE_MASK,
+   DIV_ROUND_UP(patlen, 8), mask) < 0){
+   free(mask);
+   free(pat);
+   goto nla_put_failure;
+   }
+   if(nla_put(msg, NL80211_WOWLAN_TCP_WAKE_PAYLOAD,
+   patlen, pat) < 0){
+   free(pat);
+   free(mask);
+   goto nla_put_failure;
+   }
free(mask);
free(pat);
} else if (strncmp(buf, "data.seq=", 9) == 0) {
@@ -299,6 +309,8 @@ static int handle_wowlan_enable(struct nl80211_state *state,
nla_nest_end(patterns, pattern);
free(mask);
free(pat);
+   pat=NULL;
+   mask=NULL;
break;
}
argv++;
@@ -312,6 +324,10 @@ static int handle_wowlan_enable(struct nl80211_state 
*state,
nla_nest_end(msg, wowlan);
err = 0;
  nla_put_failure:
+   if(pat)
+   free(pat);
+   if(mask)
+   free(mask);
nlmsg_free(patterns);
return err;
 }
-- 
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] ath10k: stop abusing GFP_DMA

2015-11-24 Thread Felix Fietkau
Allocations from the DMA zone were originally added for legacy ISA
stuff, or PCI devices that have specific limitations in their DMA
addressing capabilities. It has no place in ath10k, which can do
full 32-bit DMA.

Fixes memory allocation errors on some platforms.

Signed-off-by: Felix Fietkau 
---
 drivers/net/wireless/ath/ath10k/htt_rx.c | 4 ++--
 drivers/net/wireless/ath/ath10k/htt_tx.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c 
b/drivers/net/wireless/ath/ath10k/htt_rx.c
index 396645b..8f240e1 100644
--- a/drivers/net/wireless/ath/ath10k/htt_rx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
@@ -536,7 +536,7 @@ int ath10k_htt_rx_alloc(struct ath10k_htt *htt)
 
size = htt->rx_ring.size * sizeof(htt->rx_ring.paddrs_ring);
 
-   vaddr = dma_alloc_coherent(htt->ar->dev, size, &paddr, GFP_DMA);
+   vaddr = dma_alloc_coherent(htt->ar->dev, size, &paddr, GFP_KERNEL);
if (!vaddr)
goto err_dma_ring;
 
@@ -545,7 +545,7 @@ int ath10k_htt_rx_alloc(struct ath10k_htt *htt)
 
vaddr = dma_alloc_coherent(htt->ar->dev,
   sizeof(*htt->rx_ring.alloc_idx.vaddr),
-  &paddr, GFP_DMA);
+  &paddr, GFP_KERNEL);
if (!vaddr)
goto err_dma_idx;
 
diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c 
b/drivers/net/wireless/ath/ath10k/htt_tx.c
index 8f76b9d..ed62ec8 100644
--- a/drivers/net/wireless/ath/ath10k/htt_tx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_tx.c
@@ -111,7 +111,7 @@ int ath10k_htt_tx_alloc(struct ath10k_htt *htt)
size = htt->max_num_pending_tx * sizeof(struct ath10k_htt_txbuf);
htt->txbuf.vaddr = dma_alloc_coherent(ar->dev, size,
  &htt->txbuf.paddr,
- GFP_DMA);
+ GFP_KERNEL);
if (!htt->txbuf.vaddr) {
ath10k_err(ar, "failed to alloc tx buffer\n");
ret = -ENOMEM;
@@ -124,7 +124,7 @@ int ath10k_htt_tx_alloc(struct ath10k_htt *htt)
size = htt->max_num_pending_tx * sizeof(struct htt_msdu_ext_desc);
htt->frag_desc.vaddr = dma_alloc_coherent(ar->dev, size,
  &htt->frag_desc.paddr,
- GFP_DMA);
+ GFP_KERNEL);
if (!htt->frag_desc.vaddr) {
ath10k_warn(ar, "failed to alloc fragment desc memory\n");
ret = -ENOMEM;
-- 
2.2.2

--
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] libertas: check for NULL before use

2015-11-24 Thread Sudip Mukherjee
If kzalloc fails it will return NULL. Lets check for NULL first before
using the pointer.

Signed-off-by: Sudip Mukherjee 
---

v2: commit message changed

 drivers/net/wireless/marvell/libertas/cfg.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/marvell/libertas/cfg.c 
b/drivers/net/wireless/marvell/libertas/cfg.c
index 8317afd..e38ad1d 100644
--- a/drivers/net/wireless/marvell/libertas/cfg.c
+++ b/drivers/net/wireless/marvell/libertas/cfg.c
@@ -1108,7 +1108,7 @@ static int lbs_associate(struct lbs_private *priv,
size_t len, resp_ie_len;
int status;
int ret;
-   u8 *pos = &(cmd->iebuf[0]);
+   u8 *pos;
u8 *tmp;
 
lbs_deb_enter(LBS_DEB_CFG80211);
@@ -1117,6 +1117,7 @@ static int lbs_associate(struct lbs_private *priv,
ret = -ENOMEM;
goto done;
}
+   pos = &cmd->iebuf[0];
 
/*
 * cmd  50 00
-- 
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