Linux wireless drivers development
 help / color / mirror / Atom feed
* Re: [PATCH] mac80211: don't check local mesh TTL on TX
From: Johannes Berg @ 2013-06-03 14:54 UTC (permalink / raw)
  To: Thomas Pedersen; +Cc: linux-wireless, open80211s
In-Reply-To: <1370047307-19248-1-git-send-email-thomas@cozybit.com>

On Fri, 2013-05-31 at 17:41 -0700, Thomas Pedersen wrote:
> nl80211 has already verified the mesh TTL on setting the
> mesh config, so no need to check it again in mac80211.

makes sense, applied.

johannes


^ permalink raw reply

* Re: [PATCH 1/2] nl80211: allow sending CMD_FRAME without specifying any frequency
From: Antonio Quartulli @ 2013-06-03 14:25 UTC (permalink / raw)
  To: Nicolas Cavallari; +Cc: Johannes Berg, linux-wireless
In-Reply-To: <51ACA309.60904@lri.fr>

[-- Attachment #1: Type: text/plain, Size: 923 bytes --]

On Mon, Jun 03, 2013 at 04:07:05PM +0200, Nicolas Cavallari wrote:
> On 03/06/2013 08:39, Antonio Quartulli wrote:
> > From: Antonio Quartulli <antonio@open-mesh.com>
> > 
> > Users may want to send a frame on the current channel
> > without specifying it.
> > 
> > Make mgmt_tx pass a NULL channel to mac80211 if none has
> > been specified by the user.
> > 
> > Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
> > ---
> >  net/wireless/nl80211.c | 17 +++++++++++++----
> >  1 file changed, 13 insertions(+), 4 deletions(-)
> > 
> 
> Have you tested tracing or ath6kl ?

no.
For tracing I think I totally forgot to update the "prototype". For ath6kl I
have no possibility since I have no hw using that driver :/

The concern about ath6kl comes from the fact that it is a fullMAC driver?


Cheers,

-- 
Antonio Quartulli

..each of us alone is worth nothing..
Ernesto "Che" Guevara

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply

* pull-request: mac80211-next 2013-06-03
From: Johannes Berg @ 2013-06-03 14:51 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless

[-- Attachment #1: Type: text/plain, Size: 2163 bytes --]

John,

Here's another small pull request for mac80211-next, I wanted to get a
few fixes out. I have more stuff pending but not sure I can get that
reviewed right away and don't want anyone waiting for the warning fix.

I have two reverts for patches I accidentally merged in via a tree I
shouldn't have merged and a the locking fix for the locking rework I
did. On top of that, Felix's active monitor implementation, a patch to
always send multicast on the CAB queue to avoid races and a small
cleanup.

johannes


The following changes since commit 6abb9cb99f33b20c2f32f18a3ae9cc7543e46edb:

  cfg80211: make WoWLAN configuration available to drivers (2013-05-27 15:10:58 +0200)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git for-john

for you to fetch changes up to ed405be5cb5e8e494e8dcd83b6eb1add34dc752a:

  mac80211: fix sdata locking around __ieee80211_request_smps (2013-06-03 13:51:59 +0200)

----------------------------------------------------------------
Felix Fietkau (2):
      cfg80211: support an active monitor interface flag
      mac80211: support active monitor interfaces

Johannes Berg (5):
      cfg80211: remove cleanup_work kernel-doc
      mac80211: always send multicast on CAB queue
      Revert "iwlwifi: mvm: remove P2P_DEVICE support"
      Revert "mac80211_hwsim: remove P2P_DEVICE support"
      mac80211: fix sdata locking around __ieee80211_request_smps

 drivers/net/wireless/iwlwifi/mvm/mac80211.c | 14 +++++++++++++-
 drivers/net/wireless/mac80211_hwsim.c       |  4 +++-
 include/net/cfg80211.h                      |  3 ++-
 include/uapi/linux/nl80211.h                |  4 ++++
 net/mac80211/cfg.c                          | 13 +++++++++----
 net/mac80211/driver-ops.h                   |  3 ++-
 net/mac80211/iface.c                        | 29 +++++++++++++++++++++++------
 net/mac80211/tx.c                           |  5 +++--
 net/mac80211/util.c                         |  6 ++++++
 net/wireless/nl80211.c                      | 10 ++++++++++
 10 files changed, 75 insertions(+), 16 deletions(-)


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply

* pull-request: mac80211 2013-06-03
From: Johannes Berg @ 2013-06-03 14:47 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless

[-- Attachment #1: Type: text/plain, Size: 1099 bytes --]

John,

Here's one more fix for mac80211 (along with a constify patch it depends
on) to work around problems with certain (broken) APs that forget to
include HT IEs in their association responses.

johannes


The following changes since commit ac20976dcaeea3e77e40e9aac8f3799d2a22ea2b:

  mac80211: Allow single vif mac address change with addr_mask (2013-05-27 11:26:48 +0200)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211.git for-john

for you to fetch changes up to c2c15e215e860c99b86ddfc4be4bb25cf180fed0:

  mac80211: work around broken APs not including HT info (2013-05-29 00:56:13 +0200)

----------------------------------------------------------------
Johannes Berg (2):
      mac80211: constify ieee802_11_parse_elems() argument
      mac80211: work around broken APs not including HT info

 net/mac80211/ieee80211_i.h |  5 +--
 net/mac80211/mlme.c        | 87 ++++++++++++++++++++++++++++++++++++++++++----
 net/mac80211/util.c        |  4 +--
 3 files changed, 85 insertions(+), 11 deletions(-)


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply

* Re: Power saving features for iwl4965
From: Stanislaw Gruszka @ 2013-06-03 14:18 UTC (permalink / raw)
  To: Tino Keitel; +Cc: linux-wireless
In-Reply-To: <20130603085239.GA26920@mac.home>

On Mon, Jun 03, 2013 at 10:52:39AM +0200, Tino Keitel wrote:
> On Mon, Jan 07, 2013 at 12:08:00 +0100, Stanislaw Gruszka wrote:
> 
> [...]
> 
> > I posted patch here
> > http://marc.info/?l=linux-wireless&m=135601033021616&w=2
> > 
> > But I did not review code regarding power save to catch possible
> > problems. Testing are bug reporting are welcome ...
> 
> Hi,
> 
> the patch is surprisingly small. To me it looks like it only contains
> the code to make "iwconfig wlan0 power on" work, the actual power
> management is missing.
> 
> I just did some tests using powertop to see if I'm right. With the old
> pre-iwlegacy driver, the difference between "iwconfig wlan0 power on"
> and "...  power off" is more then 0,8W, which is ~10% of the total idle
> power usage of my X61s with dimmed screen.  With a current kernel and
> your patch, I can't measure a difference between "iwconfig wlan0 power
> on" and "...  power off".  To me it seems that the patch is pretty
> useless, at least on 4965AGN hardware.

Yes, we do not send any command to put hardware in sleep mode when 
mac80211 enable PS.

> It would be really nice to have proper power management in a current
> kernel, as the laptop gets noticeably hotter with the current iwlegacy
> driver.  That's why I still use a 3.1.10 kernel with an old
> forward-ported iwlagn driver.

Could you try this experimental patch?

diff --git a/drivers/net/wireless/iwlegacy/commands.h b/drivers/net/wireless/iwlegacy/commands.h
index 3b6c994..baf3ae7 100644
--- a/drivers/net/wireless/iwlegacy/commands.h
+++ b/drivers/net/wireless/iwlegacy/commands.h
@@ -2278,7 +2278,8 @@ struct il_spectrum_notification {
  */
 #define IL_POWER_VEC_SIZE 5
 
-#define IL_POWER_DRIVER_ALLOW_SLEEP_MSK	cpu_to_le16(BIT(0))
+#define IL_POWER_DRIVER_ALLOW_SLEEP_MSK		cpu_to_le16(BIT(0))
+#define IL_POWER_SLEEP_OVER_DTIM_MSK		cpu_to_le16(BIT(2))
 #define IL_POWER_PCI_PM_MSK			cpu_to_le16(BIT(3))
 
 struct il3945_powertable_cmd {
diff --git a/drivers/net/wireless/iwlegacy/common.c b/drivers/net/wireless/iwlegacy/common.c
index 592d0aa..07769ae 100644
--- a/drivers/net/wireless/iwlegacy/common.c
+++ b/drivers/net/wireless/iwlegacy/common.c
@@ -1079,29 +1079,80 @@ EXPORT_SYMBOL(il_get_channel_info);
  * Setting power level allows the card to go to sleep when not busy.
  *
  * We calculate a sleep command based on the required latency, which
- * we get from mac80211. In order to handle thermal throttling, we can
- * also use pre-defined power levels.
+ * we get from mac80211.
  */
 
-/*
- * This defines the old power levels. They are still used by default
- * (level 1) and for thermal throttle (levels 3 through 5)
- */
-
-struct il_power_vec_entry {
-	struct il_powertable_cmd cmd;
-	u8 no_dtim;		/* number of skip dtim */
-};
+#define SLP_VEC(X0, X1, X2, X3, X4) {cpu_to_le32(X0), \
+                                     cpu_to_le32(X1), \
+                                     cpu_to_le32(X2), \
+                                     cpu_to_le32(X3), \
+                                     cpu_to_le32(X4)}
 
 static void
-il_power_sleep_cam_cmd(struct il_priv *il, struct il_powertable_cmd *cmd)
+il_build_powertable_cmd(struct il_priv *il, struct il_powertable_cmd *cmd)
 {
+	const __le32 interval[3][IL_POWER_VEC_SIZE] = {
+		SLP_VEC(2, 2, 4, 6, 0xFF),
+		SLP_VEC(2, 4, 7, 10, 10),
+ 		SLP_VEC(4, 7, 10, 10, 0xFF)
+	};
+	int i, dtim_period, no_dtim;
+	u32 max_sleep;
+	bool skip;
+
 	memset(cmd, 0, sizeof(*cmd));
 
 	if (il->power_data.pci_pm)
 		cmd->flags |= IL_POWER_PCI_PM_MSK;
 
-	D_POWER("Sleep command for CAM\n");
+	/* if no Power Save, we are done */
+	if (il->power_data.ps_disabled)
+		return;
+
+	cmd->flags = IL_POWER_DRIVER_ALLOW_SLEEP_MSK;
+	cmd->keep_alive_seconds = 0;
+	cmd->debug_flags = 0;
+	cmd->rx_data_timeout = cpu_to_le32(25 * 1024);
+	cmd->tx_data_timeout = cpu_to_le32(25 * 1024);
+	cmd->keep_alive_beacons = 0;
+
+	dtim_period = il->vif ? il->vif->bss_conf.dtim_period : 0;
+
+	if (dtim_period <= 2) {
+		memcpy(cmd->sleep_interval, interval[0], sizeof(interval[0]));
+		no_dtim = 2;
+	} else if (dtim_period <= 10) {
+		memcpy(cmd->sleep_interval, interval[1], sizeof(interval[1]));
+		no_dtim = 2;
+	} else {
+		memcpy(cmd->sleep_interval, interval[2], sizeof(interval[2]));
+		no_dtim = 0;
+	}
+
+	if (dtim_period == 0) {
+		dtim_period = 1;
+		skip = false;
+	} else {
+		skip = !!no_dtim;
+	}
+
+	if (skip) {
+		__le32 tmp = cmd->sleep_interval[IL_POWER_VEC_SIZE - 1];
+
+		max_sleep = le32_to_cpu(tmp);
+		if (max_sleep == 0xFF)
+			max_sleep = dtim_period * (skip + 1);
+		else if (max_sleep >  dtim_period)
+			max_sleep = (max_sleep / dtim_period) * dtim_period;
+		cmd->flags |= IL_POWER_SLEEP_OVER_DTIM_MSK;
+	} else {
+		max_sleep = dtim_period;
+		cmd->flags &= ~IL_POWER_SLEEP_OVER_DTIM_MSK;
+	}
+
+	for (i = 0; i < IL_POWER_VEC_SIZE; i++)
+		if (le32_to_cpu(cmd->sleep_interval[i]) > max_sleep)
+			cmd->sleep_interval[i] = cpu_to_le32(max_sleep);
 }
 
 static int
@@ -1174,7 +1225,8 @@ il_power_update_mode(struct il_priv *il, bool force)
 {
 	struct il_powertable_cmd cmd;
 
-	il_power_sleep_cam_cmd(il, &cmd);
+	il_build_powertable_cmd(il, &cmd);
+
 	return il_power_set_mode(il, &cmd, force);
 }
 EXPORT_SYMBOL(il_power_update_mode);
@@ -5081,6 +5133,7 @@ set_ch_out:
 	}
 
 	if (changed & (IEEE80211_CONF_CHANGE_PS | IEEE80211_CONF_CHANGE_IDLE)) {
+		il->power_data.ps_disabled = !(conf->flags & IEEE80211_CONF_PS);
 		ret = il_power_update_mode(il, false);
 		if (ret)
 			D_MAC80211("Error setting sleep level\n");
diff --git a/drivers/net/wireless/iwlegacy/common.h b/drivers/net/wireless/iwlegacy/common.h
index f8246f2..8f81983 100644
--- a/drivers/net/wireless/iwlegacy/common.h
+++ b/drivers/net/wireless/iwlegacy/common.h
@@ -1123,6 +1123,7 @@ struct il_power_mgr {
 	struct il_powertable_cmd sleep_cmd_next;
 	int debug_sleep_level_override;
 	bool pci_pm;
+	bool ps_disabled;
 };
 
 struct il_priv {


^ permalink raw reply related

* Re: [PATCH 1/2] nl80211: allow sending CMD_FRAME without specifying any frequency
From: Nicolas Cavallari @ 2013-06-03 14:07 UTC (permalink / raw)
  To: Antonio Quartulli; +Cc: Johannes Berg, linux-wireless
In-Reply-To: <1370241587-2609-1-git-send-email-ordex@autistici.org>

On 03/06/2013 08:39, Antonio Quartulli wrote:
> From: Antonio Quartulli <antonio@open-mesh.com>
> 
> Users may want to send a frame on the current channel
> without specifying it.
> 
> Make mgmt_tx pass a NULL channel to mac80211 if none has
> been specified by the user.
> 
> Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
> ---
>  net/wireless/nl80211.c | 17 +++++++++++++----
>  1 file changed, 13 insertions(+), 4 deletions(-)
> 

Have you tested tracing or ath6kl ?

^ permalink raw reply

* [PATCH] brcmsmac: Reduce log spam in heavy tx, make err print in debug
From: John Greene @ 2013-06-03 13:47 UTC (permalink / raw)
  To: linville; +Cc: arend, linux-wireless

Move message to debug mode to reduce log spam under heavy tx (iperf) load.
This message prints in ht debug mode only:
brcms_c_ampdu_dotxstatus_complete: Pkt tx suppressed, illegal channel
possibly 153

Signed-off-by: John Greene <jogreene@redhat.com>
---
 drivers/net/wireless/brcm80211/brcmsmac/ampdu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/brcm80211/brcmsmac/ampdu.c b/drivers/net/wireless/brcm80211/brcmsmac/ampdu.c
index 1585cc5..bd98285 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/ampdu.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/ampdu.c
@@ -900,7 +900,7 @@ brcms_c_ampdu_dotxstatus_complete(struct ampdu_info *ampdu, struct scb *scb,
 		if (supr_status) {
 			update_rate = false;
 			if (supr_status == TX_STATUS_SUPR_BADCH) {
-				brcms_err(wlc->hw->d11core,
+				brcms_dbg_ht(wlc->hw->d11core,
 					  "%s: Pkt tx suppressed, illegal channel possibly %d\n",
 					  __func__, CHSPEC_CHANNEL(
 					  wlc->default_bss->chanspec));
-- 
1.8.1.4


^ permalink raw reply related

* Re: [PATCH] mac80211: fix sdata locking around __ieee80211_request_smps
From: Jakub Kicinski @ 2013-06-03 13:05 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless
In-Reply-To: <1370260400-12149-1-git-send-email-johannes@sipsolutions.net>

On Mon,  3 Jun 2013 13:53:20 +0200, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
>
> My cfg80211/mac80211 locking unification broke the sdata
> locking in ieee80211_set_power_mgmt, it needs to acquire
> the lock for __ieee80211_request_smps(). Add the locking.
>
> Reported-by: Jakub Kicinski <kubakici@wp.pl>
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> ---
>  net/mac80211/cfg.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
> index 9034da1..3062210 100644
> --- a/net/mac80211/cfg.c
> +++ b/net/mac80211/cfg.c
> @@ -2378,7 +2378,9 @@ static int ieee80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,
>  	local->dynamic_ps_forced_timeout = timeout;
>  
>  	/* no change, but if automatic follow powersave */
> +	sdata_lock(sdata);
>  	__ieee80211_request_smps(sdata, sdata->u.mgd.req_smps);
> +	sdata_unlock(sdata);
>  
>  	if (local->hw.flags & IEEE80211_HW_SUPPORTS_DYNAMIC_PS)
>  		ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS);

I can confirm that this patch fixes the reported warning.

I had to double check that sdata_lock takes the wdev mutex
though, because lockdep assert on cfg.c:2321 looks like this:

lockdep_assert_held(&sdata->wdev.mtx)

instead of:

sdata_assert_lock(&sdata)

just saying... :-)

 -- kuba

^ permalink raw reply

* [PATCH] mac80211: fix sdata locking around __ieee80211_request_smps
From: Johannes Berg @ 2013-06-03 11:53 UTC (permalink / raw)
  To: linux-wireless; +Cc: kubakici, Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

My cfg80211/mac80211 locking unification broke the sdata
locking in ieee80211_set_power_mgmt, it needs to acquire
the lock for __ieee80211_request_smps(). Add the locking.

Reported-by: Jakub Kicinski <kubakici@wp.pl>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 net/mac80211/cfg.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 9034da1..3062210 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -2378,7 +2378,9 @@ static int ieee80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,
 	local->dynamic_ps_forced_timeout = timeout;
 
 	/* no change, but if automatic follow powersave */
+	sdata_lock(sdata);
 	__ieee80211_request_smps(sdata, sdata->u.mgd.req_smps);
+	sdata_unlock(sdata);
 
 	if (local->hw.flags & IEEE80211_HW_SUPPORTS_DYNAMIC_PS)
 		ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS);
-- 
1.8.0


^ permalink raw reply related

* pull request: TI wireless drivers fixes 2013-06-03 (for 3.10)
From: Luciano Coelho @ 2013-06-03 11:37 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless

[-- Attachment #1: Type: text/plain, Size: 1312 bytes --]

Hi John,

Here are three patches that I'd like to get into 3.10.  Two of them, by
me, are related to the firmware version checks in our driver.  Without
them, the firmwares fail to load.  The other one, by Eliad, fixes a typo
bug in our 5GHz scanning code.

Please let me know if you have any problems with it!

The following changes since commit 4ab21db2202895e2c9d3520fed8e7fb061b29605:

  rtlwifi: rtl8192cu: Fix problem in connecting to WEP or WPA(1) networks (2013-05-31 13:00:33 -0400)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/luca/wl12xx.git wl12xx-fixes

for you to fetch changes up to 1b5346776c6688006380c2bb491ebf28bc3f3a19:

  wl12xx/wl18xx: scan all 5ghz channels (2013-06-03 11:43:41 +0300)

----------------------------------------------------------------
Eliad Peller (1):
      wl12xx/wl18xx: scan all 5ghz channels

Luciano Coelho (2):
      wl12xx: fix minimum required firmware version for wl127x multirole
      wl12xx: increase minimum singlerole firmware version required

 drivers/net/wireless/ti/wl12xx/scan.c   |    2 +-
 drivers/net/wireless/ti/wl12xx/wl12xx.h |    6 +++---
 drivers/net/wireless/ti/wl18xx/scan.c   |    2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)


-- 
Cheers,
Luca.


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply

* [PATCH] Fix channel index in WMI PCP start
From: Kirshenbaum Erez @ 2013-06-03  9:19 UTC (permalink / raw)
  To: qca_vkondrat; +Cc: linux-wireless, Kirshenbaum Erez

Signed-off-by: Kirshenbaum Erez <erezk@wilocity.com>
---
 drivers/net/wireless/ath/wil6210/wmi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/wil6210/wmi.c b/drivers/net/wireless/ath/wil6210/wmi.c
index 45b04e3..26f760a 100644
--- a/drivers/net/wireless/ath/wil6210/wmi.c
+++ b/drivers/net/wireless/ath/wil6210/wmi.c
@@ -724,7 +724,7 @@ int wmi_pcp_start(struct wil6210_priv *wil, int bi, u8 wmi_nettype, u8 chan)
 		.bcon_interval = cpu_to_le16(bi),
 		.network_type = wmi_nettype,
 		.disable_sec_offload = 1,
-		.channel = chan,
+		.channel = chan-1,
 	};
 	struct {
 		struct wil6210_mbox_hdr_wmi wmi;
@@ -733,9 +733,9 @@ int wmi_pcp_start(struct wil6210_priv *wil, int bi, u8 wmi_nettype, u8 chan)
 
 	if (!wil->secure_pcp)
 		cmd.disable_sec = 1;
-
+	/* This may take some time (FW set/calibrate new freq) */
 	rc = wmi_call(wil, WMI_PCP_START_CMDID, &cmd, sizeof(cmd),
-		      WMI_PCP_STARTED_EVENTID, &reply, sizeof(reply), 100);
+		      WMI_PCP_STARTED_EVENTID, &reply, sizeof(reply), 5000);
 	if (rc)
 		return rc;
 
-- 
1.7.11.7


^ permalink raw reply related

* Re: [PATCH 0/2] ath9k: add STBC Rx flags (repost untill some one asnwers)
From: Oleksij Rempel @ 2013-06-03 10:14 UTC (permalink / raw)
  To: Sujith Manoharan; +Cc: ath9k-devel, linux-wireless
In-Reply-To: <20908.26870.629833.926468@gargle.gargle.HOWL>

Am 03.06.2013 11:59, schrieb Sujith Manoharan:
> Oleksij Rempel wrote:
>> One more repost of old patches. I need, please, at least some kind of answer:
>> "we don't wont patches from you" or "you are doing some thing wrong".
>
> Both the patches have already been merged in wireless-testing.

ah... i didn't noticed that.
thank you ;)

> commit b0a1ae976d6cd40ff90ba87883e17eb2610dae3d
> Author: Oleksij Rempel <linux@rempel-privat.de>
> Date:   Fri May 24 20:30:59 2013 +0200
>
>      ath9k: check for Rx-STBC flag and pass it to ieee80211
>
>      This patch make use of STBC flag in DMA RX descriptor.
>      Only devices after ar9280 can provide this information.
>
>      If card support it we will set HAVE_STBC flag, to show
>      clint programm thet STBC is supported but not received.
>
>      Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
>      Signed-off-by: John W. Linville <linville@tuxdriver.com>
>
> commit ab276103357637fb26cc851369b5abbdc42afbf4
> Author: Oleksij Rempel <linux@rempel-privat.de>
> Date:   Fri May 24 12:18:30 2013 +0200
>
>      ath9k: remove useless flag conversation.
>
>      some flags used only outside of ath9k - In this case we can use
>      "enum mac80211_rx_flags" and pass it upstream without extra
>      conversation.
>
>      Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
>      Signed-off-by: John W. Linville <linville@tuxdriver.com>
>
> Sujith
>




-- 
Regards,
Oleksij

^ permalink raw reply

* Re: [PATCH 0/2] ath9k: add STBC Rx flags (repost untill some one asnwers)
From: Sujith Manoharan @ 2013-06-03  9:59 UTC (permalink / raw)
  To: Oleksij Rempel; +Cc: ath9k-devel, linux-wireless
In-Reply-To: <1370246279-6536-1-git-send-email-linux@rempel-privat.de>

Oleksij Rempel wrote:
> One more repost of old patches. I need, please, at least some kind of answer:
> "we don't wont patches from you" or "you are doing some thing wrong".

Both the patches have already been merged in wireless-testing.

commit b0a1ae976d6cd40ff90ba87883e17eb2610dae3d
Author: Oleksij Rempel <linux@rempel-privat.de>
Date:   Fri May 24 20:30:59 2013 +0200

    ath9k: check for Rx-STBC flag and pass it to ieee80211
    
    This patch make use of STBC flag in DMA RX descriptor.
    Only devices after ar9280 can provide this information.
    
    If card support it we will set HAVE_STBC flag, to show
    clint programm thet STBC is supported but not received.
    
    Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
    Signed-off-by: John W. Linville <linville@tuxdriver.com>

commit ab276103357637fb26cc851369b5abbdc42afbf4
Author: Oleksij Rempel <linux@rempel-privat.de>
Date:   Fri May 24 12:18:30 2013 +0200

    ath9k: remove useless flag conversation.
    
    some flags used only outside of ath9k - In this case we can use
    "enum mac80211_rx_flags" and pass it upstream without extra
    conversation.
    
    Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
    Signed-off-by: John W. Linville <linville@tuxdriver.com>

Sujith

^ permalink raw reply

* [PATCH 3.10] Revert "ath9k_hw: Update rx gain initval to improve rx sensitivity"
From: Felix Fietkau @ 2013-06-03  9:18 UTC (permalink / raw)
  To: linux-wireless; +Cc: linville, rmanohar

This reverts commit 68d9e1fa24d9c7c2e527f49df8d18fb8cf0ec943

This change reduces rx sensitivity with no apparent extra benefit.
It looks like it was meant for testing in a specific scenario,
but it was never properly validated.

Cc: rmanohar@qca.qualcomm.com
Cc: stable@vger.kernel.org
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
---
 drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h b/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h
index db5ffad..7546b9a 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h
+++ b/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h
@@ -958,11 +958,11 @@ static const u32 ar9300Common_rx_gain_table_2p2[][2] = {
 	{0x0000a074, 0x00000000},
 	{0x0000a078, 0x00000000},
 	{0x0000a07c, 0x00000000},
-	{0x0000a080, 0x1a1a1a1a},
-	{0x0000a084, 0x1a1a1a1a},
-	{0x0000a088, 0x1a1a1a1a},
-	{0x0000a08c, 0x1a1a1a1a},
-	{0x0000a090, 0x171a1a1a},
+	{0x0000a080, 0x22222229},
+	{0x0000a084, 0x1d1d1d1d},
+	{0x0000a088, 0x1d1d1d1d},
+	{0x0000a08c, 0x1d1d1d1d},
+	{0x0000a090, 0x171d1d1d},
 	{0x0000a094, 0x11111717},
 	{0x0000a098, 0x00030311},
 	{0x0000a09c, 0x00000000},
-- 
1.8.0.2


^ permalink raw reply related

* Re: Power saving features for iwl4965
From: Tino Keitel @ 2013-06-03  8:52 UTC (permalink / raw)
  To: Stanislaw Gruszka; +Cc: linux-wireless
In-Reply-To: <20130107110759.GC6931@redhat.com>

On Mon, Jan 07, 2013 at 12:08:00 +0100, Stanislaw Gruszka wrote:

[...]

> I posted patch here
> http://marc.info/?l=linux-wireless&m=135601033021616&w=2
> 
> But I did not review code regarding power save to catch possible
> problems. Testing are bug reporting are welcome ...

Hi,

the patch is surprisingly small. To me it looks like it only contains
the code to make "iwconfig wlan0 power on" work, the actual power
management is missing.

I just did some tests using powertop to see if I'm right. With the old
pre-iwlegacy driver, the difference between "iwconfig wlan0 power on"
and "...  power off" is more then 0,8W, which is ~10% of the total idle
power usage of my X61s with dimmed screen.  With a current kernel and
your patch, I can't measure a difference between "iwconfig wlan0 power
on" and "...  power off".  To me it seems that the patch is pretty
useless, at least on 4965AGN hardware.

It would be really nice to have proper power management in a current
kernel, as the laptop gets noticeably hotter with the current iwlegacy
driver.  That's why I still use a 3.1.10 kernel with an old
forward-ported iwlagn driver.

Regards,
Tino

^ permalink raw reply

* Re: [PATCH] cw1200: fix some obvious mistakes
From: Arnd Bergmann @ 2013-06-03  8:40 UTC (permalink / raw)
  To: Solomon Peachy
  Cc: linux-kernel, John W. Linville, Wei Yongjun, Dmitry Tarnyagin,
	Ajitpal Singh, linux-wireless
In-Reply-To: <20130602144725.GC3875@shaftnet.org>

On Sunday 02 June 2013 10:47:26 Solomon Peachy wrote:
> On Sun, Jun 02, 2013 at 03:59:12PM +0200, Arnd Bergmann wrote:
> > The driver doesn't reliably build, and I'm trying to fix it.
> > From my perspective, we can just mark it 'depends on !ARM'
> > to get it off my radar, but other people are doing build
> > testing on x86 and will run into the same issues.
> 
> AFAIK the only remaining build problem is when CONFIG_CW1200_SAGRAD is 
> not defined so there's no "platform" data provided.

Yes, that is correct. My first approach was to always 'select CW1200_SAGRAD'
from the CW1200_SDIO driver, but then it becomes impossible to have
a different definition of the data in platform code. Even without doing
it you also have a build error if you try to add a platform_data definition
to more than one board file in the kernel or enable the sagrad driver
at the same time as a platform.

> > If we only care about two cases a) a default sagrad card that can use
> > hardcoded data and b) a board that uses the same chip and requires
> > custom data, then I would suggest including the sagrad data in the
> > sdio driver as a default (as my patch does) but allow overriding
> > it with platform data.
> 
> Yes, those are the only use cases we care about.  And that sounds like a 
> viable approach, so I'll code that up.
> 
> I guess adding a function along the lines of 
> "cw1200_sdio_set_platform_data()" (to be called by the board/platform 
> setup code) would be the right way to do this?

It's much better than what you have today, but not ideal because it
means the driver cannot be a loadable module any more.

> As an aside, I wish I'd received this feedback a couple of months ago.

Yes, I agree it's unfortunate timing. Our review process is certainly
not perfect when you have to wait for stuff to break in linux-next
before you get people to notice the problems.

At least it's not in a released kernel yet.

> > The problem with this is that it is impossible to build a kernel that
> > supports both, or even two devices of the same type.
> 
> Adding proper devicetree support will solve this problem down the line, 
> but I don't think there's any way to fix this for non-DT systems thanks 
> to that chicken-and-egg probing situation.
> 
> (I wish I had a DT-capable platform handy to develop against..)

All ST-Ericsson DB8500 (ux500) systems should now work with DT, and will
be DT-only in one of the next few kernel releases.

> > I don't mind the backports supporting that, but we should probably
> > move on in mainline. The existance of backports is no excuse for
> > keeping around broken code.
> 
> I already have one patch queued up for backports to re-enable <2.6.36 
> support, and I have no problem adding more.  
> 
> That said, until all SDIO/SPI-supporting targets in the mainline are 
> converted to a devicetree (or equivalent) model, I imagine the 
> platform_data crap will have to remain.

I'm not sure about this: I would argue that only the boards that
are part of mainline and have a cw1200 wired up are what matters here.

Having an SoC platform with SDIO support and the potential to add
a board file including cw1200 is not relevant as long as that board
file does not actually get added. If someone can patch the kernel
to add a board file, they can also patch the driver in any way
necessary.

In contrast, with devicetree we normally anticipate that people can
have their external dts files which reference DT-enabled drivers
even if the dts file is not itself part of the kernel.

> > just look in include/linux/platform_data/. The most common type for
> > gpio numbers is 'int'.
> 
> I've already posted a patch that converts them over.

ok.

> > In fact my mobile phone has a cw1200 chip that was working until
> > recently. Now it just crashes when I do 'ifconfig wlan0 up'
> > or enable WLAN in the Android settings menu. :(
> > 
> > I'm not blaming you for that ;-)
> 
> What model, out of curiousity?

This is a Sony xperia Sola. Wireless was working for about a year
with the original Android 2.3 image, but it broke a week after
I installed CyanogenMod 9.1.

> > I think the most important part is separating the generic sagrad
> > add-on card code from any platform-specific code and removing the
> > use of cw1200_get_platform_data() function that breaks the build.
> 
> I'll convert SDIO driver to using the sagrad data as default and add a 
> 'set_platform_data' sort of function to allow it to be optionally 
> overridden.  It shouldn't take long, and I'll post the patch as soon as 
> I'm finished.

Ok, sounds like a good next step.

Regarding a long-term solution, I think what we should do here is to
move the reset logic into the SDIO framework itself: We have similar
requirements even for eMMC and SD cards, where you need to provide
the correct voltage to a device on the MMC port in order for it to
work. Today this is supported to a varying degree on the MMC controller
level, where we hook into various frameworks (clk, reset-controller,
regulator, gpio, pinctrl, power domain) based on platformm data or
device tree information on the controller node.

I think you can do this today with cw1200 as long as you know which
MMC controller you have, which may also solve your problem, but it
would be nice if that could be made more generic for SDIO, since
the problem is neither controller-specific nor device-specific
but can happen on any SDIO device.

Looking at the source code for my phone, there is one clock that
needs to be enabled for the cw1200 through pdata->clk_ctrl. This
should probably just be a turned into an anonymous clock so the
cw1200 driver itself does "clk = clk_get(dev, NULL); clk_enable(clk);"
and the callback can be removed.
There is also IRQ and reset logic in this board-mop500-wlan.c file.
The IRQ logic seems fine, and for the reset, I would suggest using
the gpio-reset driver that is getting proposed for merging in 3.11,
and to add a call to device_reset() into the sdio layer.

	Arnd

^ permalink raw reply

* [PATCH v4 2/2] ath9k: check for Rx-STBC flag and pass it to ieee80211
From: Oleksij Rempel @ 2013-06-03  7:57 UTC (permalink / raw)
  To: ath9k-devel, linux-wireless; +Cc: Oleksij Rempel
In-Reply-To: <1370246279-6536-1-git-send-email-linux@rempel-privat.de>

This patch make use of STBC flag in DMA RX descriptor.
Only devices after ar9280 can provide this information.

If card support it we will set HAVE_STBC flag, to show
clint programm thet STBC is supported but not received.

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
---
 drivers/net/wireless/ath/ath9k/init.c | 10 ++++++++--
 drivers/net/wireless/ath/ath9k/mac.c  |  5 +++++
 drivers/net/wireless/ath/ath9k/mac.h  |  3 ++-
 3 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index aba4151..b9c97d4 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -21,6 +21,7 @@
 #include <linux/ath9k_platform.h>
 #include <linux/module.h>
 #include <linux/relay.h>
+#include <net/ieee80211_radiotap.h>
 
 #include "ath9k.h"
 
@@ -769,8 +770,13 @@ void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw)
 		IEEE80211_HW_REPORTS_TX_ACK_STATUS |
 		IEEE80211_HW_SUPPORTS_RC_TABLE;
 
-	if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_HT)
-		 hw->flags |= IEEE80211_HW_AMPDU_AGGREGATION;
+	if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_HT) {
+		hw->flags |= IEEE80211_HW_AMPDU_AGGREGATION;
+
+		if (AR_SREV_9280_20_OR_LATER(ah))
+			hw->radiotap_mcs_details |=
+				IEEE80211_RADIOTAP_MCS_HAVE_STBC;
+	}
 
 	if (AR_SREV_9160_10_OR_LATER(sc->sc_ah) || ath9k_modparam_nohwcrypt)
 		hw->flags |= IEEE80211_HW_MFP_CAPABLE;
diff --git a/drivers/net/wireless/ath/ath9k/mac.c b/drivers/net/wireless/ath/ath9k/mac.c
index a52081d..d055e38 100644
--- a/drivers/net/wireless/ath/ath9k/mac.c
+++ b/drivers/net/wireless/ath/ath9k/mac.c
@@ -593,6 +593,11 @@ int ath9k_hw_rxprocdesc(struct ath_hw *ah, struct ath_desc *ds,
 		(ads.ds_rxstatus3 & AR_GI) ? RX_FLAG_SHORT_GI : 0;
 	rs->flag |=
 		(ads.ds_rxstatus3 & AR_2040) ? RX_FLAG_40MHZ : 0;
+	if (AR_SREV_9280_20_OR_LATER(ah))
+		rs->flag |=
+			(ads.ds_rxstatus3 & AR_STBC) ?
+				/* we can only Nss=1 STBC */
+				(1 << RX_FLAG_STBC_SHIFT) : 0;
 
 	if (ads.ds_rxstatus8 & AR_PreDelimCRCErr)
 		rs->rs_flags |= ATH9K_RX_DELIM_CRC_PRE;
diff --git a/drivers/net/wireless/ath/ath9k/mac.h b/drivers/net/wireless/ath/ath9k/mac.h
index 3f1e775..b02dfce 100644
--- a/drivers/net/wireless/ath/ath9k/mac.h
+++ b/drivers/net/wireless/ath/ath9k/mac.h
@@ -534,7 +534,8 @@ struct ar5416_desc {
 #define AR_2040             0x00000002
 #define AR_Parallel40       0x00000004
 #define AR_Parallel40_S     2
-#define AR_RxStatusRsvd30   0x000000f8
+#define AR_STBC             0x00000008 /* on ar9280 and later */
+#define AR_RxStatusRsvd30   0x000000f0
 #define AR_RxAntenna	    0xffffff00
 #define AR_RxAntenna_S	    8
 
-- 
1.8.1.2


^ permalink raw reply related

* [PATCH 0/2] ath9k: add STBC Rx flags (repost untill some one asnwers)
From: Oleksij Rempel @ 2013-06-03  7:57 UTC (permalink / raw)
  To: ath9k-devel, linux-wireless; +Cc: Oleksij Rempel

One more repost of old patches. I need, please, at least some kind of answer:
"we don't wont patches from you" or "you are doing some thing wrong".

^ permalink raw reply

* [PATCH 1/2] ath9k: remove useless flag conversation.
From: Oleksij Rempel @ 2013-06-03  7:57 UTC (permalink / raw)
  To: ath9k-devel, linux-wireless; +Cc: Oleksij Rempel
In-Reply-To: <1370246279-6536-1-git-send-email-linux@rempel-privat.de>

some flags used only outside of ath9k - In this case we can use
"enum mac80211_rx_flags" and pass it upstream without extra
conversation.

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
---
 drivers/net/wireless/ath/ath9k/ar9003_mac.c |  5 +++--
 drivers/net/wireless/ath/ath9k/mac.c        | 11 +++++++----
 drivers/net/wireless/ath/ath9k/mac.h        |  1 +
 drivers/net/wireless/ath/ath9k/recv.c       |  5 +----
 4 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar9003_mac.c b/drivers/net/wireless/ath/ath9k/ar9003_mac.c
index 301bf72..5163abd 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_mac.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_mac.c
@@ -469,6 +469,7 @@ int ath9k_hw_process_rxdesc_edma(struct ath_hw *ah, struct ath_rx_status *rxs,
 
 	rxs->rs_status = 0;
 	rxs->rs_flags =  0;
+	rxs->flag =  0;
 
 	rxs->rs_datalen = rxsp->status2 & AR_DataLen;
 	rxs->rs_tstamp =  rxsp->status3;
@@ -493,8 +494,8 @@ int ath9k_hw_process_rxdesc_edma(struct ath_hw *ah, struct ath_rx_status *rxs,
 	rxs->rs_isaggr = (rxsp->status11 & AR_RxAggr) ? 1 : 0;
 	rxs->rs_moreaggr = (rxsp->status11 & AR_RxMoreAggr) ? 1 : 0;
 	rxs->rs_antenna = (MS(rxsp->status4, AR_RxAntenna) & 0x7);
-	rxs->rs_flags  = (rxsp->status4 & AR_GI) ? ATH9K_RX_GI : 0;
-	rxs->rs_flags  |= (rxsp->status4 & AR_2040) ? ATH9K_RX_2040 : 0;
+	rxs->flag  |= (rxsp->status4 & AR_GI) ? RX_FLAG_SHORT_GI : 0;
+	rxs->flag  |= (rxsp->status4 & AR_2040) ? RX_FLAG_40MHZ : 0;
 
 	rxs->evm0 = rxsp->status6;
 	rxs->evm1 = rxsp->status7;
diff --git a/drivers/net/wireless/ath/ath9k/mac.c b/drivers/net/wireless/ath/ath9k/mac.c
index 498fee0..a52081d 100644
--- a/drivers/net/wireless/ath/ath9k/mac.c
+++ b/drivers/net/wireless/ath/ath9k/mac.c
@@ -547,6 +547,7 @@ int ath9k_hw_rxprocdesc(struct ath_hw *ah, struct ath_desc *ds,
 
 	rs->rs_status = 0;
 	rs->rs_flags = 0;
+	rs->flag = 0;
 
 	rs->rs_datalen = ads.ds_rxstatus1 & AR_DataLen;
 	rs->rs_tstamp = ads.AR_RcvTimestamp;
@@ -586,10 +587,12 @@ int ath9k_hw_rxprocdesc(struct ath_hw *ah, struct ath_desc *ds,
 	rs->rs_moreaggr =
 		(ads.ds_rxstatus8 & AR_RxMoreAggr) ? 1 : 0;
 	rs->rs_antenna = MS(ads.ds_rxstatus3, AR_RxAntenna);
-	rs->rs_flags =
-		(ads.ds_rxstatus3 & AR_GI) ? ATH9K_RX_GI : 0;
-	rs->rs_flags |=
-		(ads.ds_rxstatus3 & AR_2040) ? ATH9K_RX_2040 : 0;
+
+	/* directly mapped flags for ieee80211_rx_status */
+	rs->flag |=
+		(ads.ds_rxstatus3 & AR_GI) ? RX_FLAG_SHORT_GI : 0;
+	rs->flag |=
+		(ads.ds_rxstatus3 & AR_2040) ? RX_FLAG_40MHZ : 0;
 
 	if (ads.ds_rxstatus8 & AR_PreDelimCRCErr)
 		rs->rs_flags |= ATH9K_RX_DELIM_CRC_PRE;
diff --git a/drivers/net/wireless/ath/ath9k/mac.h b/drivers/net/wireless/ath/ath9k/mac.h
index 5865f92..3f1e775 100644
--- a/drivers/net/wireless/ath/ath9k/mac.h
+++ b/drivers/net/wireless/ath/ath9k/mac.h
@@ -149,6 +149,7 @@ struct ath_rx_status {
 	u32 evm2;
 	u32 evm3;
 	u32 evm4;
+	u32 flag; /* see enum mac80211_rx_flags */
 };
 
 struct ath_htc_rx_status {
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index 8be2b5d..b4b758d 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -868,10 +868,7 @@ static int ath9k_process_rate(struct ath_common *common,
 	if (rx_stats->rs_rate & 0x80) {
 		/* HT rate */
 		rxs->flag |= RX_FLAG_HT;
-		if (rx_stats->rs_flags & ATH9K_RX_2040)
-			rxs->flag |= RX_FLAG_40MHZ;
-		if (rx_stats->rs_flags & ATH9K_RX_GI)
-			rxs->flag |= RX_FLAG_SHORT_GI;
+		rxs->flag |= rx_stats->flag;
 		rxs->rate_idx = rx_stats->rs_rate & 0x7f;
 		return 0;
 	}
-- 
1.8.1.2


^ permalink raw reply related

* [RFC PATCH 1/1] mwifiex: Remove stop_net_dev_queue operation when uap handling packets forwarding.
From: Huawei Yang @ 2013-06-03  7:54 UTC (permalink / raw)
  To: Bing Zhao; +Cc: linux-wireless, linux-kernel, Huawei Yang

Under uap mode mwifiex may stop all net tx queues on forwarding packets. This may stop some tx queues and they never have chance to be waked up... There is also no need to check tx_pending and stop queues here. Because local host has such kind of check when transmitting packets and it's not proper to have forwarding affect local transmitting.

Signed-off-by: Huawei Yang <harvey.huawei.yang@gmail.com>
---
 drivers/net/wireless/mwifiex/uap_txrx.c |    4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/uap_txrx.c b/drivers/net/wireless/mwifiex/uap_txrx.c
index a018e42..11df2b2 100644
--- a/drivers/net/wireless/mwifiex/uap_txrx.c
+++ b/drivers/net/wireless/mwifiex/uap_txrx.c
@@ -95,10 +95,6 @@ static void mwifiex_uap_queue_bridged_pkt(struct mwifiex_private *priv,
 	atomic_inc(&adapter->tx_pending);
 	atomic_inc(&adapter->pending_bridged_pkts);
 
-	if ((atomic_read(&adapter->tx_pending) >= MAX_TX_PENDING)) {
-		mwifiex_set_trans_start(priv->netdev);
-		mwifiex_stop_net_dev_queue(priv->netdev, priv->adapter);
-	}
 	return;
 }
 
-- 
1.7.10.4


^ permalink raw reply related

* Re: [PATCH] net: wireless: replace strict_strtoul() with kstrtoul()
From: David Miller @ 2013-06-03  7:41 UTC (permalink / raw)
  To: jg1.han
  Cc: netdev, mcgrof, jouni, vthiagar, senthilb, linville, sgruszka,
	Larry.Finger, chaoming_li, linux-wireless
In-Reply-To: <000f01ce5e99$00617fc0$01247f40$@samsung.com>

From: Jingoo Han <jg1.han@samsung.com>
Date: Sat, 01 Jun 2013 16:24:06 +0900

> The usage of strict_strtoul() is not preferred, because
> strict_strtoul() is obsolete. Thus, kstrtoul() should be
> used.
> 
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>

Applied.

^ permalink raw reply

* [PATCH 1/2] nl80211: allow sending CMD_FRAME without specifying any frequency
From: Antonio Quartulli @ 2013-06-03  6:39 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, Antonio Quartulli

From: Antonio Quartulli <antonio@open-mesh.com>

Users may want to send a frame on the current channel
without specifying it.

Make mgmt_tx pass a NULL channel to mac80211 if none has
been specified by the user.

Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
---
 net/wireless/nl80211.c | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 31d265f..c2376c7 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -7142,6 +7142,9 @@ static int nl80211_tx_mgmt(struct sk_buff *skb, struct genl_info *info)
 		return -EOPNOTSUPP;
 
 	switch (wdev->iftype) {
+	case NL80211_IFTYPE_P2P_DEVICE:
+		if (!info->attrs[NL80211_ATTR_WIPHY_FREQ])
+			return -EINVAL;
 	case NL80211_IFTYPE_STATION:
 	case NL80211_IFTYPE_ADHOC:
 	case NL80211_IFTYPE_P2P_CLIENT:
@@ -7149,7 +7152,6 @@ static int nl80211_tx_mgmt(struct sk_buff *skb, struct genl_info *info)
 	case NL80211_IFTYPE_AP_VLAN:
 	case NL80211_IFTYPE_MESH_POINT:
 	case NL80211_IFTYPE_P2P_GO:
-	case NL80211_IFTYPE_P2P_DEVICE:
 		break;
 	default:
 		return -EOPNOTSUPP;
@@ -7177,9 +7179,16 @@ static int nl80211_tx_mgmt(struct sk_buff *skb, struct genl_info *info)
 
 	no_cck = nla_get_flag(info->attrs[NL80211_ATTR_TX_NO_CCK_RATE]);
 
-	err = nl80211_parse_chandef(rdev, info, &chandef);
-	if (err)
-		return err;
+	/*
+	 * get the channel if any has been specified, otherwise pass NULL to
+	 * mac80211. The latter will use the current one
+	 */
+	chandef.chan = NULL;
+	if (info->attrs[NL80211_ATTR_WIPHY_FREQ]) {
+		err = nl80211_parse_chandef(rdev, info, &chandef);
+		if (err)
+			return err;
+	}
 
 	if (!dont_wait_for_ack) {
 		msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
-- 
1.8.1.5


^ permalink raw reply related

* [PATCH 2/2] mac80211: in mgmt_tx use the current channel if none has been specified
From: Antonio Quartulli @ 2013-06-03  6:39 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, Antonio Quartulli
In-Reply-To: <1370241587-2609-1-git-send-email-ordex@autistici.org>

From: Antonio Quartulli <antonio@open-mesh.com>

In mgmt_tx, if no channel has been specified via cfg80211,
use the current one.

If the interface requires offchan (because disconnected or
for other reasons) then fail.

Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
---
 net/mac80211/cfg.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 9034da1..e6e41c7 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -2836,6 +2836,13 @@ static int ieee80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
 		return -EOPNOTSUPP;
 	}
 
+	/*
+	 * configurations requiring offchan cannot work if no channel has been
+	 * specified
+	 */
+	if (need_offchan && !chan)
+		return -EINVAL;
+
 	mutex_lock(&local->mtx);
 
 	/* Check if the operating channel is the requested channel */
@@ -2845,6 +2852,10 @@ static int ieee80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
 		rcu_read_lock();
 		chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf);
 
+		/* if no channel was specified, use the current one */
+		if (chanctx_conf && !chan)
+			chan = chanctx_conf->def.chan;
+
 		if (chanctx_conf)
 			need_offchan = chan != chanctx_conf->def.chan;
 		else
@@ -2852,6 +2863,12 @@ static int ieee80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
 		rcu_read_unlock();
 	}
 
+	/* at this point a channel should have been chosen */
+	if (!chan) {
+		ret = -EINVAL;
+		goto out_unlock;
+	}
+
 	if (need_offchan && !offchan) {
 		ret = -EBUSY;
 		goto out_unlock;
-- 
1.8.1.5


^ permalink raw reply related

* [PATCH 7/7] ath9k: Do not maintain ANI state per-channel
From: Sujith Manoharan @ 2013-06-03  3:49 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless
In-Reply-To: <1370231369-16241-1-git-send-email-sujith@msujith.org>

From: Sujith Manoharan <c_manoha@qca.qualcomm.com>

ANI state can be maintained globally instead of per-channel.
This reduces memory usage and since default values are used
during a scan run, per-channel state is not required.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath9k/ani.c        | 40 ++++++++++++-----------------
 drivers/net/wireless/ath/ath9k/ar5008_phy.c |  4 +--
 drivers/net/wireless/ath/ath9k/ar9003_phy.c |  4 +--
 drivers/net/wireless/ath/ath9k/hw.h         |  2 +-
 4 files changed, 22 insertions(+), 28 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ani.c b/drivers/net/wireless/ath/ath9k/ani.c
index ba0bad6..e91725b 100644
--- a/drivers/net/wireless/ath/ath9k/ani.c
+++ b/drivers/net/wireless/ath/ath9k/ani.c
@@ -121,7 +121,7 @@ static void ath9k_ani_restart(struct ath_hw *ah)
 	if (!ah->curchan)
 		return;
 
-	aniState = &ah->curchan->ani;
+	aniState = &ah->ani;
 	aniState->listenTime = 0;
 
 	ENABLE_REGWRITE_BUFFER(ah);
@@ -143,7 +143,7 @@ static void ath9k_ani_restart(struct ath_hw *ah)
 static void ath9k_hw_set_ofdm_nil(struct ath_hw *ah, u8 immunityLevel,
 				  bool scan)
 {
-	struct ar5416AniState *aniState = &ah->curchan->ani;
+	struct ar5416AniState *aniState = &ah->ani;
 	struct ath_common *common = ath9k_hw_common(ah);
 	const struct ani_ofdm_level_entry *entry_ofdm;
 	const struct ani_cck_level_entry *entry_cck;
@@ -198,7 +198,7 @@ static void ath9k_hw_ani_ofdm_err_trigger(struct ath_hw *ah)
 	if (!ah->curchan)
 		return;
 
-	aniState = &ah->curchan->ani;
+	aniState = &ah->ani;
 
 	if (aniState->ofdmNoiseImmunityLevel < ATH9K_ANI_OFDM_MAX_LEVEL)
 		ath9k_hw_set_ofdm_nil(ah, aniState->ofdmNoiseImmunityLevel + 1, false);
@@ -210,7 +210,7 @@ static void ath9k_hw_ani_ofdm_err_trigger(struct ath_hw *ah)
 static void ath9k_hw_set_cck_nil(struct ath_hw *ah, u_int8_t immunityLevel,
 				 bool scan)
 {
-	struct ar5416AniState *aniState = &ah->curchan->ani;
+	struct ar5416AniState *aniState = &ah->ani;
 	struct ath_common *common = ath9k_hw_common(ah);
 	const struct ani_ofdm_level_entry *entry_ofdm;
 	const struct ani_cck_level_entry *entry_cck;
@@ -254,7 +254,7 @@ static void ath9k_hw_ani_cck_err_trigger(struct ath_hw *ah)
 	if (!ah->curchan)
 		return;
 
-	aniState = &ah->curchan->ani;
+	aniState = &ah->ani;
 
 	if (aniState->cckNoiseImmunityLevel < ATH9K_ANI_CCK_MAX_LEVEL)
 		ath9k_hw_set_cck_nil(ah, aniState->cckNoiseImmunityLevel + 1,
@@ -269,7 +269,7 @@ static void ath9k_hw_ani_lower_immunity(struct ath_hw *ah)
 {
 	struct ar5416AniState *aniState;
 
-	aniState = &ah->curchan->ani;
+	aniState = &ah->ani;
 
 	/* lower OFDM noise immunity */
 	if (aniState->ofdmNoiseImmunityLevel > 0 &&
@@ -292,7 +292,7 @@ static void ath9k_hw_ani_lower_immunity(struct ath_hw *ah)
  */
 void ath9k_ani_reset(struct ath_hw *ah, bool is_scanning)
 {
-	struct ar5416AniState *aniState = &ah->curchan->ani;
+	struct ar5416AniState *aniState = &ah->ani;
 	struct ath9k_channel *chan = ah->curchan;
 	struct ath_common *common = ath9k_hw_common(ah);
 	int ofdm_nil, cck_nil;
@@ -380,7 +380,7 @@ void ath9k_ani_reset(struct ath_hw *ah, bool is_scanning)
 static bool ath9k_hw_ani_read_counters(struct ath_hw *ah)
 {
 	struct ath_common *common = ath9k_hw_common(ah);
-	struct ar5416AniState *aniState = &ah->curchan->ani;
+	struct ar5416AniState *aniState = &ah->ani;
 	u32 phyCnt1, phyCnt2;
 	int32_t listenTime;
 
@@ -418,7 +418,7 @@ void ath9k_hw_ani_monitor(struct ath_hw *ah, struct ath9k_channel *chan)
 	if (!ah->curchan)
 		return;
 
-	aniState = &ah->curchan->ani;
+	aniState = &ah->ani;
 	if (!ath9k_hw_ani_read_counters(ah))
 		return;
 
@@ -490,28 +490,22 @@ EXPORT_SYMBOL(ath9k_hw_disable_mib_counters);
 void ath9k_hw_ani_init(struct ath_hw *ah)
 {
 	struct ath_common *common = ath9k_hw_common(ah);
-	int i;
+	struct ar5416AniState *ani = &ah->ani;
 
 	ath_dbg(common, ANI, "Initialize ANI\n");
 
 	ah->config.ofdm_trig_high = ATH9K_ANI_OFDM_TRIG_HIGH;
 	ah->config.ofdm_trig_low = ATH9K_ANI_OFDM_TRIG_LOW;
-
 	ah->config.cck_trig_high = ATH9K_ANI_CCK_TRIG_HIGH;
 	ah->config.cck_trig_low = ATH9K_ANI_CCK_TRIG_LOW;
 
-	for (i = 0; i < ARRAY_SIZE(ah->channels); i++) {
-		struct ath9k_channel *chan = &ah->channels[i];
-		struct ar5416AniState *ani = &chan->ani;
-
-		ani->spurImmunityLevel = ATH9K_ANI_SPUR_IMMUNE_LVL;
-		ani->firstepLevel = ATH9K_ANI_FIRSTEP_LVL;
-		ani->mrcCCK = AR_SREV_9300_20_OR_LATER(ah) ? true : false;
-		ani->ofdmsTurn = true;
-		ani->ofdmWeakSigDetect = true;
-		ani->cckNoiseImmunityLevel = ATH9K_ANI_CCK_DEF_LEVEL;
-		ani->ofdmNoiseImmunityLevel = ATH9K_ANI_OFDM_DEF_LEVEL;
-	}
+	ani->spurImmunityLevel = ATH9K_ANI_SPUR_IMMUNE_LVL;
+	ani->firstepLevel = ATH9K_ANI_FIRSTEP_LVL;
+	ani->mrcCCK = AR_SREV_9300_20_OR_LATER(ah) ? true : false;
+	ani->ofdmsTurn = true;
+	ani->ofdmWeakSigDetect = true;
+	ani->cckNoiseImmunityLevel = ATH9K_ANI_CCK_DEF_LEVEL;
+	ani->ofdmNoiseImmunityLevel = ATH9K_ANI_OFDM_DEF_LEVEL;
 
 	/*
 	 * since we expect some ongoing maintenance on the tables, let's sanity
diff --git a/drivers/net/wireless/ath/ath9k/ar5008_phy.c b/drivers/net/wireless/ath/ath9k/ar5008_phy.c
index 92b79a2..d1acfe9 100644
--- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c
+++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c
@@ -931,7 +931,7 @@ static bool ar5008_hw_ani_control_new(struct ath_hw *ah,
 {
 	struct ath_common *common = ath9k_hw_common(ah);
 	struct ath9k_channel *chan = ah->curchan;
-	struct ar5416AniState *aniState = &chan->ani;
+	struct ar5416AniState *aniState = &ah->ani;
 	s32 value, value2;
 
 	switch (cmd & ah->ani_function) {
@@ -1207,7 +1207,7 @@ static void ar5008_hw_ani_cache_ini_regs(struct ath_hw *ah)
 {
 	struct ath_common *common = ath9k_hw_common(ah);
 	struct ath9k_channel *chan = ah->curchan;
-	struct ar5416AniState *aniState = &chan->ani;
+	struct ar5416AniState *aniState = &ah->ani;
 	struct ath9k_ani_default *iniDef;
 	u32 val;
 
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.c b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
index 53562a4..83e0385 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
@@ -905,7 +905,7 @@ static bool ar9003_hw_ani_control(struct ath_hw *ah,
 {
 	struct ath_common *common = ath9k_hw_common(ah);
 	struct ath9k_channel *chan = ah->curchan;
-	struct ar5416AniState *aniState = &chan->ani;
+	struct ar5416AniState *aniState = &ah->ani;
 	s32 value, value2;
 
 	switch (cmd & ah->ani_function) {
@@ -1173,7 +1173,7 @@ static void ar9003_hw_ani_cache_ini_regs(struct ath_hw *ah)
 	struct ath9k_ani_default *iniDef;
 	u32 val;
 
-	aniState = &ah->curchan->ani;
+	aniState = &ah->ani;
 	iniDef = &aniState->iniDef;
 
 	ath_dbg(common, ANI, "ver %d.%d opmode %u chan %d Mhz/0x%x\n",
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index 301b19e..7d259b7 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -420,7 +420,6 @@ struct ath9k_hw_cal_data {
 
 struct ath9k_channel {
 	struct ieee80211_channel *chan;
-	struct ar5416AniState ani;
 	u16 channel;
 	u32 channelFlags;
 	u32 chanmode;
@@ -854,6 +853,7 @@ struct ath_hw {
 	u32 aniperiod;
 	enum ath9k_ani_cmd ani_function;
 	u32 ani_skip_count;
+	struct ar5416AniState ani;
 
 #ifdef CONFIG_ATH9K_BTCOEX_SUPPORT
 	struct ath_btcoex_hw btcoex_hw;
-- 
1.8.3


^ permalink raw reply related

* [PATCH 6/7] ath9k: Print ANI statistics in debugfs
From: Sujith Manoharan @ 2013-06-03  3:49 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless
In-Reply-To: <1370231369-16241-1-git-send-email-sujith@msujith.org>

From: Sujith Manoharan <c_manoha@qca.qualcomm.com>

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath9k/ani.h   |  2 -
 drivers/net/wireless/ath/ath9k/debug.c | 81 +++++++++++++++++++++++++++-------
 2 files changed, 64 insertions(+), 19 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ani.h b/drivers/net/wireless/ath/ath9k/ani.h
index c585e05..78b9fa9 100644
--- a/drivers/net/wireless/ath/ath9k/ani.h
+++ b/drivers/net/wireless/ath/ath9k/ani.h
@@ -111,8 +111,6 @@ struct ar5416AniState {
 };
 
 struct ar5416Stats {
-	u32 ast_ani_niup;
-	u32 ast_ani_nidown;
 	u32 ast_ani_spurup;
 	u32 ast_ani_spurdown;
 	u32 ast_ani_ofdmon;
diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c
index 53c0658..2721f52 100644
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
@@ -173,25 +173,69 @@ static const struct file_operations fops_rx_chainmask = {
 	.llseek = default_llseek,
 };
 
-static ssize_t read_file_disable_ani(struct file *file, char __user *user_buf,
+static ssize_t read_file_ani(struct file *file, char __user *user_buf,
 			     size_t count, loff_t *ppos)
 {
 	struct ath_softc *sc = file->private_data;
 	struct ath_common *common = ath9k_hw_common(sc->sc_ah);
-	char buf[32];
-	unsigned int len;
+	struct ath_hw *ah = sc->sc_ah;
+	unsigned int len = 0, size = 1024;
+	ssize_t retval = 0;
+	char *buf;
 
-	len = sprintf(buf, "%d\n", common->disable_ani);
-	return simple_read_from_buffer(user_buf, count, ppos, buf, len);
+	buf = kzalloc(size, GFP_KERNEL);
+	if (buf == NULL)
+		return -ENOMEM;
+
+	if (common->disable_ani) {
+		len += snprintf(buf + len, size - len, "%s: %s\n",
+				"ANI", "DISABLED");
+		goto exit;
+	}
+
+	len += snprintf(buf + len, size - len, "%15s: %s\n",
+			"ANI", "ENABLED");
+	len += snprintf(buf + len, size - len, "%15s: %u\n",
+			"ANI RESET", ah->stats.ast_ani_reset);
+	len += snprintf(buf + len, size - len, "%15s: %u\n",
+			"SPUR UP", ah->stats.ast_ani_spurup);
+	len += snprintf(buf + len, size - len, "%15s: %u\n",
+			"SPUR DOWN", ah->stats.ast_ani_spurup);
+	len += snprintf(buf + len, size - len, "%15s: %u\n",
+			"OFDM WS-DET ON", ah->stats.ast_ani_ofdmon);
+	len += snprintf(buf + len, size - len, "%15s: %u\n",
+			"OFDM WS-DET OFF", ah->stats.ast_ani_ofdmoff);
+	len += snprintf(buf + len, size - len, "%15s: %u\n",
+			"MRC-CCK ON", ah->stats.ast_ani_ccklow);
+	len += snprintf(buf + len, size - len, "%15s: %u\n",
+			"MRC-CCK OFF", ah->stats.ast_ani_cckhigh);
+	len += snprintf(buf + len, size - len, "%15s: %u\n",
+			"FIR-STEP UP", ah->stats.ast_ani_stepup);
+	len += snprintf(buf + len, size - len, "%15s: %u\n",
+			"FIR-STEP DOWN", ah->stats.ast_ani_stepdown);
+	len += snprintf(buf + len, size - len, "%15s: %u\n",
+			"INV LISTENTIME", ah->stats.ast_ani_lneg_or_lzero);
+	len += snprintf(buf + len, size - len, "%15s: %u\n",
+			"OFDM ERRORS", ah->stats.ast_ani_ofdmerrs);
+	len += snprintf(buf + len, size - len, "%15s: %u\n",
+			"CCK ERRORS", ah->stats.ast_ani_cckerrs);
+exit:
+	if (len > size)
+		len = size;
+
+	retval = simple_read_from_buffer(user_buf, count, ppos, buf, len);
+	kfree(buf);
+
+	return retval;
 }
 
-static ssize_t write_file_disable_ani(struct file *file,
-				      const char __user *user_buf,
-				      size_t count, loff_t *ppos)
+static ssize_t write_file_ani(struct file *file,
+			      const char __user *user_buf,
+			      size_t count, loff_t *ppos)
 {
 	struct ath_softc *sc = file->private_data;
 	struct ath_common *common = ath9k_hw_common(sc->sc_ah);
-	unsigned long disable_ani;
+	unsigned long ani;
 	char buf[32];
 	ssize_t len;
 
@@ -200,12 +244,15 @@ static ssize_t write_file_disable_ani(struct file *file,
 		return -EFAULT;
 
 	buf[len] = '\0';
-	if (strict_strtoul(buf, 0, &disable_ani))
+	if (strict_strtoul(buf, 0, &ani))
+		return -EINVAL;
+
+	if (ani < 0 || ani > 1)
 		return -EINVAL;
 
-	common->disable_ani = !!disable_ani;
+	common->disable_ani = !ani;
 
-	if (disable_ani) {
+	if (common->disable_ani) {
 		clear_bit(SC_OP_ANI_RUN, &sc->sc_flags);
 		ath_stop_ani(sc);
 	} else {
@@ -215,9 +262,9 @@ static ssize_t write_file_disable_ani(struct file *file,
 	return count;
 }
 
-static const struct file_operations fops_disable_ani = {
-	.read = read_file_disable_ani,
-	.write = write_file_disable_ani,
+static const struct file_operations fops_ani = {
+	.read = read_file_ani,
+	.write = write_file_ani,
 	.open = simple_open,
 	.owner = THIS_MODULE,
 	.llseek = default_llseek,
@@ -1727,8 +1774,8 @@ int ath9k_init_debug(struct ath_hw *ah)
 			    sc->debug.debugfs_phy, sc, &fops_rx_chainmask);
 	debugfs_create_file("tx_chainmask", S_IRUSR | S_IWUSR,
 			    sc->debug.debugfs_phy, sc, &fops_tx_chainmask);
-	debugfs_create_file("disable_ani", S_IRUSR | S_IWUSR,
-			    sc->debug.debugfs_phy, sc, &fops_disable_ani);
+	debugfs_create_file("ani", S_IRUSR | S_IWUSR,
+			    sc->debug.debugfs_phy, sc, &fops_ani);
 	debugfs_create_bool("paprd", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy,
 			    &sc->sc_ah->config.enable_paprd);
 	debugfs_create_file("regidx", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy,
-- 
1.8.3


^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox