Hello Community,

I wonder if some of you could give me some advice about the way proposed
to fix the problem exposed below.

Regarding RHBZ#1703745 and RFBZ#5245:

https://bugzilla.redhat.com/show_bug.cgi?id=1703745
https://bugzilla.rpmfusion.org/show_bug.cgi?id=5245

Broadcom STA wireless module seems not to work correctly with the last
version of wpa_supplicant Fedora's package (new features activated).
There seems that randomizing MAC address while scanning for AP puzzles
Broadcom module.

First try to fix this issue was to add some piece of code that tells
what are the NL80211 types the module assumes. Random success was the
result. Some times connecting to AP was successful, but it was most of
the time failing.

The second way trying to fix the problem was to add to the broadcom-wl
package a NetworManager configuration file that deactivate the
randomizing MAC address while scanning for an AP. The disadvantage is
less privacy for all the wireless usage. Sometimes, this setting is just
needed when acquiring IP address requires one fix MAC address (MAC
filtering).
One more disadvantage is that the randomizing MAC address while scanning
for AP is disabled only when using NetworkManager.

Thanks to Davide Caratti one workaround was proposed to users in
setting-up a COPR repository containing a downgraded version of
wpa_supplicant package before the changes that caused the issue (see
RHBZ#1703745).

My questions are: 

- Do you think it is worth to add definitively to the rpmfusion
broadcom-wl package the configuration file to disable NetworkManager
randomizing MAC address while scanning for an AP ? For your information,
as exposed in RHBZ#1703745 some distributions already provides such a
file and for multiple wireless drivers including wl module.

- Do you think it is worth applying the patch to the rpmfusion wl-kmod
package that adds the piece of code that tells what are the NL80211
types the module assumes ?

As last information, since my own comment #63 on RHBZ#1703745 (posted
2019-06-22), I use the patch and the configuration file proposed above
on my laptop without any problem (more than 2 months). Some users
reported in the bug reports some difficulties to use the configuration
file.

If you think it would be worth applying the patch and providing the
configuration file in rpmfusion packages, I will also add some
documentation to the fedora.readme file already provided in the
broadcom-wl package and comments in the 90-broadcom-wl.conf file.

All the necessary files needed to understand this message are provided
as attachment.

Thanks in advance for your responses.

Cordially,


-- 
NVieville
## /usr/lib/NetworkManager/conf.d/90-broadcom-wl.conf file
##
##   Use only with Broadcom STA wireless driver provided by RPMFusion
##   broadcom-wl, akmod-wl and kmod-wl packages.
##
##   This file disables randomized MAC address while scanning wireless
##   access point with Broadcom STA wireless driver (wl) as a workaround
##   for RHBZ#1703745 and RFBZ#5245.
##   See also:
##   - https://bugzilla.gnome.org/show_bug.cgi?id=777523
##   - RHBZ#1695696
##
##   Use with care as anonymity is potentially disabled while scanning
##   for a wireless access point.
##
[device-disable-wifi-scan-rand-mac-address]
match-device=driver:wl
wifi.scan-rand-mac-address=no

[connection-disable-wifi-scan-rand-mac-address]
match-device=driver:wl
wifi.cloned-mac-address=preserve
ethernet.cloned-mac-address=preserve
This file provides some basic information about Broadcom STA wireless
driver configuration files on Fedora with RPMFusion packages.
------------------------------------------------------------------------
Version 0.1 - Tue Nov 06 2012 - initial release
Version 0.2 - Wed Jun 19 2019 - Added NetworkManager configuration to
                                disable random MAC address while
                                scanning for AP
------------------------------------------------------------------------

------------------------------------------------------------------------
Table of content
  0. Cautions
  1. Choosing between WEXT or CFG80211 API
  2. Initramfs configuration file usage
  3. NetworkManager configuration file usage
  4. Support
------------------------------------------------------------------------


0. Cautions
===========

The files mentioned in this document should not be used in a wireless
operational system. Only failing wireless system should give a try to
these files and the proposed solutions.
Use them at your own risk and only if your system could not boot
properly or if your Broadcom wireless device doesn't work correctly.


1. Choosing between WEXT or CFG80211 API
========================================

Some configurations require the user to choose between the WEXT API or
CFG80211 API in order to get Broadcom STA wireless driver properly
loaded, and correctly usable by third-party softwares.
Since this driver cannot be configured on-the-fly, the only solution is
to use RPMFusion akmod-wl package only and set the
/etc/akmods/akmod-wl/api file correctly.
No RPMFusion kmod-wl package installed will take care of the settings
provided in the /etc/akmods/akmod-wl/api file, and using this file
requires an exclusive usage of the akmod-wl package.

/etc/akmods/akmod-wl/api file should contain only one line depending on
the API choosen:

API=WEXT

to force building the module with WEXT API or

API=CFG80211

to force building the module with CFG80211 API or

#API=WEXT

or

#API=CFG80211

to let the Broadcom included Makefile do the right choice according to
your current kernel version.

#API=WEXT is the default setting.

Once this file modified, one should rebuild current kmod-wl package for
the current kernel by typing this command:

akmods --force --kernel `uname -r` --akmod wl

Reboot should be needed in order to get last wl module correctly loaded.

Caution :
---------

WEXT API will be dropped from future kernels according to
https://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=10bab00afed042c1a38ed5ffb135e2aea5ce1277

This workaround should only used on compatibles kernels with the
WEXT API.
One should considere to switch to higher wireless compatible Fedora
Release in order to get the most recent CFG80211 API with most recent
kernel.

This workaround will be dropped from the future broadcom-wl, kmod-wl and
akmod-wl packages when the WEXT API will be dropped too.


2. Initramfs configuration file usage
=====================================

Please read comments in /etc/dracut.conf.d/20-wl.conf file in order to
configure loading modules needed by the Broadcom STA wireless driver in
kernel's init ramdisks.

Edit the /etc/dracut.conf.d/20-wl.conf file and comment/uncomment the
one line "add_drivers+=" directive depending on your choice.

For example

# nano /etc/dracut.conf.d/20-wl.conf

or

# sudo nano /etc/dracut.conf.d/20-wl.conf

should let you to modify this file, ctrl+o would save the file, and
ctrl+x should quit nano.

Then use dracut command to rebuild your current kernel initramfs file.
See http://people.redhat.com/harald/dracut.html#id489921 and
http://people.redhat.com/harald/dracut.html#dracutconf5 for complete
explanations on using dracut.


3. NetworkManager configuration file usage
==========================================

To try to fix issue related in RHBZ#1703745 and RFBZ#5245 the
/usr/lib/NetworkManager/conf.d/90-broadcom-wl.conf file is provided.

This file disables NetworkManager randomization of MAC address only for
Broadcom wireless device using this driver (wl) while scanning for
wireless access point.
It prevent producing "CTRL-EVENT-SCAN-FAILED ret=-22 retry=1" messages
in logs (journalctl -xe) and the inability to connect to wireless access
point.

The drawback of this setting is that scanning for wireless access point
uses only the real MAC address of the device and produces less
anonymity.

In order to disable this setting, one have to create one empty file
using the exact same name in /etc/NetworkManager/conf.d directory.
In a root console, type:

touch /etc/NetworkManager/conf.d/90-broadcom-wl.conf

To re-enable this setting, remove the file previously created.
In a root console, type:

rm -f /etc/NetworkManager/conf.d/90-broadcom-wl.conf


4. Support
==========

Support only about these configuration files will be provided on:

https://bugzilla.rpmfusion.org/enter_bug.cgi?product=Fedora
diff -Naur hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/wl/sys/wl_cfg80211_hybrid.c hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/wl/sys/wl_cfg80211_hybrid.c
--- hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/wl/sys/wl_cfg80211_hybrid.c	2019-04-14 17:35:23.565460847 +0200
+++ hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/wl/sys/wl_cfg80211_hybrid.c	2019-06-01 14:37:25.675650990 +0200
@@ -522,6 +522,10 @@
 	switch (type) {
 	case NL80211_IFTYPE_MONITOR:
 	case NL80211_IFTYPE_WDS:
+	case NL80211_IFTYPE_MESH_POINT:
+	case NL80211_IFTYPE_P2P_DEVICE:
+	case NL80211_IFTYPE_P2P_CLIENT:
+	case NL80211_IFTYPE_P2P_GO:
 		WL_ERR(("type (%d) : currently we do not support this type\n",
 			type));
 		return -EOPNOTSUPP;
@@ -532,6 +536,10 @@
 		wl->conf->mode = WL_MODE_BSS;
 		infra = 1;
 		break;
+	case NL80211_IFTYPE_AP:
+		wl->conf->mode = WL_MODE_AP;
+		ap = 1;
+		break;
 	default:
 		return -EINVAL;
 	}
@@ -1893,6 +1901,8 @@
 		return NL80211_IFTYPE_STATION;
 	case WL_MODE_IBSS:
 		return NL80211_IFTYPE_ADHOC;
+	case WL_MODE_AP:
+		return NL80211_IFTYPE_AP;
 	default:
 		return NL80211_IFTYPE_UNSPECIFIED;
 	}
@@ -1900,6 +1910,46 @@
 	return err;
 }
 
+static const struct ieee80211_txrx_stypes
+wl_txrx_stypes[NUM_NL80211_IFTYPES] = {
+	[NL80211_IFTYPE_STATION] = {
+		.tx = 0xffff,
+		.rx = BIT(IEEE80211_STYPE_ACTION >> 4) |
+		      BIT(IEEE80211_STYPE_PROBE_REQ >> 4)
+	},
+	[NL80211_IFTYPE_AP] = {
+		.tx = 0xffff,
+		.rx = BIT(IEEE80211_STYPE_ASSOC_REQ >> 4) |
+		      BIT(IEEE80211_STYPE_REASSOC_REQ >> 4) |
+		      BIT(IEEE80211_STYPE_PROBE_REQ >> 4) |
+		      BIT(IEEE80211_STYPE_DISASSOC >> 4) |
+		      BIT(IEEE80211_STYPE_AUTH >> 4) |
+		      BIT(IEEE80211_STYPE_DEAUTH >> 4) |
+		      BIT(IEEE80211_STYPE_ACTION >> 4)
+	}
+};
+
+static const struct ieee80211_iface_limit wl_limits[] = {
+	{
+		.max = 1,
+		.types = BIT(NL80211_IFTYPE_STATION),
+	},
+	{
+		.max = 1, 
+		.types = BIT(NL80211_IFTYPE_AP),
+	},
+};
+
+static const struct ieee80211_iface_combination wl_combination [] = {
+	{
+		.limits = wl_limits,
+		.n_limits = ARRAY_SIZE(wl_limits),
+		.max_interfaces = 2,
+		.num_different_channels = 1,
+		.beacon_int_infra_match = true,
+	},
+};
+
 static s32 wl_alloc_wdev(struct device *dev, struct wireless_dev **rwdev)
 {
 	struct wireless_dev *wdev;
@@ -1922,7 +1972,10 @@
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 33)
 	wdev->wiphy->max_num_pmkids = WL_NUM_PMKIDS_MAX;
 #endif
-	wdev->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_ADHOC);
+	wdev->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_ADHOC) | BIT(NL80211_IFTYPE_AP);
+	wdev->wiphy->iface_combinations = wl_combination;
+	wdev->wiphy->n_iface_combinations = ARRAY_SIZE(wl_combination);
+	wdev->wiphy->mgmt_stypes = wl_txrx_stypes;
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
 	wdev->wiphy->bands[NL80211_BAND_2GHZ] = &__wl_band_2ghz;
 	wdev->wiphy->bands[NL80211_BAND_5GHZ] = &__wl_band_5ghz_a; 
@@ -2944,15 +2997,22 @@
 	switch (iftype) {
 	case NL80211_IFTYPE_MONITOR:
 	case NL80211_IFTYPE_WDS:
+	case NL80211_IFTYPE_MESH_POINT:
+	case NL80211_IFTYPE_P2P_DEVICE:
+	case NL80211_IFTYPE_P2P_CLIENT:
+	case NL80211_IFTYPE_P2P_GO:
 		WL_ERR(("type (%d) : currently we do not support this mode\n",
 			iftype));
-		err = -EINVAL;
+		err = -EOPNOTSUPP;
 		return err;
 	case NL80211_IFTYPE_ADHOC:
 		break;
 	case NL80211_IFTYPE_STATION:
 		infra = 1;
 		break;
+	case NL80211_IFTYPE_AP:
+		ap = 1;
+		break;
 	default:
 		err = -EINVAL;
 		WL_ERR(("invalid type (%d)\n", iftype));
_______________________________________________
rpmfusion-developers mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to