Re: [PATCH] cfg80211/nl80211: add wifi tx power mode switching support

2016-05-12 Thread Wei-Ning Huang
On Fri, May 13, 2016 at 6:02 AM, Arend van Spriel
 wrote:
> On 12-05-16 11:34, Wei-Ning Huang wrote:
>> On Thu, May 12, 2016 at 2:33 AM, Dan Williams  wrote:
>>> On Wed, 2016-05-11 at 13:03 +0800, Wei-Ning Huang wrote:
 On Fri, May 6, 2016 at 4:19 PM, Wei-Ning Huang 
 wrote:
>
> On Fri, May 6, 2016 at 12:07 AM, Dan Williams 
> wrote:
>>
>>
>> On Thu, 2016-05-05 at 14:44 +0800, Wei-Ning Huang wrote:
>>>
>>> Recent new hardware has the ability to switch between tablet
>>> mode and
>>> clamshell mode. To optimize WiFi performance, we want to be
>>> able to
>>> use
>>> different power table between modes. This patch adds a new
>>> netlink
>>> message type and cfg80211_ops function to allow userspace to
>>> trigger
>>> a
>>> power mode switch for a given wireless interface.
>>>
>>> Signed-off-by: Wei-Ning Huang 
>>> ---
>>>  include/net/cfg80211.h   | 11 +++
>>>  include/uapi/linux/nl80211.h | 21 +
>>>  net/wireless/nl80211.c   | 16 
>>>  net/wireless/rdev-ops.h  | 22 ++
>>>  net/wireless/trace.h | 20 
>>>  5 files changed, 90 insertions(+)
>>>
>>> diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
>>> index 9e1b24c..aa77fa0 100644
>>> --- a/include/net/cfg80211.h
>>> +++ b/include/net/cfg80211.h
>>> @@ -2370,6 +2370,12 @@ struct cfg80211_qos_map {
>>>   * @get_tx_power: store the current TX power into the dbm
>>> variable;
>>>   *   return 0 if successful
>>>   *
>>> + * @set_tx_power_mode: set the transmit power mode. Some
>>> device have
>>> the ability
>>> + *   to transform between different mode such as clamshell and
>>> tablet mode.
>>> + *   set_tx_power_mode allows setting of different TX power
>>> mode at runtime.
>>> + * @get_tx_power_mode: store the current TX power mode into
>>> the mode
>>> variable;
>>> + *   return 0 if successful
>>> + *
>>>   * @set_wds_peer: set the WDS peer for a WDS interface
>>>   *
>>>   * @rfkill_poll: polls the hw rfkill line, use cfg80211
>>> reporting
>>> @@ -2631,6 +2637,11 @@ struct cfg80211_ops {
>>>   int (*get_tx_power)(struct wiphy *wiphy, struct
>>> wireless_dev *wdev,
>>>   int *dbm);
>>>
>>> + int (*set_tx_power_mode)(struct wiphy *wiphy,
>>> +  enum nl80211_tx_power_mode
>>> mode);
>>> + int (*get_tx_power_mode)(struct wiphy *wiphy,
>>> +  enum nl80211_tx_power_mode
>>> *mode);
>>> +
>>>   int (*set_wds_peer)(struct wiphy *wiphy, struct
>>> net_device *dev,
>>>   const u8 *addr);
>>>
>>> diff --git a/include/uapi/linux/nl80211.h
>>> b/include/uapi/linux/nl80211.h
>>> index 5a30a75..9b1888a 100644
>>> --- a/include/uapi/linux/nl80211.h
>>> +++ b/include/uapi/linux/nl80211.h
>>> @@ -1796,6 +1796,9 @@ enum nl80211_commands {
>>>   *   connecting to a PCP, and in %NL80211_CMD_START_AP to
>>> start
>>>   *   a PCP instead of AP. Relevant for DMG networks only.
>>>   *
>>> + * @NL80211_ATTR_WIPHY_TX_POWER_MODE: Transmit power mode. See
>>> + *   nl80211_tx_power_mode for possible values.
>>> + *
>>>   * @NUM_NL80211_ATTR: total number of nl80211_attrs available
>>>   * @NL80211_ATTR_MAX: highest attribute number currently
>>> defined
>>>   * @__NL80211_ATTR_AFTER_LAST: internal use
>>> @@ -2172,6 +2175,8 @@ enum nl80211_attrs {
>>>
>>>   NL80211_ATTR_PBSS,
>>>
>>> + NL80211_ATTR_WIPHY_TX_POWER_MODE,
>>> +
>>>   /* add attributes here, update the policy in nl80211.c */
>>>
>>>   __NL80211_ATTR_AFTER_LAST,
>>> @@ -3703,6 +3708,22 @@ enum nl80211_tx_power_setting {
>>>  };
>>>
>>>  /**
>>> + * enum nl80211_tx_power_mode - TX power mode setting
>>> + * @NL80211_TX_POWER_LOW: general low TX power mode
>>> + * @NL80211_TX_POWER_MEDIUM: general medium TX power mode
>>> + * @NL80211_TX_POWER_HIGH: general high TX power mode
>>> + * @NL80211_TX_POWER_CLAMSHELL: clamshell mode TX power mode
>>> + * @NL80211_TX_POWER_TABLET: tablet mode TX power mode
>>> + */
>>> +enum nl80211_tx_power_mode {
>>> + NL80211_TX_POWER_LOW,
>>> + NL80211_TX_POWER_MEDIUM,
>>> + NL80211_TX_POWER_HIGH,
>>> + NL80211_TX_POWER_CLAMSHELL,
>>> + NL80211_TX_POWER_TABLET,
>>
>> "clamshell" and "tablet" probably mean many different things to
>> many
>> different people with respect to whether or not they should do
>> anything
>> 

[PATCH] ath9k: Support 4.9Ghz channels on AR9580 adapter.

2016-05-12 Thread greearb
From: Ben Greear 

NOTE:  These channels must not be used in most regulatory
domains unless you have a license from the FCC or similar!

A proper regulatory database is also required to actually use
these channels.

Signed-off-by: Ben Greear 
---
 drivers/net/wireless/ath/ath9k/ath9k.h   |  2 +-
 drivers/net/wireless/ath/ath9k/common-init.c | 42 ++--
 drivers/net/wireless/ath/ath9k/hw.h  |  4 +--
 3 files changed, 37 insertions(+), 11 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h 
b/drivers/net/wireless/ath/ath9k/ath9k.h
index d78bb10..0429bd5 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -958,7 +958,7 @@ struct ath_softc {
struct device *dev;
 
struct survey_info *cur_survey;
-   struct survey_info survey[ATH9K_NUM_CHANNELS];
+   struct survey_info survey[ATH9K_MAX_NUM_CHANNELS];
 
struct tasklet_struct intr_tq;
struct tasklet_struct bcon_tasklet;
diff --git a/drivers/net/wireless/ath/ath9k/common-init.c 
b/drivers/net/wireless/ath/ath9k/common-init.c
index a006c14..2bff831 100644
--- a/drivers/net/wireless/ath/ath9k/common-init.c
+++ b/drivers/net/wireless/ath/ath9k/common-init.c
@@ -86,6 +86,20 @@ static const struct ieee80211_channel ath9k_5ghz_chantable[] 
= {
CHAN5G(5785, 35), /* Channel 157 */
CHAN5G(5805, 36), /* Channel 161 */
CHAN5G(5825, 37), /* Channel 165 */
+
+   /* 4.9Ghz channels, public safety channels, license is required in US
+* and most other regulatory domains!
+*/
+   CHAN5G(4915, 38), /* Channel 183 */
+   CHAN5G(4920, 39), /* Channel 184 */
+   CHAN5G(4925, 40), /* Channel 185 */
+   CHAN5G(4935, 41), /* Channel 187 */
+   CHAN5G(4940, 42), /* Channel 188 */
+   CHAN5G(4945, 43), /* Channel 189 */
+   CHAN5G(4960, 44), /* Channel 192 */
+   CHAN5G(4970, 45), /* Channel 194 */
+   CHAN5G(4980, 46), /* Channel 196 */
+#define ATH9K_NUM_49GHZ_CHANNELS 9
 };
 
 /* Atheros hardware rate code addition for short premble */
@@ -122,14 +136,28 @@ static struct ieee80211_rate ath9k_legacy_rates[] = {
 IEEE80211_RATE_SUPPORTS_10MHZ)),
 };
 
+static bool ath9k_49ghz_capable(struct ath_hw* ah)
+{
+   /* Seems AR9580 supports 4.9ghz, at least. */
+   switch (ah->hw_version.devid) {
+   case AR9300_DEVID_AR9580:
+   return true;
+   }
+   return false;
+}
+
+
 int ath9k_cmn_init_channels_rates(struct ath_common *common)
 {
struct ath_hw *ah = (struct ath_hw *)common->ah;
void *channels;
+   int num_5ghz_chan = ARRAY_SIZE(ath9k_5ghz_chantable);
+   if (!ath9k_49ghz_capable(ah))
+   num_5ghz_chan -= ATH9K_NUM_49GHZ_CHANNELS;
 
BUILD_BUG_ON(ARRAY_SIZE(ath9k_2ghz_chantable) +
-ARRAY_SIZE(ath9k_5ghz_chantable) !=
-ATH9K_NUM_CHANNELS);
+ARRAY_SIZE(ath9k_5ghz_chantable) >
+ATH9K_MAX_NUM_CHANNELS);
 
if (ah->caps.hw_caps & ATH9K_HW_CAP_2GHZ) {
channels = devm_kzalloc(ah->dev,
@@ -149,17 +177,15 @@ int ath9k_cmn_init_channels_rates(struct ath_common 
*common)
}
 
if (ah->caps.hw_caps & ATH9K_HW_CAP_5GHZ) {
-   channels = devm_kzalloc(ah->dev,
-   sizeof(ath9k_5ghz_chantable), GFP_KERNEL);
+   int ch_sz = num_5ghz_chan * sizeof(ath9k_5ghz_chantable[0]);
+   channels = devm_kzalloc(ah->dev, ch_sz, GFP_KERNEL);
if (!channels)
return -ENOMEM;
 
-   memcpy(channels, ath9k_5ghz_chantable,
-  sizeof(ath9k_5ghz_chantable));
+   memcpy(channels, ath9k_5ghz_chantable, ch_sz);
common->sbands[IEEE80211_BAND_5GHZ].channels = channels;
common->sbands[IEEE80211_BAND_5GHZ].band = IEEE80211_BAND_5GHZ;
-   common->sbands[IEEE80211_BAND_5GHZ].n_channels =
-   ARRAY_SIZE(ath9k_5ghz_chantable);
+   common->sbands[IEEE80211_BAND_5GHZ].n_channels = num_5ghz_chan;
common->sbands[IEEE80211_BAND_5GHZ].bitrates =
ath9k_legacy_rates + 4;
common->sbands[IEEE80211_BAND_5GHZ].n_bitrates =
diff --git a/drivers/net/wireless/ath/ath9k/hw.h 
b/drivers/net/wireless/ath/ath9k/hw.h
index 831a544..eaf8d2d 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -73,7 +73,7 @@
 
 #define ATH9K_RSSI_BAD -128
 
-#define ATH9K_NUM_CHANNELS 38
+#define ATH9K_MAX_NUM_CHANNELS 47
 
 /* Register read/write primitives */
 #define REG_WRITE(_ah, _reg, _val) \
@@ -776,7 +776,7 @@ struct ath_hw {
struct ath9k_hw_version hw_version;
struct ath9k_ops_config config;
struct ath9k_hw_capabilities caps;
-   struct 

Re: [PATCH] cfg80211/nl80211: add wifi tx power mode switching support

2016-05-12 Thread Arend van Spriel
On 12-05-16 11:34, Wei-Ning Huang wrote:
> On Thu, May 12, 2016 at 2:33 AM, Dan Williams  wrote:
>> On Wed, 2016-05-11 at 13:03 +0800, Wei-Ning Huang wrote:
>>> On Fri, May 6, 2016 at 4:19 PM, Wei-Ning Huang 
>>> wrote:

 On Fri, May 6, 2016 at 12:07 AM, Dan Williams 
 wrote:
>
>
> On Thu, 2016-05-05 at 14:44 +0800, Wei-Ning Huang wrote:
>>
>> Recent new hardware has the ability to switch between tablet
>> mode and
>> clamshell mode. To optimize WiFi performance, we want to be
>> able to
>> use
>> different power table between modes. This patch adds a new
>> netlink
>> message type and cfg80211_ops function to allow userspace to
>> trigger
>> a
>> power mode switch for a given wireless interface.
>>
>> Signed-off-by: Wei-Ning Huang 
>> ---
>>  include/net/cfg80211.h   | 11 +++
>>  include/uapi/linux/nl80211.h | 21 +
>>  net/wireless/nl80211.c   | 16 
>>  net/wireless/rdev-ops.h  | 22 ++
>>  net/wireless/trace.h | 20 
>>  5 files changed, 90 insertions(+)
>>
>> diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
>> index 9e1b24c..aa77fa0 100644
>> --- a/include/net/cfg80211.h
>> +++ b/include/net/cfg80211.h
>> @@ -2370,6 +2370,12 @@ struct cfg80211_qos_map {
>>   * @get_tx_power: store the current TX power into the dbm
>> variable;
>>   *   return 0 if successful
>>   *
>> + * @set_tx_power_mode: set the transmit power mode. Some
>> device have
>> the ability
>> + *   to transform between different mode such as clamshell and
>> tablet mode.
>> + *   set_tx_power_mode allows setting of different TX power
>> mode at runtime.
>> + * @get_tx_power_mode: store the current TX power mode into
>> the mode
>> variable;
>> + *   return 0 if successful
>> + *
>>   * @set_wds_peer: set the WDS peer for a WDS interface
>>   *
>>   * @rfkill_poll: polls the hw rfkill line, use cfg80211
>> reporting
>> @@ -2631,6 +2637,11 @@ struct cfg80211_ops {
>>   int (*get_tx_power)(struct wiphy *wiphy, struct
>> wireless_dev *wdev,
>>   int *dbm);
>>
>> + int (*set_tx_power_mode)(struct wiphy *wiphy,
>> +  enum nl80211_tx_power_mode
>> mode);
>> + int (*get_tx_power_mode)(struct wiphy *wiphy,
>> +  enum nl80211_tx_power_mode
>> *mode);
>> +
>>   int (*set_wds_peer)(struct wiphy *wiphy, struct
>> net_device *dev,
>>   const u8 *addr);
>>
>> diff --git a/include/uapi/linux/nl80211.h
>> b/include/uapi/linux/nl80211.h
>> index 5a30a75..9b1888a 100644
>> --- a/include/uapi/linux/nl80211.h
>> +++ b/include/uapi/linux/nl80211.h
>> @@ -1796,6 +1796,9 @@ enum nl80211_commands {
>>   *   connecting to a PCP, and in %NL80211_CMD_START_AP to
>> start
>>   *   a PCP instead of AP. Relevant for DMG networks only.
>>   *
>> + * @NL80211_ATTR_WIPHY_TX_POWER_MODE: Transmit power mode. See
>> + *   nl80211_tx_power_mode for possible values.
>> + *
>>   * @NUM_NL80211_ATTR: total number of nl80211_attrs available
>>   * @NL80211_ATTR_MAX: highest attribute number currently
>> defined
>>   * @__NL80211_ATTR_AFTER_LAST: internal use
>> @@ -2172,6 +2175,8 @@ enum nl80211_attrs {
>>
>>   NL80211_ATTR_PBSS,
>>
>> + NL80211_ATTR_WIPHY_TX_POWER_MODE,
>> +
>>   /* add attributes here, update the policy in nl80211.c */
>>
>>   __NL80211_ATTR_AFTER_LAST,
>> @@ -3703,6 +3708,22 @@ enum nl80211_tx_power_setting {
>>  };
>>
>>  /**
>> + * enum nl80211_tx_power_mode - TX power mode setting
>> + * @NL80211_TX_POWER_LOW: general low TX power mode
>> + * @NL80211_TX_POWER_MEDIUM: general medium TX power mode
>> + * @NL80211_TX_POWER_HIGH: general high TX power mode
>> + * @NL80211_TX_POWER_CLAMSHELL: clamshell mode TX power mode
>> + * @NL80211_TX_POWER_TABLET: tablet mode TX power mode
>> + */
>> +enum nl80211_tx_power_mode {
>> + NL80211_TX_POWER_LOW,
>> + NL80211_TX_POWER_MEDIUM,
>> + NL80211_TX_POWER_HIGH,
>> + NL80211_TX_POWER_CLAMSHELL,
>> + NL80211_TX_POWER_TABLET,
>
> "clamshell" and "tablet" probably mean many different things to
> many
> different people with respect to whether or not they should do
> anything
> with power saving or wifi.  I feel like a more generic interface
> is
> needed here.
 We could probably drop those two CLAMSHELL and TABLET constant or
 describing what they mean
 in more 

Re: [PATCH v2] brcmfmac: add fallback for devices that do not report per-chain values

2016-05-12 Thread Arend van Spriel
On 12-05-16 18:25, Jaap Jan Meijer wrote:
> If brcmf_cfg80211_get_station fails to determine the RSSI from the
> per-chain values get the value individually as a fallback.
> 
> Fixes: 1f0dc59a6de9 ("brcmfmac: rework .get_station() callback")

Acked-by: Arend van Spriel 
> Signed-off-by: Jaap Jan Meijer 
> ---
> change log:
> v2:
>  - remove beacon period and dtim, these values are obtained differently
>  - add reverence to fixed commit
> ---
>  .../net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c  | 16 
> 
>  1 file changed, 16 insertions(+)
> 
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c 
> b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
> index d5c2a27..e19847c 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
> @@ -2480,12 +2480,14 @@ brcmf_cfg80211_get_station(struct wiphy *wiphy, 
> struct net_device *ndev,
>  const u8 *mac, struct station_info *sinfo)
>  {
>   struct brcmf_if *ifp = netdev_priv(ndev);
> + struct brcmf_scb_val_le scb_val;
>   s32 err = 0;
>   struct brcmf_sta_info_le sta_info_le;
>   u32 sta_flags;
>   u32 is_tdls_peer;
>   s32 total_rssi;
>   s32 count_rssi;
> + int rssi;
>   u32 i;
>  
>   brcmf_dbg(TRACE, "Enter, MAC %pM\n", mac);
> @@ -2569,6 +2571,20 @@ brcmf_cfg80211_get_station(struct wiphy *wiphy, struct 
> net_device *ndev,
>   sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL);
>   total_rssi /= count_rssi;
>   sinfo->signal = total_rssi;
> + } else if (test_bit(BRCMF_VIF_STATUS_CONNECTED,
> + >vif->sme_state)) {
> + memset(_val, 0, sizeof(scb_val));
> + err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_RSSI,
> +  _val, sizeof(scb_val));
> + if (err) {
> + brcmf_err("Could not get rssi (%d)\n", err);
> + goto done;
> + } else {
> + rssi = le32_to_cpu(scb_val.val);
> + sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL);
> + sinfo->signal = rssi;
> + brcmf_dbg(CONN, "RSSI %d dBm\n", rssi);
> + }
>   }
>   }
>  done:
> 
--
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 net-next 4/5] treewide: replace dev->trans_start update with helper

2016-05-12 Thread Doug Ledford
On 05/03/2016 10:33 AM, Florian Westphal wrote:
> Replace all trans_start updates with netif_trans_update helper.
> change was done via spatch:
> 
> struct net_device *d;
> @@
> - d->trans_start = jiffies
> + netif_trans_update(d)
> 
> Compile tested only.
> 
> Cc: user-mode-linux-de...@lists.sourceforge.net
> Cc: linux-xte...@linux-xtensa.org
> Cc: linux1394-de...@lists.sourceforge.net
> Cc: linux-r...@vger.kernel.org
> Cc: net...@vger.kernel.org
> Cc: mpt-fusionlinux@broadcom.com
> Cc: linux-s...@vger.kernel.org
> Cc: linux-...@vger.kernel.org
> Cc: linux-par...@vger.kernel.org
> Cc: linux-o...@vger.kernel.org
> Cc: linux-h...@vger.kernel.org
> Cc: linux-...@vger.kernel.org
> Cc: linux-wireless@vger.kernel.org
> Cc: linux-s...@vger.kernel.org
> Cc: de...@driverdev.osuosl.org
> Cc: b.a.t.m@lists.open-mesh.org
> Cc: linux-blueto...@vger.kernel.org
> Signed-off-by: Florian Westphal 
> ---
>  Checkpatch complains about whitespace damage, but
>  this extra whitespace already exists before this patch.
> 
>  drivers/infiniband/hw/nes/nes_nic.c| 2 +-
>  drivers/infiniband/ulp/ipoib/ipoib_cm.c| 2 +-
>  drivers/infiniband/ulp/ipoib/ipoib_ib.c| 2 +-

For InfiniBand bits,

Acked-by: Doug Ledford 

-- 
Doug Ledford 
  GPG KeyID: 0E572FDD




signature.asc
Description: OpenPGP digital signature


[RFC] wcn36xx: Implement firmware assisted scan

2016-05-12 Thread Bjorn Andersson
Using the software based channel scan mechanism from mac80211 keeps us
offline for 10-15 second, we should instead issue a start_scan/end_scan
on each channel reducing this time.

Signed-off-by: Bjorn Andersson 
---

With this implementation I see a reduction of throughput for about 1-2 seconds
with iperf while scanning, so the improvement is clear.

The problem with the implementation is that ieee80211_rx_status must specify
the correct band for the core to not drop the beacons. I have searched for
indications in the incoming data, but am not able to find anything useful, so
this currently rely on shared state (scan_freq/scan_band) that gets updated
during scan.

If anyone familiar with this hardware have any suggestions on how to better
deal with this I would appreciate the feedback.

 drivers/net/wireless/ath/wcn36xx/main.c| 62 --
 drivers/net/wireless/ath/wcn36xx/smd.c |  8 ++--
 drivers/net/wireless/ath/wcn36xx/smd.h |  4 +-
 drivers/net/wireless/ath/wcn36xx/txrx.c| 19 ++---
 drivers/net/wireless/ath/wcn36xx/wcn36xx.h |  9 +
 5 files changed, 79 insertions(+), 23 deletions(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/main.c 
b/drivers/net/wireless/ath/wcn36xx/main.c
index 25a492d7504b..20ff661694ed 100644
--- a/drivers/net/wireless/ath/wcn36xx/main.c
+++ b/drivers/net/wireless/ath/wcn36xx/main.c
@@ -489,23 +489,57 @@ out:
return ret;
 }
 
-static void wcn36xx_sw_scan_start(struct ieee80211_hw *hw,
- struct ieee80211_vif *vif,
- const u8 *mac_addr)
+static void wcn36xx_hw_scan_worker(struct work_struct *work)
 {
-   struct wcn36xx *wcn = hw->priv;
+   struct wcn36xx *wcn = container_of(work, struct wcn36xx, scan_work);
+   struct cfg80211_scan_request *req = wcn->scan_req;
+   u8 channels[WCN36XX_HAL_PNO_MAX_NETW_CHANNELS_EX];
+   int i;
+
+   wcn36xx_dbg(WCN36XX_DBG_MAC, "mac80211 scan %d channels worker\n", 
req->n_channels);
+
+   for (i = 0; i < req->n_channels; i++)
+   channels[i] = req->channels[i]->hw_value;
+
+   wcn36xx_smd_update_scan_params(wcn, channels, req->n_channels);
 
wcn36xx_smd_init_scan(wcn, HAL_SYS_MODE_SCAN);
-   wcn36xx_smd_start_scan(wcn);
+   for (i = 0; i < req->n_channels; i++) {
+   wcn->scan_freq = req->channels[i]->center_freq;
+   wcn->scan_band = req->channels[i]->band;
+
+   wcn36xx_smd_start_scan(wcn, req->channels[i]->hw_value);
+   msleep(30);
+   wcn36xx_smd_end_scan(wcn, req->channels[i]->hw_value);
+
+   wcn->scan_freq = 0;
+   }
+   wcn36xx_smd_finish_scan(wcn, HAL_SYS_MODE_SCAN);
+
+   ieee80211_scan_completed(wcn->hw, false);
+
+   mutex_lock(>scan_lock);
+   wcn->scan_req = NULL;
+   mutex_unlock(>scan_lock);
 }
 
-static void wcn36xx_sw_scan_complete(struct ieee80211_hw *hw,
-struct ieee80211_vif *vif)
+static int wcn36xx_hw_scan(struct ieee80211_hw *hw,
+  struct ieee80211_vif *vif,
+  struct ieee80211_scan_request *hw_req)
 {
struct wcn36xx *wcn = hw->priv;
 
-   wcn36xx_smd_end_scan(wcn);
-   wcn36xx_smd_finish_scan(wcn, HAL_SYS_MODE_SCAN);
+   mutex_lock(>scan_lock);
+   if (wcn->scan_req) {
+   mutex_unlock(>scan_lock);
+   return -EBUSY;
+   }
+   wcn->scan_req = _req->req;
+   mutex_unlock(>scan_lock);
+
+   schedule_work(>scan_work);
+
+   return 0;
 }
 
 static void wcn36xx_update_allowed_rates(struct ieee80211_sta *sta,
@@ -919,8 +953,7 @@ static const struct ieee80211_ops wcn36xx_ops = {
.configure_filter   = wcn36xx_configure_filter,
.tx = wcn36xx_tx,
.set_key= wcn36xx_set_key,
-   .sw_scan_start  = wcn36xx_sw_scan_start,
-   .sw_scan_complete   = wcn36xx_sw_scan_complete,
+   .hw_scan= wcn36xx_hw_scan,
.bss_info_changed   = wcn36xx_bss_info_changed,
.set_rts_threshold  = wcn36xx_set_rts_threshold,
.sta_add= wcn36xx_sta_add,
@@ -945,6 +978,7 @@ static int wcn36xx_init_ieee80211(struct wcn36xx *wcn)
ieee80211_hw_set(wcn->hw, SUPPORTS_PS);
ieee80211_hw_set(wcn->hw, SIGNAL_DBM);
ieee80211_hw_set(wcn->hw, HAS_RATE_CONTROL);
+   ieee80211_hw_set(wcn->hw, SINGLE_SCAN_ON_ALL_BANDS);
 
wcn->hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
BIT(NL80211_IFTYPE_AP) |
@@ -954,6 +988,9 @@ static int wcn36xx_init_ieee80211(struct wcn36xx *wcn)
wcn->hw->wiphy->bands[IEEE80211_BAND_2GHZ] = _band_2ghz;
wcn->hw->wiphy->bands[IEEE80211_BAND_5GHZ] = _band_5ghz;
 
+   wcn->hw->wiphy->max_scan_ssids = WCN36XX_MAX_SCAN_SSIDS;
+   wcn->hw->wiphy->max_scan_ie_len = 

[PATCH v2] brcmfmac: add fallback for devices that do not report per-chain values

2016-05-12 Thread Jaap Jan Meijer
If brcmf_cfg80211_get_station fails to determine the RSSI from the
per-chain values get the value individually as a fallback.

Fixes: 1f0dc59a6de9 ("brcmfmac: rework .get_station() callback")

Signed-off-by: Jaap Jan Meijer 
---
change log:
v2:
 - remove beacon period and dtim, these values are obtained differently
 - add reverence to fixed commit
---
 .../net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c  | 16 
 1 file changed, 16 insertions(+)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c 
b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
index d5c2a27..e19847c 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
@@ -2480,12 +2480,14 @@ brcmf_cfg80211_get_station(struct wiphy *wiphy, struct 
net_device *ndev,
   const u8 *mac, struct station_info *sinfo)
 {
struct brcmf_if *ifp = netdev_priv(ndev);
+   struct brcmf_scb_val_le scb_val;
s32 err = 0;
struct brcmf_sta_info_le sta_info_le;
u32 sta_flags;
u32 is_tdls_peer;
s32 total_rssi;
s32 count_rssi;
+   int rssi;
u32 i;
 
brcmf_dbg(TRACE, "Enter, MAC %pM\n", mac);
@@ -2569,6 +2571,20 @@ brcmf_cfg80211_get_station(struct wiphy *wiphy, struct 
net_device *ndev,
sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL);
total_rssi /= count_rssi;
sinfo->signal = total_rssi;
+   } else if (test_bit(BRCMF_VIF_STATUS_CONNECTED,
+   >vif->sme_state)) {
+   memset(_val, 0, sizeof(scb_val));
+   err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_RSSI,
+_val, sizeof(scb_val));
+   if (err) {
+   brcmf_err("Could not get rssi (%d)\n", err);
+   goto done;
+   } else {
+   rssi = le32_to_cpu(scb_val.val);
+   sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL);
+   sinfo->signal = rssi;
+   brcmf_dbg(CONN, "RSSI %d dBm\n", rssi);
+   }
}
}
 done:
-- 
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] brcmfmac: add fallback for devices that do not report per-chain values

2016-05-12 Thread Jaap Jan Meijer
2016-05-11 22:55 GMT+02:00 Arend van Spriel :
> However, this patch changes more. I did not get back on your question
> regarding beacon period and dtim. Sorry for that as it means this patch
> still need rework. Those values are obtained differently and filled in
> by the function brcmf_fill_bss_param() (called in line 2530). When you
> do that make sure the subject prefix is 'PATCH v2' iso 'PATCH' (using
> git format-patch option --subject-prefix=..) and add a changelog after
> your signed-off line as shown below:
>
> Signed-off-by: Jaap Jan Meijer 
> ---
> change log:
>  v2:
> - bla...
> ---
>  .../broadcom/brcm80211/brcmfmac/cfg80211.c | 42
> ++
>
> Don't get discouraged :-D Nederlander?

I won't but I hope you won't either and yes, what gave it away? ;)


2016-05-12 8:32 GMT+02:00 Kalle Valo :
>
> This fixed a regression, right? So then a Fixes line would be nice:
>
> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/SubmittingPatches#n171
>
> --
> Kalle Valo

Thank you for the feedback guys, I will send a new patch shortly.
--
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] iw: Fix -Wabsolute-value compiler warning in iw.c

2016-05-12 Thread Aurimas Liutikas
Signed-off-by: Aurimas Liutikas 

diff --git a/iw.c b/iw.c
index 2aabddb..a6efe5b 100644
--- a/iw.c
+++ b/iw.c
@@ -516,7 +516,7 @@ int main(int argc, char **argv)
const struct cmd *cmd = NULL;

/* calculate command size including padding */
-   cmd_size = abs((long)&__section_set - (long)&__section_get);
+   cmd_size = labs((long)&__section_set - (long)&__section_get);
/* strip off self */
argc--;
argv0 = *argv++;
--
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: mac80211-next 2016-05-12

2016-05-12 Thread David Miller
From: Johannes Berg 
Date: Thu, 12 May 2016 13:06:01 +0200

> A few more patches for 4.7 - I listed the notable ones below in the tag
> message.
> 
> Note that this isn't the tip of my tree - I merged the namespace work
> for nl80211 and hwsim there, but at least the hwsim one needs some more
> follow-up work which I don't want to send in after the merge window.
> 
> Let me know if there's any problem.

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


RE: [PATCH] mwifiex: handle edmac vendor command

2016-05-12 Thread Amitkumar Karwar
Hi Kalle,

> From: Amitkumar Karwar [mailto:akar...@marvell.com]
> Sent: Friday, April 29, 2016 9:28 PM
> To: linux-wireless@vger.kernel.org
> Cc: Jeff CF Chen; Amitkumar Karwar
> Subject: [PATCH] mwifiex: handle edmac vendor command
> 
> From: chunfan chen 
> 
> Userspace can configure edmac values through a custom vendor command.
> They will be used by hardware for adaptivity.
> 
> Signed-off-by: chunfan chen 
> Signed-off-by: Amitkumar Karwar 
> ---
>  drivers/net/wireless/marvell/mwifiex/Makefile   |  1 +
>  drivers/net/wireless/marvell/mwifiex/cfg80211.c |  2 +
>  drivers/net/wireless/marvell/mwifiex/main.h |  4 ++
>  drivers/net/wireless/marvell/mwifiex/sta_cmd.c  | 20 ++---
>  drivers/net/wireless/marvell/mwifiex/vendor.c   | 59
> +
>  drivers/net/wireless/marvell/mwifiex/vendor.h   | 27 +++
>  6 files changed, 108 insertions(+), 5 deletions(-)  create mode 100644
> drivers/net/wireless/marvell/mwifiex/vendor.c
>  create mode 100644 drivers/net/wireless/marvell/mwifiex/vendor.h
> 
> diff --git a/drivers/net/wireless/marvell/mwifiex/Makefile
> b/drivers/net/wireless/marvell/mwifiex/Makefile
> index fdfd9bf..8b34ce9 100644
> --- a/drivers/net/wireless/marvell/mwifiex/Makefile
> +++ b/drivers/net/wireless/marvell/mwifiex/Makefile
> @@ -42,6 +42,7 @@ mwifiex-y += cfg80211.o  mwifiex-y += ethtool.o
> mwifiex-y += 11h.o  mwifiex-y += tdls.o
> +mwifiex-y += vendor.o
>  mwifiex-$(CONFIG_DEBUG_FS) += debugfs.o
>  obj-$(CONFIG_MWIFIEX) += mwifiex.o
> 
> diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c
> b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
> index ff948a9..00aca7e 100644
> --- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c
> +++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
> @@ -4118,6 +4118,8 @@ int mwifiex_register_cfg80211(struct
> mwifiex_adapter *adapter)
>   if (adapter->fw_api_ver == MWIFIEX_FW_V15)
>   wiphy->features |= NL80211_FEATURE_SK_TX_STATUS;
> 
> + marvell_set_vendor_commands(wiphy);
> +
>   /* Reserve space for mwifiex specific private data for BSS */
>   wiphy->bss_priv_size = sizeof(struct mwifiex_bss_priv);
> 
> diff --git a/drivers/net/wireless/marvell/mwifiex/main.h
> b/drivers/net/wireless/marvell/mwifiex/main.h
> index 0207af0..66ba5c0 100644
> --- a/drivers/net/wireless/marvell/mwifiex/main.h
> +++ b/drivers/net/wireless/marvell/mwifiex/main.h
> @@ -1002,6 +1002,8 @@ struct mwifiex_adapter {
>   bool usb_mc_status;
>   bool usb_mc_setup;
>   struct cfg80211_wowlan_nd_info *nd_info;
> + u8 *cfg_data;
> + int cfg_len;
>  };
> 
>  void mwifiex_process_tx_queue(struct mwifiex_adapter *adapter); @@ -
> 1614,6 +1616,8 @@ void mwifiex_process_multi_chan_event(struct
> mwifiex_private *priv,
> struct sk_buff *event_skb);
>  void mwifiex_multi_chan_resync(struct mwifiex_adapter *adapter);
> 
> +void marvell_set_vendor_commands(struct wiphy *wiphy);
> +
>  #ifdef CONFIG_DEBUG_FS
>  void mwifiex_debugfs_init(void);
>  void mwifiex_debugfs_remove(void);
> diff --git a/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
> b/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
> index e436574..6b8cc39 100644
> --- a/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
> +++ b/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
> @@ -1487,9 +1487,10 @@ static int mwifiex_cmd_cfg_data(struct
> mwifiex_private *priv,  {
>   struct mwifiex_adapter *adapter = priv->adapter;
>   struct property *prop = data_buf;
> - u32 len;
> + u32 len = 0;
>   u8 *data = (u8 *)cmd + S_DS_GEN;
>   int ret;
> + const struct firmware *cal_data = adapter->cal_data;
> 
>   if (prop) {
>   len = prop->length;
> @@ -1500,11 +1501,20 @@ static int mwifiex_cmd_cfg_data(struct
> mwifiex_private *priv,
>   mwifiex_dbg(adapter, INFO,
>   "download cfg_data from device tree: %s\n",
>   prop->name);
> - } else if (adapter->cal_data->data && adapter->cal_data->size > 0)
> {
> - len = mwifiex_parse_cal_cfg((u8 *)adapter->cal_data->data,
> - adapter->cal_data->size, data);
> + } else if (cal_data) {
> + if (cal_data->data && cal_data->size > 0) {
> + len = mwifiex_parse_cal_cfg((u8 *)cal_data->data,
> + cal_data->size, data);
> + mwifiex_dbg(adapter, INFO,
> + "download cfg_data from config file\n");
> + } else {
> + return -1;
> + }
> + } else if (adapter->cfg_data && adapter->cfg_len > 0) {
> + len = mwifiex_parse_cal_cfg(adapter->cfg_data,
> + adapter->cfg_len, data);
>   mwifiex_dbg(adapter, INFO,
> - 

pull-request: mac80211-next 2016-05-12

2016-05-12 Thread Johannes Berg
Hi Dave,

A few more patches for 4.7 - I listed the notable ones below in the tag
message.

Note that this isn't the tip of my tree - I merged the namespace work
for nl80211 and hwsim there, but at least the hwsim one needs some more
follow-up work which I don't want to send in after the merge window.

Let me know if there's any problem.

Thanks,
johannes



The following changes since commit 557fc4a098039cf296fe33f118bab99a925fd881:

  fq: add fair queuing framework (2016-04-25 16:45:53 -0400)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git 
tags/mac80211-next-for-davem-2016-05-12

for you to fetch changes up to 46fa38e84b656f80edf83d21144221b0cad18d61:

  mac80211: allow software PS-Poll/U-APSD with AP_LINK_PS (2016-05-12 11:16:55 
+0200)


Some more work for 4.7, notably:
 * completion and fixups of nla_put_64_64bit() work
 * remove a/b/g/n from wext nickname to avoid confusion
   with 11ac (which wouldn't even fit fully there due to
   string length restrictions)

along with some other minor changes/cleanups.


David Spinadel (1):
  mac80211: remove disconnected APs from BSS table

Emmanuel Grumbach (1):
  cfg80211: allow finding vendor with OUI without specifying the OUI type

Johannes Berg (6):
  nl80211: add missing kerneldoc for new *_PAD attributes
  nl80211: use nla_put_u64_64bit() for the remaining u64 attributes
  wext: remove a/b/g/n from SIOCGIWNAME
  cfg80211: remove erroneous comment
  cfg80211: make wdev_list accessible to drivers
  mac80211: allow software PS-Poll/U-APSD with AP_LINK_PS

Kanchanapally, Vidyullatha (1):
  cfg80211: Add option to report the bss entry in connect result

Mohammed Shafi Shajakhan (1):
  cfg80211/nl80211: Add support for NL80211_STA_INFO_RX_DURATION

Sara Sharon (1):
  mac80211: allow same PN for AMSDU sub-frames

 Documentation/DocBook/80211.tmpl |  1 +
 include/net/cfg80211.h   | 52 +
 include/net/mac80211.h   | 33 ++-
 include/uapi/linux/nl80211.h | 11 +++
 net/mac80211/mlme.c  |  5 +++
 net/mac80211/rx.c| 70 +---
 net/mac80211/wpa.c   | 16 ++---
 net/wireless/chan.c  |  2 +-
 net/wireless/core.c  | 17 ++
 net/wireless/core.h  |  6 ++--
 net/wireless/nl80211.c   | 53 +-
 net/wireless/reg.c   |  2 +-
 net/wireless/scan.c  |  8 +++--
 net/wireless/sme.c   | 32 +-
 net/wireless/sysfs.c |  2 +-
 net/wireless/util.c  |  6 ++--
 net/wireless/wext-compat.c   | 35 
 17 files changed, 230 insertions(+), 121 deletions(-)
--
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] cfg80211/nl80211: add wifi tx power mode switching support

2016-05-12 Thread Wei-Ning Huang
On Thu, May 12, 2016 at 2:33 AM, Dan Williams  wrote:
> On Wed, 2016-05-11 at 13:03 +0800, Wei-Ning Huang wrote:
>> On Fri, May 6, 2016 at 4:19 PM, Wei-Ning Huang 
>> wrote:
>> >
>> > On Fri, May 6, 2016 at 12:07 AM, Dan Williams 
>> > wrote:
>> > >
>> > >
>> > > On Thu, 2016-05-05 at 14:44 +0800, Wei-Ning Huang wrote:
>> > > >
>> > > > Recent new hardware has the ability to switch between tablet
>> > > > mode and
>> > > > clamshell mode. To optimize WiFi performance, we want to be
>> > > > able to
>> > > > use
>> > > > different power table between modes. This patch adds a new
>> > > > netlink
>> > > > message type and cfg80211_ops function to allow userspace to
>> > > > trigger
>> > > > a
>> > > > power mode switch for a given wireless interface.
>> > > >
>> > > > Signed-off-by: Wei-Ning Huang 
>> > > > ---
>> > > >  include/net/cfg80211.h   | 11 +++
>> > > >  include/uapi/linux/nl80211.h | 21 +
>> > > >  net/wireless/nl80211.c   | 16 
>> > > >  net/wireless/rdev-ops.h  | 22 ++
>> > > >  net/wireless/trace.h | 20 
>> > > >  5 files changed, 90 insertions(+)
>> > > >
>> > > > diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
>> > > > index 9e1b24c..aa77fa0 100644
>> > > > --- a/include/net/cfg80211.h
>> > > > +++ b/include/net/cfg80211.h
>> > > > @@ -2370,6 +2370,12 @@ struct cfg80211_qos_map {
>> > > >   * @get_tx_power: store the current TX power into the dbm
>> > > > variable;
>> > > >   *   return 0 if successful
>> > > >   *
>> > > > + * @set_tx_power_mode: set the transmit power mode. Some
>> > > > device have
>> > > > the ability
>> > > > + *   to transform between different mode such as clamshell and
>> > > > tablet mode.
>> > > > + *   set_tx_power_mode allows setting of different TX power
>> > > > mode at runtime.
>> > > > + * @get_tx_power_mode: store the current TX power mode into
>> > > > the mode
>> > > > variable;
>> > > > + *   return 0 if successful
>> > > > + *
>> > > >   * @set_wds_peer: set the WDS peer for a WDS interface
>> > > >   *
>> > > >   * @rfkill_poll: polls the hw rfkill line, use cfg80211
>> > > > reporting
>> > > > @@ -2631,6 +2637,11 @@ struct cfg80211_ops {
>> > > >   int (*get_tx_power)(struct wiphy *wiphy, struct
>> > > > wireless_dev *wdev,
>> > > >   int *dbm);
>> > > >
>> > > > + int (*set_tx_power_mode)(struct wiphy *wiphy,
>> > > > +  enum nl80211_tx_power_mode
>> > > > mode);
>> > > > + int (*get_tx_power_mode)(struct wiphy *wiphy,
>> > > > +  enum nl80211_tx_power_mode
>> > > > *mode);
>> > > > +
>> > > >   int (*set_wds_peer)(struct wiphy *wiphy, struct
>> > > > net_device *dev,
>> > > >   const u8 *addr);
>> > > >
>> > > > diff --git a/include/uapi/linux/nl80211.h
>> > > > b/include/uapi/linux/nl80211.h
>> > > > index 5a30a75..9b1888a 100644
>> > > > --- a/include/uapi/linux/nl80211.h
>> > > > +++ b/include/uapi/linux/nl80211.h
>> > > > @@ -1796,6 +1796,9 @@ enum nl80211_commands {
>> > > >   *   connecting to a PCP, and in %NL80211_CMD_START_AP to
>> > > > start
>> > > >   *   a PCP instead of AP. Relevant for DMG networks only.
>> > > >   *
>> > > > + * @NL80211_ATTR_WIPHY_TX_POWER_MODE: Transmit power mode. See
>> > > > + *   nl80211_tx_power_mode for possible values.
>> > > > + *
>> > > >   * @NUM_NL80211_ATTR: total number of nl80211_attrs available
>> > > >   * @NL80211_ATTR_MAX: highest attribute number currently
>> > > > defined
>> > > >   * @__NL80211_ATTR_AFTER_LAST: internal use
>> > > > @@ -2172,6 +2175,8 @@ enum nl80211_attrs {
>> > > >
>> > > >   NL80211_ATTR_PBSS,
>> > > >
>> > > > + NL80211_ATTR_WIPHY_TX_POWER_MODE,
>> > > > +
>> > > >   /* add attributes here, update the policy in nl80211.c */
>> > > >
>> > > >   __NL80211_ATTR_AFTER_LAST,
>> > > > @@ -3703,6 +3708,22 @@ enum nl80211_tx_power_setting {
>> > > >  };
>> > > >
>> > > >  /**
>> > > > + * enum nl80211_tx_power_mode - TX power mode setting
>> > > > + * @NL80211_TX_POWER_LOW: general low TX power mode
>> > > > + * @NL80211_TX_POWER_MEDIUM: general medium TX power mode
>> > > > + * @NL80211_TX_POWER_HIGH: general high TX power mode
>> > > > + * @NL80211_TX_POWER_CLAMSHELL: clamshell mode TX power mode
>> > > > + * @NL80211_TX_POWER_TABLET: tablet mode TX power mode
>> > > > + */
>> > > > +enum nl80211_tx_power_mode {
>> > > > + NL80211_TX_POWER_LOW,
>> > > > + NL80211_TX_POWER_MEDIUM,
>> > > > + NL80211_TX_POWER_HIGH,
>> > > > + NL80211_TX_POWER_CLAMSHELL,
>> > > > + NL80211_TX_POWER_TABLET,
>> > >
>> > > "clamshell" and "tablet" probably mean many different things to
>> > > many
>> > > different people with respect to whether or not they should do
>> > > anything
>> > > with power saving or wifi.  I feel 

Re: [RESEND PATCH 1/3] rfkill: Create "rfkill-airplane-mode" LED trigger

2016-05-12 Thread Johannes Berg
On Wed, 2016-05-04 at 09:29 +0200, Pavel Machek wrote:
> 
> If userspace wants to control the manually, it can do just that --
> control it manually. There should not be a need to "override the
> default policy".

I'm still not buying this.

In the original situation, without these patches, userspace has to have
a list of all LEDs that are supposed to indicate airplane mode.

With this patch only (without patch 2/3), userspace can look up the
default trigger, but then has to change it, causing the necessary
information to be lost immediately when you actually use it - that also
seems like a bad idea.

With the patches, the userspace that cares can also concentrate on
something it already *does* - i.e. dealing with the rfkill API - and
let the rest of the situation be sorted out in itself.


Now, if the LED subsystem had a really good way of specifying LED
intent, and it was widely used, and rfkill didn't already concern
itself with the rfkill status of all devices ... yeah maybe this
wouldn't be needed. As it stands, I still think this is the best way
forward.

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


Re: [PATCH v2 0/2] wireless: Allow wiphy/hwsim management from user namespaces

2016-05-12 Thread Johannes Berg
Hi Martin,

Thanks for the update.

I've applied your patch now, but I think we need to do some work around
the wmediumd abstraction.

Right now, you allowed HWSIM_CMD_REGISTER only from init_net, which is
mostly fine.

However, it means that a wmediumd running in init_net will see frames
from the radios that are generated by other namespace, but will have no
way to access anything else about them, neither through hwsim netlink
nor through nl80211 or sysfs.

So I think you should change the "wmediumd_portid" variable to live
in struct hwsim_net and then allow HWSIM_CMD_REGISTER to be done inside
the net namespace.

With that, and making the other few wmediumd related operations
namespace aware, we would be able to run wmediumd in any net namespace
and have it manage all the radios created in that namespace.

johannes

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


Re: [PATCH v2] mac80211: allow same PN for AMSDU sub-frames

2016-05-12 Thread Johannes Berg
Applied all 6 patches you sent together here.

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


Re: [PATCH v2] mac80211: add vht cap decode to debugfs.

2016-05-12 Thread Johannes Berg
On Mon, 2016-05-02 at 14:23 -0700, gree...@candelatech.com wrote:
> 
> + PFLAG(MAX_MPDU_LENGTH_3895, "MAX-MPDU-3895");
> + PFLAG(MAX_MPDU_LENGTH_7991, "MAX-MPDU-7991");
> + PFLAG(MAX_MPDU_LENGTH_11454, "MAX-MPDU-11454");

This doesn't work as intended, please treat this two-bit field
properly.

> + PFLAG(SUPP_CHAN_WIDTH_160MHZ, "160Mhz");
> + PFLAG(SUPP_CHAN_WIDTH_160_80PLUS80MHZ, "160-
> 80+80Mhz");

Same here.

> + PFLAG(RXSTBC_1, "RXSTBC_1");
> + PFLAG(RXSTBC_2, "RXSTBC_2");
> + PFLAG(RXSTBC_3, "RXSTBC_3");
> + PFLAG(RXSTBC_4, "RXSTBC_4");

This is clearly also wrong, as you could even see in the output you
pasted into the commit log.

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


Re: [PATCH] mac80211: Get ethtool-stats frequency more often.

2016-05-12 Thread Johannes Berg
Hi Ben,

I'm confused about the subject - "more often"?

> Some NICs (ath9k_htc) don't use chanctx_conf, it
> seems, so look at local->hw.conf.channel->center_freq
> in that case.

It shouldn't matter whether or not the *driver* (not NIC anyway) uses
that structure - mac80211 uses it throughout internally. As such, this
doesn't really make sense.

I also think that your patch is wrong because it causes a driver that
doesn't report information for the current channel to still have a non-
zero frequency, so userspace won't be able to tell if there's any data
or not.

johannes

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


Re: [PATCH] brcmfmac: add fallback for devices that do not report per-chain values

2016-05-12 Thread Kalle Valo
Arend van Spriel  writes:

> On 11-05-16 21:40, Jaap Jan Meijer wrote:
>> If brcmf_cfg80211_get_station fails to determine the RSSI from the
>> per-chain values get all values individually as a fallback.
>
> That commit message looks good.

This fixed a regression, right? So then a Fixes line would be nice:

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/SubmittingPatches#n171

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