[Bug 35215] Re: ipw3945 driver required for functionality on new Intel PRO/Wireless 3945ABG Mini-PCI Express Adapters

Ian Chiew ian at snork.net
Mon Apr 24 12:31:58 UTC 2006


This wireless controller also needs a binary-only regulation daemon (http://bughost.org/ipw3945/daemon/ipw3945d-1.7.18.tgz) to work.

Perhaps it could be included in /lib/firmware in the kernel package? The daemon could then be automatically loaded at boot time with a udev rule like:

SUBSYSTEM=="drivers", PHYSDEVDRIVER="ipw3945"
ACTION=="add",          RUN+="/lib/firmware/%v/ipw3945d --quiet"
ACTION=="remove",       RUN+="/lib/firmware/%v/ipw3945d --quiet --kill"

udev doesn't have a %v kernel version substitution, so here's a quick patch to implement it:

--- udev-079.orig/udev_rules.c	2006-04-24 22:24:41.000000000 +1000
+++ udev-079/udev_rules.c	2006-04-24 21:46:43.000000000 +1000
@@ -30,6 +30,7 @@
 #include <syslog.h>
 #include <sys/wait.h>
 #include <sys/stat.h>
+#include <sys/utsname.h>
 
 #include "libsysfs/sysfs/libsysfs.h"
 #include "list.h"
@@ -425,6 +426,7 @@
 		SUBST_ROOT,
 		SUBST_MODALIAS,
 		SUBST_ENV,
+		SUBST_KERNEL_VERSION,
 	};
 	static const struct subst_map {
 		char *name;
@@ -445,10 +447,12 @@
 		{ .name = "root",		.fmt = 'r',	.type = SUBST_ROOT },
 		{ .name = "modalias",		.fmt = 'A',	.type = SUBST_MODALIAS },
 		{ .name = "env",		.fmt = 'E',	.type = SUBST_ENV },
+		{ .name = "version",		.fmt = 'v',	.type = SUBST_KERNEL_VERSION },
 		{ NULL, '\0', 0 }
 	};
 	enum subst_type type;
 	const struct subst_map *subst;
+	struct utsname kernel_version;
 
 	head = string;
 	while (1) {
@@ -654,6 +658,15 @@
 			dbg("substitute env '%s=%s'", attr, pos);
 			strlcat(string, pos, maxsize);
 			break;
+		case SUBST_KERNEL_VERSION:
+			if (uname(&kernel_version) == -1)
+			{
+				dbg("could not fetch kernel version");
+				break;
+			}
+			dbg("substitute kernel_version '%s'", kernel_version.release);
+			strlcat(string, kernel_version.release, maxsize);
+			break;
 		default:
 			err("unknown substitution type=%i", type);
 			break;
--- udev-079.orig/udev.8	2005-12-23 10:51:30.000000000 +1100
+++ udev-079/udev.8	2006-04-24 18:56:16.000000000 +1000
@@ -200,6 +200,9 @@
 \fB%r\fR, \fB$root\fR
 The udev_root value.
 .TP
+\fB%v\fR, \fB$version\fR
+The kernel version number (as with 'uname -r').
+.TP
 \fB%N\fR, \fB$tempnode\fR
 The name of a created temporary device node to provide access to the device from a external program before the real node is created.
 .TP

-- 
ipw3945 driver required for functionality on new Intel PRO/Wireless 3945ABG Mini-PCI Express Adapters
https://launchpad.net/bugs/35215




More information about the kernel-bugs mailing list