* [PATCH v2 7/9] rt2800: use RTS/CTS protection instead of CTS-to-self
From: Stanislaw Gruszka @ 2016-11-18 9:43 UTC (permalink / raw)
To: linux-wireless; +Cc: Helmut Schaa, Mathias Kresin
In-Reply-To: <1479462241-9299-1-git-send-email-sgruszka@redhat.com>
Change default to RTS/CTS protection. This has a cost of transmitting
one more control frame (RTS) however protect us from traffic from
hidden node.
On station mode will use CTS-to-self if AP will configure that
for the network.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
index 812f8e7..57bfec4 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
@@ -1621,7 +1621,7 @@ static void rt2800_config_ht_opmode(struct rt2x00_dev *rt2x00dev,
* => Protect all HT40 transmissions.
*/
mm20_mode = gf20_mode = 0;
- mm40_mode = gf40_mode = 2;
+ mm40_mode = gf40_mode = 1;
break;
case IEEE80211_HT_OP_MODE_PROTECTION_NONMEMBER:
@@ -1644,7 +1644,7 @@ static void rt2800_config_ht_opmode(struct rt2x00_dev *rt2x00dev,
* Legacy STAs are present
* => Protect all HT transmissions.
*/
- mm20_mode = mm40_mode = gf20_mode = gf40_mode = 2;
+ mm20_mode = mm40_mode = gf20_mode = gf40_mode = 1;
/*
* If erp protection is needed we have to protect HT
@@ -1660,7 +1660,7 @@ static void rt2800_config_ht_opmode(struct rt2x00_dev *rt2x00dev,
/* check for STAs not supporting greenfield mode */
if (any_sta_nongf)
- gf20_mode = gf40_mode = 2;
+ gf20_mode = gf40_mode = 1;
/* Update HT protection config */
rt2800_register_read(rt2x00dev, MM20_PROT_CFG, ®);
--
1.8.3.1
^ permalink raw reply related
* [PATCH v2 6/9] rt2800: correct TX_SW_CFG1 for 5592
From: Stanislaw Gruszka @ 2016-11-18 9:43 UTC (permalink / raw)
To: linux-wireless; +Cc: Helmut Schaa, Mathias Kresin
In-Reply-To: <1479462241-9299-1-git-send-email-sgruszka@redhat.com>
Those TX_SW_CFG1 values are used in vendor driver.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
index ff4a7c3..812f8e7 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
@@ -4670,11 +4670,14 @@ static int rt2800_init_registers(struct rt2x00_dev *rt2x00dev)
0x00000000);
}
} else if (rt2x00_rt(rt2x00dev, RT5390) ||
- rt2x00_rt(rt2x00dev, RT5392) ||
- rt2x00_rt(rt2x00dev, RT5592)) {
+ rt2x00_rt(rt2x00dev, RT5392)) {
rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000404);
rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x00080606);
rt2800_register_write(rt2x00dev, TX_SW_CFG2, 0x00000000);
+ } else if (rt2x00_rt(rt2x00dev, RT5592)) {
+ rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000404);
+ rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x00000000);
+ rt2800_register_write(rt2x00dev, TX_SW_CFG2, 0x00000000);
} else {
rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000000);
rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x00080606);
--
1.8.3.1
^ permalink raw reply related
* [PATCH v2 5/9] rt2800: correct AUTO_RSP_CFG
From: Stanislaw Gruszka @ 2016-11-18 9:43 UTC (permalink / raw)
To: linux-wireless; +Cc: Helmut Schaa, Mathias Kresin
In-Reply-To: <1479462241-9299-1-git-send-email-sgruszka@redhat.com>
Initialize AUTO_RSP_CFG register to similar value as vendor driver does.
Do not set BAC_ACK_POLICY based on short preamble setting, those are
unrelated.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
index 9ecdc4c..ff4a7c3 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
@@ -1691,8 +1691,6 @@ void rt2800_config_erp(struct rt2x00_dev *rt2x00dev, struct rt2x00lib_erp *erp,
if (changed & BSS_CHANGED_ERP_PREAMBLE) {
rt2800_register_read(rt2x00dev, AUTO_RSP_CFG, ®);
- rt2x00_set_field32(®, AUTO_RSP_CFG_BAC_ACK_POLICY,
- !!erp->short_preamble);
rt2x00_set_field32(®, AUTO_RSP_CFG_AR_PREAMBLE,
!!erp->short_preamble);
rt2800_register_write(rt2x00dev, AUTO_RSP_CFG, reg);
@@ -4735,9 +4733,9 @@ static int rt2800_init_registers(struct rt2x00_dev *rt2x00dev)
rt2800_register_read(rt2x00dev, AUTO_RSP_CFG, ®);
rt2x00_set_field32(®, AUTO_RSP_CFG_AUTORESPONDER, 1);
rt2x00_set_field32(®, AUTO_RSP_CFG_BAC_ACK_POLICY, 1);
- rt2x00_set_field32(®, AUTO_RSP_CFG_CTS_40_MMODE, 0);
+ rt2x00_set_field32(®, AUTO_RSP_CFG_CTS_40_MMODE, 1);
rt2x00_set_field32(®, AUTO_RSP_CFG_CTS_40_MREF, 0);
- rt2x00_set_field32(®, AUTO_RSP_CFG_AR_PREAMBLE, 1);
+ rt2x00_set_field32(®, AUTO_RSP_CFG_AR_PREAMBLE, 0);
rt2x00_set_field32(®, AUTO_RSP_CFG_DUAL_CTS_EN, 0);
rt2x00_set_field32(®, AUTO_RSP_CFG_ACK_CTS_PSM_BIT, 0);
rt2800_register_write(rt2x00dev, AUTO_RSP_CFG, reg);
--
1.8.3.1
^ permalink raw reply related
* [PATCH v2 4/9] rt2800: do not overwrite WPDMA_GLO_CFG_WP_DMA_BURST_SIZE
From: Stanislaw Gruszka @ 2016-11-18 9:43 UTC (permalink / raw)
To: linux-wireless; +Cc: Helmut Schaa, Mathias Kresin
In-Reply-To: <1479462241-9299-1-git-send-email-sgruszka@redhat.com>
We already initlized WPDMA_GLO_CFG_WP_DMA_BURST_SIZE to 3 on
rt2800_init_registers() for USB devices. For PCI devices we will use
HW default setting, which is 2, so patch does not change behaviour
on PCI devices.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
index feceb13..9ecdc4c 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
@@ -6756,7 +6756,6 @@ int rt2800_enable_radio(struct rt2x00_dev *rt2x00dev)
rt2800_register_read(rt2x00dev, WPDMA_GLO_CFG, ®);
rt2x00_set_field32(®, WPDMA_GLO_CFG_ENABLE_TX_DMA, 1);
rt2x00_set_field32(®, WPDMA_GLO_CFG_ENABLE_RX_DMA, 1);
- rt2x00_set_field32(®, WPDMA_GLO_CFG_WP_DMA_BURST_SIZE, 2);
rt2x00_set_field32(®, WPDMA_GLO_CFG_TX_WRITEBACK_DONE, 1);
rt2800_register_write(rt2x00dev, WPDMA_GLO_CFG, reg);
--
1.8.3.1
^ permalink raw reply related
* [PATCH v2 3/9] rt2800: OFDM rates are mandatory
From: Stanislaw Gruszka @ 2016-11-18 9:43 UTC (permalink / raw)
To: linux-wireless; +Cc: Helmut Schaa, Mathias Kresin
In-Reply-To: <1479462241-9299-1-git-send-email-sgruszka@redhat.com>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
index aab59f6..feceb13 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
@@ -1707,7 +1707,7 @@ void rt2800_config_erp(struct rt2x00_dev *rt2x00dev, struct rt2x00lib_erp *erp,
if (changed & BSS_CHANGED_BASIC_RATES) {
rt2800_register_write(rt2x00dev, LEGACY_BASIC_RATE,
- erp->basic_rates);
+ 0xff0 | erp->basic_rates);
rt2800_register_write(rt2x00dev, HT_BASIC_RATE, 0x00008003);
}
--
1.8.3.1
^ permalink raw reply related
* [PATCH v2 2/9] rt2800usb: do not wipe out USB_DMA_CFG settings
From: Stanislaw Gruszka @ 2016-11-18 9:43 UTC (permalink / raw)
To: linux-wireless; +Cc: Helmut Schaa, Mathias Kresin
In-Reply-To: <1479462241-9299-1-git-send-email-sgruszka@redhat.com>
We should not reset USB_DMA_CFG on rt2800usb_init_registers() as this
function is called indirectly from rt2800_enable_radio(). If we
do so, we wipe out USB_DMA_CFG settings from rt2800usb_enable_radio().
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
drivers/net/wireless/ralink/rt2x00/rt2800usb.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800usb.c b/drivers/net/wireless/ralink/rt2x00/rt2800usb.c
index 4b0bb6b..9f61293 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2800usb.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800usb.c
@@ -341,8 +341,6 @@ static int rt2800usb_init_registers(struct rt2x00_dev *rt2x00dev)
rt2x00_set_field32(®, MAC_SYS_CTRL_RESET_BBP, 1);
rt2x00usb_register_write(rt2x00dev, MAC_SYS_CTRL, reg);
- rt2x00usb_register_write(rt2x00dev, USB_DMA_CFG, 0x00000000);
-
rt2x00usb_vendor_request_sw(rt2x00dev, USB_DEVICE_MODE, 0,
USB_MODE_RESET, REGISTER_TIMEOUT);
@@ -353,12 +351,11 @@ static int rt2800usb_init_registers(struct rt2x00_dev *rt2x00dev)
static int rt2800usb_enable_radio(struct rt2x00_dev *rt2x00dev)
{
- u32 reg;
+ u32 reg = 0;
if (unlikely(rt2800_wait_wpdma_ready(rt2x00dev)))
return -EIO;
- rt2x00usb_register_read(rt2x00dev, USB_DMA_CFG, ®);
rt2x00_set_field32(®, USB_DMA_CFG_PHY_CLEAR, 0);
rt2x00_set_field32(®, USB_DMA_CFG_RX_BULK_AGG_EN, 0);
rt2x00_set_field32(®, USB_DMA_CFG_RX_BULK_AGG_TIMEOUT, 128);
--
1.8.3.1
^ permalink raw reply related
* [PATCH v2 1/9] rt2800: correctly report MCS TX parameters
From: Stanislaw Gruszka @ 2016-11-18 9:43 UTC (permalink / raw)
To: linux-wireless; +Cc: Helmut Schaa, Mathias Kresin
In-Reply-To: <1479462241-9299-1-git-send-email-sgruszka@redhat.com>
We should only set IEEE80211_HT_MCS_TX_RX_DIF when TX and RX MCS sets
are not equal, i.e. when number of tx streams is different than
number of RX streams.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 23 +++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)
diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
index bf3f0a3..aab59f6 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
@@ -7464,7 +7464,7 @@ static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
char *default_power1;
char *default_power2;
char *default_power3;
- unsigned int i;
+ unsigned int i, tx_chains, rx_chains;
u32 reg;
/*
@@ -7589,21 +7589,24 @@ static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
IEEE80211_HT_CAP_SGI_20 |
IEEE80211_HT_CAP_SGI_40;
- if (rt2x00dev->default_ant.tx_chain_num >= 2)
+ tx_chains = rt2x00dev->default_ant.tx_chain_num;
+ rx_chains = rt2x00dev->default_ant.rx_chain_num;
+
+ if (tx_chains >= 2)
spec->ht.cap |= IEEE80211_HT_CAP_TX_STBC;
- spec->ht.cap |= rt2x00dev->default_ant.rx_chain_num <<
- IEEE80211_HT_CAP_RX_STBC_SHIFT;
+ spec->ht.cap |= rx_chains << IEEE80211_HT_CAP_RX_STBC_SHIFT;
spec->ht.ampdu_factor = 3;
spec->ht.ampdu_density = 4;
- spec->ht.mcs.tx_params =
- IEEE80211_HT_MCS_TX_DEFINED |
- IEEE80211_HT_MCS_TX_RX_DIFF |
- ((rt2x00dev->default_ant.tx_chain_num - 1) <<
- IEEE80211_HT_MCS_TX_MAX_STREAMS_SHIFT);
+ spec->ht.mcs.tx_params = IEEE80211_HT_MCS_TX_DEFINED;
+ if (tx_chains != rx_chains) {
+ spec->ht.mcs.tx_params |= IEEE80211_HT_MCS_TX_RX_DIFF;
+ spec->ht.mcs.tx_params |=
+ (tx_chains - 1) << IEEE80211_HT_MCS_TX_MAX_STREAMS_SHIFT;
+ }
- switch (rt2x00dev->default_ant.rx_chain_num) {
+ switch (rx_chains) {
case 3:
spec->ht.mcs.rx_mask[2] = 0xff;
case 2:
--
1.8.3.1
^ permalink raw reply related
* [PATCH v2 0/9] rt2800: random fixes
From: Stanislaw Gruszka @ 2016-11-18 9:43 UTC (permalink / raw)
To: linux-wireless; +Cc: Helmut Schaa, Mathias Kresin
Random fixes mostly related to HT performance.
v1 -> v2:
- drop patch "rt2800: make ba_size depend on ampdu_factor"
- fix changelog for patch "rt2800: do not overwrite WPDMA_GLO_CFG_WP_DMA_BURST_SIZE"
Stanislaw Gruszka (9):
rt2800: correctly report MCS TX parameters
rt2800usb: do not wipe out USB_DMA_CFG settings
rt2800: OFDM rates are mandatory
rt2800: do not overwrite WPDMA_GLO_CFG_WP_DMA_BURST_SIZE
rt2800: correct AUTO_RSP_CFG
rt2800: correct TX_SW_CFG1 for 5592
rt2800: use RTS/CTS protection instead of CTS-to-self
rt2800: tune *_PROT_CFG parameters
rt2800: disable CCK rates on HT
drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 62 +++++++++++++-------------
drivers/net/wireless/ralink/rt2x00/rt2800usb.c | 5 +--
2 files changed, 33 insertions(+), 34 deletions(-)
--
1.8.3.1
^ permalink raw reply
* Re: [PATCH 0/7] Fix -Wunused-but-set-variable in mwifiex/
From: Arnd Bergmann @ 2016-11-18 8:49 UTC (permalink / raw)
To: Kirtika Ruchandani
Cc: Amitkumar Karwar, Kalle Valo, linux-wireless, Nishant Sarmukadam,
Zhaoyang Liu, Bing Zhao, Xinming Hu, Avinash Patil
In-Reply-To: <cover.1479458373.git.kirtika@google.com>
On Friday, November 18, 2016 12:43:22 AM CET Kirtika Ruchandani wrote:
> This patchset is part of the effort led by Arnd Bergmann to clean up
> warnings in the kernel. This and following patchsets will focus on
> "-Wunused-but-set-variable" as it among the noisier ones. These were
> found compiling with W=1.
All seven patches look good to me, nice cleanup!
Acked-by: Arnd Bergmann <arnd@arndb.de>
^ permalink raw reply
* [PATCH 7/7] mwifiex: Remove unused 'bcd_usb' variable
From: Kirtika Ruchandani @ 2016-11-18 8:46 UTC (permalink / raw)
To: Amitkumar Karwar
Cc: Arnd Bergmann, Kalle Valo, linux-wireless, Nishant Sarmukadam,
Zhaoyang Liu, Bing Zhao, Xinming Hu, Avinash Patil
In-Reply-To: <cover.1479458373.git.kirtika@google.com>
mwifiex_usb_probe() defines and sets bcd_usb but does not use it,
Compiling with W=1 gives the following warning, fix it.
mwifiex/usb.c: In function ‘mwifiex_usb_probe’:
mwifiex/usb.c:383:41: warning: variable ‘bcd_usb’ set but not used [-Wunused-but-set-variable]
The unused variable seems to be present since 4daffe354366 which introduced
mwifiex_usb_probe().
Fixes: 4daffe354366 ("mwifiex: add support for Marvell USB8797 chipset")
Cc: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kirtika Ruchandani <kirtika@google.com>
---
drivers/net/wireless/marvell/mwifiex/usb.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/wireless/marvell/mwifiex/usb.c b/drivers/net/wireless/marvell/mwifiex/usb.c
index 73eb084..67a15c1 100644
--- a/drivers/net/wireless/marvell/mwifiex/usb.c
+++ b/drivers/net/wireless/marvell/mwifiex/usb.c
@@ -380,7 +380,7 @@ static int mwifiex_usb_probe(struct usb_interface *intf,
struct usb_endpoint_descriptor *epd;
int ret, i;
struct usb_card_rec *card;
- u16 id_vendor, id_product, bcd_device, bcd_usb;
+ u16 id_vendor, id_product, bcd_device;
card = kzalloc(sizeof(struct usb_card_rec), GFP_KERNEL);
if (!card)
@@ -389,7 +389,6 @@ static int mwifiex_usb_probe(struct usb_interface *intf,
id_vendor = le16_to_cpu(udev->descriptor.idVendor);
id_product = le16_to_cpu(udev->descriptor.idProduct);
bcd_device = le16_to_cpu(udev->descriptor.bcdDevice);
- bcd_usb = le16_to_cpu(udev->descriptor.bcdUSB);
pr_debug("info: VID/PID = %X/%X, Boot2 version = %X\n",
id_vendor, id_product, bcd_device);
--
2.8.0.rc3.226.g39d4020
^ permalink raw reply related
* [PATCH 6/7] mwifiex: Removed unused 'pkt_type' variable
From: Kirtika Ruchandani @ 2016-11-18 8:46 UTC (permalink / raw)
To: Amitkumar Karwar
Cc: Arnd Bergmann, Kalle Valo, linux-wireless, Nishant Sarmukadam,
Zhaoyang Liu, Bing Zhao, Xinming Hu, Avinash Patil
In-Reply-To: <cover.1479458373.git.kirtika@google.com>
Commit 92263a841b15 introduced mwifiex_deaggr_sdio_pkt which initializes
variable pkt_type but does not use it. Compiling with W=1 gives the following
warning, fix it.
mwifiex/sdio.c: In function ‘mwifiex_deaggr_sdio_pkt’:
mwifiex/sdio.c:1198:6: warning: variable ‘pkt_type’ set but not used [-Wunused-but-set-variable]
Fixes: 92263a841b15 ("mwifiex: add SDIO rx single port aggregation")
Cc: Zhaoyang Liu <liuzy@marvell.com>
Cc: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kirtika Ruchandani <kirtika@google.com>
---
drivers/net/wireless/marvell/mwifiex/sdio.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.c b/drivers/net/wireless/marvell/mwifiex/sdio.c
index 41ec59d7..4028a8c 100644
--- a/drivers/net/wireless/marvell/mwifiex/sdio.c
+++ b/drivers/net/wireless/marvell/mwifiex/sdio.c
@@ -1193,7 +1193,6 @@ static void mwifiex_deaggr_sdio_pkt(struct mwifiex_adapter *adapter,
{
u32 total_pkt_len, pkt_len;
struct sk_buff *skb_deaggr;
- u32 pkt_type;
u16 blk_size;
u8 blk_num;
u8 *data;
@@ -1214,8 +1213,6 @@ static void mwifiex_deaggr_sdio_pkt(struct mwifiex_adapter *adapter,
break;
}
pkt_len = le16_to_cpu(*(__le16 *)(data + SDIO_HEADER_OFFSET));
- pkt_type = le16_to_cpu(*(__le16 *)(data + SDIO_HEADER_OFFSET +
- 2));
if ((pkt_len + SDIO_HEADER_OFFSET) > blk_size) {
mwifiex_dbg(adapter, ERROR,
"%s: error in pkt_len,\t"
--
2.8.0.rc3.226.g39d4020
^ permalink raw reply related
* [PATCH 5/7] mwifiex: Remove unused 'pm_flag' variable
From: Kirtika Ruchandani @ 2016-11-18 8:45 UTC (permalink / raw)
To: Amitkumar Karwar
Cc: Arnd Bergmann, Kalle Valo, linux-wireless, Nishant Sarmukadam,
Zhaoyang Liu, Bing Zhao, Xinming Hu, Avinash Patil
In-Reply-To: <cover.1479458373.git.kirtika@google.com>
mwifiex_sdio_resume() intializes pm_flag, just like mwifiex_sdio_suspend(), but
does not use it. Compiling with W=1 gives the following warning, fix it.
mwifiex/sdio.c: In function ‘mwifiex_sdio_resume’:
mwifiex/sdio.c:234:16: warning: variable ‘pm_flag’ set but not used [-Wunused-but-set-variable]
sdio_get_host_pm_caps() is just an acessor, so the call to it is safe to
remove.
The unused variable seems to be present since 5e6e3a92b9a4 which introduced
mwifiex_sdio_resume().
Fixes: 5e6e3a92b9a4 ("wireless: mwifiex: initial commit for Marvell mwifiex driver")
Cc: Bing Zhao <bzhao@marvell.com>
Cc: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kirtika Ruchandani <kirtika@google.com>
---
drivers/net/wireless/marvell/mwifiex/sdio.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.c b/drivers/net/wireless/marvell/mwifiex/sdio.c
index 8718950..41ec59d7 100644
--- a/drivers/net/wireless/marvell/mwifiex/sdio.c
+++ b/drivers/net/wireless/marvell/mwifiex/sdio.c
@@ -231,10 +231,8 @@ static int mwifiex_sdio_resume(struct device *dev)
struct sdio_func *func = dev_to_sdio_func(dev);
struct sdio_mmc_card *card;
struct mwifiex_adapter *adapter;
- mmc_pm_flag_t pm_flag = 0;
if (func) {
- pm_flag = sdio_get_host_pm_caps(func);
card = sdio_get_drvdata(func);
if (!card || !card->adapter) {
pr_err("resume: invalid card or adapter\n");
--
2.8.0.rc3.226.g39d4020
^ permalink raw reply related
* [PATCH 4/7] mwifiex: Remove unused 'adapter'variable
From: Kirtika Ruchandani @ 2016-11-18 8:45 UTC (permalink / raw)
To: Amitkumar Karwar
Cc: Arnd Bergmann, Kalle Valo, linux-wireless, Nishant Sarmukadam,
Zhaoyang Liu, Bing Zhao, Xinming Hu, Avinash Patil
In-Reply-To: <cover.1479458373.git.kirtika@google.com>
Commit 3935ccc14d2c introduced mwifiex_tm_cmd() which initializes
struct mwifiex_adapter* adapter, but doesn't use it.
Compiling with W=1 gives the following warning, fix it.
mwifiex/cfg80211.c: In function ‘mwifiex_tm_cmd’:
mwifiex/cfg80211.c:3973:26: warning: variable ‘adapter’ set but not used [-Wunused-but-set-variable]
Fixes: 3935ccc14d2c ("mwifiex: add cfg80211 testmode support")
Cc: Xinming Hu <huxm@marvell.com>
Cc: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kirtika Ruchandani <kirtika@google.com>
---
drivers/net/wireless/marvell/mwifiex/cfg80211.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
index 39ce76a..dd93cda 100644
--- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
@@ -3970,13 +3970,11 @@ static int mwifiex_tm_cmd(struct wiphy *wiphy, struct wireless_dev *wdev,
struct mwifiex_private *priv = mwifiex_netdev_get_priv(wdev->netdev);
struct mwifiex_ds_misc_cmd *hostcmd;
struct nlattr *tb[MWIFIEX_TM_ATTR_MAX + 1];
- struct mwifiex_adapter *adapter;
struct sk_buff *skb;
int err;
if (!priv)
return -EINVAL;
- adapter = priv->adapter;
err = nla_parse(tb, MWIFIEX_TM_ATTR_MAX, data, len,
mwifiex_tm_policy);
--
2.8.0.rc3.226.g39d4020
^ permalink raw reply related
* [PATCH 3/7] mwifiex: Remove unused 'sta_ptr' variable
From: Kirtika Ruchandani @ 2016-11-18 8:45 UTC (permalink / raw)
To: Amitkumar Karwar
Cc: Arnd Bergmann, Kalle Valo, linux-wireless, Nishant Sarmukadam,
Zhaoyang Liu, Bing Zhao, Xinming Hu, Avinash Patil
In-Reply-To: <cover.1479458373.git.kirtika@google.com>
Commit 429d90d2212b introduced mwifiex_cmd_tdls_oper() which initializes
struct mwifiex_sta_node* sta_ptr, but does not use it. Compiling with W=1 gives
the following warning, fix it.
mwifiex/sta_cmd.c: In function ‘mwifiex_cmd_tdls_oper’:
mwifiex/sta_cmd.c:1732:27: warning: variable ‘sta_ptr’ set but not used [-Wunused-but-set-variable]
Fixes: 429d90d2212b ("mwifiex: add cfg80211 tdls_oper handler support")
Cc: Avinash Patil <patila@marvell.com>
Signed-off-by: Kirtika Ruchandani <kirtika@google.com>
---
drivers/net/wireless/marvell/mwifiex/sta_cmd.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/net/wireless/marvell/mwifiex/sta_cmd.c b/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
index 2a162c3..d5aa1b7 100644
--- a/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
+++ b/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
@@ -1729,7 +1729,6 @@ mwifiex_cmd_tdls_oper(struct mwifiex_private *priv,
{
struct host_cmd_ds_tdls_oper *tdls_oper = &cmd->params.tdls_oper;
struct mwifiex_ds_tdls_oper *oper = data_buf;
- struct mwifiex_sta_node *sta_ptr;
struct host_cmd_tlv_rates *tlv_rates;
struct mwifiex_ie_types_htcap *ht_capab;
struct mwifiex_ie_types_qos_info *wmm_qos_info;
@@ -1747,7 +1746,6 @@ mwifiex_cmd_tdls_oper(struct mwifiex_private *priv,
tdls_oper->reason = 0;
memcpy(tdls_oper->peer_mac, oper->peer_mac, ETH_ALEN);
- sta_ptr = mwifiex_get_sta_entry(priv, oper->peer_mac);
pos = (u8 *)tdls_oper + sizeof(struct host_cmd_ds_tdls_oper);
--
2.8.0.rc3.226.g39d4020
^ permalink raw reply related
* [PATCH 2/7] mwifiex: Remove unused 'chan_num' variable
From: Kirtika Ruchandani @ 2016-11-18 8:44 UTC (permalink / raw)
To: Amitkumar Karwar
Cc: Arnd Bergmann, Kalle Valo, linux-wireless, Nishant Sarmukadam,
Zhaoyang Liu, Bing Zhao, Xinming Hu, Avinash Patil
In-Reply-To: <cover.1479458373.git.kirtika@google.com>
Commit b5413e6b2228 removed all uses of chan_num in mwifiex_config_scan().
Compiling mwifiex with W=1 gives the following warning, fix it.
mwifiex/scan.c: In function ‘mwifiex_config_scan’:
mwifiex/scan.c:830:6: warning: variable ‘chan_num’ set but not used [-Wunused-but-set-variable]
Fixes: b5413e6b2228 ("mwifiex: increase the number of nodes in command pool")
Cc: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kirtika Ruchandani <kirtika@google.com>
---
drivers/net/wireless/marvell/mwifiex/scan.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/marvell/mwifiex/scan.c b/drivers/net/wireless/marvell/mwifiex/scan.c
index 97c9765..436e628 100644
--- a/drivers/net/wireless/marvell/mwifiex/scan.c
+++ b/drivers/net/wireless/marvell/mwifiex/scan.c
@@ -827,7 +827,6 @@ mwifiex_config_scan(struct mwifiex_private *priv,
u32 num_probes;
u32 ssid_len;
u32 chan_idx;
- u32 chan_num;
u32 scan_type;
u16 scan_dur;
u8 channel;
@@ -1105,13 +1104,12 @@ mwifiex_config_scan(struct mwifiex_private *priv,
mwifiex_dbg(adapter, INFO,
"info: Scan: Scanning current channel only\n");
}
- chan_num = chan_idx;
} else {
mwifiex_dbg(adapter, INFO,
"info: Scan: Creating full region channel list\n");
- chan_num = mwifiex_scan_create_channel_list(priv, user_scan_in,
- scan_chan_list,
- *filtered_scan);
+ mwifiex_scan_create_channel_list(priv, user_scan_in,
+ scan_chan_list,
+ *filtered_scan);
}
}
--
2.8.0.rc3.226.g39d4020
^ permalink raw reply related
* [PATCH 1/7] mwifiex: Removed unused mwifiex_private* 'priv' variable
From: Kirtika Ruchandani @ 2016-11-18 8:44 UTC (permalink / raw)
To: Amitkumar Karwar
Cc: Arnd Bergmann, Kalle Valo, linux-wireless, Nishant Sarmukadam,
Zhaoyang Liu, Bing Zhao, Xinming Hu, Avinash Patil
In-Reply-To: <cover.1479458373.git.kirtika@google.com>
Commit bec568ff5107 removed the last remaining usage of struct
mwifiex_private* priv in mwifiex_fw_dpc(), by removing the call to
mwifiex_del_virtual_intf().
Compiling mwifiex/ with W=1 gives the following warning, fix it.
mwifiex/main.c: In function ‘mwifiex_fw_dpc’:
mwifiex/main.c:520:26: warning: variable ‘priv’ set but not used [-Wunused-but-set-variable]
Fixes: bec568ff5107 ("mwifiex: failure path handling in mwifiex_add_virtual_intf()")
Cc: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kirtika Ruchandani <kirtika@google.com>
---
drivers/net/wireless/marvell/mwifiex/main.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c
index 2478ccd..fff96be 100644
--- a/drivers/net/wireless/marvell/mwifiex/main.c
+++ b/drivers/net/wireless/marvell/mwifiex/main.c
@@ -517,7 +517,6 @@ static void mwifiex_fw_dpc(const struct firmware *firmware, void *context)
{
int ret;
char fmt[64];
- struct mwifiex_private *priv;
struct mwifiex_adapter *adapter = context;
struct mwifiex_fw_image fw;
struct semaphore *sem = adapter->card_sem;
@@ -575,8 +574,6 @@ static void mwifiex_fw_dpc(const struct firmware *firmware, void *context)
goto err_init_fw;
}
- priv = adapter->priv[MWIFIEX_BSS_ROLE_STA];
-
if (!adapter->wiphy) {
if (mwifiex_register_cfg80211(adapter)) {
mwifiex_dbg(adapter, ERROR,
--
2.8.0.rc3.226.g39d4020
^ permalink raw reply related
* [PATCH 0/7] Fix -Wunused-but-set-variable in mwifiex/
From: Kirtika Ruchandani @ 2016-11-18 8:43 UTC (permalink / raw)
To: Amitkumar Karwar
Cc: Arnd Bergmann, Kalle Valo, linux-wireless, Nishant Sarmukadam,
Zhaoyang Liu, Bing Zhao, Xinming Hu, Avinash Patil
This patchset is part of the effort led by Arnd Bergmann to clean up
warnings in the kernel. This and following patchsets will focus on
"-Wunused-but-set-variable" as it among the noisier ones. These were
found compiling with W=1.
Kirtika Ruchandani (7):
mwifiex: Removed unused mwifiex_private* 'priv' variable
mwifiex: Remove unused 'chan_num' variable
mwifiex: Remove unused 'sta_ptr' variable
mwifiex: Remove unused 'adapter'variable
mwifiex: Remove unused 'pm_flag' variable
mwifiex: Removed unused 'pkt_type' variable
mwifiex: Remove unused 'bcd_usb' variable
drivers/net/wireless/marvell/mwifiex/cfg80211.c | 2 --
drivers/net/wireless/marvell/mwifiex/main.c | 3 ---
drivers/net/wireless/marvell/mwifiex/scan.c | 8 +++-----
drivers/net/wireless/marvell/mwifiex/sdio.c | 5 -----
drivers/net/wireless/marvell/mwifiex/sta_cmd.c | 2 --
drivers/net/wireless/marvell/mwifiex/usb.c | 3 +--
6 files changed, 4 insertions(+), 19 deletions(-)
--
2.8.0.rc3.226.g39d4020
^ permalink raw reply
* pull-request: mac80211 2016-11-18
From: Johannes Berg @ 2016-11-18 7:52 UTC (permalink / raw)
To: David Miller; +Cc: netdev, linux-wireless
Hi Dave,
Due to travel/vacation, this is a bit late, but there aren't
that many fixes either. Most interesting/important are the
fixes from Felix and perhaps the scan entry limit.
Please pull and let me know if there's any problem.
Thanks,
johannes
The following changes since commit 269ebce4531b8edc4224259a02143181a1c1d77c:
xen-netfront: cast grant table reference first to type int (2016-11-02 15:33:36 -0400)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211.git tags/mac80211-for-davem-2016-11-18
for you to fetch changes up to 9853a55ef1bb66d7411136046060bbfb69c714fa:
cfg80211: limit scan results cache size (2016-11-18 08:44:44 +0100)
----------------------------------------------------------------
A few more bugfixes:
* limit # of scan results stored in memory - this is a long-standing bug
Jouni and I only noticed while discussing other things in Santa Fe
* revert AP_LINK_PS patch that was causing issues (Felix)
* various A-MSDU/A-MPDU fixes for TXQ code (Felix)
* interoperability workaround for peers with broken VHT capabilities
(Filip Matusiak)
* add bitrate definition for a VHT MCS that's supposed to be invalid
but gets used by some hardware anyway (Thomas Pedersen)
* beacon timer fix in hwsim (Benjamin Beichler)
----------------------------------------------------------------
Benjamin Beichler (1):
mac80211_hwsim: fix beacon delta calculation
Felix Fietkau (4):
Revert "mac80211: allow using AP_LINK_PS with mac80211-generated TIM IE"
mac80211: update A-MPDU flag on tx dequeue
mac80211: remove bogus skb vif assignment
mac80211: fix A-MSDU aggregation with fast-xmit + txq
Filip Matusiak (1):
mac80211: Ignore VHT IE from peer with wrong rx_mcs_map
Johannes Berg (1):
cfg80211: limit scan results cache size
Pedersen, Thomas (1):
cfg80211: add bitrate for 20MHz MCS 9
drivers/net/wireless/mac80211_hwsim.c | 2 +-
net/mac80211/sta_info.c | 2 +-
net/mac80211/tx.c | 14 +++++--
net/mac80211/vht.c | 16 ++++++++
net/wireless/core.h | 1 +
net/wireless/scan.c | 69 +++++++++++++++++++++++++++++++++++
net/wireless/util.c | 3 +-
7 files changed, 100 insertions(+), 7 deletions(-)
^ permalink raw reply
* [PATCH V2] brcmfmac: update beacon IE after bss up and clear when AP stopped
From: Wright Feng @ 2016-11-18 1:59 UTC (permalink / raw)
To: arend.vanspriel, franky.lin, hante.meuleman, pieterpg, kvalo,
brcm80211-dev-list.pdl, linux-wireless
Cc: Chi-Hsien Lin, wright.feng
Firmware doesn't update beacon/Probe Response vendor IEs correctly when
bss is down, so we move brcmf_config_ap_mgmt_ie after BSS up. And host
driver should clear IEs when AP stopped so that the IEs in host side will
be synced with in firmware side.
Signed-off-by: Wright Feng <wright.feng@cypress.com>
---
V2: word wrap the commit log
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
index b777e1b..d022605 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
@@ -4578,8 +4578,6 @@ brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev,
brcmf_configure_opensecurity(ifp);
}
- brcmf_config_ap_mgmt_ie(ifp->vif, &settings->beacon);
-
/* Parameters shared by all radio interfaces */
if (!mbss) {
if ((supports_11d) && (is_11d != ifp->vif->is_11d)) {
@@ -4708,6 +4706,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev,
WARN_ON(1);
}
+ brcmf_config_ap_mgmt_ie(ifp->vif, &settings->beacon);
set_bit(BRCMF_VIF_STATUS_AP_CREATED, &ifp->vif->sme_state);
brcmf_net_setcarrier(ifp, true);
@@ -4764,6 +4763,8 @@ static int brcmf_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *ndev)
err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_UP, 1);
if (err < 0)
brcmf_err("BRCMF_C_UP error %d\n", err);
+
+ brcmf_vif_clear_mgmt_ies(ifp->vif);
} else {
bss_enable.bsscfgidx = cpu_to_le32(ifp->bsscfgidx);
bss_enable.enable = cpu_to_le32(0);
--
2.1.0
^ permalink raw reply related
* [PATCH] mmc: pwrseq: add support for Marvell SD8787 chip
From: Matt Ranostay @ 2016-11-18 1:55 UTC (permalink / raw)
To: linux-wireless, linux-kernel, devicetree, linux-mmc
Cc: Matt Ranostay, Tony Lindgren, Ulf Hansson, Mark Rutland,
Srinivas Kandagatla
Allow power sequencing for the Marvell SD8787 Wifi/BT chip.
This can be abstracted to other chipsets if needed in the future.
Cc: Tony Lindgren <tony@atomide.com>
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Matt Ranostay <matt@ranostay.consulting>
---
.../devicetree/bindings/mmc/mmc-pwrseq-sd8787.txt | 14 +++
.../bindings/net/wireless/marvell-sd8xxx.txt | 4 +
drivers/mmc/core/Kconfig | 10 ++
drivers/mmc/core/Makefile | 1 +
drivers/mmc/core/pwrseq_sd8787.c | 117 +++++++++++++++++++++
5 files changed, 146 insertions(+)
create mode 100644 Documentation/devicetree/bindings/mmc/mmc-pwrseq-sd8787.txt
create mode 100644 drivers/mmc/core/pwrseq_sd8787.c
diff --git a/Documentation/devicetree/bindings/mmc/mmc-pwrseq-sd8787.txt b/Documentation/devicetree/bindings/mmc/mmc-pwrseq-sd8787.txt
new file mode 100644
index 000000000000..1b658351629b
--- /dev/null
+++ b/Documentation/devicetree/bindings/mmc/mmc-pwrseq-sd8787.txt
@@ -0,0 +1,14 @@
+* Marvell SD8787 power sequence provider
+
+Required properties:
+- compatible: must be "mmc-pwrseq-sd8787".
+- pwndn-gpio: contains a power down GPIO specifier.
+- reset-gpio: contains a reset GPIO specifier.
+
+Example:
+
+ wifi_pwrseq: wifi_pwrseq {
+ compatible = "mmc-pwrseq-sd8787";
+ pwrdn-gpio = <&twl_gpio 0 GPIO_ACTIVE_LOW>;
+ reset-gpio = <&twl_gpio 1 GPIO_ACTIVE_LOW>;
+ }
diff --git a/Documentation/devicetree/bindings/net/wireless/marvell-sd8xxx.txt b/Documentation/devicetree/bindings/net/wireless/marvell-sd8xxx.txt
index c421aba0a5bc..08fd65d35725 100644
--- a/Documentation/devicetree/bindings/net/wireless/marvell-sd8xxx.txt
+++ b/Documentation/devicetree/bindings/net/wireless/marvell-sd8xxx.txt
@@ -32,6 +32,9 @@ Optional properties:
so that the wifi chip can wakeup host platform under certain condition.
during system resume, the irq will be disabled to make sure
unnecessary interrupt is not received.
+ - vmmc-supply: a phandle of a regulator, supplying VCC to the card
+ - mmc-pwrseq: phandle to the MMC power sequence node. See "mmc-pwrseq-*"
+ for documentation of MMC power sequence bindings.
Example:
@@ -44,6 +47,7 @@ so that firmware can wakeup host using this device side pin.
&mmc3 {
status = "okay";
vmmc-supply = <&wlan_en_reg>;
+ mmc-pwrseq = <&wifi_pwrseq>;
bus-width = <4>;
cap-power-off-card;
keep-power-in-suspend;
diff --git a/drivers/mmc/core/Kconfig b/drivers/mmc/core/Kconfig
index 250f223aaa80..cf61d676ac06 100644
--- a/drivers/mmc/core/Kconfig
+++ b/drivers/mmc/core/Kconfig
@@ -12,6 +12,16 @@ config PWRSEQ_EMMC
This driver can also be built as a module. If so, the module
will be called pwrseq_emmc.
+config PWRSEQ_SD8787
+ tristate "HW reset support for SD8787 BT + Wifi module"
+ depends on OF && (MWIFIEX || BT_MRVL_SDIO)
+ help
+ This selects hardware reset support for the SD8787 BT + Wifi
+ module. By default this option is set to n.
+
+ This driver can also be built as a module. If so, the module
+ will be called pwrseq_sd8787.
+
config PWRSEQ_SIMPLE
tristate "Simple HW reset support for MMC"
default y
diff --git a/drivers/mmc/core/Makefile b/drivers/mmc/core/Makefile
index f007151dfdc6..f1c060e56d4e 100644
--- a/drivers/mmc/core/Makefile
+++ b/drivers/mmc/core/Makefile
@@ -10,5 +10,6 @@ mmc_core-y := core.o bus.o host.o \
quirks.o slot-gpio.o
mmc_core-$(CONFIG_OF) += pwrseq.o
obj-$(CONFIG_PWRSEQ_SIMPLE) += pwrseq_simple.o
+obj-$(CONFIG_PWRSEQ_SD8787) += pwrseq_sd8787.o
obj-$(CONFIG_PWRSEQ_EMMC) += pwrseq_emmc.o
mmc_core-$(CONFIG_DEBUG_FS) += debugfs.o
diff --git a/drivers/mmc/core/pwrseq_sd8787.c b/drivers/mmc/core/pwrseq_sd8787.c
new file mode 100644
index 000000000000..f4080fe6439e
--- /dev/null
+++ b/drivers/mmc/core/pwrseq_sd8787.c
@@ -0,0 +1,117 @@
+/*
+ * pwrseq_sd8787.c - power sequence support for Marvell SD8787 BT + Wifi chip
+ *
+ * Copyright (C) 2016 Matt Ranostay <matt@ranostay.consulting>
+ *
+ * Based on the original work pwrseq_simple.c
+ * Copyright (C) 2014 Linaro Ltd
+ * Author: Ulf Hansson <ulf.hansson@linaro.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#include <linux/delay.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/platform_device.h>
+#include <linux/module.h>
+#include <linux/slab.h>
+#include <linux/device.h>
+#include <linux/err.h>
+#include <linux/gpio/consumer.h>
+
+#include <linux/mmc/host.h>
+
+#include "pwrseq.h"
+
+struct mmc_pwrseq_sd8787 {
+ struct mmc_pwrseq pwrseq;
+ struct gpio_desc *reset_gpio;
+ struct gpio_desc *pwrdn_gpio;
+};
+
+#define to_pwrseq_sd8787(p) container_of(p, struct mmc_pwrseq_sd8787, pwrseq)
+
+static void mmc_pwrseq_sd8787_pre_power_on(struct mmc_host *host)
+{
+ struct mmc_pwrseq_sd8787 *pwrseq = to_pwrseq_sd8787(host->pwrseq);
+
+ gpiod_set_value_cansleep(pwrseq->reset_gpio, 1);
+
+ msleep(300);
+ gpiod_set_value_cansleep(pwrseq->pwrdn_gpio, 1);
+}
+
+static void mmc_pwrseq_sd8787_power_off(struct mmc_host *host)
+{
+ struct mmc_pwrseq_sd8787 *pwrseq = to_pwrseq_sd8787(host->pwrseq);
+
+ gpiod_set_value_cansleep(pwrseq->pwrdn_gpio, 0);
+ gpiod_set_value_cansleep(pwrseq->reset_gpio, 0);
+}
+
+static const struct mmc_pwrseq_ops mmc_pwrseq_sd8787_ops = {
+ .pre_power_on = mmc_pwrseq_sd8787_pre_power_on,
+ .power_off = mmc_pwrseq_sd8787_power_off,
+};
+
+static const struct of_device_id mmc_pwrseq_sd8787_of_match[] = {
+ { .compatible = "mmc-pwrseq-sd8787",},
+ {/* sentinel */},
+};
+MODULE_DEVICE_TABLE(of, mmc_pwrseq_sd8787_of_match);
+
+static int mmc_pwrseq_sd8787_probe(struct platform_device *pdev)
+{
+ struct mmc_pwrseq_sd8787 *pwrseq;
+ struct device *dev = &pdev->dev;
+
+ pwrseq = devm_kzalloc(dev, sizeof(*pwrseq), GFP_KERNEL);
+ if (!pwrseq)
+ return -ENOMEM;
+
+ pwrseq->pwrdn_gpio = devm_gpiod_get(dev, "pwrdn", GPIOD_OUT_LOW);
+ if (IS_ERR(pwrseq->pwrdn_gpio))
+ return PTR_ERR(pwrseq->pwrdn_gpio);
+
+ pwrseq->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
+ if (IS_ERR(pwrseq->reset_gpio))
+ return PTR_ERR(pwrseq->reset_gpio);
+
+ pwrseq->pwrseq.dev = dev;
+ pwrseq->pwrseq.ops = &mmc_pwrseq_sd8787_ops;
+ pwrseq->pwrseq.owner = THIS_MODULE;
+ platform_set_drvdata(pdev, pwrseq);
+
+ return mmc_pwrseq_register(&pwrseq->pwrseq);
+}
+
+static int mmc_pwrseq_sd8787_remove(struct platform_device *pdev)
+{
+ struct mmc_pwrseq_sd8787 *pwrseq = platform_get_drvdata(pdev);
+
+ mmc_pwrseq_unregister(&pwrseq->pwrseq);
+
+ return 0;
+}
+
+static struct platform_driver mmc_pwrseq_sd8787_driver = {
+ .probe = mmc_pwrseq_sd8787_probe,
+ .remove = mmc_pwrseq_sd8787_remove,
+ .driver = {
+ .name = "pwrseq_sd8787",
+ .of_match_table = mmc_pwrseq_sd8787_of_match,
+ },
+};
+
+module_platform_driver(mmc_pwrseq_sd8787_driver);
+MODULE_LICENSE("GPL v2");
--
2.7.4
^ permalink raw reply related
* Re: [PATCH] RFC: Universal scan proposal
From: Arend Van Spriel @ 2016-11-17 20:56 UTC (permalink / raw)
To: dimitrysh, linux-wireless
In-Reply-To: <94eb2c110db85c2379054172dad0@google.com>
On 16-11-2016 23:47, dimitrysh@google.com wrote:
> From 68a9d37a4c7e9dc7a90a6e922cdea52737a98d66 Mon Sep 17 00:00:00 2001
> From: Dmitry Shmidt <dimitrysh@google.com>
> Date: Wed, 16 Nov 2016 14:27:26 -0800
> Subject: [PATCH] RFC: Universal scan proposal
>
> Currently we have sched scan with possibility of various
> intervals. We would like to extend it to support also
> different types of scan.
> In case of powerful wlan CPU, all this functionality
> can be offloaded.
> In general case FW processes additional scan requests
> and puts them into queue based on start time and interval.
> Once current request is fulfilled, FW adds it (if interval != 0)
> again to the queue with proper interval. If requests are
> overlapping, new request can be combined with either one before,
> or one after, assuming that requests are not mutually exclusive.
> Combining requests is done by combining scan channels, ssids,
> bssids and types of scan result. Once combined request was fulfilled
> it will be reinserted as two (or three) different requests based on
> their type and interval.
> Each request has attribute:
> Type: connectivity / location
Don't see this type in the patch below (guess it was a last minute
addition ;-) ).
> Report: none / batch / immediate
> Request may have priority and can be inserted into
> the head of the queue.
> Types of scans:
> - Normal scan
> - Scheduled scan
> - Hotlist (BSSID scan)
> - Roaming
> - AutoJoin
Don't see the last one mentioned in the patch below.
> Change-Id: I9f3e4c975784f1c1c5156887144d80fc5a26bffa
> Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
> ---
> include/net/cfg80211.h | 37 +++++++++++++++++++++++++++++++------
> 1 file changed, 31 insertions(+), 6 deletions(-)
>
> diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
> index 14b51d7..1ae2570 100644
> --- a/include/net/cfg80211.h
> +++ b/include/net/cfg80211.h
> @@ -1602,8 +1602,10 @@ struct cfg80211_sched_scan_plan {
> * cycle. The driver may ignore this parameter and start
> * immediately (or at any other time), if this feature is not
> * supported.
At the the top of this kernel doc section it probably still refers to
struct cfg80211_sched_scan_request.
> + * @uscan_type: uscan type (scan, sched_scan, hotlist, scan_history,
> roaming)
> + * @uscan_results: uscan results report (none/batch/immediate)
If you change the type to struct cfg80211_uscan_request it seems a bit
redundant to prefix the field names with 'uscan_'.
> */
> -struct cfg80211_sched_scan_request {
> +struct cfg80211_uscan_request {
> struct cfg80211_ssid *ssids;
> int n_ssids;
> u32 n_channels;
> @@ -1621,6 +1623,10 @@ struct cfg80211_sched_scan_request {
> u8 mac_addr[ETH_ALEN] __aligned(2);
> u8 mac_addr_mask[ETH_ALEN] __aligned(2);
>
> + /* universal scan fields */
As the struct name changed it seems to me all fields in the struct are
universal scan fields.
> + u32 uscan_type;
> + u32 uscan_results;
> +
> /* internal */
> struct wiphy *wiphy;
> struct net_device *dev;
> @@ -1633,6 +1639,21 @@ struct cfg80211_sched_scan_request {
> };
>
> /**
> + * struct cfg80211_uscan_capa - universal scan capabilities
> + *
> + * @uscan_type: uscan type (scan, sched_scan, hotlist, scan_history,
> roaming)
> + * @max_ssids: max amount of ssids in sched scan
> + * @max_hotlist: max amount of bssids in hotlist
> + * @max_history: max amount of records in history
> + */
> +struct cfg80211_uscan_capa {
> + u32 uscan_type;
> + u32 max_ssids;
> + u32 max_hotlist;
> + u32 max_history;
> +};
> +
> +/**
> * enum cfg80211_signal_type - signal type
> *
> * @CFG80211_SIGNAL_TYPE_NONE: no signal strength information available
> @@ -2898,10 +2919,13 @@ struct cfg80211_ops {
> int (*set_antenna)(struct wiphy *wiphy, u32 tx_ant, u32 rx_ant);
> int (*get_antenna)(struct wiphy *wiphy, u32 *tx_ant, u32 *rx_ant);
>
> - int (*sched_scan_start)(struct wiphy *wiphy,
> + int (*uscan_get_capa)(struct wiphy *wiphy, struct net_device *dev,
> + struct cfg80211_uscan_capa *uscan_capa);
Not sure if people start worrying about the size of struct wiphy
already, but for static information like capabilities I think a callback
is overkill.
> + int (*uscan_start)(struct wiphy *wiphy,
> struct net_device *dev,
> - struct cfg80211_sched_scan_request *request);
> - int (*sched_scan_stop)(struct wiphy *wiphy, struct net_device
> *dev);
> + struct cfg80211_uscan_request *request);
So given the two extra fields, what different driver/device behaviour is
required, eg. if uscan_type == roaming what will be different compared
to a normal scan.
> + int (*uscan_stop)(struct wiphy *wiphy, struct net_device *dev,
> + int uscan_id);
The uscan_id is probably referring to a specific scan request started by
uscan_start. So who hands out that id (wiphy->cookie_counter?) and how
does the driver know about it. If cfg80211 determines the id it probably
need to be passed in the uscan request.
> int (*set_rekey_data)(struct wiphy *wiphy, struct net_device *dev,
> struct cfg80211_gtk_rekey_data *data);
> @@ -4305,11 +4329,12 @@ void cfg80211_scan_done(struct
> cfg80211_scan_request *request,
> struct cfg80211_scan_info *info);
>
> /**
> - * cfg80211_sched_scan_results - notify that new scan results are
> available
> + * cfg80211_uscan_results - notify that new uscan results are available
> *
> * @wiphy: the wiphy which got scheduled scan results
> + * @uscan_id: type of scan results
Confused now. What is uscan_id here? Same as in .uscan_stop() callback?
> */
> -void cfg80211_sched_scan_results(struct wiphy *wiphy);
> +void cfg80211_sched_scan_results(struct wiphy *wiphy, int uscan_id);
should this be renamed to cfg80211_uscan_results().
> /**
> * cfg80211_sched_scan_stopped - notify that the scheduled scan has
> stopped
Also change to cfg80211_uscan_stopped()? Does it need an additional
argument, ie. uscan_id.
Regards,
Arend
^ permalink raw reply
* Re: [RFC 0/5] nl80211: add support for g-scan
From: Arend Van Spriel @ 2016-11-17 20:23 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, Dmitry Shmidt
In-Reply-To: <1479393551.1463.11.camel@sipsolutions.net>
On 17-11-2016 15:39, Johannes Berg wrote:
> On Thu, 2016-11-17 at 13:18 +0000, Arend van Spriel wrote:
>> Android employs a Wifi-HAL layer in its wireless frame. It basically
>> abstracts dealing with netlink messages from the framework. For some
>> features it employs nl80211 vendor commands. The goal I set myself is
>> to be able to have a generic nl80211 Wifi-HAL implementation. One of
>> the features currently requiring the vendor commands is g-scan. We
>> can only guess what the 'g' stands for ;-) This series converts the
>> vendor command api into common nl80211 api.
>
> Hehe :)
> We also have gscan API. If you're interested, you can see it here:
> https://git.kernel.org/cgit/linux/kernel/git/iwlwifi/backport-iwlwifi.git/tree/drivers/net/wireless/intel/iwlwifi/mvm/vendor-cmd.h#n96
I am interested and I did have a look at it when I found out, but I had
already tinkered out a large portion so decided to stick with that.
>> Before making an attempt to explain more about the g-scan
>> functionality first this. While I am still testing the driver
>> implementation resulting in numerous questions Dmitry send the email
>> below to bring a related discussion to the table..eh.. the linux-
>> wireless list. This is probably a good thing as anyone can dive in
>> and share their thoughts.
>
>
> Yeah. How does this overlap? Have you looked at it already?
The overlap occurred when Dmitry pointed me to this thread in response
to questions I had regarding gscan :-p Now the similarity is reflected
mainly in terms used for functionality like bss hotlist, batch results,
etc. which are also found in gscan defintions in android wifi hal.
The main difference between the gscan and universal scan is that gscan
specifies everything in a single start request and the universal scan
api can be used to add/remove individual scans, which would be
equivalent with the ability to add/remove buckets in gscan.
I will comment more replying the RFC email from Dmitry.
Regards,
Arend
^ permalink raw reply
* Re: [PATCH 1/5] nl80211: allow reporting RTT information in scan results
From: Arend Van Spriel @ 2016-11-17 19:50 UTC (permalink / raw)
To: Dan Williams, Johannes Berg; +Cc: linux-wireless
In-Reply-To: <1479399340.6110.8.camel@redhat.com>
On 17-11-2016 17:15, Dan Williams wrote:
> On Thu, 2016-11-17 at 11:39 +0000, Arend van Spriel wrote:
>> Add distance and its variance to the BSS structure so drivers
>> may provide RTT information for BSS instances found during
>> scanning.
>>
>> Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
>> Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.co
>> m>
>> Reviewed-by: Franky Lin <franky.lin@broadcom.com>
>> Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
>> ---
>> include/net/cfg80211.h | 11 +++++++++++
>> include/uapi/linux/nl80211.h | 6 ++++++
>> net/wireless/nl80211.c | 8 ++++++++
>> net/wireless/scan.c | 2 ++
>> 4 files changed, 27 insertions(+)
>>
>> diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
>> index 2019310..d1217da 100644
>> --- a/include/net/cfg80211.h
>> +++ b/include/net/cfg80211.h
>> @@ -1675,6 +1675,9 @@ enum cfg80211_signal_type {
>> * @scan_width: scan width that was used
>> * @signal: signal strength value, according to the wiphy's
>> * signal type
>> + * @distance: distance to AP with %parent_bssid in centimeters. Zero
>> + * value indicates this is undetermined.
>> + * @var_distance: variance of %distance indicating accurracy.
>
> "accuracy" without the second 'r'.
>
> Also, what unit is the variance in? Needs more documentation.
The term variance here is the standard statistical term. You can read
more info here [1]. As distance is in centimeters, the variance of the
distance is in square centimeters. I can add that.
Regards,
Arend
[1] http://www.mathsisfun.com/data/standard-deviation.html
> Dan
>
>> * @boottime_ns: timestamp (CLOCK_BOOTTIME) when the information was
>> * received; should match the time when the frame was
>> actually
>> * received by the device (not just by the host, in case it
>> was
>> @@ -1691,6 +1694,8 @@ struct cfg80211_inform_bss {
>> struct ieee80211_channel *chan;
>> enum nl80211_bss_scan_width scan_width;
>> s32 signal;
>> + u32 distance;
>> + u32 var_distance;
>> u64 boottime_ns;
>> u64 parent_tsf;
>> u8 parent_bssid[ETH_ALEN] __aligned(2);
>> @@ -1737,6 +1742,9 @@ struct cfg80211_bss_ies {
>> * that holds the beacon data. @beacon_ies is still valid, of
>> course, and
>> * points to the same data as hidden_beacon_bss->beacon_ies
>> in that case.
>> * @signal: signal strength value (type depends on the wiphy's
>> signal_type)
>> + * @distance: distance to AP with %parent_bssid in centimeters. Zero
>> + * value indicates this is undetermined.
>> + * @var_distance: variance of %distance indicating accurracy.
>> * @priv: private area for driver use, has at least wiphy-
>>> bss_priv_size bytes
>> */
>> struct cfg80211_bss {
>> @@ -1756,6 +1764,9 @@ struct cfg80211_bss {
>>
>> u8 bssid[ETH_ALEN];
>>
>> + u32 distance;
>> + u32 var_distance;
>> +
>> u8 priv[0] __aligned(sizeof(void *));
>> };
>>
>> diff --git a/include/uapi/linux/nl80211.h
>> b/include/uapi/linux/nl80211.h
>> index 259c9c7..7e935f6 100644
>> --- a/include/uapi/linux/nl80211.h
>> +++ b/include/uapi/linux/nl80211.h
>> @@ -3651,6 +3651,10 @@ enum nl80211_bss_scan_width {
>> * @NL80211_BSS_PARENT_BSSID. (u64).
>> * @NL80211_BSS_PARENT_BSSID: the BSS according to which
>> @NL80211_BSS_PARENT_TSF
>> * is set.
>> + * @NL80211_BSS_DISTANCE: distance to AP with
>> @NL80211_BSS_PARENT_BSSID in
>> + * centimeters (u32).
>> + * @NL80211_BSS_VARIANCE_DISTANCE: variance of @NL80211_BSS_DISTANCE
>> value (u32).
>> + *
>> * @__NL80211_BSS_AFTER_LAST: internal
>> * @NL80211_BSS_MAX: highest BSS attribute
>> */
>> @@ -3674,6 +3678,8 @@ enum nl80211_bss {
>> NL80211_BSS_PAD,
>> NL80211_BSS_PARENT_TSF,
>> NL80211_BSS_PARENT_BSSID,
>> + NL80211_BSS_DISTANCE,
>> + NL80211_BSS_VARIANCE_DISTANCE,
>>
>> /* keep last */
>> __NL80211_BSS_AFTER_LAST,
>> diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
>> index 24ab199..ffce566 100644
>> --- a/net/wireless/nl80211.c
>> +++ b/net/wireless/nl80211.c
>> @@ -7515,6 +7515,14 @@ static int nl80211_send_bss(struct sk_buff
>> *msg, struct netlink_callback *cb,
>> intbss->ts_boottime, NL80211_BSS_PAD))
>> goto nla_put_failure;
>>
>> + if (res->distance && nla_put_u32(msg, NL80211_BSS_DISTANCE,
>> + res->distance))
>> + goto nla_put_failure;
>> +
>> + if (res->var_distance && nla_put_u32(msg,
>> NL80211_BSS_VARIANCE_DISTANCE,
>> + res->var_distance))
>> + goto nla_put_failure;
>> +
>> switch (rdev->wiphy.signal_type) {
>> case CFG80211_SIGNAL_TYPE_MBM:
>> if (nla_put_u32(msg, NL80211_BSS_SIGNAL_MBM, res-
>>> signal))
>> diff --git a/net/wireless/scan.c b/net/wireless/scan.c
>> index b5bd58d..afda1f9 100644
>> --- a/net/wireless/scan.c
>> +++ b/net/wireless/scan.c
>> @@ -973,6 +973,8 @@ struct cfg80211_bss *
>> tmp.pub.signal = data->signal;
>> tmp.pub.beacon_interval = beacon_interval;
>> tmp.pub.capability = capability;
>> + tmp.pub.distance = data->distance;
>> + tmp.pub.var_distance = data->var_distance;
>> tmp.ts_boottime = data->boottime_ns;
>>
>> /*
^ permalink raw reply
* Re: [PATCH] rtlwifi: rtl8723be: Fix bug in ant_sel code from commit c18d8f509571
From: kbuild test robot @ 2016-11-17 19:33 UTC (permalink / raw)
To: Larry Finger
Cc: kbuild-all, kvalo, devel, Ping-Ke Shih, linux-wireless, Stable,
Larry Finger
In-Reply-To: <20161117180533.16136-1-Larry.Finger@lwfinger.net>
[-- Attachment #1: Type: text/plain, Size: 1692 bytes --]
Hi Ping-Ke,
[auto build test ERROR on wireless-drivers-next/master]
[also build test ERROR on v4.9-rc5]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Larry-Finger/rtlwifi-rtl8723be-Fix-bug-in-ant_sel-code-from-commit-c18d8f509571/20161118-024559
base: https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git master
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 6.2.0
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=ia64
All errors (new ones prefixed by >>):
drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c: In function 'rtl8723be_read_bt_coexist_info_from_hwpg':
>> drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c:2670:30: error: 'struct rtl_btc_info' has no member named 'single_ant_path'
rtlpriv->btcoexist.btc_info.single_ant_path =
^
vim +2670 drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c
2664 }
2665
2666 /* override ant_num / ant_path */
2667 if (mod_params->ant_sel) {
2668 rtlpriv->btcoexist.btc_info.ant_num =
2669 (mod_params->ant_sel == 1 ? ANT_X2 : ANT_X1);
> 2670 rtlpriv->btcoexist.btc_info.single_ant_path =
2671 (mod_params->ant_sel == 1 ? 0 : 1);
2672 }
2673 }
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 45106 bytes --]
^ permalink raw reply
* Re: [PATCH] rtlwifi: rtl8723be: Fix bug in ant_sel code from commit c18d8f509571
From: Larry Finger @ 2016-11-17 18:20 UTC (permalink / raw)
To: kvalo; +Cc: devel, linux-wireless, Ping-Ke Shih, Stable
In-Reply-To: <20161117180533.16136-1-Larry.Finger@lwfinger.net>
On 11/17/2016 12:05 PM, Larry Finger wrote:
> From: Ping-Ke Shih <pkshih@realtek.com>
>
> In commit c18d8f509571 ("rtlwifi: rtl8723be: Add antenna select module
> parameter"), wifi was fixed for those laptops that have only a single
> antenna but have an incorrectly coded EEPROM. This error causes the
> driver to select the wrong antenna. In that commit, one necessary change
> that affects Bluetooth operation was missed.
>
> Fixes: c18d8f509571 ("rtlwifi: rtl8723be: Add antenna select module parameter")
> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
> Cc: Stable <stable@vger.kernel.org>
> ---
> drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c
> index aba60c3..cb046ec 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c
> @@ -2664,9 +2664,12 @@ void rtl8723be_read_bt_coexist_info_from_hwpg(struct ieee80211_hw *hw,
> }
>
> /* override ant_num / ant_path */
> - if (mod_params->ant_sel)
> + if (mod_params->ant_sel) {
> rtlpriv->btcoexist.btc_info.ant_num =
> (mod_params->ant_sel == 1 ? ANT_X2 : ANT_X1);
> + rtlpriv->btcoexist.btc_info.single_ant_path =
> + (mod_params->ant_sel == 1 ? 0 : 1);
> + }
> }
>
> void rtl8723be_bt_reg_init(struct ieee80211_hw *hw)
>
Please drop this patch. It contains an error.
Sorry,
Larry
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox