Porting a device drive to use device id
linux at dominikbrodowski.net
Wed Apr 20 09:06:15 EDT 2005
On Thu, Apr 14, 2005 at 03:23:51PM -0400, Alex Holeczy wrote:
> On Thu, 14 Apr 2005, David Hinds wrote:
> >On Thu, Apr 14, 2005 at 01:18:45PM -0400, Alex Holeczy wrote:
> >>When I load the updated device driver with the PCMCIA card inserted, the
> >>device driver gets loaded correctly and I can access the card. But if I
> >>insert the card after I have loaded the device driver, I get the following
> >>error message from cardmgr.
> >>cardmgr: error in file './cacdsp.conf' line 18: module name
> >>'bullet33_cs' not found
> >Actually, no, you don't. You get this error message when cardmgr
> >reads your conf file, regardless of when you insert your card...
> >>The following is my configuration file:
> >>module "bullet33_cs" opts "xx=1"
> >What do you intend this line to do?
> I found the syntax for this line in pcmciautils-002/config/config.opts.
Please put module options into modprobe.conf isntead. I'll fix config.opts
in pcmciautils for the next release to not mislead you into this direction.
> When a PCMCIA card gets inserted into the system, 'cardmgr' would scan the
> *.conf files in the /etc/pcmcia directory informing the kernel of possible
> loadable modules which handle PCMCIA cards. Since the kernel knows which
> drivers manage which devices, the kernel would load the appropriate module
> to handle the inserted PCMCIA card.
> If I need to tell 'cardmgr' which driver to load like I did under the
> kernel 2.4, then I am missing the purpose of telling the kernel through
> the .id_table element what PCMCIA cards the module handle.
> Could you explain the sequence of events that happen when a PCMCIA card
> gets inserted into the system?
I'll exclude the previous behaviour:
- device is discovered
- device information is determined, a hotplug call is generated
- a hotplug script uses the device information and "modprobe" to load the
appropriate module. Which module is appropriate is determined by comparing
the information stored in id_table and passed using the hotplug script.
- the kernel matches the device driver and the device information to check
whether this is indeed the correct device driver.
This means that you don't need cardmgr for these purposes. However, you do
need a patched libsysfs and a patched modprobe. Check the archives for
More information about the linux-pcmcia