It happens that a soft reset is failing and blocking the chip in a state
where it always times out. The only wait to get out of this is to hard
reset the bluetooth chip.
BugzID: 77171
Detecting if the mac address must be inverted means doing two resets of
the chip in a short period when the mac must be inverted.
These two resets is sometimes letting the BT chip in a state where it
does not answer for more than a minute.
Also fixes getopts string: options -w and -b don't have arguments.
BugzID: 77171
settin mac address of bt and wlan is now triggered in two separated
services.
BugzID: 77171
Signed-off-by: Patrick Zysset <patrick.zysset@netmodule.com>
added several enhancements to the mac-address-set script:
- splittet wlan and bt address setting (use -w / -b options)
- fixed upper and lower case problem with vcu1 addresses
- fixed hexadecimal support with vcu2 addresses
- added testify support (incl. log_test function)
BugzID: 77171
Signed-off-by: Patrick Zysset <patrick.zysset@netmodule.com>
adding a unit test script which uses testify framework to test the
mac-address-set script for vuc1 and vcu2.
BugzID: 77171
Signed-off-by: Patrick Zysset <patrick.zysset@netmodule.com>
if a device is never getting ready on startup sequence, the wait_on()
function runs forever. with this patch it aborts after 10 seconds.
BugzID: 77171
Signed-off-by: Patrick Zysset <patrick.zysset@netmodule.com>
If NetworkManager starts before, it may change the mac address for
scanning and store the chip mac address. When finaly using a static mac
address (for an established connection or AP) it will restore the chip
address instead of our address.
BugzID: 77171
Signed-off-by: Patrick Zysset <patrick.zysset@netmodule.com>
After an overall refactoring this script now does:
* Wait on devices being ready before changing the address
* Handle errors when setting wlan or bluetooth mac address
* Handle different MAC address schemes
* Handle different behaviors when setting wlan mac:
On HW21, the address must be set while the interface is down, but on
HW23 it must be set while the interface is up and if it is down, no
error is thrown, so the modified address is checked.
* Handle different behaviors while setting BT mac:
On HW21, the address must be given with the bytes in reverse order.
We therefore first try with the right order and check the address and
retry with the reversed address if it failed.
BugzID: 77171
Signed-off-by: Patrick Zysset <patrick.zysset@netmodule.com>
on nmhw21 the following mac address scheme is used:
- Ethernet: xx:xx:xx:50:xx:xx
- User Module: xx:xx:xx:60:xx:xx
- Wifi: xx:xx:xx:70:xx:xx
- BT: xx:xx:xx:80:xx:xx
Note: this scheme is only valid for nmhw21.
BugzID: 54514
Signed-off-by: Patrick Zysset <patrick.zysset@netmodule.com>
This script sets mac address of wifi and bluetooth chip
according to serial number
Also add NetworkManager config to not use random mac address on wifi
BugzID: 54514