android 4.0 wifi-direct 实现分析-supplicant部分

wpa_drv_get_capa

{

 wpa_s->drv_priv = wpa_drv_init(wpa_s, wpa_s->ifname);

wpa_drv_get_capa(wpa_s, &capa);

wpa_s->drv_flags = capa.flags;

wpas_p2p_init

}

 

device capa  support or not 

 wpas_p2p_init ->p2p_init

 global->p2p = p2p_init(&p2p);

 

wpa_drv_get_capa()

int wpa_driver_wext_get_capa(void *priv, struct wpa_driver_capa *capa)
{
 struct wpa_driver_wext_data *drv = priv;
 if (!drv->has_capability)
  return -1;
 os_memcpy(capa, &drv->capa, sizeof(*capa));// wpa_s->drv_priv = wpa_drv_init(wpa_s, wpa_s->ifname);
 return 0;
}

//判断设备是否支持p2p

wpa_driver_nl80211_capa

{

 if (info.p2p_supported)
  drv->capa.flags |= WPA_DRIVER_FLAGS_P2P_CAPABLE;

}


你可能感兴趣的:(android 4.0 wifi-direct 实现分析-supplicant部分)