* Re: hostap: Delete an unnecessary jump label in prism2_ioctl_priv_hostapd()
From: SF Markus Elfring @ 2016-09-26 16:03 UTC (permalink / raw)
To: Kalle Valo
Cc: linux-wireless, netdev, Jouni Malinen, LKML, kernel-janitors,
Julia Lawall
In-Reply-To: <20160926150656.213D961568@smtp.codeaurora.org>
> 9291771 [2/3] hostap: Delete an unnecessary jump label in prism2_ioctl_priv_hostapd()
> 9291775 [3/3] hostap: Delete unnecessary initialisations for the variable "ret"
>
> Reason: The benefit is not clear.
How do you think about to reduce the source code a bit at these places?
Regards,
Markus
^ permalink raw reply
* Re: [PATCH] staging: wilc1000: fix symbol 'WILC_DEBUG_LEVEL' was not declared.
From: Greg Kroah-Hartman @ 2016-09-26 15:52 UTC (permalink / raw)
To: Matias Mucciolo
Cc: devel, Aditya Shankar, linux-wireless, linux-kernel,
Ganesh Krishna
In-Reply-To: <4399555.QWNJt8EtNN@varitech>
On Mon, Sep 26, 2016 at 12:44:24PM -0300, Matias Mucciolo wrote:
>
> hi
>
> sorry...this is the full warning:
>
> drivers/staging/wilc1000/wilc_debugfs.c:32:10: warning: symbol 'WILC_DEBUG_LEVEL' was not declared. Should it be static?
the "should it be static" is the key here, right? Care to fix this up
and resend it?
thanks,
greg k-h
^ permalink raw reply
* Re: [PATCH 1/5] wlcore: Prepare family to fix nvs file handling
From: Kalle Valo @ 2016-09-26 15:47 UTC (permalink / raw)
To: Tony Lindgren
Cc: Eyal Reizer, Guy Mishol, Luca Coelho, Maital Hahn, Maxim Altshul,
Shahar Patury, linux-wireless, linux-omap
In-Reply-To: <20160917160633.8767-2-tony@atomide.com>
Tony Lindgren <tony@atomide.com> writes:
> Move struct wilink_family_data to be available for all TI WLAN
> variants. And fix familiy typo, it should be just family.
>
> Looks like wl12xx use two different nvs.bin files and wl18xx
> uses a different conf.bin file.
>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
Applied to wireless-drivers-next.git, thanks.
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH] staging: wilc1000: fix symbol 'WILC_DEBUG_LEVEL' was not declared.
From: Matias Mucciolo @ 2016-09-26 15:44 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Aditya Shankar, Ganesh Krishna, devel, linux-wireless,
linux-kernel
In-Reply-To: <20160926153733.GA1723@kroah.com>
hi
sorry...this is the full warning:
drivers/staging/wilc1000/wilc_debugfs.c:32:10: warning: symbol 'WILC_DEBUG_LEVEL' was not declared. Should it be static?
--
Matias Mucciolo
Area de Infraestructura.
Piedras 737 C.A.B.A
SUTEBA
On Monday 26 September 2016 17:37:33 Greg Kroah-Hartman wrote:
> On Mon, Sep 26, 2016 at 12:15:18PM -0300, Matias Mucciolo wrote:
> >
> > - Fixed a sparse warning: symbol 'WILC_DEBUG_LEVEL' was not declared.
>
> I don't think that was the full warning, as that does not make much
> sense to me, does it to you?
>
> thanks,
>
> greg k-h
^ permalink raw reply
* Re: [PATCH] staging: wilc1000: fix symbol 'WILC_DEBUG_LEVEL' was not declared.
From: Greg Kroah-Hartman @ 2016-09-26 15:37 UTC (permalink / raw)
To: Matias Mucciolo
Cc: Aditya Shankar, Ganesh Krishna, devel, linux-wireless,
linux-kernel
In-Reply-To: <34310025.aMSyYASYEz@varitech>
On Mon, Sep 26, 2016 at 12:15:18PM -0300, Matias Mucciolo wrote:
>
> - Fixed a sparse warning: symbol 'WILC_DEBUG_LEVEL' was not declared.
I don't think that was the full warning, as that does not make much
sense to me, does it to you?
thanks,
greg k-h
^ permalink raw reply
* [PATCH] staging: wilc1000: fix symbol 'WILC_DEBUG_LEVEL' was not declared.
From: Matias Mucciolo @ 2016-09-26 15:15 UTC (permalink / raw)
To: Aditya Shankar, Ganesh Krishna, Greg Kroah-Hartman
Cc: linux-wireless, devel, linux-kernel
- Fixed a sparse warning: symbol 'WILC_DEBUG_LEVEL' was not declared.
Signed-off-by: Matias Mucciolo <mmucciolo@suteba.org.ar>
---
drivers/staging/wilc1000/wilc_debugfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/wilc1000/wilc_debugfs.c b/drivers/staging/wilc1000/wilc_debugfs.c
index b052628..802bb1d 100644
--- a/drivers/staging/wilc1000/wilc_debugfs.c
+++ b/drivers/staging/wilc1000/wilc_debugfs.c
@@ -29,7 +29,7 @@ static struct dentry *wilc_dir;
#define ERR BIT(3)
#define DBG_LEVEL_ALL (DEBUG | INFO | WRN | ERR)
-atomic_t WILC_DEBUG_LEVEL = ATOMIC_INIT(ERR);
+static atomic_t WILC_DEBUG_LEVEL = ATOMIC_INIT(ERR);
EXPORT_SYMBOL_GPL(WILC_DEBUG_LEVEL);
/*
--
2.1.4
^ permalink raw reply related
* Re: [v3] mwifiex: cfg80211 set_default_mgmt_key handler
From: Kalle Valo @ 2016-09-26 15:21 UTC (permalink / raw)
To: Amitkumar Karwar; +Cc: linux-wireless, Ganapathi Bhat, Amitkumar Karwar
In-Reply-To: <1474377383-12600-1-git-send-email-akarwar@marvell.com>
Amitkumar Karwar <akarwar@marvell.com> wrote:
> From: Ganapathi Bhat <gbhat@marvell.com>
>
> Previously device used to start using IGTK key as Tx key as soon as it
> gets downloaded in add_key(). This patch implements set_default_mgmt_key
> handler. We will update Tx key ID in set_default_mgmt_key().
>
> Signed-off-by: Ganapathi Bhat <gbhat@marvell.com>
> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Patch applied to wireless-drivers-next.git, thanks.
89951db2be53 mwifiex: cfg80211 set_default_mgmt_key handler
--
https://patchwork.kernel.org/patch/9341673/
Documentation about submitting wireless patches and checking status
from patchwork:
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply
* Re: [PATCH v2 RESEND] qtnfmac: announcement of new FullMAC driver for Quantenna chipsets
From: IgorMitsyanko @ 2016-09-26 12:45 UTC (permalink / raw)
To: Kalle Valo
Cc: johannes, linux-wireless, Avinash Patil, Dmitrii Lebed,
Sergei Maksimenko, Sergey Matyukevich, Bindu Therthala,
Huizhao Wang, Kamlesh Rath
In-Reply-To: <87oa3byln4.fsf@kamboji.qca.qualcomm.com>
On 09/26/2016 01:56 PM, Kalle Valo wrote:
> IgorMitsyanko <igor.mitsyanko.os@quantenna.com> writes:
>
>> On 09/17/2016 04:46 PM, Kalle Valo wrote:
>>> <igor.mitsyanko.os@quantenna.com> writes:
>>>
>>>> +/* Supported rates to be advertised to the cfg80211 */
>>>> +static struct ieee80211_rate qtnf_rates[] = {
>>>> + {.bitrate = 10, .hw_value = 2, },
>>>> + {.bitrate = 20, .hw_value = 4, },
>>>> + {.bitrate = 55, .hw_value = 11, },
>>>> + {.bitrate = 110, .hw_value = 22, },
>>>> + {.bitrate = 60, .hw_value = 12, },
>>>> + {.bitrate = 90, .hw_value = 18, },
>>>> + {.bitrate = 120, .hw_value = 24, },
>>>> + {.bitrate = 180, .hw_value = 36, },
>>>> + {.bitrate = 240, .hw_value = 48, },
>>>> + {.bitrate = 360, .hw_value = 72, },
>>>> + {.bitrate = 480, .hw_value = 96, },
>>>> + {.bitrate = 540, .hw_value = 108, },
>>>> +};
>>>> +
>>>> +/* Channel definitions to be advertised to cfg80211 */
>>>> +static struct ieee80211_channel qtnf_channels_2ghz[] = {
>>>> + {.center_freq = 2412, .hw_value = 1, },
>>>> + {.center_freq = 2417, .hw_value = 2, },
>>>> + {.center_freq = 2422, .hw_value = 3, },
>>>> + {.center_freq = 2427, .hw_value = 4, },
>>>> + {.center_freq = 2432, .hw_value = 5, },
>>>> + {.center_freq = 2437, .hw_value = 6, },
>>>> + {.center_freq = 2442, .hw_value = 7, },
>>>> + {.center_freq = 2447, .hw_value = 8, },
>>>> + {.center_freq = 2452, .hw_value = 9, },
>>>> + {.center_freq = 2457, .hw_value = 10, },
>>>> + {.center_freq = 2462, .hw_value = 11, },
>>>> + {.center_freq = 2467, .hw_value = 12, },
>>>> + {.center_freq = 2472, .hw_value = 13, },
>>>> + {.center_freq = 2484, .hw_value = 14, },
>>>> +};
>>> I guess some of these static variables could be also const, but didn't
>>> check.
>> We did some changes to this code recently: will get bands info
>> (channel list, rates, capabilities etc) from wireless device itself,
>> it will be in next patch revision.
> For the initial submission please freeze the driver, otherwise it's pain
> to review as the driver changes too much in-between review rounds. So at
> this stage only minimal changes, please.
>
> You can continue adding new features and making changes, but do those as
> follow up patches and use the initial submission as the baseline for the
> new patches. Once the driver is applied you can submit the rest of the
> patches adding new features and they will be reviewed similarly like all
> other wireless patches.
Ok, we will keep patch modification to minimum between revisions, but
channels-related changes are something we would like to apply: we're
setting SELF_MANAGED bit right now and do not handle regulatory hints
from cfg80211, having all the regulatory-related info fixed on device
itself (region, per-channel Tx powers, DFS requirements). This info is
what was used to pass regulatory authorities certification, and
considering seriousness of regulatory compliance requirement it's
probably better to use the info that is known to be accepted.
Would it be acceptable if we keep rates/capabilities logic intact, but
will modify channel-related logic in next patch revision?
In a follow-up patches we're considering introducing closer and more
flexible integration with cfg80211 regulatory logic, allowing host
system itself to provide regulatory info. This will need further legal
consideration though: FCC and European commission seem to stricken rules
recently, maybe having region fixed on device is a more compliant solution.
>
>>>> +static int
>>>> +qtnf_event_handle_sta_assoc(struct qtnf_wmac *mac, struct qtnf_vif *vif,
>>>> + const struct qlink_event_sta_assoc *sta_assoc,
>>>> + u16 len)
>>>> +{
>>>> + const u8 *sta_addr;
>>>> + u16 frame_control;
>>>> + struct station_info sinfo = { 0 };
>>>> + size_t payload_len;
>>>> + u16 tlv_type;
>>>> + u16 tlv_value_len;
>>>> + size_t tlv_full_len;
>>>> + const struct qlink_tlv_hdr *tlv;
>>>> +
>>>> + if (unlikely(len < sizeof(*sta_assoc))) {
>>>> + pr_err("%s: payload is too short (%u < %zu)\n", __func__,
>>>> + len, sizeof(*sta_assoc));
>>>> + return -EINVAL;
>>>> + }
>>> I see unlikely() used a lot, I counted 145 times. Not a big issue but I
>>> don't see the point. In hot path I understand using it, but not
>>> everywhere.
>> Agree, but would you suggest that we remove the ones that we already
>> have but that are not really needed?
> Up to you really. This isn't important, just something I found a bit
> odd.
>
^ permalink raw reply
* Re: [2/3] hostap: Delete an unnecessary jump label in prism2_ioctl_priv_hostapd()
From: Kalle Valo @ 2016-09-26 15:06 UTC (permalink / raw)
To: SF Markus Elfring
Cc: linux-wireless, netdev, Jouni Malinen, LKML, kernel-janitors,
Julia Lawall
In-Reply-To: <65ed528f-7ec5-a0f2-6219-3e63a78ca0ee@users.sourceforge.net>
SF Markus Elfring <elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sat, 20 Aug 2016 18:21:29 +0200
>
> Remove a jump label which is unneeded in this function at the end.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
2 patches set to Rejected.
9291771 [2/3] hostap: Delete an unnecessary jump label in prism2_ioctl_priv_hostapd()
9291775 [3/3] hostap: Delete unnecessary initialisations for the variable "ret"
Reason: The benefit is not clear.
--
https://patchwork.kernel.org/patch/9291771/
Documentation about submitting wireless patches and checking status
from patchwork:
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply
* Re: [PATCH] brcmfmac: implement more accurate skb tracking
From: Dan Williams @ 2016-09-26 14:59 UTC (permalink / raw)
To: Rafał Miłecki, Arend Van Spriel
Cc: Kalle Valo, Franky Lin, Hante Meuleman, Pieter-Paul Giesberts,
Franky Lin, linux-wireless@vger.kernel.org,
open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER,
Network Development, Linux Kernel Mailing List,
Rafał Miłecki
In-Reply-To: <CACna6rwnLb3sEPmdx6uhYMstVn04WbP2xzznsjnwgguEXn04=w@mail.gmail.com>
On Mon, 2016-09-26 at 14:13 +0200, Rafał Miłecki wrote:
> On 26 September 2016 at 13:46, Arend Van Spriel
> <arend.vanspriel@broadcom.com> wrote:
> >
> > On 26-9-2016 12:23, Rafał Miłecki wrote:
> > >
> > > From: Rafał Miłecki <rafal@milecki.pl>
> > >
> > > We need to track 802.1x packets to know if there are any pending
> > > ones
> > > for transmission. This is required for performing key update in
> > > the
> > > firmware.
> >
> > The problem we are trying to solve is a pretty old one. The problem
> > is
> > that wpa_supplicant uses two separate code paths: EAPOL messaging
> > through data path and key configuration though nl80211.
>
> Can I find it described/reported somewhere?
If I understand the issue correctly, you can find all this in the
supplicant code. Once the supplicant has done whatever it wants to do
with the data frames that just happen to be EAPOL it then sends the
keys down to the driver with nl80211.
But it sounds like, instead of sniffing EAPOL frames in the driver skb
tracking and sniffing ETH_P_PAE, you should probably implement support
for NL80211_CMD_CRIT_PROTOCOL_START/NL80211_CMD_CRIT_PROTOCOL_STOP and
key off the passed-in NL80211_CRIT_PROTO_EAPOL. At least at the
beginning of connection setup only EAPOL packets will be allowed
anyway.
It doesn't seem like the supplicant uses NL80211_CRIT_PROTO_EAPOL yet,
but that should also be fixed in the supplicant itself. You should
probably get some comments from Jouni on how he'd like to see all this
work. But generally the less specific sniffing of frames in drivers,
likely the better.
Dan
>
> >
> > >
> > > Unfortunately our old tracking code wasn't very accurate. It was
> > > treating skb as pending as soon as it was passed by the netif.
> > > Actual
> > > handling packet to the firmware was happening later as brcmfmac
> > > internally queues them and uses its own worker(s).
> >
> > That does not seem right. As soon as we get a 1x packet we need to
> > wait
> > with key configuration regardless whether it is still in the driver
> > or
> > handed over to firmware already.
>
> OK, thanks.
^ permalink raw reply
* Re: [1/3] hostap: Use memdup_user() rather than duplicating its implementation
From: Kalle Valo @ 2016-09-26 14:19 UTC (permalink / raw)
To: SF Markus Elfring
Cc: linux-wireless, netdev, Jouni Malinen, LKML, kernel-janitors,
Julia Lawall
In-Reply-To: <efa66c16-7998-9ceb-0be6-d62dd249a2dc@users.sourceforge.net>
SF Markus Elfring <elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sat, 20 Aug 2016 18:19:43 +0200
>
> Reuse existing functionality from memdup_user() instead of keeping
> duplicate source code.
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Patch set to Rejected.
[1/3] hostap: Use memdup_user() rather than duplicating i... 2016-08-20 SF Markus El Rejected
Reason: A similar patch is already applied.
Applying: hostap: Use memdup_user() rather than duplicating its implementation
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
Auto-merging drivers/net/wireless/intersil/hostap/hostap_ioctl.c
CONFLICT (content): Merge conflict in drivers/net/wireless/intersil/hostap/hostap_ioctl.c
Failed to merge in the changes.
Patch failed at 0001 hostap: Use memdup_user() rather than duplicating its implementation
--
https://patchwork.kernel.org/patch/9306999/
Documentation about submitting wireless patches and checking status
from patchwork:
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply
* Re: wil6200
From: Lior David @ 2016-09-26 12:49 UTC (permalink / raw)
To: Vikram, linux-wireless
In-Reply-To: <CALZLQ=biEM2efkYhkr6PYu7wn_CJTJ9LQg+0VJvf2rMgmKPS9w@mail.gmail.com>
On 9/25/2016 6:15 PM, Vikram wrote:
> Hi,
>
> Could you please let me know as to how to change the mode of wil6200
> chip from WBE to WiFi?
>
> Regards,
> Vikram
>
What is the exact device you are using? Older devices have firmware that only
supports WBE mode.
Thanks,
Lior
^ permalink raw reply
* Re: [PATCH] brcmfmac: implement more accurate skb tracking
From: Rafał Miłecki @ 2016-09-26 12:38 UTC (permalink / raw)
To: Arend Van Spriel
Cc: Kalle Valo, Franky Lin, Hante Meuleman, Pieter-Paul Giesberts,
Franky Lin, linux-wireless@vger.kernel.org,
open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER,
Network Development, Linux Kernel Mailing List,
Rafał Miłecki
In-Reply-To: <CACna6rwnLb3sEPmdx6uhYMstVn04WbP2xzznsjnwgguEXn04=w@mail.gmail.com>
On 26 September 2016 at 14:13, Rafa=C5=82 Mi=C5=82ecki <zajec5@gmail.com> w=
rote:
> On 26 September 2016 at 13:46, Arend Van Spriel
> <arend.vanspriel@broadcom.com> wrote:
>> On 26-9-2016 12:23, Rafa=C5=82 Mi=C5=82ecki wrote:
>>> From: Rafa=C5=82 Mi=C5=82ecki <rafal@milecki.pl>
>>>
>>> We need to track 802.1x packets to know if there are any pending ones
>>> for transmission. This is required for performing key update in the
>>> firmware.
>>
>> The problem we are trying to solve is a pretty old one. The problem is
>> that wpa_supplicant uses two separate code paths: EAPOL messaging
>> through data path and key configuration though nl80211.
>
> Can I find it described/reported somewhere?
>
>
>>> Unfortunately our old tracking code wasn't very accurate. It was
>>> treating skb as pending as soon as it was passed by the netif. Actual
>>> handling packet to the firmware was happening later as brcmfmac
>>> internally queues them and uses its own worker(s).
>>
>> That does not seem right. As soon as we get a 1x packet we need to wait
>> with key configuration regardless whether it is still in the driver or
>> handed over to firmware already.
>
> OK, thanks.
Actually, it's not OK. I was trying to report/describe/discuss this
problem for over a week. I couldn't get much of answer from you.
I had to come with a patch I worked on for quite some time. Only then
you decided to react and reply with a reason for a nack. I see this
patch may be wrong (but it's still hard to know what's going wrong
without a proper hostapd bug report). I'd expect you to somehow work &
communicate with open source community.
--=20
Rafa=C5=82
^ permalink raw reply
* Re: [PATCH] brcmfmac: implement more accurate skb tracking
From: Arend Van Spriel @ 2016-09-26 12:20 UTC (permalink / raw)
To: Rafał Miłecki
Cc: Kalle Valo, Franky Lin, Hante Meuleman, Pieter-Paul Giesberts,
Franky Lin, linux-wireless@vger.kernel.org,
open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER,
Network Development, Linux Kernel Mailing List,
Rafał Miłecki
In-Reply-To: <CACna6rwnLb3sEPmdx6uhYMstVn04WbP2xzznsjnwgguEXn04=w@mail.gmail.com>
On 26-9-2016 14:13, Rafał Miłecki wrote:
> On 26 September 2016 at 13:46, Arend Van Spriel
> <arend.vanspriel@broadcom.com> wrote:
>> On 26-9-2016 12:23, Rafał Miłecki wrote:
>>> From: Rafał Miłecki <rafal@milecki.pl>
>>>
>>> We need to track 802.1x packets to know if there are any pending ones
>>> for transmission. This is required for performing key update in the
>>> firmware.
>>
>> The problem we are trying to solve is a pretty old one. The problem is
>> that wpa_supplicant uses two separate code paths: EAPOL messaging
>> through data path and key configuration though nl80211.
>
> Can I find it described/reported somewhere?
Not sure. It is something that I recall from working at Intersil so back
in the prism days.
Regards,
Arend
>>> Unfortunately our old tracking code wasn't very accurate. It was
>>> treating skb as pending as soon as it was passed by the netif. Actual
>>> handling packet to the firmware was happening later as brcmfmac
>>> internally queues them and uses its own worker(s).
>>
>> That does not seem right. As soon as we get a 1x packet we need to wait
>> with key configuration regardless whether it is still in the driver or
>> handed over to firmware already.
>
> OK, thanks.
>
^ permalink raw reply
* Re: [PATCH] brcmfmac: implement more accurate skb tracking
From: Rafał Miłecki @ 2016-09-26 12:13 UTC (permalink / raw)
To: Arend Van Spriel
Cc: Kalle Valo, Franky Lin, Hante Meuleman, Pieter-Paul Giesberts,
Franky Lin, linux-wireless@vger.kernel.org,
open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER,
Network Development, Linux Kernel Mailing List,
Rafał Miłecki
In-Reply-To: <09084e8b-829d-9a13-ae16-a493438216ac@broadcom.com>
On 26 September 2016 at 13:46, Arend Van Spriel
<arend.vanspriel@broadcom.com> wrote:
> On 26-9-2016 12:23, Rafa=C5=82 Mi=C5=82ecki wrote:
>> From: Rafa=C5=82 Mi=C5=82ecki <rafal@milecki.pl>
>>
>> We need to track 802.1x packets to know if there are any pending ones
>> for transmission. This is required for performing key update in the
>> firmware.
>
> The problem we are trying to solve is a pretty old one. The problem is
> that wpa_supplicant uses two separate code paths: EAPOL messaging
> through data path and key configuration though nl80211.
Can I find it described/reported somewhere?
>> Unfortunately our old tracking code wasn't very accurate. It was
>> treating skb as pending as soon as it was passed by the netif. Actual
>> handling packet to the firmware was happening later as brcmfmac
>> internally queues them and uses its own worker(s).
>
> That does not seem right. As soon as we get a 1x packet we need to wait
> with key configuration regardless whether it is still in the driver or
> handed over to firmware already.
OK, thanks.
^ permalink raw reply
* Re: [PATCH] brcmfmac: implement more accurate skb tracking
From: Arend Van Spriel @ 2016-09-26 11:46 UTC (permalink / raw)
To: Rafał Miłecki, Kalle Valo
Cc: Franky Lin, Hante Meuleman, Pieter-Paul Giesberts, Franky Lin,
linux-wireless, brcm80211-dev-list.pdl, netdev, linux-kernel,
Rafał Miłecki
In-Reply-To: <20160926102348.8695-1-zajec5@gmail.com>
On 26-9-2016 12:23, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
>
> We need to track 802.1x packets to know if there are any pending ones
> for transmission. This is required for performing key update in the
> firmware.
The problem we are trying to solve is a pretty old one. The problem is
that wpa_supplicant uses two separate code paths: EAPOL messaging
through data path and key configuration though nl80211.
> Unfortunately our old tracking code wasn't very accurate. It was
> treating skb as pending as soon as it was passed by the netif. Actual
> handling packet to the firmware was happening later as brcmfmac
> internally queues them and uses its own worker(s).
That does not seem right. As soon as we get a 1x packet we need to wait
with key configuration regardless whether it is still in the driver or
handed over to firmware already.
Regards,
Arend
> Other than that it was hard to handle freeing packets. Everytime we had
> to determine (in more generic funcions) if packet was counted as pending
> 802.1x one or not. It was causing some problems, e.g. it wasn't clear if
> brcmf_flowring_delete should free skb directly or not.
>
> This patch introduces 2 separated functions for tracking skbs. This
> simplifies logic, fixes brcmf_flowring_delete (maybe other hidden bugs
> as well) and allows further simplifications. Thanks to better accuracy
> is also increases time window for key update (and lowers timeout risk).
>
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> ---
> This was successfully tested with 4366b1. Can someone give it a try with
> some USB/SDIO device, please?
> ---
> .../wireless/broadcom/brcm80211/brcmfmac/bcdc.c | 11 +++++++
> .../wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 12 +++++++-
> .../wireless/broadcom/brcm80211/brcmfmac/core.c | 36 ++++++++++++++++------
> .../wireless/broadcom/brcm80211/brcmfmac/core.h | 2 ++
> .../wireless/broadcom/brcm80211/brcmfmac/msgbuf.c | 14 +++++++--
> .../wireless/broadcom/brcm80211/brcmfmac/proto.h | 11 +++++++
> .../wireless/broadcom/brcm80211/brcmfmac/sdio.c | 8 +++++
> .../net/wireless/broadcom/brcm80211/brcmfmac/usb.c | 10 ++++++
> 8 files changed, 91 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c
> index d1bc51f..3e40244 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c
> @@ -326,6 +326,16 @@ brcmf_proto_bcdc_hdrpull(struct brcmf_pub *drvr, bool do_fws,
> return 0;
> }
>
> +static int brcmf_proto_bcdc_hdr_get_ifidx(struct brcmf_pub *drvr,
> + struct sk_buff *skb)
> +{
> + struct brcmf_proto_bcdc_header *h;
> +
> + h = (struct brcmf_proto_bcdc_header *)(skb->data);
> +
> + return BCDC_GET_IF_IDX(h);
> +}
> +
> static int
> brcmf_proto_bcdc_txdata(struct brcmf_pub *drvr, int ifidx, u8 offset,
> struct sk_buff *pktbuf)
> @@ -373,6 +383,7 @@ int brcmf_proto_bcdc_attach(struct brcmf_pub *drvr)
> }
>
> drvr->proto->hdrpull = brcmf_proto_bcdc_hdrpull;
> + drvr->proto->hdr_get_ifidx = brcmf_proto_bcdc_hdr_get_ifidx;
> drvr->proto->query_dcmd = brcmf_proto_bcdc_query_dcmd;
> drvr->proto->set_dcmd = brcmf_proto_bcdc_set_dcmd;
> drvr->proto->txdata = brcmf_proto_bcdc_txdata;
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
> index 03404cb..fef9d02 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
> @@ -43,6 +43,7 @@
> #include "chip.h"
> #include "bus.h"
> #include "debug.h"
> +#include "proto.h"
> #include "sdio.h"
> #include "core.h"
> #include "common.h"
> @@ -772,6 +773,7 @@ int brcmf_sdiod_send_buf(struct brcmf_sdio_dev *sdiodev, u8 *buf, uint nbytes)
> int brcmf_sdiod_send_pkt(struct brcmf_sdio_dev *sdiodev,
> struct sk_buff_head *pktq)
> {
> + struct brcmf_pub *pub = sdiodev->bus_if->drvr;
> struct sk_buff *skb;
> u32 addr = sdiodev->sbwad;
> int err;
> @@ -784,10 +786,18 @@ int brcmf_sdiod_send_pkt(struct brcmf_sdio_dev *sdiodev,
>
> if (pktq->qlen == 1 || !sdiodev->sg_support)
> skb_queue_walk(pktq, skb) {
> + struct brcmf_if *ifp;
> + int ifidx;
> +
> + ifidx = brcmf_proto_hdr_get_ifidx(pub, skb);
> + ifp = brcmf_get_ifp(pub, ifidx);
> + brcmf_tx_passing_skb(ifp, skb);
> err = brcmf_sdiod_buffrw(sdiodev, SDIO_FUNC_2, true,
> addr, skb);
> - if (err)
> + if (err) {
> + brcmf_tx_regained_skb(ifp, skb);
> break;
> + }
> }
> else
> err = brcmf_sdiod_sglist_rw(sdiodev, SDIO_FUNC_2, true, addr,
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
> index bc3d8ab..7cdc1f6 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
> @@ -247,9 +247,6 @@ static netdev_tx_t brcmf_netdev_start_xmit(struct sk_buff *skb,
> goto done;
> }
>
> - if (eh->h_proto == htons(ETH_P_PAE))
> - atomic_inc(&ifp->pend_8021x_cnt);
> -
> /* determine the priority */
> if (skb->priority == 0 || skb->priority > 7)
> skb->priority = cfg80211_classify8021d(skb, NULL);
> @@ -388,20 +385,41 @@ void brcmf_rx_event(struct device *dev, struct sk_buff *skb)
> brcmu_pkt_buf_free_skb(skb);
> }
>
> -void brcmf_txfinalize(struct brcmf_if *ifp, struct sk_buff *txp, bool success)
> +/**
> + * brcmf_tx_passing_skb - Let core know skb is being passed to the firmware
> + *
> + * Core code needs to track state of some skbs. This function should be called
> + * every time skb is going to be passed to the firmware for transmitting.
> + */
> +void brcmf_tx_passing_skb(struct brcmf_if *ifp, struct sk_buff *skb)
> {
> - struct ethhdr *eh;
> - u16 type;
> + struct ethhdr *eh = (struct ethhdr *)(skb->data);
>
> - eh = (struct ethhdr *)(txp->data);
> - type = ntohs(eh->h_proto);
> + if (eh->h_proto == htons(ETH_P_PAE))
> + atomic_inc(&ifp->pend_8021x_cnt);
> +}
>
> - if (type == ETH_P_PAE) {
> +/**
> + * brcmf_tx_regained_skb - Let core know skb is not being fw processed anymore
> + *
> + * This function should be called every time skb is returned from the firmware
> + * processing for whatever reason. It usually happens after successful
> + * transmission but may be also due to some error.
> + */
> +void brcmf_tx_regained_skb(struct brcmf_if *ifp, struct sk_buff *skb)
> +{
> + struct ethhdr *eh = (struct ethhdr *)(skb->data);
> +
> + if (eh->h_proto == htons(ETH_P_PAE)) {
> atomic_dec(&ifp->pend_8021x_cnt);
> +
> if (waitqueue_active(&ifp->pend_8021x_wait))
> wake_up(&ifp->pend_8021x_wait);
> }
> +}
>
> +void brcmf_txfinalize(struct brcmf_if *ifp, struct sk_buff *txp, bool success)
> +{
> if (!success)
> ifp->stats.tx_errors++;
>
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h
> index f16cfc9..80478b5 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h
> @@ -215,6 +215,8 @@ struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, s32 bsscfgidx, s32 ifidx,
> void brcmf_remove_interface(struct brcmf_if *ifp, bool rtnl_locked);
> void brcmf_txflowblock_if(struct brcmf_if *ifp,
> enum brcmf_netif_stop_reason reason, bool state);
> +void brcmf_tx_passing_skb(struct brcmf_if *ifp, struct sk_buff *skb);
> +void brcmf_tx_regained_skb(struct brcmf_if *ifp, struct sk_buff *skb);
> void brcmf_txfinalize(struct brcmf_if *ifp, struct sk_buff *txp, bool success);
> void brcmf_netif_rx(struct brcmf_if *ifp, struct sk_buff *skb);
> void brcmf_net_setcarrier(struct brcmf_if *ifp, bool on);
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
> index 2b9a2bc..2a25eea 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
> @@ -701,17 +701,22 @@ static void brcmf_msgbuf_txflow(struct brcmf_msgbuf *msgbuf, u16 flowid)
>
> count = BRCMF_MSGBUF_TX_FLUSH_CNT2 - BRCMF_MSGBUF_TX_FLUSH_CNT1;
> while (brcmf_flowring_qlen(flow, flowid)) {
> + u8 ifidx = brcmf_flowring_ifidx_get(flow, flowid);
> + struct brcmf_if *ifp = brcmf_get_ifp(msgbuf->drvr, ifidx);
> +
> skb = brcmf_flowring_dequeue(flow, flowid);
> if (skb == NULL) {
> brcmf_err("No SKB, but qlen %d\n",
> brcmf_flowring_qlen(flow, flowid));
> break;
> }
> + brcmf_tx_passing_skb(ifp, skb);
> skb_orphan(skb);
> if (brcmf_msgbuf_alloc_pktid(msgbuf->drvr->bus_if->dev,
> msgbuf->tx_pktids, skb, ETH_HLEN,
> &physaddr, &pktid)) {
> brcmf_flowring_reinsert(flow, flowid, skb);
> + brcmf_tx_regained_skb(ifp, skb);
> brcmf_err("No PKTID available !!\n");
> break;
> }
> @@ -720,6 +725,7 @@ static void brcmf_msgbuf_txflow(struct brcmf_msgbuf *msgbuf, u16 flowid)
> brcmf_msgbuf_get_pktid(msgbuf->drvr->bus_if->dev,
> msgbuf->tx_pktids, pktid);
> brcmf_flowring_reinsert(flow, flowid, skb);
> + brcmf_tx_regained_skb(ifp, skb);
> break;
> }
> count++;
> @@ -728,7 +734,7 @@ static void brcmf_msgbuf_txflow(struct brcmf_msgbuf *msgbuf, u16 flowid)
>
> tx_msghdr->msg.msgtype = MSGBUF_TYPE_TX_POST;
> tx_msghdr->msg.request_id = cpu_to_le32(pktid);
> - tx_msghdr->msg.ifidx = brcmf_flowring_ifidx_get(flow, flowid);
> + tx_msghdr->msg.ifidx = ifidx;
> tx_msghdr->flags = BRCMF_MSGBUF_PKT_FLAGS_FRAME_802_3;
> tx_msghdr->flags |= (skb->priority & 0x07) <<
> BRCMF_MSGBUF_PKT_FLAGS_PRIO_SHIFT;
> @@ -857,6 +863,7 @@ brcmf_msgbuf_process_ioctl_complete(struct brcmf_msgbuf *msgbuf, void *buf)
> static void
> brcmf_msgbuf_process_txstatus(struct brcmf_msgbuf *msgbuf, void *buf)
> {
> + struct brcmf_if *ifp;
> struct brcmf_commonring *commonring;
> struct msgbuf_tx_status *tx_status;
> u32 idx;
> @@ -876,8 +883,9 @@ brcmf_msgbuf_process_txstatus(struct brcmf_msgbuf *msgbuf, void *buf)
> commonring = msgbuf->flowrings[flowid];
> atomic_dec(&commonring->outstanding_tx);
>
> - brcmf_txfinalize(brcmf_get_ifp(msgbuf->drvr, tx_status->msg.ifidx),
> - skb, true);
> + ifp = brcmf_get_ifp(msgbuf->drvr, tx_status->msg.ifidx);
> + brcmf_tx_regained_skb(ifp, skb);
> + brcmf_txfinalize(ifp, skb, true);
> }
>
>
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.h
> index 57531f4..453cc5a 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.h
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.h
> @@ -16,6 +16,7 @@
> #ifndef BRCMFMAC_PROTO_H
> #define BRCMFMAC_PROTO_H
>
> +#include "core.h"
>
> enum proto_addr_mode {
> ADDR_INDIRECT = 0,
> @@ -29,6 +30,7 @@ struct brcmf_skb_reorder_data {
> struct brcmf_proto {
> int (*hdrpull)(struct brcmf_pub *drvr, bool do_fws,
> struct sk_buff *skb, struct brcmf_if **ifp);
> + int (*hdr_get_ifidx)(struct brcmf_pub *drvr, struct sk_buff *skb);
> int (*query_dcmd)(struct brcmf_pub *drvr, int ifidx, uint cmd,
> void *buf, uint len);
> int (*set_dcmd)(struct brcmf_pub *drvr, int ifidx, uint cmd, void *buf,
> @@ -64,6 +66,15 @@ static inline int brcmf_proto_hdrpull(struct brcmf_pub *drvr, bool do_fws,
> ifp = &tmp;
> return drvr->proto->hdrpull(drvr, do_fws, skb, ifp);
> }
> +
> +static inline int brcmf_proto_hdr_get_ifidx(struct brcmf_pub *drvr,
> + struct sk_buff *skb)
> +{
> + if (!drvr->proto->hdr_get_ifidx)
> + return -ENOTSUPP;
> + return drvr->proto->hdr_get_ifidx(drvr, skb);
> +}
> +
> static inline int brcmf_proto_query_dcmd(struct brcmf_pub *drvr, int ifidx,
> uint cmd, void *buf, uint len)
> {
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
> index b892dac..4dc96bd 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
> @@ -42,6 +42,7 @@
> #include "sdio.h"
> #include "chip.h"
> #include "firmware.h"
> +#include "proto.h"
> #include "core.h"
> #include "common.h"
>
> @@ -2240,6 +2241,7 @@ brcmf_sdio_txpkt_postp(struct brcmf_sdio *bus, struct sk_buff_head *pktq)
> static int brcmf_sdio_txpkt(struct brcmf_sdio *bus, struct sk_buff_head *pktq,
> uint chan)
> {
> + struct brcmf_pub *pub = bus->sdiodev->bus_if->drvr;
> int ret;
> struct sk_buff *pkt_next, *tmp;
>
> @@ -2263,7 +2265,13 @@ done:
> if (ret == 0)
> bus->tx_seq = (bus->tx_seq + pktq->qlen) % SDPCM_SEQ_WRAP;
> skb_queue_walk_safe(pktq, pkt_next, tmp) {
> + struct brcmf_if *ifp;
> + int ifidx;
> +
> __skb_unlink(pkt_next, pktq);
> + ifidx = brcmf_proto_hdr_get_ifidx(pub, pkt_next);
> + ifp = brcmf_get_ifp(pub, ifidx);
> + brcmf_tx_regained_skb(ifp, pkt_next);
> brcmf_txcomplete(bus->sdiodev->dev, pkt_next, ret == 0);
> }
> return ret;
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
> index 2f978a3..d2f81c7 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
> @@ -26,6 +26,7 @@
> #include "bus.h"
> #include "debug.h"
> #include "firmware.h"
> +#include "proto.h"
> #include "usb.h"
> #include "core.h"
> #include "common.h"
> @@ -476,12 +477,16 @@ static void brcmf_usb_tx_complete(struct urb *urb)
> {
> struct brcmf_usbreq *req = (struct brcmf_usbreq *)urb->context;
> struct brcmf_usbdev_info *devinfo = req->devinfo;
> + struct brcmf_pub *pub = devinfo->bus_pub.bus->drvr;
> + struct brcmf_if *ifp;
> unsigned long flags;
>
> brcmf_dbg(USB, "Enter, urb->status=%d, skb=%p\n", urb->status,
> req->skb);
> brcmf_usb_del_fromq(devinfo, req);
>
> + ifp = brcmf_get_ifp(pub, brcmf_proto_hdr_get_ifidx(pub, req->skb));
> + brcmf_tx_regained_skb(ifp, req->skb);
> brcmf_txcomplete(devinfo->dev, req->skb, urb->status == 0);
> req->skb = NULL;
> brcmf_usb_enq(devinfo, &devinfo->tx_freeq, req, &devinfo->tx_freecount);
> @@ -598,7 +603,9 @@ brcmf_usb_state_change(struct brcmf_usbdev_info *devinfo, int state)
> static int brcmf_usb_tx(struct device *dev, struct sk_buff *skb)
> {
> struct brcmf_usbdev_info *devinfo = brcmf_usb_get_businfo(dev);
> + struct brcmf_pub *pub = devinfo->bus_pub.bus->drvr;
> struct brcmf_usbreq *req;
> + struct brcmf_if *ifp;
> int ret;
> unsigned long flags;
>
> @@ -622,6 +629,8 @@ static int brcmf_usb_tx(struct device *dev, struct sk_buff *skb)
> skb->data, skb->len, brcmf_usb_tx_complete, req);
> req->urb->transfer_flags |= URB_ZERO_PACKET;
> brcmf_usb_enq(devinfo, &devinfo->tx_postq, req, NULL);
> + ifp = brcmf_get_ifp(pub, brcmf_proto_hdr_get_ifidx(pub, skb));
> + brcmf_tx_passing_skb(ifp, skb);
> ret = usb_submit_urb(req->urb, GFP_ATOMIC);
> if (ret) {
> brcmf_err("brcmf_usb_tx usb_submit_urb FAILED\n");
> @@ -629,6 +638,7 @@ static int brcmf_usb_tx(struct device *dev, struct sk_buff *skb)
> req->skb = NULL;
> brcmf_usb_enq(devinfo, &devinfo->tx_freeq, req,
> &devinfo->tx_freecount);
> + brcmf_tx_regained_skb(ifp, skb);
> goto fail;
> }
>
>
^ permalink raw reply
* Re: [PATCH 1/2] brcmfmac: initialize fws(ignal) for BCDC protocol only
From: Arend Van Spriel @ 2016-09-26 11:28 UTC (permalink / raw)
To: Rafał Miłecki, Kalle Valo
Cc: Franky Lin, Hante Meuleman, Pieter-Paul Giesberts, Franky Lin,
linux-wireless, brcm80211-dev-list.pdl, netdev, linux-kernel,
Rafał Miłecki
In-Reply-To: <20160924204419.10213-1-zajec5@gmail.com>
On 24-9-2016 22:44, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
>
> There are two protocols used by Broadcom FullMAC devices: BCDC and
> msgbuf. They use different ways for (some part of) communication with
> the firmware. Firmware Signaling is required for the first one only
> (BCDC).
>
> So far we were always initializing fws and always calling it's skb
> processing function. It was fws that was passing skb processing to the
> protocol specific function. It was redundant for the msgbuf case.
>
> Simply taking few lines of code out of fws allows us to totally avoid
> using it. This simplifies code flow, saves some memory & will allow
> further optimizations like not compiling fwsignal.c.
Hi Rafał,
Conceptually fwsignal is part of BCDC so you are indeed right when
saying it is not needed for msgbuf. The signalling is actually part of
the BCDC message overhead so I would rather see fwsignal only being used
in BCDC code. Could try and do that on top of this patch, but I would
prefer dropping these patches.
Regards,
Arend
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> ---
> .../wireless/broadcom/brcm80211/brcmfmac/core.c | 24 ++++++++++++++++------
> .../broadcom/brcm80211/brcmfmac/fwsignal.c | 17 ++++++---------
> .../broadcom/brcm80211/brcmfmac/fwsignal.h | 1 +
> 3 files changed, 25 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
> index 27cd50a..bc3d8ab 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
> @@ -250,7 +250,17 @@ static netdev_tx_t brcmf_netdev_start_xmit(struct sk_buff *skb,
> if (eh->h_proto == htons(ETH_P_PAE))
> atomic_inc(&ifp->pend_8021x_cnt);
>
> - ret = brcmf_fws_process_skb(ifp, skb);
> + /* determine the priority */
> + if (skb->priority == 0 || skb->priority > 7)
> + skb->priority = cfg80211_classify8021d(skb, NULL);
> +
> + if (drvr->fws && brcmf_fws_skbs_queueing(drvr->fws)) {
> + ret = brcmf_fws_process_skb(ifp, skb);
> + } else {
> + ret = brcmf_proto_txdata(drvr, ifp->ifidx, 0, skb);
> + if (ret < 0)
> + brcmf_txfinalize(ifp, skb, false);
> + }
>
> done:
> if (ret) {
> @@ -405,7 +415,7 @@ void brcmf_txcomplete(struct device *dev, struct sk_buff *txp, bool success)
> struct brcmf_if *ifp;
>
> /* await txstatus signal for firmware if active */
> - if (brcmf_fws_fc_active(drvr->fws)) {
> + if (drvr->fws && brcmf_fws_fc_active(drvr->fws)) {
> if (!success)
> brcmf_fws_bustxfail(drvr->fws, txp);
> } else {
> @@ -1006,11 +1016,13 @@ int brcmf_bus_start(struct device *dev)
> }
> brcmf_feat_attach(drvr);
>
> - ret = brcmf_fws_init(drvr);
> - if (ret < 0)
> - goto fail;
> + if (bus_if->proto_type == BRCMF_PROTO_BCDC) {
> + ret = brcmf_fws_init(drvr);
> + if (ret < 0)
> + goto fail;
>
> - brcmf_fws_add_interface(ifp);
> + brcmf_fws_add_interface(ifp);
> + }
>
> drvr->config = brcmf_cfg80211_attach(drvr, bus_if->dev,
> drvr->settings->p2p_enable);
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c
> index a190f53..495eaf8 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c
> @@ -2100,16 +2100,6 @@ int brcmf_fws_process_skb(struct brcmf_if *ifp, struct sk_buff *skb)
> int rc = 0;
>
> brcmf_dbg(DATA, "tx proto=0x%X\n", ntohs(eh->h_proto));
> - /* determine the priority */
> - if ((skb->priority == 0) || (skb->priority > 7))
> - skb->priority = cfg80211_classify8021d(skb, NULL);
> -
> - if (fws->avoid_queueing) {
> - rc = brcmf_proto_txdata(drvr, ifp->ifidx, 0, skb);
> - if (rc < 0)
> - brcmf_txfinalize(ifp, skb, false);
> - return rc;
> - }
>
> /* set control buffer information */
> skcb->if_flags = 0;
> @@ -2155,7 +2145,7 @@ void brcmf_fws_add_interface(struct brcmf_if *ifp)
> struct brcmf_fws_info *fws = ifp->drvr->fws;
> struct brcmf_fws_mac_descriptor *entry;
>
> - if (!ifp->ndev)
> + if (!fws || !ifp->ndev)
> return;
>
> entry = &fws->desc.iface[ifp->ifidx];
> @@ -2442,6 +2432,11 @@ void brcmf_fws_deinit(struct brcmf_pub *drvr)
> kfree(fws);
> }
>
> +bool brcmf_fws_skbs_queueing(struct brcmf_fws_info *fws)
> +{
> + return !fws->avoid_queueing;
> +}
> +
> bool brcmf_fws_fc_active(struct brcmf_fws_info *fws)
> {
> if (!fws->creditmap_received)
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.h
> index ef0ad85..8f7c1d7 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.h
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.h
> @@ -20,6 +20,7 @@
>
> int brcmf_fws_init(struct brcmf_pub *drvr);
> void brcmf_fws_deinit(struct brcmf_pub *drvr);
> +bool brcmf_fws_skbs_queueing(struct brcmf_fws_info *fws);
> bool brcmf_fws_fc_active(struct brcmf_fws_info *fws);
> void brcmf_fws_hdrpull(struct brcmf_if *ifp, s16 siglen, struct sk_buff *skb);
> int brcmf_fws_process_skb(struct brcmf_if *ifp, struct sk_buff *skb);
>
^ permalink raw reply
* Re: [2/2] mwifiex: fix unaligned read in mwifiex_config_scan()
From: Kalle Valo @ 2016-09-26 11:19 UTC (permalink / raw)
To: Petri Gynther; +Cc: linux-wireless, davem, joe, akarwar, Petri Gynther
In-Reply-To: <1471057200-58166-2-git-send-email-pgynther@google.com>
Petri Gynther <pgynther@google.com> wrote:
> $ iwconfig mlan0 essid MySSID
> [ 36.930000] Path: /sbin/iwconfig
> [ 36.930000] CPU: 0 PID: 203 Comm: iwconfig Not tainted 4.7.0 #2
> [ 36.940000] task: 866f83a0 ti: 866a6000 task.ti: 866a6000
> [ 36.940000]
> [ECR ]: 0x00230400 => Misaligned r/w from 0x8677f403
> [ 36.960000] [EFA ]: 0x8677f403
> [ 36.960000] [BLINK ]: mwifiex_scan_networks+0x17a/0x198c [mwifiex]
> [ 36.960000] [ERET ]: mwifiex_scan_networks+0x18a/0x198c [mwifiex]
> [ 36.980000] [STAT32]: 0x00000206 : K E2 E1
> [ 36.980000] BTA: 0x700736e2 SP: 0x866a7d0c FP: 0x5faddc84
> [ 37.000000] LPS: 0x806a37ec LPE: 0x806a37fa LPC: 0x00000000
> [ 37.000000] r00: 0x8677f401 r01: 0x8668aa08 r02: 0x00000001
> r03: 0x00000000 r04: 0x8668b600 r05: 0x8677f406
> r06: 0x8702b600 r07: 0x00000000 r08: 0x8702b600
> r09: 0x00000000 r10: 0x870b3b00 r11: 0x00000000
> r12: 0x00000000
> [ 37.040000]
> [ 37.040000] Stack Trace:
> [ 37.040000] mwifiex_scan_networks+0x18a/0x198c [mwifiex]
>
> Root cause:
> mwifiex driver calls is_zero_ether_addr() against byte-aligned address:
>
> drivers/net/wireless/marvell/mwifiex/fw.h:
> struct mwifiex_scan_cmd_config {
> /*
> * BSS mode to be sent in the firmware command
> */
> u8 bss_mode;
>
> /* Specific BSSID used to filter scan results in the firmware */
> u8 specific_bssid[ETH_ALEN];
>
> ...
> } __packed;
>
> drivers/net/wireless/marvell/mwifiex/scan.c:
> mwifiex_config_scan(..., struct mwifiex_scan_cmd_config *scan_cfg_out, ...)
> ...
> if (adapter->ext_scan &&
> !is_zero_ether_addr(scan_cfg_out->specific_bssid)) {
> ...
> }
>
> Since firmware-related struct mwifiex_scan_cmd_config cannot be changed,
> we need to use the new function is_zero_ether_addr_unaligned() here.
>
> This is v2 of the original patch:
> [PATCH] Modify is_zero_ether_addr() to handle byte-aligned addresses
>
> Per Joe's suggestion -- instead of modifying is_zero_ether_addr() --
> add is_zero_ether_addr_unaligned() and use it where needed.
>
> Cc: Kalle Valo <kvalo@codeaurora.org>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: Joe Perches <joe@perches.com>
> Cc: Amitkumar Karwar <akarwar@marvell.com>
> Signed-off-by: Petri Gynther <pgynther@google.com>
Patch set to Rejected.
Reason: As is_zero_ether_addr_unaligned() patch is not applied I can't take
this. Please resend if that patch is accepted.
--
https://patchwork.kernel.org/patch/9306999/
Documentation about submitting wireless patches and checking status
from patchwork:
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply
* Re: pull-request: iwlwifi-next 2016-09-19-2
From: Kalle Valo @ 2016-09-26 11:12 UTC (permalink / raw)
To: Luca Coelho; +Cc: linux-wireless, linuxwifi
In-Reply-To: <1474275007.5664.96.camel@coelho.fi>
Luca Coelho <luca@coelho.fi> writes:
> Please drop my previous pull-request. =C2=A0There was a compilation error
> that I missed to due a missing flag in my .config. =C2=A0I fixed it now a=
nd
> this is the new pull request that includes the fix.
>
> Here we go again, now I'm almost catching up with the pending stuff in
> our internal tree, just in time for 4.9.=C2=A0=C2=A0This pull contains a =
bunch of
> fixes to DQA and new HW support code, a few new features and some
> cleanups.=C2=A0=C2=A0More details in the tag description.
>
> Let me know if everything's fine (or not). :)
>
> Luca.
>
>
> The following changes since commit 80ba4f1d365af206b9e818d17d22fed02fe5de=
f0:
>
> mwifiex: fix null pointer deference when adapter is null (2016-09-17 18=
:26:32 +0300)
>
> are available in the git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next.git =
tags/iwlwifi-next-for-kalle-2016-09-19-2
Pulled, thanks.
--=20
Kalle Valo
^ permalink raw reply
* Re: [PATCH v2 RESEND] qtnfmac: announcement of new FullMAC driver for Quantenna chipsets
From: Kalle Valo @ 2016-09-26 10:56 UTC (permalink / raw)
To: IgorMitsyanko
Cc: johannes, linux-wireless, Avinash Patil, Dmitrii Lebed,
Sergei Maksimenko, Sergey Matyukevich, Bindu Therthala,
Huizhao Wang, Kamlesh Rath
In-Reply-To: <99f0c921-1230-0896-2bc5-4a12eb81dca1@quantenna.com>
IgorMitsyanko <igor.mitsyanko.os@quantenna.com> writes:
> On 09/17/2016 04:46 PM, Kalle Valo wrote:
>> <igor.mitsyanko.os@quantenna.com> writes:
>>
>>> +/* Supported rates to be advertised to the cfg80211 */
>>> +static struct ieee80211_rate qtnf_rates[] = {
>>> + {.bitrate = 10, .hw_value = 2, },
>>> + {.bitrate = 20, .hw_value = 4, },
>>> + {.bitrate = 55, .hw_value = 11, },
>>> + {.bitrate = 110, .hw_value = 22, },
>>> + {.bitrate = 60, .hw_value = 12, },
>>> + {.bitrate = 90, .hw_value = 18, },
>>> + {.bitrate = 120, .hw_value = 24, },
>>> + {.bitrate = 180, .hw_value = 36, },
>>> + {.bitrate = 240, .hw_value = 48, },
>>> + {.bitrate = 360, .hw_value = 72, },
>>> + {.bitrate = 480, .hw_value = 96, },
>>> + {.bitrate = 540, .hw_value = 108, },
>>> +};
>>> +
>>> +/* Channel definitions to be advertised to cfg80211 */
>>> +static struct ieee80211_channel qtnf_channels_2ghz[] = {
>>> + {.center_freq = 2412, .hw_value = 1, },
>>> + {.center_freq = 2417, .hw_value = 2, },
>>> + {.center_freq = 2422, .hw_value = 3, },
>>> + {.center_freq = 2427, .hw_value = 4, },
>>> + {.center_freq = 2432, .hw_value = 5, },
>>> + {.center_freq = 2437, .hw_value = 6, },
>>> + {.center_freq = 2442, .hw_value = 7, },
>>> + {.center_freq = 2447, .hw_value = 8, },
>>> + {.center_freq = 2452, .hw_value = 9, },
>>> + {.center_freq = 2457, .hw_value = 10, },
>>> + {.center_freq = 2462, .hw_value = 11, },
>>> + {.center_freq = 2467, .hw_value = 12, },
>>> + {.center_freq = 2472, .hw_value = 13, },
>>> + {.center_freq = 2484, .hw_value = 14, },
>>> +};
>> I guess some of these static variables could be also const, but didn't
>> check.
>
> We did some changes to this code recently: will get bands info
> (channel list, rates, capabilities etc) from wireless device itself,
> it will be in next patch revision.
For the initial submission please freeze the driver, otherwise it's pain
to review as the driver changes too much in-between review rounds. So at
this stage only minimal changes, please.
You can continue adding new features and making changes, but do those as
follow up patches and use the initial submission as the baseline for the
new patches. Once the driver is applied you can submit the rest of the
patches adding new features and they will be reviewed similarly like all
other wireless patches.
>>> +static int
>>> +qtnf_event_handle_sta_assoc(struct qtnf_wmac *mac, struct qtnf_vif *vif,
>>> + const struct qlink_event_sta_assoc *sta_assoc,
>>> + u16 len)
>>> +{
>>> + const u8 *sta_addr;
>>> + u16 frame_control;
>>> + struct station_info sinfo = { 0 };
>>> + size_t payload_len;
>>> + u16 tlv_type;
>>> + u16 tlv_value_len;
>>> + size_t tlv_full_len;
>>> + const struct qlink_tlv_hdr *tlv;
>>> +
>>> + if (unlikely(len < sizeof(*sta_assoc))) {
>>> + pr_err("%s: payload is too short (%u < %zu)\n", __func__,
>>> + len, sizeof(*sta_assoc));
>>> + return -EINVAL;
>>> + }
>>
>> I see unlikely() used a lot, I counted 145 times. Not a big issue but I
>> don't see the point. In hot path I understand using it, but not
>> everywhere.
>
> Agree, but would you suggest that we remove the ones that we already
> have but that are not really needed?
Up to you really. This isn't important, just something I found a bit
odd.
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH v2 RESEND] qtnfmac: announcement of new FullMAC driver for Quantenna chipsets
From: Kalle Valo @ 2016-09-26 10:45 UTC (permalink / raw)
To: IgorMitsyanko
Cc: johannes, linux-wireless, Avinash Patil, Dmitrii Lebed,
Sergei Maksimenko, Sergey Matyukevich, Bindu Therthala,
Huizhao Wang, Kamlesh Rath
In-Reply-To: <dfdaca87-dfbd-4677-fbff-45127ccd2e0c@quantenna.com>
IgorMitsyanko <igor.mitsyanko.os@quantenna.com> writes:
> On 09/17/2016 04:56 PM, Kalle Valo wrote:
>> <igor.mitsyanko.os@quantenna.com> writes:
>>
>>> +/* FW names */
>>> +
>>> +#define QTN_PCI_FW_NAME "pearl-linux.lzma.img"
>>
>> The firmware name gives no indication what this file is about (remember
>> that linux-firmware.git has a lot of files). Please name it properly,
>> don't just use what is used in by firmware build scripts :) Take into
>> account also future hw support, all firmware files need to coexist in
>> the same repository without user invention. In a way the firmware
>> filename is part of kernel/userspace interface and needs to be stable.
>>
>> For example, you could use something like "qtnfmac/qsr10g.img" (assuming
>> qsr10g is the name of chip).
>
> Ok, we will reconsider our naming conventions, take into account more
> devices that we need to support in the future.
> I'm thinking about something like:
> qtn/fmac_qsr10g.img <---- FullMAC QSR10G device
> qtn/fmac_qsr1000.img <---- FullMAC QSR1000 device
> qtn/smac_qsr10g.img <---- SoftMAC QSR10G
> qtn/smac_qsr10000.img <----- SoftMAC QSR1000
> etc
Looks good to me.
--
Kalle Valo
^ permalink raw reply
* [PATCH] rsi: update in vap_capabilities frame to device
From: Prameela Rani Garnepudi @ 2016-09-26 10:33 UTC (permalink / raw)
To: linux-wireless
Cc: kvalo, johannes.berg, hofrat, xypron.glpk, prameela.garnepudi,
Prameela Rani Garnepudi
added vap status(add/delete) field in vap capabilities frame to device
added sending vap capabilites frame(with vap status 'delete') in remove interface
Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
---
drivers/net/wireless/rsi/rsi_91x_mac80211.c | 12 ++++++++----
drivers/net/wireless/rsi/rsi_91x_mgmt.c | 8 ++++++--
drivers/net/wireless/rsi/rsi_mgmt.h | 9 ++++++++-
3 files changed, 22 insertions(+), 7 deletions(-)
diff --git a/drivers/net/wireless/rsi/rsi_91x_mac80211.c b/drivers/net/wireless/rsi/rsi_91x_mac80211.c
index dbb2389..d5b17b1 100644
--- a/drivers/net/wireless/rsi/rsi_91x_mac80211.c
+++ b/drivers/net/wireless/rsi/rsi_91x_mac80211.c
@@ -304,13 +304,15 @@ static int rsi_mac80211_add_interface(struct ieee80211_hw *hw,
if (!adapter->sc_nvifs) {
++adapter->sc_nvifs;
adapter->vifs[0] = vif;
- ret = rsi_set_vap_capabilities(common, STA_OPMODE);
+ ret = rsi_set_vap_capabilities(common,
+ STA_OPMODE,
+ VAP_ADD);
}
break;
default:
rsi_dbg(ERR_ZONE,
- "%s: Interface type %d not supported\n", __func__,
- vif->type);
+ "%s: Interface type %d not supported\n",
+ __func__, vif->type);
}
mutex_unlock(&common->mutex);
@@ -332,8 +334,10 @@ static void rsi_mac80211_remove_interface(struct ieee80211_hw *hw,
struct rsi_common *common = adapter->priv;
mutex_lock(&common->mutex);
- if (vif->type == NL80211_IFTYPE_STATION)
+ if (vif->type == NL80211_IFTYPE_STATION) {
adapter->sc_nvifs--;
+ rsi_set_vap_capabilities(common, STA_OPMODE, VAP_DELETE);
+ }
if (!memcmp(adapter->vifs[0], vif, sizeof(struct ieee80211_vif)))
adapter->vifs[0] = NULL;
diff --git a/drivers/net/wireless/rsi/rsi_91x_mgmt.c b/drivers/net/wireless/rsi/rsi_91x_mgmt.c
index 35c14cc..c41bb4f 100644
--- a/drivers/net/wireless/rsi/rsi_91x_mgmt.c
+++ b/drivers/net/wireless/rsi/rsi_91x_mgmt.c
@@ -617,7 +617,9 @@ static int rsi_program_bb_rf(struct rsi_common *common)
*
* Return: 0 on success, corresponding negative error code on failure.
*/
-int rsi_set_vap_capabilities(struct rsi_common *common, enum opmode mode)
+int rsi_set_vap_capabilities(struct rsi_common *common,
+ enum opmode mode,
+ u8 vap_status)
{
struct sk_buff *skb = NULL;
struct rsi_vap_caps *vap_caps;
@@ -626,7 +628,8 @@ int rsi_set_vap_capabilities(struct rsi_common *common, enum opmode mode)
struct ieee80211_conf *conf = &hw->conf;
u16 vap_id = 0;
- rsi_dbg(MGMT_TX_ZONE, "%s: Sending VAP capabilities frame\n", __func__);
+ rsi_dbg(MGMT_TX_ZONE,
+ "%s: Sending VAP capabilities frame\n", __func__);
skb = dev_alloc_skb(sizeof(struct rsi_vap_caps));
if (!skb) {
@@ -642,6 +645,7 @@ int rsi_set_vap_capabilities(struct rsi_common *common, enum opmode mode)
FRAME_DESC_SZ) |
(RSI_WIFI_MGMT_Q << 12));
vap_caps->desc_word[1] = cpu_to_le16(VAP_CAPABILITIES);
+ vap_caps->desc_word[2] = cpu_to_le16(vap_status << 8);
vap_caps->desc_word[4] = cpu_to_le16(mode |
(common->channel_width << 8));
vap_caps->desc_word[7] = cpu_to_le16((vap_id << 8) |
diff --git a/drivers/net/wireless/rsi/rsi_mgmt.h b/drivers/net/wireless/rsi/rsi_mgmt.h
index 3741173..d155358 100644
--- a/drivers/net/wireless/rsi/rsi_mgmt.h
+++ b/drivers/net/wireless/rsi/rsi_mgmt.h
@@ -145,6 +145,12 @@ enum opmode {
AP_OPMODE = 2
};
+enum vap_status {
+ VAP_ADD = 1,
+ VAP_DELETE = 2,
+ VAP_UPDATE = 3
+};
+
extern struct ieee80211_rate rsi_rates[12];
extern const u16 rsi_mcsrates[8];
@@ -287,7 +293,8 @@ static inline u8 rsi_get_channel(u8 *addr)
}
int rsi_mgmt_pkt_recv(struct rsi_common *common, u8 *msg);
-int rsi_set_vap_capabilities(struct rsi_common *common, enum opmode mode);
+int rsi_set_vap_capabilities(struct rsi_common *common, enum opmode mode,
+ u8 vap_status);
int rsi_send_aggregation_params_frame(struct rsi_common *common, u16 tid,
u16 ssn, u8 buf_size, u8 event);
int rsi_hal_load_key(struct rsi_common *common, u8 *data, u16 key_len,
--
2.4.11
^ permalink raw reply related
* [PATCH] brcmfmac: implement more accurate skb tracking
From: Rafał Miłecki @ 2016-09-26 10:23 UTC (permalink / raw)
To: Kalle Valo
Cc: Arend van Spriel, Franky Lin, Hante Meuleman,
Pieter-Paul Giesberts, Franky Lin, linux-wireless,
brcm80211-dev-list.pdl, netdev, linux-kernel,
Rafał Miłecki
From: Rafał Miłecki <rafal@milecki.pl>
We need to track 802.1x packets to know if there are any pending ones
for transmission. This is required for performing key update in the
firmware.
Unfortunately our old tracking code wasn't very accurate. It was
treating skb as pending as soon as it was passed by the netif. Actual
handling packet to the firmware was happening later as brcmfmac
internally queues them and uses its own worker(s).
Other than that it was hard to handle freeing packets. Everytime we had
to determine (in more generic funcions) if packet was counted as pending
802.1x one or not. It was causing some problems, e.g. it wasn't clear if
brcmf_flowring_delete should free skb directly or not.
This patch introduces 2 separated functions for tracking skbs. This
simplifies logic, fixes brcmf_flowring_delete (maybe other hidden bugs
as well) and allows further simplifications. Thanks to better accuracy
is also increases time window for key update (and lowers timeout risk).
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
This was successfully tested with 4366b1. Can someone give it a try with
some USB/SDIO device, please?
---
.../wireless/broadcom/brcm80211/brcmfmac/bcdc.c | 11 +++++++
.../wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 12 +++++++-
.../wireless/broadcom/brcm80211/brcmfmac/core.c | 36 ++++++++++++++++------
.../wireless/broadcom/brcm80211/brcmfmac/core.h | 2 ++
.../wireless/broadcom/brcm80211/brcmfmac/msgbuf.c | 14 +++++++--
.../wireless/broadcom/brcm80211/brcmfmac/proto.h | 11 +++++++
.../wireless/broadcom/brcm80211/brcmfmac/sdio.c | 8 +++++
.../net/wireless/broadcom/brcm80211/brcmfmac/usb.c | 10 ++++++
8 files changed, 91 insertions(+), 13 deletions(-)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c
index d1bc51f..3e40244 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c
@@ -326,6 +326,16 @@ brcmf_proto_bcdc_hdrpull(struct brcmf_pub *drvr, bool do_fws,
return 0;
}
+static int brcmf_proto_bcdc_hdr_get_ifidx(struct brcmf_pub *drvr,
+ struct sk_buff *skb)
+{
+ struct brcmf_proto_bcdc_header *h;
+
+ h = (struct brcmf_proto_bcdc_header *)(skb->data);
+
+ return BCDC_GET_IF_IDX(h);
+}
+
static int
brcmf_proto_bcdc_txdata(struct brcmf_pub *drvr, int ifidx, u8 offset,
struct sk_buff *pktbuf)
@@ -373,6 +383,7 @@ int brcmf_proto_bcdc_attach(struct brcmf_pub *drvr)
}
drvr->proto->hdrpull = brcmf_proto_bcdc_hdrpull;
+ drvr->proto->hdr_get_ifidx = brcmf_proto_bcdc_hdr_get_ifidx;
drvr->proto->query_dcmd = brcmf_proto_bcdc_query_dcmd;
drvr->proto->set_dcmd = brcmf_proto_bcdc_set_dcmd;
drvr->proto->txdata = brcmf_proto_bcdc_txdata;
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
index 03404cb..fef9d02 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
@@ -43,6 +43,7 @@
#include "chip.h"
#include "bus.h"
#include "debug.h"
+#include "proto.h"
#include "sdio.h"
#include "core.h"
#include "common.h"
@@ -772,6 +773,7 @@ int brcmf_sdiod_send_buf(struct brcmf_sdio_dev *sdiodev, u8 *buf, uint nbytes)
int brcmf_sdiod_send_pkt(struct brcmf_sdio_dev *sdiodev,
struct sk_buff_head *pktq)
{
+ struct brcmf_pub *pub = sdiodev->bus_if->drvr;
struct sk_buff *skb;
u32 addr = sdiodev->sbwad;
int err;
@@ -784,10 +786,18 @@ int brcmf_sdiod_send_pkt(struct brcmf_sdio_dev *sdiodev,
if (pktq->qlen == 1 || !sdiodev->sg_support)
skb_queue_walk(pktq, skb) {
+ struct brcmf_if *ifp;
+ int ifidx;
+
+ ifidx = brcmf_proto_hdr_get_ifidx(pub, skb);
+ ifp = brcmf_get_ifp(pub, ifidx);
+ brcmf_tx_passing_skb(ifp, skb);
err = brcmf_sdiod_buffrw(sdiodev, SDIO_FUNC_2, true,
addr, skb);
- if (err)
+ if (err) {
+ brcmf_tx_regained_skb(ifp, skb);
break;
+ }
}
else
err = brcmf_sdiod_sglist_rw(sdiodev, SDIO_FUNC_2, true, addr,
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
index bc3d8ab..7cdc1f6 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
@@ -247,9 +247,6 @@ static netdev_tx_t brcmf_netdev_start_xmit(struct sk_buff *skb,
goto done;
}
- if (eh->h_proto == htons(ETH_P_PAE))
- atomic_inc(&ifp->pend_8021x_cnt);
-
/* determine the priority */
if (skb->priority == 0 || skb->priority > 7)
skb->priority = cfg80211_classify8021d(skb, NULL);
@@ -388,20 +385,41 @@ void brcmf_rx_event(struct device *dev, struct sk_buff *skb)
brcmu_pkt_buf_free_skb(skb);
}
-void brcmf_txfinalize(struct brcmf_if *ifp, struct sk_buff *txp, bool success)
+/**
+ * brcmf_tx_passing_skb - Let core know skb is being passed to the firmware
+ *
+ * Core code needs to track state of some skbs. This function should be called
+ * every time skb is going to be passed to the firmware for transmitting.
+ */
+void brcmf_tx_passing_skb(struct brcmf_if *ifp, struct sk_buff *skb)
{
- struct ethhdr *eh;
- u16 type;
+ struct ethhdr *eh = (struct ethhdr *)(skb->data);
- eh = (struct ethhdr *)(txp->data);
- type = ntohs(eh->h_proto);
+ if (eh->h_proto == htons(ETH_P_PAE))
+ atomic_inc(&ifp->pend_8021x_cnt);
+}
- if (type == ETH_P_PAE) {
+/**
+ * brcmf_tx_regained_skb - Let core know skb is not being fw processed anymore
+ *
+ * This function should be called every time skb is returned from the firmware
+ * processing for whatever reason. It usually happens after successful
+ * transmission but may be also due to some error.
+ */
+void brcmf_tx_regained_skb(struct brcmf_if *ifp, struct sk_buff *skb)
+{
+ struct ethhdr *eh = (struct ethhdr *)(skb->data);
+
+ if (eh->h_proto == htons(ETH_P_PAE)) {
atomic_dec(&ifp->pend_8021x_cnt);
+
if (waitqueue_active(&ifp->pend_8021x_wait))
wake_up(&ifp->pend_8021x_wait);
}
+}
+void brcmf_txfinalize(struct brcmf_if *ifp, struct sk_buff *txp, bool success)
+{
if (!success)
ifp->stats.tx_errors++;
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h
index f16cfc9..80478b5 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h
@@ -215,6 +215,8 @@ struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, s32 bsscfgidx, s32 ifidx,
void brcmf_remove_interface(struct brcmf_if *ifp, bool rtnl_locked);
void brcmf_txflowblock_if(struct brcmf_if *ifp,
enum brcmf_netif_stop_reason reason, bool state);
+void brcmf_tx_passing_skb(struct brcmf_if *ifp, struct sk_buff *skb);
+void brcmf_tx_regained_skb(struct brcmf_if *ifp, struct sk_buff *skb);
void brcmf_txfinalize(struct brcmf_if *ifp, struct sk_buff *txp, bool success);
void brcmf_netif_rx(struct brcmf_if *ifp, struct sk_buff *skb);
void brcmf_net_setcarrier(struct brcmf_if *ifp, bool on);
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
index 2b9a2bc..2a25eea 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
@@ -701,17 +701,22 @@ static void brcmf_msgbuf_txflow(struct brcmf_msgbuf *msgbuf, u16 flowid)
count = BRCMF_MSGBUF_TX_FLUSH_CNT2 - BRCMF_MSGBUF_TX_FLUSH_CNT1;
while (brcmf_flowring_qlen(flow, flowid)) {
+ u8 ifidx = brcmf_flowring_ifidx_get(flow, flowid);
+ struct brcmf_if *ifp = brcmf_get_ifp(msgbuf->drvr, ifidx);
+
skb = brcmf_flowring_dequeue(flow, flowid);
if (skb == NULL) {
brcmf_err("No SKB, but qlen %d\n",
brcmf_flowring_qlen(flow, flowid));
break;
}
+ brcmf_tx_passing_skb(ifp, skb);
skb_orphan(skb);
if (brcmf_msgbuf_alloc_pktid(msgbuf->drvr->bus_if->dev,
msgbuf->tx_pktids, skb, ETH_HLEN,
&physaddr, &pktid)) {
brcmf_flowring_reinsert(flow, flowid, skb);
+ brcmf_tx_regained_skb(ifp, skb);
brcmf_err("No PKTID available !!\n");
break;
}
@@ -720,6 +725,7 @@ static void brcmf_msgbuf_txflow(struct brcmf_msgbuf *msgbuf, u16 flowid)
brcmf_msgbuf_get_pktid(msgbuf->drvr->bus_if->dev,
msgbuf->tx_pktids, pktid);
brcmf_flowring_reinsert(flow, flowid, skb);
+ brcmf_tx_regained_skb(ifp, skb);
break;
}
count++;
@@ -728,7 +734,7 @@ static void brcmf_msgbuf_txflow(struct brcmf_msgbuf *msgbuf, u16 flowid)
tx_msghdr->msg.msgtype = MSGBUF_TYPE_TX_POST;
tx_msghdr->msg.request_id = cpu_to_le32(pktid);
- tx_msghdr->msg.ifidx = brcmf_flowring_ifidx_get(flow, flowid);
+ tx_msghdr->msg.ifidx = ifidx;
tx_msghdr->flags = BRCMF_MSGBUF_PKT_FLAGS_FRAME_802_3;
tx_msghdr->flags |= (skb->priority & 0x07) <<
BRCMF_MSGBUF_PKT_FLAGS_PRIO_SHIFT;
@@ -857,6 +863,7 @@ brcmf_msgbuf_process_ioctl_complete(struct brcmf_msgbuf *msgbuf, void *buf)
static void
brcmf_msgbuf_process_txstatus(struct brcmf_msgbuf *msgbuf, void *buf)
{
+ struct brcmf_if *ifp;
struct brcmf_commonring *commonring;
struct msgbuf_tx_status *tx_status;
u32 idx;
@@ -876,8 +883,9 @@ brcmf_msgbuf_process_txstatus(struct brcmf_msgbuf *msgbuf, void *buf)
commonring = msgbuf->flowrings[flowid];
atomic_dec(&commonring->outstanding_tx);
- brcmf_txfinalize(brcmf_get_ifp(msgbuf->drvr, tx_status->msg.ifidx),
- skb, true);
+ ifp = brcmf_get_ifp(msgbuf->drvr, tx_status->msg.ifidx);
+ brcmf_tx_regained_skb(ifp, skb);
+ brcmf_txfinalize(ifp, skb, true);
}
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.h
index 57531f4..453cc5a 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.h
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.h
@@ -16,6 +16,7 @@
#ifndef BRCMFMAC_PROTO_H
#define BRCMFMAC_PROTO_H
+#include "core.h"
enum proto_addr_mode {
ADDR_INDIRECT = 0,
@@ -29,6 +30,7 @@ struct brcmf_skb_reorder_data {
struct brcmf_proto {
int (*hdrpull)(struct brcmf_pub *drvr, bool do_fws,
struct sk_buff *skb, struct brcmf_if **ifp);
+ int (*hdr_get_ifidx)(struct brcmf_pub *drvr, struct sk_buff *skb);
int (*query_dcmd)(struct brcmf_pub *drvr, int ifidx, uint cmd,
void *buf, uint len);
int (*set_dcmd)(struct brcmf_pub *drvr, int ifidx, uint cmd, void *buf,
@@ -64,6 +66,15 @@ static inline int brcmf_proto_hdrpull(struct brcmf_pub *drvr, bool do_fws,
ifp = &tmp;
return drvr->proto->hdrpull(drvr, do_fws, skb, ifp);
}
+
+static inline int brcmf_proto_hdr_get_ifidx(struct brcmf_pub *drvr,
+ struct sk_buff *skb)
+{
+ if (!drvr->proto->hdr_get_ifidx)
+ return -ENOTSUPP;
+ return drvr->proto->hdr_get_ifidx(drvr, skb);
+}
+
static inline int brcmf_proto_query_dcmd(struct brcmf_pub *drvr, int ifidx,
uint cmd, void *buf, uint len)
{
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
index b892dac..4dc96bd 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
@@ -42,6 +42,7 @@
#include "sdio.h"
#include "chip.h"
#include "firmware.h"
+#include "proto.h"
#include "core.h"
#include "common.h"
@@ -2240,6 +2241,7 @@ brcmf_sdio_txpkt_postp(struct brcmf_sdio *bus, struct sk_buff_head *pktq)
static int brcmf_sdio_txpkt(struct brcmf_sdio *bus, struct sk_buff_head *pktq,
uint chan)
{
+ struct brcmf_pub *pub = bus->sdiodev->bus_if->drvr;
int ret;
struct sk_buff *pkt_next, *tmp;
@@ -2263,7 +2265,13 @@ done:
if (ret == 0)
bus->tx_seq = (bus->tx_seq + pktq->qlen) % SDPCM_SEQ_WRAP;
skb_queue_walk_safe(pktq, pkt_next, tmp) {
+ struct brcmf_if *ifp;
+ int ifidx;
+
__skb_unlink(pkt_next, pktq);
+ ifidx = brcmf_proto_hdr_get_ifidx(pub, pkt_next);
+ ifp = brcmf_get_ifp(pub, ifidx);
+ brcmf_tx_regained_skb(ifp, pkt_next);
brcmf_txcomplete(bus->sdiodev->dev, pkt_next, ret == 0);
}
return ret;
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
index 2f978a3..d2f81c7 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
@@ -26,6 +26,7 @@
#include "bus.h"
#include "debug.h"
#include "firmware.h"
+#include "proto.h"
#include "usb.h"
#include "core.h"
#include "common.h"
@@ -476,12 +477,16 @@ static void brcmf_usb_tx_complete(struct urb *urb)
{
struct brcmf_usbreq *req = (struct brcmf_usbreq *)urb->context;
struct brcmf_usbdev_info *devinfo = req->devinfo;
+ struct brcmf_pub *pub = devinfo->bus_pub.bus->drvr;
+ struct brcmf_if *ifp;
unsigned long flags;
brcmf_dbg(USB, "Enter, urb->status=%d, skb=%p\n", urb->status,
req->skb);
brcmf_usb_del_fromq(devinfo, req);
+ ifp = brcmf_get_ifp(pub, brcmf_proto_hdr_get_ifidx(pub, req->skb));
+ brcmf_tx_regained_skb(ifp, req->skb);
brcmf_txcomplete(devinfo->dev, req->skb, urb->status == 0);
req->skb = NULL;
brcmf_usb_enq(devinfo, &devinfo->tx_freeq, req, &devinfo->tx_freecount);
@@ -598,7 +603,9 @@ brcmf_usb_state_change(struct brcmf_usbdev_info *devinfo, int state)
static int brcmf_usb_tx(struct device *dev, struct sk_buff *skb)
{
struct brcmf_usbdev_info *devinfo = brcmf_usb_get_businfo(dev);
+ struct brcmf_pub *pub = devinfo->bus_pub.bus->drvr;
struct brcmf_usbreq *req;
+ struct brcmf_if *ifp;
int ret;
unsigned long flags;
@@ -622,6 +629,8 @@ static int brcmf_usb_tx(struct device *dev, struct sk_buff *skb)
skb->data, skb->len, brcmf_usb_tx_complete, req);
req->urb->transfer_flags |= URB_ZERO_PACKET;
brcmf_usb_enq(devinfo, &devinfo->tx_postq, req, NULL);
+ ifp = brcmf_get_ifp(pub, brcmf_proto_hdr_get_ifidx(pub, skb));
+ brcmf_tx_passing_skb(ifp, skb);
ret = usb_submit_urb(req->urb, GFP_ATOMIC);
if (ret) {
brcmf_err("brcmf_usb_tx usb_submit_urb FAILED\n");
@@ -629,6 +638,7 @@ static int brcmf_usb_tx(struct device *dev, struct sk_buff *skb)
req->skb = NULL;
brcmf_usb_enq(devinfo, &devinfo->tx_freeq, req,
&devinfo->tx_freecount);
+ brcmf_tx_regained_skb(ifp, skb);
goto fail;
}
--
2.9.3
^ permalink raw reply related
* RE: [PATCH] realtek: Add switch variable to 'switch case not processed' messages
From: David Laight @ 2016-09-26 9:33 UTC (permalink / raw)
To: 'Joe Perches', Jean Delvare
Cc: Larry Finger, Chaoming Li, Kalle Valo,
linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
In-Reply-To: <1474733754.23838.3.camel@perches.com>
> If you want to create enum->#ENUM structs and
> "const char *" lookup functions, please be my guest.
>
> otherwise, hex is at least a consistent way to display
> what should be infrequent output.
If I've typed it right:
#define tags(x) x(A) x(B) x(C)
#define x(t) t,
enum {tags(x) tag_count};
#undef x
#define x(t) ##t,
static const char names[] = { tags(x) };
#undef x
David
^ permalink raw reply
* RE: [PATCH 2/2] mwifiex: firmware name correction for usb8997 chipset
From: Amitkumar Karwar @ 2016-09-26 9:01 UTC (permalink / raw)
To: Kalle Valo; +Cc: linux-wireless@vger.kernel.org, Ganapathi Bhat
In-Reply-To: <87wphzyr7e.fsf@kamboji.qca.qualcomm.com>
Hi Kalle,
> From: Kalle Valo [mailto:kvalo@codeaurora.org]
> Sent: Monday, September 26, 2016 2:27 PM
> To: Amitkumar Karwar
> Cc: linux-wireless@vger.kernel.org; Ganapathi Bhat
> Subject: Re: [PATCH 2/2] mwifiex: firmware name correction for usb8997
> chipset
>
> Amitkumar Karwar <akarwar@marvell.com> writes:
>
> >> Like discussed earlier, the firmware names are supposed to be stable.
> >> I consider them to be an interface between kernel and user space.
> >> Instead of changing the driver you should actually rename the
> >> firmware file. I'm planning to take this anyway but in the future
> >> please pay extra attention to do this properly.
> >
> > Thanks for accepting the patch. We will stick to the same name for
> > 8997 and ensure v3/v4 etc won't be used for future chipsets/firmwares.
>
> Good, thanks.
>
> >> My recommendation is to keep the firmware name simple as possible and
> >> get rid of any extra cruft, for example in this case a good name
> >> would be "mrvl/usb8997.bin". That extra "usb" and "combo_v4" don't
> >> bring any benefit.
> >>
> >
> > 'combo' here indicates it's a combine firmware image for bluetooth and
> > wifi. Firmware images with bluetooth only OR WiFi only functionality
> > are also possible. Example use case: We support PCIe function level
> > reset feature as a recovery mechanism. With this mechanism, WiFi
> > recovery can happen by re-downloading WiFi only firmware without
> > affecting bluetooth functionality for PCIe-USB8997 chipset.
>
> Ok, makes sense.
>
> > 'usbusb' here indicates this firmware is for a USB-USB8997 chipset
> > where WiFi and bluetooth are over USB bus. There would be a different
> > firmware if chipset is USB-UART8997 where bluetooth is via UART.
>
> So the bluetooth via UART chip would be 'usbuart'? Sounds reasonable
> then.
>
Right. 'usbuart' string would be used in firmware name for USB-UART8997 where bluetooth is via uart.
Regards,
Amitkumar Karwar
^ 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