linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* udev problems with crypto hardware
@ 2007-01-25 19:29 Lev Lvovsky
  2007-01-25 20:38 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Lev Lvovsky @ 2007-01-25 19:29 UTC (permalink / raw)
  To: linux-hotplug

I'm running into some problems using udev in conjunction with a  
hardware crypto device.  The board provides a kernel module which  
loads as "xcrypto".  The /sys filesystem registers the PCI board and  
provides some identification that we can use for the rules file.  The  
problem is that no matter what the settings in the .rule file, I  
can't seem to get udev to create an entry in the /dev filesystem for it.

Some info about our system:
CentOS 4.4
udev RPM: udev-039-10.15.EL4

for the sysfs info, I'm using the following directory (which  
corresponds to the PCI card itself): /sys/bus/pci/drivers/xcrypto/ 
0000:04:04.0

the contents of that directory are:
-->
class  config  detach_state  device  irq  power  resource   
subsystem_device  subsystem_vendor  vendor
<--

the /etc/rules.d/xcrypto.rules file contains (currently):
BUS="pci", SYSFS{device}="0x01e4", NAME="xcrypto0"

previously an 'mknod' call was made, the major numbers figured/parsed  
out from /proc/devices, and everything worked fine - however right  
now I'd like to start using the proper way to do all of this stuff.

Upon running 'udev' with all of the proper environment variables set,  
nothing happens.  I've tweaked the .rules file over and over again to  
no avail.

I'm also curious how udev manages to guess the major/minor numbers  
for this device - does it correlate the SYSFS{device} variable to  
the /proc/devices somehow?  Or am I missing something fundamental?

thanks for any advice on this issue!
-lev

-------------------------------------------------------------------------
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=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: udev problems with crypto hardware
  2007-01-25 19:29 udev problems with crypto hardware Lev Lvovsky
@ 2007-01-25 20:38 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2007-01-25 20:38 UTC (permalink / raw)
  To: linux-hotplug

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  
> hardware crypto device.  The board provides a kernel module which  
> loads as "xcrypto".  The /sys filesystem registers the PCI board and  
> provides some identification that we can use for the rules file.  The  
> problem is that no matter what the settings in the .rule file, I  
> can't seem to get udev to create an entry in the /dev filesystem for it.
> 
> Some info about our system:
> CentOS 4.4
> udev RPM: udev-039-10.15.EL4
> 
> for the sysfs info, I'm using the following directory (which  
> corresponds to the PCI card itself): /sys/bus/pci/drivers/xcrypto/ 
> 0000:04:04.0
> 
> the contents of that directory are:
> -->
> class  config  detach_state  device  irq  power  resource   
> subsystem_device  subsystem_vendor  vendor
> <--
> 
> the /etc/rules.d/xcrypto.rules file contains (currently):
> BUS="pci", SYSFS{device}="0x01e4", NAME="xcrypto0"
> 
> previously an 'mknod' call was made, the major numbers figured/parsed  
> out from /proc/devices, and everything worked fine - however right  
> now I'd like to start using the proper way to do all of this stuff.
> 
> Upon running 'udev' with all of the proper environment variables set,  
> nothing happens.  I've tweaked the .rules file over and over again to  
> no avail.
> 
> I'm also curious how udev manages to guess the major/minor numbers  
> for this device - does it correlate the SYSFS{device} variable to  
> 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=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-01-25 20:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-25 19:29 udev problems with crypto hardware Lev Lvovsky
2007-01-25 20:38 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).