There is also another behavior, which is used by usb-storage.

Drivers for SCSI host adaptor cards generally allow their usage count to
be managed by the SCSI layer.  This allows high-level information (i.e.
what devices are actually in use) to affect the usage count for a driver
which doesn't really have an 'open' semantic.

Matt Dharm

On Wed, 5 Apr 2000, Donald Becker wrote:

> On Wed, 5 Apr 2000, Alessandro Rubini wrote:
> 
> > I'm currently studying the USB kernel subsystem using modules, and I
> > noticed how the usage count of specific device never raises above
> > zero.  Should that be construed as a feature?
> >
> > I'd personally prefer to have the driver marked as busy when there is
> > a device using it. For example, a devault crontab in Debian removes
> ..
> > The best option would be to increment the count when the device is
> > actually being read, but the current layout of the USB and input
> > subsystems make it impractical to do so, and I wouldn't like such
> > feature to be implemented as things are clean enough as they are now.
> 
> My USB modules have varying semantics:
> 
>    Network drivers only have a non-zero usage count when they are up.  They
>    shut down the interface automatically on hardware disconnect.
> 
>    Character/block drivers only have a non-zero usage count when they are
>    open.  Removing the device does not (can not) automatically close, so the
>    module is not removed until the last opener finishes.
> 
>    Mouse and keyboard device drivers have a non-zero usage count whenever
>    they are plugged in.  Any explicit mouse open further increments the usage
>    count.  Keyboards just inject events, and thus they never know if anyone
>    is listening.
> 
> I believe this is close to the semantics of most of the pre-2.4 drivers, but
> I'm not certain that it's consistent or documented.
> 
> Donald Becker
> Scyld Computing Corporation, [EMAIL PROTECTED]
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

-- 
Matthew Dharm                              Home: [EMAIL PROTECTED] 
Engineer, Qualcomm, Inc.                         Work: [EMAIL PROTECTED]

You are needink to look more evil.  You likink very strong coffee?
                                        -- Pitr to Dust Puppy
User Friendly, 10/16/1998


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to