Add test command for disabling/enabling A-MPDU aggregation
authorJouni Malinen <jouni.malinen@atheros.com>
Sun, 1 Aug 2010 23:19:31 +0000 (16:19 -0700)
committerJouni Malinen <j@w1.fi>
Thu, 9 Sep 2010 14:17:21 +0000 (07:17 -0700)
ctrl_iface command "SET ampdu <0/1>" can now be used to
disable/enable A-MPDU aggregation.

src/drivers/driver.h
src/drivers/driver_ndis.c
wpa_supplicant/ctrl_iface.c
wpa_supplicant/driver_i.h

index 1af83f1..5352ef5 100644 (file)
@@ -1885,6 +1885,14 @@ struct wpa_driver_ops {
         */
        int (*set_p2p_powersave)(void *priv, int legacy_ps, int opp_ps,
                                 int ctwindow);
+
+       /**
+        * ampdu - Enable/disable aggregation
+        * @priv: Private driver interface data
+        * @ampdu: 1/0 = enable/disable A-MPDU aggregation
+        * Returns: 0 on success or -1 on failure
+        */
+       int (*ampdu)(void *priv, int ampdu);
 };
 
 
index b4b5cf3..ed00e98 100644 (file)
@@ -3307,5 +3307,6 @@ const struct wpa_driver_ops wpa_driver_ndis_ops = {
        NULL /* shared_freq */,
        NULL /* get_noa */,
        NULL /* set_noa */,
-       NULL /* set_p2p_powersave */
+       NULL /* set_p2p_powersave */,
+       NULL /* ampdu */
 };
index 4357ada..0871b39 100644 (file)
@@ -84,6 +84,9 @@ static int wpa_supplicant_ctrl_iface_set(struct wpa_supplicant *wpa_s,
                        ret = -1;
        } else if (os_strcasecmp(cmd, "wps_fragment_size") == 0) {
                wpa_s->wps_fragment_size = atoi(value);
+       } else if (os_strcasecmp(cmd, "ampdu") == 0) {
+               if (wpa_drv_ampdu(wpa_s, atoi(value)) < 0)
+                       ret = -1;
        } else {
                value[-1] = '=';
                ret = wpa_config_process_global(wpa_s->conf, cmd, -1);
index 2e404e9..bfc5b74 100644 (file)
@@ -524,4 +524,11 @@ static inline int wpa_drv_set_p2p_powersave(struct wpa_supplicant *wpa_s,
                                                opp_ps, ctwindow);
 }
 
+static inline int wpa_drv_ampdu(struct wpa_supplicant *wpa_s, int ampdu)
+{
+       if (!wpa_s->driver->ampdu)
+               return -1;
+       return wpa_s->driver->ampdu(wpa_s->drv_priv, ampdu);
+}
+
 #endif /* DRIVER_I_H */