Browse Source

Add test command for disabling/enabling A-MPDU aggregation

ctrl_iface command "SET ampdu <0/1>" can now be used to
disable/enable A-MPDU aggregation.
Jouni Malinen 14 years ago
parent
commit
b6c79a998f
4 changed files with 20 additions and 1 deletions
  1. 8 0
      src/drivers/driver.h
  2. 2 1
      src/drivers/driver_ndis.c
  3. 3 0
      wpa_supplicant/ctrl_iface.c
  4. 7 0
      wpa_supplicant/driver_i.h

+ 8 - 0
src/drivers/driver.h

@@ -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);
 };
 
 

+ 2 - 1
src/drivers/driver_ndis.c

@@ -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 */
 };

+ 3 - 0
wpa_supplicant/ctrl_iface.c

@@ -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);

+ 7 - 0
wpa_supplicant/driver_i.h

@@ -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 */