From 316d0ed1069790d6a5a68db1c88537ae24c2cc62 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 29 Sep 2011 15:46:47 -0500 Subject: [PATCH] wifi: remove some WEXT leftovers --- src/nm-device-wifi.c | 36 ++++-------------------------------- 1 file changed, 4 insertions(+), 32 deletions(-) diff --git a/src/nm-device-wifi.c b/src/nm-device-wifi.c index ed68081729..2f25431905 100644 --- a/src/nm-device-wifi.c +++ b/src/nm-device-wifi.c @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include @@ -34,6 +33,8 @@ #include #include #include +#include +#include #include "nm-glib-compat.h" #include "nm-device.h" @@ -182,8 +183,6 @@ static void supplicant_iface_notify_scanning_cb (NMSupplicantInterface * iface, GParamSpec * pspec, NMDeviceWifi * self); -static guint32 nm_device_wifi_get_bitrate (NMDeviceWifi *self); - static void cull_scan_list (NMDeviceWifi *self); /*****************************************************************/ @@ -749,7 +748,7 @@ periodic_update (NMDeviceWifi *self) set_current_ap (self, new_ap); } - new_rate = nm_device_wifi_get_bitrate (self); + new_rate = wifi_utils_get_rate (priv->wifi_data); if (new_rate != priv->rate) { priv->rate = new_rate; g_object_notify (G_OBJECT (self), NM_DEVICE_WIFI_BITRATE); @@ -1379,33 +1378,6 @@ impl_device_get_access_points (NMDeviceWifi *self, return TRUE; } -/* - * nm_device_wifi_get_bitrate - * - * For wireless devices, get the bitrate to broadcast/receive at. - * Returned value is rate in Kb/s. - * - */ -static guint32 -nm_device_wifi_get_bitrate (NMDeviceWifi *self) -{ - int err = -1, fd; - struct iwreq wrq; - - g_return_val_if_fail (self != NULL, 0); - - fd = socket (PF_INET, SOCK_DGRAM, 0); - if (fd < 0) - return 0; - - memset (&wrq, 0, sizeof (wrq)); - strncpy (wrq.ifr_name, nm_device_get_iface (NM_DEVICE (self)), IFNAMSIZ); - err = ioctl (fd, SIOCGIWRATE, &wrq); - close (fd); - - return ((err == 0) ? wrq.u.bitrate.value / 1000 : 0); -} - static gboolean scanning_allowed (NMDeviceWifi *self) { @@ -2908,7 +2880,7 @@ activation_success_handler (NMDevice *dev) if (!nm_ap_get_freq (ap)) nm_ap_set_freq (ap, wifi_utils_get_freq (priv->wifi_data)); if (!nm_ap_get_max_bitrate (ap)) - nm_ap_set_max_bitrate (ap, nm_device_wifi_get_bitrate (self)); + nm_ap_set_max_bitrate (ap, wifi_utils_get_rate (priv->wifi_data)); tmp_ap = get_active_ap (self, ap, TRUE); if (tmp_ap) {