From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg KH Date: Wed, 30 Aug 2006 17:51:06 +0000 Subject: Re: issues getting I/O device to work with udev.... Message-Id: <20060830175106.GA5366@kroah.com> List-Id: References: <20060823222620.GA1164@seberino.org> In-Reply-To: <20060823222620.GA1164@seberino.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On Wed, Aug 30, 2006 at 03:52:39PM +0200, Jan Zwiegers wrote: > > -----Original Message----- > > From: linux-hotplug-devel-bounces@lists.sourceforge.net [mailto:linux- > > hotplug-devel-bounces@lists.sourceforge.net] On Behalf Of Kay Sievers > > Sent: 27 August 2006 02:18 AM > > To: jan@eagle.co.za > > Cc: 'John Thomas'; linux-hotplug-devel@lists.sourceforge.net; 'Ray > > Schumacher'; md@Linux.IT > > Subject: RE: issues getting I/O device to work with udev.... > > > > On Fri, 2006-08-25 at 21:22 +0200, Jan Zwiegers wrote: > > > > > > Oh, that all sounds very much like you don't use the right driver > > core > > > > > > functions and you create the "dev" file yourself in sysfs. You > > must use > > > > > > the right functions in the kernel and pass the correct dev_t to > > the > > > > > > device registration. That will automatically create the "dev" file > > and > > > > > > add the needed data to the uevent environment, to let udev create > > the > > > > > > node. > > > > > > > > > > > > But again, to verify this, we need the output of "udevmonitor -- > > env", > > > > > > while you plug in a device or re-trigger the event by writing > > "add" to > > > > > > the "uevent" file in the sysfs device directory. > > > > > > > > > > > > > > > I just create a simple device class by making use of: > > > > > > > > > > 'class_device_register' & > > > > > 'class_device_createfile' > > > > > to create /sys/class/edredaq/device0 & > > > > > /sys/class/edredaq/device0/edredaq_nodename > > > > > > > > See how class_device_create() works and fills in dev_t, you need to > > > > convert to that function or do the same with the dev_t value. You also > > > > need to set the 'device' pointer like that function does, to make > > > > userspace happy. > > > > > Do you say that I need to look at how I implemented the > > > class_device_create_file? Mine seems the same as others. Do you think > > this > > > is the cause of my problem? > > > > I'm just guessing, but I expect you create the file with the name "dev" > > which contains the major/minor number yourself in your driver. If that's > > the case, you shouldn't do that and just set the dev_t value in the > > device structure before registering the device, that will instruct the > > driver core to create that file, along with environment variables needed > > for udev to create a node. > > > > The best way to do this, would probably be to use the > > class_device_create() function in /linux/drivers/base/class.c, which > > expects all the needed values as parameters. > [Jan Zwiegers] > Hi Kay & Greg > > Sorry for taking so long to get back to you. > > The source code is downloadable at > http://www.eagle.co.za/download/download/edre_linux_drivers_2_0_8.tar.gz > > If you can maybe have a quick look at the class driver. The code is very > short, so you should be able to quickly understand what is wrong. Just like Kay guessed, you are not using the proper function call. Please use the class_device_create() call instead of rolling your own. That will fix your problem. And why aren't these drivers in the main kernel tree? That would make this a whole lot easier, and save you a lot of time on maintenance. As it is, I get a whole lot of warnings and errors when trying to build this code against the latest kernel version :( If you want, I can help you out in getting this into the kernel tree. Overall the code looks pretty sane, only a few small cleanups would be needed (becides the warning fixes...) thanks, greg k-h ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642 _______________________________________________ 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