Hello.
I am trying to change the mac address of wi-fi access point (uap0) on NXP 88W8987.
As a condition, accesspoint (uap0) and station (mlan0) are enabled simultaneously.
The following is a good method, but it will be reset by rebooting.
ifconfig uap0 down
ifconfig uap0 hw ether xx:xx:xx:xx:xx:xx
ifconfig uap0 up
The following doesn't work.
Specify the mac_addr parameter when installing the driver.
mac_addr=xx:xx:xx:xx:xx:xx
or
mac_addr=uap0: xx:xx:xx:xx:xx:xx
I used this URL as a reference for the driver parameters.
Could you please tell me a better way?
Thank you.
已解决! 转到解答。
Dear @masakiyo
Module makers program one MAC address in non volatile memory during module production (this MAC address cannot be updated by the customers).
Then the 88W8987 SW derives several MAC addresses, one for each interface.
See below traces with an i.MX8+Jody-W2 module (Linux 6.1.36 BSP):
root@imx8mqevk:~# modprobe moal cfg80211_wext=0xf wfd_name=p2p max_vir_bss=1 cal_data_cfg=none drv_mode=7 ps_mode=1 auto_ds=1 host_mlme=1 fw_name=nxp/sdiouart8987_combo_v0.bin
[ 76.933254] mlan: loading out-of-tree module taints kernel.
[ 76.961681] wlan: Loading MWLAN driver
[ 76.965822] wlan: Register to Bus Driver...
[ 76.970228] vendor=0x02DF device=0x9149 class=0 function=1
[ 76.975806] Attach moal handle ops, card interface type: 0x105
[ 76.981663] rps set to 0 from module param
[ 76.985773] No module param cfg file specified
[ 76.990235] SDIO: max_segs=128 max_seg_size=65535
[ 76.994963] rx_work=1 cpu_num=4
[ 76.998131] Attach mlan adapter operations.card_type is 0x105.
[ 77.004356] wlan: Enable TX SG mode
[ 77.007987] wlan: Enable RX SG mode
[ 77.014516] Request firmware: nxp/sdiouart8987_combo_v0.bin
[ 77.268117] Wlan: FW download over, firmwarelen=617588 downloaded 617588
[ 78.138962] WLAN FW is active
[ 78.141944] on_time is 78139617698
[ 78.196858] FW country code WW does not match with US
[ 78.202151] fw_cap_info=0x181d7f03, dev_cap_mask=0xffffffff
[ 78.207760] max_p2p_conn = 8, max_sta_conn = 8
[ 78.226162] Register NXP 802.11 Adapter mlan0
[ 78.233628] Register NXP 802.11 Adapter uap0
[ 78.242699] Register NXP 802.11 Adapter p2p0
[ 78.247146] wlan: version = SD8987----16.92.21.p99.2-MM6X16408.p2-GPL-(FP92)
[ 78.255965] wlan: Register to Bus Driver Done
[ 78.260657] wlan: Driver loaded successfully
root@imx8mqevk:~# ifconfig -a
eth0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether 00:04:9f:06:32:d2 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 124 bytes 9760 (9.5 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 124 bytes 9760 (9.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
mlan0: flags=4098<BROADCAST,MULTICAST> mtu 1500
ether cc:f9:57:e0:7b:0d txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
p2p0: flags=4098<BROADCAST,MULTICAST> mtu 1500
ether ce:f9:57:e0:7b:0d txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
uap0: flags=4098<BROADCAST,MULTICAST> mtu 1500
ether ce:f9:57:e0:7c:0d txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
You can see that we have 3 different MAC addresses:
Regards,
Olivier
Dear @masakiyo
On my side, these 2 methods are working, but they are not reboot persistent
1/ Using mac_addr driver param (mac_addr=ee:2e:98:f6:ff:4c)
2/ Using init_cfg driver param (init_cfg=init_cfg.conf)
root@imx8mmevk:~# cat /lib/firmware/init_cfg.conf
---------------------------
# File : init_cfg.conf
# MAC address (interface: address)
mac_addr=mlan0: 00:50:43:20:12:34
mac_addr=uap0: 00:50:43:20:12:35
The only way to have reboot persistent MAC addresses is to program them in OTP or EEPROM. This is what module makers do.
Regards,
Olivier
Thank you for your reply.
The answer is 1.
I am using a JODY-W263-A module including NXP 88w8987.
https://www.u-blox.com/en/product/jody-w2-series
The mlan0's MAC address is programmed into EEPROM, but uap0's is not.
I haven't tried the method using init_cfg.conf, so I'll try it.
Dear @masakiyo
Module makers program one MAC address in non volatile memory during module production (this MAC address cannot be updated by the customers).
Then the 88W8987 SW derives several MAC addresses, one for each interface.
See below traces with an i.MX8+Jody-W2 module (Linux 6.1.36 BSP):
root@imx8mqevk:~# modprobe moal cfg80211_wext=0xf wfd_name=p2p max_vir_bss=1 cal_data_cfg=none drv_mode=7 ps_mode=1 auto_ds=1 host_mlme=1 fw_name=nxp/sdiouart8987_combo_v0.bin
[ 76.933254] mlan: loading out-of-tree module taints kernel.
[ 76.961681] wlan: Loading MWLAN driver
[ 76.965822] wlan: Register to Bus Driver...
[ 76.970228] vendor=0x02DF device=0x9149 class=0 function=1
[ 76.975806] Attach moal handle ops, card interface type: 0x105
[ 76.981663] rps set to 0 from module param
[ 76.985773] No module param cfg file specified
[ 76.990235] SDIO: max_segs=128 max_seg_size=65535
[ 76.994963] rx_work=1 cpu_num=4
[ 76.998131] Attach mlan adapter operations.card_type is 0x105.
[ 77.004356] wlan: Enable TX SG mode
[ 77.007987] wlan: Enable RX SG mode
[ 77.014516] Request firmware: nxp/sdiouart8987_combo_v0.bin
[ 77.268117] Wlan: FW download over, firmwarelen=617588 downloaded 617588
[ 78.138962] WLAN FW is active
[ 78.141944] on_time is 78139617698
[ 78.196858] FW country code WW does not match with US
[ 78.202151] fw_cap_info=0x181d7f03, dev_cap_mask=0xffffffff
[ 78.207760] max_p2p_conn = 8, max_sta_conn = 8
[ 78.226162] Register NXP 802.11 Adapter mlan0
[ 78.233628] Register NXP 802.11 Adapter uap0
[ 78.242699] Register NXP 802.11 Adapter p2p0
[ 78.247146] wlan: version = SD8987----16.92.21.p99.2-MM6X16408.p2-GPL-(FP92)
[ 78.255965] wlan: Register to Bus Driver Done
[ 78.260657] wlan: Driver loaded successfully
root@imx8mqevk:~# ifconfig -a
eth0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether 00:04:9f:06:32:d2 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 124 bytes 9760 (9.5 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 124 bytes 9760 (9.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
mlan0: flags=4098<BROADCAST,MULTICAST> mtu 1500
ether cc:f9:57:e0:7b:0d txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
p2p0: flags=4098<BROADCAST,MULTICAST> mtu 1500
ether ce:f9:57:e0:7b:0d txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
uap0: flags=4098<BROADCAST,MULTICAST> mtu 1500
ether ce:f9:57:e0:7c:0d txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
You can see that we have 3 different MAC addresses:
Regards,
Olivier
Is this also the case for the NXP 88W9098 module? i.e. the h/w programmed mac cannot be changed?
In the case of the module we are evaluating (M2-JODY-W377) the default MAC is a u-blox OUI,
so if we need to change it we should do so early in bootup?
Thanks
Sorry for the late reply.
I checked the same steps as you on my board.
mlan0 Link encap:Ethernet HWaddr 6C:1D:EB:EB:8E:69
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)
uap0 Link encap:Ethernet HWaddr 6E:1D:EB:EB:8F:69
inet addr:192.168.8.1 Bcast:192.168.8.255 Mask:255.255.255.0
inet6 addr: fe80::6c1d:ebff:feeb:8f69/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:37 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
The MAC of mlan0 is stored in non-volatile memory and is a fixed value.
On the other hand, the uap0's MAC is not.
The uap0's MAC is a local address (G/L bit is 1).
I tried the following.
vi /lib/firmware/nxp/init_cfg.conf
# add
mac_addr=uap0: 6C:1D:EB:EB:8E:70
modprobe moal cfg80211_wext=0xf wfd_name=p2p max_vir_bss=1 cal_data_cfg=none drv_mode=7 ps_mode=1 auto_ds=1 host_mlme=1 fw_name=nxp/sdiouart8987_combo_v0.bin init_cfg=nxp/init_cfg.conf
ifconfig -a
mlan0 Link encap:Ethernet HWaddr 6C:1D:EB:EB:8E:69
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)
uap0 Link encap:Ethernet HWaddr 6C:1D:EB:EB:8E:70
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)
The MAC of uap0 has changed.
However, this is not written to non-volatile memory.
It is possible to make it permanent by applying init_cfg.conf every time the board boots.
I feel that there is no problem if the MAC of uap0 is left as a local address (G/L bit is 1).
That's what I understood. thank you very much.