* Re: [PATCH] ath10k: fix WEP in AP and IBSS mode
From: Kalle Valo @ 2013-08-14 15:06 UTC (permalink / raw)
To: Marek Puzyniak; +Cc: ath10k, linux-wireless
In-Reply-To: <1376387122-18075-1-git-send-email-marek.puzyniak@tieto.com>
Marek Puzyniak <marek.puzyniak@tieto.com> writes:
> WEP encoding was not working properly for AP and IBSS mode.
> TX frames were encrypted with default WEP tx key index set
> always to zero, what sometimes was wrong when different
> key index should be used. This patch allows to update
> WEP key index also for AP and IBSS mode.
> Problem detected during automated WEP tests.
>
> Signed-off-by: Marek Puzyniak <marek.puzyniak@tieto.com>
Thanks, applied.
--
Kalle Valo
^ permalink raw reply
* RE: [PATCH 28/30] iwlwifi: mvm: Change beacon abort escape time value
From: Bondar, Alexander @ 2013-08-14 15:11 UTC (permalink / raw)
To: Arik Nemtsov, Johannes Berg; +Cc: linux-wireless@vger.kernel.org
In-Reply-To: <CA+XVXfeoHkOwrj76MwSC9ad5igffng8QueT6cKu9ytsLu=C+Cw@mail.gmail.com>
Yes, it's a bug. Intention was 9.
Thanks.
> -----Original Message-----
> From: anamtsov@gmail.com [mailto:anamtsov@gmail.com] On Behalf Of
> Arik Nemtsov
> Sent: Monday, August 12, 2013 3:21 PM
> To: Johannes Berg
> Cc: linux-wireless@vger.kernel.org; Bondar, Alexander
> Subject: Re: [PATCH 28/30] iwlwifi: mvm: Change beacon abort escape time
> value
>
> On Fri, Jul 26, 2013 at 11:28 AM, Johannes Berg <johannes@sipsolutions.net>
> wrote:
> > From: Alexander Bondar <alexander.bondar@intel.com>
> >
> > Set beacon abort escape timer values - 6 beacons in D0 state,
> > 9 beacons in D3 and D0i3.
> >
> > Signed-off-by: Alexander Bondar <alexander.bondar@intel.com>
> > Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
> > Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> > ---
> > drivers/net/wireless/iwlwifi/mvm/fw-api-power.h | 3 ++-
> > drivers/net/wireless/iwlwifi/mvm/power.c | 3 +++
> > 2 files changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/wireless/iwlwifi/mvm/fw-api-power.h
> > b/drivers/net/wireless/iwlwifi/mvm/fw-api-power.h
> > index 149347d..060e630 100644
> > --- a/drivers/net/wireless/iwlwifi/mvm/fw-api-power.h
> > +++ b/drivers/net/wireless/iwlwifi/mvm/fw-api-power.h
> > @@ -285,7 +285,8 @@ struct iwl_beacon_filter_cmd { #define
> > IWL_BF_ESCAPE_TIMER_MAX 1024 #define IWL_BF_ESCAPE_TIMER_MIN
> 0
> >
> > -#define IWL_BA_ESCAPE_TIMER_DEFAULT 3
> > +#define IWL_BA_ESCAPE_TIMER_DEFAULT 6 #define
> IWL_BA_ESCAPE_TIMER_D3
> > +6
>
> Did you mean 9 here?
> (Sorry for the late review)
---------------------------------------------------------------------
A member of the Intel Corporation group of companies
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
^ permalink raw reply
* [PATCH 2/4] ath9k: Identify first subframe in an A-MPDU
From: Sujith Manoharan @ 2013-08-14 15:45 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless
In-Reply-To: <1376495157-18983-1-git-send-email-sujith@msujith.org>
From: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath9k/ar9003_mac.c | 1 +
drivers/net/wireless/ath/ath9k/mac.c | 4 ++--
drivers/net/wireless/ath/ath9k/mac.h | 2 ++
3 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_mac.c b/drivers/net/wireless/ath/ath9k/ar9003_mac.c
index 5163abd..f6c5c1b 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_mac.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_mac.c
@@ -491,6 +491,7 @@ int ath9k_hw_process_rxdesc_edma(struct ath_hw *ah, struct ath_rx_status *rxs,
rxs->rs_rate = MS(rxsp->status1, AR_RxRate);
rxs->rs_more = (rxsp->status2 & AR_RxMore) ? 1 : 0;
+ rxs->rs_firstaggr = (rxsp->status11 & AR_RxFirstAggr) ? 1 : 0;
rxs->rs_isaggr = (rxsp->status11 & AR_RxAggr) ? 1 : 0;
rxs->rs_moreaggr = (rxsp->status11 & AR_RxMoreAggr) ? 1 : 0;
rxs->rs_antenna = (MS(rxsp->status4, AR_RxAntenna) & 0x7);
diff --git a/drivers/net/wireless/ath/ath9k/mac.c b/drivers/net/wireless/ath/ath9k/mac.c
index 2ef05eb..a3eff09 100644
--- a/drivers/net/wireless/ath/ath9k/mac.c
+++ b/drivers/net/wireless/ath/ath9k/mac.c
@@ -583,9 +583,9 @@ int ath9k_hw_rxprocdesc(struct ath_hw *ah, struct ath_desc *ds,
rs->rs_rate = MS(ads.ds_rxstatus0, AR_RxRate);
rs->rs_more = (ads.ds_rxstatus1 & AR_RxMore) ? 1 : 0;
+ rs->rs_firstaggr = (ads.ds_rxstatus8 & AR_RxFirstAggr) ? 1 : 0;
rs->rs_isaggr = (ads.ds_rxstatus8 & AR_RxAggr) ? 1 : 0;
- rs->rs_moreaggr =
- (ads.ds_rxstatus8 & AR_RxMoreAggr) ? 1 : 0;
+ rs->rs_moreaggr = (ads.ds_rxstatus8 & AR_RxMoreAggr) ? 1 : 0;
rs->rs_antenna = MS(ads.ds_rxstatus3, AR_RxAntenna);
/* directly mapped flags for ieee80211_rx_status */
diff --git a/drivers/net/wireless/ath/ath9k/mac.h b/drivers/net/wireless/ath/ath9k/mac.h
index b02dfce..bfccace 100644
--- a/drivers/net/wireless/ath/ath9k/mac.h
+++ b/drivers/net/wireless/ath/ath9k/mac.h
@@ -140,6 +140,7 @@ struct ath_rx_status {
int8_t rs_rssi_ext1;
int8_t rs_rssi_ext2;
u8 rs_isaggr;
+ u8 rs_firstaggr;
u8 rs_moreaggr;
u8 rs_num_delims;
u8 rs_flags;
@@ -569,6 +570,7 @@ struct ar5416_desc {
#define AR_RxAggr 0x00020000
#define AR_PostDelimCRCErr 0x00040000
#define AR_RxStatusRsvd71 0x3ff80000
+#define AR_RxFirstAggr 0x20000000
#define AR_DecryptBusyErr 0x40000000
#define AR_KeyMiss 0x80000000
--
1.8.3.4
^ permalink raw reply related
* [PATCH 1/4] ath9k: Handle invalid RSSI
From: Sujith Manoharan @ 2013-08-14 15:45 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless
From: Sujith Manoharan <c_manoha@qca.qualcomm.com>
The combined RSSI can be invalid which is indicated by
the value -128. Use RX_FLAG_NO_SIGNAL_VAL for such cases.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath9k/recv.c | 49 +++++++++++++++++++++++------------
1 file changed, 33 insertions(+), 16 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index 3b47198..6ad7d61 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -885,29 +885,49 @@ static int ath9k_process_rate(struct ath_common *common,
static void ath9k_process_rssi(struct ath_common *common,
struct ieee80211_hw *hw,
- struct ath_rx_status *rx_stats)
+ struct ath_rx_status *rx_stats,
+ struct ieee80211_rx_status *rxs)
{
struct ath_softc *sc = hw->priv;
struct ath_hw *ah = common->ah;
int last_rssi;
int rssi = rx_stats->rs_rssi;
- if (!rx_stats->is_mybeacon ||
- ((ah->opmode != NL80211_IFTYPE_STATION) &&
- (ah->opmode != NL80211_IFTYPE_ADHOC)))
+ /*
+ * RSSI is not available for subframes in an A-MPDU.
+ */
+ if (rx_stats->rs_moreaggr) {
+ rxs->flag |= RX_FLAG_NO_SIGNAL_VAL;
+ return;
+ }
+
+ /*
+ * Check if the RSSI for the last subframe in an A-MPDU
+ * or an unaggregated frame is valid.
+ */
+ if (rx_stats->rs_rssi == ATH9K_RSSI_BAD) {
+ rxs->flag |= RX_FLAG_NO_SIGNAL_VAL;
return;
+ }
- if (rx_stats->rs_rssi != ATH9K_RSSI_BAD && !rx_stats->rs_moreaggr)
+ /*
+ * Update Beacon RSSI, this is used by ANI.
+ */
+ if (rx_stats->is_mybeacon &&
+ ((ah->opmode == NL80211_IFTYPE_STATION) ||
+ (ah->opmode == NL80211_IFTYPE_ADHOC))) {
ATH_RSSI_LPF(sc->last_rssi, rx_stats->rs_rssi);
+ last_rssi = sc->last_rssi;
+
+ if (likely(last_rssi != ATH_RSSI_DUMMY_MARKER))
+ rssi = ATH_EP_RND(last_rssi, ATH_RSSI_EP_MULTIPLIER);
+ if (rssi < 0)
+ rssi = 0;
- last_rssi = sc->last_rssi;
- if (likely(last_rssi != ATH_RSSI_DUMMY_MARKER))
- rssi = ATH_EP_RND(last_rssi, ATH_RSSI_EP_MULTIPLIER);
- if (rssi < 0)
- rssi = 0;
+ ah->stats.avgbrssi = rssi;
+ }
- /* Update Beacon RSSI, this is used by ANI. */
- ah->stats.avgbrssi = rssi;
+ rxs->signal = ah->noise + rx_stats->rs_rssi;
}
static void ath9k_process_tsf(struct ath_rx_status *rs,
@@ -1149,15 +1169,12 @@ static int ath9k_rx_skb_preprocess(struct ath_softc *sc,
goto exit;
}
- ath9k_process_rssi(common, hw, rx_stats);
+ ath9k_process_rssi(common, hw, rx_stats, rx_status);
rx_status->band = hw->conf.chandef.chan->band;
rx_status->freq = hw->conf.chandef.chan->center_freq;
- rx_status->signal = ah->noise + rx_stats->rs_rssi;
rx_status->antenna = rx_stats->rs_antenna;
rx_status->flag |= RX_FLAG_MACTIME_END;
- if (rx_stats->rs_moreaggr)
- rx_status->flag |= RX_FLAG_NO_SIGNAL_VAL;
#ifdef CONFIG_ATH9K_BTCOEX_SUPPORT
if (ieee80211_is_data_present(hdr->frame_control) &&
--
1.8.3.4
^ permalink raw reply related
* [PATCH 3/4] ath9k: Optimize LNA check
From: Sujith Manoharan @ 2013-08-14 15:45 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless
In-Reply-To: <1376495157-18983-1-git-send-email-sujith@msujith.org>
From: Sujith Manoharan <c_manoha@qca.qualcomm.com>
The documentation for antenna diversity says:
"The decision of diversity is done at 802.11 preamble. So, for
11G/11B, for every MAC packet hardware will do a decision. But in
11N with aggregation, the decision is made only at the preamble and
all other MPDUs will use the same LNA as the first MPDU."
Make use of rs_firstaggr to avoid needlessly scanning for LNA
changes.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath9k/recv.c | 77 +++++++++++++++++++++--------------
1 file changed, 47 insertions(+), 30 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index 6ad7d61..6161d14 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -1238,6 +1238,52 @@ static void ath9k_rx_skb_postprocess(struct ath_common *common,
rxs->flag &= ~RX_FLAG_DECRYPTED;
}
+/*
+ * Run the LNA combining algorithm only in these cases:
+ *
+ * Standalone WLAN cards with both LNA/Antenna diversity
+ * enabled in the EEPROM.
+ *
+ * WLAN+BT cards which are in the supported card list
+ * in ath_pci_id_table and the user has loaded the
+ * driver with "bt_ant_diversity" set to true.
+ */
+static void ath9k_antenna_check(struct ath_softc *sc,
+ struct ath_rx_status *rs)
+{
+ struct ath_hw *ah = sc->sc_ah;
+ struct ath9k_hw_capabilities *pCap = &ah->caps;
+ struct ath_common *common = ath9k_hw_common(ah);
+
+ if (!(ah->caps.hw_caps & ATH9K_HW_CAP_ANT_DIV_COMB))
+ return;
+
+ /*
+ * All MPDUs in an aggregate will use the same LNA
+ * as the first MPDU.
+ */
+ if (rs->rs_isaggr && !rs->rs_firstaggr)
+ return;
+
+ /*
+ * Change the default rx antenna if rx diversity
+ * chooses the other antenna 3 times in a row.
+ */
+ if (sc->rx.defant != rs->rs_antenna) {
+ if (++sc->rx.rxotherant >= 3)
+ ath_setdefantenna(sc, rs->rs_antenna);
+ } else {
+ sc->rx.rxotherant = 0;
+ }
+
+ if (pCap->hw_caps & ATH9K_HW_CAP_BT_ANT_DIV) {
+ if (common->bt_ant_diversity)
+ ath_ant_comb_scan(sc, rs);
+ } else {
+ ath_ant_comb_scan(sc, rs);
+ }
+}
+
static void ath9k_apply_ampdu_details(struct ath_softc *sc,
struct ath_rx_status *rs, struct ieee80211_rx_status *rxs)
{
@@ -1262,7 +1308,6 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp)
struct sk_buff *skb = NULL, *requeue_skb, *hdr_skb;
struct ieee80211_rx_status *rxs;
struct ath_hw *ah = sc->sc_ah;
- struct ath9k_hw_capabilities *pCap = &ah->caps;
struct ath_common *common = ath9k_hw_common(ah);
struct ieee80211_hw *hw = sc->hw;
int retval;
@@ -1398,35 +1443,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp)
ath_rx_ps(sc, skb, rs.is_mybeacon);
spin_unlock_irqrestore(&sc->sc_pm_lock, flags);
- /*
- * Run the LNA combining algorithm only in these cases:
- *
- * Standalone WLAN cards with both LNA/Antenna diversity
- * enabled in the EEPROM.
- *
- * WLAN+BT cards which are in the supported card list
- * in ath_pci_id_table and the user has loaded the
- * driver with "bt_ant_diversity" set to true.
- */
- if (ah->caps.hw_caps & ATH9K_HW_CAP_ANT_DIV_COMB) {
- /*
- * Change the default rx antenna if rx diversity
- * chooses the other antenna 3 times in a row.
- */
- if (sc->rx.defant != rs.rs_antenna) {
- if (++sc->rx.rxotherant >= 3)
- ath_setdefantenna(sc, rs.rs_antenna);
- } else {
- sc->rx.rxotherant = 0;
- }
-
- if (pCap->hw_caps & ATH9K_HW_CAP_BT_ANT_DIV) {
- if (common->bt_ant_diversity)
- ath_ant_comb_scan(sc, &rs);
- } else {
- ath_ant_comb_scan(sc, &rs);
- }
- }
+ ath9k_antenna_check(sc, &rs);
ath9k_apply_ampdu_details(sc, &rs, rxs);
--
1.8.3.4
^ permalink raw reply related
* [PATCH 4/4] ath9k: Use lockless variant to initialize RX fifo
From: Sujith Manoharan @ 2013-08-14 15:45 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless
In-Reply-To: <1376495157-18983-1-git-send-email-sujith@msujith.org>
From: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Since the rx_fifo queue is accessed only using the various
lockless SKB queue routines, there is no need to initialize
the lock and __skb_queue_head_init() can be used.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath9k/recv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index 6161d14..653f7fc 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -190,7 +190,7 @@ static void ath_rx_edma_cleanup(struct ath_softc *sc)
static void ath_rx_edma_init_queue(struct ath_rx_edma *rx_edma, int size)
{
- skb_queue_head_init(&rx_edma->rx_fifo);
+ __skb_queue_head_init(&rx_edma->rx_fifo);
rx_edma->rx_fifo_hwsize = size;
}
--
1.8.3.4
^ permalink raw reply related
* Re: carl9170: Problems setting up Virtual Interface
From: moony @ 2013-08-14 9:32 UTC (permalink / raw)
To: linux-wireless
In-Reply-To: <CAMJnVwm4Xp87pF7PHLP7vVqF-LYzsgeso7ZPzPwOC_39mwP_Kw@mail.gmail.com>
Alex <alex9434@...> writes:
>
> Great! I now get an additional interface:
> wlan1-wlan0 Link encap:Ethernet HWaddr <deleted>
> BROADCAST MULTICAST MTU:1500 Metric:1
> RX packets:0 errors:0 dropped:0 overruns:0 frame:0
> TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:1000
> RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Hi Alex,
did you get this to work? I'm using the same driver and procedure, but when
I try to bring up the second interface (with ifup wifi1), I get the error
device or resource busy... The first always comes up.
I don't know if vif is enabled by default on the kernelmodule. I tried to
compile it by myself (there is an option for the number of vif, and the
default is 1), but stuck on errors or missing dependencies, yet.
Best regards,
moony
^ permalink raw reply
* Re: [RFT 00/13] brcmsmac: bcm4313 iPA related patches
From: Arend van Spriel @ 2013-08-14 18:16 UTC (permalink / raw)
To: David Herrmann
Cc: linux-wireless, Jonas Gorski, Maximilian Engelhardt, David Costa
In-Reply-To: <CANq1E4SOcT765CTFCR=xywBuMkOs5oru-NBqwHM=Jj_dfwtvkw@mail.gmail.com>
On 08/14/2013 12:33 PM, David Herrmann wrote:
> Hi
>
> On Tue, Aug 13, 2013 at 10:46 PM, Arend van Spriel <arend@broadcom.com> wrote:
>> On 08/13/2013 10:09 PM, David Herrmann wrote:
>>>
>>> Hi
>>>
>>> On Tue, Aug 13, 2013 at 10:03 PM, Arend van Spriel <arend@broadcom.com>
>>> wrote:
>>>>
>>>> This series replaces the patch "[PATCH 12/12] brcmsmac: support 4313iPA"
>>>> with Message-ID: <1376130450-29746-13-git-send-email-arend@broadcom.com>.
>>>>
>>>> It has been split up into individual patches. Please test this series
>>>> especially if you had issues with the original commit b6fc28a that was
>>>> reverted.
>>>>
>>>> Cc: Jonas Gorski <jogo@openwrt.org>
>>>> Cc: David Herrmann <dh.herrmann@gmail.com>
>>>> Cc: Maximilian Engelhardt <maxi@daemonizer.de>
>>>> Cc: David Costa <david@zarel.net>
>>>
>>>
>>> Is this available in a public branch that I can merge? And what should
>>> be used as base? 3.11-rc5? linux-next?
>>
>>
>> Indeed I should have mentioned. It applies on v3.11-rc5 for sure. Did not
>> try linux-next.
>
> All 13 patches applied cleanly on top of 3.11-rc5, everything works
> fine even after a dozen of reconnects to different networks. No
> additional delays.
>
> Consider this whole series:
> Tested-by: David Herrmann <dh.herrmann@gmail.com>
>
> card info: Broadcom Corporation BCM4313 802.11b/g/n (0a5c:219c)
> (builtin into my old Intel Atom N450 board)
> I tested with 802.11g networks. I have only a/g networks here. I don't
> know whether that matters.
As this series modifies the phy code, I would say no.
Thanks for verifying this works for you.
Regards,
Arend
^ permalink raw reply
* Re: issues with RTL8188CE device and rtl8192ce driver
From: Colleen Josephson @ 2013-08-14 21:39 UTC (permalink / raw)
To: Larry Finger; +Cc: linux-wireless
In-Reply-To: <520AF3BD.5020705@lwfinger.net>
> First, what chip is in your computer. Please send me the output of the
> command '/sbin/lspci -nnv'. Only the stanza for the RTL8188CE will be
> needed. There are at least 4 different chips that work with driver
> rtl8192ce.
03:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd.
RTL8188CE 802.11b/g/n WiFi Adapter [10ec:8176] (rev 01)
Subsystem: Realtek Semiconductor Co., Ltd. Device [10ec:8195]
Flags: bus master, fast devsel, latency 0, IRQ 17
I/O ports at 5000 [size=256]
Memory at f3800000 (64-bit, non-prefetchable) [size=16K]
Capabilities: [40] Power Management version 3
Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+
Capabilities: [70] Express Endpoint, MSI 00
Capabilities: [100] Advanced Error Reporting
Capabilities: [140] Virtual Channel
Capabilities: [160] Device Serial Number 01-91-81-fe-ff-4c-e0-00
Kernel driver in use: rtl8192ce
Kernel modules: rtl8192ce
> Second, what is the make/model of the access point that you are using? Is
> the firmware up to date?
There are two Meraki M16 access points (with up to date firmware).
> Third, what is the encryption method you are using, and what is the maximum
> rate for the connection? That will tell me if you are using 802.11g or
> 802.11n.
802.11g. The encryption is WPA & WPA2 Personal, and the maximum rate
is 54 Mbps.
^ permalink raw reply
* [PATCH] net: rfkill: Do not ignore errors from regulator_enable()
From: Luis Henriques @ 2013-08-14 22:10 UTC (permalink / raw)
To: linux-kernel
Cc: netdev, linux-wireless, David S. Miller, Johannes Berg,
John W. Linville
Function regulator_enable() may return an error that has to be checked.
This patch changes function rfkill_regulator_set_block() so that it checks
for the return code. Also, rfkill_data->reg_enabled is set to 'true' only
if there is no error.
This fixes the following compilation warning:
net/rfkill/rfkill-regulator.c:43:20: warning: ignoring return value of 'regulator_enable', declared with attribute warn_unused_result [-Wunused-result]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
net/rfkill/rfkill-regulator.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/net/rfkill/rfkill-regulator.c b/net/rfkill/rfkill-regulator.c
index d11ac79..cf5b145 100644
--- a/net/rfkill/rfkill-regulator.c
+++ b/net/rfkill/rfkill-regulator.c
@@ -30,6 +30,7 @@ struct rfkill_regulator_data {
static int rfkill_regulator_set_block(void *data, bool blocked)
{
struct rfkill_regulator_data *rfkill_data = data;
+ int ret = 0;
pr_debug("%s: blocked: %d\n", __func__, blocked);
@@ -40,15 +41,16 @@ static int rfkill_regulator_set_block(void *data, bool blocked)
}
} else {
if (!rfkill_data->reg_enabled) {
- regulator_enable(rfkill_data->vcc);
- rfkill_data->reg_enabled = true;
+ ret = regulator_enable(rfkill_data->vcc);
+ if (!ret)
+ rfkill_data->reg_enabled = true;
}
}
pr_debug("%s: regulator_is_enabled after set_block: %d\n", __func__,
regulator_is_enabled(rfkill_data->vcc));
- return 0;
+ return ret;
}
static struct rfkill_ops rfkill_regulator_ops = {
--
1.8.3.2
^ permalink raw reply related
* [GIT] [3.12] NFC updates
From: Samuel Ortiz @ 2013-08-14 23:04 UTC (permalink / raw)
To: John W. Linville; +Cc: Linux NFC, Linux Wireless
Hi John,
This is the first NFC pull request for the 3.12 release.
With this one we have:
- A few pn533 improvements and minor fixes. Testing our pn533 driver
against Google's NCI stack triggered a few issues that we fixed now.
We also added Tx fragmentation support to this driver.
- More NFC secure element handling. We added a GET_SE netlink command
for getting all the discovered secure elements, and we defined 2
additional secure element netlink event (transaction and connectivity).
We also fixed a couple of typos and copy-paste bugs from the secure
element handling code.
- Firmware download support for the pn544 driver. This chipset can enter a
special mode where it's waiting for firmware blobs to replace the
already flashed one. We now support that mode.
The following changes since commit d1e2586f484dfc36eee2b2d3a6c6c77be67ca492:
mwifiex: fix build error when CONFIG_PM is not set (2013-08-12 14:36:55 -0400)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/sameo/nfc-next.git tags/nfc-next-3.12-1
for you to fetch changes up to 39525ee1dc78ca1f5f2fb1f764f7a141005fe440:
NFC: Update secure element state (2013-08-14 01:13:40 +0200)
----------------------------------------------------------------
Arron Wang (2):
NFC: Fix secure element state check
NFC: Update secure element state
Dan Carpenter (1):
NFC: hci: Fix enable/disable confusion
Eric Lapuyade (5):
NFC: Move nfc_fw_download_done() definition from private to public
NFC: pn544: i2c: Add firmware download mode power-on support
NFC: netlink: Add result of firmware operation to completion event
NFC: pn544: Add firmware operations hci ops
NFC: pn544: i2c: Add firmware download implementation for pn544
Olivier Guiter (3):
NFC: pn533: Add extended information frame decoding support
NFC: pn533: Split large Tx frames in chunks
NFC: pn533: Store the correct frame size (normal vs ext)
Samuel Ortiz (12):
MAINTAINERS: Change the NFC subsystem status to Supported
NFC: Document secure element addition/removal netlink events
NFC: Define secure element connectivity and transaction events
NFC: pn533: Fix hardware busy loop when establishing the LLCP link
NFC: pn533: Fix the pn533 polling loop
NFC: pn533: Request System code from SENSF_REQ
NFC: pn533: Unconditionaly select the highest p2p bit rate
NFC: pn533: Enable AUTO RFCA
NFC: Fix SE discovery failure warning condition
NFC: Add a GET_SE netlink API
NFC: pn533: Add delay between each poll frame
NFC: pn533: Add some polling entropy
Thierry Escande (1):
NFC: Fix missing static declarations
MAINTAINERS | 2 +-
drivers/nfc/nfcsim.c | 6 +-
drivers/nfc/pn533.c | 389 +++++++++++++++++++++++++++++++++++----------
drivers/nfc/pn544/i2c.c | 360 +++++++++++++++++++++++++++++++++++++++--
drivers/nfc/pn544/mei.c | 2 +-
drivers/nfc/pn544/pn544.c | 20 ++-
drivers/nfc/pn544/pn544.h | 7 +-
include/net/nfc/nfc.h | 3 +
include/uapi/linux/nfc.h | 20 +++
net/nfc/core.c | 22 ++-
net/nfc/hci/core.c | 2 +-
net/nfc/netlink.c | 95 ++++++++++-
net/nfc/nfc.h | 5 +-
13 files changed, 810 insertions(+), 123 deletions(-)
--
Intel Open Source Technology Centre
http://oss.intel.com/
^ permalink raw reply
* Re: [GIT] [3.12] NFC updates
From: Joe Perches @ 2013-08-15 3:07 UTC (permalink / raw)
To: Samuel Ortiz; +Cc: John W. Linville, Linux NFC, Linux Wireless
In-Reply-To: <20130814230448.GB11055@zurbaran>
On Thu, 2013-08-15 at 01:04 +0200, Samuel Ortiz wrote:
> Hi John,
>
> This is the first NFC pull request for the 3.12 release.
Any reason why these reformatting patches were
not applied?
https://lkml.org/lkml/2013/4/5/417
^ permalink raw reply
* Switching band of a dual-band WiFi device
From: Christian Gagneraud @ 2013-08-15 5:11 UTC (permalink / raw)
To: linux-wireless
Hi there,
I am using a TP-Link TL-WDN3200 on a ubuntu 13.04 (kernel
3.8.0-27-generic), and I have install relevant modules with
backports-3.11-rc3-1.
I would like to switch my WiFi stick to 5GHz, I tried iwconfig wlan0
freq 5G, but I get ENOTSUPP.
Is the freq settings suppose to handle this 2.4 vs 5GHz band or is it
only for selecting channel frequency within a given band?
Does linux-wireless provides a way for selecting 2.4 or 5GHz band?
"iw phy phy11 info" tells me that in band 2, all the frequencies are
disabled except:
* 5745 MHz [149] (30.0 dBm)
* 5755 MHz [151] (30.0 dBm)
* 5765 MHz [153] (30.0 dBm)
* 5775 MHz [155] (30.0 dBm)
* 5785 MHz [157] (30.0 dBm)
* 5795 MHz [159] (30.0 dBm)
* 5805 MHz [161] (30.0 dBm)
* 5825 MHz [165] (30.0 dBm)
As well, my understanding of WiFi might be a bit limited but, does a
dual-band WiFi device provides 2.4 and 5GHz services at the same time or
do I need to select one or the other myself? Or maybe I can just
enable/disable them manually (and separately)?
Hope someone can shed some light at this.
Regards,
Chris
^ permalink raw reply
* Re: Switching band of a dual-band WiFi device
From: Christian Gagneraud @ 2013-08-15 5:40 UTC (permalink / raw)
To: linux-wireless; +Cc: Siyu Qiu
In-Reply-To: <CA+J2US3uKD9xr9FOg5=tkwjx2ETQY9qmH305supcjGcVYHmRPQ@mail.gmail.com>
On 15/08/13 17:30, Siyu Qiu wrote:
> hi, do you mean that you take the wireless card from tplink and embed it
> into your pc ? Does it work ? Coz i want to put qca 9889 into pc but the
> info about network controller is :!!! unknown type 7f
Hi Siyu Qio,
I'm not sure to understand your question, but this is what I did
- went to the shop to buy this USB stick
- plugged it in a USB slot of my PC
And now I'm trying to understand if I can switch/enable/disable these 2
bands, and more importantly, do I really need to?
Right now, my feeling is that "it just works out of the box", I
shouldn't try to do this kind of things. I just try to understand this
dual-band thing.
Chris
PS: Can you reply on the mailing list instead of sending private email
please?
>
> On Aug 14, 2013 10:12 PM, "Christian Gagneraud" <chgans@gna.org
> <mailto:chgans@gna.org>> wrote:
>
> Hi there,
>
> I am using a TP-Link TL-WDN3200 on a ubuntu 13.04 (kernel
> 3.8.0-27-generic), and I have install relevant modules with
> backports-3.11-rc3-1.
>
> I would like to switch my WiFi stick to 5GHz, I tried iwconfig wlan0
> freq 5G, but I get ENOTSUPP.
> Is the freq settings suppose to handle this 2.4 vs 5GHz band or is
> it only for selecting channel frequency within a given band?
>
> Does linux-wireless provides a way for selecting 2.4 or 5GHz band?
>
> "iw phy phy11 info" tells me that in band 2, all the frequencies are
> disabled except:
> * 5745 MHz [149] (30.0 dBm)
> * 5755 MHz [151] (30.0 dBm)
> * 5765 MHz [153] (30.0 dBm)
> * 5775 MHz [155] (30.0 dBm)
> * 5785 MHz [157] (30.0 dBm)
> * 5795 MHz [159] (30.0 dBm)
> * 5805 MHz [161] (30.0 dBm)
> * 5825 MHz [165] (30.0 dBm)
>
> As well, my understanding of WiFi might be a bit limited but, does a
> dual-band WiFi device provides 2.4 and 5GHz services at the same
> time or do I need to select one or the other myself? Or maybe I can
> just enable/disable them manually (and separately)?
>
> Hope someone can shed some light at this.
>
> Regards,
> Chris
> --
> To unsubscribe from this list: send the line "unsubscribe
> linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> <mailto:majordomo@vger.kernel.org>
> More majordomo info at http://vger.kernel.org/__majordomo-info.html
> <http://vger.kernel.org/majordomo-info.html>
>
^ permalink raw reply
* Re: [PATCHv2 1/2] mac80211: perform power save processing before decryption
From: Kalle Valo @ 2013-08-15 6:08 UTC (permalink / raw)
To: Johan Almbladh; +Cc: johannes, ordex, linux-wireless
In-Reply-To: <1376486987-23224-1-git-send-email-ja@anyfi.net>
Johan Almbladh <ja@anyfi.net> writes:
> This patch decouples the power save processing from the frame decryption
> by running the decrypt rx handler after sta_process. In the case where
> the decryption failed for some reason, the stack used to not process
> the PM and MOREDATA bits for that frame. The stack now always performs
> power save processing regardless of the decryption result. That means that
> encrypted data frames and NULLFUNC frames are now handled in the same way
> regarding power save processing, making the stack more robust.
>
> Tested-by: Johan Almbladh <ja@anyfi.net>
> Signed-off-by: Johan Almbladh <ja@anyfi.net>
The idea of the Tested-by is that someone else than the patch author has
also tested the patch, like a bug reporter etc. The patch author should
always tests his/her code, so adding Tested-by for the author is moot.
--
Kalle Valo
^ permalink raw reply
* Re: [PATCHv2 1/2] mac80211: perform power save processing before decryption
From: Johan Almbladh @ 2013-08-15 6:58 UTC (permalink / raw)
To: Kalle Valo; +Cc: Johan Almbladh, Johannes Berg, ordex, linux-wireless
In-Reply-To: <877gfnwkog.fsf@purkki.adurom.net>
Right, I got it.
Johan
On Thu, Aug 15, 2013 at 8:08 AM, Kalle Valo <kvalo@adurom.com> wrote:
> Johan Almbladh <ja@anyfi.net> writes:
>
>> This patch decouples the power save processing from the frame decryption
>> by running the decrypt rx handler after sta_process. In the case where
>> the decryption failed for some reason, the stack used to not process
>> the PM and MOREDATA bits for that frame. The stack now always performs
>> power save processing regardless of the decryption result. That means that
>> encrypted data frames and NULLFUNC frames are now handled in the same way
>> regarding power save processing, making the stack more robust.
>>
>> Tested-by: Johan Almbladh <ja@anyfi.net>
>> Signed-off-by: Johan Almbladh <ja@anyfi.net>
>
> The idea of the Tested-by is that someone else than the patch author has
> also tested the patch, like a bug reporter etc. The patch author should
> always tests his/her code, so adding Tested-by for the author is moot.
>
> --
> Kalle Valo
^ permalink raw reply
* Re: Kernel Panic with Linux 3.10-6
From: Arend van Spriel @ 2013-08-15 9:31 UTC (permalink / raw)
To: Pedram Navid; +Cc: brcm80211-dev-list, linux-wireless
In-Reply-To: <CAHgnS=pnv0AV7JoDq5MCFMsDO60g1a_av0b6F-UM6V0m-7e=eQ@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1132 bytes --]
On 08/15/2013 03:28 AM, Pedram Navid wrote:
> With the latest 3.10-6 kernel I am receiving frequent and consistent
> kernel panics. Downgrading to 3.9.5 resolves the issue.
Thanks, Pedram
I have had a couple of other report about this particular panic and did
some investigation. It is a divide-by-zero causing the panic. I do have
a patch to avoid that, but the root cause is something else. Is 3.10.6
you see this on the unmodified stable release?
The attached patch avoids the panic, but you will probably have crappy
connectivity.
Regards,
Arend
> Other users are also reporting this issue:
> https://bbs.archlinux.org/viewtopic.php?pid=1312140
>
> Hope this is the right place to post this. For reference, here is my
> card, using the brcmsmac module.
>
> 02:00.0 Network controller [0280]: Broadcom Corporation BCM4313
> 802.11b/g/n Wireless LAN Controller [14e4:4727] (rev 01)
> Subsystem: Broadcom Corporation Device [14e4:0510]
> Flags: bus master, fast devsel, latency 0, IRQ 17
> Memory at 56000000 (64-bit, non-prefetchable) [size=16K]
> Capabilities: <access denied>
> Kernel driver in use: bcma-pci-bridge
>
[-- Attachment #2: 0001-brcmsmac-avoid-kernel-panic-due-to-divide-by-zero-er.patch --]
[-- Type: text/plain, Size: 1447 bytes --]
>From aeca211f0bb6186eefb7f3a6ad98115e2256e53a Mon Sep 17 00:00:00 2001
From: Arend van Spriel <arend@broadcom.com>
Date: Mon, 12 Aug 2013 12:34:45 +0200
Subject: [PATCH] brcmsmac: avoid kernel panic due to divide-by-zero error
The patch avoid the kernel panic and adds a few error log messages.
Signed-off-by: Arend van Spriel <arend@broadcom.com>
---
drivers/net/wireless/brcm80211/brcmsmac/main.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.c b/drivers/net/wireless/brcm80211/brcmsmac/main.c
index 9fd6f2f..ea92ea2 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/main.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c
@@ -630,10 +630,21 @@ static uint brcms_c_calc_frame_time(struct brcms_c_info *wlc, u32 ratespec,
dur = PREN_PREAMBLE + (tot_streams * PREN_PREAMBLE_EXT);
if (preamble_type == BRCMS_MM_PREAMBLE)
dur += PREN_MM_EXT;
+
+ if (mcs > BRCMS_MAXMCS) {
+ brcms_err(wlc->hw->d11core, "wl%d: invalid mcs: %u\n",
+ wlc->pub->unit, mcs);
+ mcs = 0;
+ }
/* 1000Ndbps = kbps * 4 */
kNdps = mcs_2_rate(mcs, rspec_is40mhz(ratespec),
rspec_issgi(ratespec)) * 4;
+ if (kNdps == 0) {
+ brcms_err(wlc->hw->d11core, "wl%d: invalid zero rate: rspec=0x%x\n",
+ wlc->pub->unit, ratespec);
+ kNdps = 6500 * 4;
+ }
if (rspec_stc(ratespec) == 0)
nsyms =
CEIL((APHY_SERVICE_NBITS + 8 * mac_len +
--
1.7.10.4
^ permalink raw reply related
* Re: Switching band of a dual-band WiFi device
From: Simon Farnsworth @ 2013-08-15 9:03 UTC (permalink / raw)
To: Christian Gagneraud; +Cc: linux-wireless
In-Reply-To: <520C631F.6010806@gna.org>
[-- Attachment #1: Type: text/plain, Size: 2136 bytes --]
On Thursday 15 August 2013 17:11:59 Christian Gagneraud wrote:
> Hi there,
>
> I am using a TP-Link TL-WDN3200 on a ubuntu 13.04 (kernel
> 3.8.0-27-generic), and I have install relevant modules with
> backports-3.11-rc3-1.
>
> I would like to switch my WiFi stick to 5GHz, I tried iwconfig wlan0
> freq 5G, but I get ENOTSUPP.
> Is the freq settings suppose to handle this 2.4 vs 5GHz band or is it
> only for selecting channel frequency within a given band?
>
> Does linux-wireless provides a way for selecting 2.4 or 5GHz band?
Linux should automatically select the right frequency band, depending on
the frequencies in use by the device you're trying to communicate with.
Connect to an AP in the 5GHz band, and Linux should just use 5GHz
automatically.
>
> "iw phy phy11 info" tells me that in band 2, all the frequencies are
> disabled except:
> * 5745 MHz [149] (30.0 dBm)
> * 5755 MHz [151] (30.0 dBm)
> * 5765 MHz [153] (30.0 dBm)
> * 5775 MHz [155] (30.0 dBm)
> * 5785 MHz [157] (30.0 dBm)
> * 5795 MHz [159] (30.0 dBm)
> * 5805 MHz [161] (30.0 dBm)
> * 5825 MHz [165] (30.0 dBm)
>
That's showing you that, with Linux's understanding of the RF regulations in
your area, it can only transmit on certain frequencies.
> As well, my understanding of WiFi might be a bit limited but, does a
> dual-band WiFi device provides 2.4 and 5GHz services at the same time or
> do I need to select one or the other myself? Or maybe I can just
> enable/disable them manually (and separately)?
>
A dual-band WiFi device can only transmit and receive on one channel at a
time. The advantage of dual-band is that it can transmit and receive on either
the 5GHz band (which is less crowded), or the 2.4GHz band (which is more
commonly used). There's no need to select the band manually - it will just
use 5GHz when the other device (e.g. the AP) is using 5GHz.
--
Simon Farnsworth
Software Engineer
ONELAN Ltd
http://www.onelan.com
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 490 bytes --]
^ permalink raw reply
* [PATCH v14 0/2] P2P find phase offload
From: Vladimir Kondratiev @ 2013-08-15 11:51 UTC (permalink / raw)
To: Johannes Berg
Cc: Vladimir Kondratiev, linux-wireless, Luis R . Rodriguez,
John W . Linville, Jouni Malinen
Addressed input collected:
- remove NL80211_FEATURE_P2P_PROBE_RESP_OFFLOAD feature flag because
NL80211_RXMGMT_FLAG_REPLIED flag in cfg80211_rx_mgmt() provide needed
info on per-frame basis
- validate min/max discoverable interval parameters
- use kcalloc to allocate array
Vladimir Kondratiev (2):
cfg80211: add 'flags' to cfg80211_rx_mgmt()
cfg80211: P2P find phase offload
drivers/net/wireless/ath/ath6kl/wmi.c | 7 +-
drivers/net/wireless/ath/wil6210/wmi.c | 2 +-
drivers/net/wireless/brcm80211/brcmfmac/p2p.c | 4 +-
drivers/net/wireless/mwifiex/util.c | 4 +-
include/net/cfg80211.h | 79 +++++++++-
include/uapi/linux/nl80211.h | 27 ++++
net/mac80211/rx.c | 3 +-
net/wireless/mlme.c | 4 +-
net/wireless/nl80211.c | 216 +++++++++++++++++++++++++-
net/wireless/nl80211.h | 2 +-
net/wireless/rdev-ops.h | 19 +++
net/wireless/trace.h | 44 ++++++
12 files changed, 394 insertions(+), 17 deletions(-)
--
1.8.1.2
^ permalink raw reply
* [PATCH v14 2/2] cfg80211: P2P find phase offload
From: Vladimir Kondratiev @ 2013-08-15 11:51 UTC (permalink / raw)
To: Johannes Berg
Cc: Vladimir Kondratiev, linux-wireless, Luis R . Rodriguez,
John W . Linville, Jouni Malinen
In-Reply-To: <1376567489-1863-1-git-send-email-qca_vkondrat@qca.qualcomm.com>
Allow to implement P2P find phase in the driver/firmware.
Offload scheme designed as follows:
- Driver provide methods start_p2p_find and stop_p2p_find in the cfg80211_ops;
- wpa_supplicant analyses methods supported to discover p2p offload support;
to perform p2p scan, wpa_supplicant:
- perform legacy scan, through driver's cfg80211_ops 'scan' method
- configure rx management filter to get probe-request and probe-response frames
- start p2p find via driver's cfg80211_ops start_p2p_find method
- driver start p2p find with hardware and notify wpa_supplicant with
cfg80211_p2p_find_notify_start()
- driver/firmware toggle search/listen states. Received probe-request and
probe-response frames passed to the wpa_supplicant via cfg80211_rx_mgmt;
replied by driver/firmware probe-request frames indicated with
NL80211_RXMGMT_FLAG_REPLIED flag
- when wpa_supplicant wants to stop p2p find, it calls driver's
cfg80211_ops stop_p2p_find method. Alternatively, driver/firmware may decide
to stop p2p find. In all cases, driver notifies wpa_supplicant using
cfg80211_p2p_find_notify_end()
All driver to user space communication done through nl80211 layer.
Offloaded P2P find does not support variations like progressive scan.
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
---
include/net/cfg80211.h | 76 ++++++++++++++++
include/uapi/linux/nl80211.h | 10 +++
net/wireless/nl80211.c | 210 +++++++++++++++++++++++++++++++++++++++++++
net/wireless/rdev-ops.h | 19 ++++
net/wireless/trace.h | 44 +++++++++
5 files changed, 359 insertions(+)
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index e1ee9d3..c831f8b 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1924,6 +1924,36 @@ struct cfg80211_update_ft_ies_params {
};
/**
+ * struct cfg80211_p2p_find_params - parameters for P2P find
+ * @probe_ie: extra IE's for probe frames
+ * @probe_ie_len: length, bytes, of @probe_ie
+ * @probe_resp_ie: extra IE's for probe response frames
+ * @probe_resp_ie_len: length, bytes, of @probe_resp_ie
+ * Driver/firmware may add additional IE's as well as modify
+ * provided ones; typical IE's to be added are
+ * WLAN_EID_EXT_SUPP_RATES, WLAN_EID_DS_PARAMS,
+ * WLAN_EID_HT_CAPABILITY.
+ * @min_discoverable_interval: and
+ * @max_discoverable_interval: min/max for random multiplier of 100TU's
+ * for the listen state duration
+ * @listen_channel: channel to listen on; not NULL
+ * @n_channels: number of channels to operate on
+ * @channels: channels to operate on; non-empty list
+ */
+struct cfg80211_p2p_find_params {
+ const u8 *probe_ie;
+ size_t probe_ie_len;
+ const u8 *probe_resp_ie;
+ size_t probe_resp_ie_len;
+ u32 min_discoverable_interval;
+ u32 max_discoverable_interval;
+ struct ieee80211_channel *listen_channel;
+
+ int n_channels;
+ struct ieee80211_channel **channels;
+};
+
+/**
* struct cfg80211_ops - backend description for wireless configuration
*
* This struct is registered by fullmac card drivers and/or wireless stacks
@@ -2165,6 +2195,24 @@ struct cfg80211_update_ft_ies_params {
* @set_coalesce: Set coalesce parameters.
*
* @channel_switch: initiate channel-switch procedure (with CSA)
+ *
+ * @start_p2p_find: start P2P find phase
+ * Parameters include IEs for probe/probe-resp frames;
+ * and channels to operate on.
+ * Parameters are not retained after call, driver need to copy data if
+ * it need it later.
+ * P2P find can't run concurrently with ROC or scan,
+ * conflict with scan detected by cfg80211 and -EBUSY returned;
+ * and driver should check for ROC and return -EBUSY to indicate conflict.
+ * While performing P2P discovery, driver should report received
+ * probe-request and probe-response frames via cfg80211_rx_mgmt
+ * accordingly to the rx mgmt filter, as set by mgmt_frame_register().
+ * If device indicates NL80211_FEATURE_P2P_PROBE_RESP_OFFLOAD, it may
+ * reply some matching probes and replied probes may be not reported to
+ * the upper layers; otherwise it must not reply any probe.
+ * @stop_p2p_find: stop P2P find phase
+ * After stopping p2p find, driver should call
+ * cfg80211_p2p_find_notify_end() to inform upper layers
*/
struct cfg80211_ops {
int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow);
@@ -2406,6 +2454,12 @@ struct cfg80211_ops {
int (*channel_switch)(struct wiphy *wiphy,
struct net_device *dev,
struct cfg80211_csa_settings *params);
+
+ int (*start_p2p_find)(struct wiphy *wiphy,
+ struct wireless_dev *wdev,
+ struct cfg80211_p2p_find_params *params);
+ void (*stop_p2p_find)(struct wiphy *wiphy,
+ struct wireless_dev *wdev);
};
/*
@@ -3062,6 +3116,7 @@ struct wireless_dev {
struct mutex mtx;
bool use_4addr, p2p_started;
+ bool p2p_find_active; /* protected by rtnl */
u8 address[ETH_ALEN] __aligned(sizeof(u16));
@@ -4376,6 +4431,27 @@ void cfg80211_report_wowlan_wakeup(struct wireless_dev *wdev,
*/
void cfg80211_crit_proto_stopped(struct wireless_dev *wdev, gfp_t gfp);
+/**
+ * cfg80211_p2p_find_notify_start - report p2p find phase started
+ * @wdev: the wireless device reporting the event
+ * @gfp: allocation flags
+ */
+void cfg80211_p2p_find_notify_start(struct wireless_dev *wdev, gfp_t gfp);
+
+/**
+ * cfg80211_p2p_find_notify_end - report p2p find phase ended
+ * @wdev: the wireless device reporting the event
+ * @gfp: allocation flags
+ *
+ * p2p find phase may be ended either unsolicited or in response to
+ * ops->stop_p2p_find. If called out of context of ops->stop_p2p_find,
+ * should be protected with rtnl_lock()
+ *
+ * In any case, if @start_p2p_find from driver's struct cfg80211_ops called,
+ * @cfg80211_p2p_find_notify_end should be eventually called
+ */
+void cfg80211_p2p_find_notify_end(struct wireless_dev *wdev, gfp_t gfp);
+
/* Logging, debugging and troubleshooting/diagnostic helpers. */
/* wiphy_printk helpers, similar to dev_printk */
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index fc1665e..5a00bd61 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -853,6 +853,9 @@ enum nl80211_commands {
NL80211_CMD_CHANNEL_SWITCH,
+ NL80211_CMD_START_P2P_FIND,
+ NL80211_CMD_STOP_P2P_FIND,
+
/* add new commands above here */
/* used to define NL80211_CMD_MAX below */
@@ -1497,6 +1500,10 @@ enum nl80211_commands {
* As specified in the enum nl80211_rxmgmt_flags.
* Passed from cfg80211_rx_mgmt()
*
+ * @NL80211_ATTR_MIN_DISCOVERABLE_INTERVAL:
+ * @NL80211_ATTR_MAX_DISCOVERABLE_INTERVAL: min/max discoverable interval
+ * for the p2p find, multiple of 100 TUs, represented as u32
+ *
* @NL80211_ATTR_MAX: highest attribute number currently defined
* @__NL80211_ATTR_AFTER_LAST: internal use
*/
@@ -1807,6 +1814,9 @@ enum nl80211_attrs {
NL80211_ATTR_RXMGMT_FLAGS,
+ NL80211_ATTR_MIN_DISCOVERABLE_INTERVAL,
+ NL80211_ATTR_MAX_DISCOVERABLE_INTERVAL,
+
/* add attributes here, update the policy in nl80211.c */
__NL80211_ATTR_AFTER_LAST,
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 8dbb289..d2a85f1 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -354,6 +354,8 @@ static const struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] = {
[NL80211_ATTR_CSA_IES] = { .type = NLA_NESTED },
[NL80211_ATTR_CSA_C_OFF_BEACON] = { .type = NLA_U16 },
[NL80211_ATTR_CSA_C_OFF_PRESP] = { .type = NLA_U16 },
+ [NL80211_ATTR_MIN_DISCOVERABLE_INTERVAL] = { .type = NLA_U32 },
+ [NL80211_ATTR_MAX_DISCOVERABLE_INTERVAL] = { .type = NLA_U32 },
};
/* policy for the key attributes */
@@ -1431,6 +1433,8 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *dev,
CMD(crit_proto_stop, CRIT_PROTOCOL_STOP);
if (dev->wiphy.flags & WIPHY_FLAG_HAS_CHANNEL_SWITCH)
CMD(channel_switch, CHANNEL_SWITCH);
+ CMD(start_p2p_find, START_P2P_FIND);
+ CMD(stop_p2p_find, STOP_P2P_FIND);
}
#ifdef CONFIG_NL80211_TESTMODE
@@ -8762,6 +8766,157 @@ static int nl80211_crit_protocol_stop(struct sk_buff *skb,
return 0;
}
+static int p2p_find_handle_channel(struct wiphy *wiphy,
+ struct cfg80211_p2p_find_params *params,
+ u32 freq)
+{
+ struct ieee80211_channel *chan = ieee80211_get_channel(wiphy, freq);
+
+ if (!chan)
+ return -EINVAL;
+
+ /* ignore disabled channels */
+ if (chan->flags & IEEE80211_CHAN_DISABLED)
+ return 0;
+
+ params->channels[params->n_channels++] = chan;
+ return 0;
+}
+
+static int nl80211_start_p2p_find(struct sk_buff *skb, struct genl_info *info)
+{
+ struct cfg80211_registered_device *rdev = info->user_ptr[0];
+ struct wireless_dev *wdev = info->user_ptr[1];
+ struct wiphy *wiphy = &rdev->wiphy;
+ /*
+ * Defaults, as defined in the spec
+ * Ref: Wi-Fi Peer-to-Peer (P2P) Technical Specification v1.1
+ * Clause: 3.1.2.1.3 Find Phase
+ */
+ struct cfg80211_p2p_find_params params = {
+ .min_discoverable_interval = 1,
+ .max_discoverable_interval = 3,
+ };
+ /* P2P spec defines social channels 1,6,11 @2.4GHz and 2 @60GHz */
+ static u32 social_freqs[] = {2412, 2437, 2462, 60480};
+ struct nlattr *attr_freq = info->attrs[NL80211_ATTR_SCAN_FREQUENCIES];
+ struct nlattr *attr_l_freq = info->attrs[NL80211_ATTR_WIPHY_FREQ];
+ struct nlattr *attr;
+ int err, tmp, n_channels;
+ struct ieee80211_channel *chan;
+
+ if (wdev->iftype != NL80211_IFTYPE_P2P_DEVICE)
+ return -EOPNOTSUPP;
+
+ if (!rdev->ops->start_p2p_find || !rdev->ops->stop_p2p_find)
+ return -EOPNOTSUPP;
+
+ if (!attr_l_freq)
+ return -EINVAL;
+
+ if (!is_valid_ie_attr(info->attrs[NL80211_ATTR_IE]))
+ return -EINVAL;
+
+ if (!is_valid_ie_attr(info->attrs[NL80211_ATTR_IE_PROBE_RESP]))
+ return -EINVAL;
+
+ if (rdev->scan_req)
+ return -EBUSY;
+
+ if (wdev->p2p_find_active)
+ return -EBUSY;
+
+ chan = ieee80211_get_channel(wiphy, nla_get_u32(attr_l_freq));
+ if (!chan || (chan->flags & IEEE80211_CHAN_DISABLED))
+ return -EINVAL;
+ params.listen_channel = chan;
+
+ attr = info->attrs[NL80211_ATTR_MIN_DISCOVERABLE_INTERVAL];
+ if (attr)
+ params.min_discoverable_interval = nla_get_u32(attr);
+
+ attr = info->attrs[NL80211_ATTR_MAX_DISCOVERABLE_INTERVAL];
+ if (attr)
+ params.max_discoverable_interval = nla_get_u32(attr);
+
+ if (params.min_discoverable_interval >
+ params.max_discoverable_interval)
+ return -EINVAL;
+
+ if (attr_freq) {
+ n_channels = validate_scan_freqs(attr_freq);
+ if (!n_channels)
+ return -EINVAL;
+ } else {
+ n_channels = ARRAY_SIZE(social_freqs);
+ }
+ params.channels = kcalloc(n_channels, sizeof(*params.channels),
+ GFP_KERNEL);
+ if (!params.channels)
+ return -ENOMEM;
+
+ if (attr_freq) {
+ /* user specified, bail out if channel not found */
+ nla_for_each_nested(attr, attr_freq, tmp) {
+ err = p2p_find_handle_channel(wiphy, ¶ms,
+ nla_get_u32(attr));
+ if (err)
+ goto out_free;
+ }
+ } else { /* all supported social channels */
+ /* ignore errors for non-existing channels */
+ for (tmp = 0; tmp < ARRAY_SIZE(social_freqs); tmp++) {
+ p2p_find_handle_channel(wiphy, ¶ms,
+ social_freqs[tmp]);
+ }
+ }
+ if (!params.n_channels) {
+ err = -EINVAL;
+ goto out_free;
+ }
+
+ attr = info->attrs[NL80211_ATTR_IE];
+ if (attr) {
+ params.probe_ie_len = nla_len(attr);
+ params.probe_ie = nla_data(attr);
+ }
+
+ attr = info->attrs[NL80211_ATTR_IE_PROBE_RESP];
+ if (attr) {
+ params.probe_resp_ie_len = nla_len(attr);
+ params.probe_resp_ie = nla_data(attr);
+ }
+
+ wdev->p2p_find_active = true;
+ err = rdev_start_p2p_find(rdev, wdev, ¶ms);
+ if (err)
+ wdev->p2p_find_active = false;
+
+out_free:
+ kfree(params.channels);
+
+ return err;
+}
+
+static int nl80211_stop_p2p_find(struct sk_buff *skb, struct genl_info *info)
+{
+ struct cfg80211_registered_device *rdev = info->user_ptr[0];
+ struct wireless_dev *wdev = info->user_ptr[1];
+
+ if (wdev->iftype != NL80211_IFTYPE_P2P_DEVICE)
+ return -EOPNOTSUPP;
+
+ if (!rdev->ops->start_p2p_find || !rdev->ops->stop_p2p_find)
+ return -EOPNOTSUPP;
+
+ if (!wdev->p2p_find_active)
+ return -ENOENT;
+
+ rdev_stop_p2p_find(rdev, wdev);
+
+ return 0;
+}
+
#define NL80211_FLAG_NEED_WIPHY 0x01
#define NL80211_FLAG_NEED_NETDEV 0x02
#define NL80211_FLAG_NEED_RTNL 0x04
@@ -9435,6 +9590,22 @@ static struct genl_ops nl80211_ops[] = {
NL80211_FLAG_NEED_RTNL,
},
{
+ .cmd = NL80211_CMD_START_P2P_FIND,
+ .doit = nl80211_start_p2p_find,
+ .policy = nl80211_policy,
+ .flags = GENL_ADMIN_PERM,
+ .internal_flags = NL80211_FLAG_NEED_WDEV_UP |
+ NL80211_FLAG_NEED_RTNL,
+ },
+ {
+ .cmd = NL80211_CMD_STOP_P2P_FIND,
+ .doit = nl80211_stop_p2p_find,
+ .policy = nl80211_policy,
+ .flags = GENL_ADMIN_PERM,
+ .internal_flags = NL80211_FLAG_NEED_WDEV_UP |
+ NL80211_FLAG_NEED_RTNL,
+ },
+ {
.cmd = NL80211_CMD_GET_PROTOCOL_FEATURES,
.doit = nl80211_get_protocol_features,
.policy = nl80211_policy,
@@ -11126,6 +11297,45 @@ void cfg80211_tdls_oper_request(struct net_device *dev, const u8 *peer,
}
EXPORT_SYMBOL(cfg80211_tdls_oper_request);
+static
+void cfg80211_p2p_find_notify(struct wireless_dev *wdev, int cmd, gfp_t gfp)
+{
+ struct wiphy *wiphy = wdev->wiphy;
+ struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
+ struct sk_buff *msg;
+ void *hdr;
+
+ trace_cfg80211_p2p_find_notify(wdev, cmd);
+ msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
+ if (!msg)
+ return;
+
+ hdr = nl80211hdr_put(msg, 0, 0, 0, cmd);
+ if (!hdr) {
+ nlmsg_free(msg);
+ return;
+ }
+
+ genlmsg_end(msg, hdr);
+
+ genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0,
+ nl80211_scan_mcgrp.id, GFP_KERNEL);
+}
+
+void cfg80211_p2p_find_notify_start(struct wireless_dev *wdev, gfp_t gfp)
+{
+ cfg80211_p2p_find_notify(wdev, NL80211_CMD_START_P2P_FIND, gfp);
+}
+EXPORT_SYMBOL(cfg80211_p2p_find_notify_start);
+
+void cfg80211_p2p_find_notify_end(struct wireless_dev *wdev, gfp_t gfp)
+{
+ ASSERT_RTNL();
+ cfg80211_p2p_find_notify(wdev, NL80211_CMD_STOP_P2P_FIND, gfp);
+ wdev->p2p_find_active = false;
+}
+EXPORT_SYMBOL(cfg80211_p2p_find_notify_end);
+
static int nl80211_netlink_notify(struct notifier_block * nb,
unsigned long state,
void *_notify)
diff --git a/net/wireless/rdev-ops.h b/net/wireless/rdev-ops.h
index de870d4..6c3f463 100644
--- a/net/wireless/rdev-ops.h
+++ b/net/wireless/rdev-ops.h
@@ -935,4 +935,23 @@ static inline int rdev_channel_switch(struct cfg80211_registered_device *rdev,
return ret;
}
+static inline int rdev_start_p2p_find(struct cfg80211_registered_device *rdev,
+ struct wireless_dev *wdev,
+ struct cfg80211_p2p_find_params *params)
+{
+ int ret;
+ trace_rdev_start_p2p_find(&rdev->wiphy, wdev, params);
+ ret = rdev->ops->start_p2p_find(&rdev->wiphy, wdev, params);
+ trace_rdev_return_int(&rdev->wiphy, ret);
+ return ret;
+}
+
+static inline void rdev_stop_p2p_find(struct cfg80211_registered_device *rdev,
+ struct wireless_dev *wdev)
+{
+ trace_rdev_stop_p2p_find(&rdev->wiphy, wdev);
+ rdev->ops->stop_p2p_find(&rdev->wiphy, wdev);
+ trace_rdev_return_void(&rdev->wiphy);
+}
+
#endif /* __CFG80211_RDEV_OPS */
diff --git a/net/wireless/trace.h b/net/wireless/trace.h
index f0ebdcd..ec5b0cd 100644
--- a/net/wireless/trace.h
+++ b/net/wireless/trace.h
@@ -1874,6 +1874,36 @@ TRACE_EVENT(rdev_channel_switch,
__entry->counter_offset_presp)
);
+TRACE_EVENT(rdev_start_p2p_find,
+ TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
+ struct cfg80211_p2p_find_params *params),
+ TP_ARGS(wiphy, wdev, params),
+ TP_STRUCT__entry(
+ WIPHY_ENTRY
+ WDEV_ENTRY
+ __field(u32, min_di)
+ __field(u32, max_di)
+ __field(u32, listen_freq)
+ __field(int, n_channels)
+ ),
+ TP_fast_assign(
+ WIPHY_ASSIGN;
+ WDEV_ASSIGN;
+ __entry->min_di = params->min_discoverable_interval;
+ __entry->max_di = params->max_discoverable_interval;
+ __entry->listen_freq = params->listen_channel->center_freq;
+ __entry->n_channels = params->n_channels;
+ ),
+ TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", listen %d MHz, disc. int. [%d..%d], n_channels %d",
+ WIPHY_PR_ARG, WDEV_PR_ARG, __entry->listen_freq,
+ __entry->min_di, __entry->max_di, __entry->n_channels)
+);
+
+DEFINE_EVENT(wiphy_wdev_evt, rdev_stop_p2p_find,
+ TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
+ TP_ARGS(wiphy, wdev)
+);
+
/*************************************************************
* cfg80211 exported functions traces *
*************************************************************/
@@ -2557,6 +2587,20 @@ TRACE_EVENT(cfg80211_ft_event,
WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(target_ap))
);
+TRACE_EVENT(cfg80211_p2p_find_notify,
+ TP_PROTO(struct wireless_dev *wdev, int cmd),
+ TP_ARGS(wdev, cmd),
+ TP_STRUCT__entry(
+ WDEV_ENTRY
+ __field(int, cmd)
+ ),
+ TP_fast_assign(
+ WDEV_ASSIGN;
+ __entry->cmd = cmd;
+ ),
+ TP_printk(WDEV_PR_FMT ", cmd: %d", WDEV_PR_ARG, __entry->cmd)
+);
+
#endif /* !__RDEV_OPS_TRACE || TRACE_HEADER_MULTI_READ */
#undef TRACE_INCLUDE_PATH
--
1.8.1.2
^ permalink raw reply related
* [PATCH v14 1/2] cfg80211: add 'flags' to cfg80211_rx_mgmt()
From: Vladimir Kondratiev @ 2013-08-15 11:51 UTC (permalink / raw)
To: Johannes Berg
Cc: Vladimir Kondratiev, linux-wireless, Luis R . Rodriguez,
John W . Linville, Jouni Malinen
In-Reply-To: <1376567489-1863-1-git-send-email-qca_vkondrat@qca.qualcomm.com>
Flags intended to report various auxiliary information.
Introduced flag NL80211_RXMGMT_FLAG_REPLIED to report
whether frame was replied by the device/driver.
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/wmi.c | 7 +++----
drivers/net/wireless/ath/wil6210/wmi.c | 2 +-
drivers/net/wireless/brcm80211/brcmfmac/p2p.c | 4 ++--
drivers/net/wireless/mwifiex/util.c | 4 ++--
include/net/cfg80211.h | 3 ++-
include/uapi/linux/nl80211.h | 17 +++++++++++++++++
net/mac80211/rx.c | 3 +--
net/wireless/mlme.c | 4 ++--
net/wireless/nl80211.c | 6 ++++--
net/wireless/nl80211.h | 2 +-
10 files changed, 35 insertions(+), 17 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c
index 87aefb4..546d5da 100644
--- a/drivers/net/wireless/ath/ath6kl/wmi.c
+++ b/drivers/net/wireless/ath/ath6kl/wmi.c
@@ -568,8 +568,8 @@ static int ath6kl_wmi_rx_probe_req_event_rx(struct wmi *wmi, u8 *datap, int len,
dlen, freq, vif->probe_req_report);
if (vif->probe_req_report || vif->nw_type == AP_NETWORK)
- cfg80211_rx_mgmt(&vif->wdev, freq, 0,
- ev->data, dlen, GFP_ATOMIC);
+ cfg80211_rx_mgmt(&vif->wdev, freq, 0, ev->data, dlen, 0,
+ GFP_ATOMIC);
return 0;
}
@@ -608,8 +608,7 @@ static int ath6kl_wmi_rx_action_event_rx(struct wmi *wmi, u8 *datap, int len,
return -EINVAL;
}
ath6kl_dbg(ATH6KL_DBG_WMI, "rx_action: len=%u freq=%u\n", dlen, freq);
- cfg80211_rx_mgmt(&vif->wdev, freq, 0,
- ev->data, dlen, GFP_ATOMIC);
+ cfg80211_rx_mgmt(&vif->wdev, freq, 0, ev->data, dlen, 0, GFP_ATOMIC);
return 0;
}
diff --git a/drivers/net/wireless/ath/wil6210/wmi.c b/drivers/net/wireless/ath/wil6210/wmi.c
index 5220f15..063963e 100644
--- a/drivers/net/wireless/ath/wil6210/wmi.c
+++ b/drivers/net/wireless/ath/wil6210/wmi.c
@@ -339,7 +339,7 @@ static void wmi_evt_rx_mgmt(struct wil6210_priv *wil, int id, void *d, int len)
}
} else {
cfg80211_rx_mgmt(wil->wdev, freq, signal,
- (void *)rx_mgmt_frame, d_len, GFP_KERNEL);
+ (void *)rx_mgmt_frame, d_len, 0, GFP_KERNEL);
}
}
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/p2p.c b/drivers/net/wireless/brcm80211/brcmfmac/p2p.c
index 79555f0..d7a9745 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/p2p.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/p2p.c
@@ -1430,7 +1430,7 @@ int brcmf_p2p_notify_action_frame_rx(struct brcmf_if *ifp,
IEEE80211_BAND_5GHZ);
wdev = &ifp->vif->wdev;
- cfg80211_rx_mgmt(wdev, freq, 0, (u8 *)mgmt_frame, mgmt_frame_len,
+ cfg80211_rx_mgmt(wdev, freq, 0, (u8 *)mgmt_frame, mgmt_frame_len, 0,
GFP_ATOMIC);
kfree(mgmt_frame);
@@ -1895,7 +1895,7 @@ s32 brcmf_p2p_notify_rx_mgmt_p2p_probereq(struct brcmf_if *ifp,
IEEE80211_BAND_2GHZ :
IEEE80211_BAND_5GHZ);
- cfg80211_rx_mgmt(&vif->wdev, freq, 0, mgmt_frame, mgmt_frame_len,
+ cfg80211_rx_mgmt(&vif->wdev, freq, 0, mgmt_frame, mgmt_frame_len, 0,
GFP_ATOMIC);
brcmf_dbg(INFO, "mgmt_frame_len (%d) , e->datalen (%d), chanspec (%04x), freq (%d)\n",
diff --git a/drivers/net/wireless/mwifiex/util.c b/drivers/net/wireless/mwifiex/util.c
index e57ac0d..5d9e150 100644
--- a/drivers/net/wireless/mwifiex/util.c
+++ b/drivers/net/wireless/mwifiex/util.c
@@ -171,8 +171,8 @@ mwifiex_process_mgmt_packet(struct mwifiex_private *priv,
rx_pd->rx_pkt_length = cpu_to_le16(pkt_len);
cfg80211_rx_mgmt(priv->wdev, priv->roc_cfg.chan.center_freq,
- CAL_RSSI(rx_pd->snr, rx_pd->nf),
- skb->data, pkt_len, GFP_ATOMIC);
+ CAL_RSSI(rx_pd->snr, rx_pd->nf), skb->data, pkt_len,
+ 0, GFP_ATOMIC);
return 0;
}
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index b7495c7..e1ee9d3 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -4055,6 +4055,7 @@ void cfg80211_conn_failed(struct net_device *dev, const u8 *mac_addr,
* @sig_dbm: signal strength in mBm, or 0 if unknown
* @buf: Management frame (header + body)
* @len: length of the frame data
+ * @flags: flags, as defined in enum nl80211_rxmgmt_flags
* @gfp: context flags
*
* This function is called whenever an Action frame is received for a station
@@ -4066,7 +4067,7 @@ void cfg80211_conn_failed(struct net_device *dev, const u8 *mac_addr,
* driver is responsible for rejecting the frame.
*/
bool cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, int sig_dbm,
- const u8 *buf, size_t len, gfp_t gfp);
+ const u8 *buf, size_t len, u32 flags, gfp_t gfp);
/**
* cfg80211_mgmt_tx_status - notification of TX status for management frame
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 1f42bc3..fc1665e 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -1493,6 +1493,10 @@ enum nl80211_commands {
* @NL80211_ATTR_CSA_C_OFF_PRESP: Offset of the channel switch counter
* field in the probe response (%NL80211_ATTR_PROBE_RESP).
*
+ * @NL80211_ATTR_RXMGMT_FLAGS: flags for nl80211_send_mgmt(), u32.
+ * As specified in the enum nl80211_rxmgmt_flags.
+ * Passed from cfg80211_rx_mgmt()
+ *
* @NL80211_ATTR_MAX: highest attribute number currently defined
* @__NL80211_ATTR_AFTER_LAST: internal use
*/
@@ -1801,6 +1805,8 @@ enum nl80211_attrs {
NL80211_ATTR_CSA_C_OFF_BEACON,
NL80211_ATTR_CSA_C_OFF_PRESP,
+ NL80211_ATTR_RXMGMT_FLAGS,
+
/* add attributes here, update the policy in nl80211.c */
__NL80211_ATTR_AFTER_LAST,
@@ -3901,4 +3907,15 @@ enum nl80211_crit_proto_id {
/* maximum duration for critical protocol measures */
#define NL80211_CRIT_PROTO_MAX_DURATION 5000 /* msec */
+/**
+ * enum nl80211_rxmgmt_flags - flags for received management frame.
+ *
+ * Used by cfg80211_rx_mgmt()
+ *
+ * @NL80211_RXMGMT_FLAG_REPLIED: frame was replied by device/driver.
+ */
+enum nl80211_rxmgmt_flags {
+ NL80211_RXMGMT_FLAG_REPLIED = 1 << 0,
+};
+
#endif /* __LINUX_NL80211_H */
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 6b85f95..6698a34 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -2684,8 +2684,7 @@ ieee80211_rx_h_userspace_mgmt(struct ieee80211_rx_data *rx)
sig = status->signal;
if (cfg80211_rx_mgmt(&rx->sdata->wdev, status->freq, sig,
- rx->skb->data, rx->skb->len,
- GFP_ATOMIC)) {
+ rx->skb->data, rx->skb->len, 0, GFP_ATOMIC)) {
if (rx->sta)
rx->sta->rx_packets++;
dev_kfree_skb(rx->skb);
diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
index bfac5e1..8d49c1c 100644
--- a/net/wireless/mlme.c
+++ b/net/wireless/mlme.c
@@ -621,7 +621,7 @@ int cfg80211_mlme_mgmt_tx(struct cfg80211_registered_device *rdev,
}
bool cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, int sig_mbm,
- const u8 *buf, size_t len, gfp_t gfp)
+ const u8 *buf, size_t len, u32 flags, gfp_t gfp)
{
struct wiphy *wiphy = wdev->wiphy;
struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
@@ -664,7 +664,7 @@ bool cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, int sig_mbm,
/* Indicate the received Action frame to user space */
if (nl80211_send_mgmt(rdev, wdev, reg->nlportid,
freq, sig_mbm,
- buf, len, gfp))
+ buf, len, flags, gfp))
continue;
result = true;
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index adf1e98..8dbb289 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -10442,7 +10442,7 @@ EXPORT_SYMBOL(cfg80211_rx_unexpected_4addr_frame);
int nl80211_send_mgmt(struct cfg80211_registered_device *rdev,
struct wireless_dev *wdev, u32 nlportid,
int freq, int sig_dbm,
- const u8 *buf, size_t len, gfp_t gfp)
+ const u8 *buf, size_t len, u32 flags, gfp_t gfp)
{
struct net_device *netdev = wdev->netdev;
struct sk_buff *msg;
@@ -10465,7 +10465,9 @@ int nl80211_send_mgmt(struct cfg80211_registered_device *rdev,
nla_put_u32(msg, NL80211_ATTR_WIPHY_FREQ, freq) ||
(sig_dbm &&
nla_put_u32(msg, NL80211_ATTR_RX_SIGNAL_DBM, sig_dbm)) ||
- nla_put(msg, NL80211_ATTR_FRAME, len, buf))
+ nla_put(msg, NL80211_ATTR_FRAME, len, buf) ||
+ (flags &&
+ nla_put_u32(msg, NL80211_ATTR_RXMGMT_FLAGS, flags)))
goto nla_put_failure;
genlmsg_end(msg, hdr);
diff --git a/net/wireless/nl80211.h b/net/wireless/nl80211.h
index 44341bf..2c0f2b3 100644
--- a/net/wireless/nl80211.h
+++ b/net/wireless/nl80211.h
@@ -66,7 +66,7 @@ void nl80211_send_ibss_bssid(struct cfg80211_registered_device *rdev,
int nl80211_send_mgmt(struct cfg80211_registered_device *rdev,
struct wireless_dev *wdev, u32 nlpid,
int freq, int sig_dbm,
- const u8 *buf, size_t len, gfp_t gfp);
+ const u8 *buf, size_t len, u32 flags, gfp_t gfp);
void
nl80211_radar_notify(struct cfg80211_registered_device *rdev,
--
1.8.1.2
^ permalink raw reply related
* Re: [PATCH] mac80211: implement STA CSA for drivers using channel contexts
From: Johannes Berg @ 2013-08-15 12:03 UTC (permalink / raw)
To: Arik Nemtsov; +Cc: linux-wireless
In-Reply-To: <1376395438-24788-1-git-send-email-arik@wizery.com>
On Tue, 2013-08-13 at 15:03 +0300, Arik Nemtsov wrote:
> This isn't very well tested yet, but seems to work with a TI wl18xx card.
> The single-role/single-channel support is enough to pass the 11h certification.
:-)
> net/mac80211/cfg.c | 5 +++++
> net/mac80211/chan.c | 5 -----
> net/mac80211/mlme.c | 55 +++++++++++++++++++++++++++++++++++++++--------------
> 3 files changed, 46 insertions(+), 19 deletions(-)
>
> diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
> index 7aa38ce..beb1c2a 100644
> --- a/net/mac80211/cfg.c
> +++ b/net/mac80211/cfg.c
> @@ -2872,6 +2872,11 @@ void ieee80211_csa_finalize_work(struct work_struct *work)
> if (WARN_ON(err < 0))
> return;
>
> + if (!local->use_chanctx) {
> + local->_oper_chandef = local->csa_chandef;
> + ieee80211_hw_config(local, 0);
> + }
I don't really understand this part - I think you should add some
documentation or something?
> @@ -453,11 +453,6 @@ int ieee80211_vif_change_channel(struct ieee80211_sub_if_data *sdata,
> chanctx_changed |= IEEE80211_CHANCTX_CHANGE_CHANNEL;
> drv_change_chanctx(local, ctx, chanctx_changed);
>
> - if (!local->use_chanctx) {
> - local->_oper_chandef = *chandef;
> - ieee80211_hw_config(local, 0);
> - }
I really don't like it either - this was here so that no other code
really needed to be worried about non-chanctx drivers.
> @@ -1180,17 +1196,27 @@ ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata,
> }
>
> ifmgd->flags |= IEEE80211_STA_CSA_RECEIVED;
> + sdata->vif.csa_active = true;
I don't think we can just do this - this isn't going to result in good
behaviour for multi-vif drivers and in particular I'm pretty sure with
the MVM driver this would result in bad behaviour.
If you really want to do this I think it needs to be optional.
Also the documentation for the chanctx channel change probably needs to
be updated, etc.
johannes
^ permalink raw reply
* Re: [PATCH 1/3] ath10k: clean up HTT tx tid handling
From: Kalle Valo @ 2013-08-15 13:07 UTC (permalink / raw)
To: Michal Kazior; +Cc: ath10k, linux-wireless
In-Reply-To: <1376036014-29707-2-git-send-email-michal.kazior@tieto.com>
Michal Kazior <michal.kazior@tieto.com> writes:
> The tids weren't mapped really properly. This
> doesn't fix any known bug but seems the right
> thing to do.
>
> Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
[...]
> enum htt_data_tx_ext_tid {
> - HTT_DATA_TX_EXT_TID_NON_QOS_MCAST_BCAST = 16,
> - HTT_DATA_TX_EXT_TID_MGMT = 17,
> + HTT_DATA_TX_EXT_TID_NON_QOS_UNICAST = 16,
> + HTT_DATA_TX_EXT_TID_UNUSED = 17,
> + HTT_DATA_TX_EXT_TID_NON_QOS_MCAST_BCAST = 18,
> + HTT_DATA_TX_EXT_TID_MGMT = 19,
> HTT_DATA_TX_EXT_TID_INVALID = 31
> };
This doesn't seem to match what firmware uses. We need to investigate
more about this so I drop the patch for now.
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH 3/3] ath10k: add support for HTT 3.0
From: Kalle Valo @ 2013-08-15 13:10 UTC (permalink / raw)
To: Michal Kazior; +Cc: ath10k, linux-wireless
In-Reply-To: <1376036014-29707-4-git-send-email-michal.kazior@tieto.com>
Michal Kazior <michal.kazior@tieto.com> writes:
> New firmware comes with new HTT protocol version.
> In 3.0 the separate mgmt tx command has been
> removed. All traffic is to be pushed through data
> tx (tx_frm) command with a twist - FW seems to not
> be able (yet?) to access tx fragment table so for
> manamgement frames frame pointer is passed
> directly.
>
> Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Because I dropped patch 1 this patch had conflicts. I tried to be extra
careful, but please double check my conflict resolution.
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH 0/3] ath10k: firmware-related updates
From: Kalle Valo @ 2013-08-15 13:09 UTC (permalink / raw)
To: Michal Kazior; +Cc: ath10k, linux-wireless
In-Reply-To: <1376036014-29707-1-git-send-email-michal.kazior@tieto.com>
Michal Kazior <michal.kazior@tieto.com> writes:
> Hi,
>
> This patchset contains 2 firmware-related upgrades
> and 1 fix (that I though is a good pick to include
> here, since it's related with HTT tx).
>
> This keeps backward compatbility with old
> firmware.
>
> This includes fixes for issues pointed out during
> RFC review.
[...]
> Michal Kazior (3):
> ath10k: clean up HTT tx tid handling
I dropped this patch.
> ath10k: add support for firmware newer than 636
> ath10k: add support for HTT 3.0
These two are applied.
--
Kalle Valo
^ 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