[Pkg-utopia-commits] r2424 - in /packages/unstable/hal/debian: changelog patches/60_use-wext-ioctl-instead-of-sysfs-to-detect-wireless.patch patches/61_use-phy80211-instead-of-wiphy-symlink-to-detect.patch

lool at users.alioth.debian.org lool at users.alioth.debian.org
Mon Sep 22 21:20:32 UTC 2008


Author: lool
Date: Mon Sep 22 21:20:31 2008
New Revision: 2424

URL: http://svn.debian.org/wsvn/pkg-utopia/?sc=1&rev=2424
Log:
* New patches backported and adapated from upstream, fixing support of some
  wifi chips with 2.6.27 kernels; closes: #498132, #498478.
  - 60_use-wext-ioctl-instead-of-sysfs-to-detect-wireless, fixes detection
    of wifi interfaces with 2.6.27 kernels.
  - 61_use-phy80211-instead-of-wiphy-symlink-to-detect, fixes the sysfs
    symlink lookup to use the proper pathname.
  - WIP: should redo the patches in proper order, cough

Added:
    packages/unstable/hal/debian/patches/60_use-wext-ioctl-instead-of-sysfs-to-detect-wireless.patch
    packages/unstable/hal/debian/patches/61_use-phy80211-instead-of-wiphy-symlink-to-detect.patch
Modified:
    packages/unstable/hal/debian/changelog

Modified: packages/unstable/hal/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-utopia/packages/unstable/hal/debian/changelog?rev=2424&op=diff
==============================================================================
--- packages/unstable/hal/debian/changelog (original)
+++ packages/unstable/hal/debian/changelog Mon Sep 22 21:20:31 2008
@@ -1,3 +1,15 @@
+hal (0.5.11-4) UNRELEASED; urgency=low
+
+  * New patches backported and adapated from upstream, fixing support of some
+    wifi chips with 2.6.27 kernels; closes: #498132, #498478.
+    - 60_use-wext-ioctl-instead-of-sysfs-to-detect-wireless, fixes detection
+      of wifi interfaces with 2.6.27 kernels.
+    - 61_use-phy80211-instead-of-wiphy-symlink-to-detect, fixes the sysfs
+      symlink lookup to use the proper pathname.
+    - WIP: should redo the patches in proper order, cough
+
+ -- Loic Minier <lool at dooz.org>  Mon, 22 Sep 2008 22:54:46 +0200
+
 hal (0.5.11-3) unstable; urgency=low
 
   [ Michael Biebl ]

Added: packages/unstable/hal/debian/patches/60_use-wext-ioctl-instead-of-sysfs-to-detect-wireless.patch
URL: http://svn.debian.org/wsvn/pkg-utopia/packages/unstable/hal/debian/patches/60_use-wext-ioctl-instead-of-sysfs-to-detect-wireless.patch?rev=2424&op=file
==============================================================================
--- packages/unstable/hal/debian/patches/60_use-wext-ioctl-instead-of-sysfs-to-detect-wireless.patch (added)
+++ packages/unstable/hal/debian/patches/60_use-wext-ioctl-instead-of-sysfs-to-detect-wireless.patch Mon Sep 22 21:20:31 2008
@@ -1,0 +1,65 @@
+Backported and adapted from this commit:
+
+From 41073645ea95e0bb478d6b26871a1bc4ccf832d1 Mon Sep 17 00:00:00 2001
+From: Johannes Berg <johannes at sipsolutions.net>
+Date: Fri, 23 May 2008 17:31:51 +0200
+Subject: [PATCH] use wext ioctl instead of sysfs to detect wireless
+
+The canonical way to check whether a network interface has wireless
+extensions is to try calling the SIOCGIWNAME ioctl on it.
+
+--- hal-0.5.11/hald/linux/device.c	2008-05-08 01:23:42.000000000 +0200
++++ hal-0.5.11.new/hald/linux/device.c	2008-09-22 23:06:05.000000000 +0200
+@@ -45,6 +45,10 @@
+   #include <linux/input.h>
+ #endif
+ 
++/* for wireless extensions */
++#include <linux/if.h>
++#include <linux/wireless.h>
++
+ #include <dbus/dbus.h>
+ #include <dbus/dbus-glib.h>
+ 
+@@ -532,10 +536,14 @@
+ 		const char *addr;
+ 		const char *parent_subsys;
+ 		char bridge_path[HAL_PATH_MAX];
+-		char wireless_path[HAL_PATH_MAX];
+ 		char wiphy_path[HAL_PATH_MAX];
+ 		struct stat s;
+ 		dbus_uint64_t mac_address = 0;
++		int ioctl_fd;
++		struct iwreq iwr;
++
++		ioctl_fd = socket (PF_INET, SOCK_DGRAM, 0);
++		strncpy (iwr.ifr_ifrn.ifrn_name, ifname, IFNAMSIZ);
+ 
+ 		addr = hal_device_property_get_string (d, "net.address");
+ 		if (addr != NULL) {
+@@ -554,7 +562,6 @@
+ 		}
+ 
+ 		snprintf (bridge_path, HAL_PATH_MAX, "%s/bridge", sysfs_path);
+-		snprintf (wireless_path, HAL_PATH_MAX, "%s/wireless", sysfs_path);
+ 		/* wireless dscape stack e.g. from rt2500pci driver*/
+ 		snprintf (wiphy_path, HAL_PATH_MAX, "%s/wiphy", sysfs_path);
+ 		parent_subsys = hal_device_property_get_string (parent_dev, "info.subsystem");
+@@ -564,7 +571,7 @@
+ 			hal_device_property_set_string (d, "info.category", "net.bluetooth");
+ 			hal_device_add_capability (d, "net.bluetooth");
+ 			hal_device_property_set_uint64 (d, "net.bluetooth.mac_address", mac_address);
+-		} else if ((stat (wireless_path, &s) == 0 && (s.st_mode & S_IFDIR)) ||
++		} else if ((ioctl (ioctl_fd, SIOCGIWNAME, &iwr) == 0) ||
+ 			(stat (wiphy_path, &s) == 0 && (s.st_mode & S_IFDIR))) {
+ 			hal_device_property_set_string (d, "info.product", "WLAN Interface");
+ 			hal_device_property_set_string (d, "info.category", "net.80211");
+@@ -581,6 +588,8 @@
+ 			hal_device_add_capability (d, "net.80203");
+ 			hal_device_property_set_uint64 (d, "net.80203.mac_address", mac_address);
+ 		}
++
++		close (ioctl_fd);
+ 	} else if (media_type == ARPHRD_IRDA) {
+ 		hal_device_property_set_string (d, "info.product", "Networking Interface");
+ 		hal_device_property_set_string (d, "info.category", "net.irda");

Added: packages/unstable/hal/debian/patches/61_use-phy80211-instead-of-wiphy-symlink-to-detect.patch
URL: http://svn.debian.org/wsvn/pkg-utopia/packages/unstable/hal/debian/patches/61_use-phy80211-instead-of-wiphy-symlink-to-detect.patch?rev=2424&op=file
==============================================================================
--- packages/unstable/hal/debian/patches/61_use-phy80211-instead-of-wiphy-symlink-to-detect.patch (added)
+++ packages/unstable/hal/debian/patches/61_use-phy80211-instead-of-wiphy-symlink-to-detect.patch Mon Sep 22 21:20:31 2008
@@ -1,0 +1,42 @@
+Backported and adapted from this commit:
+
+From d5d0b8cd48d07b5854565d9ad2c4dcc92fdda2e7 Mon Sep 17 00:00:00 2001
+From: Johannes Berg <johannes at sipsolutions.net>
+Date: Fri, 23 May 2008 17:29:47 +0200
+Subject: [PATCH] use 'phy80211' instead of 'wiphy' symlink to detect wireless
+
+When hal wants to determine whether a device is wireless or not,
+it looks up the 'wiphy' symlink that only existed in unreleased
+versions of cfg80211, mainline uses 'phy80211' now.
+
+--- hal-0.5.11/hald/linux/device.c	2008-09-22 23:07:30.000000000 +0200
++++ hal-0.5.11.new/hald/linux/device.c	2008-09-22 23:10:17.000000000 +0200
+@@ -536,7 +536,7 @@
+ 		const char *addr;
+ 		const char *parent_subsys;
+ 		char bridge_path[HAL_PATH_MAX];
+-		char wiphy_path[HAL_PATH_MAX];
++		char phy80211_path[HAL_PATH_MAX];
+ 		struct stat s;
+ 		dbus_uint64_t mac_address = 0;
+ 		int ioctl_fd;
+@@ -562,8 +562,8 @@
+ 		}
+ 
+ 		snprintf (bridge_path, HAL_PATH_MAX, "%s/bridge", sysfs_path);
+-		/* wireless dscape stack e.g. from rt2500pci driver*/
+-		snprintf (wiphy_path, HAL_PATH_MAX, "%s/wiphy", sysfs_path);
++		/* cfg80211 */
++		snprintf (phy80211_path, HAL_PATH_MAX, "%s/phy80211", sysfs_path);
+ 		parent_subsys = hal_device_property_get_string (parent_dev, "info.subsystem");
+ 
+ 		if (parent_subsys && strcmp(parent_subsys, "bluetooth") == 0) {
+@@ -572,7 +572,7 @@
+ 			hal_device_add_capability (d, "net.bluetooth");
+ 			hal_device_property_set_uint64 (d, "net.bluetooth.mac_address", mac_address);
+ 		} else if ((ioctl (ioctl_fd, SIOCGIWNAME, &iwr) == 0) ||
+-			(stat (wiphy_path, &s) == 0 && (s.st_mode & S_IFDIR))) {
++			(stat (phy80211_path, &s) == 0 && (s.st_mode & S_IFDIR))) {
+ 			hal_device_property_set_string (d, "info.product", "WLAN Interface");
+ 			hal_device_property_set_string (d, "info.category", "net.80211");
+ 			hal_device_add_capability (d, "net.80211");




More information about the Pkg-utopia-commits mailing list