[PATCH] Adding new mode - WPAS_MODE_P2P_CLIENT for P2P client.

Janusz Dziedzic janusz.dziedzic at gmail.com
Sun Apr 10 08:19:15 EDT 2011


And patch file.

BR
Janusz

2011/4/8 Janusz Dziedzic <janusz.dziedzic at gmail.com>:
> Hello,
>
> New mode added for p2p_client. Now we know if we are p2p_client or
> legacy station.
>
>
> From 8ca5f8cea4edd7d3e8413c0c232e3f00ec5aa27f Mon Sep 17 00:00:00 2001
> From: Janusz Dziedzic <janusz.dziedzic at gmail.com>
> Date: Fri, 8 Apr 2011 22:02:07 +0300
> Subject: [PATCH] Adding new mode - WPAS_MODE_P2P_CLIENT for P2P client.
>
>  wpa_supplicant/ap.c             |    1 +
>  wpa_supplicant/config_ssid.h    |    1 +
>  wpa_supplicant/ctrl_iface.c     |    5 +++++
>  wpa_supplicant/p2p_supplicant.c |    1 +
>  4 files changed, 8 insertions(+), 0 deletions(-)
>
> diff --git a/wpa_supplicant/ap.c b/wpa_supplicant/ap.c
> index 95279d3..ec61d99 100644
> --- a/wpa_supplicant/ap.c
> +++ b/wpa_supplicant/ap.c
> @@ -328,6 +328,7 @@ int wpa_supplicant_create_ap(struct wpa_supplicant *wpa_s,
>        params.ssid_len = ssid->ssid_len;
>        switch (ssid->mode) {
>        case WPAS_MODE_INFRA:
> +       case WPAS_MODE_P2P_CLIENT:
>                params.mode = IEEE80211_MODE_INFRA;
>                break;
>        case WPAS_MODE_IBSS:
> diff --git a/wpa_supplicant/config_ssid.h b/wpa_supplicant/config_ssid.h
> index 8419f43..826dc6e 100644
> --- a/wpa_supplicant/config_ssid.h
> +++ b/wpa_supplicant/config_ssid.h
> @@ -294,6 +294,7 @@ struct wpa_ssid {
>                WPAS_MODE_AP = 2,
>                WPAS_MODE_P2P_GO = 3,
>                WPAS_MODE_P2P_GROUP_FORMATION = 4,
> +               WPAS_MODE_P2P_CLIENT = 5,
>        } mode;
>
>        /**
> diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
> index 5488ea4..5f11057 100644
> --- a/wpa_supplicant/ctrl_iface.c
> +++ b/wpa_supplicant/ctrl_iface.c
> @@ -812,6 +812,11 @@ static int
> wpa_supplicant_ctrl_iface_status(struct wpa_supplicant *wpa_s,
>                                                  "mode=P2P GO - group "
>                                                  "formation\n");
>                                break;
> +
> +                       case WPAS_MODE_P2P_CLIENT:
> +                               ret = os_snprintf(pos, end - pos,
> +                                                 "mode=P2P CLIENT\n");
> +                               break;
>                        default:
>                                ret = 0;
>                                break;
> diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
> index cfa6510..0630662 100644
> --- a/wpa_supplicant/p2p_supplicant.c
> +++ b/wpa_supplicant/p2p_supplicant.c
> @@ -3772,6 +3772,7 @@ void wpas_p2p_completed(struct wpa_supplicant *wpa_s)
>        if (ssid->passphrase == NULL && ssid->psk_set) {
>                char psk[65];
>                wpa_snprintf_hex(psk, sizeof(psk), ssid->psk, 32);
> +               ssid->mode = WPAS_MODE_P2P_CLIENT;
>                wpa_msg(wpa_s->parent, MSG_INFO, P2P_EVENT_GROUP_STARTED
>                        "%s client ssid=\"%s\" freq=%d psk=%s go_dev_addr="
>                        MACSTR "%s",
> --
> 1.7.1
>



-- 
Janusz Dziedzic
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Adding-new-mode-WPAS_MODE_P2P_CLIENT-for-P2P-client.patch
Type: text/x-patch
Size: 2252 bytes
Desc: not available
Url : http://lists.shmoo.com/pipermail/hostap/attachments/20110410/08f0396f/attachment.bin 


More information about the HostAP mailing list