mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-01-30 08:44:03 -05:00
Android: Add P2P/WPS wrappers for private lib
Android uses a vendor specific library for implementing couple of driver interface functions. Add the wrapper code to allow that mechanism to be used. Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
7b74c0acfb
commit
0de3803610
@ -363,6 +363,14 @@ static int android_pno_start(struct i802_bss *bss,
|
|||||||
struct wpa_driver_scan_params *params);
|
struct wpa_driver_scan_params *params);
|
||||||
static int android_pno_stop(struct i802_bss *bss);
|
static int android_pno_stop(struct i802_bss *bss);
|
||||||
#endif /* ANDROID */
|
#endif /* ANDROID */
|
||||||
|
#ifdef ANDROID_P2P
|
||||||
|
int wpa_driver_set_p2p_noa(void *priv, u8 count, int start, int duration);
|
||||||
|
int wpa_driver_get_p2p_noa(void *priv, u8 *buf, size_t len);
|
||||||
|
int wpa_driver_set_p2p_ps(void *priv, int legacy_ps, int opp_ps, int ctwindow);
|
||||||
|
int wpa_driver_set_ap_wps_p2p_ie(void *priv, const struct wpabuf *beacon,
|
||||||
|
const struct wpabuf *proberesp,
|
||||||
|
const struct wpabuf *assocresp);
|
||||||
|
#endif /* ANDROID_P2P */
|
||||||
|
|
||||||
static void add_ifidx(struct wpa_driver_nl80211_data *drv, int ifidx);
|
static void add_ifidx(struct wpa_driver_nl80211_data *drv, int ifidx);
|
||||||
static void del_ifidx(struct wpa_driver_nl80211_data *drv, int ifidx);
|
static void del_ifidx(struct wpa_driver_nl80211_data *drv, int ifidx);
|
||||||
@ -615,10 +623,13 @@ static int send_and_recv_msgs_global(struct nl80211_global *global,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int send_and_recv_msgs(struct wpa_driver_nl80211_data *drv,
|
#ifndef ANDROID_P2P
|
||||||
struct nl_msg *msg,
|
static
|
||||||
int (*valid_handler)(struct nl_msg *, void *),
|
#endif /* ANDROID_P2P */
|
||||||
void *valid_data)
|
int send_and_recv_msgs(struct wpa_driver_nl80211_data *drv,
|
||||||
|
struct nl_msg *msg,
|
||||||
|
int (*valid_handler)(struct nl_msg *, void *),
|
||||||
|
void *valid_data)
|
||||||
{
|
{
|
||||||
return send_and_recv(drv->global, drv->global->nl, msg,
|
return send_and_recv(drv->global, drv->global->nl, msg,
|
||||||
valid_handler, valid_data);
|
valid_handler, valid_data);
|
||||||
@ -10610,8 +10621,13 @@ static int nl80211_set_p2p_powersave(void *priv, int legacy_ps, int opp_ps,
|
|||||||
wpa_printf(MSG_DEBUG, "nl80211: set_p2p_powersave (legacy_ps=%d "
|
wpa_printf(MSG_DEBUG, "nl80211: set_p2p_powersave (legacy_ps=%d "
|
||||||
"opp_ps=%d ctwindow=%d)", legacy_ps, opp_ps, ctwindow);
|
"opp_ps=%d ctwindow=%d)", legacy_ps, opp_ps, ctwindow);
|
||||||
|
|
||||||
if (opp_ps != -1 || ctwindow != -1)
|
if (opp_ps != -1 || ctwindow != -1) {
|
||||||
|
#ifdef ANDROID_P2P
|
||||||
|
wpa_driver_set_p2p_ps(priv, legacy_ps, opp_ps, ctwindow);
|
||||||
|
#else /* ANDROID_P2P */
|
||||||
return -1; /* Not yet supported */
|
return -1; /* Not yet supported */
|
||||||
|
#endif /* ANDROID_P2P */
|
||||||
|
}
|
||||||
|
|
||||||
if (legacy_ps == -1)
|
if (legacy_ps == -1)
|
||||||
return 0;
|
return 0;
|
||||||
@ -11433,4 +11449,9 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
|
|||||||
.get_survey = wpa_driver_nl80211_get_survey,
|
.get_survey = wpa_driver_nl80211_get_survey,
|
||||||
.status = wpa_driver_nl80211_status,
|
.status = wpa_driver_nl80211_status,
|
||||||
.switch_channel = nl80211_switch_channel,
|
.switch_channel = nl80211_switch_channel,
|
||||||
|
#ifdef ANDROID_P2P
|
||||||
|
.set_noa = wpa_driver_set_p2p_noa,
|
||||||
|
.get_noa = wpa_driver_get_p2p_noa,
|
||||||
|
.set_ap_wps_ie = wpa_driver_set_ap_wps_p2p_ie,
|
||||||
|
#endif /* ANDROID_P2P */
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user