Wireless Issue

Hi

I’m using the linaro developer image and I seem to be getting an error in wcn36xx each time about a failure to “read macaddress file wlan/macaddr0, using a random address instead”. This seems to create a new wlan interface each time. Is there any fix for this or do I just need to run wpa-supplicant each time on startup?

Thanks,
Jon

Hi Jon

What release are you using and could you share the output of
$uname -a

and the relevant sections of
$dmesg

cheers
Jorge

Hi Jorge-

I flashed the following files via fastboot:
boot-linaro-vivid-qcom-snapdragon-arm64-20150618-47.img
linaro-vivid-developer-qcom-snapdragon-arm64-20150618-47.img

user@linaro-developer:~$ uname -a
Linux linaro-developer 4.0.0-linaro-lt-qcom #1 SMP PREEMPT Thu Jun 18 09:43:10 UTC 2015 aarch64 aarch64 aarch64 GNU/Linux

dmesg:
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Initializing cgroup subsys cpuacct
[ 0.000000] Linux version 4.0.0-linaro-lt-qcom (buildslave@x86-64-07) (gcc version 4.9.2 20140904 (prerelease) (crosstool-NG linaro-1.13.1-4.9-2014.09 - Linaro GCC 4.9-2014.09) ) #1 SMP PREEMPT Thu Jun 18 09:43:10 UTC 2015
[ 0.000000] CPU: AArch64 Processor [410fd030] revision 0
[ 0.000000] Detected VIPT I-cache on CPU0
[ 0.000000] alternatives: enabling workaround for ARM errata 826319, 827319, 824069
[ 0.000000] efi: Getting EFI parameters from FDT:
[ 0.000000] efi: UEFI not found.
[ 0.000000] Reserved memory: created CMA memory pool at 0x0000000086000000, size 8 MiB
[ 0.000000] Reserved memory: initialized node external_image_region@86000000, compatible id removed-dma-pool
[ 0.000000] Reserved memory: created CMA memory pool at 0x0000000086800000, size 78 MiB
[ 0.000000] Reserved memory: initialized node modem_adsp_region@86800000, compatible id removed-dma-pool
[ 0.000000] Reserved memory: created CMA memory pool at 0x000000008b600000, size 6 MiB
[ 0.000000] Reserved memory: initialized node peripheral_region@8b600000, compatible id removed-dma-pool
[ 0.000000] Reserved memory: created CMA memory pool at 0x000000008f800000, size 8 MiB
[ 0.000000] Reserved memory: initialized node venus_qseecom_region, compatible id shared-dma-pool
[ 0.000000] Reserved memory: created CMA memory pool at 0x00000000bfc00000, size 4 MiB
[ 0.000000] Reserved memory: initialized node audio_region, compatible id shared-dma-pool
[ 0.000000] cma: Reserved 64 MiB at 0x00000000bbc00000
[ 0.000000] On node 0 totalpages: 238592
[ 0.000000] DMA zone: 3728 pages used for memmap
[ 0.000000] DMA zone: 0 pages reserved
[ 0.000000] DMA zone: 238592 pages, LIFO batch:31
[ 0.000000] PERCPU: Embedded 15 pages/cpu @ffffffc03bb54000 s22208 r8192 d31040 u61440
[ 0.000000] pcpu-alloc: s22208 r8192 d31040 u61440 alloc=15*4096
[ 0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 234864
[ 0.000000] Kernel command line: root=/dev/disk/by-partlabel/rootfs rw rootwait console=tty0 console=ttyMSM0,115200n8 text androidboot.emmc=true androidboot.serialno=b6631d88 androidboot.baseband=apq mdss_mdp.panel=0:dsi:0:
[ 0.000000] PID hash table entries: 4096 (order: 3, 32768 bytes)
[ 0.000000] Dentry cache hash table entries: 131072 (order: 8, 1048576 bytes)
[ 0.000000] Inode-cache hash table entries: 65536 (order: 7, 524288 bytes)
[ 0.000000] software IO TLB [mem 0xb6800000-0xba800000] (64MB) mapped at [ffffffc036800000-ffffffc03a7fffff]
[ 0.000000] Memory: 744788K/954368K available (7049K kernel code, 543K rwdata, 2828K rodata, 276K init, 15220K bss, 131756K reserved, 77824K cma-reserved)
[ 0.000000] Virtual kernel memory layout:
vmalloc : 0xffffff8000000000 - 0xffffffbdbfff0000 ( 246 GB)
vmemmap : 0xffffffbdc0000000 - 0xffffffbfc0000000 ( 8 GB maximum)
0xffffffbdc2000000 - 0xffffffbdc3000000 ( 16 MB actual)
fixed : 0xffffffbffabfe000 - 0xffffffbffac00000 ( 8 KB)
PCI I/O : 0xffffffbffae00000 - 0xffffffbffbe00000 ( 16 MB)
modules : 0xffffffbffc000000 - 0xffffffc000000000 ( 64 MB)
memory : 0xffffffc000000000 - 0xffffffc040000000 ( 1024 MB)
.init : 0xffffffc000a28000 - 0xffffffc000a6d000 ( 276 KB)
.text : 0xffffffc000080000 - 0xffffffc000a277c4 ( 9886 KB)
.data : 0xffffffc000a72000 - 0xffffffc000af9c00 ( 543 KB)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[ 0.000000] Preemptible hierarchical RCU implementation.
[ 0.000000] Additional per-CPU info printed with stalls.
[ 0.000000] RCU restricting CPUs from NR_CPUS=64 to nr_cpu_ids=4.
[ 0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
[ 0.000000] NR_IRQS:64 nr_irqs:64 0
[ 0.000000] Architected cp15 and mmio timer(s) running at 19.20MHz (virt/virt).
[ 0.000005] sched_clock: 56 bits at 19MHz, resolution 52ns, wraps every 3579139424256ns
[ 0.000409] Console: colour dummy device 80x25
[ 0.003741] console [tty0] enabled
[ 0.003770] Lock dependency validator: Copyright (c) 2006 Red Hat, Inc., Ingo Molnar
[ 0.003812] … MAX_LOCKDEP_SUBCLASSES: 8
[ 0.003837] … MAX_LOCK_DEPTH: 48
[ 0.003863] … MAX_LOCKDEP_KEYS: 8191
[ 0.003887] … CLASSHASH_SIZE: 4096
[ 0.003913] … MAX_LOCKDEP_ENTRIES: 32768
[ 0.003938] … MAX_LOCKDEP_CHAINS: 65536
[ 0.003963] … CHAINHASH_SIZE: 32768
[ 0.003989] memory used by lock dependency info: 8159 kB
[ 0.004016] per task-struct memory footprint: 1920 bytes
[ 0.004060] Calibrating delay loop (skipped), value calculated using timer frequency… 38.40 BogoMIPS (lpj=192000)
[ 0.004116] pid_max: default: 32768 minimum: 301
[ 0.004377] Security Framework initialized
[ 0.004499] Mount-cache hash table entries: 2048 (order: 2, 16384 bytes)
[ 0.004538] Mountpoint-cache hash table entries: 2048 (order: 2, 16384 bytes)
[ 0.006016] Initializing cgroup subsys blkio
[ 0.006063] Initializing cgroup subsys memory
[ 0.006139] Initializing cgroup subsys devices
[ 0.006198] Initializing cgroup subsys hugetlb
[ 0.006931] hw perfevents: enabled with arm/armv8-pmuv3 PMU driver, 7 counters available
[ 0.007027] EFI services will not be available.
[ 0.080648] CPU1: Booted secondary processor
[ 0.080664] Detected VIPT I-cache on CPU1
[ 0.100433] CPU2: Booted secondary processor
[ 0.100445] Detected VIPT I-cache on CPU2
[ 0.120481] CPU3: Booted secondary processor
[ 0.120494] Detected VIPT I-cache on CPU3
[ 0.120670] Brought up 4 CPUs
[ 0.120829] SMP: Total of 4 processors activated.
[ 0.120986] alternatives: patching kernel code
[ 0.122565] devtmpfs: initialized
[ 0.124378] DMI not present or invalid.
[ 0.127532] pinctrl core: initialized pinctrl subsystem
[ 0.128447] reg-dummy reg-dummy: no of_node; not parsing pinctrl DT
[ 0.171579] NET: Registered protocol family 16
[ 0.200000] cpuidle: using governor ladder
[ 0.229989] cpuidle: using governor menu
[ 0.230217] vdso: 2 pages (1 code @ ffffffc000a79000, 1 data @ ffffffc000a78000)
[ 0.230340] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[ 0.232738] DMA: preallocated 256 KiB pool for atomic allocations
[ 0.232937] msm_smd_init: unable to create SMD logging context
[ 0.232969] msm_smd_init: unable to create SMSM logging context
[ 0.233358] msm_smem_init: unable to create logging context
[ 0.233847] Serial: AMBA PL011 UART driver
[ 0.236440] msm8916-pinctrl 1000000.pinctrl: try to register 134 pins …

[ 6.090873] msm8916-pinctrl 1000000.pinctrl: request pin 40 (GPIO_40) for a000000.qcom,wcn36xx
[ 6.090890] msm8916-pinctrl 1000000.pinctrl: request pin 41 (GPIO_41) for a000000.qcom,wcn36xx
[ 6.090904] msm8916-pinctrl 1000000.pinctrl: request pin 42 (GPIO_42) for a000000.qcom,wcn36xx
[ 6.090918] msm8916-pinctrl 1000000.pinctrl: request pin 43 (GPIO_43) for a000000.qcom,wcn36xx
[ 6.090932] msm8916-pinctrl 1000000.pinctrl: request pin 44 (GPIO_44) for a000000.qcom,wcn36xx
[ 6.111047] iris_read_v: 0x0
[ 6.111072] wcnss: IRIS Reg: 0x51120004
[ 6.171456] subsys-pil-tz a21b000.qcom,pronto: wcnss: loading from 0x000000008b600000 to 0x000000008bbe0000
[ 6.512944] subsys-pil-tz a21b000.qcom,pronto: wcnss: Brought out of reset
[ 6.981731] WCNSS_CTRL WCNSS_CTRL.6: no of_node; not parsing pinctrl DT
[ 8.264624] fw_status: 2
[ 9.725996] wcnss: received WCNSS_CBC_COMPLETE_IND from FW
[ 9.727109] WLAN_CTRL WLAN_CTRL.6: no of_node; not parsing pinctrl DT
[ 9.732714] wcn36xx-msm a000000.qcom,wcn36xx: wcn36xx_msm_probe initialized
[ 9.764055] wcn36xx wcn36xx: no of_node; not parsing pinctrl DT
[ 9.767431] wcn36xx wcn36xx: Direct firmware load for wlan/macaddr0 failed with error -2
[ 9.767485] wcn36xx wcn36xx: Falling back to user helper
[ 14.463449] random: nonblocking pool is initialized
[ 69.779209] wcn36xx wcn36xx: Failed (-11) to read macaddress file wlan/macaddr0, using a random address instead
[ 69.782500] wcn36xx: mac address: 00:0a:f5:92:a9:ad
[ 69.940482] wcn36xx wcn36xx wlan6: renamed from wlan0

Thanks,
Jon

Hi Jon

Thanks I can see the same thing with a newer release (internal)

[ 5.704609] subsys-pil-tz a21b000.qcom,pronto: wcnss: loading from 0x000000008b600000 to 0x000000008bbe0000
[ 6.000672] subsys-pil-tz a21b000.qcom,pronto: wcnss: Brought out of reset
[ 9.231716] wcnss: received WCNSS_CBC_COMPLETE_IND from FW
[ 9.239643] wcn36xx-msm a000000.qcom,wcn36xx: wcn36xx_msm_probe initialized
[ 9.259780] wcn36xx wcn36xx: no of_node; not parsing pinctrl DT
[ 9.261762] wcn36xx wcn36xx: Direct firmware load for wlan/macaddr0 failed with error -2
[ 9.261788] wcn36xx wcn36xx: Falling back to user helper
[ 69.269165] wcn36xx wcn36xx: Failed (-11) to read macaddress file wlan/macaddr0, using a random address instead
[ 69.272495] wcn36xx: mac address: 00:0a:f5:10:78:53
[ 69.493778] wcn36xx wcn36xx wlan1: renamed from wlan0

root@linaro-developer:~# uname -a
Linux linaro-developer 4.0.0-linaro-lt-qcom #1 SMP PREEMPT Wed Jun 24 08:04:27 UTC 2015 aarch64 aarch64 aarch64 GNU/Linux

we will look into this.

Just for completeness, this is the firmware version

[ 136.013036] wcn36xx: firmware WLAN version ‘WCN v2.0 RadioPhy vRhea_GF_1.12 with 19.2MHz XO’ and CRM version ‘CNSS-PR-2-0-1-2-c1-00010’
[ 136.013095] wcn36xx: firmware API 1.5.1.2, 41 stations, 2 bssids
[ 136.018845] wcn36xx: FW Cap MCC
[ 136.018886] wcn36xx: FW Cap P2P

and the firmware seems to be “working” despite those messages

The MAC address that I have
root@linaro-developer:/etc/udev/rules.d# ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:168 errors:0 dropped:0 overruns:0 frame:0
TX packets:168 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:13552 (13.5 KB) TX bytes:13552 (13.5 KB)

wlan2 Link encap:Ethernet HWaddr 00:0a:f5:c2:f7:3a
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

and the wlan scan seems to behave properly

root@linaro-developer:~# iwlist wlan2 scan
wlan2 Scan completed :
Cell 01 - Address: 10:0D:7F:8B:23:9B
Channel:1
Frequency:2.412 GHz (Channel 1)
Quality=70/70 Signal level=-36 dBm
Encryption key:on
ESSID:“slowspeed”
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 18 Mb/s
24 Mb/s; 36 Mb/s; 54 Mb/s
Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 48 Mb/s
Mode:Master
Extra:tsf=000000a204e53cc4
Extra: Last beacon: 2710ms ago
IE: Unknown: 0009736C6F777370656564
IE: Unknown: 010882840B162430486C
IE: Unknown: 030101
IE: Unknown: 2A0104
IE: Unknown: 2F0104
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
IE: Unknown: 32040C121860
IE: Unknown: 0B050A00900000
IE: Unknown: 2D1AAD1917FFFFFF0000000000000000000000000000000000000000
IE: Unknown: 3D1601001700000000000000000000000000000000000000
IE: Unknown: 7F080000080000000040
IE: Unknown: DD7C0050F204104A0001101044000102103B00010310470010D815F822B47C02D29134F482957AB38C1021000D4E4554474541522C20496E632E1023000552363330301024000552360
IE: Unknown: DD09001018020A00180000

The name of the interface is defined in udev depending on the mac address.
Can you check/share the contents of:
$ cat /etc/udev/rules.d/70-persistent-net.rules
and your wlan MAC address please?

All right so looking at /lib/udev/write_net_rules this is the expected behaviour when the MAC address can’t be read from the device.

I suppose /lib/udev/write_net_rules for wlan could be modified to always default to wlan0 instead of creating a new interface each time.

hi,

i will check what’s the issue with MAC addr, i suspect there is no MAC addr for the WLAN device… I will let you know.

in the mean time, a simple workaround is to add the following lines to file:

$ cat /etc/udev/rules.d/70-persistent-net.rules

# Unknown net device (/devices/platform/wcn36xx/net/wlan0) (wcn36xx)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0"

and make sure to remove all other lines that refer to ‘wlan’

we will see how to properly fix that in the next release, either by using this workaround, or something better…

I guess another workaround could be to actually create the firmware file the driver request?

root@linaro-developer:~# cat /lib/firmware/wlan/macaddr0
00:0a:f5:94:14:27
root@linaro-developer:~#

Then the content will be used to set mac address, which can be verified:

root@linaro-developer:~# ifconfig wlan0
wlan0 Link encap:Ethernet HWaddr 00:0a:f5:94:14:27
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

root@linaro-developer:~#

Actually, the latest linux distro (15.06) had the rules mentioned above, and it was still giving an error, despite the MAC address was set. Putting the MAC address in the macaddr0 file, as suggested eliminated the error messages.

–Rasit

resolved:

http://www.96boards.org/forums/topic/wifi-mac-address-programming/#post-19152