Re: [rt2x00-users] [PATCH] wireless: Remove unnessary write over of register 11 in rt2800lib.c

2014-09-28 Thread Stanislaw Gruszka
On Sat, Sep 27, 2014 at 05:11:41PM -0400, Nicholas Krause wrote:
> This removes the unnecessary  overwrite of register 11 in the function,
> rt2800_config_channel as we are already writing a correct value to the
> register with rt2800_rfcsr_write(rt2x00dev,11.rfcsr).
What make you sure that overwrite is unnecessary ?

> 
> Signed-off-by: Nicholas Krause 
> ---
>  drivers/net/wireless/rt2x00/rt2800lib.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c 
> b/drivers/net/wireless/rt2x00/rt2800lib.c
> index 893c9d5..fb0ae38 100644
> --- a/drivers/net/wireless/rt2x00/rt2800lib.c
> +++ b/drivers/net/wireless/rt2x00/rt2800lib.c
> @@ -2787,8 +2787,6 @@ static void rt2800_config_channel_rf55xx(struct 
> rt2x00_dev *rt2x00dev,
>  
>   if (rf->channel <= 14) {
>   rt2800_rfcsr_write(rt2x00dev, 10, 0x90);
> - /* FIXME: RF11 owerwrite ? */
> - rt2800_rfcsr_write(rt2x00dev, 11, 0x4A);
We need a prove that remove is correct, i.e. some reference to 
vendor code or spec that current writing register twice with
different values is wrong.

NACK for the patch.

Stanislaw
--
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: [rt2x00-users] [PATCH] wireless: Remove unnessary write over of register 11 in rt2800lib.c

2014-09-28 Thread Denis Kirjanov
Or someone with the hardware has to test and check that...

On 9/28/14, Stanislaw Gruszka  wrote:
> On Sat, Sep 27, 2014 at 05:11:41PM -0400, Nicholas Krause wrote:
>> This removes the unnecessary  overwrite of register 11 in the function,
>> rt2800_config_channel as we are already writing a correct value to the
>> register with rt2800_rfcsr_write(rt2x00dev,11.rfcsr).
> What make you sure that overwrite is unnecessary ?
>
>>
>> Signed-off-by: Nicholas Krause 
>> ---
>>  drivers/net/wireless/rt2x00/rt2800lib.c | 2 --
>>  1 file changed, 2 deletions(-)
>>
>> diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c
>> b/drivers/net/wireless/rt2x00/rt2800lib.c
>> index 893c9d5..fb0ae38 100644
>> --- a/drivers/net/wireless/rt2x00/rt2800lib.c
>> +++ b/drivers/net/wireless/rt2x00/rt2800lib.c
>> @@ -2787,8 +2787,6 @@ static void rt2800_config_channel_rf55xx(struct
>> rt2x00_dev *rt2x00dev,
>>
>>  if (rf->channel <= 14) {
>>  rt2800_rfcsr_write(rt2x00dev, 10, 0x90);
>> -/* FIXME: RF11 owerwrite ? */
>> -rt2800_rfcsr_write(rt2x00dev, 11, 0x4A);
> We need a prove that remove is correct, i.e. some reference to
> vendor code or spec that current writing register twice with
> different values is wrong.
>
> NACK for the patch.
>
> Stanislaw
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
--
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] bcma: use device from DT (brcm,bus-gpio) for SoC GPIO chip

2014-09-28 Thread Rafał Miłecki
This will allow us to define GPIO-attached devices (LEDs, buttons) in
the the device tree.

Signed-off-by: Rafał Miłecki 
---
This is based on top of
[PATCH v6] bcma: register bcma as device tree driver
that I hope will reach wireless-next git tree.

V2: Describe axi chilren and make gpio a child of chipcommon core.
---
 Documentation/devicetree/bindings/bus/bcma.txt | 24 
 drivers/bcma/driver_gpio.c |  5 +
 2 files changed, 29 insertions(+)

diff --git a/Documentation/devicetree/bindings/bus/bcma.txt 
b/Documentation/devicetree/bindings/bus/bcma.txt
index e9070c1..26ef4b7 100644
--- a/Documentation/devicetree/bindings/bus/bcma.txt
+++ b/Documentation/devicetree/bindings/bus/bcma.txt
@@ -9,6 +9,22 @@ Required properties:
 The cores on the AXI bus are automatically detected by bcma with the
 memory ranges they are using and they get registered afterwards.
 
+The top-level axi bus may contain children representing attached cores
+(devices). This is needed since some hardware details can't be auto
+detected (e.g. IRQ numbers).
+
+There is also one special core called ChipCommon that may contain some
+extra sub-devices. This is because some devices (e.g. GPIO chip) are
+not standalone cores and can be access using ChipCommon regs only.
+Possible ChipCommon children:
+
+- gpio: GPIO chip on the SoC
+
+  Required properties:
+  - compatible: "brcm,bus-gpio"
+  - gpio-controller : makes the node a GPIO controller
+  - #gpio-cells : size of the GPIO specifier, must be 2
+
 Example:
 
axi@1800 {
@@ -17,4 +33,12 @@ Example:
ranges = <0x 0x1800 0x0010>;
#address-cells = <1>;
#size-cells = <1>;
+
+   chipcommon@0 {
+   gpio@0 {
+   compatible = "brcm,bus-gpio";
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+   };
};
diff --git a/drivers/bcma/driver_gpio.c b/drivers/bcma/driver_gpio.c
index 8ea497c..7ae39a8 100644
--- a/drivers/bcma/driver_gpio.c
+++ b/drivers/bcma/driver_gpio.c
@@ -218,6 +218,11 @@ int bcma_gpio_init(struct bcma_drv_cc *cc)
 #if IS_BUILTIN(CONFIG_BCM47XX)
chip->to_irq= bcma_gpio_to_irq;
 #endif
+#if IS_BUILTIN(CONFIG_OF)
+   if (cc->core->bus->hosttype == BCMA_HOSTTYPE_SOC)
+   chip->of_node   = of_find_compatible_node(NULL, NULL,
+ "brcm,bus-gpio");
+#endif
switch (cc->core->bus->chipinfo.id) {
case BCMA_CHIP_ID_BCM5357:
case BCMA_CHIP_ID_BCM53572:
-- 
1.8.4.5

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


Re: [rt2x00-users] [PATCH] wireless: Remove unnessary write over of register 11 in rt2800lib.c

2014-09-28 Thread Stanislaw Gruszka
On Sun, Sep 28, 2014 at 12:05:30PM +0400, Denis Kirjanov wrote:
> Or someone with the hardware has to test and check that...

... on all possible combinations of channel, bandwidth, signal strength, 
modulation type, ...

Stanislaw

--
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] MAINTAINERS: change rt2x00 maintainer

2014-09-28 Thread Stanislaw Gruszka
After short chat with Ivo, we decided that I'll take maintenance
of rt2x00 driver.

Thanks for Ivo's great work in the past!

Signed-off-by: Stanislaw Gruszka 
---
 MAINTAINERS | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 79cd603..980f609 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -7492,13 +7492,12 @@ F:  drivers/video/fbdev/aty/aty128fb.c
 
 RALINK RT2X00 WIRELESS LAN DRIVER
 P: rt2x00 project
-M: Ivo van Doorn 
+M: Stanislaw Gruszka 
 M: Helmut Schaa 
 L: linux-wireless@vger.kernel.org
 L: us...@rt2x00.serialmonkey.com (moderated for non-subscribers)
 W: http://rt2x00.serialmonkey.com/
 S: Maintained
-T: git git://git.kernel.org/pub/scm/linux/kernel/git/ivd/rt2x00.git
 F: drivers/net/wireless/rt2x00/
 
 RAMDISK RAM BLOCK DEVICE DRIVER
-- 
1.8.3.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: [rt2x00-users] [PATCH] MAINTAINERS: change rt2x00 maintainer

2014-09-28 Thread Peter Stuge
Stanislaw Gruszka wrote:
> After short chat with Ivo, we decided that I'll take maintenance
> of rt2x00 driver.
> 
> Thanks for Ivo's great work in the past!
> 
> Signed-off-by: Stanislaw Gruszka 

I would have been a whole lot happier to see this patch from Ivo.

Nothing whatsoever against you Stanislaw - I am sure that you are
doing and will do a good job.


//Peter
--
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/16] ath5k: update dependencies

2014-09-28 Thread Sergey Ryazanov
- Use config symbol defined in the driver instead of arch specific one for
  conditional compilation.
- Rename the ATHEROS_AR231X config symbol to AR231X.
- Some of AR231x SoCs (e.g. AR2315) have PCI bus support, so remove !PCI
  dependency, which block AHB support build.

Signed-off-by: Sergey Ryazanov 
Cc: Jiri Slaby 
Cc: Nick Kossifidis 
Cc: "Luis R. Rodriguez" 
Cc: linux-wireless@vger.kernel.org
Cc: ath5k-de...@lists.ath5k.org
---

Changes since RFC:
  - merge together patches that update ath5k dependencies

 drivers/net/wireless/ath/ath5k/Kconfig | 10 +-
 drivers/net/wireless/ath/ath5k/ath5k.h |  2 +-
 drivers/net/wireless/ath/ath5k/base.c  |  4 ++--
 drivers/net/wireless/ath/ath5k/led.c   |  4 ++--
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/ath/ath5k/Kconfig 
b/drivers/net/wireless/ath/ath5k/Kconfig
index c9f81a3..2b2a399 100644
--- a/drivers/net/wireless/ath/ath5k/Kconfig
+++ b/drivers/net/wireless/ath/ath5k/Kconfig
@@ -1,13 +1,13 @@
 config ATH5K
tristate "Atheros 5xxx wireless cards support"
-   depends on (PCI || ATHEROS_AR231X) && MAC80211
+   depends on (PCI || AR231X) && MAC80211
select ATH_COMMON
select MAC80211_LEDS
select LEDS_CLASS
select NEW_LEDS
select AVERAGE
-   select ATH5K_AHB if (ATHEROS_AR231X && !PCI)
-   select ATH5K_PCI if (!ATHEROS_AR231X && PCI)
+   select ATH5K_AHB if AR231X
+   select ATH5K_PCI if !AR231X
---help---
  This module adds support for wireless adapters based on
  Atheros 5xxx chipset.
@@ -54,14 +54,14 @@ config ATH5K_TRACER
 
 config ATH5K_AHB
bool "Atheros 5xxx AHB bus support"
-   depends on (ATHEROS_AR231X && !PCI)
+   depends on AR231X
---help---
  This adds support for WiSoC type chipsets of the 5xxx Atheros
  family.
 
 config ATH5K_PCI
bool "Atheros 5xxx PCI bus support"
-   depends on (!ATHEROS_AR231X && PCI)
+   depends on (!AR231X && PCI)
---help---
  This adds support for PCI type chipsets of the 5xxx Atheros
  family.
diff --git a/drivers/net/wireless/ath/ath5k/ath5k.h 
b/drivers/net/wireless/ath/ath5k/ath5k.h
index 85316bb..1ed7a88 100644
--- a/drivers/net/wireless/ath/ath5k/ath5k.h
+++ b/drivers/net/wireless/ath/ath5k/ath5k.h
@@ -1647,7 +1647,7 @@ static inline struct ath_regulatory 
*ath5k_hw_regulatory(struct ath5k_hw *ah)
return &(ath5k_hw_common(ah)->regulatory);
 }
 
-#ifdef CONFIG_ATHEROS_AR231X
+#ifdef CONFIG_ATH5K_AHB
 #define AR5K_AR2315_PCI_BASE   ((void __iomem *)0xb010)
 
 static inline void __iomem *ath5k_ahb_reg(struct ath5k_hw *ah, u16 reg)
diff --git a/drivers/net/wireless/ath/ath5k/base.c 
b/drivers/net/wireless/ath/ath5k/base.c
index 8ad2550..dd42487 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -99,7 +99,7 @@ static int ath5k_reset(struct ath5k_hw *ah, struct 
ieee80211_channel *chan,
 
 /* Known SREVs */
 static const struct ath5k_srev_name srev_names[] = {
-#ifdef CONFIG_ATHEROS_AR231X
+#ifdef CONFIG_ATH5K_AHB
{ "5312",   AR5K_VERSION_MAC,   AR5K_SREV_AR5312_R2 },
{ "5312",   AR5K_VERSION_MAC,   AR5K_SREV_AR5312_R7 },
{ "2313",   AR5K_VERSION_MAC,   AR5K_SREV_AR2313_R8 },
@@ -142,7 +142,7 @@ static const struct ath5k_srev_name srev_names[] = {
{ "5413",   AR5K_VERSION_RAD,   AR5K_SREV_RAD_5413 },
{ "5424",   AR5K_VERSION_RAD,   AR5K_SREV_RAD_5424 },
{ "5133",   AR5K_VERSION_RAD,   AR5K_SREV_RAD_5133 },
-#ifdef CONFIG_ATHEROS_AR231X
+#ifdef CONFIG_ATH5K_AHB
{ "2316",   AR5K_VERSION_RAD,   AR5K_SREV_RAD_2316 },
{ "2317",   AR5K_VERSION_RAD,   AR5K_SREV_RAD_2317 },
 #endif
diff --git a/drivers/net/wireless/ath/ath5k/led.c 
b/drivers/net/wireless/ath/ath5k/led.c
index 48a6a69b..c730677 100644
--- a/drivers/net/wireless/ath/ath5k/led.c
+++ b/drivers/net/wireless/ath/ath5k/led.c
@@ -162,7 +162,7 @@ int ath5k_init_leds(struct ath5k_hw *ah)
 {
int ret = 0;
struct ieee80211_hw *hw = ah->hw;
-#ifndef CONFIG_ATHEROS_AR231X
+#ifndef CONFIG_ATH5K_AHB
struct pci_dev *pdev = ah->pdev;
 #endif
char name[ATH5K_LED_MAX_NAME_LEN + 1];
@@ -171,7 +171,7 @@ int ath5k_init_leds(struct ath5k_hw *ah)
if (!ah->pdev)
return 0;
 
-#ifdef CONFIG_ATHEROS_AR231X
+#ifdef CONFIG_ATH5K_AHB
match = NULL;
 #else
match = pci_match_id(&ath5k_led_devices[0], pdev);
-- 
1.8.5.5

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


Re: [PATCH v2 2/2] mac80211: improve minstrel_ht rate sorting by throughput & probability

2014-09-28 Thread Karl Beldan
On Tue, Sep 09, 2014 at 11:22:14PM +0200, Thomas Huehn wrote:
> This patch improves the way minstrel_ht sorts rates according to throughput
> and success probability. 3 FOR-loops across the entire rate and mcs group set
> in function minstrel_ht_update_stats() which where used to determine the
> fastest, second fastest and most robust rate are reduced to 2 FOR-loop.
> 
> The sorted list of rates according throughput is extended to the best four
> rates as we need them in upcoming joint rate and power control. The sorting
> is done via the new function minstrel_ht_sort_best_tp_rates(). The annotation
> of those 4 best throughput rates in the debugfs file rc-stats is changes to:
> "A,B,C,D", where A is the fastest rate and C the 4th fastest.
> 
> ---
> v2: fix coding style issues, thx the Felix Fietkau
> 
> Signed-off-by: Thomas Huehn 
> Tested-by: Stefan Venz 
> ---
>  net/mac80211/rc80211_minstrel_ht.c | 303 
> +++--
>  net/mac80211/rc80211_minstrel_ht.h |  19 +-
>  net/mac80211/rc80211_minstrel_ht_debugfs.c |  10 +-
>  3 files changed, 213 insertions(+), 119 deletions(-)
> 
> diff --git a/net/mac80211/rc80211_minstrel_ht.c 
> b/net/mac80211/rc80211_minstrel_ht.c
> index 85c1e74..df90ce2 100644
> --- a/net/mac80211/rc80211_minstrel_ht.c
> +++ b/net/mac80211/rc80211_minstrel_ht.c
> @@ -135,7 +135,7 @@ minstrel_ht_update_rates(struct minstrel_priv *mp, struct 
> minstrel_ht_sta *mi);
>  static int
>  minstrel_ht_get_group_idx(struct ieee80211_tx_rate *rate)
>  {
> - return GROUP_IDX((rate->idx / 8) + 1,
> + return GROUP_IDX((rate->idx / MCS_GROUP_RATES) + 1,
>!!(rate->flags & IEEE80211_TX_RC_SHORT_GI),
>!!(rate->flags & IEEE80211_TX_RC_40_MHZ_WIDTH));
>  }

Hi,

Here you should have kept 8, GROUP_IDX requires the number of streams.
I will rebase the vht RFC I sent a year ago tonight and also send the
fix for 7a5e3fa breakage.
 
Karl
--
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


RTL8188SU(r8712u) - drivers/usb/core/urb.c:339 usb_submit_urb+0x11d/0x5f0()

2014-09-28 Thread poma

0bda:8171 Realtek Semiconductor Corp. RTL8188SU 802.11n WLAN Adapter

r8712u: module is from the staging directory, the quality is unknown, you have 
been warned.
r8712u: Staging version
r8712u: register rtl8712_netdev_ops to netdev_ops
usb 2-1: r8712u: USB_SPEED_HIGH with 4 endpoints
usb 2-1: r8712u: Boot from EFUSE: Autoload OK
usb 2-1: r8712u: CustomerID = 0x
usb 2-1: r8712u: MAC Address from efuse = 00:e0:4c:87:00:00
usb 2-1: r8712u: Loading firmware from "rtlwifi/rtl8712u.bin"
usbcore: registered new interface driver r8712u
r8712u 2-1:1.0 wlp0s4f1u1: renamed from wlan0
systemd-udevd[394]: renamed network interface wlan0 to wlp0s4f1u1

[ cut here ]
WARNING: CPU: 3 PID: 679 at drivers/usb/core/urb.c:339 
usb_submit_urb+0x11d/0x5f0()
URB 8800cb25eb40 submitted while active
Modules linked in: r8712u(C) 
CPU: 3 PID: 679 Comm: NetworkManager Tainted: G C 
3.17.0-0.rc6.git2.1.fc22.x86_64 #1
Call Trace:
 [] dump_stack+0x45/0x56
 [] warn_slowpath_common+0x7d/0xa0
 [] warn_slowpath_fmt+0x5c/0x80
 [] ? __down_interruptible+0xa6/0xf0
 [] usb_submit_urb+0x11d/0x5f0
 [] r8712_usb_write_mem+0xa5/0xc0 [r8712u]
 [] r8712_write_mem+0x1a/0x20 [r8712u]
 [] rtl8712_hal_init+0x274/0x7e0 [r8712u]
 [] rtl871x_hal_init+0x40/0x60 [r8712u]
 [] netdev_open+0xfe/0x260 [r8712u]
 [] __dev_open+0xce/0x150
 [] __dev_change_flags+0x9d/0x160
 [] dev_change_flags+0x29/0x70
 [] do_setlink+0x409/0xb80
 [] ? mem_cgroup_bad_page_check+0x1b/0x30
 [] ? find_busiest_group+0x143/0x910
 [] ? nla_parse+0x32/0x120
 [] rtnl_newlink+0x61d/0x780
 [] ? security_capable+0x18/0x20
 [] ? ns_capable+0x2b/0x60
 [] rtnetlink_rcv_msg+0xa1/0x260
 [] ? __kmalloc_node_track_caller+0x191/0x2e0
 [] ? rhashtable_lookup_compare+0x36/0x70
 [] ? rtnetlink_rcv+0x30/0x30
 [] netlink_rcv_skb+0xa9/0xd0
 [] rtnetlink_rcv+0x28/0x30
 [] netlink_unicast+0x12a/0x1a0
 [] netlink_sendmsg+0x351/0x7b0
 [] sock_sendmsg+0x9e/0xe0
 [] ? move_addr_to_kernel.part.20+0x1e/0x70
 [] ? move_addr_to_kernel+0x21/0x30
 [] ___sys_sendmsg+0x3c8/0x3e0
 [] ? __fget_light+0x25/0x70
 [] ? SYSC_sendto+0x17d/0x1c0
 [] ? __fget_light+0x25/0x70
 [] __sys_sendmsg+0x51/0x90
 [] SyS_sendmsg+0x12/0x20
 [] system_call_fastpath+0x16/0x1b
---[ end trace c3332f64cf535dba ]---


--
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 9/11 V2 NEXT] rtlwifi: rtl8188ee: Update driver to match Realtek release of 06282014

2014-09-28 Thread Larry Finger

On 09/27/2014 02:49 PM, Francois Romieu wrote:


Larry Finger  :
[...]

diff --git a/drivers/net/wireless/rtlwifi/core.c 
b/drivers/net/wireless/rtlwifi/core.c
index 40738e3..d30f416 100644
--- a/drivers/net/wireless/rtlwifi/core.c
+++ b/drivers/net/wireless/rtlwifi/core.c
@@ -28,6 +28,7 @@
  #include "cam.h"
  #include "base.h"
  #include "ps.h"
+#include "pwrseqcmd.h"

  #include "btcoexist/rtl_btc.h"
  #include 
@@ -1700,3 +1701,100 @@ const struct ieee80211_ops rtl_ops = {
  };
  EXPORT_SYMBOL_GPL(rtl_ops);

+/* Description:
+ * This routine deals with the Power Configuration CMD
+ *  parsing for RTL8723/RTL8188E Series IC.
+ * Assumption:
+ * We should follow specific format that was released from HW SD.


"released" is a bit misleading if it does not mean "publicly released".


+ */
+bool rtl_hal_pwrseqcmdparsing(struct rtl_priv *rtlpriv, u8 cut_version,
+ u8 faversion, u8 interface_type,
+ struct wlan_pwr_cfg pwrcfgcmd[])
+{
+   struct wlan_pwr_cfg cfg_cmd = {0};
+   bool polling_bit = false;
+   u32 ary_idx = 0;


u32 i;


+   u8 value = 0;
+   u32 offset = 0;


Useless init.


+   u32 polling_count = 0;


Wrong scope.


+   u32 max_polling_cnt = 5000;


Inverted xmas tree for declaration.


I do not understand what you mean here.




+
+   do {


while (1) {


+   cfg_cmd = pwrcfgcmd[ary_idx];
+   RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
+"rtl_hal_pwrseqcmdparsing(): offset(%#x),cut_msk(%#x), 
famsk(%#x), interface_msk(%#x), base(%#x), cmd(%#x), msk(%#x), value(%#x)\n",

 ^^^ missing 
space


+GET_PWR_CFG_OFFSET(cfg_cmd),
+   GET_PWR_CFG_CUT_MASK(cfg_cmd),
+GET_PWR_CFG_FAB_MASK(cfg_cmd),
+ GET_PWR_CFG_INTF_MASK(cfg_cmd),
+GET_PWR_CFG_BASE(cfg_cmd), GET_PWR_CFG_CMD(cfg_cmd),
+GET_PWR_CFG_MASK(cfg_cmd), GET_PWR_CFG_VALUE(cfg_cmd));
+
+   if ((GET_PWR_CFG_FAB_MASK(cfg_cmd)&faversion) &&
+   (GET_PWR_CFG_CUT_MASK(cfg_cmd)&cut_version) &&

  ^^^ missing spaces


+   (GET_PWR_CFG_INTF_MASK(cfg_cmd)&interface_type)) {
+   switch (GET_PWR_CFG_CMD(cfg_cmd)) {
+   case PWR_CMD_READ:
+   RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
+   "rtl_hal_pwrseqcmdparsing(): 
PWR_CMD_READ\n");


It should line up after the parenthesis.


+   break;
+   case PWR_CMD_WRITE:
+   RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
+   "rtl_hal_pwrseqcmdparsing(): 
PWR_CMD_WRITE\n");
+   offset = GET_PWR_CFG_OFFSET(cfg_cmd);
+
+   /*Read the value from system register*/
+   value = rtl_read_byte(rtlpriv, offset);
+   value &= (~(GET_PWR_CFG_MASK(cfg_cmd)));


Excess parenthsis.


+   value |= (GET_PWR_CFG_VALUE(cfg_cmd) &
+ GET_PWR_CFG_MASK(cfg_cmd));


Excess parenthsis.


+
+   /*Write the value back to sytem register*/
+   rtl_write_byte(rtlpriv, offset, value);
+   break;
+   case PWR_CMD_POLLING:
+   RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
+   "rtl_hal_pwrseqcmdparsing(): 
PWR_CMD_POLLING\n");


It should line up after the parenthesis.


+   polling_bit = false;
+   offset = GET_PWR_CFG_OFFSET(cfg_cmd);
+
+   do {
+   value = rtl_read_byte(rtlpriv, offset);
+
+   value &= GET_PWR_CFG_MASK(cfg_cmd);
+   if (value ==
+   (GET_PWR_CFG_VALUE(cfg_cmd) &
+GET_PWR_CFG_MASK(cfg_cmd)))
+   polling_bit = true;
+   else
+   udelay(10);
+
+   if (polling_count++ > max_polling_cnt)
+   return false;
+   } while (!polling_bit);


Simple "for" loop in disguise.

An helper function may help.

Imnsho the whole do { more, more, more } while (1) concept is broken.

[...]

diff --gi

[PATCH] mac80211: minstrel_ht: fix MCS_GROUP_RATES usage

2014-09-28 Thread Karl Beldan
From: Karl Beldan 

Commit 4441e8e9 ("mac80211: improve minstrel_ht rate sorting by
throughput & probability") replaced the constant 8 with MCS_GROUP_RATES
when getting the number of streams of an HT MCS. See commit 7a5e3fa2
("mac80211: minstrel_ht: replace some occurences of MCS_GROUP_RATES").

Signed-off-by: Karl Beldan 
---
 net/mac80211/rc80211_minstrel_ht.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/mac80211/rc80211_minstrel_ht.c 
b/net/mac80211/rc80211_minstrel_ht.c
index df90ce2..17ef54a 100644
--- a/net/mac80211/rc80211_minstrel_ht.c
+++ b/net/mac80211/rc80211_minstrel_ht.c
@@ -135,7 +135,7 @@ minstrel_ht_update_rates(struct minstrel_priv *mp, struct 
minstrel_ht_sta *mi);
 static int
 minstrel_ht_get_group_idx(struct ieee80211_tx_rate *rate)
 {
-   return GROUP_IDX((rate->idx / MCS_GROUP_RATES) + 1,
+   return GROUP_IDX((rate->idx / 8) + 1,
 !!(rate->flags & IEEE80211_TX_RC_SHORT_GI),
 !!(rate->flags & IEEE80211_TX_RC_40_MHZ_WIDTH));
 }
-- 
2.0.1

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


[PATCH] mac80211: minstrel_ht: add basic support for VHT rates <= 80MHz@NSS2

2014-09-28 Thread Karl Beldan
From: Karl Beldan 

When the new CONFIG_MAC80211_RC_MINSTREL_VHT is not set, there is no
behavioral change including in sampling and MCS_GROUP_RATES remains 8.
When it is, MCS_GROUP_RATES is 10 and we restrict to VHT rates for stats
readability (though it is possible to use both HT and VHT (unset
vht_only)).
---
 net/mac80211/Kconfig   |   7 +
 net/mac80211/rc80211_minstrel_ht.c | 263 +++--
 net/mac80211/rc80211_minstrel_ht.h |  33 +++-
 net/mac80211/rc80211_minstrel_ht_debugfs.c |  30 ++--
 4 files changed, 261 insertions(+), 72 deletions(-)

diff --git a/net/mac80211/Kconfig b/net/mac80211/Kconfig
index aeb6a48..39095a9 100644
--- a/net/mac80211/Kconfig
+++ b/net/mac80211/Kconfig
@@ -33,6 +33,13 @@ config MAC80211_RC_MINSTREL_HT
---help---
  This option enables the 'minstrel_ht' TX rate control algorithm
 
+config MAC80211_RC_MINSTREL_VHT
+   bool "Minstrel 802.11vht support" if EXPERT
+   depends on MAC80211_RC_MINSTREL_HT
+   default n
+   ---help---
+ This option enables vht in the 'minstrel_ht' TX rate control algorithm
+
 choice
prompt "Default rate control algorithm"
depends on MAC80211_HAS_RC
diff --git a/net/mac80211/rc80211_minstrel_ht.c 
b/net/mac80211/rc80211_minstrel_ht.c
index 17ef54a..41522c7 100644
--- a/net/mac80211/rc80211_minstrel_ht.c
+++ b/net/mac80211/rc80211_minstrel_ht.c
@@ -34,12 +34,17 @@
 /* Transmit duration for the raw data part of an average sized packet */
 #define MCS_DURATION(streams, sgi, bps) MCS_SYMBOL_TIME(sgi, 
MCS_NSYMS((streams) * (bps)))
 
+#define BW_20  0
+#define BW_40  1
+#define BW_80  2
+
 /*
  * Define group sort order: HT40 -> SGI -> #streams
  */
 #define GROUP_IDX(_streams, _sgi, _ht40)   \
-   MINSTREL_MAX_STREAMS * 2 * _ht40 +  \
-   MINSTREL_MAX_STREAMS * _sgi +   \
+   MINSTREL_HT_GROUP_0 +   \
+   MINSTREL_HT_MAX_STREAMS * 2 * _ht40 +   \
+   MINSTREL_HT_MAX_STREAMS * _sgi +\
_streams - 1
 
 /* MCS rate information for an MCS group */
@@ -47,6 +52,7 @@
[GROUP_IDX(_streams, _sgi, _ht40)] = {  \
.streams = _streams,\
.flags =\
+   IEEE80211_TX_RC_MCS |   \
(_sgi ? IEEE80211_TX_RC_SHORT_GI : 0) | \
(_ht40 ? IEEE80211_TX_RC_40_MHZ_WIDTH : 0), \
.duration = {   \
@@ -61,6 +67,38 @@
}   \
 }
 
+#define VHT_GROUP_IDX(_streams, _sgi, _bw) \
+   (MINSTREL_VHT_GROUP_0 + \
+MINSTREL_VHT_MAX_STREAMS * 2 * (_bw) + \
+MINSTREL_VHT_MAX_STREAMS * (_sgi) +\
+(_streams) - 1)
+
+#define BW2VBPS(_bw, r3, r2, r1)   
\
+   (_bw == BW_80 ? r3 : _bw == BW_40 ? r2 : r1)
+
+#define VHT_GROUP(_streams, _sgi, _bw) 
\
+   [VHT_GROUP_IDX(_streams, _sgi, _bw)] = {
\
+   .streams = _streams,
\
+   .flags =
\
+   IEEE80211_TX_RC_VHT_MCS |   
\
+   (_sgi ? IEEE80211_TX_RC_SHORT_GI : 0) | 
\
+   (_bw == BW_80 ? IEEE80211_TX_RC_80_MHZ_WIDTH :  
\
+_bw == BW_40 ? IEEE80211_TX_RC_40_MHZ_WIDTH : 0),  
\
+   .duration = {   
\
+   MCS_DURATION(_streams, _sgi, BW2VBPS(_bw,  117,  54,  26)), 
\
+   MCS_DURATION(_streams, _sgi, BW2VBPS(_bw,  234, 108,  52)), 
\
+   MCS_DURATION(_streams, _sgi, BW2VBPS(_bw,  351, 162,  78)), 
\
+   MCS_DURATION(_streams, _sgi, BW2VBPS(_bw,  468, 216, 104)), 
\
+   MCS_DURATION(_streams, _sgi, BW2VBPS(_bw,  702, 324, 156)), 
\
+   MCS_DURATION(_streams, _sgi, BW2VBPS(_bw,  936, 432, 208)), 
\
+   MCS_DURATION(_streams, _sgi, BW2VBPS(_bw, 1053, 486, 234)), 
\
+   MCS_DURATION(_streams, _sgi, BW2VBPS(_bw, 1170, 540, 260)), 
\
+   MCS_DURATION(_streams, _sgi, BW2VBPS(_bw, 1404, 648, 312)), 
\
+   MCS_DURATION(_streams, _sgi, BW2VBPS(_bw, 1560, 720, 346))  
\
+   }   
\
+}
+
+
 #define CCK_DURATION(_bitrate, _short, _len)   \
(1000 * (10 /* SIFS */ +   

Re: [PATCH v2] ath: Add support for tracing

2014-09-28 Thread Kalle Valo
Sujith Manoharan  writes:

> From: Sujith Manoharan 
>
> Signed-off-by: Sujith Manoharan 
> ---
>  drivers/net/wireless/ath/Kconfig  |  8 +
>  drivers/net/wireless/ath/Makefile |  4 +++
>  drivers/net/wireless/ath/ath.h|  1 +
>  drivers/net/wireless/ath/main.c   |  3 ++
>  drivers/net/wireless/ath/trace.c  | 20 +++
>  drivers/net/wireless/ath/trace.h  | 71 
> +++

Why add it to ath.ko module? What drivers are going to use this?

Because all ath* drivers are different, I suspect there is not that much
to share between drivers and that's why it would be better to have the
trace points per driver.

And I just checked that currently we have trace points for ath10k,
ath5k, ath6kl and wil6210. IMHO adding more trace points to ath.ko just
makes this confusing.

-- 
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 v2] ath: Add support for tracing

2014-09-28 Thread Sujith Manoharan
Kalle Valo wrote:
> Why add it to ath.ko module? What drivers are going to use this?

The debug code for ath9k is in ath.ko.

Sujith
--
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] ath: Add support for tracing

2014-09-28 Thread Kalle Valo
Sujith Manoharan  writes:

> Kalle Valo wrote:
>> Why add it to ath.ko module? What drivers are going to use this?
>
> The debug code for ath9k is in ath.ko.

You mean ath_printk() & friends? But that doesn't require tracing code
to be in ath.ko as well, right? If I understood correctly, trace.c could
be under ath9k directory and the kconfig option could be
ATH9K_TRACEPOINTS.

I think it's just misleading and confusing for the user to call it
"Atheros wireless tracing" when it only affects ath9k. It's easier to
understand if each driver has it's own "tracing" kconfig option.

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