From: Martin Burnicki <martin.burnicki@meinberg.de>
To: linux-hotplug@vger.kernel.org
Subject: Need help to get udev/hotplug working for extra module in early 2.6
Date: Tue, 08 Jul 2008 14:24:29 +0000 [thread overview]
Message-ID: <4873789D.2080609@meinberg.de> (raw)
Hi all,
I'm maintaining a driver for Meinberg PCI cards (radio clocks, GPS
receivers, IRIG receivers), see "Standalone Computer Synchronisation":
http://www.meinberg.de/english/products/formfactor.htm#slot_card
The driver lets the ntpd daemon be able to use those PCI cards as
plugged-in reference time sources for accurate timing.
The driver package contains an extra module which is built outside the
kernel tree. The currently released version of the driver can be built
and used with kernels 2.2.x, 2.4.x, and 2.6.x.
However, that version of the driver implements a "misc" device in a way
which doesn't support 2.6's udev very well.
I've now improved the code of the kernel module (currently for 2.6.x
only) and the new module works fine under recent 2.6.x kernels, e.g.
2.6.11 (SuSE 9.1 on i386), 2.6.22 (Ubuntu on Sparc64), or 2.6.25
(openSUSE 11 on AMD x86_64).
The new driver implements a new class of character device, mbgclock,
which uses a dynamic major number. Additionally the driver supports our
new USB devices in a way they can be accessed by applications using the
same API calls as with PCI cards.
Under the newer 2.6.x kernels, if a PCI card is installed or when a new
USB radio clock is plugged in my kernel module is loaded automatically,
and the device nodes are created or deleted by udev as required, so
everything works fine.
Now I'd like to get some help to get it working on older 2.6.x kernels.
E.g. I have a SuSE 9.1 system with 2.6.4 kernel. After booting, my
kernel module is not loaded automatically even though a PCI card is
installed. If I load the module using modprobe then the PCI card is
recognized and works just fine.
If I plug in a USB device, or the USB device is already plugged in at
boot time, then the module is loaded automatically.
However, device nodes are never created automatically on that 2.6.4
system, so I have to create them the old way using mknod. So they are
even persistent over reboots, as they have been with older kernels.
Unfortunately, since the driver now uses a dynamic major number I would
normally have to load the module first, then look in /proc/devices which
major number has been assigned to my device class, and finally create
the device nodes using that major number.
So the best way to get it working would be as with recent kernels.
I'm assuming the udev actions are triggered by class_simple_device_add()
(before 2.6.13) or class_device_create() (2.6.13 and newer). Is it
possible that I have to call some extra function in 2.6.4 to trigger a
udev or hotplug event in 2.6.4 so a device node gets created?
Unlike with newer systems where udev is configured using multiple rules
files in /etc/udev/rules.d the 2.6.4 system has only a single rules
file, namely /etc/udev/udev.rules.
Is there someone who is familiar with the history of udev/hotplug who
can point me in the right direction?
Thanks,
Martin
--
Martin Burnicki
Meinberg Funkuhren
Bad Pyrmont
Germany
next reply other threads:[~2008-07-08 14:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-08 14:24 Martin Burnicki [this message]
2008-07-15 10:21 ` Need help to get udev/hotplug working for extra module in early Martin Burnicki
2008-07-17 7:13 ` Need help to get udev/hotplug working for extra module in Greg KH
2008-07-17 8:38 ` Need help to get udev/hotplug working for extra module inearly Greg KH
2008-07-17 13:12 ` Need help to get udev/hotplug working for extra module Greg KH
2008-07-17 13:58 ` AW: Need help to get udev/hotplug working for extra module inearly2.6 Martin Burnicki
2008-07-17 14:27 ` Martin Burnicki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4873789D.2080609@meinberg.de \
--to=martin.burnicki@meinberg.de \
--cc=linux-hotplug@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).