[PATCH v2 1/2] P2P: Enable 40MHz support for p2p group addition

Rajkumar Manoharan rmanohar at qca.qualcomm.com
Mon Jul 16 04:23:30 EDT 2012


On Mon, Jul 16, 2012 at 09:56:45AM +0300, Arik Nemtsov wrote:
> On Thu, Jul 12, 2012 at 11:44 AM, Rajkumar Manoharan
> <rmanohar at qca.qualcomm.com> wrote:
> > Add optional "ht40" argument for p2p_group_add command to enable 40MHz
> > in 5GHz band. This could configure secondary channel, when 11n support
> > was enabled and if the HW supports 40MHz channel width.
> >
> > Signed-hostap: Rajkumar Manoharan <rmanohar at qca.qualcomm.com>
> [...]
> >  static int p2p_ctrl_group_add(struct wpa_supplicant *wpa_s, char *cmd)
> >  {
> > -       int freq = 0;
> > +       int freq = 0, ht40 = 0;
> >         char *pos;
> >
> >         pos = os_strstr(cmd, "freq=");
> >         if (pos)
> >                 freq = atoi(pos + 5);
> >
> > +       if (os_strncmp(cmd, "ht40", 4) == 0)
> > +               ht40 = 1;
> 
> This limits ht40 to appear only in the beginning of the command. I
> hope that's on purpose?
> 
Nice. I will replace it by !!os_strstr(cmd, "ht40");
> > +
> >         if (os_strncmp(cmd, "persistent=", 11) == 0)
> > -               return p2p_ctrl_group_add_persistent(wpa_s, cmd + 11, freq);
> > +               return p2p_ctrl_group_add_persistent(wpa_s, cmd + 11, freq, ht40);
> >         if (os_strcmp(cmd, "persistent") == 0 ||
> >             os_strncmp(cmd, "persistent ", 11) == 0)
> > -               return wpas_p2p_group_add(wpa_s, 1, freq);
> > +               return wpas_p2p_group_add(wpa_s, 1, freq, ht40);
> >         if (os_strncmp(cmd, "freq=", 5) == 0)
> > -               return wpas_p2p_group_add(wpa_s, 0, freq);
> > +               return wpas_p2p_group_add(wpa_s, 0, freq, ht40);
> > +       if (ht40)
> > +               return wpas_p2p_group_add(wpa_s, 0, freq, ht40);
> [...]
> 
> > @@ -2019,7 +2020,7 @@ static void wpas_invitation_received(void *ctx, const u8 *sa, const u8 *bssid,
> >                            MAC2STR(sa), op_freq);
> >                 if (s) {
> >                         wpas_p2p_group_add_persistent(
> > -                               wpa_s, s, s->mode == WPAS_MODE_P2P_GO, 0);
> > +                               wpa_s, s, s->mode == WPAS_MODE_P2P_GO, 0, 0);
> >                 } else if (bssid) {
> >                         wpas_p2p_join(wpa_s, bssid, go_dev_addr,
> >                                       wpa_s->p2p_wps_method, 0);
> 
> This appears to be a corner case of the
> ht40-only-on-explicit-p2p-connect approach. Here we can never enable
> ht40.
> 
Exactly.

> Jouni - perhaps we can also use a global parameter in
> wpa_supplicant.conf (go_enable_ht40=1)?
> The p2p_connect parameter (if specified) will override the globally
> set parameter.
>
Sounds good. May be we can address it separately.

> > @@ -2086,7 +2087,7 @@ static void wpas_invitation_result(void *ctx, int status, const u8 *bssid)
> >         }
> >
> >         wpas_p2p_group_add_persistent(wpa_s, ssid,
> > -                                     ssid->mode == WPAS_MODE_P2P_GO, 0);
> > +                                     ssid->mode == WPAS_MODE_P2P_GO, 0, 0);
> >  }
> 
> Same argument applies here.
> 
> >
> >
> > @@ -2331,6 +2332,42 @@ static int wpas_go_connected(void *ctx, const u8 *dev_addr)
> >         return 0;
> >  }
> >
> > +int wpas_p2p_select_ht40_sec_channel(struct wpa_supplicant *wpa_s,
> > +                                    struct hostapd_hw_modes *mode,
> > +                                    u8 channel)
> 
> This functions seems like a duplication of wpas_p2p_setup_channels().
> Perhaps its worth separating out the common code into another
> function?
>
Will give a try. But functionality wise both are differed.
Thanks for the review.

-Rajkumar


More information about the HostAP mailing list