diff options
author | Linas Vepstas <linas@austin.ibm.com> | 2006-02-03 06:03:38 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-02-03 11:31:59 -0500 |
commit | ab11f89929b785daaa428801bd8b7e65241d7913 (patch) | |
tree | 490adc87a0dafd1085ce872818e19285c09c576a /Documentation/driver-model/overview.txt | |
parent | 1989e20cc1e7491232795f9dac9b745e4329dfd8 (diff) |
[PATCH] Clean up Documentation/driver-model/overview.txt
Edits to the driver-model documentation for grammar, clarity and content.
These docs haven't been updated in years, and some of the technical content
and discussion has become stale; this patch updates these. In addition,
some of the language is awkward. Fix this.
(I'm trying to cleanup the other files in this directory also,
patches for these will come a bit later).
Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Acked-by: Patrick Mochel <mochel@digitalimplant.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'Documentation/driver-model/overview.txt')
-rw-r--r-- | Documentation/driver-model/overview.txt | 57 |
1 files changed, 25 insertions, 32 deletions
diff --git a/Documentation/driver-model/overview.txt b/Documentation/driver-model/overview.txt index 44662735cf81..ac4a7a737e43 100644 --- a/Documentation/driver-model/overview.txt +++ b/Documentation/driver-model/overview.txt | |||
@@ -1,50 +1,43 @@ | |||
1 | The Linux Kernel Device Model | 1 | The Linux Kernel Device Model |
2 | 2 | ||
3 | Patrick Mochel <mochel@osdl.org> | 3 | Patrick Mochel <mochel@digitalimplant.org> |
4 | 4 | ||
5 | 26 August 2002 | 5 | Drafted 26 August 2002 |
6 | Updated 31 January 2006 | ||
6 | 7 | ||
7 | 8 | ||
8 | Overview | 9 | Overview |
9 | ~~~~~~~~ | 10 | ~~~~~~~~ |
10 | 11 | ||
11 | This driver model is a unification of all the current, disparate driver models | 12 | The Linux Kernel Driver Model is a unification of all the disparate driver |
12 | that are currently in the kernel. It is intended to augment the | 13 | models that were previously used in the kernel. It is intended to augment the |
13 | bus-specific drivers for bridges and devices by consolidating a set of data | 14 | bus-specific drivers for bridges and devices by consolidating a set of data |
14 | and operations into globally accessible data structures. | 15 | and operations into globally accessible data structures. |
15 | 16 | ||
16 | Current driver models implement some sort of tree-like structure (sometimes | 17 | Traditional driver models implemented some sort of tree-like structure |
17 | just a list) for the devices they control. But, there is no linkage between | 18 | (sometimes just a list) for the devices they control. There wasn't any |
18 | the different bus types. | 19 | uniformity across the different bus types. |
19 | 20 | ||
20 | A common data structure can provide this linkage with little overhead: when a | 21 | The current driver model provides a comon, uniform data model for describing |
21 | bus driver discovers a particular device, it can insert it into the global | 22 | a bus and the devices that can appear under the bus. The unified bus |
22 | tree as well as its local tree. In fact, the local tree becomes just a subset | 23 | model includes a set of common attributes which all busses carry, and a set |
23 | of the global tree. | 24 | of common callbacks, such as device discovery during bus probing, bus |
24 | 25 | shutdown, bus power management, etc. | |
25 | Common data fields can also be moved out of the local bus models into the | ||
26 | global model. Some of the manipulations of these fields can also be | ||
27 | consolidated. Most likely, manipulation functions will become a set | ||
28 | of helper functions, which the bus drivers wrap around to include any | ||
29 | bus-specific items. | ||
30 | |||
31 | The common device and bridge interface currently reflects the goals of the | ||
32 | modern PC: namely the ability to do seamless Plug and Play, power management, | ||
33 | and hot plug. (The model dictated by Intel and Microsoft (read: ACPI) ensures | ||
34 | us that any device in the system may fit any of these criteria.) | ||
35 | |||
36 | In reality, not every bus will be able to support such operations. But, most | ||
37 | buses will support a majority of those operations, and all future buses will. | ||
38 | In other words, a bus that doesn't support an operation is the exception, | ||
39 | instead of the other way around. | ||
40 | 26 | ||
27 | The common device and bridge interface reflects the goals of the modern | ||
28 | computer: namely the ability to do seamless device "plug and play", power | ||
29 | management, and hot plug. In particular, the model dictated by Intel and | ||
30 | Microsoft (namely ACPI) ensures that almost every device on almost any bus | ||
31 | on an x86-compatible system can work within this paradigm. Of course, | ||
32 | not every bus is able to support all such operations, although most | ||
33 | buses support a most of those operations. | ||
41 | 34 | ||
42 | 35 | ||
43 | Downstream Access | 36 | Downstream Access |
44 | ~~~~~~~~~~~~~~~~~ | 37 | ~~~~~~~~~~~~~~~~~ |
45 | 38 | ||
46 | Common data fields have been moved out of individual bus layers into a common | 39 | Common data fields have been moved out of individual bus layers into a common |
47 | data structure. But, these fields must still be accessed by the bus layers, | 40 | data structure. These fields must still be accessed by the bus layers, |
48 | and sometimes by the device-specific drivers. | 41 | and sometimes by the device-specific drivers. |
49 | 42 | ||
50 | Other bus layers are encouraged to do what has been done for the PCI layer. | 43 | Other bus layers are encouraged to do what has been done for the PCI layer. |
@@ -53,7 +46,7 @@ struct pci_dev now looks like this: | |||
53 | struct pci_dev { | 46 | struct pci_dev { |
54 | ... | 47 | ... |
55 | 48 | ||
56 | struct device device; | 49 | struct device dev; |
57 | }; | 50 | }; |
58 | 51 | ||
59 | Note first that it is statically allocated. This means only one allocation on | 52 | Note first that it is statically allocated. This means only one allocation on |
@@ -64,9 +57,9 @@ the two. | |||
64 | 57 | ||
65 | The PCI bus layer freely accesses the fields of struct device. It knows about | 58 | The PCI bus layer freely accesses the fields of struct device. It knows about |
66 | the structure of struct pci_dev, and it should know the structure of struct | 59 | the structure of struct pci_dev, and it should know the structure of struct |
67 | device. PCI devices that have been converted generally do not touch the fields | 60 | device. Individual PCI device drivers that have been converted the the current |
68 | of struct device. More precisely, device-specific drivers should not touch | 61 | driver model generally do not and should not touch the fields of struct device, |
69 | fields of struct device unless there is a strong compelling reason to do so. | 62 | unless there is a strong compelling reason to do so. |
70 | 63 | ||
71 | This abstraction is prevention of unnecessary pain during transitional phases. | 64 | This abstraction is prevention of unnecessary pain during transitional phases. |
72 | If the name of the field changes or is removed, then every downstream driver | 65 | If the name of the field changes or is removed, then every downstream driver |