public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* driverfs: [PATCH] remove bus and improve driver management (2.5.30)
@ 2002-08-14 22:16 Adam Belay
  2002-08-15  5:04 ` Greg KH
  0 siblings, 1 reply; 9+ messages in thread
From: Adam Belay @ 2002-08-14 22:16 UTC (permalink / raw)
  To: Patrick Mochel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2792 bytes --]

    This patch removes bus.c from the Driver Model and replaces it with 
a more advanced and scaleable driver subsystem.  

The following diagram illustrates the current Driver Model 
implementation for drivers:
 bus->    pci->    parport_pc
                           agpgart
                           cardbus
              usb->    
                           hid

    Lets say that the usb bus is connected to pci0.  Notice how the usb 
driver has no linkage to the pci driver.  It should in order to take 
full advatage of the power management and other features of the driver 
model.  Of course the usb bus could create another driver and register 
it to pci but that would be wasteful and overly complicated.  Also 
notice that parport_pc could have a printer attached to it.  The lp 
driver would control this device but there is no way to represent the lp 
driver in the current model since only buses can have child drivers.

The following diagram illustrates the driver implementation after this 
patch: (this assumes that the listed driver have been converted to the 
Driver Model)
driver->    pci->    usb->                hid
                              parport_pc->    lp
                              agpgart
                              cardbus

    Notice that this implementation not only solves the problems listed 
earlier but also it is more scalable because it lists the drivers by 
thier true relationship to one another.  These changes actually reduce 
the total amount of code as well as the complexity of the entire system 
resulting in better efficiency and perhaps even less memory consumption.

    `This patch also provides user level driver management support 
through the advanced features of the new interface.  It creates a file 
entry named "driver" for each device.
To attach a driver simply echo the name of the driver you want to 
attach.  For example:
#cd ./root/pci0/00:00.0
#echo "agpgart" > driver

To remove a driver simply echo remove to the driver file while a driver 
is loaded.  For example:
#echo "remove" > driver

If you read the driver file you will get the name of the loaded driver 
if a driver is loaded.  For example:
#cat driver
output: agpgart

This patch is against 2.5.30.  The following still needs to be done:
1.) port to 2.5.31
2.) update bus drivers, currently only pci has been ported and tested, 
use the other buses at your own risk
3.) explore the possibility of linking the driver and root trees.  I 
have included an unused and untested function that will provide at least 
a framework for this.  See the code and comments in fs.c.  The function 
is called "device_driver_link".

Sincerely,

Adam Belay

*because the patch is so large I have gzipped it and attached it.  It is 
available in other formats upon request.

[-- Attachment #2: a.patch.gz --]
[-- Type: application/octet-stream, Size: 7302 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2002-08-16  1:01 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-08-14 22:16 driverfs: [PATCH] remove bus and improve driver management (2.5.30) Adam Belay
2002-08-15  5:04 ` Greg KH
2002-08-15 10:57   ` Adam Belay
     [not found]   ` <3D5B885E.5000407@netscape.net>
2002-08-15 16:23     ` Greg KH
2002-08-15 16:48       ` Patrick Mochel
2002-08-15 20:53       ` driverfs: driver interface Adam Belay
2002-08-16  1:00         ` Greg KH
2002-08-15 16:44     ` driverfs: [PATCH] remove bus and improve driver management (2.5.30) Patrick Mochel
2002-08-15 15:35       ` Adam Belay

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox