P2P_CLIENT or STATION - how to check this?
Janusz Dziedzic
janusz.dziedzic
Fri Apr 8 01:32:12 PDT 2011
2011/4/8 <raghunathan.kailasanathan at wipro.com>:
>>
>>Status have only info this is a station:
>>
>><3>P2P-GROUP-STARTED wlan0 client ssid="DIRECT-WB" freq=0
>>psk=897c52bab7a7573e1f
>>922dc947a6d342e7fdf39d5f22e272d3756bee31f8513d
>>go_dev_addr=00:aa:ab:02:9f:22
>>
>>> > status
>>status
>>bssid=00:aa:ab:02:9f:22
>>ssid=DIRECT-WB
>>id=0
>>mode=station
>>pairwise_cipher=CCMP
>>group_cipher=CCMP
>>key_mgmt=WPA2-PSK
>>wpa_state=COMPLETED
>>p2p_device_address=00:80:e1:9c:fc:03
>>address=00:80:e1:9c:fc:03
>
> Do you want to make a decision whether it's a legacy station or
> a P2P client ? ... a legacy station won't have a p2p_device_address
> and I don't think it even shows a "mode=" when connected.
>
Seems p2p_address is always present.
Also mode = station is set in case of "standard" connection.
This is what I get without any connection:
> list_n
list_n
network id / ssid / bssid / flags
>
> status
status
wpa_state=INACTIVE
p2p_device_address=00:80:e1:78:8e:94
address=00:80:e1:78:8e:94
>
In case I am connected as station (not p2p):
> enable_n 0
enable_n 0
OK
<3>CTRL-EVENT-STATE-CHANGE id=-1 state=3
<3>CTRL-EVENT-SCAN-RESULTS
<3>WPS-AP-AVAILABLE
<3>Trying to associate with 68:7f:74:0a:ca:80 (SSID='internet' freq=2432 MHz)
<3>CTRL-EVENT-STATE-CHANGE id=-1 state=5
<3>CTRL-EVENT-STATE-CHANGE id=0 state=6
<3>Associated with 68:7f:74:0a:ca:80
<3>CTRL-EVENT-STATE-CHANGE id=0 state=9
<3>CTRL-EVENT-CONNECTED - Connection to 68:7f:74:0a:ca:80 completed (reauth) [id
=0 id_str=]
<3>Connection quality monitor event: RSSI high
> >
> status
status
bssid=68:7f:74:0a:ca:80
ssid=internet
id=0
mode=station
pairwise_cipher=NONE
group_cipher=NONE
key_mgmt=NONE
wpa_state=COMPLETED
p2p_device_address=00:80:e1:78:8e:94
address=00:80:e1:78:8e:94
>
> list_n
list_n
network id / ssid / bssid / flags
0 internet any [CURRENT]
>
So, I added small patch for that - new field in struct ssid() and set
this field in wpas_p2p_completed() when we became P2P_STATION and
P2P_GO. Seems work fine for my case as temporary solution.
Maybe we should extend:
enum wpas_mode { } structure and add WPAS_MODE_P2P_CLIENT.
BR
Janusz
More information about the Hostap
mailing list