Closed Bug 847157 Opened 11 years ago Closed 6 years ago

WiFi Tethering broken on Nexus S due to invalid firmware used

Categories

(Firefox OS Graveyard :: Wifi, defect)

ARM
Gonk (Firefox OS)
defect
Not set
major

Tracking

(tracking-b2g:backlog)

RESOLVED WONTFIX
tracking-b2g backlog

People

(Reporter: gerard-majax, Unassigned)

References

Details

Attachments

(2 files, 1 obsolete file)

Trying to debug WiFi Tethering on Nexus S. Gecko to netd chain of command seems ok, however, lower level stack fails:

<4>[   50.842885] Dongle Host Driver, version 4.218.248.23
<4>[   52.897828] current firmware_path[]=/vendor/firmware/fw_bcm4329.bin
<4>[   52.897967] GOT APSTA FIRMWARE
<4>[   52.898034] SET firmware_path[]=/vendor/firmware/fw_bcm4329_apsta.bin , str_p:bf02b0e0
<4>[   53.830215]  Got str param in iw_point:
<4>[   53.830227]  ASCII_CMD=AP_CFG,SSID=FirefoxOS,SEC=open,KEY=cac3d9a2d7080d71761bd75604a2b023132bd59dc0d7cc8f4a1839573ddfda3f,CHANNEL=6,PREAMBLE=0,MAX_SCB=8,END
<4>[   53.830431] 
<4>[   53.830434]  get_parmeter_from_string: No token:HIDDEN= in str:END
<4>[   53.830612] 
<4>[   53.830615]  get_parmeter_from_string: No token:COUNTRY= in str:END
<4>[   53.830794] wl_iw: set ap profile:
<4>[   53.830858] 	ssid = 'FirefoxOS'
<4>[   53.830921] 	security = 'open'
<4>[   53.831037] 	key = 'cac3d9a2d7080d71761bd75604a2b023132bd59dc0d7cc8f4a1839573ddfda3f'
<4>[   53.831103] 	channel = 6
<4>[   53.831166] 	max scb = 8
<4>[   53.839550] set_ap_cfg fail to set apsta 
<4>[   53.839625] set_ap_cfg exit with -95
<4>[   53.839692] iwpriv_set_ap_config failed to set_ap_cfg -95

After digging a bit in the network driver code (https://android.googlesource.com/kernel/msm.git/+/6990e9491e6dae6ade8f2fd0c6e3dd4b14c942aa/drivers/net/wireless/bcm4329/wl_iw.c), it seems that the AP STA firmware call fails with EOPNOTSUPP.

I took a chance, unloaded the bcm4329 kernel driver then reloaded it:
# insmod /system/modules/bcm4329.ko iface_name=wlan0 firmware_path=/vendor/firmware/fw_bcm4329_apsta.bin

After this, dmesg shows:

<4>[  676.030606] Broadcom Dongle Host Driver mac=02:1a:11:f4:0c:ec
<4>[  676.031745] Firmware version = wl0: Feb 11 2011 17:01:29 version 4.218.248.23
<4>[  676.174871] dhd_preinit_ioctls set keeplive failed -23
<4>[  676.189772] wlan0: Broadcom Dongle Host Driver mac=02:1a:11:f4:0c:ec
<4>[  676.191503] 
<4>[  676.191521] Dongle Host Driver, version 4.218.248.23

Then, trying to reenable WiFi Tethering, I get no more error:

/Gecko   (   78): Network Worker: Dump params:
I/Gecko   (   78): Network Worker:      ifname: wlan0
I/Gecko   (   78): Network Worker:      ip: 192.168.1.1
I/Gecko   (   78): Network Worker:      link: up
I/Gecko   (   78): Network Worker:      prefix: 24
I/Gecko   (   78): Network Worker:      startIp: 192.168.1.10
I/Gecko   (   78): Network Worker:      endIp: 192.168.1.30
I/Gecko   (   78): Network Worker:      dnsserver1: 212.27.40.240
I/Gecko   (   78): Network Worker:      dnsserver2: 212.27.40.241
I/Gecko   (   78): Network Worker:      internalIfname: wlan0
I/Gecko   (   78): Network Worker:      externalIfname: rmnet0
I/Gecko   (   78): Network Worker:      wifictrlinterfacename: wl0.1
I/Gecko   (   78): Network Worker:      ssid: FirefoxOS
I/Gecko   (   78): Network Worker:      security: open
I/Gecko   (   78): Network Worker:      key: 1234567890
I/Gecko   (   78): Network Worker: Starting Wifi Tethering on wlan0<->rmnet0
I/Gecko   (   78): Network Worker: Preparing to send 'softap fwreload wlan0 AP' command...
I/Gecko   (   78): Network Worker: Sending 'softap fwreload wlan0 AP' command to netd.
D/SoftapController(   80): Softap fwReload - Ok
I/Gecko   (   78): Network Worker: Receiving 'softap fwreload wlan0 AP' command response from netd.
I/Gecko   (   78): Network Worker:           ==> Code: 200  Reason: Softap operation succeeded
I/Gecko   (   78): Network Worker: Preparing to send 'softap start wlan0' command...
I/Gecko   (   78): Network Worker: Sending 'softap start wlan0' command to netd.
D/SoftapController(   80): Softap driver start: 0
I/Gecko   (   78): Network Worker: Receiving 'softap start wlan0' command response from netd.
I/Gecko   (   78): Network Worker:           ==> Code: 200  Reason: Softap operation succeeded
I/Gecko   (   78): Network Worker: Preparing to send 'softap set wlan0 wl0.1 "FirefoxOS" open null 6 0 8' command...
I/Gecko   (   78): Network Worker: Sending 'softap set wlan0 wl0.1 "FirefoxOS" open null 6 0 8' command to netd.
D/SoftapController(   80): Softap set - Ok
I/Gecko   (   78): Network Worker: Receiving 'softap set wlan0 wl0.1 "FirefoxOS" open null 6 0 8' command response from netd.
I/Gecko   (   78): Network Worker:           ==> Code: 200  Reason: Softap operation succeeded
I/Gecko   (   78): Network Worker: Preparing to send 'softap startap' command...
I/Gecko   (   78): Network Worker: Sending 'softap startap' command to netd.
D/SoftapController(   80): Softap startap - Ok
I/Gecko   (   78): Network Worker: Receiving 'softap startap' command response from netd.
I/Gecko   (   78): Network Worker:           ==> Code: 200  Reason: Softap operation succeeded
I/Gecko   (   78): Network Worker: Preparing to send 'interface setcfg wlan0 192.168.1.1 24 [up]' command...
I/Gecko   (   78): Network Worker: Sending 'interface setcfg wlan0 192.168.1.1 24 [up]' command to netd.
D/CommandListener(   80): Setting iface cfg
D/CommandListener(   80): Trying to bring up wlan0
I/Gecko   (   78): Network Worker: Receiving 'interface setcfg wlan0 192.168.1.1 24 [up]' command response from netd.
I/Gecko   (   78): Network Worker:           ==> Code: 200  Reason: Interface configuration set
I/Gecko   (   78): Network Worker: Preparing to send 'tether interface add wlan0' command...
I/Gecko   (   78): Network Worker: Sending 'tether interface add wlan0' command to netd.
I/Gecko   (   78): Network Worker: Receiving 'tether interface add wlan0' command response from netd.
I/Gecko   (   78): Network Worker:           ==> Code: 200  Reason: Tether operation succeeded
I/Gecko   (   78): Network Worker: Preparing to send 'ipfwd enable' command...
I/Gecko   (   78): Network Worker: Sending 'ipfwd enable' command to netd.
D/TetherController(   80): Setting IP forward enable = 1
I/Gecko   (   78): Network Worker: Receiving 'ipfwd enable' command response from netd.
I/Gecko   (   78): Network Worker:           ==> Code: 200  Reason: ipfwd operation succeeded
I/Gecko   (   78): Network Worker: Preparing to send 'tether start 192.168.1.10 192.168.1.30' command...
I/Gecko   (   78): Network Worker: Sending 'tether start 192.168.1.10 192.168.1.30' command to netd.
D/TetherController(   80): Starting tethering services
D/TetherController(   80): Tethering services running
I/Gecko   (   78): Network Worker: Receiving 'tether start 192.168.1.10 192.168.1.30' command response from netd.
I/Gecko   (   78): Network Worker:           ==> Code: 200  Reason: Tether operation succeeded
I/Gecko   (   78): Network Worker: Preparing to send 'tether dns set 212.27.40.240 212.27.40.241' command...
I/Gecko   (   78): Network Worker: Sending 'tether dns set 212.27.40.240 212.27.40.241' command to netd.
D/TetherController(   80): setDnsForwarders(0 = '212.27.40.240')
D/TetherController(   80): setDnsForwarders(1 = '212.27.40.241')
D/TetherController(   80): Sending update msg to dnsmasq [update_dns:212.27.40.240:212.27.40.241]
I/Gecko   (   78): Network Worker: Receiving 'tether dns set 212.27.40.240 212.27.40.241' command response from netd.
I/Gecko   (   78): Network Worker:           ==> Code: 200  Reason: Tether operation succeeded
I/Gecko   (   78): Network Worker: Preparing to send 'nat enable wlan0 rmnet0 0' command...
I/Gecko   (   78): Network Worker: Sending 'nat enable wlan0 rmnet0 0' command to netd.
I/dnsmasq (  465): started, version 2.51 cachesize 150
I/dnsmasq (  465): compile time options: no-IPv6 GNU-getopt no-DBus no-I18N DHCP no-scripts no-TFTP
W/dnsmasq (  465): warning: no upstream servers configured
I/dnsmasq (  465): DHCP, IP range 192.168.1.10 -- 192.168.1.30, lease time 1h
I/dnsmasq (  465): read /etc/hosts - 1 addresses
I/Gecko   (   78): Network Worker: Receiving 'nat enable wlan0 rmnet0 0' command response from netd.
I/Gecko   (   78): Network Worker:           ==> Code: 200  Reason: Nat operation succeeded
I/dnsmasq (  465): using nameserver 212.27.40.241#53
I/dnsmasq (  465): using nameserver 212.27.40.240#53

And from my laptop I can see the network:
          Cell 02 - Address: 02:1A:11:xx:xx:xx
                    Channel:6
                    Frequency:2.437 GHz (Channel 6)
                    Quality=58/70  Signal level=-52 dBm  
                    Encryption key:off
                    ESSID:"FirefoxOS"
                    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=0000000003d5ed0f
                    Extra: Last beacon: 5952ms ago
                    IE: Unknown: 000946697265666F784F53
                    IE: Unknown: 010882848B962430486C
                    IE: Unknown: 030106
                    IE: Unknown: 2A0100
                    IE: Unknown: 2F0100
                    IE: Unknown: 32040C121860
                    IE: Unknown: DD09001018020000040000
                    IE: Unknown: DD180050F2020101800003A4000027A4000042435E0062322F00
There is still an issue, however. When disabling WiFi tethering, I can't connect to my WiFi network until either next reboot or rmmod followed by insmod is performed.
Assignee: nobody → lissyx+mozillians
Status: NEW → ASSIGNED
Attachment #720411 - Flags: review?
Comment on attachment 720411 [details] [diff] [review]
Making WiFi Tethering working on Nexus S

I think this is what was intended here.
Attachment #720411 - Flags: review? → review?(vchang)
Comment on attachment 720411 [details] [diff] [review]
Making WiFi Tethering working on Nexus S

Review of attachment 720411 [details] [diff] [review]:
-----------------------------------------------------------------

I am fine with this patch. But does it fix the problem described in comment 1 ? 
If not, please also file a follow-up bug.
 
It would be very appreciated if can also verify the patch on unagi.
Attachment #720411 - Flags: review?(vchang) → review+
Thanks for your feed back. The proposed patch fixes the issue described un comment 1, i.e., hotspot feature not getting enabled. For the full WiFi Tethering to work on Nexus S, please also consider bug 84738.

Unfortunately, I can't test on Unagi, so if someone has access to it and some time to check if the patches does not break anything, please do not hesitate.
Blocks: 847388
(In reply to Vincent Chang[:vchang] from comment #3)
> It would be very appreciated if can also verify the patch on unagi.

Verified that Unagi works fine with this change.
Blocks: b2g-nexuss
blocking-b2g: --- → backlog
Looks like this bug is still present. I'll try to provide an updated patch.
Flags: needinfo?(lissyx+mozillians)
Attached patch bug-847157.patchSplinter Review
New tentative patch.
Attachment #720411 - Attachment is obsolete: true
Flags: needinfo?(lissyx+mozillians)
blocking-b2g: backlog → ---
Unassigning as I'm stopping dogfooding Nexus S.
Assignee: lissyx+mozillians → nobody
Firefox OS is not being worked on
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: