Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

eisa.txt: standardize document format

Each text file under Documentation follows a different
format. Some doesn't even have titles!

Change its representation to follow the adopted standard,
using ReST markups for it to be parseable by Sphinx:

- use ReST notation for titles;
- identify literal blocks;
- use :Author: for document authorship;
- use the proper notation for tables;
- adjust whitespaces where needed.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>

authored by

Mauro Carvalho Chehab and committed by
Jonathan Corbet
72fd15c0 ef16bcc7

+137 -110
+137 -110
Documentation/eisa.txt
··· 1 - EISA bus support (Marc Zyngier <maz@wild-wind.fr.eu.org>) 1 + ================ 2 + EISA bus support 3 + ================ 4 + 5 + :Author: Marc Zyngier <maz@wild-wind.fr.eu.org> 2 6 3 7 This document groups random notes about porting EISA drivers to the 4 8 new EISA/sysfs API. ··· 18 14 most EISA drivers are among the oldest Linux drivers so, as you can 19 15 imagine, some dust has settled here over the years. 20 16 21 - The EISA infrastructure is made up of three parts : 17 + The EISA infrastructure is made up of three parts: 22 18 23 19 - The bus code implements most of the generic code. It is shared 24 - among all the architectures that the EISA code runs on. It 25 - implements bus probing (detecting EISA cards available on the bus), 26 - allocates I/O resources, allows fancy naming through sysfs, and 27 - offers interfaces for driver to register. 20 + among all the architectures that the EISA code runs on. It 21 + implements bus probing (detecting EISA cards available on the bus), 22 + allocates I/O resources, allows fancy naming through sysfs, and 23 + offers interfaces for driver to register. 28 24 29 25 - The bus root driver implements the glue between the bus hardware 30 - and the generic bus code. It is responsible for discovering the 31 - device implementing the bus, and setting it up to be latter probed 32 - by the bus code. This can go from something as simple as reserving 33 - an I/O region on x86, to the rather more complex, like the hppa 34 - EISA code. This is the part to implement in order to have EISA 35 - running on an "new" platform. 26 + and the generic bus code. It is responsible for discovering the 27 + device implementing the bus, and setting it up to be latter probed 28 + by the bus code. This can go from something as simple as reserving 29 + an I/O region on x86, to the rather more complex, like the hppa 30 + EISA code. This is the part to implement in order to have EISA 31 + running on an "new" platform. 36 32 37 33 - The driver offers the bus a list of devices that it manages, and 38 - implements the necessary callbacks to probe and release devices 39 - whenever told to. 34 + implements the necessary callbacks to probe and release devices 35 + whenever told to. 40 36 41 37 Every function/structure below lives in <linux/eisa.h>, which depends 42 38 heavily on <linux/device.h>. 43 39 44 - ** Bus root driver : 40 + Bus root driver 41 + =============== 45 42 46 - int eisa_root_register (struct eisa_root_device *root); 43 + :: 44 + 45 + int eisa_root_register (struct eisa_root_device *root); 47 46 48 47 The eisa_root_register function is used to declare a device as the 49 48 root of an EISA bus. The eisa_root_device structure holds a reference 50 - to this device, as well as some parameters for probing purposes. 49 + to this device, as well as some parameters for probing purposes:: 51 50 52 - struct eisa_root_device { 53 - struct device *dev; /* Pointer to bridge device */ 54 - struct resource *res; 55 - unsigned long bus_base_addr; 56 - int slots; /* Max slot number */ 57 - int force_probe; /* Probe even when no slot 0 */ 58 - u64 dma_mask; /* from bridge device */ 59 - int bus_nr; /* Set by eisa_root_register */ 60 - struct resource eisa_root_res; /* ditto */ 61 - }; 51 + struct eisa_root_device { 52 + struct device *dev; /* Pointer to bridge device */ 53 + struct resource *res; 54 + unsigned long bus_base_addr; 55 + int slots; /* Max slot number */ 56 + int force_probe; /* Probe even when no slot 0 */ 57 + u64 dma_mask; /* from bridge device */ 58 + int bus_nr; /* Set by eisa_root_register */ 59 + struct resource eisa_root_res; /* ditto */ 60 + }; 62 61 63 - node : used for eisa_root_register internal purpose 64 - dev : pointer to the root device 65 - res : root device I/O resource 66 - bus_base_addr : slot 0 address on this bus 67 - slots : max slot number to probe 68 - force_probe : Probe even when slot 0 is empty (no EISA mainboard) 69 - dma_mask : Default DMA mask. Usually the bridge device dma_mask. 70 - bus_nr : unique bus id, set by eisa_root_register 62 + ============= ====================================================== 63 + node used for eisa_root_register internal purpose 64 + dev pointer to the root device 65 + res root device I/O resource 66 + bus_base_addr slot 0 address on this bus 67 + slots max slot number to probe 68 + force_probe Probe even when slot 0 is empty (no EISA mainboard) 69 + dma_mask Default DMA mask. Usually the bridge device dma_mask. 70 + bus_nr unique bus id, set by eisa_root_register 71 + ============= ====================================================== 71 72 72 - ** Driver : 73 + Driver 74 + ====== 73 75 74 - int eisa_driver_register (struct eisa_driver *edrv); 75 - void eisa_driver_unregister (struct eisa_driver *edrv); 76 + :: 77 + 78 + int eisa_driver_register (struct eisa_driver *edrv); 79 + void eisa_driver_unregister (struct eisa_driver *edrv); 76 80 77 81 Clear enough ? 78 82 79 - struct eisa_device_id { 80 - char sig[EISA_SIG_LEN]; 81 - unsigned long driver_data; 82 - }; 83 + :: 83 84 84 - struct eisa_driver { 85 - const struct eisa_device_id *id_table; 86 - struct device_driver driver; 87 - }; 85 + struct eisa_device_id { 86 + char sig[EISA_SIG_LEN]; 87 + unsigned long driver_data; 88 + }; 88 89 89 - id_table : an array of NULL terminated EISA id strings, 90 - followed by an empty string. Each string can 91 - optionally be paired with a driver-dependent value 92 - (driver_data). 90 + struct eisa_driver { 91 + const struct eisa_device_id *id_table; 92 + struct device_driver driver; 93 + }; 93 94 94 - driver : a generic driver, such as described in 95 - Documentation/driver-model/driver.txt. Only .name, 96 - .probe and .remove members are mandatory. 95 + =============== ==================================================== 96 + id_table an array of NULL terminated EISA id strings, 97 + followed by an empty string. Each string can 98 + optionally be paired with a driver-dependent value 99 + (driver_data). 97 100 98 - An example is the 3c59x driver : 101 + driver a generic driver, such as described in 102 + Documentation/driver-model/driver.txt. Only .name, 103 + .probe and .remove members are mandatory. 104 + =============== ==================================================== 99 105 100 - static struct eisa_device_id vortex_eisa_ids[] = { 101 - { "TCM5920", EISA_3C592_OFFSET }, 102 - { "TCM5970", EISA_3C597_OFFSET }, 103 - { "" } 104 - }; 106 + An example is the 3c59x driver:: 105 107 106 - static struct eisa_driver vortex_eisa_driver = { 107 - .id_table = vortex_eisa_ids, 108 - .driver = { 109 - .name = "3c59x", 110 - .probe = vortex_eisa_probe, 111 - .remove = vortex_eisa_remove 112 - } 113 - }; 108 + static struct eisa_device_id vortex_eisa_ids[] = { 109 + { "TCM5920", EISA_3C592_OFFSET }, 110 + { "TCM5970", EISA_3C597_OFFSET }, 111 + { "" } 112 + }; 114 113 115 - ** Device : 114 + static struct eisa_driver vortex_eisa_driver = { 115 + .id_table = vortex_eisa_ids, 116 + .driver = { 117 + .name = "3c59x", 118 + .probe = vortex_eisa_probe, 119 + .remove = vortex_eisa_remove 120 + } 121 + }; 122 + 123 + Device 124 + ====== 116 125 117 126 The sysfs framework calls .probe and .remove functions upon device 118 127 discovery and removal (note that the .remove function is only called 119 128 when driver is built as a module). 120 129 121 130 Both functions are passed a pointer to a 'struct device', which is 122 - encapsulated in a 'struct eisa_device' described as follows : 131 + encapsulated in a 'struct eisa_device' described as follows:: 123 132 124 - struct eisa_device { 125 - struct eisa_device_id id; 126 - int slot; 127 - int state; 128 - unsigned long base_addr; 129 - struct resource res[EISA_MAX_RESOURCES]; 130 - u64 dma_mask; 131 - struct device dev; /* generic device */ 132 - }; 133 + struct eisa_device { 134 + struct eisa_device_id id; 135 + int slot; 136 + int state; 137 + unsigned long base_addr; 138 + struct resource res[EISA_MAX_RESOURCES]; 139 + u64 dma_mask; 140 + struct device dev; /* generic device */ 141 + }; 133 142 134 - id : EISA id, as read from device. id.driver_data is set from the 135 - matching driver EISA id. 136 - slot : slot number which the device was detected on 137 - state : set of flags indicating the state of the device. Current 138 - flags are EISA_CONFIG_ENABLED and EISA_CONFIG_FORCED. 139 - res : set of four 256 bytes I/O regions allocated to this device 140 - dma_mask: DMA mask set from the parent device. 141 - dev : generic device (see Documentation/driver-model/device.txt) 143 + ======== ============================================================ 144 + id EISA id, as read from device. id.driver_data is set from the 145 + matching driver EISA id. 146 + slot slot number which the device was detected on 147 + state set of flags indicating the state of the device. Current 148 + flags are EISA_CONFIG_ENABLED and EISA_CONFIG_FORCED. 149 + res set of four 256 bytes I/O regions allocated to this device 150 + dma_mask DMA mask set from the parent device. 151 + dev generic device (see Documentation/driver-model/device.txt) 152 + ======== ============================================================ 142 153 143 154 You can get the 'struct eisa_device' from 'struct device' using the 144 155 'to_eisa_device' macro. 145 156 146 - ** Misc stuff : 157 + Misc stuff 158 + ========== 147 159 148 - void eisa_set_drvdata (struct eisa_device *edev, void *data); 160 + :: 161 + 162 + void eisa_set_drvdata (struct eisa_device *edev, void *data); 149 163 150 164 Stores data into the device's driver_data area. 151 165 152 - void *eisa_get_drvdata (struct eisa_device *edev): 166 + :: 167 + 168 + void *eisa_get_drvdata (struct eisa_device *edev): 153 169 154 170 Gets the pointer previously stored into the device's driver_data area. 155 171 156 - int eisa_get_region_index (void *addr); 172 + :: 173 + 174 + int eisa_get_region_index (void *addr); 157 175 158 176 Returns the region number (0 <= x < EISA_MAX_RESOURCES) of a given 159 177 address. 160 178 161 - ** Kernel parameters : 179 + Kernel parameters 180 + ================= 162 181 163 - eisa_bus.enable_dev : 182 + eisa_bus.enable_dev 183 + A comma-separated list of slots to be enabled, even if the firmware 184 + set the card as disabled. The driver must be able to properly 185 + initialize the device in such conditions. 164 186 165 - A comma-separated list of slots to be enabled, even if the firmware 166 - set the card as disabled. The driver must be able to properly 167 - initialize the device in such conditions. 187 + eisa_bus.disable_dev 188 + A comma-separated list of slots to be enabled, even if the firmware 189 + set the card as enabled. The driver won't be called to handle this 190 + device. 168 191 169 - eisa_bus.disable_dev : 192 + virtual_root.force_probe 193 + Force the probing code to probe EISA slots even when it cannot find an 194 + EISA compliant mainboard (nothing appears on slot 0). Defaults to 0 195 + (don't force), and set to 1 (force probing) when either 196 + CONFIG_ALPHA_JENSEN or CONFIG_EISA_VLB_PRIMING are set. 170 197 171 - A comma-separated list of slots to be enabled, even if the firmware 172 - set the card as enabled. The driver won't be called to handle this 173 - device. 174 - 175 - virtual_root.force_probe : 176 - 177 - Force the probing code to probe EISA slots even when it cannot find an 178 - EISA compliant mainboard (nothing appears on slot 0). Defaults to 0 179 - (don't force), and set to 1 (force probing) when either 180 - CONFIG_ALPHA_JENSEN or CONFIG_EISA_VLB_PRIMING are set. 181 - 182 - ** Random notes : 198 + Random notes 199 + ============ 183 200 184 201 Converting an EISA driver to the new API mostly involves *deleting* 185 202 code (since probing is now in the core EISA code). Unfortunately, most ··· 219 194 For example, switching your favorite EISA SCSI card to the "hotplug" 220 195 model is "the right thing"(tm). 221 196 222 - ** Thanks : 197 + Thanks 198 + ====== 223 199 224 - I'd like to thank the following people for their help : 200 + I'd like to thank the following people for their help: 201 + 225 202 - Xavier Benigni for lending me a wonderful Alpha Jensen, 226 203 - James Bottomley, Jeff Garzik for getting this stuff into the kernel, 227 204 - Andries Brouwer for contributing numerous EISA ids,