Puedo iniciar wpa_supplicant sin problemas a través de adb shell. El firmware y las cosas para mi radio WiFi está todo cargado antes de esto.
Sin embargo, quiero iniciarlo mediante execv() en un programa C. Cuando ejecuto execv(), obtengo el siguiente error:
E/wpa_supplicant( 3008): Failed to initialize control interface 'wlan0'.
E/wpa_supplicant( 3008): You may have another wpa_supplicant process already running or the file was
E/wpa_supplicant( 3008): left by an unclean termination of wpa_supplicant in which case you will need
E/wpa_supplicant( 3008): to manually remove this file before starting wpa_supplicant again.
I/wpa_supplicant( 3008): ELOOP: remaining socket: sock=15 eloop_data=0xa5320 user_data=0x0 handler=0x6acd9
También tengo esto en la consola de serie:
mkdir[ctrl_interface]: Permission denied
La salida completa de strace está aquí: http://pastebin.com/fuQnqjXK
Aquí está el fragmento de salida strace de interés:
2380 mkdir("wlan0", 0770) = -1 EACCES (Permission denied)
2380 write(2, "mkdir[ctrl_interface]", 21) = 21
2380 write(2, ": ", 2) = 2
2380 write(2, "Permission denied", 17) = 17
2380 write(2, "\n", 1) = 1
Además, aquí está el fragmento de logcat. Ya he verificado que no hay wpa_supplicant ejecutándose en segundo plano, y el archivo que se crea cuando wpa_supplicant se ejecuta con éxito (/data/misc/wifi/wlan0/wlan0) no existe. ¿Hay otros archivos que wpa_supplicant esté creando?
D/wpa_supplicant( 3627): wpa_supplicant v0.8.x
D/wpa_supplicant( 3627): random: Trying to read entropy from /dev/random
D/wpa_supplicant( 3627): Initializing interface 'wlan0' conf '/data/misc/wifi/wpa_supplicant.conf' driver 'nl80211' ctr
_interface 'N/A' bridge 'N/A'
D/wpa_supplicant( 3627): Configuration file '/data/misc/wifi/wpa_supplicant.conf' -> '/data/misc/wifi/wpa_supplicant.co
f'
D/wpa_supplicant( 3627): Reading configuration file '/data/misc/wifi/wpa_supplicant.conf'
D/wpa_supplicant( 3627): update_config=1
D/wpa_supplicant( 3627): ctrl_interface='wlan0'
D/wpa_supplicant( 3627): eapol_version=1
D/wpa_supplicant( 3627): ap_scan=1
D/wpa_supplicant( 3627): fast_reauth=1
D/wpa_supplicant( 3627): config_methods='push_button keypad display'
D/wpa_supplicant( 3627): device_name='U8500'
D/wpa_supplicant( 3627): default_bgscan='learn:60:-70:300:10:20:/data/misc/wifi/wpa_supplicant_bgscan.db'
D/wpa_supplicant( 3627): wmm_enabled=1
D/wpa_supplicant( 3627): uapsd_enabled=1
D/wpa_supplicant( 3627): nl80211: interface wlan0 in phy phy0
I/wpa_supplicant( 3627): rfkill: Cannot open RFKILL control device
D/wpa_supplicant( 3627): nl80211: RFKILL status not available
D/wpa_supplicant( 3627): nl80211: Set mode ifindex 5 iftype 2 (STATION)
D/wpa_supplicant( 3627): netlink: Operstate: linkmode=1, operstate=5
D/wpa_supplicant( 3627): nl80211: Using driver-based off-channel TX
D/wpa_supplicant( 3627): nl80211: driver param='(null)'
D/wpa_supplicant( 3627): wapi_initialization()
D/wpa_supplicant( 3627): wlan0: Own MAC address: 00:80:e1:c2:89:9a
D/wpa_supplicant( 3627): Country: 00
D/wpa_supplicant( 3627): wpa_driver_nl80211_set_key: ifindex=5 alg=0 addr=0x0 key_idx=0 set_tx=0 seq_len=0 key_len=0
D/wpa_supplicant( 3627): wpa_driver_nl80211_set_key: ifindex=5 alg=0 addr=0x0 key_idx=1 set_tx=0 seq_len=0 key_len=0
D/wpa_supplicant( 3627): wpa_driver_nl80211_set_key: ifindex=5 alg=0 addr=0x0 key_idx=2 set_tx=0 seq_len=0 key_len=0
D/wpa_supplicant( 3627): wpa_driver_nl80211_set_key: ifindex=5 alg=0 addr=0x0 key_idx=3 set_tx=0 seq_len=0 key_len=0
D/wpa_supplicant( 3627): wlan0: RSN: flushing PMKID list in the driver
D/wpa_supplicant( 3627): nl80211: Flush PMKIDs
D/wpa_supplicant( 3627): wlan0: State: DISCONNECTED -> INACTIVE
I/wpa_supplicant( 3627): WPS: Converting display to virtual_display for WPS 2.0 compliance
I/wpa_supplicant( 3627): WPS: Converting push_button to virtual_push_button for WPS 2.0 compliance
D/wpa_supplicant( 3627): nl80211: Regulatory information - country=00
D/wpa_supplicant( 3627): nl80211: 2402-2472 @ 40 MHz
D/wpa_supplicant( 3627): nl80211: 2457-2482 @ 20 MHz
D/wpa_supplicant( 3627): nl80211: 2474-2494 @ 20 MHz
D/wpa_supplicant( 3627): nl80211: 5170-5250 @ 40 MHz
D/wpa_supplicant( 3627): nl80211: 5735-5835 @ 40 MHz
D/wpa_supplicant( 3627): nl80211: Added 802.11b mode based on 802.11g information
D/wpa_supplicant( 3627): WPS: Set UUID for interface wlan0
E/wpa_supplicant( 3627): WPS: UUID based on MAC address - hexdump(len=16): b2 15 b7 6a cb d7 55 cf b9 d4 3e 8c 40 ae 2d
30
D/wpa_supplicant( 3627): EAPOL: SUPP_PAE entering state DISCONNECTED
D/wpa_supplicant( 3627): EAPOL: Supplicant port status: Unauthorized
D/wpa_supplicant( 3627): EAPOL: KEY_RX entering state NO_KEY_RECEIVE
D/wpa_supplicant( 3627): EAPOL: SUPP_BE entering state INITIALIZE
D/wpa_supplicant( 3627): EAP: EAP entering state DISABLED
D/wpa_supplicant( 3627): EAPOL: Supplicant port status: Unauthorized
D/wpa_supplicant( 3627): EAPOL: Supplicant port status: Unauthorized
E/wpa_supplicant( 3627): Failed to initialize control interface 'wlan0'.
E/wpa_supplicant( 3627): You may have another wpa_supplicant process already running or the file was
E/wpa_supplicant( 3627): left by an unclean termination of wpa_supplicant in which case you will need
E/wpa_supplicant( 3627): to manually remove this file before starting wpa_supplicant again.
D/wpa_supplicant( 3627): Failed to add interface wlan0
D/wpa_supplicant( 3627): wlan0: No keys have been configured - skip key clearing
D/wpa_supplicant( 3627): wlan0: State: INACTIVE -> DISCONNECTED
D/wpa_supplicant( 3627): wpa_driver_nl80211_set_operstate: operstate 0->0 (DORMANT)
D/wpa_supplicant( 3627): netlink: Operstate: linkmode=-1, operstate=5
D/wpa_supplicant( 3627): EAPOL: External notification - portEnabled=0
D/wpa_supplicant( 3627): EAPOL: Supplicant port status: Unauthorized
D/wpa_supplicant( 3627): EAPOL: External notification - portValid=0
D/wpa_supplicant( 3627): EAPOL: Supplicant port status: Unauthorized
D/wpa_supplicant( 3627): wlan0: No keys have been configured - skip key clearing
D/wpa_supplicant( 3627): wlan0: Cancelling scan request
D/wpa_supplicant( 3627): wlan0: Cancelling authentication timeout
D/wpa_supplicant( 3627): nl80211: Set TX rates failed: ret=-22 (Invalid argument)
D/wpa_supplicant( 3627): netlink: Operstate: linkmode=0, operstate=6
D/wpa_supplicant( 3627): nl80211: Set mode ifindex 5 iftype 2 (STATION)
I/wpa_supplicant( 3627): ELOOP: remaining socket: sock=15 eloop_data=0xa5320 user_data=0x0 handler=0x6acd9
¿Alguien puede indicarme qué puedo estar haciendo mal? ¿Permisos?