Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added virtual ALSA AVB driver #246

Open
wants to merge 133 commits into
base: 5.4-rt
Choose a base branch
from

Conversation

NiklasWan
Copy link

This is a port of the virtual ALSA AVB driver by indu for BBB and BBAI. It is based on: https://github.com/induarun9086/beagleboard-linux/blob/4.4/sound/drivers/avb.c
It was implemented during GSoC 2020 for the project Media Ip Streaming.
Usage description and documentation can be found here: https://niklaswan.github.io/GSoC-Overview/avb-alsa/

@RobertCNelson
Copy link
Member

Thanks @NiklasWan ! this looks awesome, i'll merge it tomorrow morning and push it out..

RobertCNelson and others added 29 commits August 24, 2020 18:15
patch-5.4.52-rt31.patch.xz

Signed-off-by: Robert Nelson <[email protected]>
Reference: v5.7.10
Signed-off-by: Robert Nelson <[email protected]>
Reference: v5.6.19
Signed-off-by: Robert Nelson <[email protected]>
Reference: v5.5.19
Signed-off-by: Robert Nelson <[email protected]>
Reference: v5.4.18
Signed-off-by: Robert Nelson <[email protected]>
Set F2 blocksize to 256 bytes for 4373. It fixes DMA error while having
UDP bi-directional traffic.

Signed-off-by: Wright Feng <[email protected]>
Signed-off-by: Chi-hsien Lin <[email protected]>
broken_sg_support, sd_head_align, and sd_sgentry_align are used in
brcmfmac code but not configurable in dts file. Add the parsing logic.
Now they can be configured like below in dts:
	brcm,broken_sg_support;
	brcm,sd_head_align = /bits/ 16 <4>;
	brcm,sd_sgentry_align = /bits/ 16 <4>;

Signed-off-by: Chi-hsien Lin <[email protected]>
APSTA can work on two band concurrently with using VSDB(Virtual
Simultaneous Dual-Band) or RSDB(Real Simultaneous Dual-Band) features.
In this case, we have to keep apsta is 1 in firmware side.
If we start wpa_supplicant on wlan0 and then start hostapd on wlan1, the
apsta will be set to 0, and data will be stall on wlan0(station).
Because that, we only set apsta to 0 when AP start on primary interface.

Signed-off-by: Wright Feng <[email protected]>
Signed-off-by: Chi-hsien Lin <[email protected]>
Hostap daemon has a parameter "ap_isolate which is used to prevent
low-level bridging of frames between associated stations in the BSS.
For driver side, we add cfg80211 ops method change_bss to support
setting AP isolation from user space.

Signed-off-by: Wright Feng <[email protected]>
Signed-off-by: Chi-hsien Lin <[email protected]>
When eap_restrict is enabled, firmware will toss non-802.1x frames from
tx/rx data path if station not yet authorized.
Internal firmware eap_restrict is disabled by default. This patch makes
it possible to enable firmware eap_restrict by specifying
eap_restrict=1 as module parameter.

Signed-off-by: Wright Feng <[email protected]>
Signed-off-by: Chi-hsien Lin <[email protected]>
Host driver needs to provide a dummy wowlan filter for kernel and
provided the the well configured wowlan stack. So the system will
keep driver in connected state in suspend mode and can be wake
up by ping packet.

Enable unicast packet filter before system suspend and disable it after
resume.

Signed-off-by: Double Lo <[email protected]>
Signed-off-by: Double Lo <[email protected]>
Signed-off-by: Chi-hsien Lin <[email protected]>
Set wowl configuration in disconnect state is redundant.
Remove it to fix no scan result issue after resume.

Signed-off-by: Double Lo <[email protected]>
Signed-off-by: Chi-hsien Lin <[email protected]>
With setting sdio_wq_highpri=1 in module parameters, tasks submitted to
SDIO workqueue will put at the head of the queue and run immediately.
This parameter is for getting higher TX/RX throughput with SDIO bus.

Signed-off-by: Wright Feng <[email protected]>
Signed-off-by: Chi-hsien Lin <[email protected]>
The firmware does not respond ARP request and causes ping failed with
following steps.

1. Bring up interface
   ifconfig wlan0 up or start wpa_supplicant
2. Set the IP address
   ifconfig wlan0 192.168.100.10
3. Bring down interface or
   ifconfig wlan0 down or kill wpa_supplicant
4. Bring up interface again and set the same IP address
5. Connect to AP(192.168.100.1) and ping to AP will be failed.

FMAC clears arp_hostip when bringing down the interface, but not set it
back if setting the same IP address. We are able to see the IP address
in interface info(inconfig wlan0) but the ping still cannot work because
the firmware ARP offload does not respond the ARP request.
Because of that, we remove "arp_hostip_clear" from function
"brcmf_netdev_stop"

Signed-off-by: Wright Feng <[email protected]>
Signed-off-by: Chi-hsien Lin <[email protected]>
Send P2P Presence Response from the p2p interface address instead
of the p2p device address.

Signed-off-by: Madhan Mohan R <[email protected]>
Signed-off-by: Chi-hsien Lin <[email protected]>
P2p spec mentioned that the p2p device address should be the globally
administered address with locally administered bit set. Therefore,
follow this guideline by default.

When the primary interface is set to a locally administered address, the
locally administered bit cannot be set again. Generate a random locally
administered address for this case.

Signed-off-by: Chi-Hsien Lin <[email protected]>
commit 	2bc50d8 upstream.

Will enable FMAC to push more packets to bus tx queue and help
improve throughput when fws queuing is enabled. This change is
required to tune the throughput for passing WMM CERT tests.

Signed-off-by: Madhan Mohan R <[email protected]>
Signed-off-by: Chi-hsien Lin <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
In WLAN, priority among various access categories of traffic is
always set by the AP using WMM parameters and this may not always
follow the standard 802.1d priority.
In this change, priority is adjusted based on the AP WMM params
received as part of the Assoc Response and the same is later used
to map the priority of all incoming traffic.

This change should fix the following 802.11n certification tests:
* 5.2.31 ACM Bit Conformance test
* 5.2.32 AC Parameter Modification test

Signed-off-by: Saravanan Shanmugham <[email protected]>
Signed-off-by: Chi-hsien Lin <[email protected]>
When USB or SDIO device got abnormal bus disconnection, host driver
tried to clean up the SKBs in PSQ and TXQ. The SKBs pointer in hanger
linked to PSQ and TSQ, so we should set the state of skb hanger slot
to BRCMF_FWS_HANGER_ITEM_STATE_FREE before freeing skb. In
brcmf_fws_bus_txq_cleanup it already set BRCMF_FWS_HANGER_ITEM_STATE_FREE
before freeing SKB, therefore we add this in brcmf_fws_psq_flush to
avoid following warning message.

   [ 1580.012880] ------------   [ cut here ]------------
   [ 1580.017550] WARNING: CPU: 3 PID: 3065 at
drivers/net/wireless/broadcom/brcm80211/brcmutil/utils.c:49
brcmu_pkt_buf_free_skb+0x21/0x30 [brcmutil]
   [ 1580.184017] Call Trace:
   [ 1580.186514]  brcmf_fws_cleanup+0x14e/0x190 [brcmfmac]
   [ 1580.191594]  brcmf_fws_del_interface+0x70/0x90 [brcmfmac]
   [ 1580.197029]  brcmf_proto_bcdc_del_if+0xe/0x10 [brcmfmac]
   [ 1580.202418]  brcmf_remove_interface+0x69/0x190 [brcmfmac]
   [ 1580.207888]  brcmf_detach+0x90/0xe0 [brcmfmac]
   [ 1580.212385]  brcmf_usb_disconnect+0x76/0xb0 [brcmfmac]
   [ 1580.217557]  usb_unbind_interface+0x72/0x260
   [ 1580.221857]  device_release_driver_internal+0x141/0x200
   [ 1580.227152]  device_release_driver+0x12/0x20
   [ 1580.231460]  bus_remove_device+0xfd/0x170
   [ 1580.235504]  device_del+0x1d9/0x300
   [ 1580.239041]  usb_disable_device+0x9e/0x270
   [ 1580.243160]  usb_disconnect+0x94/0x270
   [ 1580.246980]  hub_event+0x76d/0x13b0
   [ 1580.250499]  process_one_work+0x144/0x360
   [ 1580.254564]  worker_thread+0x4d/0x3c0
   [ 1580.258247]  kthread+0x109/0x140
   [ 1580.261515]  ? rescuer_thread+0x340/0x340
   [ 1580.265543]  ? kthread_park+0x60/0x60
   [ 1580.269237]  ? SyS_exit_group+0x14/0x20
   [ 1580.273118]  ret_from_fork+0x25/0x30
   [ 1580.300446] ------------   [ cut here ]------------

Signed-off-by: Wright Feng <[email protected]>
Signed-off-by: Chi-hsien Lin <[email protected]>
commit 	837482e upstream.

With firmware RSDB feature
1. The maximum support interface is four.
2. The maximum difference channel is two.
3. The maximum interfaces of {station/p2p client/AP} are two.
4. The maximum interface of p2p device is one.

Signed-off-by: Wright Feng <[email protected]>
Signed-off-by: Soeren Moch <[email protected]>
Reviewed-by: Chi-Hsien Lin <[email protected]>
commit 2635853 upstream.

With RSDB mode, FMAC and firmware are able to create 2 or more AP,
so we should not set mbss in vif structure if firmware does not
support MBSS feature.

Signed-off-by: Wright Feng <[email protected]>
Signed-off-by: Soeren Moch <[email protected]>
Reviewed-by: Chi-Hsien Lin <[email protected]>
With RSDB feature, firmware is able to support two P2P-AGO or two
P2P-GC at the same time. So we add the second p2p connection type
to maps to driver's second P2P connection bsscfg.

Signed-off-by: Wright Feng <[email protected]>
Signed-off-by: Chi-hsien Lin <[email protected]>
commit 6581154be4a2b0f77ff789b09fade7c14ec3078c upstream.

BCM4359 is a 2x2 802.11 abgn+ac Dual-Band HT80 combo chip and it
supports Real Simultaneous Dual Band feature.

Based on a similar patch by: Wright Feng <[email protected]>

Signed-off-by: Soeren Moch <[email protected]>
Acked-by: Chi-Hsien Lin <[email protected]>
Acked-by: Ulf Hansson <[email protected]>
commit be898fe upstream.

With FT-802.1X, driver should send a port authorized event right after
sending a roamed event. It is used to indicate that a new AP is already
authorized so 802.1X is not required.

Acked-by: Arend van Spriel <[email protected]>
Signed-off-by: Chung-Hsien Hsu <[email protected]>
Signed-off-by: Chi-Hsien Lin <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
@NiklasWan NiklasWan force-pushed the submission_gsoc_avb branch from 6e936f9 to 7f60543 Compare August 25, 2020 12:41
@NiklasWan
Copy link
Author

@RobertCNelson I resolved conflicts due to new merges and rebased all changes onto HEAD. Let me know if there are any issues.

@RobertCNelson RobertCNelson force-pushed the 5.4-rt branch 2 times, most recently from 681c6fa to 3fef3b8 Compare January 5, 2021 03:15
@RobertCNelson RobertCNelson force-pushed the 5.4-rt branch 2 times, most recently from dd2e1d9 to b687de1 Compare March 23, 2021 20:34
@RobertCNelson RobertCNelson force-pushed the 5.4-rt branch 3 times, most recently from a0eb9c6 to f1d27f8 Compare May 21, 2021 18:00
@RobertCNelson RobertCNelson force-pushed the 5.4-rt branch 2 times, most recently from 1296885 to 1ec7015 Compare June 3, 2021 01:44
@RobertCNelson RobertCNelson force-pushed the 5.4-rt branch 2 times, most recently from 35c83cd to 99cce5a Compare September 16, 2021 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.