From juri.lelli at gmail.com Fri Mar 23 02:47:40 2018 From: juri.lelli at gmail.com (Juri Lelli) Date: Fri, 23 Mar 2018 10:47:40 +0100 Subject: [QUESTION] Mainline support for B43_PHY_AC wifi cards Message-ID: <20180323094740.GA5942@localhost.localdomain> Hi, I've got a Dell XPS 13 9343/0TM99H (BIOS A15 01/23/2018) mounting a BCM4352 802.11ac (rev 03) wireless card and so far I've been using it on Fedora with broadcom-wl package (which I believe installs Broadcom's STA driver?). It works good apart from occasional hiccups after suspend. I'd like to get rid of that dependency (you can understand that it's particularly annoying when testing mainline kernels), but I found out that support for my card is BROKEN in mainline [1]. Just to see what happens, I forcibly enabled it witnessing that it indeed crashes like below as Kconfig warns. :) bcma: bus0: Found chip with id 0x4352, rev 0x03 and package 0x00 bcma: bus0: Core 0 found: ChipCommon (manuf 0x4BF, id 0x800, rev 0x2B, class 0x0) bcma: bus0: Core 1 found: IEEE 802.11 (manuf 0x4BF, id 0x812, rev 0x2A, class 0x0) bcma: bus0: Core 2 found: ARM CR4 (manuf 0x4BF, id 0x83E, rev 0x02, class 0x0) bcma: bus0: Core 3 found: PCIe Gen2 (manuf 0x4BF, id 0x83C, rev 0x01, class 0x0) bcma: bus0: Core 4 found: USB 2.0 Device (manuf 0x4BF, id 0x81A, rev 0x11, class 0x0) bcma: Unsupported SPROM revision: 11 bcma: bus0: Invalid SPROM read from the PCIe card, trying to use fallback SPROM bcma: bus0: Using fallback SPROM failed (err -2) bcma: bus0: No SPROM available bcma: bus0: Bus registered b43-phy0: Broadcom 4352 WLAN found (core revision 42) b43-phy0: Found PHY: Analog 12, Type 11 (AC), Revision 1 b43-phy0: Found Radio: Manuf 0x17F, ID 0x2069, Revision 4, Version 0 BUG: unable to handle kernel NULL pointer dereference at 0000000000000000 So, question: is replacing my card the only way I can get rid of this downstream dependency? :( Thanks a lot. Best, - Juri [1] https://elixir.bootlin.com/linux/v4.16-rc6/source/drivers/net/wireless/broadcom/b43/Kconfig#L151 From zajec5 at gmail.com Fri Mar 23 06:43:28 2018 From: zajec5 at gmail.com (=?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?=) Date: Fri, 23 Mar 2018 14:43:28 +0100 Subject: [QUESTION] Mainline support for B43_PHY_AC wifi cards In-Reply-To: <20180323094740.GA5942@localhost.localdomain> References: <20180323094740.GA5942@localhost.localdomain> Message-ID: Hi, On 23 March 2018 at 10:47, Juri Lelli wrote: > I've got a Dell XPS 13 9343/0TM99H (BIOS A15 01/23/2018) mounting a > BCM4352 802.11ac (rev 03) wireless card and so far I've been using it on > Fedora with broadcom-wl package (which I believe installs Broadcom's STA > driver?). It works good apart from occasional hiccups after suspend. > > I'd like to get rid of that dependency (you can understand that it's > particularly annoying when testing mainline kernels), but I found out > that support for my card is BROKEN in mainline [1]. Just to see what > happens, I forcibly enabled it witnessing that it indeed crashes like > below as Kconfig warns. :) > > bcma: bus0: Found chip with id 0x4352, rev 0x03 and package 0x00 > bcma: bus0: Core 0 found: ChipCommon (manuf 0x4BF, id 0x800, rev 0x2B, class 0x0) > bcma: bus0: Core 1 found: IEEE 802.11 (manuf 0x4BF, id 0x812, rev 0x2A, class 0x0) > bcma: bus0: Core 2 found: ARM CR4 (manuf 0x4BF, id 0x83E, rev 0x02, class 0x0) > bcma: bus0: Core 3 found: PCIe Gen2 (manuf 0x4BF, id 0x83C, rev 0x01, class 0x0) > bcma: bus0: Core 4 found: USB 2.0 Device (manuf 0x4BF, id 0x81A, rev 0x11, class 0x0) > bcma: Unsupported SPROM revision: 11 > bcma: bus0: Invalid SPROM read from the PCIe card, trying to use fallback SPROM > bcma: bus0: Using fallback SPROM failed (err -2) > bcma: bus0: No SPROM available > bcma: bus0: Bus registered > b43-phy0: Broadcom 4352 WLAN found (core revision 42) > b43-phy0: Found PHY: Analog 12, Type 11 (AC), Revision 1 > b43-phy0: Found Radio: Manuf 0x17F, ID 0x2069, Revision 4, Version 0 > BUG: unable to handle kernel NULL pointer dereference at 0000000000000000 This isn't really useful without a full backtrace. > So, question: is replacing my card the only way I can get rid of this > downstream dependency? :( It's definitely the cheapest way. Getting AC PHY into anything usable (proper setup that will allow Tx & Rx anything) would probably take weeks or months of development. I'm not even going to estimate cost of adding support for 802.11n and 802.11ac features. I was the last person actively working on b43, right now I spend my free time on other hobby projects. Few people were planning to help but it seems it never worked out for them. From juri.lelli at gmail.com Fri Mar 23 07:09:19 2018 From: juri.lelli at gmail.com (Juri Lelli) Date: Fri, 23 Mar 2018 15:09:19 +0100 Subject: [QUESTION] Mainline support for B43_PHY_AC wifi cards In-Reply-To: References: <20180323094740.GA5942@localhost.localdomain> Message-ID: <20180323140919.GB5942@localhost.localdomain> Hi, thanks a lot for your reply! On 23/03/18 14:43, Rafa? Mi?ecki wrote: > Hi, > > On 23 March 2018 at 10:47, Juri Lelli wrote: > > I've got a Dell XPS 13 9343/0TM99H (BIOS A15 01/23/2018) mounting a > > BCM4352 802.11ac (rev 03) wireless card and so far I've been using it on > > Fedora with broadcom-wl package (which I believe installs Broadcom's STA > > driver?). It works good apart from occasional hiccups after suspend. > > > > I'd like to get rid of that dependency (you can understand that it's > > particularly annoying when testing mainline kernels), but I found out > > that support for my card is BROKEN in mainline [1]. Just to see what > > happens, I forcibly enabled it witnessing that it indeed crashes like > > below as Kconfig warns. :) > > > > bcma: bus0: Found chip with id 0x4352, rev 0x03 and package 0x00 > > bcma: bus0: Core 0 found: ChipCommon (manuf 0x4BF, id 0x800, rev 0x2B, class 0x0) > > bcma: bus0: Core 1 found: IEEE 802.11 (manuf 0x4BF, id 0x812, rev 0x2A, class 0x0) > > bcma: bus0: Core 2 found: ARM CR4 (manuf 0x4BF, id 0x83E, rev 0x02, class 0x0) > > bcma: bus0: Core 3 found: PCIe Gen2 (manuf 0x4BF, id 0x83C, rev 0x01, class 0x0) > > bcma: bus0: Core 4 found: USB 2.0 Device (manuf 0x4BF, id 0x81A, rev 0x11, class 0x0) > > bcma: Unsupported SPROM revision: 11 > > bcma: bus0: Invalid SPROM read from the PCIe card, trying to use fallback SPROM > > bcma: bus0: Using fallback SPROM failed (err -2) > > bcma: bus0: No SPROM available > > bcma: bus0: Bus registered > > b43-phy0: Broadcom 4352 WLAN found (core revision 42) > > b43-phy0: Found PHY: Analog 12, Type 11 (AC), Revision 1 > > b43-phy0: Found Radio: Manuf 0x17F, ID 0x2069, Revision 4, Version 0 > > BUG: unable to handle kernel NULL pointer dereference at 0000000000000000 > > This isn't really useful without a full backtrace. Sure. I cut it here because I didn't expect people to debug what is already known to be broken (but still it seemed to carry useful information about the hw). :) > > So, question: is replacing my card the only way I can get rid of this > > downstream dependency? :( > > It's definitely the cheapest way. Getting AC PHY into anything usable > (proper setup that will allow Tx & Rx anything) would probably take > weeks or months of development. I'm not even going to estimate cost of > adding support for 802.11n and 802.11ac features. I was the last > person actively working on b43, right now I spend my free time on > other hobby projects. Few people were planning to help but it seems it > never worked out for them. I see. Just wondering why even if Broadcom's STA solution seems to work fine, it is not mainline. Maybe a maintenance problem? But Fedora ships with very recent kernels, so I'd expect the driver to work with mainline (I tried compiling that against mainline, but I got errors that I didn't spend time figuring out how to fix). Do you know what's the deal w.r.t. the STA driver? Best, - Juri From zajec5 at gmail.com Fri Mar 23 16:01:05 2018 From: zajec5 at gmail.com (=?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?=) Date: Sat, 24 Mar 2018 00:01:05 +0100 Subject: [QUESTION] Mainline support for B43_PHY_AC wifi cards In-Reply-To: <20180323140919.GB5942@localhost.localdomain> References: <20180323094740.GA5942@localhost.localdomain> <20180323140919.GB5942@localhost.localdomain> Message-ID: On 23 March 2018 at 15:09, Juri Lelli wrote: > On 23/03/18 14:43, Rafa? Mi?ecki wrote: >> Hi, >> >> On 23 March 2018 at 10:47, Juri Lelli wrote: >> > I've got a Dell XPS 13 9343/0TM99H (BIOS A15 01/23/2018) mounting a >> > BCM4352 802.11ac (rev 03) wireless card and so far I've been using it on >> > Fedora with broadcom-wl package (which I believe installs Broadcom's STA >> > driver?). It works good apart from occasional hiccups after suspend. >> > >> > I'd like to get rid of that dependency (you can understand that it's >> > particularly annoying when testing mainline kernels), but I found out >> > that support for my card is BROKEN in mainline [1]. Just to see what >> > happens, I forcibly enabled it witnessing that it indeed crashes like >> > below as Kconfig warns. :) >> > >> > bcma: bus0: Found chip with id 0x4352, rev 0x03 and package 0x00 >> > bcma: bus0: Core 0 found: ChipCommon (manuf 0x4BF, id 0x800, rev 0x2B, class 0x0) >> > bcma: bus0: Core 1 found: IEEE 802.11 (manuf 0x4BF, id 0x812, rev 0x2A, class 0x0) >> > bcma: bus0: Core 2 found: ARM CR4 (manuf 0x4BF, id 0x83E, rev 0x02, class 0x0) >> > bcma: bus0: Core 3 found: PCIe Gen2 (manuf 0x4BF, id 0x83C, rev 0x01, class 0x0) >> > bcma: bus0: Core 4 found: USB 2.0 Device (manuf 0x4BF, id 0x81A, rev 0x11, class 0x0) >> > bcma: Unsupported SPROM revision: 11 >> > bcma: bus0: Invalid SPROM read from the PCIe card, trying to use fallback SPROM >> > bcma: bus0: Using fallback SPROM failed (err -2) >> > bcma: bus0: No SPROM available >> > bcma: bus0: Bus registered >> > b43-phy0: Broadcom 4352 WLAN found (core revision 42) >> > b43-phy0: Found PHY: Analog 12, Type 11 (AC), Revision 1 >> > b43-phy0: Found Radio: Manuf 0x17F, ID 0x2069, Revision 4, Version 0 >> > BUG: unable to handle kernel NULL pointer dereference at 0000000000000000 >> >> This isn't really useful without a full backtrace. > > Sure. I cut it here because I didn't expect people to debug what is > already known to be broken (but still it seemed to carry useful > information about the hw). :) Please paste the remaining part if you still got it. >> > So, question: is replacing my card the only way I can get rid of this >> > downstream dependency? :( >> >> It's definitely the cheapest way. Getting AC PHY into anything usable >> (proper setup that will allow Tx & Rx anything) would probably take >> weeks or months of development. I'm not even going to estimate cost of >> adding support for 802.11n and 802.11ac features. I was the last >> person actively working on b43, right now I spend my free time on >> other hobby projects. Few people were planning to help but it seems it >> never worked out for them. > > I see. Just wondering why even if Broadcom's STA solution seems to work > fine, it is not mainline. Maybe a maintenance problem? But Fedora ships > with very recent kernels, so I'd expect the driver to work with mainline > (I tried compiling that against mainline, but I got errors that I didn't > spend time figuring out how to fix). > > Do you know what's the deal w.r.t. the STA driver? Driver being closed source and company not willing to open source it is usually a big problem getting it mainline... -- Rafa? From juri.lelli at gmail.com Sun Mar 25 22:56:43 2018 From: juri.lelli at gmail.com (Juri Lelli) Date: Mon, 26 Mar 2018 07:56:43 +0200 Subject: [QUESTION] Mainline support for B43_PHY_AC wifi cards In-Reply-To: References: <20180323094740.GA5942@localhost.localdomain> <20180323140919.GB5942@localhost.localdomain> Message-ID: <20180326055643.GD5942@localhost.localdomain> On 24/03/18 00:01, Rafa? Mi?ecki wrote: > On 23 March 2018 at 15:09, Juri Lelli wrote: > > On 23/03/18 14:43, Rafa? Mi?ecki wrote: > >> Hi, > >> > >> On 23 March 2018 at 10:47, Juri Lelli wrote: > >> > I've got a Dell XPS 13 9343/0TM99H (BIOS A15 01/23/2018) mounting a > >> > BCM4352 802.11ac (rev 03) wireless card and so far I've been using it on > >> > Fedora with broadcom-wl package (which I believe installs Broadcom's STA > >> > driver?). It works good apart from occasional hiccups after suspend. > >> > > >> > I'd like to get rid of that dependency (you can understand that it's > >> > particularly annoying when testing mainline kernels), but I found out > >> > that support for my card is BROKEN in mainline [1]. Just to see what > >> > happens, I forcibly enabled it witnessing that it indeed crashes like > >> > below as Kconfig warns. :) > >> > > >> > bcma: bus0: Found chip with id 0x4352, rev 0x03 and package 0x00 > >> > bcma: bus0: Core 0 found: ChipCommon (manuf 0x4BF, id 0x800, rev 0x2B, class 0x0) > >> > bcma: bus0: Core 1 found: IEEE 802.11 (manuf 0x4BF, id 0x812, rev 0x2A, class 0x0) > >> > bcma: bus0: Core 2 found: ARM CR4 (manuf 0x4BF, id 0x83E, rev 0x02, class 0x0) > >> > bcma: bus0: Core 3 found: PCIe Gen2 (manuf 0x4BF, id 0x83C, rev 0x01, class 0x0) > >> > bcma: bus0: Core 4 found: USB 2.0 Device (manuf 0x4BF, id 0x81A, rev 0x11, class 0x0) > >> > bcma: Unsupported SPROM revision: 11 > >> > bcma: bus0: Invalid SPROM read from the PCIe card, trying to use fallback SPROM > >> > bcma: bus0: Using fallback SPROM failed (err -2) > >> > bcma: bus0: No SPROM available > >> > bcma: bus0: Bus registered > >> > b43-phy0: Broadcom 4352 WLAN found (core revision 42) > >> > b43-phy0: Found PHY: Analog 12, Type 11 (AC), Revision 1 > >> > b43-phy0: Found Radio: Manuf 0x17F, ID 0x2069, Revision 4, Version 0 > >> > BUG: unable to handle kernel NULL pointer dereference at 0000000000000000 > >> > >> This isn't really useful without a full backtrace. > > > > Sure. I cut it here because I didn't expect people to debug what is > > already known to be broken (but still it seemed to carry useful > > information about the hw). :) > > Please paste the remaining part if you still got it. Sure, please find it below. Thanks! - Juri --->8--- [ 60.732180] cfg80211: Loading compiled-in X.509 certificates for regulatory database [ 60.733048] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7' [ 60.733303] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2 [ 60.733305] cfg80211: failed to load regulatory.db [ 61.047277] bcma: bus0: Found chip with id 0x4352, rev 0x03 and package 0x00 [ 61.047302] bcma: bus0: Core 0 found: ChipCommon (manuf 0x4BF, id 0x800, rev 0x2B, class 0x0) [ 61.047316] bcma: bus0: Core 1 found: IEEE 802.11 (manuf 0x4BF, id 0x812, rev 0x2A, class 0x0) [ 61.047340] bcma: bus0: Core 2 found: ARM CR4 (manuf 0x4BF, id 0x83E, rev 0x02, class 0x0) [ 61.047366] bcma: bus0: Core 3 found: PCIe Gen2 (manuf 0x4BF, id 0x83C, rev 0x01, class 0x0) [ 61.047380] bcma: bus0: Core 4 found: USB 2.0 Device (manuf 0x4BF, id 0x81A, rev 0x11, class 0x0) [ 61.107321] bcma: Unsupported SPROM revision: 11 [ 61.107325] bcma: bus0: Invalid SPROM read from the PCIe card, trying to use fallback SPROM [ 61.107326] bcma: bus0: Using fallback SPROM failed (err -2) [ 61.107327] bcma: bus0: No SPROM available [ 61.109830] bcma: bus0: Bus registered [ 61.242068] b43-phy0: Broadcom 4352 WLAN found (core revision 42) [ 61.242481] b43-phy0: Found PHY: Analog 12, Type 11 (AC), Revision 1 [ 61.242487] b43-phy0: Found Radio: Manuf 0x17F, ID 0x2069, Revision 4, Version 0 [ 61.242909] BUG: unable to handle kernel NULL pointer dereference at 0000000000000000 [ 61.242916] IP: (null) [ 61.242919] PGD 0 P4D 0 [ 61.242924] Oops: 0010 [#1] PREEMPT SMP PTI [ 61.242926] Modules linked in: b43(+) bcma mac80211 cfg80211 ssb mmc_core rfcomm fuse nf_conntrack_netbios_ns nf_conntrack_broadcast xt_CT ip6t_rpfilter ip6t_REJECT nf_reject_ipv6 xt_conntrack ip_set nfnetlink ebtable_nat ebtable_broute bridge stp llc ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_mangle ip6table_raw ip6table_security iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack libcrc32c iptable_mangle iptable_raw iptable_security ebtable_filter ebtables ip6table_filter ip6_tables cmac bnep sunrpc intel_rapl x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel kvm snd_hda_codec_realtek snd_hda_codec_hdmi snd_hda_codec_generic snd_hda_intel btusb snd_hda_codec uvcvideo btrtl btbcm btintel snd_hda_core bluetooth snd_hwdep videobuf2_vmalloc snd_seq [ 61.242989] videobuf2_memops videobuf2_v4l2 iTCO_wdt snd_seq_device snd_pcm videobuf2_common iTCO_vendor_support dell_laptop dell_wmi irqbypass videodev wmi_bmof sparse_keymap dell_smbios intel_cstate dell_wmi_descriptor intel_uncore dcdbas ecdh_generic snd_timer intel_rapl_perf snd rfkill mei_me media pcspkr mei i2c_i801 shpchp joydev tpm_crb soundcore intel_pch_thermal processor_thermal_device lpc_ich tpm_tis intel_soc_dts_iosf wmi tpm_tis_core tpm int3403_thermal dw_dmac int3402_thermal int3400_thermal int340x_thermal_zone acpi_pad acpi_thermal_rel dm_crypt i915 i2c_algo_bit drm_kms_helper drm hid_multitouch crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel serio_raw video i2c_hid [ 61.243044] CPU: 1 PID: 2410 Comm: modprobe Not tainted 4.16.0-rc6+ #2 [ 61.243046] Hardware name: Dell Inc. XPS 13 9343/0TM99H, BIOS A15 01/23/2018 [ 61.243049] RIP: 0010: (null) [ 61.243051] RSP: 0018:ffffaaa6c2afbaf0 EFLAGS: 00010282 [ 61.243054] RAX: 0000000000000000 RBX: ffff908d0b3c4800 RCX: ffff908d0b3c2800 [ 61.243057] RDX: ffff908d0b3c2800 RSI: 0000000000000001 RDI: ffff908d0b3c4800 [ 61.243059] RBP: 0000000000000001 R08: 0000000000000001 R09: 0000000000000000 [ 61.243061] R10: 0000000000000000 R11: 000000000000008b R12: 0000000000000001 [ 61.243064] R13: ffff908d082b9f00 R14: ffff908d0b3c4800 R15: 0000000000000004 [ 61.243067] FS: 00007feb59ec30c0(0000) GS:ffff908d1f480000(0000) knlGS:0000000000000000 [ 61.243069] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 61.243071] CR2: 0000000000000000 CR3: 000000020caaa002 CR4: 00000000003606e0 [ 61.243074] Call Trace: [ 61.243089] ? b43_wireless_core_reset+0x38/0x230 [b43] [ 61.243099] ? b43_one_core_attach+0x368/0xd00 [b43] [ 61.243109] ? b43_bcma_probe+0x54/0xf0 [b43] [ 61.243115] ? bcma_device_probe+0x31/0x60 [bcma] [ 61.243120] ? preempt_count_sub+0x9b/0xd0 [ 61.243125] ? driver_probe_device+0x30b/0x480 [ 61.243129] ? __driver_attach+0xb8/0xe0 [ 61.243133] ? driver_probe_device+0x480/0x480 [ 61.243136] ? driver_probe_device+0x480/0x480 [ 61.243140] ? bus_for_each_dev+0x76/0xc0 [ 61.243144] ? bus_add_driver+0x161/0x260 [ 61.243147] ? 0xffffffffc0ab5000 [ 61.243151] ? driver_register+0x57/0xc0 [ 61.243154] ? 0xffffffffc0ab5000 [ 61.243163] ? b43_init+0x24/0x1000 [b43] [ 61.243167] ? do_one_initcall+0x4e/0x192 [ 61.243172] ? kmem_cache_alloc_trace+0xa1/0x1c0 [ 61.243177] ? do_init_module+0x5b/0x20b [ 61.243180] ? load_module+0x257b/0x2bb0 [ 61.243185] ? vfs_read+0x113/0x130 [ 61.243191] ? SYSC_finit_module+0xe9/0x110 [ 61.243194] ? SYSC_finit_module+0xe9/0x110 [ 61.243200] ? do_syscall_64+0x79/0x190 [ 61.243205] ? entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 61.243209] Code: Bad RIP value. [ 61.243217] RIP: (null) RSP: ffffaaa6c2afbaf0 [ 61.243218] CR2: 0000000000000000 [ 61.243222] ---[ end trace 3e3c52c383af1049 ]--- From joe at perches.com Sat Mar 31 00:05:15 2018 From: joe at perches.com (Joe Perches) Date: Sat, 31 Mar 2018 00:05:15 -0700 Subject: [PATCH 00/12] Ethernet: Add and use ether__addr globals Message-ID: There are many local static and non-static arrays that are used for Ethernet broadcast address output or comparison. Centralize the array into a single separate file and remove the local arrays. Joe Perches (12): ethernet: Add generic ether__addr addresses treewide/net: Rename eth_stp_addr to ether_stp_addr net: mac80211: Use global ether_broadcast_addr bridge: netfilter: Use the new global ether__addr arrays net: atm: Use ether_broadcast_addr wireless: Convert simple uses of a static const Ethernet broadcast address brcmfmac: Convert ALLFFMAC to ether_broadcast_addr iwlegacy: Remove EXPORT_SYMBOL(il_bcast_addr) and use ether_broadcast_addr iwlwifi: Remove local iwl_bcast_addr and use ether_broadcast_addr mvpp2: Use ether_broadcast_addr instead of a local array qlogic: Convert local bcast_addr to global ether_broadcast_addr ethernet: Use ether_zero_addr instead of local statics drivers/net/dsa/lan9303-core.c | 4 ++-- drivers/net/ethernet/broadcom/b44.c | 5 ++--- drivers/net/ethernet/freescale/gianfar.c | 3 +-- drivers/net/ethernet/marvell/mvpp2.c | 4 +--- drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c | 5 +---- drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c | 6 ++---- .../net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c | 6 ++---- drivers/net/wireless/admtek/adm8211.c | 3 +-- drivers/net/wireless/ath/carl9170/mac.c | 4 +--- drivers/net/wireless/broadcom/b43/main.c | 3 +-- .../net/wireless/broadcom/brcm80211/brcmfmac/common.c | 2 -- .../net/wireless/broadcom/brcm80211/brcmfmac/common.h | 2 -- .../wireless/broadcom/brcm80211/brcmfmac/flowring.c | 8 ++++---- drivers/net/wireless/intel/iwlegacy/3945-mac.c | 2 +- drivers/net/wireless/intel/iwlegacy/4965-mac.c | 2 +- drivers/net/wireless/intel/iwlegacy/common.c | 3 --- drivers/net/wireless/intel/iwlegacy/common.h | 1 - drivers/net/wireless/intel/iwlwifi/dvm/dev.h | 1 - drivers/net/wireless/intel/iwlwifi/dvm/scan.c | 2 +- drivers/net/wireless/intel/iwlwifi/dvm/sta.c | 4 +--- drivers/net/wireless/marvell/mwifiex/cfg80211.c | 3 +-- drivers/net/wireless/realtek/rtlwifi/core.c | 5 ++--- drivers/net/wireless/rndis_wlan.c | 6 +----- drivers/net/wireless/ti/wl1251/main.c | 5 +---- drivers/net/wireless/ti/wlcore/main.c | 5 +---- include/linux/etherdevice.h | 13 +++++++++---- net/atm/lec.c | 12 +++++------- net/bridge/br_device.c | 4 ++-- net/bridge/netfilter/ebt_stp.c | 6 ++---- net/ethernet/Makefile | 2 +- net/ethernet/ether_addrs.c | 19 +++++++++++++++++++ net/mac80211/iface.c | 5 +---- net/mac80211/key.c | 6 ++---- net/mac80211/mesh_hwmp.c | 19 ++++++++++--------- net/mac80211/mesh_pathtbl.c | 8 ++++---- 35 files changed, 83 insertions(+), 105 deletions(-) create mode 100644 net/ethernet/ether_addrs.c -- 2.15.0 From joe at perches.com Sat Mar 31 00:05:21 2018 From: joe at perches.com (Joe Perches) Date: Sat, 31 Mar 2018 00:05:21 -0700 Subject: [PATCH 06/12] wireless: Convert simple uses of a static const Ethernet broadcast address In-Reply-To: References: Message-ID: <79196f134a513d50968e8e208a0e56b3c0236ee3.1522479607.git.joe@perches.com> Use the new ether_broadcast_addr global instead to save some object code. Signed-off-by: Joe Perches --- drivers/net/wireless/admtek/adm8211.c | 3 +-- drivers/net/wireless/ath/carl9170/mac.c | 4 +--- drivers/net/wireless/broadcom/b43/main.c | 3 +-- drivers/net/wireless/marvell/mwifiex/cfg80211.c | 3 +-- drivers/net/wireless/realtek/rtlwifi/core.c | 5 ++--- drivers/net/wireless/rndis_wlan.c | 6 +----- drivers/net/wireless/ti/wl1251/main.c | 5 +---- drivers/net/wireless/ti/wlcore/main.c | 5 +---- 8 files changed, 9 insertions(+), 25 deletions(-) diff --git a/drivers/net/wireless/admtek/adm8211.c b/drivers/net/wireless/admtek/adm8211.c index 3b0802fc5bf5..0aa2d114d5b3 100644 --- a/drivers/net/wireless/admtek/adm8211.c +++ b/drivers/net/wireless/admtek/adm8211.c @@ -1354,7 +1354,6 @@ static void adm8211_configure_filter(struct ieee80211_hw *dev, unsigned int *total_flags, u64 multicast) { - static const u8 bcast[ETH_ALEN] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; struct adm8211_priv *priv = dev->priv; unsigned int new_flags; u32 mc_filter[2]; @@ -1385,7 +1384,7 @@ static void adm8211_configure_filter(struct ieee80211_hw *dev, __clear_bit(IEEE80211_HW_RX_INCLUDES_FCS, dev->flags); if (*total_flags & FIF_BCN_PRBRESP_PROMISC) - adm8211_set_bssid(dev, bcast); + adm8211_set_bssid(dev, ether_broadcast_addr); else adm8211_set_bssid(dev, priv->bssid); diff --git a/drivers/net/wireless/ath/carl9170/mac.c b/drivers/net/wireless/ath/carl9170/mac.c index 7d4a72dc98db..b1c608db047c 100644 --- a/drivers/net/wireless/ath/carl9170/mac.c +++ b/drivers/net/wireless/ath/carl9170/mac.c @@ -476,10 +476,8 @@ int carl9170_upload_key(struct ar9170 *ar, const u8 id, const u8 *mac, const int keylen) { struct carl9170_set_key_cmd key = { }; - static const u8 bcast[ETH_ALEN] = { - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; - mac = mac ? : bcast; + mac = mac ? : ether_broadcast_addr; key.user = cpu_to_le16(id); key.keyId = cpu_to_le16(keyidx); diff --git a/drivers/net/wireless/broadcom/b43/main.c b/drivers/net/wireless/broadcom/b43/main.c index b37e7391f55d..f23d60064691 100644 --- a/drivers/net/wireless/broadcom/b43/main.c +++ b/drivers/net/wireless/broadcom/b43/main.c @@ -4185,7 +4185,6 @@ static int b43_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, u8 algorithm; u8 index; int err; - static const u8 bcast_addr[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; if (modparam_nohwcrypt) return -ENOSPC; /* User disabled HW-crypto */ @@ -4293,7 +4292,7 @@ static int b43_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, b43dbg(wl, "%s hardware based encryption for keyidx: %d, " "mac: %pM\n", cmd == SET_KEY ? "Using" : "Disabling", key->keyidx, - sta ? sta->addr : bcast_addr); + sta ? sta->addr : ether_broadcast_addr); b43_dump_keymemory(dev); } mutex_unlock(&wl->mutex); diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c index 7f7e9de2db1c..400a4a67d545 100644 --- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c +++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c @@ -174,7 +174,6 @@ mwifiex_cfg80211_del_key(struct wiphy *wiphy, struct net_device *netdev, static int mwifiex_form_mgmt_frame(struct sk_buff *skb, const u8 *buf, size_t len) { - u8 addr[ETH_ALEN] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; u16 pkt_len; u32 tx_control = 0, pkt_type = PKT_TYPE_MGMT; @@ -191,7 +190,7 @@ mwifiex_form_mgmt_frame(struct sk_buff *skb, const u8 *buf, size_t len) /* Add packet data and address4 */ skb_put_data(skb, buf, sizeof(struct ieee80211_hdr_3addr)); - skb_put_data(skb, addr, ETH_ALEN); + skb_put_data(skb, ether_broadcast_addr, ETH_ALEN); skb_put_data(skb, buf + sizeof(struct ieee80211_hdr_3addr), len - sizeof(struct ieee80211_hdr_3addr)); diff --git a/drivers/net/wireless/realtek/rtlwifi/core.c b/drivers/net/wireless/realtek/rtlwifi/core.c index cfea57efa7f4..8c534a93dad5 100644 --- a/drivers/net/wireless/realtek/rtlwifi/core.c +++ b/drivers/net/wireless/realtek/rtlwifi/core.c @@ -1527,7 +1527,6 @@ static int rtl_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, bool wep_only = false; int err = 0; u8 mac_addr[ETH_ALEN]; - u8 bcast_addr[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; rtlpriv->btcoexist.btc_info.in_4way = false; @@ -1544,7 +1543,7 @@ static int rtl_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, "%s hardware based encryption for keyidx: %d, mac: %pM\n", cmd == SET_KEY ? "Using" : "Disabling", key->keyidx, - sta ? sta->addr : bcast_addr); + sta ? sta->addr : ether_broadcast_addr); rtlpriv->sec.being_setkey = true; rtl_ips_nic_on(hw); mutex_lock(&rtlpriv->locks.conf_mutex); @@ -1649,7 +1648,7 @@ static int rtl_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, memcpy(rtlpriv->sec.key_buf[key_idx], key->key, key->keylen); rtlpriv->sec.key_len[key_idx] = key->keylen; - memcpy(mac_addr, bcast_addr, ETH_ALEN); + memcpy(mac_addr, ether_broadcast_addr, ETH_ALEN); } else { /* pairwise key */ RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, "set pairwise key\n"); diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c index 9935bd09db1f..da0c4f790dd0 100644 --- a/drivers/net/wireless/rndis_wlan.c +++ b/drivers/net/wireless/rndis_wlan.c @@ -1021,11 +1021,7 @@ static int set_bssid(struct usbnet *usbdev, const u8 *bssid) static int clear_bssid(struct usbnet *usbdev) { - static const u8 broadcast_mac[ETH_ALEN] = { - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff - }; - - return set_bssid(usbdev, broadcast_mac); + return set_bssid(usbdev, ether_broadcast_addr); } static int get_bssid(struct usbnet *usbdev, u8 bssid[ETH_ALEN]) diff --git a/drivers/net/wireless/ti/wl1251/main.c b/drivers/net/wireless/ti/wl1251/main.c index bd8641ad953b..442a557ad2e2 100644 --- a/drivers/net/wireless/ti/wl1251/main.c +++ b/drivers/net/wireless/ti/wl1251/main.c @@ -887,9 +887,6 @@ static int wl1251_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, const u8 *addr; int ret; - static const u8 bcast_addr[ETH_ALEN] = - { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; - wl1251_debug(DEBUG_MAC80211, "mac80211 set key"); wl_cmd = kzalloc(sizeof(*wl_cmd), GFP_KERNEL); @@ -898,7 +895,7 @@ static int wl1251_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, goto out; } - addr = sta ? sta->addr : bcast_addr; + addr = sta ? sta->addr : ether_broadcast_addr; wl1251_debug(DEBUG_CRYPT, "CMD: 0x%x", cmd); wl1251_dump(DEBUG_CRYPT, "ADDR: ", addr, ETH_ALEN); diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c index 3a51ab116e79..a4a408f48eeb 100644 --- a/drivers/net/wireless/ti/wlcore/main.c +++ b/drivers/net/wireless/ti/wlcore/main.c @@ -3392,11 +3392,8 @@ static int wl1271_set_key(struct wl1271 *wl, struct wl12xx_vif *wlvif, return ret; } else { const u8 *addr; - static const u8 bcast_addr[ETH_ALEN] = { - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff - }; - addr = sta ? sta->addr : bcast_addr; + addr = sta ? sta->addr : ether_broadcast_addr; if (is_zero_ether_addr(addr)) { /* We dont support TX only encryption */ -- 2.15.0 From pkshih at realtek.com Sat Mar 31 07:01:12 2018 From: pkshih at realtek.com (Pkshih) Date: Sat, 31 Mar 2018 14:01:12 +0000 Subject: [PATCH 06/12] wireless: Convert simple uses of a static const Ethernet broadcast address In-Reply-To: <79196f134a513d50968e8e208a0e56b3c0236ee3.1522479607.git.joe@perches.com> References: <79196f134a513d50968e8e208a0e56b3c0236ee3.1522479607.git.joe@perches.com> Message-ID: <1522504872.1910.17.camel@realtek.com> On Sat, 2018-03-31 at 00:05 -0700, Joe Perches wrote: > Use the new ether_broadcast_addr global instead to save some object code. > > Signed-off-by: Joe Perches > --- > ?drivers/net/wireless/admtek/adm8211.c???????????| 3 +-- > ?drivers/net/wireless/ath/carl9170/mac.c?????????| 4 +--- > ?drivers/net/wireless/broadcom/b43/main.c????????| 3 +-- > ?drivers/net/wireless/marvell/mwifiex/cfg80211.c | 3 +-- > ?drivers/net/wireless/realtek/rtlwifi/core.c?????| 5 ++--- > ?drivers/net/wireless/rndis_wlan.c???????????????| 6 +----- > ?drivers/net/wireless/ti/wl1251/main.c???????????| 5 +---- > ?drivers/net/wireless/ti/wlcore/main.c???????????| 5 +---- > ?8 files changed, 9 insertions(+), 25 deletions(-) > > ? > diff --git a/drivers/net/wireless/realtek/rtlwifi/core.c > b/drivers/net/wireless/realtek/rtlwifi/core.c > index cfea57efa7f4..8c534a93dad5 100644 > --- a/drivers/net/wireless/realtek/rtlwifi/core.c > +++ b/drivers/net/wireless/realtek/rtlwifi/core.c > @@ -1527,7 +1527,6 @@ static int rtl_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, > ? bool wep_only = false; > ? int err = 0; > ? u8 mac_addr[ETH_ALEN]; > - u8 bcast_addr[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; > ? > ? rtlpriv->btcoexist.btc_info.in_4way = false; > ? > @@ -1544,7 +1543,7 @@ static int rtl_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, > ? RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, > ? ?"%s hardware based encryption for keyidx: %d, mac: %pM\n", > ? ??cmd == SET_KEY ? "Using" : "Disabling", key->keyidx, > - ??sta ? sta->addr : bcast_addr); > + ??sta ? sta->addr : ether_broadcast_addr); > ? rtlpriv->sec.being_setkey = true; > ? rtl_ips_nic_on(hw); > ? mutex_lock(&rtlpriv->locks.conf_mutex); > @@ -1649,7 +1648,7 @@ static int rtl_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, > ? memcpy(rtlpriv->sec.key_buf[key_idx], > ? ???????key->key, key->keylen); > ? rtlpriv->sec.key_len[key_idx] = key->keylen; > - memcpy(mac_addr, bcast_addr, ETH_ALEN); > + memcpy(mac_addr, ether_broadcast_addr, ETH_ALEN); Use?ether_addr_copy(mac_addr, ether_broadcast_addr) ? > ? } else { /* pairwise key */ > ? RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, > ? ?"set pairwise key\n"); From joe at perches.com Sat Mar 31 07:33:28 2018 From: joe at perches.com (Joe Perches) Date: Sat, 31 Mar 2018 07:33:28 -0700 Subject: [PATCH 06/12] wireless: Convert simple uses of a static const Ethernet broadcast address In-Reply-To: <1522504872.1910.17.camel@realtek.com> References: <79196f134a513d50968e8e208a0e56b3c0236ee3.1522479607.git.joe@perches.com> <1522504872.1910.17.camel@realtek.com> Message-ID: <1522506808.11653.7.camel@perches.com> On Sat, 2018-03-31 at 14:01 +0000, Pkshih wrote: > On Sat, 2018-03-31 at 00:05 -0700, Joe Perches wrote: > > Use the new ether_broadcast_addr global instead to save some object code. [] > > diff --git a/drivers/net/wireless/realtek/rtlwifi/core.c [] > > @@ -1649,7 +1648,7 @@ static int rtl_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, > > memcpy(rtlpriv->sec.key_buf[key_idx], > > key->key, key->keylen); > > rtlpriv->sec.key_len[key_idx] = key->keylen; > > - memcpy(mac_addr, bcast_addr, ETH_ALEN); > > + memcpy(mac_addr, ether_broadcast_addr, ETH_ALEN); > > Use ether_addr_copy(mac_addr, ether_broadcast_addr) ? This should use eth_broadcast_addr(mac_addr) instead. There are similar conversion still possible in the tree. One day.