Re: UDEV.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Aug 24, 2010 at 01:27:15PM +0400, Тима wrote:
> > 
> > A: No.
> > Q: Should I include quotations after my reply?
> > 
> > http://daringfireball.net/2007/07/on_top
> > 
> > On Thu, Aug 19, 2010 at 07:07:40PM +0400, ???? wrote:
> > > Thanks. 
> > > My question (I think) is very easy. But I could not find answer in the Internet, and did not get it on forum.
> > > My aim is to make UDEV create device node automatically on loading module.
> > > I tied rule:
> > > KERNEL=="math", NAME="math"
> > > meaning my device name (register char dev) is "math" and the node name I want is "math".
> > > But nothing happens.
> > > Is there any possibility to make such rule?
> > > Maybe I do not export some required information to SysFS?
> > > If you need module code I can send it to you with Makefile.
> > 
> > Yes, please post your kernel code.  You need to hook into the driver
> > model to properly be able to have udev pick up your device information.
> > Have you done that?
> > 
> > thanks,
> > 
> > greg k-h
> 
> Yes, here is my code.
> (Sorry for comments in russian. If you need something to understand -
> ask me and I'll translate it.) I want kernel to make, for example,
> /dev/math on loading this module. What should I add to this code or to
> UDEV rules?

You need to tie into a class somehow.

The easiest way to do this is to make your driver a 'misc' device and
call misc_register() to get a minor number and register your
file_operations structure.  That infrastructure will then set up
everything properly so that udev will automatically create your device
node.

If you don't want to do that, then you need to create your own 'struct
class' and register a device with it after you register your chardev.
See the kernel for lots of examples of how to do this.

Hope this helps,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Linux DVB]     [Asterisk Internet PBX]     [DCCP]     [Netdev]     [X.org]     [Util Linux NG]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux