AnsweredAssumed Answered

virtual P2P interface creation.

Question asked by sandesh gowda on Mar 15, 2014
Latest reply on Dec 1, 2015 by Ankur Rahi

Hi,

 

I'm using atheros ath9k series Wifi-BT WiFi chip fr Wifi bringup. The respective driver support to create "waln0" interface and not virtual interface "p2p0" interface and when i enable Wifi from Android UI, it fails to communicate detect p2p0 interface.(i hard coded p2p_supplicant in wifi_ath.c file to enable WiFi feature).

I need p2p0 interface to bringup WiFi direct and WiFi display feature. so i try to create p2p0 interface from wifi_ath.c file using libnl API's like (nlmsg_alloc, nl_cb_alloc, nl_send_auto_complete). with libnl library APi's able to create p2p0 interface as below:

-----------------------------------------------------------------

wlan0DOWN                               0.0.0.0/0   0x00001002 00:0e:8e:42:e3:78
p2p0 DOWN                               0.0.0.0/0   0x00001002 00:0e:8e:42:e3:78

---------------------------------------------------------------------------

but fails to start p2p0 interface when i select WiFi option from UI and from logcat getting following errors .

------------------------------------------------------------

E/wpa_supplicant( 3201): nl80211: Register frame match - hexdump(len=2): 0a 07

E/wpa_supplicant( 3201): Could not set interface p2p0 flags (UP): Name not unique on network

E/wpa_supplicant( 3201): nl80211: Could not set interface 'p2p0' UP

E/wpa_supplicant( 3201): nl80211: Set mode ifindex 8 iftype 2 (STATION)

E/wpa_supplicant( 3201): nl80211: Unsubscribe mgmt frames handle 0x41a470e0 (mode change)

E/wpa_supplicant( 3201): p2p0: Failed to initialize driver interface

E/wpa_supplicant( 3201): Failed to add interface p2p0

E/wpa_supplicant( 3201): p2p0: Cancelling authentication timeout

I/wpa_supplicant( 3201): wpa_driver_set_ap_wps_p2p_ie: Entry

E/wpa_supplicant( 3201): wlan0: Removing interface wlan0

E/wpa_supplicant( 3201): wlan0: No keys have been configured - skip key clearing

E/wpa_supplicant( 3201): wlan0: State: DISCONNECTED -> DISCONNECTED

E/wpa_supplicant( 3201): wpa_driver_nl80211_set_operstate: operstate 0->0 (DORMANT)

E/wpa_supplicant( 3201): wlan0: No keys have been configured - skip key clearing

E/wpa_supplicant( 3201): wlan0: Cancelling authentication timeout

E/wpa_supplicant( 3201): nl80211: Set mode ifindex 7 iftype 2 (STATION)

E/wpa_supplicant( 3201): nl80211: Unsubscribe mgmt frames handle 0x41a37f28 (mode change)

I/wpa_supplicant( 3201): wlan0: CTRL-EVENT-TERMINATING

---------------------------------------------------------------------------------------

 

I even try to modify MAC address on basis of wlan0 mac address when i create p2p0 interface in wifi_ath.c and it fails to update:

---------------------------------------------------------------------------------------------------

    get_mac_addr(WLAN_INTERFACE, mac_addr); // function to get wlan0 mac address ex:00:0e:8e:42:e3:78
    update_p2p_mac_addr(mac_addr, new_addr);// Api to create p2p0 macc address fe:0e:8e:42:e3:78
    mac_addr_n2a(buf1, new_addr);
    ALOGE("get_mac_addr: ifname=%s, NEW MAC Address=%s",iface, buf1);

 

 

NLA_PUT_STRING(msg, NL80211_ATTR_IFNAME, iface);
NLA_PUT_U32(msg, NL80211_ATTR_IFTYPE, type);
NLA_PUT(msg, NL80211_ATTR_MAC, 6, new_addr);

--------------------------------------------------------------------------------------------------------------------------

But p2p0 mac address is not reflecting.

 

The following are the queries:

1. What are the ways to create p2p0 interface from userspace?

2. how i can modifiy mac address from userspace?

3. i'm finding difficulty in creating p2p0  virtual interface from ath9k kernel 3.0.35 version. Is there an patches availble?

 

Appreciate your help in advance regarding Wifi Direct bringup.

 

Thanks,

Sandesh D

Outcomes