Re: Problems while adding sysfs support to older device driver

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

 



Hi,

thanks for your answer.

On Thursday 10 December 2009 06:13:45 Greg KH wrote:
> On Mon, Dec 07, 2009 at 10:54:36AM +0100, Bjoern Hinrichs wrote:
[...]
> > Now I want device files to be automatically generated, but it seems as if
> > I'm missing someting here. udevadm tells me I'm getting the following
> > uevents:
> >
> > ---
> > KERNEL[1259568653.205951] add      /module/titan (module)
> > UDEV_LOG=3
> > ACTION=add
> > DEVPATH=/module/titan
> > SUBSYSTEM=module
> > SEQNUM=682
> >
> > KERNEL[1259568653.206472] add      /bus/pci/drivers/titan (drivers)
> > UDEV_LOG=3
> > ACTION=add
> > DEVPATH=/bus/pci/drivers/titan
> > SUBSYSTEM=drivers
> > SEQNUM=683
> >
> > UDEV  [1259568653.215901] add      /module/titan (module)
> > UDEV_LOG=3
> > ACTION=add
> > DEVPATH=/module/titan
> > SUBSYSTEM=module
> > SEQNUM=682
> >
> > UDEV  [1259568653.236102] add      /bus/pci/drivers/titan (drivers)
> > UDEV_LOG=3
> > ACTION=add
> > DEVPATH=/bus/pci/drivers/titan
> > SUBSYSTEM=drivers
> > SEQNUM=683
> >
> >
> > KERNEL[1259568653.205951] add      /module/titan (module)
> > UDEV_LOG=3
> > ACTION=add
> > DEVPATH=/module/titan
> > SUBSYSTEM=module
> > SEQNUM=682
> > ---
> >
> > This looks to me as if I'm missing some uevents here. I guess there's
> > something I should be doing in .probe, but I'm neither sure whether
> > that's correct nor what it is.
> > (Of course I can still add device files using mknod, but that'd be kinda
> > .. boring.)
> >
> > Someone willing to give me a hint?
> 
> That all looks correct, what specifically is wrong here?  You don't get
> a uevent for adding a sysfs file, only when you add a struct device (or
> kobject) to sysfs.

Reading my mail again I see that I was unclear about what I was trying to do, 
sorry.

I want a device node (e.g. /dev/titan) to be generated automatically for my 
device. I was expecting udev to do so using a default name, but it is not.
Because of that I started comparing uevents with other drivers and saw that 
they are seeing additional uevents, therefore I thought that that my mistake 
was there.

(As you can see I'm doing some guesswork here. This is the first time I'm doing 
anything at kernel level at all.)

Now, my question should have been:
What do I have to do in my driver in order for udev to generate a device node 
under /dev using a default name?

> What type of sysfs file are you adding to your driver?  What do you want
> to export to userspace?  You do know the rules about sysfs files, right?

Yes, I know the rules and that part works, especially thanks to your kobject-
example.c. (Right now I'm only exporting some statistics from the driver to 
userspace.)

Again, thank you for your time,
Björn
> thanks,
> 
> greg k-h
> 

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux