Re: [PATCH] dt: bindings: add bindings for ipq4019 wifi block

2015-12-30 Thread Raja Mani


On Wednesday 30 December 2015 10:05 PM, Rob Herring wrote:

On Wed, Dec 23, 2015 at 11:05:15AM +0530, Raja Mani wrote:

Add device tree binding documentation details for wifi block present
in Qualcomm IPQ4019 SoC into qcom,ath10k.txt.

Signed-off-by: Raja Mani 
---
  .../bindings/net/wireless/qcom,ath10k.txt  | 87 --
  1 file changed, 82 insertions(+), 5 deletions(-)

diff --git a/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt 
b/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
index edefc26..ffd0742 100644
--- a/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
+++ b/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
@@ -1,17 +1,42 @@
  * Qualcomm Atheros ath10k wireless devices

-For ath10k devices the calibration data can be provided through Device
-Tree. The node is a child node of the PCI controller.


So it is now not a PCI device?


Right now, ath10k wireless driver has support for PCI devices. There is
a plan to extend ath10k driver to support wifi devices which are 
connected over AHB as well (enumeration will happen via device tree node).


Qualcomm IPQ4019 SoC has two inbuilt wifi block which are connected over 
AHB bus (not connected over PCI bus) and also has one external PCI

slot where we can connect standalone wifi PCI devices.

In future, ath10k would support both PCI and AHB. For PCI based
devices, only calibration data is supplied via device tree. For AHB
based devices (ie, ipq4019), all wifi properties are supplied
via device tree (including irq, reg addr, cal data,etc).




-
  Required properties:
--compatible : Should be "qcom,ath10k"
+- compatible: Should be one of the following:
+   * "qcom,ath10k"
+   * "qcom,ipq4019-wifi"


One is a standalone PCI device and one is embedded block in an SOC?


Yes, it's possible to have this combination (one in SoC + one in
standalone PCI device in the same platform).


These should be more separated as all these new properties would only
apply in the latter case.


Sorry, i didn't get this point. I mentioned it under optional
properties. Whichever properties applies to particular wifi, only
those parameters are needed. For example, for PCI based devices,
only calibration data is needed, for AHB based devices most the
properties are needed.

Is it fine if add below text some thing like this ?

"only "qcom,ath10k-calibration-data" is applicable for PCI based
devices, rest of the members are applicable only for AHB based
devices"

Correct me if i am wrong.





  Optional properties:
+- reg: Address and length of the register set for the device.
+- core-id: Core number associated to the device.


This needs a better explanation.


Sure, Let me add below text in next version.

"core-id is numeric number associated to the wifi block.
 For example, 0 means first block, 1 means second wifi block,etc."




+- resets: Must contain an entry for each entry in reset-names.
+  See ../reset/reseti.txt for details.
+- reset-names: Must include the list of following reset names,
+  "wifi_cpu_init"
+  "wifi_radio_srif"
+  "wifi_radio_warm"
+  "wifi_radio_cold"
+  "wifi_core_warm"
+  "wifi_core_cold"
+- clocks: List of clock specifiers, must contain an entry for each required
+  entry in clock-names.
+- clock-names: Should contain the clock names "wifi_wcss_cmd", "wifi_wcss_ref",
+   "wifi_wcss_rtc".
+- interrupts: List of interrupt lines. Must contain an entry
+ for each entry in the interrupt-names property.
+- interrupt-names: Must include the entries for MSI interrupt
+  names ("msi0" to "msi15") and legacy interrupt
+  name ("legacy"),
+- qca,msi_addr: MSI interrupt address.
+- qca,msi_base: Base value to add before writing MSI data into
+   MSI address register.


Why don't the standard MSI properties work?


Standard msi controller mapping is not needed. Basically, msi property 
defined above just goes to the firmware runs in wifi block. Meaning, 
Driver will read it and push it to firmware. That's all.





  - qcom,ath10k-calibration-data : calibration data as an array, the
 length can vary between hw versions
+- status: Either "disabled" or "ok".
+


No need to document status here.


Sure, will remove it in next version.



Rob



Thanks for the review.

--
Raja
--
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] mwifiex: correctly handling kzalloc

2015-12-30 Thread Insu Yun
Since kzalloc can be failed in memory pressure,
it needs to be handled, otherwise NULL dereference could be happened

Signed-off-by: Insu Yun 
---
 drivers/net/wireless/mwifiex/sdio.c | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/drivers/net/wireless/mwifiex/sdio.c 
b/drivers/net/wireless/mwifiex/sdio.c
index 78a8474..a8af72d 100644
--- a/drivers/net/wireless/mwifiex/sdio.c
+++ b/drivers/net/wireless/mwifiex/sdio.c
@@ -2053,8 +2053,19 @@ static int mwifiex_init_sdio(struct mwifiex_adapter 
*adapter)
/* Allocate skb pointer buffers */
card->mpa_rx.skb_arr = kzalloc((sizeof(void *)) *
   card->mp_agg_pkt_limit, GFP_KERNEL);
+   if (!card->mpa_rx.skb_arr) {
+   kfree(card->mp_regs);
+   return -ENOMEM;
+   }
+
card->mpa_rx.len_arr = kzalloc(sizeof(*card->mpa_rx.len_arr) *
   card->mp_agg_pkt_limit, GFP_KERNEL);
+   if (!card->mpa_rx.len_arr) {
+   kfree(card->mp_regs);
+   kfree(card->mpa_rx.skb_arr);
+   return -ENOMEM;
+   }
+
ret = mwifiex_alloc_sdio_mpa_buffers(adapter,
 card->mp_tx_agg_buf_size,
 card->mp_rx_agg_buf_size);
-- 
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] dt: bindings: add bindings for ipq4019 wifi block

2015-12-30 Thread Rob Herring
On Wed, Dec 23, 2015 at 11:05:15AM +0530, Raja Mani wrote:
> Add device tree binding documentation details for wifi block present
> in Qualcomm IPQ4019 SoC into qcom,ath10k.txt.
> 
> Signed-off-by: Raja Mani 
> ---
>  .../bindings/net/wireless/qcom,ath10k.txt  | 87 
> --
>  1 file changed, 82 insertions(+), 5 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt 
> b/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
> index edefc26..ffd0742 100644
> --- a/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
> +++ b/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
> @@ -1,17 +1,42 @@
>  * Qualcomm Atheros ath10k wireless devices
>  
> -For ath10k devices the calibration data can be provided through Device
> -Tree. The node is a child node of the PCI controller.

So it is now not a PCI device?

> -
>  Required properties:
> --compatible : Should be "qcom,ath10k"
> +- compatible: Should be one of the following:
> + * "qcom,ath10k"
> + * "qcom,ipq4019-wifi"

One is a standalone PCI device and one is embedded block in an SOC? 
These should be more separated as all these new properties would only 
apply in the latter case.

>  
>  Optional properties:
> +- reg: Address and length of the register set for the device.
> +- core-id: Core number associated to the device.

This needs a better explanation.

> +- resets: Must contain an entry for each entry in reset-names.
> +  See ../reset/reseti.txt for details.
> +- reset-names: Must include the list of following reset names,
> +"wifi_cpu_init"
> +"wifi_radio_srif"
> +"wifi_radio_warm"
> +"wifi_radio_cold"
> +"wifi_core_warm"
> +"wifi_core_cold"
> +- clocks: List of clock specifiers, must contain an entry for each required
> +  entry in clock-names.
> +- clock-names: Should contain the clock names "wifi_wcss_cmd", 
> "wifi_wcss_ref",
> +   "wifi_wcss_rtc".
> +- interrupts: List of interrupt lines. Must contain an entry
> +   for each entry in the interrupt-names property.
> +- interrupt-names: Must include the entries for MSI interrupt
> +names ("msi0" to "msi15") and legacy interrupt
> +name ("legacy"),
> +- qca,msi_addr: MSI interrupt address.
> +- qca,msi_base: Base value to add before writing MSI data into
> + MSI address register.

Why don't the standard MSI properties work?

>  - qcom,ath10k-calibration-data : calibration data as an array, the
>length can vary between hw versions
> +- status: Either "disabled" or "ok".
> +

No need to document status here.

Rob
--
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] mac80211: Make addr const in SET_IEEE80211_PERM_ADDR()

2015-12-30 Thread Bjorn Andersson
On Wed, Dec 30, 2015 at 8:47 AM, Souptick Joarder  wrote:
>
> HI Bjorn,
>
> On Thu, Dec 24, 2015 at 2:03 PM, Bjorn Andersson  wrote:
> > Make the addr parameter const in SET_IEEE80211_PERM_ADDR() to save
> > clients from having to cast away a const qualifier.
> >
> > Signed-off-by: Bjorn Andersson 
> > ---
> >  include/net/mac80211.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/include/net/mac80211.h b/include/net/mac80211.h
> > index 7c30faff245f..a6f3c9c4b7c2 100644
> > --- a/include/net/mac80211.h
> > +++ b/include/net/mac80211.h
> > @@ -2167,7 +2167,7 @@ static inline void SET_IEEE80211_DEV(struct 
> > ieee80211_hw *hw, struct device *dev
> >   * @hw: the  ieee80211_hw to set the MAC address for
> >   * @addr: the address to set
> >   */
> > -static inline void SET_IEEE80211_PERM_ADDR(struct ieee80211_hw *hw, u8 
> > *addr)
> > +static inline void SET_IEEE80211_PERM_ADDR(struct ieee80211_hw *hw, const 
> > u8 *addr)
>
> I guess without const or with const doesn't make much difference here.
> Correct me if I am wrong.

For most cases it doesn't make any difference, but in my driver I
acquire the mac address as a const u8 *. Therefor I need to cast away
the const part when calling this API.

There's an existing example of this in
drivers/net/wireless/st/cw1200/main.c line 601.


I think it's safe to assume that this API won't ever modify the passed
addr buffer, so there would be no future issues of marking the
parameter const either.

>
> >  {
> > memcpy(hw->wiphy->perm_addr, addr, ETH_ALEN);
> >  }
>

Regards,
Bjorn
--
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] mac80211: Make addr const in SET_IEEE80211_PERM_ADDR()

2015-12-30 Thread Souptick Joarder
On Wed, Dec 30, 2015 at 10:35 PM, Bjorn Andersson  wrote:
> On Wed, Dec 30, 2015 at 8:47 AM, Souptick Joarder  
> wrote:
>>
>> HI Bjorn,
>>
>> On Thu, Dec 24, 2015 at 2:03 PM, Bjorn Andersson  wrote:
>> > Make the addr parameter const in SET_IEEE80211_PERM_ADDR() to save
>> > clients from having to cast away a const qualifier.
>> >
>> > Signed-off-by: Bjorn Andersson 
>> > ---
>> >  include/net/mac80211.h | 2 +-
>> >  1 file changed, 1 insertion(+), 1 deletion(-)
>> >
>> > diff --git a/include/net/mac80211.h b/include/net/mac80211.h
>> > index 7c30faff245f..a6f3c9c4b7c2 100644
>> > --- a/include/net/mac80211.h
>> > +++ b/include/net/mac80211.h
>> > @@ -2167,7 +2167,7 @@ static inline void SET_IEEE80211_DEV(struct 
>> > ieee80211_hw *hw, struct device *dev
>> >   * @hw: the  ieee80211_hw to set the MAC address for
>> >   * @addr: the address to set
>> >   */
>> > -static inline void SET_IEEE80211_PERM_ADDR(struct ieee80211_hw *hw, u8 
>> > *addr)
>> > +static inline void SET_IEEE80211_PERM_ADDR(struct ieee80211_hw *hw, const 
>> > u8 *addr)
>>
>> I guess without const or with const doesn't make much difference here.
>> Correct me if I am wrong.
>
> For most cases it doesn't make any difference, but in my driver I
> acquire the mac address as a const u8 *. Therefor I need to cast away
> the const part when calling this API.
>
> There's an existing example of this in
> drivers/net/wireless/st/cw1200/main.c line 601.

Is the path correct ? I think path is
drivers/net/wireless/cw1200/main.c line 334

> I think it's safe to assume that this API won't ever modify the passed
> addr buffer, so there would be no future issues of marking the
> parameter const either.

I agree with you.

>
>>
>> >  {
>> > memcpy(hw->wiphy->perm_addr, addr, ETH_ALEN);
>> >  }
>>
>
> Regards,
> Bjorn

-Souptick
--
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 2/3] wlcore/wl12xx: spi: add device tree support

2015-12-30 Thread Rob Herring
On Wed, Dec 23, 2015 at 10:35:43AM +0200, Uri Mashiach wrote:
> Add DT support for the wl1271 SPI WiFi.
> 
> Add documentation file for the wl1271 SPI WiFi.
> 
> Signed-off-by: Uri Mashiach 
> Acked-by: Igor Grinberg 
> ---
>  .../bindings/net/wireless/ti,wlcore,spi.txt| 35 +++

For the binding:

Acked-by: Rob Herring 
--
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] mac80211: Make addr const in SET_IEEE80211_PERM_ADDR()

2015-12-30 Thread Souptick Joarder
HI Bjorn,

On Thu, Dec 24, 2015 at 2:03 PM, Bjorn Andersson  wrote:
> Make the addr parameter const in SET_IEEE80211_PERM_ADDR() to save
> clients from having to cast away a const qualifier.
>
> Signed-off-by: Bjorn Andersson 
> ---
>  include/net/mac80211.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/net/mac80211.h b/include/net/mac80211.h
> index 7c30faff245f..a6f3c9c4b7c2 100644
> --- a/include/net/mac80211.h
> +++ b/include/net/mac80211.h
> @@ -2167,7 +2167,7 @@ static inline void SET_IEEE80211_DEV(struct 
> ieee80211_hw *hw, struct device *dev
>   * @hw: the  ieee80211_hw to set the MAC address for
>   * @addr: the address to set
>   */
> -static inline void SET_IEEE80211_PERM_ADDR(struct ieee80211_hw *hw, u8 *addr)
> +static inline void SET_IEEE80211_PERM_ADDR(struct ieee80211_hw *hw, const u8 
> *addr)

I guess without const or with const doesn't make much difference here.
Correct me if I am wrong.
>  {
> memcpy(hw->wiphy->perm_addr, addr, ETH_ALEN);
>  }
> --
> 2.5.0
>
> --
> 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

-Souptick
--
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 RESEND] iwlwifi:Fix error handling in the function iwl_pcie_enqueue_hcmd

2015-12-30 Thread Grumbach, Emmanuel
Hi,


On 12/30/2015 07:15 PM, Nicholas Krause wrote:
> This fixes error handling in the function iwl_pcie_enqueue_hcmd
> by checking if all calls to the function wl_pcie_txq_build_tfd
> have failed by returning a error code and if so jump to the goto
> label out from the cleaning up of acquired resources before


For sure you haven't ran your code otherwise you would have noticed it
break pretty much everything.
Moreover this patch is not based on my -next tree.
Simple rebasing won't fix the obvious issues in your patch though.

> Signed-off-by: Nicholas Krause 
> ---
>  drivers/net/wireless/iwlwifi/pcie/tx.c | 27 +--
>  1 file changed, 17 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/net/wireless/iwlwifi/pcie/tx.c 
> b/drivers/net/wireless/iwlwifi/pcie/tx.c
> index 2b86c21..49c8c77 100644
> --- a/drivers/net/wireless/iwlwifi/pcie/tx.c
> +++ b/drivers/net/wireless/iwlwifi/pcie/tx.c
> @@ -1472,9 +1472,11 @@ static int iwl_pcie_enqueue_hcmd(struct iwl_trans 
> *trans,
>   /* start the TFD with the scratchbuf */
>   scratch_size = min_t(int, copy_size, IWL_HCMD_SCRATCHBUF_SIZE);
>   memcpy(>scratchbufs[q->write_ptr], _cmd->hdr, scratch_size);
> - iwl_pcie_txq_build_tfd(trans, txq,
> -iwl_pcie_get_scratchbuf_dma(txq, q->write_ptr),
> -scratch_size, true);
> + idx = iwl_pcie_txq_build_tfd(trans, txq,
> +  iwl_pcie_get_scratchbuf_dma(txq, 
> q->write_ptr),
> +  scratch_size, true);
> + if (idx)
> + goto out;
>  
>   /* map first command fragment, if any remains */
>   if (copy_size > scratch_size) {
> @@ -1489,8 +1491,9 @@ static int iwl_pcie_enqueue_hcmd(struct iwl_trans 
> *trans,
>   goto out;
>   }
>  
> - iwl_pcie_txq_build_tfd(trans, txq, phys_addr,
> -copy_size - scratch_size, false);
> + idx = iwl_pcie_txq_build_tfd(trans, txq, phys_addr, copy_size - 
> scratch_size, false);
> + if (idx)
> + goto out;
>   }
>  
>   /* map the remaining (adjusted) nocopy/dup fragments */
> @@ -1513,7 +1516,9 @@ static int iwl_pcie_enqueue_hcmd(struct iwl_trans 
> *trans,
>   goto out;
>   }
>  
> - iwl_pcie_txq_build_tfd(trans, txq, phys_addr, cmdlen[i], false);
> + idx = iwl_pcie_txq_build_tfd(trans, txq, phys_addr, cmdlen[i], 
> false);
> + if (idx)
> + goto out;
>   }
>  
>   out_meta->flags = cmd->flags;
> @@ -1830,8 +1835,8 @@ int iwl_trans_pcie_tx(struct iwl_trans *trans, struct 
> sk_buff *skb,
>   /* The first TB points to the scratchbuf data - min_copy bytes */
>   memcpy(>scratchbufs[q->write_ptr], _cmd->hdr,
>  IWL_HCMD_SCRATCHBUF_SIZE);
> - iwl_pcie_txq_build_tfd(trans, txq, tb0_phys,
> -IWL_HCMD_SCRATCHBUF_SIZE, true);
> + if (iwl_pcie_txq_build_tfd(trans, txq, tb0_phys, 
> IWL_HCMD_SCRATCHBUF_SIZE, true))
> + goto out_err;
>  
>   /* there must be data left over for TB1 or this code must be changed */
>   BUILD_BUG_ON(sizeof(struct iwl_tx_cmd) < IWL_HCMD_SCRATCHBUF_SIZE);
> @@ -1841,7 +1846,8 @@ int iwl_trans_pcie_tx(struct iwl_trans *trans, struct 
> sk_buff *skb,
>   tb1_phys = dma_map_single(trans->dev, tb1_addr, tb1_len, DMA_TO_DEVICE);
>   if (unlikely(dma_mapping_error(trans->dev, tb1_phys)))
>   goto out_err;
> - iwl_pcie_txq_build_tfd(trans, txq, tb1_phys, tb1_len, false);
> + if (iwl_pcie_txq_build_tfd(trans, txq, tb1_phys, tb1_len, false))
> + goto out_err;
>  
>   /*
>* Set up TFD's third entry to point directly to remainder
> @@ -1857,7 +1863,8 @@ int iwl_trans_pcie_tx(struct iwl_trans *trans, struct 
> sk_buff *skb,
>  >tfds[q->write_ptr]);
>   goto out_err;
>   }
> - iwl_pcie_txq_build_tfd(trans, txq, tb2_phys, tb2_len, false);
> + if (iwl_pcie_txq_build_tfd(trans, txq, tb2_phys, tb2_len, 
> false))
> + goto out_err;
>   }
>  
>   /* Set up entry for this TFD in Tx byte-count array */

--
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: fix always return 0 error

2015-12-30 Thread Souptick Joarder
HI Glen,

On Thu, Dec 24, 2015 at 11:32 AM, Glen Lee  wrote:
> This patch fixes a bug that return always 0 so it fails every time.
>
> Fixes: c1af9db78950 ("staging: wilc1000: call linux_sdio_init instead of 
> io_init")
> Signed-off-by: Glen Lee 
> ---
> Changes in v2: separate v1 patch into two patches.
> ---
>  drivers/staging/wilc1000/wilc_sdio.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/drivers/staging/wilc1000/wilc_sdio.c 
> b/drivers/staging/wilc1000/wilc_sdio.c
> index e961b50..464d27d 100644
> --- a/drivers/staging/wilc1000/wilc_sdio.c
> +++ b/drivers/staging/wilc1000/wilc_sdio.c
> @@ -614,8 +614,6 @@ static int sdio_init(struct wilc *wilc)
> if (!wilc_sdio_init()) {
> dev_err(>dev, "Failed io init bus...\n");
> return 0;
> -   } else {
> -   return 0;
> }

I think it's better to handle the error case properly when
wilc_sdio_init() call fails.

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

-Souptick
--
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] mac80211: Make addr const in SET_IEEE80211_PERM_ADDR()

2015-12-30 Thread Bjorn Andersson
On Wed, Dec 30, 2015 at 10:30 AM, Souptick Joarder  wrote:
> On Wed, Dec 30, 2015 at 10:35 PM, Bjorn Andersson  wrote:
>> On Wed, Dec 30, 2015 at 8:47 AM, Souptick Joarder  
>> wrote:
>>>
>>> HI Bjorn,
>>>
>>> On Thu, Dec 24, 2015 at 2:03 PM, Bjorn Andersson  wrote:
>>> > Make the addr parameter const in SET_IEEE80211_PERM_ADDR() to save
>>> > clients from having to cast away a const qualifier.
>>> >
>>> > Signed-off-by: Bjorn Andersson 
>>> > ---
>>> >  include/net/mac80211.h | 2 +-
>>> >  1 file changed, 1 insertion(+), 1 deletion(-)
>>> >
>>> > diff --git a/include/net/mac80211.h b/include/net/mac80211.h
>>> > index 7c30faff245f..a6f3c9c4b7c2 100644
>>> > --- a/include/net/mac80211.h
>>> > +++ b/include/net/mac80211.h
>>> > @@ -2167,7 +2167,7 @@ static inline void SET_IEEE80211_DEV(struct 
>>> > ieee80211_hw *hw, struct device *dev
>>> >   * @hw: the  ieee80211_hw to set the MAC address for
>>> >   * @addr: the address to set
>>> >   */
>>> > -static inline void SET_IEEE80211_PERM_ADDR(struct ieee80211_hw *hw, u8 
>>> > *addr)
>>> > +static inline void SET_IEEE80211_PERM_ADDR(struct ieee80211_hw *hw, 
>>> > const u8 *addr)
>>>
>>> I guess without const or with const doesn't make much difference here.
>>> Correct me if I am wrong.
>>
>> For most cases it doesn't make any difference, but in my driver I
>> acquire the mac address as a const u8 *. Therefor I need to cast away
>> the const part when calling this API.
>>
>> There's an existing example of this in
>> drivers/net/wireless/st/cw1200/main.c line 601.
>
> Is the path correct ? I think path is
> drivers/net/wireless/cw1200/main.c line 334
>

It's apparently being relocated in linux-next, and I'm not sure where
I got that line number from. But that's the example I tried to refer
to ;)

Sorry about that.

Regards,
Bjorn

>> I think it's safe to assume that this API won't ever modify the passed
>> addr buffer, so there would be no future issues of marking the
>> parameter const either.
>
> I agree with you.
>
>>
>>>
>>> >  {
>>> > memcpy(hw->wiphy->perm_addr, addr, ETH_ALEN);
>>> >  }
>>>
>>
>> Regards,
>> Bjorn
>
> -Souptick
--
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] wlcore/wl12xx: spi: fix NULL pointer dereference (Oops)

2015-12-30 Thread Uri Mashiach

Hello Kalle Valo,

On 12/30/2015 05:15 PM, Kalle Valo wrote:

Uri Mashiach  writes:


Fix the below Oops when trying to modprobe wlcore_spi.
The oops occurs because the wl1271_power_{off,on}()
function doesn't check the power() function pointer.

[   23.401447] Unable to handle kernel NULL pointer dereference at
virtual address 
[   23.409954] pgd = c0004000
[   23.412922] [] *pgd=
[   23.416693] Internal error: Oops: 8007 [#1] SMP ARM
[   23.422168] Modules linked in: wl12xx wlcore mac80211 cfg80211
musb_dsps musb_hdrc usbcore usb_common snd_soc_simple_card evdev joydev
omap_rng wlcore_spi snd_soc_tlv320aic23_i2c rng_core snd_soc_tlv320aic23
c_can_platform c_can can_dev snd_soc_davinci_mcasp snd_soc_edma
snd_soc_omap omap_wdt musb_am335x cpufreq_dt thermal_sys hwmon
[   23.453253] CPU: 0 PID: 36 Comm: kworker/0:2 Not tainted
4.2.0-2-g951efee-dirty #233
[   23.461720] Hardware name: Generic AM33XX (Flattened Device Tree)
[   23.468123] Workqueue: events request_firmware_work_func
[   23.473690] task: de32efc0 ti: de4ee000 task.ti: de4ee000
[   23.479341] PC is at 0x0
[   23.482112] LR is at wl12xx_set_power_on+0x28/0x124 [wlcore]
[   23.488074] pc : [<>]lr : []psr: 6013
[   23.488074] sp : de4efe50  ip : 0002  fp : 
[   23.500162] r10: de7cdd00  r9 : dc848800  r8 : bf27af00
[   23.505663] r7 : bf27a1a8  r6 : dcbd8a80  r5 : dce0e2e0  r4 :
dce0d2e0
[   23.512536] r3 :   r2 :   r1 : 0001  r0 :
dc848810
[   23.519412] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM
Segment kernel
[   23.527109] Control: 10c5387d  Table: 9cb78019  DAC: 0015
[   23.533160] Process kworker/0:2 (pid: 36, stack limit = 0xde4ee218)
[   23.539760] Stack: (0xde4efe50 to 0xde4f)

[...]

[   23.665030] [] (wl12xx_set_power_on [wlcore]) from
[] (wlcore_nvs_cb+0x118/0xa4c [wlcore])
[   23.675604] [] (wlcore_nvs_cb [wlcore]) from []
(request_firmware_work_func+0x30/0x58)
[   23.685784] [] (request_firmware_work_func) from
[] (process_one_work+0x1b4/0x4b4)
[   23.695591] [] (process_one_work) from []
(worker_thread+0x3c/0x4a4)
[   23.704124] [] (worker_thread) from []
(kthread+0xd4/0xf0)
[   23.711747] [] (kthread) from []
(ret_from_fork+0x14/0x3c)
[   23.719357] Code: bad PC value
[   23.722760] ---[ end trace 981be8510db9b3a9 ]---

Prevent oops by validationg power() pointer value before
calling the function.

Signed-off-by: Uri Mashiach 
Cc: sta...@vger.kernel.org
Acked-by: Igor Grinberg 


Please always provide a changelog when you resend patches, I lost track
what I'm supposed to do with this. Should I apply or drop?


Sorry for not providing a changelog.
The patch should be applied.

--
Thanks,
Uri
--
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] ath10k: do not use coherent memory for allocated device memory chunks

2015-12-30 Thread Ben Greear

On 11/30/2015 10:32 AM, Felix Fietkau wrote:

Coherent memory is more expensive to allocate (and constrained on some
architectures where it has to be pre-allocated). It is also completely
unnecessary, since the host has no reason to even access these allocated
memory spaces

Signed-off-by: Felix Fietkau 



-   memset(ar->wmi.mem_chunks[idx].vaddr, 0, pool_size);
+   if (!num_units)
+   return -ENOMEM;
+
+   paddr = dma_map_single(ar->dev, vaddr, pool_size, DMA_TO_DEVICE);
+   if (dma_mapping_error(ar->dev, paddr)) {
+   kfree(vaddr);
+   return -ENOMEM;
+   }


Are you sure you have the direction correct for the 'dma_map_single'
call?

I thought this memory was for the NIC to scribble in, and probably
host should never even bother reading or writing it?

The reason I started looking at this is that I see these errors when
trying to use a 4x4 wave-2 ath10k NIC in a 4.4.0-rc7 ath kernel:

[  202.489625] wlan0: authenticate with 00:0e:8e:f8:73:96
[  202.784533] DMAR: DRHD: handling fault status reg 3
[  202.786246] wlan0: send auth to 00:0e:8e:f8:73:96 (try 1/3)
[  202.788133] DMAR: DMAR:[DMA Write] Request device [05:00.0] fault addr 
ff5de000
DMAR:[fault reason 05] PTE Write access is not set
[  202.887410] wlan0: send auth to 00:0e:8e:f8:73:96 (try 2/3)
[  202.988423] wlan0: send auth to 00:0e:8e:f8:73:96 (try 3/3)
[  203.089437] wlan0: authentication with 00:0e:8e:f8:73:96 timed out

This is on an Intel x86-64 system with IOMMU (VT-d) enabled.

I'm likely having more than one problem since a 4.3.0-rc6+ kernel is not
working with this NIC either...

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: pull-request: wireless-drivers 2015-12-28

2015-12-30 Thread David Miller
From: Kalle Valo 
Date: Mon, 28 Dec 2015 13:47:43 +0200

> here's one more pull request, a bit late due to holidays but I hope this
> still makes it to 4.4. Just two small fixes to iwlwifi, nothing else.

Pulled, thanks Kalle.
--
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


net/nfc: user-controllable kmalloc size in nfc_llcp_send_ui_frame

2015-12-30 Thread Dmitry Vyukov
Hello,

The following program triggers WARNING In kmalloc:


[ cut here ]
WARNING: CPU: 2 PID: 6754 at mm/page_alloc.c:2989
__alloc_pages_nodemask+0x771/0x15f0()
Modules linked in:
CPU: 2 PID: 6754 Comm: a.out Not tainted 4.4.0-rc7+ #181
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
  88006275f5e0 8289d9dd 
 8800621c8000 85dbab40 88006275f620 812ebbb9
 815fc6b1 85dbab40 0bad 88006275f8a8
Call Trace:
 [< inline >] __dump_stack lib/dump_stack.c:15
 [] dump_stack+0x6f/0xa2 lib/dump_stack.c:50
 [] warn_slowpath_common+0xd9/0x140 kernel/panic.c:460
 [] warn_slowpath_null+0x29/0x30 kernel/panic.c:493
 [< inline >] __alloc_pages_slowpath mm/page_alloc.c:2989
 [] __alloc_pages_nodemask+0x771/0x15f0 mm/page_alloc.c:3235
 [] alloc_pages_current+0xee/0x340 mm/mempolicy.c:2055
 [< inline >] alloc_pages include/linux/gfp.h:451
 [] alloc_kmem_pages+0x16/0xf0 mm/page_alloc.c:3414
 [] kmalloc_order+0x1f/0x80 mm/slab_common.c:1007
 [] kmalloc_order_trace+0x1f/0x140 mm/slab_common.c:1018
 [< inline >] kmalloc_large include/linux/slab.h:390
 [] __kmalloc+0x2de/0x330 mm/slub.c:3555
 [< inline >] kmalloc include/linux/slab.h:463
 [< inline >] kzalloc include/linux/slab.h:602
 [] nfc_llcp_send_ui_frame+0xdc/0x3d0
net/nfc/llcp_commands.c:732
 [] llcp_sock_sendmsg+0x250/0x310 net/nfc/llcp_sock.c:782
 [< inline >] sock_sendmsg_nosec net/socket.c:610
 [] sock_sendmsg+0xca/0x110 net/socket.c:620
 [] ___sys_sendmsg+0x72a/0x840 net/socket.c:1946
 [] __sys_sendmsg+0xce/0x170 net/socket.c:1980
 [< inline >] SYSC_sendmsg net/socket.c:1991
 [] SyS_sendmsg+0x2d/0x50 net/socket.c:1987
 [] entry_SYSCALL_64_fastpath+0x16/0x7a
arch/x86/entry/entry_64.S:185
---[ end trace 62962d1ed2b9f41a ]---


// autogenerated by syzkaller (http://github.com/google/syzkaller)
#include 
#include 
#include 
#include 

long r[68];

int main()
{
memset(r, -1, sizeof(r));
r[0] = syscall(SYS_mmap, 0x2000ul, 0x2ul, 0x3ul,
0x32ul, 0xul, 0x0ul);
r[1] = syscall(SYS_socket, 0x27ul, 0x2ul, 0x1ul, 0, 0, 0);
*(uint16_t*)0x2000cfa0 = (uint16_t)0x27;
*(uint32_t*)0x2000cfa4 = (uint32_t)0x1;
*(uint32_t*)0x2000cfa8 = (uint32_t)0x8;
*(uint32_t*)0x2000cfac = (uint32_t)0x7;
*(uint8_t*)0x2000cfb0 = (uint8_t)0x0;
*(uint8_t*)0x2000cfb1 = (uint8_t)0x38;
*(uint8_t*)0x2000cfb2 = (uint8_t)0x6;
*(uint8_t*)0x2000cfb3 = (uint8_t)0x0;
*(uint32_t*)0x2000cfb4 = (uint32_t)0x9;
*(uint32_t*)0x2000cfb8 = (uint32_t)0x7;
*(uint32_t*)0x2000cfbc = (uint32_t)0x9;
*(uint32_t*)0x2000cfc0 = (uint32_t)0xfff7;
*(uint32_t*)0x2000cfc4 = (uint32_t)0x8;
*(uint32_t*)0x2000cfc8 = (uint32_t)0xcf77;
*(uint32_t*)0x2000cfcc = (uint32_t)0x39;
*(uint32_t*)0x2000cfd0 = (uint32_t)0x6;
*(uint32_t*)0x2000cfd4 = (uint32_t)0x8;
*(uint32_t*)0x2000cfd8 = (uint32_t)0x4;
*(uint32_t*)0x2000cfdc = (uint32_t)0x4b;
*(uint32_t*)0x2000cfe0 = (uint32_t)0x9;
*(uint32_t*)0x2000cfe4 = (uint32_t)0x5;
*(uint32_t*)0x2000cfe8 = (uint32_t)0x4;
*(uint32_t*)0x2000cfec = (uint32_t)0x7;
*(uint8_t*)0x2000cff0 = (uint8_t)0xfffd;
*(uint64_t*)0x2000cff8 = (uint64_t)0x8;
r[27] = syscall(SYS_bind, r[1], 0x2000cfa0ul, 0x60ul, 0, 0, 0);
*(uint64_t*)0x20014fc8 = (uint64_t)0x20014000;
*(uint32_t*)0x20014fd0 = (uint32_t)0x60;
*(uint64_t*)0x20014fd8 = (uint64_t)0x20014000;
*(uint64_t*)0x20014fe0 = (uint64_t)0x1;
*(uint64_t*)0x20014fe8 = (uint64_t)0x20014000;
*(uint64_t*)0x20014ff0 = (uint64_t)0x11;
*(uint32_t*)0x20014ff8 = (uint32_t)0x0;
*(uint16_t*)0x20014000 = (uint16_t)0x27;
*(uint32_t*)0x20014004 = (uint32_t)0x3;
*(uint32_t*)0x20014008 = (uint32_t)0x0;
*(uint32_t*)0x2001400c = (uint32_t)0x0;
*(uint8_t*)0x20014010 = (uint8_t)0x2;
*(uint8_t*)0x20014011 = (uint8_t)0x52;
*(uint8_t*)0x20014012 = (uint8_t)0x7;
*(uint8_t*)0x20014013 = (uint8_t)0x2;
*(uint32_t*)0x20014014 = (uint32_t)0x3;
*(uint32_t*)0x20014018 = (uint32_t)0x8;
*(uint32_t*)0x2001401c = (uint32_t)0x9;
*(uint32_t*)0x20014020 = (uint32_t)0xde4;
*(uint32_t*)0x20014024 = (uint32_t)0x8;
*(uint32_t*)0x20014028 = (uint32_t)0x6;
*(uint32_t*)0x2001402c = (uint32_t)0x6850;
*(uint32_t*)0x20014030 = (uint32_t)0x24;
*(uint32_t*)0x20014034 = (uint32_t)0x0;
*(uint32_t*)0x20014038 = (uint32_t)0xffe4;
*(uint32_t*)0x2001403c = (uint32_t)0x6;
*(uint32_t*)0x20014040 = (uint32_t)0x4e;
*(uint32_t*)0x20014044 = (uint32_t)0x6;
*(uint32_t*)0x20014048 = (uint32_t)0xf14c;

[PATCH] iwlegacy: 4965-mac: constify il_sensitivity_ranges structure

2015-12-30 Thread Julia Lawall
The il_sensitivity_ranges is never modified, so declare it as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall 

---
 drivers/net/wireless/intel/iwlegacy/4965-mac.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/intel/iwlegacy/4965-mac.c 
b/drivers/net/wireless/intel/iwlegacy/4965-mac.c
index 6656215..fd38aa0 100644
--- a/drivers/net/wireless/intel/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/intel/iwlegacy/4965-mac.c
@@ -6416,7 +6416,7 @@ il4965_hw_detect(struct il_priv *il)
D_INFO("HW Revision ID = 0x%X\n", il->rev_id);
 }
 
-static struct il_sensitivity_ranges il4965_sensitivity = {
+static const struct il_sensitivity_ranges il4965_sensitivity = {
.min_nrg_cck = 97,
.max_nrg_cck = 0,   /* not used, set to 0 */
 

--
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] mac80211: pass block ack session timeout to to driver

2015-12-30 Thread Sara Sharon
Currently mac80211 does not inform the driver of the session
block ack timeout when starting a rx aggregation session.
Drivers that manage the reorder buffer need to know this
parameter.
Seeing that there are now too many arguments for the
drv_ampdu_action() function, wrap them inside a structure.

Signed-off-by: Sara Sharon 
---
v2: fix all the users of the API
---
 drivers/net/wireless/ath/ath10k/mac.c  |  7 +--
 drivers/net/wireless/ath/ath9k/htc_drv_main.c  |  7 +--
 drivers/net/wireless/ath/ath9k/main.c  |  8 ++--
 drivers/net/wireless/ath/carl9170/main.c   |  8 ++--
 drivers/net/wireless/ath/wcn36xx/main.c|  8 ++--
 .../net/wireless/brcm80211/brcmsmac/mac80211_if.c  |  8 ++--
 drivers/net/wireless/cw1200/sta.c  |  4 +-
 drivers/net/wireless/cw1200/sta.h  |  4 +-
 drivers/net/wireless/iwlegacy/4965-mac.c   |  8 ++--
 drivers/net/wireless/iwlegacy/4965.h   |  4 +-
 drivers/net/wireless/iwlwifi/dvm/mac80211.c|  9 ++--
 drivers/net/wireless/iwlwifi/mvm/mac80211.c| 10 ++--
 drivers/net/wireless/mac80211_hwsim.c  |  8 ++--
 drivers/net/wireless/mediatek/mt7601u/main.c   |  8 ++--
 drivers/net/wireless/mwl8k.c   | 10 ++--
 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c   |  6 +--
 drivers/net/wireless/realtek/rtlwifi/core.c|  8 ++--
 drivers/net/wireless/rsi/rsi_91x_mac80211.c| 19 +++-
 drivers/net/wireless/rt2x00/rt2800lib.c|  7 +--
 drivers/net/wireless/rt2x00/rt2800lib.h|  4 +-
 drivers/net/wireless/ti/wlcore/main.c  |  8 ++--
 include/net/mac80211.h | 44 --
 net/mac80211/agg-rx.c  | 25 --
 net/mac80211/agg-tx.c  | 53 ++
 net/mac80211/driver-ops.c  | 10 ++--
 net/mac80211/driver-ops.h  |  4 +-
 net/mac80211/trace.h   | 41 +
 27 files changed, 201 insertions(+), 139 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c 
b/drivers/net/wireless/ath/ath10k/mac.c
index a7411fe..4f53576 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -6348,12 +6348,13 @@ static u64 ath10k_get_tsf(struct ieee80211_hw *hw, 
struct ieee80211_vif *vif)
 
 static int ath10k_ampdu_action(struct ieee80211_hw *hw,
   struct ieee80211_vif *vif,
-  enum ieee80211_ampdu_mlme_action action,
-  struct ieee80211_sta *sta, u16 tid, u16 *ssn,
-  u8 buf_size, bool amsdu)
+  struct ieee80211_ampdu_params *params)
 {
struct ath10k *ar = hw->priv;
struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
+   struct ieee80211_sta *sta = params->sta;
+   enum ieee80211_ampdu_mlme_action action = params->action;
+   u16 tid = params->tid;
 
ath10k_dbg(ar, ATH10K_DBG_MAC, "mac ampdu vdev_id %i sta %pM tid %hu 
action %d\n",
   arvif->vdev_id, sta->addr, tid, action);
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c 
b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index a680a97..e428143 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -1657,13 +1657,14 @@ static void ath9k_htc_reset_tsf(struct ieee80211_hw *hw,
 
 static int ath9k_htc_ampdu_action(struct ieee80211_hw *hw,
  struct ieee80211_vif *vif,
- enum ieee80211_ampdu_mlme_action action,
- struct ieee80211_sta *sta,
- u16 tid, u16 *ssn, u8 buf_size, bool amsdu)
+ struct ieee80211_ampdu_params *params)
 {
struct ath9k_htc_priv *priv = hw->priv;
struct ath9k_htc_sta *ista;
int ret = 0;
+   struct ieee80211_sta *sta = params->sta;
+   enum ieee80211_ampdu_mlme_action action = params->action;
+   u16 tid = params->tid;
 
mutex_lock(>mutex);
ath9k_htc_ps_wakeup(priv);
diff --git a/drivers/net/wireless/ath/ath9k/main.c 
b/drivers/net/wireless/ath/ath9k/main.c
index d184e68..5cc0ddc 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1860,14 +1860,16 @@ static void ath9k_reset_tsf(struct ieee80211_hw *hw, 
struct ieee80211_vif *vif)
 
 static int ath9k_ampdu_action(struct ieee80211_hw *hw,
  struct ieee80211_vif *vif,
- enum ieee80211_ampdu_mlme_action action,
- struct ieee80211_sta *sta,
- u16 tid, u16 *ssn, u8 buf_size, bool amsdu)
+ struct 

Re: [PATCH 17/20] staging: wilc1000: fix return type of host_int_get_ipaddress

2015-12-30 Thread Souptick Joarder
Hi Lim,

On Wed, Dec 30, 2015 at 5:45 PM, Chaehyun Lim  wrote:
> This patch changes return type of host_int_get_ipaddress from s32 to
> int. The result variable gets return value from wilc_mq_send that has
> data type of int. It should be changed return type of this function as
> well as data type of result variable.
>
> Signed-off-by: Chaehyun Lim 
> ---
>  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 90fdbdd..a203647 100644
> --- a/drivers/staging/wilc1000/host_interface.c
> +++ b/drivers/staging/wilc1000/host_interface.c
> @@ -362,7 +362,7 @@ static s32 handle_set_operation_mode(struct wilc_vif *vif,
> return result;
>  }
>
> -static s32 host_int_get_ipaddress(struct wilc_vif *vif,
> +static int host_int_get_ipaddress(struct wilc_vif *vif,
>   struct host_if_drv *hif_drv,
>   u8 *u16ipadd, u8 idx);
>
s32 and int both are same. isn't it ?

> @@ -4664,11 +4664,11 @@ int wilc_setup_ipaddress(struct wilc_vif *vif, u8 
> *ip_addr, u8 idx)
> return result;
>  }
>
> -static s32 host_int_get_ipaddress(struct wilc_vif *vif,
> +static int host_int_get_ipaddress(struct wilc_vif *vif,
>   struct host_if_drv *hif_drv,
>   u8 *u16ipadd, u8 idx)
>  {
> -   s32 result = 0;
> +   int result = 0;
> struct host_if_msg msg;
>
> if (!hif_drv) {
> --
> 2.6.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-Souptick
--
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 03/20] staging: wilc1000: rename bReg in wilc_frame_register

2015-12-30 Thread Chaehyun Lim
This patch renames bReg to reg to avoid camelcase.

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

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index c3e59d8..9b72519 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -4123,7 +4123,7 @@ s32 wilc_listen_state_expired(struct wilc_vif *vif, u32 
u32SessionID)
return result;
 }
 
-int wilc_frame_register(struct wilc_vif *vif, u16 frame_type, bool bReg)
+int wilc_frame_register(struct wilc_vif *vif, u16 frame_type, bool reg)
 {
int result = 0;
struct host_if_msg msg;
@@ -4153,7 +4153,7 @@ int wilc_frame_register(struct wilc_vif *vif, u16 
frame_type, bool bReg)
break;
}
msg.body.reg_frame.frame_type = frame_type;
-   msg.body.reg_frame.reg = bReg;
+   msg.body.reg_frame.reg = reg;
msg.vif = vif;
 
result = wilc_mq_send(_msg_q, , sizeof(struct host_if_msg));
diff --git a/drivers/staging/wilc1000/host_interface.h 
b/drivers/staging/wilc1000/host_interface.h
index efb657b..b43e0a1 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -362,7 +362,7 @@ s32 wilc_remain_on_channel(struct wilc_vif *vif, u32 
u32SessionID,
   wilc_remain_on_chan_ready RemainOnChanReady,
   void *pvUserArg);
 s32 wilc_listen_state_expired(struct wilc_vif *vif, u32 u32SessionID);
-int wilc_frame_register(struct wilc_vif *vif, u16 frame_type, bool bReg);
+int wilc_frame_register(struct wilc_vif *vif, u16 frame_type, bool reg);
 int wilc_set_wfi_drv_handler(struct wilc_vif *vif, int index);
 int wilc_set_operation_mode(struct wilc_vif *vif, u32 mode);
 int wilc_get_statistics(struct wilc_vif *vif, struct rf_info *stats);
-- 
2.6.4

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


[PATCH 06/20] staging: wilc1000: fix return type of wilc_set_power_mgmt

2015-12-30 Thread Chaehyun Lim
This patch changes return type of wilc_set_power_mgmt from s32 to int.
The result variable gets return value from wilc_mq_send that has return
type of int. It should be changed return type of this function as well
as data type of result variable.

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

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 3a9a967..8b1e535 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -4393,9 +4393,9 @@ s32 wilc_edit_station(struct wilc_vif *vif,
return result;
 }
 
-s32 wilc_set_power_mgmt(struct wilc_vif *vif, bool bIsEnabled, u32 u32Timeout)
+int wilc_set_power_mgmt(struct wilc_vif *vif, bool bIsEnabled, u32 u32Timeout)
 {
-   s32 result = 0;
+   int result = 0;
struct host_if_msg msg;
struct power_mgmt_param *pstrPowerMgmtParam = _mgmt_info;
struct host_if_drv *hif_drv = vif->hif_drv;
diff --git a/drivers/staging/wilc1000/host_interface.h 
b/drivers/staging/wilc1000/host_interface.h
index 47c664e..fb9c0ea 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -351,7 +351,7 @@ s32 wilc_del_allstation(struct wilc_vif *vif, u8 
pu8MacAddr[][ETH_ALEN]);
 int wilc_del_station(struct wilc_vif *vif, const u8 *mac_addr);
 s32 wilc_edit_station(struct wilc_vif *vif,
  struct add_sta_param *pstrStaParams);
-s32 wilc_set_power_mgmt(struct wilc_vif *vif, bool bIsEnabled, u32 u32Timeout);
+int wilc_set_power_mgmt(struct wilc_vif *vif, bool bIsEnabled, u32 u32Timeout);
 s32 wilc_setup_multicast_filter(struct wilc_vif *vif, bool bIsEnabled,
u32 u32count);
 s32 wilc_setup_ipaddress(struct wilc_vif *vif, u8 *u16ipadd, u8 idx);
-- 
2.6.4

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


[PATCH 01/20] staging: wilc1000: fix return type of wilc_frame_register

2015-12-30 Thread Chaehyun Lim
This patch changes return type of wilc_frame_register from s32 to int.
The result variable gets return value from wilc_mq_send that has return
type of int. It should be changed return type of this function as well
as data type of result variable.

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

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 5113d3d..d9e4e11 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -4123,9 +4123,9 @@ s32 wilc_listen_state_expired(struct wilc_vif *vif, u32 
u32SessionID)
return result;
 }
 
-s32 wilc_frame_register(struct wilc_vif *vif, u16 u16FrameType, bool bReg)
+int wilc_frame_register(struct wilc_vif *vif, u16 u16FrameType, bool bReg)
 {
-   s32 result = 0;
+   int result = 0;
struct host_if_msg msg;
struct host_if_drv *hif_drv = vif->hif_drv;
 
diff --git a/drivers/staging/wilc1000/host_interface.h 
b/drivers/staging/wilc1000/host_interface.h
index b8b235d..5ecc978 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -362,7 +362,7 @@ s32 wilc_remain_on_channel(struct wilc_vif *vif, u32 
u32SessionID,
   wilc_remain_on_chan_ready RemainOnChanReady,
   void *pvUserArg);
 s32 wilc_listen_state_expired(struct wilc_vif *vif, u32 u32SessionID);
-s32 wilc_frame_register(struct wilc_vif *vif, u16 u16FrameType, bool bReg);
+int wilc_frame_register(struct wilc_vif *vif, u16 u16FrameType, bool bReg);
 int wilc_set_wfi_drv_handler(struct wilc_vif *vif, int index);
 int wilc_set_operation_mode(struct wilc_vif *vif, u32 mode);
 int wilc_get_statistics(struct wilc_vif *vif, struct rf_info *stats);
-- 
2.6.4

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


[PATCH 02/20] staging: wilc1000: rename u16FrameType in wilc_frame_register

2015-12-30 Thread Chaehyun Lim
This patch renames u16FrameType to frame_type to avoid camelcase.

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

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index d9e4e11..c3e59d8 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -4123,7 +4123,7 @@ s32 wilc_listen_state_expired(struct wilc_vif *vif, u32 
u32SessionID)
return result;
 }
 
-int wilc_frame_register(struct wilc_vif *vif, u16 u16FrameType, bool bReg)
+int wilc_frame_register(struct wilc_vif *vif, u16 frame_type, bool bReg)
 {
int result = 0;
struct host_if_msg msg;
@@ -4137,7 +4137,7 @@ int wilc_frame_register(struct wilc_vif *vif, u16 
u16FrameType, bool bReg)
memset(, 0, sizeof(struct host_if_msg));
 
msg.id = HOST_IF_MSG_REGISTER_FRAME;
-   switch (u16FrameType) {
+   switch (frame_type) {
case ACTION:
PRINT_D(HOSTINF_DBG, "ACTION\n");
msg.body.reg_frame.reg_id = ACTION_FRM_IDX;
@@ -4152,7 +4152,7 @@ int wilc_frame_register(struct wilc_vif *vif, u16 
u16FrameType, bool bReg)
PRINT_D(HOSTINF_DBG, "Not valid frame type\n");
break;
}
-   msg.body.reg_frame.frame_type = u16FrameType;
+   msg.body.reg_frame.frame_type = frame_type;
msg.body.reg_frame.reg = bReg;
msg.vif = vif;
 
diff --git a/drivers/staging/wilc1000/host_interface.h 
b/drivers/staging/wilc1000/host_interface.h
index 5ecc978..efb657b 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -362,7 +362,7 @@ s32 wilc_remain_on_channel(struct wilc_vif *vif, u32 
u32SessionID,
   wilc_remain_on_chan_ready RemainOnChanReady,
   void *pvUserArg);
 s32 wilc_listen_state_expired(struct wilc_vif *vif, u32 u32SessionID);
-int wilc_frame_register(struct wilc_vif *vif, u16 u16FrameType, bool bReg);
+int wilc_frame_register(struct wilc_vif *vif, u16 frame_type, bool bReg);
 int wilc_set_wfi_drv_handler(struct wilc_vif *vif, int index);
 int wilc_set_operation_mode(struct wilc_vif *vif, u32 mode);
 int wilc_get_statistics(struct wilc_vif *vif, struct rf_info *stats);
-- 
2.6.4

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


[PATCH 05/20] staging: wilc1000: rename u32SessionID in wilc_listen_state_expired

2015-12-30 Thread Chaehyun Lim
This patch renames u32SessionID to session_id to avoid camelcase.

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

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 4db211b..3a9a967 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -4098,7 +4098,7 @@ s32 wilc_remain_on_channel(struct wilc_vif *vif, u32 
u32SessionID,
return result;
 }
 
-int wilc_listen_state_expired(struct wilc_vif *vif, u32 u32SessionID)
+int wilc_listen_state_expired(struct wilc_vif *vif, u32 session_id)
 {
int result = 0;
struct host_if_msg msg;
@@ -4114,7 +4114,7 @@ int wilc_listen_state_expired(struct wilc_vif *vif, u32 
u32SessionID)
memset(, 0, sizeof(struct host_if_msg));
msg.id = HOST_IF_MSG_LISTEN_TIMER_FIRED;
msg.vif = vif;
-   msg.body.remain_on_ch.id = u32SessionID;
+   msg.body.remain_on_ch.id = session_id;
 
result = wilc_mq_send(_msg_q, , sizeof(struct host_if_msg));
if (result)
diff --git a/drivers/staging/wilc1000/host_interface.h 
b/drivers/staging/wilc1000/host_interface.h
index fbc1ee1..47c664e 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -361,7 +361,7 @@ s32 wilc_remain_on_channel(struct wilc_vif *vif, u32 
u32SessionID,
   wilc_remain_on_chan_expired RemainOnChanExpired,
   wilc_remain_on_chan_ready RemainOnChanReady,
   void *pvUserArg);
-int wilc_listen_state_expired(struct wilc_vif *vif, u32 u32SessionID);
+int wilc_listen_state_expired(struct wilc_vif *vif, u32 session_id);
 int wilc_frame_register(struct wilc_vif *vif, u16 frame_type, bool reg);
 int wilc_set_wfi_drv_handler(struct wilc_vif *vif, int index);
 int wilc_set_operation_mode(struct wilc_vif *vif, u32 mode);
-- 
2.6.4

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


[PATCH 04/20] staging: wilc1000: fix return type of wilc_listen_state_expired

2015-12-30 Thread Chaehyun Lim
This patch changes return type of wilc_listen_state_expired from s32 to
int. The result variable gets return value from wilc_mq_send that has
return type of int. It should be changed return type of this function as
well as data type of result variable.

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

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 9b72519..4db211b 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -4098,9 +4098,9 @@ s32 wilc_remain_on_channel(struct wilc_vif *vif, u32 
u32SessionID,
return result;
 }
 
-s32 wilc_listen_state_expired(struct wilc_vif *vif, u32 u32SessionID)
+int wilc_listen_state_expired(struct wilc_vif *vif, u32 u32SessionID)
 {
-   s32 result = 0;
+   int result = 0;
struct host_if_msg msg;
struct host_if_drv *hif_drv = vif->hif_drv;
 
diff --git a/drivers/staging/wilc1000/host_interface.h 
b/drivers/staging/wilc1000/host_interface.h
index b43e0a1..fbc1ee1 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -361,7 +361,7 @@ s32 wilc_remain_on_channel(struct wilc_vif *vif, u32 
u32SessionID,
   wilc_remain_on_chan_expired RemainOnChanExpired,
   wilc_remain_on_chan_ready RemainOnChanReady,
   void *pvUserArg);
-s32 wilc_listen_state_expired(struct wilc_vif *vif, u32 u32SessionID);
+int wilc_listen_state_expired(struct wilc_vif *vif, u32 u32SessionID);
 int wilc_frame_register(struct wilc_vif *vif, u16 frame_type, bool reg);
 int wilc_set_wfi_drv_handler(struct wilc_vif *vif, int index);
 int wilc_set_operation_mode(struct wilc_vif *vif, u32 mode);
-- 
2.6.4

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


[PATCH 13/20] staging: wilc1000: rename pstrMulticastFilterParam in wilc_setup_multicast_filter

2015-12-30 Thread Chaehyun Lim
This patch renames pstrMulticastFilterParam to multicast_filter_param to
avoid camelcase.

Signed-off-by: Chaehyun Lim 
---
 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 489ab29..aeb3271 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -4428,7 +4428,7 @@ int wilc_setup_multicast_filter(struct wilc_vif *vif, 
bool enabled,
 {
int result = 0;
struct host_if_msg msg;
-   struct set_multicast *pstrMulticastFilterParam = 
_info;
+   struct set_multicast *multicast_filter_param = _info;
struct host_if_drv *hif_drv = vif->hif_drv;
 
if (!hif_drv) {
@@ -4443,8 +4443,8 @@ int wilc_setup_multicast_filter(struct wilc_vif *vif, 
bool enabled,
msg.id = HOST_IF_MSG_SET_MULTICAST_FILTER;
msg.vif = vif;
 
-   pstrMulticastFilterParam->enabled = enabled;
-   pstrMulticastFilterParam->cnt = count;
+   multicast_filter_param->enabled = enabled;
+   multicast_filter_param->cnt = count;
 
result = wilc_mq_send(_msg_q, , sizeof(struct host_if_msg));
if (result)
-- 
2.6.4

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


[PATCH 07/20] staging: wilc1000: rename bIsEnabled in wilc_set_power_mgmt

2015-12-30 Thread Chaehyun Lim
This patch renames bIsEnabled to enabled to avoid camelcase.

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

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 8b1e535..3ed8275 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -4393,14 +4393,14 @@ s32 wilc_edit_station(struct wilc_vif *vif,
return result;
 }
 
-int wilc_set_power_mgmt(struct wilc_vif *vif, bool bIsEnabled, u32 u32Timeout)
+int wilc_set_power_mgmt(struct wilc_vif *vif, bool enabled, u32 u32Timeout)
 {
int result = 0;
struct host_if_msg msg;
struct power_mgmt_param *pstrPowerMgmtParam = _mgmt_info;
struct host_if_drv *hif_drv = vif->hif_drv;
 
-   PRINT_INFO(HOSTINF_DBG, "\n\n>> Setting PS to %d <<\n\n", bIsEnabled);
+   PRINT_INFO(HOSTINF_DBG, "\n\n>> Setting PS to %d <<\n\n", enabled);
 
if (!hif_drv) {
PRINT_ER("driver is null\n");
@@ -4414,7 +4414,7 @@ int wilc_set_power_mgmt(struct wilc_vif *vif, bool 
bIsEnabled, u32 u32Timeout)
msg.id = HOST_IF_MSG_POWER_MGMT;
msg.vif = vif;
 
-   pstrPowerMgmtParam->enabled = bIsEnabled;
+   pstrPowerMgmtParam->enabled = enabled;
pstrPowerMgmtParam->timeout = u32Timeout;
 
result = wilc_mq_send(_msg_q, , sizeof(struct host_if_msg));
diff --git a/drivers/staging/wilc1000/host_interface.h 
b/drivers/staging/wilc1000/host_interface.h
index fb9c0ea..89765b8 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -351,7 +351,7 @@ s32 wilc_del_allstation(struct wilc_vif *vif, u8 
pu8MacAddr[][ETH_ALEN]);
 int wilc_del_station(struct wilc_vif *vif, const u8 *mac_addr);
 s32 wilc_edit_station(struct wilc_vif *vif,
  struct add_sta_param *pstrStaParams);
-int wilc_set_power_mgmt(struct wilc_vif *vif, bool bIsEnabled, u32 u32Timeout);
+int wilc_set_power_mgmt(struct wilc_vif *vif, bool enabled, u32 u32Timeout);
 s32 wilc_setup_multicast_filter(struct wilc_vif *vif, bool bIsEnabled,
u32 u32count);
 s32 wilc_setup_ipaddress(struct wilc_vif *vif, u8 *u16ipadd, u8 idx);
-- 
2.6.4

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


[PATCH 08/20] staging: wilc1000: rename u32Timeout in wilc_set_power_mgmt

2015-12-30 Thread Chaehyun Lim
This patch renames u32Timeout to timeout to avoid camelcase.

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

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 3ed8275..dc1773d 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -4393,7 +4393,7 @@ s32 wilc_edit_station(struct wilc_vif *vif,
return result;
 }
 
-int wilc_set_power_mgmt(struct wilc_vif *vif, bool enabled, u32 u32Timeout)
+int wilc_set_power_mgmt(struct wilc_vif *vif, bool enabled, u32 timeout)
 {
int result = 0;
struct host_if_msg msg;
@@ -4415,7 +4415,7 @@ int wilc_set_power_mgmt(struct wilc_vif *vif, bool 
enabled, u32 u32Timeout)
msg.vif = vif;
 
pstrPowerMgmtParam->enabled = enabled;
-   pstrPowerMgmtParam->timeout = u32Timeout;
+   pstrPowerMgmtParam->timeout = timeout;
 
result = wilc_mq_send(_msg_q, , sizeof(struct host_if_msg));
if (result)
diff --git a/drivers/staging/wilc1000/host_interface.h 
b/drivers/staging/wilc1000/host_interface.h
index 89765b8..7b12425 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -351,7 +351,7 @@ s32 wilc_del_allstation(struct wilc_vif *vif, u8 
pu8MacAddr[][ETH_ALEN]);
 int wilc_del_station(struct wilc_vif *vif, const u8 *mac_addr);
 s32 wilc_edit_station(struct wilc_vif *vif,
  struct add_sta_param *pstrStaParams);
-int wilc_set_power_mgmt(struct wilc_vif *vif, bool enabled, u32 u32Timeout);
+int wilc_set_power_mgmt(struct wilc_vif *vif, bool enabled, u32 timeout);
 s32 wilc_setup_multicast_filter(struct wilc_vif *vif, bool bIsEnabled,
u32 u32count);
 s32 wilc_setup_ipaddress(struct wilc_vif *vif, u8 *u16ipadd, u8 idx);
-- 
2.6.4

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


[PATCH 12/20] staging: wilc1000: rename u32count in wilc_setup_multicast_filter

2015-12-30 Thread Chaehyun Lim
This patch renames u32count to count to remove u32 prefix.
There is no need to use this prefix to show data type of this argument.

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

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index a32e930..489ab29 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -4424,7 +4424,7 @@ int wilc_set_power_mgmt(struct wilc_vif *vif, bool 
enabled, u32 timeout)
 }
 
 int wilc_setup_multicast_filter(struct wilc_vif *vif, bool enabled,
-   u32 u32count)
+   u32 count)
 {
int result = 0;
struct host_if_msg msg;
@@ -,7 +,7 @@ int wilc_setup_multicast_filter(struct wilc_vif *vif, 
bool enabled,
msg.vif = vif;
 
pstrMulticastFilterParam->enabled = enabled;
-   pstrMulticastFilterParam->cnt = u32count;
+   pstrMulticastFilterParam->cnt = count;
 
result = wilc_mq_send(_msg_q, , sizeof(struct host_if_msg));
if (result)
diff --git a/drivers/staging/wilc1000/host_interface.h 
b/drivers/staging/wilc1000/host_interface.h
index 9abdd3f..5c271b1 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -353,7 +353,7 @@ s32 wilc_edit_station(struct wilc_vif *vif,
  struct add_sta_param *pstrStaParams);
 int wilc_set_power_mgmt(struct wilc_vif *vif, bool enabled, u32 timeout);
 int wilc_setup_multicast_filter(struct wilc_vif *vif, bool enabled,
-   u32 u32count);
+   u32 count);
 s32 wilc_setup_ipaddress(struct wilc_vif *vif, u8 *u16ipadd, u8 idx);
 s32 wilc_del_all_rx_ba_session(struct wilc_vif *vif, char *pBSSID, char TID);
 s32 wilc_remain_on_channel(struct wilc_vif *vif, u32 u32SessionID,
-- 
2.6.4

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


[PATCH 09/20] staging: wilc1000: rename pstrPowerMgmtParam in wilc_set_power_mgmt

2015-12-30 Thread Chaehyun Lim
This patch renames pstrPowerMgmtParam to pwr_mgmt_info to avoid
camelcase.

Signed-off-by: Chaehyun Lim 
---
 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 dc1773d..83ac21a 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -4397,7 +4397,7 @@ int wilc_set_power_mgmt(struct wilc_vif *vif, bool 
enabled, u32 timeout)
 {
int result = 0;
struct host_if_msg msg;
-   struct power_mgmt_param *pstrPowerMgmtParam = _mgmt_info;
+   struct power_mgmt_param *pwr_mgmt_info = _mgmt_info;
struct host_if_drv *hif_drv = vif->hif_drv;
 
PRINT_INFO(HOSTINF_DBG, "\n\n>> Setting PS to %d <<\n\n", enabled);
@@ -4414,8 +4414,8 @@ int wilc_set_power_mgmt(struct wilc_vif *vif, bool 
enabled, u32 timeout)
msg.id = HOST_IF_MSG_POWER_MGMT;
msg.vif = vif;
 
-   pstrPowerMgmtParam->enabled = enabled;
-   pstrPowerMgmtParam->timeout = timeout;
+   pwr_mgmt_info->enabled = enabled;
+   pwr_mgmt_info->timeout = timeout;
 
result = wilc_mq_send(_msg_q, , sizeof(struct host_if_msg));
if (result)
-- 
2.6.4

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


[PATCH 18/20] staging: wilc1000: remove argument hif_drv in host_int_get_ipaddress

2015-12-30 Thread Chaehyun Lim
This patch removes hif_drv argument of host_int_get_ipaddress.
There is no need to pass hif_drv in this function because hif_drv is a
member of vif. It is removed struct host_if_drv and use hif_drv of vif.

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

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index a203647..72115ae 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -362,16 +362,13 @@ static s32 handle_set_operation_mode(struct wilc_vif *vif,
return result;
 }
 
-static int host_int_get_ipaddress(struct wilc_vif *vif,
- struct host_if_drv *hif_drv,
- u8 *u16ipadd, u8 idx);
+static int host_int_get_ipaddress(struct wilc_vif *vif, u8 *u16ipadd, u8 idx);
 
 static s32 handle_set_ip_address(struct wilc_vif *vif, u8 *ip_addr, u8 idx)
 {
s32 result = 0;
struct wid wid;
char firmware_ip_addr[4] = {0};
-   struct host_if_drv *hif_drv = vif->hif_drv;
 
if (ip_addr[0] < 192)
ip_addr[0] = 0;
@@ -389,7 +386,7 @@ static s32 handle_set_ip_address(struct wilc_vif *vif, u8 
*ip_addr, u8 idx)
result = wilc_send_config_pkt(vif->wilc, SET_CFG, , 1,
 wilc_get_vif_idx(vif));
 
-   host_int_get_ipaddress(vif, hif_drv, firmware_ip_addr, idx);
+   host_int_get_ipaddress(vif, firmware_ip_addr, idx);
 
if (result) {
PRINT_ER("Failed to set IP address\n");
@@ -4664,12 +4661,11 @@ int wilc_setup_ipaddress(struct wilc_vif *vif, u8 
*ip_addr, u8 idx)
return result;
 }
 
-static int host_int_get_ipaddress(struct wilc_vif *vif,
- struct host_if_drv *hif_drv,
- u8 *u16ipadd, u8 idx)
+static int host_int_get_ipaddress(struct wilc_vif *vif, u8 *u16ipadd, u8 idx)
 {
int result = 0;
struct host_if_msg msg;
+   struct host_if_drv *hif_drv = vif->hif_drv;
 
if (!hif_drv) {
PRINT_ER("driver is null\n");
-- 
2.6.4

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


[PATCH 15/20] staging: wilc1000: rename u16ipadd in wilc_setup_ipaddress

2015-12-30 Thread Chaehyun Lim
This patch renames u16ipadd to ip_addr to remove u16 prefix.
There is no need to use prefix to show data type of this argument.

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

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index dacadc9..0d41657 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -4638,7 +4638,7 @@ s32 wilc_del_all_rx_ba_session(struct wilc_vif *vif, char 
*pBSSID, char TID)
return result;
 }
 
-int wilc_setup_ipaddress(struct wilc_vif *vif, u8 *u16ipadd, u8 idx)
+int wilc_setup_ipaddress(struct wilc_vif *vif, u8 *ip_addr, u8 idx)
 {
int result = 0;
struct host_if_msg msg;
@@ -4655,7 +4655,7 @@ int wilc_setup_ipaddress(struct wilc_vif *vif, u8 
*u16ipadd, u8 idx)
 
msg.id = HOST_IF_MSG_SET_IPADDRESS;
 
-   msg.body.ip_info.ip_addr = u16ipadd;
+   msg.body.ip_info.ip_addr = ip_addr;
msg.vif = vif;
msg.body.ip_info.idx = idx;
 
diff --git a/drivers/staging/wilc1000/host_interface.h 
b/drivers/staging/wilc1000/host_interface.h
index d36a9f5..f90a530 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -354,7 +354,7 @@ s32 wilc_edit_station(struct wilc_vif *vif,
 int wilc_set_power_mgmt(struct wilc_vif *vif, bool enabled, u32 timeout);
 int wilc_setup_multicast_filter(struct wilc_vif *vif, bool enabled,
u32 count);
-int wilc_setup_ipaddress(struct wilc_vif *vif, u8 *u16ipadd, u8 idx);
+int wilc_setup_ipaddress(struct wilc_vif *vif, u8 *ip_addr, u8 idx);
 s32 wilc_del_all_rx_ba_session(struct wilc_vif *vif, char *pBSSID, char TID);
 s32 wilc_remain_on_channel(struct wilc_vif *vif, u32 u32SessionID,
   u32 u32duration, u16 chan,
-- 
2.6.4

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


[PATCH 20/20] staging: wilc1000: move static declaration of host_int_get_ipaddress

2015-12-30 Thread Chaehyun Lim
This patch moves static function declaration to front part of
host_interface.c file.

Signed-off-by: Chaehyun Lim 
---
 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 c8b4b32..5a97a9d 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -263,6 +263,7 @@ static struct wilc_vif *join_req_vif;
 #define FLUSHED_BYTE_POS 79
 
 static void *host_int_ParseJoinBssParam(tstrNetworkInfo *ptstrNetworkInfo);
+static int host_int_get_ipaddress(struct wilc_vif *vif, u8 *ip_addr, u8 idx);
 
 /* The u8IfIdx starts from 0 to NUM_CONCURRENT_IFC -1, but 0 index used as
  * special purpose in wilc device, so we add 1 to the index to starts from 1.
@@ -362,8 +363,6 @@ static s32 handle_set_operation_mode(struct wilc_vif *vif,
return result;
 }
 
-static int host_int_get_ipaddress(struct wilc_vif *vif, u8 *ip_addr, u8 idx);
-
 static s32 handle_set_ip_address(struct wilc_vif *vif, u8 *ip_addr, u8 idx)
 {
s32 result = 0;
-- 
2.6.4

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


[PATCH 10/20] staging: wilc1000: fix return type of wilc_setup_multicast_filter

2015-12-30 Thread Chaehyun Lim
This patch changes return type of wilc_setup_multicast_filter from s32
to int. The result variable gets return value from wilc_mq_send that has
return type of int. It should be changed return type of this function as
well as data type of result variable.

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

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 83ac21a..8e8e70e 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -4423,10 +4423,10 @@ int wilc_set_power_mgmt(struct wilc_vif *vif, bool 
enabled, u32 timeout)
return result;
 }
 
-s32 wilc_setup_multicast_filter(struct wilc_vif *vif, bool bIsEnabled,
+int wilc_setup_multicast_filter(struct wilc_vif *vif, bool bIsEnabled,
u32 u32count)
 {
-   s32 result = 0;
+   int result = 0;
struct host_if_msg msg;
struct set_multicast *pstrMulticastFilterParam = 
_info;
struct host_if_drv *hif_drv = vif->hif_drv;
diff --git a/drivers/staging/wilc1000/host_interface.h 
b/drivers/staging/wilc1000/host_interface.h
index 7b12425..52032be 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -352,7 +352,7 @@ int wilc_del_station(struct wilc_vif *vif, const u8 
*mac_addr);
 s32 wilc_edit_station(struct wilc_vif *vif,
  struct add_sta_param *pstrStaParams);
 int wilc_set_power_mgmt(struct wilc_vif *vif, bool enabled, u32 timeout);
-s32 wilc_setup_multicast_filter(struct wilc_vif *vif, bool bIsEnabled,
+int wilc_setup_multicast_filter(struct wilc_vif *vif, bool bIsEnabled,
u32 u32count);
 s32 wilc_setup_ipaddress(struct wilc_vif *vif, u8 *u16ipadd, u8 idx);
 s32 wilc_del_all_rx_ba_session(struct wilc_vif *vif, char *pBSSID, char TID);
-- 
2.6.4

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


[PATCH 11/20] staging: wilc1000: rename bIsEnabled in wilc_setup_multicast_filter

2015-12-30 Thread Chaehyun Lim
This patch renames bIsEnabled to enabled to avoid camelcase.

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

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 8e8e70e..a32e930 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -4423,7 +4423,7 @@ int wilc_set_power_mgmt(struct wilc_vif *vif, bool 
enabled, u32 timeout)
return result;
 }
 
-int wilc_setup_multicast_filter(struct wilc_vif *vif, bool bIsEnabled,
+int wilc_setup_multicast_filter(struct wilc_vif *vif, bool enabled,
u32 u32count)
 {
int result = 0;
@@ -4443,7 +4443,7 @@ int wilc_setup_multicast_filter(struct wilc_vif *vif, 
bool bIsEnabled,
msg.id = HOST_IF_MSG_SET_MULTICAST_FILTER;
msg.vif = vif;
 
-   pstrMulticastFilterParam->enabled = bIsEnabled;
+   pstrMulticastFilterParam->enabled = enabled;
pstrMulticastFilterParam->cnt = u32count;
 
result = wilc_mq_send(_msg_q, , sizeof(struct host_if_msg));
diff --git a/drivers/staging/wilc1000/host_interface.h 
b/drivers/staging/wilc1000/host_interface.h
index 52032be..9abdd3f 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -352,7 +352,7 @@ int wilc_del_station(struct wilc_vif *vif, const u8 
*mac_addr);
 s32 wilc_edit_station(struct wilc_vif *vif,
  struct add_sta_param *pstrStaParams);
 int wilc_set_power_mgmt(struct wilc_vif *vif, bool enabled, u32 timeout);
-int wilc_setup_multicast_filter(struct wilc_vif *vif, bool bIsEnabled,
+int wilc_setup_multicast_filter(struct wilc_vif *vif, bool enabled,
u32 u32count);
 s32 wilc_setup_ipaddress(struct wilc_vif *vif, u8 *u16ipadd, u8 idx);
 s32 wilc_del_all_rx_ba_session(struct wilc_vif *vif, char *pBSSID, char TID);
-- 
2.6.4

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


[PATCH 14/20] staging: wilc1000: fix return type of wilc_setup_ipaddress

2015-12-30 Thread Chaehyun Lim
This patch changes return type of wilc_setup_ipaddress from s32 to int.
The result variable gets return value from wilc_mq_send that has data
type of int. It should be changed return type of this function as well
as data type of result variable.

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

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index aeb3271..dacadc9 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -4638,9 +4638,9 @@ s32 wilc_del_all_rx_ba_session(struct wilc_vif *vif, char 
*pBSSID, char TID)
return result;
 }
 
-s32 wilc_setup_ipaddress(struct wilc_vif *vif, u8 *u16ipadd, u8 idx)
+int wilc_setup_ipaddress(struct wilc_vif *vif, u8 *u16ipadd, u8 idx)
 {
-   s32 result = 0;
+   int result = 0;
struct host_if_msg msg;
struct host_if_drv *hif_drv = vif->hif_drv;
 
diff --git a/drivers/staging/wilc1000/host_interface.h 
b/drivers/staging/wilc1000/host_interface.h
index 5c271b1..d36a9f5 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -354,7 +354,7 @@ s32 wilc_edit_station(struct wilc_vif *vif,
 int wilc_set_power_mgmt(struct wilc_vif *vif, bool enabled, u32 timeout);
 int wilc_setup_multicast_filter(struct wilc_vif *vif, bool enabled,
u32 count);
-s32 wilc_setup_ipaddress(struct wilc_vif *vif, u8 *u16ipadd, u8 idx);
+int wilc_setup_ipaddress(struct wilc_vif *vif, u8 *u16ipadd, u8 idx);
 s32 wilc_del_all_rx_ba_session(struct wilc_vif *vif, char *pBSSID, char TID);
 s32 wilc_remain_on_channel(struct wilc_vif *vif, u32 u32SessionID,
   u32 u32duration, u16 chan,
-- 
2.6.4

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


[PATCH 19/20] staging: wilc1000: rename u16ipadd in host_int_get_ipaddress

2015-12-30 Thread Chaehyun Lim
This patch renames u16ipadd to ip_addr to remove u16 prefix.
There is no need to use this prefix to show data type of this argument.

Signed-off-by: Chaehyun Lim 
---
 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 72115ae..c8b4b32 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -362,7 +362,7 @@ static s32 handle_set_operation_mode(struct wilc_vif *vif,
return result;
 }
 
-static int host_int_get_ipaddress(struct wilc_vif *vif, u8 *u16ipadd, u8 idx);
+static int host_int_get_ipaddress(struct wilc_vif *vif, u8 *ip_addr, u8 idx);
 
 static s32 handle_set_ip_address(struct wilc_vif *vif, u8 *ip_addr, u8 idx)
 {
@@ -4661,7 +4661,7 @@ int wilc_setup_ipaddress(struct wilc_vif *vif, u8 
*ip_addr, u8 idx)
return result;
 }
 
-static int host_int_get_ipaddress(struct wilc_vif *vif, u8 *u16ipadd, u8 idx)
+static int host_int_get_ipaddress(struct wilc_vif *vif, u8 *ip_addr, u8 idx)
 {
int result = 0;
struct host_if_msg msg;
@@ -4676,7 +4676,7 @@ static int host_int_get_ipaddress(struct wilc_vif *vif, 
u8 *u16ipadd, u8 idx)
 
msg.id = HOST_IF_MSG_GET_IPADDRESS;
 
-   msg.body.ip_info.ip_addr = u16ipadd;
+   msg.body.ip_info.ip_addr = ip_addr;
msg.vif = vif;
msg.body.ip_info.idx = idx;
 
-- 
2.6.4

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


[PATCH 17/20] staging: wilc1000: fix return type of host_int_get_ipaddress

2015-12-30 Thread Chaehyun Lim
This patch changes return type of host_int_get_ipaddress from s32 to
int. The result variable gets return value from wilc_mq_send that has
data type of int. It should be changed return type of this function as
well as data type of result variable.

Signed-off-by: Chaehyun Lim 
---
 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 90fdbdd..a203647 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -362,7 +362,7 @@ static s32 handle_set_operation_mode(struct wilc_vif *vif,
return result;
 }
 
-static s32 host_int_get_ipaddress(struct wilc_vif *vif,
+static int host_int_get_ipaddress(struct wilc_vif *vif,
  struct host_if_drv *hif_drv,
  u8 *u16ipadd, u8 idx);
 
@@ -4664,11 +4664,11 @@ int wilc_setup_ipaddress(struct wilc_vif *vif, u8 
*ip_addr, u8 idx)
return result;
 }
 
-static s32 host_int_get_ipaddress(struct wilc_vif *vif,
+static int host_int_get_ipaddress(struct wilc_vif *vif,
  struct host_if_drv *hif_drv,
  u8 *u16ipadd, u8 idx)
 {
-   s32 result = 0;
+   int result = 0;
struct host_if_msg msg;
 
if (!hif_drv) {
-- 
2.6.4

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


[PATCH 16/20] staging: wilc1000: remove return statement

2015-12-30 Thread Chaehyun Lim
This patch removes return statement that is always returned 0.
wilc_setup_ipaddress can not run to the end due to return statement.

Signed-off-by: Chaehyun Lim 
---
 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 0d41657..90fdbdd 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -4644,8 +4644,6 @@ int wilc_setup_ipaddress(struct wilc_vif *vif, u8 
*ip_addr, u8 idx)
struct host_if_msg msg;
struct host_if_drv *hif_drv = vif->hif_drv;
 
-   return 0;
-
if (!hif_drv) {
PRINT_ER("driver is null\n");
return -EFAULT;
-- 
2.6.4

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


[PATCH v4 3/3] wlcore/wl12xx: spi: add wifi support to cm-t335

2015-12-30 Thread Uri Mashiach
Device tree modifications:
- Pinmux for SPI0 and WiFi GPIOs.
- SPI0 node with wlcore as a child node.

Cc: Tony Lindgren 
Signed-off-by: Uri Mashiach 
---
v1 -> v2: Replace interrupts and interrupt-parent with interrupts-extended.
v2 -> v3: Move the pinctrl-0 = <_pins> to the wlcore node.
v3 -> v4: replace interrupts-extended with interrupts and interrupt-parent. 
(revert v2 modification).
  According to Rob Herring and 
Documentation/devicetree/bindings/interrupt-controller/interrupts.txt,
  interrupts-extended should only be used when a device has multiple 
interrupt parents.

 arch/arm/boot/dts/am335x-cm-t335.dts | 55 
 1 file changed, 55 insertions(+)

diff --git a/arch/arm/boot/dts/am335x-cm-t335.dts 
b/arch/arm/boot/dts/am335x-cm-t335.dts
index 42e9b66..65f1099 100644
--- a/arch/arm/boot/dts/am335x-cm-t335.dts
+++ b/arch/arm/boot/dts/am335x-cm-t335.dts
@@ -11,6 +11,7 @@
 /dts-v1/;
 
 #include "am33xx.dtsi"
+#include 
 
 / {
model = "CompuLab CM-T335";
@@ -40,6 +41,15 @@
regulator-max-microvolt = <330>;
};
 
+   /* Regulator for WiFi */
+   vwlan_fixed: fixedregulator@2 {
+   compatible = "regulator-fixed";
+   regulator-name = "vwlan_fixed";
+   gpio = < 20 GPIO_ACTIVE_HIGH>; /* gpio0_20 */
+   enable-active-high;
+   regulator-boot-off;
+   };
+
backlight {
compatible = "pwm-backlight";
pwms = < 0 5 0>;
@@ -223,6 +233,21 @@
>;
};
 
+   spi0_pins: pinmux_spi0_pins {
+   pinctrl-single,pins = <
+   /* spi0_sclk.spi0_sclk */
+   AM33XX_IOPAD(0x950, PIN_INPUT | MUX_MODE0)
+   /* spi0_d0.spi0_d0 */
+   AM33XX_IOPAD(0x954, PIN_OUTPUT_PULLUP | MUX_MODE0)
+   /* spi0_d1.spi0_d1 */
+   AM33XX_IOPAD(0x958, PIN_INPUT | MUX_MODE0)
+   /* spi0_cs0.spi0_cs0 */
+   AM33XX_IOPAD(0x95C, PIN_OUTPUT | MUX_MODE0)
+   /* spi0_cs1.spi0_cs1 */
+   AM33XX_IOPAD(0x960, PIN_OUTPUT | MUX_MODE0)
+   >;
+   };
+
/* wl1271 bluetooth */
bluetooth_pins: pinmux_bluetooth_pins {
pinctrl-single,pins = <
@@ -230,6 +255,16 @@
AM33XX_IOPAD(0x9b0, PIN_OUTPUT_PULLUP | MUX_MODE7)
>;
};
+
+   /* wl1271 WiFi */
+   wifi_pins: pinmux_wifi_pins {
+   pinctrl-single,pins = <
+   /* EMU1.gpio3_8 - WiFi IRQ */
+   AM33XX_IOPAD(0x9e8, PIN_INPUT_PULLUP | MUX_MODE7)
+   /* XDMA_EVENT_INTR1.gpio0_20 - WiFi enable */
+   AM33XX_IOPAD(0x9b4, PIN_OUTPUT | MUX_MODE7)
+   >;
+   };
 };
 
  {
@@ -394,3 +429,23 @@ status = "okay";
pinctrl-names = "default";
pinctrl-0 = <_pins>;
 };
+
+ {
+   status = "okay";
+   pinctrl-names = "default";
+   pinctrl-0 = <_pins>;
+   ti,pindir-d0-out-d1-in = <1>;
+   /* WLS1271 WiFi */
+   wlcore: wlcore@1 {
+   compatible = "ti,wl1271";
+   pinctrl-names = "default";
+   pinctrl-0 = <_pins>;
+   reg = <1>;
+   spi-max-frequency = <4800>;
+   clock-xtal;
+   ref-clock-frequency = <3840>;
+   interrupt-parent = <>;
+   interrupts = <8 IRQ_TYPE_LEVEL_HIGH>;
+   vwlan-supply = <_fixed>;
+   };
+};
-- 
2.5.0

--
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 v4 1/3] wlcore/wl12xx: spi: add power operation function

2015-12-30 Thread Uri Mashiach
The power function uses a consumer regulator access to update the WiFi
enable GPIO value.

Signed-off-by: Uri Mashiach 
---
v1 -> v2: oops fix was removed to a separate fix.
v2 -> v3: no changes
v3 -> v4: update devm_regulator_get() error handling.

 drivers/net/wireless/ti/wlcore/spi.c | 39 
 1 file changed, 39 insertions(+)

diff --git a/drivers/net/wireless/ti/wlcore/spi.c 
b/drivers/net/wireless/ti/wlcore/spi.c
index 44f059f..dec1512 100644
--- a/drivers/net/wireless/ti/wlcore/spi.c
+++ b/drivers/net/wireless/ti/wlcore/spi.c
@@ -30,6 +30,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "wlcore.h"
 #include "wl12xx_80211.h"
@@ -81,6 +82,7 @@
 struct wl12xx_spi_glue {
struct device *dev;
struct platform_device *core;
+   struct regulator *reg; /* Power regulator */
 };
 
 static void wl12xx_spi_reset(struct device *child)
@@ -318,11 +320,40 @@ static int __must_check wl12xx_spi_raw_write(struct 
device *child, int addr,
return 0;
 }
 
+/**
+ * wl12xx_spi_set_power - power on/off the wl12xx unit
+ * @child: wl12xx device handle.
+ * @enable: true/false to power on/off the unit.
+ *
+ * use the WiFi enable regulator to enable/disable the WiFi unit.
+ */
+static int wl12xx_spi_set_power(struct device *child, bool enable)
+{
+   int ret = 0;
+   struct wl12xx_spi_glue *glue = dev_get_drvdata(child->parent);
+
+   WARN_ON(!glue->reg);
+
+   /* Update regulator state */
+   if (enable) {
+   ret = regulator_enable(glue->reg);
+   if (ret)
+   dev_err(child, "Power enable failure\n");
+   } else {
+   ret =  regulator_disable(glue->reg);
+   if (ret)
+   dev_err(child, "Power disable failure\n");
+   }
+
+   return ret;
+}
+
 static struct wl1271_if_operations spi_ops = {
.read   = wl12xx_spi_raw_read,
.write  = wl12xx_spi_raw_write,
.reset  = wl12xx_spi_reset,
.init   = wl12xx_spi_init,
+   .power  = wl12xx_spi_set_power,
.set_block_size = NULL,
 };
 
@@ -353,6 +384,14 @@ static int wl1271_probe(struct spi_device *spi)
 * comes from the board-peripherals file */
spi->bits_per_word = 32;
 
+   glue->reg = devm_regulator_get(>dev, "vwlan");
+   if (PTR_ERR(glue->reg) == -EPROBE_DEFER)
+   return -EPROBE_DEFER;
+   if (IS_ERR(glue->reg)) {
+   dev_err(glue->dev, "can't get regulator\n");
+   return PTR_ERR(glue->reg);
+   }
+
ret = spi_setup(spi);
if (ret < 0) {
dev_err(glue->dev, "spi_setup failed\n");
-- 
2.5.0

--
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 v4 2/3] wlcore/wl12xx: spi: add device tree support

2015-12-30 Thread Uri Mashiach
Add DT support for the wl1271 SPI WiFi.

Add documentation file for the wl1271 SPI WiFi.

Signed-off-by: Uri Mashiach 
Acked-by: Rob Herring 
---
v1 -> v2: update interrupt documentation.
  replace interrupts and interrupt-parent with interrupts-extended.
  IRQ parameters retrieved from spi_device instead of DT.
  remove redundant #ifdef CONFIG_OF
v2 -> v3: Add MODULE_DEVICE_TABLE.
  Remove #ifdef CONFIG_OF.
  Make the Kconfig symbol to depend on OF.
  Replace irqd_get_trigger_type() with irq_get_trigger_type().
v3 -> v4: replace interrupts-extended with interrupts and interrupt-parent. 
(revert v2 modification).
  According to Rob Herring and 
Documentation/devicetree/bindings/interrupt-controller/interrupts.txt,
  interrupts-extended should only be used when a device has multiple 
interrupt parents.

 .../bindings/net/wireless/ti,wlcore,spi.txt| 36 +
 drivers/net/wireless/ti/wlcore/Kconfig |  2 +-
 drivers/net/wireless/ti/wlcore/spi.c   | 47 --
 3 files changed, 80 insertions(+), 5 deletions(-)
 create mode 100644 
Documentation/devicetree/bindings/net/wireless/ti,wlcore,spi.txt

diff --git a/Documentation/devicetree/bindings/net/wireless/ti,wlcore,spi.txt 
b/Documentation/devicetree/bindings/net/wireless/ti,wlcore,spi.txt
new file mode 100644
index 000..9180724
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/wireless/ti,wlcore,spi.txt
@@ -0,0 +1,36 @@
+* Texas Instruments wl1271 wireless lan controller
+
+The wl1271 chip can be connected via SPI or via SDIO. This
+document describes the binding for the SPI connected chip.
+
+Required properties:
+- compatible :  Should be "ti,wl1271"
+- reg : Chip select address of device
+- spi-max-frequency :   Maximum SPI clocking speed of device in Hz
+- ref-clock-frequency : Reference clock frequency
+- interrupt-parent, interrupts :
+Should contain parameters for 1 interrupt line.
+Interrupt parameters: parent, line number, type.
+- vwlan-supply :Point the node of the regulator that powers/enable the 
wl1271 chip
+
+Optional properties:
+- clock-xtal :  boolean, clock is generated from XTAL
+
+- Please consult Documentation/devicetree/bindings/spi/spi-bus.txt
+  for optional SPI connection related properties,
+
+Examples:
+
+ {
+   wl1271@1 {
+   compatible = "ti,wl1271";
+
+   reg = <1>;
+   spi-max-frequency = <4800>;
+   clock-xtal;
+   ref-clock-frequency = <3840>;
+   interrupt-parent = <>;
+   interrupts = <8 IRQ_TYPE_LEVEL_HIGH>;
+   vwlan-supply = <_fixed>;
+   };
+};
diff --git a/drivers/net/wireless/ti/wlcore/Kconfig 
b/drivers/net/wireless/ti/wlcore/Kconfig
index 7c09954..5918080 100644
--- a/drivers/net/wireless/ti/wlcore/Kconfig
+++ b/drivers/net/wireless/ti/wlcore/Kconfig
@@ -13,7 +13,7 @@ config WLCORE
 
 config WLCORE_SPI
tristate "TI wlcore SPI support"
-   depends on WLCORE && SPI_MASTER
+   depends on WLCORE && SPI_MASTER && OF
select CRC7
---help---
  This module adds support for the SPI interface of adapters using
diff --git a/drivers/net/wireless/ti/wlcore/spi.c 
b/drivers/net/wireless/ti/wlcore/spi.c
index dec1512..020ac1a 100644
--- a/drivers/net/wireless/ti/wlcore/spi.c
+++ b/drivers/net/wireless/ti/wlcore/spi.c
@@ -30,6 +30,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include "wlcore.h"
@@ -357,6 +358,39 @@ static struct wl1271_if_operations spi_ops = {
.set_block_size = NULL,
 };
 
+static const struct of_device_id wlcore_spi_of_match_table[] = {
+   { .compatible = "ti,wl1271" },
+   { }
+};
+MODULE_DEVICE_TABLE(of, wlcore_spi_of_match_table);
+
+/**
+ * wlcore_probe_of - DT node parsing.
+ * @spi: SPI slave device parameters.
+ * @res: resource parameters.
+ * @glue: wl12xx SPI bus to slave device glue parameters.
+ * @pdev_data: wlcore device parameters
+ */
+static int wlcore_probe_of(struct spi_device *spi, struct wl12xx_spi_glue 
*glue,
+  struct wlcore_platdev_data *pdev_data)
+{
+   struct device_node *dt_node = spi->dev.of_node;
+   int ret;
+
+   if (of_find_property(dt_node, "clock-xtal", NULL))
+   pdev_data->ref_clock_xtal = true;
+
+   ret = of_property_read_u32(dt_node, "ref-clock-frequency",
+  _data->ref_clock_freq);
+   if (IS_ERR_VALUE(ret)) {
+   dev_err(glue->dev,
+   "can't get reference clock frequency (%d)\n", ret);
+   return ret;
+   }
+
+   return 0;
+}
+
 static int wl1271_probe(struct spi_device *spi)
 {
struct wl12xx_spi_glue *glue;
@@ -366,8 +400,6 @@ static int wl1271_probe(struct spi_device *spi)
 
   

[PATCH v4 0/3] wlcore/wl12xx: spi: add wifi support to cm-t335

2015-12-30 Thread Uri Mashiach
Add DT support for WLS1271 SPI driver.
Add power operation function to the WLS1271 SPI driver.

Uri Mashiach (3):
  wlcore/wl12xx: spi: add power operation function
  wlcore/wl12xx: spi: add device tree support
  wlcore/wl12xx: spi: add wifi support to cm-t335

 .../bindings/net/wireless/ti,wlcore,spi.txt| 36 +
 arch/arm/boot/dts/am335x-cm-t335.dts   | 55 ++
 drivers/net/wireless/ti/wlcore/Kconfig |  2 +-
 drivers/net/wireless/ti/wlcore/spi.c   | 86 +-
 4 files changed, 174 insertions(+), 5 deletions(-)
 create mode 100644 
Documentation/devicetree/bindings/net/wireless/ti,wlcore,spi.txt

-- 
2.5.0

--
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] mwifiex: correctly handling kzalloc

2015-12-30 Thread Kalle Valo
Andy Shevchenko  writes:

> On Tue, Dec 29, 2015 at 10:17 PM, Insu Yun  wrote:
>
> Empty commit message?

Yeah, no empty commit log, please.

And then you submit a new version remember to add v2, v3 and so on:

http://kernelnewbies.org/FirstKernelPatch#head-5c81b3c517a1d0bbc24f92594cb734e155fcbbcb

-- 
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 1/3] mwifiex: fix misleading firmware download messages

2015-12-30 Thread Amitkumar Karwar
From: chunfan chen 

mwifiex_check_fw_status() checks firmware status and also
check if WLAN is the winner for firmware downloading.

Once we detect that other interface is downloading
the firmware, we call this routine again with max
poll count to wait until firmware is ready.

This patch splits the routine to avoid checking
winner status multiple times and ensures that
correct warning messages are displayed.

Firmware status poll count is also increased to 150.

Signed-off-by: chunfan chen 
Signed-off-by: Amitkumar Karwar 
---
 drivers/net/wireless/marvell/mwifiex/fw.h   |  2 +-
 drivers/net/wireless/marvell/mwifiex/init.c | 16 +---
 drivers/net/wireless/marvell/mwifiex/main.h |  1 +
 drivers/net/wireless/marvell/mwifiex/pcie.c | 40 +
 drivers/net/wireless/marvell/mwifiex/sdio.c | 33 ++--
 5 files changed, 57 insertions(+), 35 deletions(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/fw.h 
b/drivers/net/wireless/marvell/mwifiex/fw.h
index ced7af2..426e76a 100644
--- a/drivers/net/wireless/marvell/mwifiex/fw.h
+++ b/drivers/net/wireless/marvell/mwifiex/fw.h
@@ -96,7 +96,7 @@ enum KEY_TYPE_ID {
 #define WAPI_KEY_LEN   (WLAN_KEY_LEN_SMS4 + PN_LEN + 2)
 
 #define MAX_POLL_TRIES 100
-#define MAX_FIRMWARE_POLL_TRIES100
+#define MAX_FIRMWARE_POLL_TRIES150
 
 #define FIRMWARE_READY_SDIO0xfedc
 #define FIRMWARE_READY_PCIE0xfedcba00
diff --git a/drivers/net/wireless/marvell/mwifiex/init.c 
b/drivers/net/wireless/marvell/mwifiex/init.c
index 6f7876e..517653b 100644
--- a/drivers/net/wireless/marvell/mwifiex/init.c
+++ b/drivers/net/wireless/marvell/mwifiex/init.c
@@ -741,8 +741,6 @@ int mwifiex_dnld_fw(struct mwifiex_adapter *adapter,
u32 poll_num = 1;
 
if (adapter->if_ops.check_fw_status) {
-   adapter->winner = 0;
-
/* check if firmware is already running */
ret = adapter->if_ops.check_fw_status(adapter, poll_num);
if (!ret) {
@@ -750,13 +748,23 @@ int mwifiex_dnld_fw(struct mwifiex_adapter *adapter,
"WLAN FW already running! Skip FW dnld\n");
return 0;
}
+   }
+
+   /* check if we are the winner for downloading FW */
+   if (adapter->if_ops.check_winner_status) {
+   adapter->winner = 0;
+   ret = adapter->if_ops.check_winner_status(adapter);
 
poll_num = MAX_FIRMWARE_POLL_TRIES;
+   if (ret) {
+   mwifiex_dbg(adapter, MSG,
+   "WLAN read winner status failed!\n");
+   return ret;
+   }
 
-   /* check if we are the winner for downloading FW */
if (!adapter->winner) {
mwifiex_dbg(adapter, MSG,
-   "FW already running! Skip FW dnld\n");
+   "WLAN is not the winner! Skip FW dnld\n");
goto poll_fw;
}
}
diff --git a/drivers/net/wireless/marvell/mwifiex/main.h 
b/drivers/net/wireless/marvell/mwifiex/main.h
index 2f7f478..c08be79 100644
--- a/drivers/net/wireless/marvell/mwifiex/main.h
+++ b/drivers/net/wireless/marvell/mwifiex/main.h
@@ -791,6 +791,7 @@ struct mwifiex_if_ops {
int (*init_if) (struct mwifiex_adapter *);
void (*cleanup_if) (struct mwifiex_adapter *);
int (*check_fw_status) (struct mwifiex_adapter *, u32);
+   int (*check_winner_status)(struct mwifiex_adapter *);
int (*prog_fw) (struct mwifiex_adapter *, struct mwifiex_fw_image *);
int (*register_dev) (struct mwifiex_adapter *);
void (*unregister_dev) (struct mwifiex_adapter *);
diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c 
b/drivers/net/wireless/marvell/mwifiex/pcie.c
index 9703848..4000357 100644
--- a/drivers/net/wireless/marvell/mwifiex/pcie.c
+++ b/drivers/net/wireless/marvell/mwifiex/pcie.c
@@ -2007,14 +2007,12 @@ done:
 
 /*
  * This function checks the firmware status in card.
- *
- * The winner interface is also determined by this function.
  */
 static int
 mwifiex_check_fw_status(struct mwifiex_adapter *adapter, u32 poll_num)
 {
int ret = 0;
-   u32 firmware_stat, winner_status;
+   u32 firmware_stat;
struct pcie_service_card *card = adapter->card;
const struct mwifiex_pcie_card_reg *reg = card->pcie.reg;
u32 tries;
@@ -2054,19 +2052,28 @@ mwifiex_check_fw_status(struct mwifiex_adapter 
*adapter, u32 poll_num)
}
}
 
-   if (ret) {
-   if (mwifiex_read_reg(adapter, reg->fw_status,
-_status))
-   ret = -1;
-   else if 

[PATCH 2/3] mwifiex: fix IBSS data path issue.

2015-12-30 Thread Amitkumar Karwar
From: chunfan chen 

The port_open flag is not applicable for IBSS mode. IBSS data
path was broken when port_open flag was introduced.
This patch fixes the problem by correcting the checks.

Fixes: 5c8946330abfa4c ("mwifiex: enable traffic only when port is open")
Signed-off-by: chunfan chen 
Signed-off-by: Amitkumar Karwar 
---
 drivers/net/wireless/marvell/mwifiex/sta_event.c | 10 ++
 drivers/net/wireless/marvell/mwifiex/wmm.c   |  6 --
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/sta_event.c 
b/drivers/net/wireless/marvell/mwifiex/sta_event.c
index ff3ee9d..23bae87 100644
--- a/drivers/net/wireless/marvell/mwifiex/sta_event.c
+++ b/drivers/net/wireless/marvell/mwifiex/sta_event.c
@@ -607,11 +607,13 @@ int mwifiex_process_sta_event(struct mwifiex_private 
*priv)
 
case EVENT_PS_AWAKE:
mwifiex_dbg(adapter, EVENT, "info: EVENT: AWAKE\n");
-   if (!adapter->pps_uapsd_mode && priv->port_open &&
+   if (!adapter->pps_uapsd_mode &&
+   (priv->port_open ||
+(priv->bss_mode == NL80211_IFTYPE_ADHOC)) &&
priv->media_connected && adapter->sleep_period.period) {
-   adapter->pps_uapsd_mode = true;
-   mwifiex_dbg(adapter, EVENT,
-   "event: PPS/UAPSD mode 
activated\n");
+   adapter->pps_uapsd_mode = true;
+   mwifiex_dbg(adapter, EVENT,
+   "event: PPS/UAPSD mode activated\n");
}
adapter->tx_lock_flag = false;
if (adapter->pps_uapsd_mode && adapter->gen_null_pkt) {
diff --git a/drivers/net/wireless/marvell/mwifiex/wmm.c 
b/drivers/net/wireless/marvell/mwifiex/wmm.c
index acccd67..499e5a7 100644
--- a/drivers/net/wireless/marvell/mwifiex/wmm.c
+++ b/drivers/net/wireless/marvell/mwifiex/wmm.c
@@ -475,7 +475,8 @@ mwifiex_wmm_lists_empty(struct mwifiex_adapter *adapter)
priv = adapter->priv[i];
if (!priv)
continue;
-   if (!priv->port_open)
+   if (!priv->port_open &&
+   (priv->bss_mode != NL80211_IFTYPE_ADHOC))
continue;
if (adapter->if_ops.is_port_ready &&
!adapter->if_ops.is_port_ready(priv))
@@ -1099,7 +1100,8 @@ mwifiex_wmm_get_highest_priolist_ptr(struct 
mwifiex_adapter *adapter,
 
priv_tmp = adapter->bss_prio_tbl[j].bss_prio_cur->priv;
 
-   if (!priv_tmp->port_open ||
+   if (((priv_tmp->bss_mode != NL80211_IFTYPE_ADHOC) &&
+!priv_tmp->port_open) ||
(atomic_read(_tmp->wmm.tx_pkts_queued) == 0))
continue;
 
-- 
1.8.1.4

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


[PATCH 3/3] mwifiex: add debugfs file to read chip information

2015-12-30 Thread Amitkumar Karwar
From: Xinming Hu 

This patch add 'verext' debugfs item, which can be used to
get detailed chip specific information from our firmware.

Examples:
echo "1" > /sys/kernel/debug/mwifiex/mlan0/verext
cat /sys/kernel/debug/mwifiex/mlan0/verext

Signed-off-by: Shengzhen Li 
Signed-off-by: Amitkumar Karwar 
---
 drivers/net/wireless/marvell/mwifiex/README  | 10 +
 drivers/net/wireless/marvell/mwifiex/debugfs.c   | 51 +++-
 drivers/net/wireless/marvell/mwifiex/main.h  |  3 +-
 drivers/net/wireless/marvell/mwifiex/sta_ioctl.c |  3 +-
 4 files changed, 63 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/README 
b/drivers/net/wireless/marvell/mwifiex/README
index 2f0f9b5..24e649b 100644
--- a/drivers/net/wireless/marvell/mwifiex/README
+++ b/drivers/net/wireless/marvell/mwifiex/README
@@ -237,4 +237,14 @@ device_dump
 
cat fw_dump
 
+verext
+   This command is used to get extended firmware version string using
+   different configuration parameters.
+
+   Usage:
+   echo "[version_str_sel]" > verext
+   cat verext
+
+   [version_str_sel]: firmware support several extend version
+  string cases, include 0/1/10/20/21/99
 ===
diff --git a/drivers/net/wireless/marvell/mwifiex/debugfs.c 
b/drivers/net/wireless/marvell/mwifiex/debugfs.c
index 5e55629..13fe384 100644
--- a/drivers/net/wireless/marvell/mwifiex/debugfs.c
+++ b/drivers/net/wireless/marvell/mwifiex/debugfs.c
@@ -95,8 +95,7 @@ mwifiex_info_read(struct file *file, char __user *ubuf,
 
mwifiex_drv_get_driver_version(priv->adapter, fmt, sizeof(fmt) - 1);
 
-   if (!priv->version_str[0])
-   mwifiex_get_ver_ext(priv);
+   mwifiex_get_ver_ext(priv, 0);
 
p += sprintf(p, "driver_name = " "\"mwifiex\"\n");
p += sprintf(p, "driver_version = %s", fmt);
@@ -596,6 +595,52 @@ done:
return ret;
 }
 
+/* debugfs verext file write handler.
+ * This function is called when the 'verext' file is opened for write
+ */
+static ssize_t
+mwifiex_verext_write(struct file *file, const char __user *ubuf,
+size_t count, loff_t *ppos)
+{
+   int ret;
+   u32 versionstrsel;
+   struct mwifiex_private *priv = (void *)file->private_data;
+   char buf[16];
+
+   memset(buf, 0, sizeof(buf));
+
+   if (copy_from_user(, ubuf, min_t(size_t, sizeof(buf) - 1, count)))
+   return -EFAULT;
+
+   ret = kstrtou32(buf, 10, );
+   if (ret)
+   return ret;
+
+   priv->versionstrsel = versionstrsel;
+
+   return count;
+}
+
+/* Proc verext file read handler.
+ * This function is called when the 'verext' file is opened for reading
+ * This function can be used read driver exteneed verion string.
+ */
+static ssize_t
+mwifiex_verext_read(struct file *file, char __user *ubuf,
+   size_t count, loff_t *ppos)
+{
+   struct mwifiex_private *priv =
+   (struct mwifiex_private *)file->private_data;
+   char buf[256];
+   int ret;
+
+   mwifiex_get_ver_ext(priv, priv->versionstrsel);
+   ret = snprintf(buf, sizeof(buf), "version string: %s\n",
+  priv->version_str);
+
+   return simple_read_from_buffer(ubuf, count, ppos, buf, ret);
+}
+
 /* Proc memrw file write handler.
  * This function is called when the 'memrw' file is opened for writing
  * This function can be used to write to a memory location.
@@ -972,6 +1017,7 @@ MWIFIEX_DFS_FILE_OPS(histogram);
 MWIFIEX_DFS_FILE_OPS(debug_mask);
 MWIFIEX_DFS_FILE_OPS(timeshare_coex);
 MWIFIEX_DFS_FILE_WRITE_OPS(reset);
+MWIFIEX_DFS_FILE_OPS(verext);
 
 /*
  * This function creates the debug FS directory structure and the files.
@@ -1000,6 +1046,7 @@ mwifiex_dev_debugfs_init(struct mwifiex_private *priv)
MWIFIEX_DFS_ADD_FILE(debug_mask);
MWIFIEX_DFS_ADD_FILE(timeshare_coex);
MWIFIEX_DFS_ADD_FILE(reset);
+   MWIFIEX_DFS_ADD_FILE(verext);
 }
 
 /*
diff --git a/drivers/net/wireless/marvell/mwifiex/main.h 
b/drivers/net/wireless/marvell/mwifiex/main.h
index c08be79..35ab052 100644
--- a/drivers/net/wireless/marvell/mwifiex/main.h
+++ b/drivers/net/wireless/marvell/mwifiex/main.h
@@ -616,6 +616,7 @@ struct mwifiex_private {
spinlock_t curr_bcn_buf_lock;
struct wireless_dev wdev;
struct mwifiex_chan_freq_power cfp;
+   u32 versionstrsel;
char version_str[128];
 #ifdef CONFIG_DEBUG_FS
struct dentry *dfs_dev_dir;
@@ -1418,7 +1419,7 @@ int mwifiex_set_encode(struct mwifiex_private *priv, 
struct key_params *kp,
 
 int mwifiex_set_gen_ie(struct mwifiex_private *priv, const u8 *ie, int ie_len);
 
-int mwifiex_get_ver_ext(struct mwifiex_private *priv);
+int mwifiex_get_ver_ext(struct mwifiex_private *priv, u32 version_str_sel);
 

Re: [01/14] mwifiex: change ap and station interface limits

2015-12-30 Thread Kalle Valo

> From: Shengzhen Li 
> 
> ap/station interface limit has been changed to allow
> creating maximum 3 interfaces.
> 
> Signed-off-by: Shengzhen Li 
> Signed-off-by: Amitkumar Karwar 

Thanks, 14 patches applied to wireless-drivers-next.git:

eb5d912e1564 mwifiex: change ap and station interface limits
5b13d3e1f926 mwifiex: multiple bss support
5eab67779974 mwifiex: advertise SMS4 cipher suite
c8ac6a8ee8e7 mwifiex: fix bug for wildcard-prefix wowlan pattern
b0922ffa706b mwifiex: increase supported wowlan pattern length
abffd274a243 mwifiex: abort cac in del_station() handler
bd642acf3213 mwifiex: suppress "Rx of mgmt packet failed" message
47f336d7e0df mwifiex: remove redundant timestamp assignment
76ae3e26ea43 mwifiex: add debugfs file for testing reset of card
776f742040ca mwifiex: fix AMPDU not setup on TDLS link problem
7f3f1245ffcd mwifiex: fix wake on disconnect feature
610d0af8e8d2 mwifiex: update region_code_index array
19b0a71017aa mwifiex: use world for unidentified region code
84a38fb3167e mwifiex: fix WPA connection problem

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 02/14] mwifiex: multiple bss support

2015-12-30 Thread Kalle Valo
Amitkumar Karwar  writes:

> From: Shengzhen Li 
>
> This patch fixes issues observed while starting 3 different
> bss simultaneously, eg, 2 AP + 1 STA or 3 AP
>
> Signed-off-by: Amitkumar Karwar 

I applied this already but I want to point out still that the title is
quite vague. For example, "mwifiex: fix an issue with 3 simultaneous
bss" would have been more informative.

-- 
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: [1/8] rtlwifi: rtl8723be: Fix module parameter initialization

2015-12-30 Thread Kalle Valo

> This driver has a number of errors in the module initialization. These
> include the following:
> 
> Parameter msi_support is stored in two places - one is removed.
> Paramters sw_crypto and disable_watchdog were never stored in the final
> locations, nor were they initialized properly.
> 
> Signed-off-by: Larry Finger 
> Cc: Stable 

Thanks, 8 patches applied to wireless-drivers-next.git:

7079604ddb83 rtlwifi: rtl8723be: Fix module parameter initialization
793b09994211 rtlwifi: rtl8723ae: Fix initialization of module parameters
78bae1de422a rtlwifi: rtl8821ae: Fix errors in parameter initialization
06f34572c611 rtlwifi: rtl8188ee: Fix module parameter initialization
d4d60b4caaa5 rtlwifi: rtl8192de: Fix incorrect module parameter descriptions
7503efbd82c1 rtlwifi: rtl8192se: Fix module parameter initialization
b24f19f16b9e rtlwifi: rtl8192ce: Fix handling of module parameters
b68d0ae7e586 rtlwifi: rtl8192cu: Add missing parameter setup

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] wlcore/wl12xx: spi: fix NULL pointer dereference (Oops)

2015-12-30 Thread Kalle Valo
Uri Mashiach  writes:

> Fix the below Oops when trying to modprobe wlcore_spi.
> The oops occurs because the wl1271_power_{off,on}()
> function doesn't check the power() function pointer.
>
> [   23.401447] Unable to handle kernel NULL pointer dereference at
> virtual address 
> [   23.409954] pgd = c0004000
> [   23.412922] [] *pgd=
> [   23.416693] Internal error: Oops: 8007 [#1] SMP ARM
> [   23.422168] Modules linked in: wl12xx wlcore mac80211 cfg80211
> musb_dsps musb_hdrc usbcore usb_common snd_soc_simple_card evdev joydev
> omap_rng wlcore_spi snd_soc_tlv320aic23_i2c rng_core snd_soc_tlv320aic23
> c_can_platform c_can can_dev snd_soc_davinci_mcasp snd_soc_edma
> snd_soc_omap omap_wdt musb_am335x cpufreq_dt thermal_sys hwmon
> [   23.453253] CPU: 0 PID: 36 Comm: kworker/0:2 Not tainted
> 4.2.0-2-g951efee-dirty #233
> [   23.461720] Hardware name: Generic AM33XX (Flattened Device Tree)
> [   23.468123] Workqueue: events request_firmware_work_func
> [   23.473690] task: de32efc0 ti: de4ee000 task.ti: de4ee000
> [   23.479341] PC is at 0x0
> [   23.482112] LR is at wl12xx_set_power_on+0x28/0x124 [wlcore]
> [   23.488074] pc : [<>]lr : []psr: 6013
> [   23.488074] sp : de4efe50  ip : 0002  fp : 
> [   23.500162] r10: de7cdd00  r9 : dc848800  r8 : bf27af00
> [   23.505663] r7 : bf27a1a8  r6 : dcbd8a80  r5 : dce0e2e0  r4 :
> dce0d2e0
> [   23.512536] r3 :   r2 :   r1 : 0001  r0 :
> dc848810
> [   23.519412] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM
> Segment kernel
> [   23.527109] Control: 10c5387d  Table: 9cb78019  DAC: 0015
> [   23.533160] Process kworker/0:2 (pid: 36, stack limit = 0xde4ee218)
> [   23.539760] Stack: (0xde4efe50 to 0xde4f)
>
> [...]
>
> [   23.665030] [] (wl12xx_set_power_on [wlcore]) from
> [] (wlcore_nvs_cb+0x118/0xa4c [wlcore])
> [   23.675604] [] (wlcore_nvs_cb [wlcore]) from []
> (request_firmware_work_func+0x30/0x58)
> [   23.685784] [] (request_firmware_work_func) from
> [] (process_one_work+0x1b4/0x4b4)
> [   23.695591] [] (process_one_work) from []
> (worker_thread+0x3c/0x4a4)
> [   23.704124] [] (worker_thread) from []
> (kthread+0xd4/0xf0)
> [   23.711747] [] (kthread) from []
> (ret_from_fork+0x14/0x3c)
> [   23.719357] Code: bad PC value
> [   23.722760] ---[ end trace 981be8510db9b3a9 ]---
>
> Prevent oops by validationg power() pointer value before
> calling the function.
>
> Signed-off-by: Uri Mashiach 
> Cc: sta...@vger.kernel.org
> Acked-by: Igor Grinberg 

Please always provide a changelog when you resend patches, I lost track
what I'm supposed to do with this. Should I apply or drop?

-- 
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: [1/4] mwifiex: fix potential integer truncation

2015-12-30 Thread Kalle Valo

> From: chunfan chen 
> 
> At some places, ie length is truncated from u16 to u8 while
> storing it to driver's internal variable. This patch fixes
> the problem.
> 
> Signed-off-by: chunfan chen 
> Signed-off-by: Amitkumar Karwar 

Thanks, 4 patches applied to wireless-drivers-next.git:

1d8f5c138540 mwifiex: fix potential integer truncation
ce0c58d99841 mwifiex: fix PCIe register information for 8997 chipset
f3b35f280968 mwifiex: add missing check for PCIe8997 chipset
7be0f5b5e169 mwifiex: enable MSI interrupt support in pcie

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: rsi: consolidate kmalloc/memset 0 calls to kzalloc

2015-12-30 Thread Kalle Valo

> This is an API consolidation only. The use of kmalloc + memset to 0
> is equivalent to kzalloc.
> 
> Signed-off-by: Nicholas Mc Guire 

Thanks, applied to wireless-drivers-next.git.

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: rsi: bool tests do not need comparison

2015-12-30 Thread Kalle Valo

> This is an API consolidation only. Bool initializations should 
> use true and false thus bool tests don't need an explicit comparison.
> 
> Signed-off-by: Nicholas Mc Guire 

Thanks, applied to wireless-drivers-next.git.

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: rtlwifi: rtl_pci: Fix kernel panic

2015-12-30 Thread Kalle Valo

> In commit 38506ecefab9 (rtlwifi: rtl_pci: Start modification for new
> drivers), a bug was introduced that causes a NULL pointer dereference.
> As this bug only affects the infrequently used RTL8192EE and only under
> low-memory conditions, it has taken a long time for the bug to show up.
> 
> The bug was reported on the linux-wireless mailing list and also at
> https://bugs.launchpad.net/ubuntu/+source/ubuntu-release-upgrader/ as
> bug #1527603 (kernel crashes due to rtl8192ee driver on ubuntu 15.10).
> 
> Fixes: 38506ecefab9 ("rtlwifi: rtl_pci: Start modification for new drivers")
> Signed-off-by: Larry Finger 
> Cc: Stable 

Thanks, applied to wireless-drivers-next.git.

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