Ok I followed this article 
http://blog.linuxconsulting.ro/2010/04/porting-wifi-drivers-to-android.html
Built following the Unix standard socket as /data/system/
wpa_supplicant seems to be needed.

Created wlan_loader with:

#!/system/bin/sh
#
# WLAN Loader
#
if netcfg wlan0 up; then
sleep 1
setprop wlan.driver.status ok
fi


When I tried to on WiFi, logcat keep repeating the same errors:

E/WifiService( 1016): Failed to unload Wi-Fi driver.
I/WifiHW  ( 1016): Loading WiFi Modules
E/WifiHW  ( 1016): Cannot find driver rt73usb  in proc
I/WifiHW  ( 1016): insmod
I/WifiHW  ( 1016): insmod
I/WifiHW  ( 1016): insmod
D/wpa_supplicant( 1484): RTM_NEWLINK: operstate=0 ifi_flags=0x1002 ()
D/wpa_supplicant( 1484): RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0'
added
D/wpa_supplicant( 1484): RTM_NEWLINK: operstate=0 ifi_flags=0x1003
([UP])
D/wpa_supplicant( 1484): RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0'
added
I/WifiHW  ( 1016): start wifi_start_supplicant
E/WifiHW  ( 1016): ensure_config_file_exists
I/WifiHW  ( 1016): Wi-Fi is running
I/WifiHW  ( 1016): wifi_connect_to_supplicant called
I/WifiHW  ( 1016): Interface directory = /data/system/wpa_supplicant
I/WifiHW  ( 1016): Interface name = /data/system/wpa_supplicant/wlan0
I/WifiHW  ( 1016): Connect to Supplicant done
I/WifiHW  ( 1016): wifi_command called, cmd:DRIVER MACADDR
I/WifiHW  ( 1016): wifi_send_command, cmd = DRIVER MACADDR
D/wpa_supplicant( 1484): wpa_driver_priv_driver_cmd MACADDR len = 4096
E/wpa_supplicant( 1484): wpa_driver_priv_driver_cmd failed
I/wpa_supplicant( 1484): CTRL-EVENT-DRIVER-STATE HANGED
I/WifiHW  ( 1016): reply:FAIL
I/WifiHW  ( 1016):
I/WifiHW  ( 1016): returning nread
V/WifiMonitor( 1016): Event [CTRL-EVENT-DRIVER-STATE HANGED]
I/WifiHW  ( 1016): wifi_command called, cmd:BLACKLIST clear
I/WifiHW  ( 1016): wifi_send_command, cmd = BLACKLIST clear
D/wpa_supplicant( 1484): CTRL_IFACE: bssid=' clear'
D/wpa_supplicant( 1484): Setting scan request: 0 sec 0 usec
D/wpa_supplicant( 1484): No enabled networks - do not scan
D/wpa_supplicant( 1484): State: INACTIVE -> INACTIVE
I/wpa_supplicant( 1484): CTRL-EVENT-STATE-CHANGE id=-1 state=1
I/WifiHW  ( 1016): returning reply  for cmd BLACKLIST clear
I/WifiHW  ( 1016): wifi_command called, cmd:BLACKLIST clear
I/WifiHW  ( 1016): wifi_send_command, cmd = BLACKLIST clear
D/wpa_supplicant( 1484): wpa_driver_priv_driver_cmd BTCOEXSCAN-STOP
len = 4096
E/wpa_supplicant( 1484): wpa_driver_priv_driver_cmd failed
I/WifiHW  ( 1016): reply:FAIL
I/WifiHW  ( 1016):
E/WifiStateTracker( 1016): Wifi Driver reports HUNG - reloading.
I/WifiHW  ( 1016): wifi_stop_supplicant called
D/WifiStateTracker( 1016): Reset connections and stopping DHCP
V/WifiStateTracker( 1016): Changing supplicant state: INACTIVE ==>
INACTIVE
D/wpa_supplicant( 1484): RTM_NEWLINK: operstate=0 ifi_flags=0x1002 ()
D/wpa_supplicant( 1484): RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0'
added
I/WifiHW  ( 1016): rmmod
E/WifiHW  ( 1016): Unable to unload driver module "rt73usb": No such
file or directory
E/WifiService( 1016): Failed to unload Wi-Fi driver.


Minicom:

phy0 -> rt2x00mac_conf_tx: Info - Configured TX queue 0 - CWmin: 3,
CWmax: 4, A.
phy0 -> rt2x00mac_conf_tx: Info - Configured TX queue 1 - CWmin: 4,
CWmax: 5, A.
phy0 -> rt2x00mac_conf_tx: Info - Configured TX queue 2 - CWmin: 5,
CWmax: 10, .
phy0 -> rt2x00mac_conf_tx: Info - Configured TX queue 3 - CWmin: 5,
CWmax: 10, .

On Mar 15, 10:52 am, BiX <bixt...@gmail.com> wrote:
> > comment this out from wifi.c
>
> My wifi.c was modified to followhttp://projectkennel.com/wiki/diffs/wifi.html
> so this is wrong?
>
> On Mar 14, 9:14 pm, Pavan Savoy <pavan.sa...@gmail.com> wrote:
>
>
>
>
>
>
>
> > On Mon, Mar 14, 2011 at 3:00 PM, BiX <bixt...@gmail.com> wrote:
> > > Thanks Pavan for the config.
>
> > > WiFi:
> > > I built wpa_supplicant instead of BOARD_WLAN_TI_STA_DK_ROOT.
> > > These are the changes I've made:
> > > 1. Add to BoardConfig.mk:
> > >        BOARD_WPA_SUPPLICANT_DRIVER := WEXT
> > > 2. Uncommment wpa_supplicant config in external/wpa_supplicant/
> > > Android.mk
> > > 3. Add to init.rc:
> > >        mkdir /system/etc/wifi 0770 wifi wifi
> > >        chmod 0770 /system/etc/wifi
> > >        chmod 0660 /system/etc/wifi/wpa_supplicant.conf
> > >        chown wifi wifi /system/etc/wifi/wpa_supplicant.conf
> > >        #wpa_supplicant control socket for android wifi.c
> > >        mkdir /data/misc/wifi 0770 wifi wifi
> > >        mkdir /data/misc/wifi/sockets 0770 wifi wifi
> > >        chmod 0770 /data/misc/wifi
> > >        chmod 0660 /data/misc/wifi/wpa_supplicant.conf
> > >        chown wifi wifi /data/misc/wifi
> > >        chown wifi wifi /data/misc/wifi/wpa_supplicant.conf
>
> > > However, I still cannot get WiFi on.
>
> > > Logcat:
> > > I/WifiHW  ( 1004): Loading WiFi Modules
> > > E/WifiHW  ( 1004): Cannot find driver rt73usb  in proc
>
> > Here you either need to build rt73usb as module or comment this out from 
> > wifi.c
>
> > > I/WifiHW  ( 1004): insmod
> > > I/WifiHW  ( 1004): insmod
> > > I/WifiHW  ( 1004): insmod
> > > I/WifiHW  ( 1004): start wifi_start_supplicant
> > > E/WifiHW  ( 1004): ensure_config_file_exists
> > > I/WifiHW  ( 1004): Wi-Fi is running
> > > I/WifiHW  ( 1004): wifi_command called, cmd:BLACKLIST clear
> > > I/WifiHW  ( 1004): wifi_send_command, cmd = BLACKLIST clear
> > > I/WifiHW  ( 1004): wifi_connect_to_supplicant called
> > > I/WifiHW  ( 1004): Interface directory = /data/system/wpa_supplicant
> > > I/WifiHW  ( 1004): Interface name = wlan0
> > > E/WifiHW  ( 1004): Unable to open connection to supplicant on "wlan0":
> > > No such file or directory
> > > D/WifiStateTracker( 1004): Reset connections and stopping DHCP
> > > E/wpa_supplicant( 1391): Failed to read or parse configuration '/
> > > system/etc/wifi/wpa_supplicant.conf'.
>
> > problem here - wpa_supplicant.conf not found....
>
> > > I/logwrapper( 1388): /system/bin/wpa_supplicant terminated by
> > > exit(255)
> > > D/WifiStateTracker( 1004): Disabling interface
>
> > > Bluetooth:
> > > I can scan devices! However I cannot seem to pair with them.
>
> > > Logcat:
> > > D/BluetoothService( 1003): 00:27:13:6D:D5:0C bond state 11 -> 10 (0)
> > > W/BluetoothService( 1003): setBondState() called to unbond device, but
> > > reason code is invalid. Overriding reason code with
> > > BOND_RESULT_REMOVED
> > > I/BluetoothEventLoop.cpp( 1003): agent_event_filter: Received method
> > > org.bluez.Agent:Release
> > > V/BluetoothEventRedirector( 1345): Received
> > > android.bluetooth.device.action.BOND_STATE_CHANGED
> > > W/CachedBluetoothDeviceManager( 1345): showUnbondMessage: Not
> > > displaying any message for reason:9
>
> > from the earlier messages, the adapter itself doesn't seem to be up,
> > for example - you can try hciconfig -a - to check the status of adapter.
>
> > > Are there any modifications or modules missing?
>
> > As a general rule - enable Wi-Fi or Bluetooth from command line first
> > - start using them as in scanning APs or BT devices and then try and
> > enable them from the UI ...
>
> > > Thanks in advance.
>
> > > On Mar 10, 9:30 pm, Pavan Savoy <pavan.sa...@gmail.com> wrote:
> > >> On Thu, Mar 10, 2011 at 12:28 PM, BiX <bixt...@gmail.com> wrote:
> > >> > Using Gingerbread on OMAP 3530
>
> > >> > For WiFi:
>
> > >> > 1. Build rt73 as loadable module.
> > >> > 2. Added BOARD_WLAN_TI_STA_DK_ROOT in BoardConfig.mk to build
> > >> > wlan_loader.
> > >> > 3. Placed rt73usb.ko, rt2x00lib.ko & rt2x00usb.ko in /system/lib/
> > >> > modules.
> > >> > 4. Placed rt73.bin in /system/etc/firmware.
>
> > >> > Locat:
> > >> >        I/WifiHW  (  973): Loading WiFi Modules
> > >> >        E/WifiHW  (  973): Cannot find driver rt73usb  in proc
> > >> >        I/WifiHW  (  973): insmod
> > >> >        I/WifiHW  (  973): insmod
> > >> >        I/WifiHW  (  973): insmod
> > >> >        D/Tethering(  973): wlan0 is not a tetherable iface, ignoring
> > >> >        E/wlan_loader( 1316): Cannot open eeprom image file 
> > >> > <./nvs_map.bin>:
> > >> > No such file or directory
> > >> >        E/wlan_loader( 1316): init_driver() failed
> > >> >        I/WifiHW  (  973): rmmod
> > >> >        E/Tethering(  973): attempting to remove unknown iface (wlan0),
> > >> > ignoring
> > >> >        E/WifiService(  973): Failed to load Wi-Fi driver.
>
> > >> > For Bluetooth:
>
> > >> > 1. Build HCI USB and HCI UART for kernel.
> > >> > 2. Add to BoardConfig.mk:
> > >> >        BOARD_HAVE_BLUETOOTH := true
> > >> > 3. Remove from $ANDROID/system/bluetooth/bluedroid/bluetooth.c:
> > >> >        if (set_bluetooth_power(1) < 0) goto out;
>
> > >> > Once Bluetooth is ticked, this message will keep repeating 'E/
> > >> > bluetooth_ScoSocket.cpp( 1035): accept_work socket() failed: Protocol
> > >> > not supported'.
> > >> > I can scan with hcitool scan but if I try to l2ping, I'll get 'Can't
> > >> > create socket: Protocol not supported'.
>
> > >> > Logcat:
> > >> >        I/bluedroid(  972): Starting hciattach daemon
> > >> >        I/bluedroid(  972): Starting bluetoothd deamon
> > >> >        E/BluetoothEventLoop.cpp(  972): event_filter: Received signal
> > >> > org.freedesktop.DBus:NameAcquired from /org/freedesktop/DBus
> > >> >        E/BluetoothEventLoop.cpp(  972): event_filter: Received signal
> > >> > org.bluez.Adapter:PropertyChanged from /org/bluez/1309/hci0
> > >> >        D/BluetoothService(  972): Bluetooth state 11 -> 12
> > >> >        V/BluetoothEventRedirector( 1289): Received
> > >> > android.bluetooth.adapter.action.STATE_CHANGED
> > >> >        E/BluetoothAudioGateway.cpp( 1035): Can't create RFCOMM socket
> > >> >        E/BT Audio Gateway( 1035): Could not set up listening socket, 
> > >> > exiting
> > >> >        E/bluetooth_ScoSocket.cpp( 1035): accept_work socket() failed:
> > >> > Protocol not supported
>
> > >> You need to enable these in your kernel,
> > >> #
> > >> # Network testing
> > >> #
> > >> # CONFIG_NET_PKTGEN is not set
> > >> # CONFIG_HAMRADIO is not set
> > >> # CONFIG_CAN is not set
> > >> # CONFIG_IRDA is not set
> > >> CONFIG_BT=y
> > >> CONFIG_BT_L2CAP=y
> > >> # CONFIG_BT_L2CAP_EXT_FEATURES is not set
> > >> CONFIG_BT_SCO=y
> > >> CONFIG_BT_RFCOMM=y
> > >> CONFIG_BT_RFCOMM_TTY=y
> > >> # CONFIG_BT_BNEP is not set
> > >> CONFIG_BT_HIDP=y
>
> > >> > Things added to my init.rc:
>
> > >> > # wifi
> > >> >    mkdir /system/etc/wifi 0770 wifi wifi
> > >> >    chmod 0770 /system/etc/wifi
> > >> >    chmod 0660 /system/etc/wifi/wpa_supplicant.conf
> > >> >    chown wifi wifi /system/etc/wifi/wpa_supplicant.conf
>
> > >> > #bluetooth power up/down interface
> > >> >   chown bluetooth bluetooth /sys/class/rfkill/rfkill0/type
> > >> >   chown bluetooth bluetooth /sys/class/rfkill/rfkill0/state
> > >> >   chmod 0660                /sys/class/rfkill/rfkill0/state
>
> > >> >    setprop wifi.interface wlan0
> > >> >    setprop wlan.driver.status ok
>
> > >> > service wlan_loader /system/bin/wlan_loader
> > >> >   disabled
> > >> >   oneshot
>
> > >> > service ifcfg_ralink /system/bin/ifconfig wlan0 up
> > >> >   disabled
> > >> >   oneshot
>
> > >> > service wpa_supplicant /system/bin/wpa_supplicant -dd -Dwext -iwlan0 -
> > >> > c /system/etc/wifi/wpa_supplicant.conf
> > >> >   group system wifi inet
> > >> >   disabled
> > >> >   oneshot
>
> > >> > service dhcpcd /system/bin/logwrapper /system/bin/dhcpcd -d wlan0
> > >> >   disabled
> > >> >   oneshot
> > >> >   #group system dhcp
>
> > >> > service hciattach /system/bin/hciattach -l
> > >> >    user root
> > >> > # changing user to root from bluetooth is a potential security issue
> > >> > # service hciattach_legacy is used instead of hciattach because, we
> > >> > dont
> > >> > # have nodes named ttyHS0
> > >> >    group bluetooth net_bt_admin misc
> > >> >    disabled
> > >> >    oneshot
>
> > >> > on property:init.svc.wpa_supplicant=stopped
> > >> >    stop dhcpcd
>
> > >> > --
> > >> > unsubscribe: android-porting+unsubscr...@googlegroups.com
> > >> > website:http://groups.google.com/group/android-porting
>
> > >> --
> > >> --Pavan Savoy
>
> > > --
> > > unsubscribe: android-porting+unsubscr...@googlegroups.com
> > > website:http://groups.google.com/group/android-porting
>
> > --
> > --Pavan Savoy

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-porting

Reply via email to