P2P: Remove 802.11b rates from wpa_supplicant AP mode operations
authorJouni Malinen <jouni.malinen@atheros.com>
Sun, 18 Jul 2010 21:30:25 +0000 (14:30 -0700)
committerJouni Malinen <j@w1.fi>
Thu, 9 Sep 2010 14:17:17 +0000 (07:17 -0700)
TODO: do this only for P2P group interface

wpa_supplicant/ap.c

index a1fe9c6..ab63d6f 100644 (file)
@@ -67,6 +67,34 @@ static int wpa_supplicant_conf_ap(struct wpa_supplicant *wpa_s,
        /* TODO: enable HT if driver supports it;
         * drop to 11b if driver does not support 11g */
 
+#ifdef CONFIG_P2P
+       if (conf->hw_mode == HOSTAPD_MODE_IEEE80211G) {
+               /* Remove 802.11b rates from supported and basic rate sets */
+               int *list = os_malloc(4 * sizeof(int));
+               if (list) {
+                       list[0] = 60;
+                       list[1] = 120;
+                       list[2] = 240;
+                       list[3] = -1;
+               }
+               conf->basic_rates = list;
+
+               list = os_malloc(9 * sizeof(int));
+               if (list) {
+                       list[0] = 60;
+                       list[1] = 90;
+                       list[2] = 120;
+                       list[3] = 180;
+                       list[4] = 240;
+                       list[5] = 360;
+                       list[6] = 480;
+                       list[7] = 540;
+                       list[8] = -1;
+               }
+               conf->supported_rates = list;
+       }
+#endif /* CONFIG_P2P */
+
        if (ssid->ssid_len == 0) {
                wpa_printf(MSG_ERROR, "No SSID configured for AP mode");
                return -1;