Browse Source

Remove disable_11b_rates() driver_ops

This function was used unconditionally if wpa_supplicant build
includes CONFIG_P2P=y. Adding a separate driver_ops for such use
is not really useful since the driver wrappers can do the same
internally. Remove this driver_ops and move matching functionality
into driver_nl80211.c which was the only driver wrapper using
this driver_ops callback.

Signed-hostap: Jouni Malinen <j@w1.fi>
Jouni Malinen 13 years ago
parent
commit
97bcd562eb

+ 0 - 13
src/drivers/driver.h

@@ -1946,19 +1946,6 @@ struct wpa_driver_ops {
 	 */
 	int (*probe_req_report)(void *priv, int report);
 
-	/**
-	 * disable_11b_rates - Set whether IEEE 802.11b rates are used for TX
-	 * @priv: Private driver interface data
-	 * @disabled: Whether IEEE 802.11b rates are disabled
-	 * Returns: 0 on success, -1 on failure (or if not supported)
-	 *
-	 * This command is used to disable IEEE 802.11b rates (1, 2, 5.5, and
-	 * 11 Mbps) as TX rates for data and management frames. This can be
-	 * used to optimize channel use when there is no need to support IEEE
-	 * 802.11b-only devices.
-	 */
-	int (*disable_11b_rates)(void *priv, int disabled);
-
 	/**
 	 * deinit_ap - Deinitialize AP mode
 	 * @priv: Private driver interface data

+ 0 - 1
src/drivers/driver_ndis.c

@@ -3288,7 +3288,6 @@ const struct wpa_driver_ops wpa_driver_ndis_ops = {
 	NULL /* remain_on_channel */,
 	NULL /* cancel_remain_on_channel */,
 	NULL /* probe_req_report */,
-	NULL /* disable_11b_rates */,
 	NULL /* deinit_ap */,
 	NULL /* suspend */,
 	NULL /* resume */,

+ 11 - 10
src/drivers/driver_nl80211.c

@@ -2419,6 +2419,17 @@ wpa_driver_nl80211_finish_drv_init(struct wpa_driver_nl80211_data *drv)
 				       drv, drv->ctx);
 	}
 
+#ifdef CONFIG_P2P
+	if (drv->capa.flags & WPA_DRIVER_FLAGS_P2P_CAPABLE) {
+		/*
+		 * FIX: Do this conditionally on the interface type to avoid
+		 * changing non-P2P use cases.
+		 */
+		drv->disable_11b_rates = 1;
+		nl80211_disable_11b_rates(drv, drv->ifindex, 1);
+	}
+#endif /* CONFIG_P2P */
+
 	return 0;
 }
 
@@ -7022,15 +7033,6 @@ nla_put_failure:
 }
 
 
-static int wpa_driver_nl80211_disable_11b_rates(void *priv, int disabled)
-{
-	struct i802_bss *bss = priv;
-	struct wpa_driver_nl80211_data *drv = bss->drv;
-	drv->disable_11b_rates = disabled;
-	return nl80211_disable_11b_rates(drv, drv->ifindex, disabled);
-}
-
-
 static int wpa_driver_nl80211_deinit_ap(void *priv)
 {
 	struct i802_bss *bss = priv;
@@ -7530,7 +7532,6 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
 	.cancel_remain_on_channel =
 	wpa_driver_nl80211_cancel_remain_on_channel,
 	.probe_req_report = wpa_driver_nl80211_probe_req_report,
-	.disable_11b_rates = wpa_driver_nl80211_disable_11b_rates,
 	.deinit_ap = wpa_driver_nl80211_deinit_ap,
 	.resume = wpa_driver_nl80211_resume,
 	.send_ft_action = nl80211_send_ft_action,

+ 0 - 9
wpa_supplicant/driver_i.h

@@ -426,15 +426,6 @@ static inline int wpa_drv_probe_req_report(struct wpa_supplicant *wpa_s,
 	return -1;
 }
 
-static inline int wpa_drv_disable_11b_rates(struct wpa_supplicant *wpa_s,
-					    int disabled)
-{
-	if (wpa_s->driver->disable_11b_rates)
-		return wpa_s->driver->disable_11b_rates(wpa_s->drv_priv,
-							disabled);
-	return -1;
-}
-
 static inline int wpa_drv_deinit_ap(struct wpa_supplicant *wpa_s)
 {
 	if (wpa_s->driver->deinit_ap)

+ 0 - 5
wpa_supplicant/p2p_supplicant.c

@@ -2134,11 +2134,6 @@ int wpas_p2p_init(struct wpa_global *global, struct wpa_supplicant *wpa_s)
 	if (!(wpa_s->drv_flags & WPA_DRIVER_FLAGS_P2P_CAPABLE))
 		return 0;
 
-	if (wpa_drv_disable_11b_rates(wpa_s, 1) < 0) {
-		wpa_printf(MSG_DEBUG, "P2P: Failed to disable 11b rates");
-		/* Continue anyway; this is not really a fatal error */
-	}
-
 	if (global->p2p)
 		return 0;