From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg KH Date: Thu, 25 Jan 2007 20:38:23 +0000 Subject: Re: udev problems with crypto hardware Message-Id: <20070125203823.GA29355@kroah.com> List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: linux-hotplug@vger.kernel.org On Thu, Jan 25, 2007 at 11:29:37AM -0800, Lev Lvovsky wrote: > I'm running into some problems using udev in conjunction with a =20 > hardware crypto device. The board provides a kernel module which =20 > loads as "xcrypto". The /sys filesystem registers the PCI board and =20 > provides some identification that we can use for the rules file. The =20 > problem is that no matter what the settings in the .rule file, I =20 > can't seem to get udev to create an entry in the /dev filesystem for it. >=20 > Some info about our system: > CentOS 4.4 > udev RPM: udev-039-10.15.EL4 >=20 > for the sysfs info, I'm using the following directory (which =20 > corresponds to the PCI card itself): /sys/bus/pci/drivers/xcrypto/=20 > 0000:04:04.0 >=20 > the contents of that directory are: > --> > class config detach_state device irq power resource =20 > subsystem_device subsystem_vendor vendor > <-- >=20 > the /etc/rules.d/xcrypto.rules file contains (currently): > BUS=3D"pci", SYSFS{device}=3D"0x01e4", NAME=3D"xcrypto0" >=20 > previously an 'mknod' call was made, the major numbers figured/parsed =20 > out from /proc/devices, and everything worked fine - however right =20 > now I'd like to start using the proper way to do all of this stuff. >=20 > Upon running 'udev' with all of the proper environment variables set, =20 > nothing happens. I've tweaked the .rules file over and over again to =20 > no avail. >=20 > I'm also curious how udev manages to guess the major/minor numbers =20 > for this device - does it correlate the SYSFS{device} variable to =20 > the /proc/devices somehow? Or am I missing something fundamental? Yes, you need to create a "dev" file by using a struct class, and either a struct class_device or struct device. For newer kernel versions, use struct device with a call to device_create() and on older versions, use class_device_create(). There is a section in the book, Linux Device Drivers, third edition, that covers the basics for what is needed to get udev to work properly. But note that the api calls it uses there are no longer present in the kernel tree, use class_device_create() instead. hope this helps, greg k-h ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=DEVD= EV _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel