linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* brcmfmac: _brcmf_set_mac_address: Setting cur_etheraddr failed, -52
@ 2015-07-09  7:07 Rafał Miłecki
  2015-07-09 10:38 ` Rafał Miłecki
  2015-07-09 18:08 ` Arend van Spriel
  0 siblings, 2 replies; 5+ messages in thread
From: Rafał Miłecki @ 2015-07-09  7:07 UTC (permalink / raw)
  To: linux-wireless@vger.kernel.org, brcm80211 development

[-- Attachment #1: Type: text/plain, Size: 903 bytes --]

Hey guys, I'm afraid I hit another brcmfmac bug.

First of all, I implemented a trivial workaround for the previous bug
reported in the:
brcmfmac: one faulty "iw interface add" command breaks in-firmware BSS state
See my workaround in OpenWrt git:
http://git.openwrt.org/?p=openwrt.git;a=commitdiff;h=0e6c9bd9556eea98b476ad371d64d8d16e3a9f9c

So now OpenWrt's user space calls using "iw" tool don't trigger
brcmfmac BSSes bug anymore. I can successfully use one AP interface
per device.

The problem appears when trying to use more than 1 interface. It gets
created correctly, but setting its MAC fails. It results in wlan0-1
having the same MAC as wlan0 and finally having two networks (SSIDs)
using the same MAC. That obviously doesn't work.

The error I see is:
brcmfmac: _brcmf_set_mac_address: Setting cur_etheraddr failed, -52
with -52 meaning BCME_IE_NOTFOUND.

-- 
Rafał

[-- Attachment #2: dmesg.txt --]
[-- Type: text/plain, Size: 1873 bytes --]

[   17.014251] brcmfmac 0000:01:00.0: enabling device (0140 -> 0142)
[   17.028974] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[   17.036950] cfg80211:   (2457000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[   17.044939] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A)
[   17.052922] cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A)
[   17.062363] cfg80211:   (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s)
[   17.071805] cfg80211:   (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s)
[   17.079859] cfg80211:   (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
[   17.087842] cfg80211:   (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A)
[   17.867533] brcmfmac 0000:01:00.0: Direct firmware load for brcm/brcmfmac43602-pcie.txt failed with error -2
[   17.877408] brcmfmac 0000:01:00.0: Falling back to user helper
[   17.892499] firmware brcm!brcmfmac43602-pcie.txt: firmware_loading_store: map pages failed
[   17.901084] brcmfmac: brcmf_fw_request_nvram_done: Found platform NVRAM (19204 B)
[   18.163675] brcmfmac: brcmf_c_preinit_dcmds: Firmware version = wl0: Mar  3 2015 04:46:51 version 7.35.177.33 (r538052) FWID 01-c8317c80
[   18.184345] brcmfmac: brcmf_cfg80211_reg_notifier: not a ISO3166 code
[  203.691845] brcmfmac: brcmf_add_if: ERROR: netdev:wlan0 already exists
[  203.698361] brcmfmac: brcmf_add_if: ignore IF event
[  203.866214] brcmfmac: brcmf_add_if: ERROR: netdev:wlan0 already exists
[  203.872750] brcmfmac: brcmf_add_if: ignore IF event
[  203.932492] brcmfmac: _brcmf_set_mac_address: Setting cur_etheraddr failed, -52
[  204.088635] brcmfmac: brcmf_add_if: ERROR: netdev:wlan0 already exists
[  204.095205] brcmfmac: brcmf_add_if: ignore IF event

[-- Attachment #3: hostapd.conf --]
[-- Type: application/octet-stream, Size: 799 bytes --]

driver=nl80211
logger_syslog=127
logger_syslog_level=2
logger_stdout=127
logger_stdout_level=2
hw_mode=g
channel=11

ieee80211n=1
ht_coex=0
ht_capab=[SHORT-GI-20][DSSS_CCK-40]

interface=wlan0
ctrl_interface=/var/run/hostapd
disassoc_low_ack=1
preamble=1
wmm_enabled=1
ignore_broadcast_ssid=0
uapsd_advertisement_enabled=1
wpa_passphrase=password123
auth_algs=1
wpa=2
wpa_pairwise=CCMP
ssid=OpenWrtA
bridge=br-lan
wpa_key_mgmt=WPA-PSK
okc=0
disable_pmksa_caching=1
bssid=00:23:6a:a3:7d:95


bss=wlan0-1
ctrl_interface=/var/run/hostapd
disassoc_low_ack=1
preamble=1
wmm_enabled=1
ignore_broadcast_ssid=0
uapsd_advertisement_enabled=1
wpa_passphrase=password123
auth_algs=1
wpa=2
wpa_pairwise=CCMP
ssid=OpenWrtB
bridge=br-lan
wpa_key_mgmt=WPA-PSK
okc=0
disable_pmksa_caching=1
bssid=02:23:6a:a3:7d:95

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: brcmfmac: _brcmf_set_mac_address: Setting cur_etheraddr failed, -52
  2015-07-09  7:07 brcmfmac: _brcmf_set_mac_address: Setting cur_etheraddr failed, -52 Rafał Miłecki
@ 2015-07-09 10:38 ` Rafał Miłecki
  2015-07-09 12:08   ` Rafał Miłecki
  2015-07-09 18:08 ` Arend van Spriel
  1 sibling, 1 reply; 5+ messages in thread
From: Rafał Miłecki @ 2015-07-09 10:38 UTC (permalink / raw)
  To: linux-wireless@vger.kernel.org, brcm80211 development

On 9 July 2015 at 09:07, Rafał Miłecki <zajec5@gmail.com> wrote:
> The problem appears when trying to use more than 1 interface. It gets
> created correctly, but setting its MAC fails. It results in wlan0-1
> having the same MAC as wlan0 and finally having two networks (SSIDs)
> using the same MAC. That obviously doesn't work.
>
> The error I see is:
> brcmfmac: _brcmf_set_mac_address: Setting cur_etheraddr failed, -52
> with -52 meaning BCME_IE_NOTFOUND.

I managed to find/guess what exactly BCM43602 firmware rejects. It
doesn't like 2 MAC addresses that differ by the locally administrated
bit only. In my case it was 00:23:6a:a3:7d:95 + 02:23:6a:a3:7d:95.

When I change MAC addresses to some other combination, e.g.:
00:23:6a:a3:7d:95 + 00:23:6a:a3:7d:96
02:23:6a:a3:7d:95 + 00:23:6a:a3:7d:96
it works correctly.

Any idea why Broadcom driver/firmware team decided to reject MAC
address that differ by locally administrated bit only from the already
used one? I don't think there is anything wrong with that in general.

Is there a chance to release fixed firmware?

-- 
Rafał

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: brcmfmac: _brcmf_set_mac_address: Setting cur_etheraddr failed, -52
  2015-07-09 10:38 ` Rafał Miłecki
@ 2015-07-09 12:08   ` Rafał Miłecki
  0 siblings, 0 replies; 5+ messages in thread
From: Rafał Miłecki @ 2015-07-09 12:08 UTC (permalink / raw)
  To: linux-wireless@vger.kernel.org, brcm80211 development

On 9 July 2015 at 12:38, Rafał Miłecki <zajec5@gmail.com> wrote:
> On 9 July 2015 at 09:07, Rafał Miłecki <zajec5@gmail.com> wrote:
>> The problem appears when trying to use more than 1 interface. It gets
>> created correctly, but setting its MAC fails. It results in wlan0-1
>> having the same MAC as wlan0 and finally having two networks (SSIDs)
>> using the same MAC. That obviously doesn't work.
>>
>> The error I see is:
>> brcmfmac: _brcmf_set_mac_address: Setting cur_etheraddr failed, -52
>> with -52 meaning BCME_IE_NOTFOUND.
>
> I managed to find/guess what exactly BCM43602 firmware rejects. It
> doesn't like 2 MAC addresses that differ by the locally administrated
> bit only. In my case it was 00:23:6a:a3:7d:95 + 02:23:6a:a3:7d:95.
>
> When I change MAC addresses to some other combination, e.g.:
> 00:23:6a:a3:7d:95 + 00:23:6a:a3:7d:96
> 02:23:6a:a3:7d:95 + 00:23:6a:a3:7d:96
> it works correctly.

Oh, it appeared to be more tricky. What BCM43602 firmware doesn't
allow is using the same value in the last 2 bits for different BSSes.

Few examples:
00:23:6a:a3:7d:90 + 00:23:6a:a3:7d:91 is GOOD
00:23:6a:a3:7d:90 + 00:23:6a:a3:7d:93 is GOOD
00:23:6a:a3:7d:90 + 00:23:6a:a3:7d:94 is BAD (last two bits are 0x0)
00:23:6a:a3:7d:92 + 00:23:6a:a3:7d:9a is BAD (last two bits are 0x2)

What's weird, all other numbers can be used as you want:
00:23:6A:A3:7D:90 + 00:7D:A3:6A:23:92 is GOOD

-- 
Rafał

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: brcmfmac: _brcmf_set_mac_address: Setting cur_etheraddr failed, -52
  2015-07-09  7:07 brcmfmac: _brcmf_set_mac_address: Setting cur_etheraddr failed, -52 Rafał Miłecki
  2015-07-09 10:38 ` Rafał Miłecki
@ 2015-07-09 18:08 ` Arend van Spriel
  2015-07-09 19:10   ` Rafał Miłecki
  1 sibling, 1 reply; 5+ messages in thread
From: Arend van Spriel @ 2015-07-09 18:08 UTC (permalink / raw)
  To: Rafał Miłecki, linux-wireless@vger.kernel.org,
	brcm80211 development

On 07/09/2015 09:07 AM, Rafał Miłecki wrote:
> Hey guys, I'm afraid I hit another brcmfmac bug.
>
> First of all, I implemented a trivial workaround for the previous bug
> reported in the:
> brcmfmac: one faulty "iw interface add" command breaks in-firmware BSS state
> See my workaround in OpenWrt git:
> http://git.openwrt.org/?p=openwrt.git;a=commitdiff;h=0e6c9bd9556eea98b476ad371d64d8d16e3a9f9c
>
> So now OpenWrt's user space calls using "iw" tool don't trigger
> brcmfmac BSSes bug anymore. I can successfully use one AP interface
> per device.
>
> The problem appears when trying to use more than 1 interface. It gets
> created correctly, but setting its MAC fails. It results in wlan0-1
> having the same MAC as wlan0 and finally having two networks (SSIDs)
> using the same MAC. That obviously doesn't work.

Can we please take one step back. I am not understanding how you guys 
use the multiple interfaces. The multiple AP interfaces in brcmfmac are 
only intended for Multiple-BSS feature as described in hostapd.conf 
which changes wlan0 from STA to AP and creates additional AP interfaces, 
but you seem to be creating an AP interface with iw next to a STA interface.

I actually have patches pending that correct the announced interface 
combinations. I am currently on vacation as my family expanded with a 
baby girl.

Regards,
Arend

> The error I see is:
> brcmfmac: _brcmf_set_mac_address: Setting cur_etheraddr failed, -52
> with -52 meaning BCME_IE_NOTFOUND.
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: brcmfmac: _brcmf_set_mac_address: Setting cur_etheraddr failed, -52
  2015-07-09 18:08 ` Arend van Spriel
@ 2015-07-09 19:10   ` Rafał Miłecki
  0 siblings, 0 replies; 5+ messages in thread
From: Rafał Miłecki @ 2015-07-09 19:10 UTC (permalink / raw)
  To: Arend van Spriel; +Cc: linux-wireless@vger.kernel.org, brcm80211 development

On 9 July 2015 at 20:08, Arend van Spriel <arend@broadcom.com> wrote:
> On 07/09/2015 09:07 AM, Rafał Miłecki wrote:
>>
>> Hey guys, I'm afraid I hit another brcmfmac bug.
>>
>> First of all, I implemented a trivial workaround for the previous bug
>> reported in the:
>> brcmfmac: one faulty "iw interface add" command breaks in-firmware BSS
>> state
>> See my workaround in OpenWrt git:
>>
>> http://git.openwrt.org/?p=openwrt.git;a=commitdiff;h=0e6c9bd9556eea98b476ad371d64d8d16e3a9f9c
>>
>> So now OpenWrt's user space calls using "iw" tool don't trigger
>> brcmfmac BSSes bug anymore. I can successfully use one AP interface
>> per device.
>>
>> The problem appears when trying to use more than 1 interface. It gets
>> created correctly, but setting its MAC fails. It results in wlan0-1
>> having the same MAC as wlan0 and finally having two networks (SSIDs)
>> using the same MAC. That obviously doesn't work.
>
>
> Can we please take one step back. I am not understanding how you guys use
> the multiple interfaces. The multiple AP interfaces in brcmfmac are only
> intended for Multiple-BSS feature as described in hostapd.conf which changes
> wlan0 from STA to AP and creates additional AP interfaces, but you seem to
> be creating an AP interface with iw next to a STA interface.

OpenWrt tries to remove all existing interfaces and then create needed
ones from the scratch. So e.g. after loading brcmfmac you have:
wlan0

Lets say OpenWrt wants 2 AP interfaces, so it calls:
iw dev wlan0 del
iw phy phy0 interface add wlan0 type __ap
iw phy phy0 interface add wlan0-1 type __ap

The first command fails (brcmfmac limitation), the second one gets
rejected (wlan0 already exists) and the third one creates new virtual
interface. This results in having two interfaces: STA and AP.
Then OpenWrt finally runs hostapd which changes wlan0 to AP and starts
AP on both interfaces.


> I actually have patches pending that correct the announced interface
> combinations. I am currently on vacation as my family expanded with a baby
> girl.

Have fun! :)

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-07-09 19:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-09  7:07 brcmfmac: _brcmf_set_mac_address: Setting cur_etheraddr failed, -52 Rafał Miłecki
2015-07-09 10:38 ` Rafał Miłecki
2015-07-09 12:08   ` Rafał Miłecki
2015-07-09 18:08 ` Arend van Spriel
2015-07-09 19:10   ` Rafał Miłecki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).