diff options
Diffstat (limited to 'Documentation')
72 files changed, 2334 insertions, 3996 deletions
diff --git a/Documentation/00-INDEX b/Documentation/00-INDEX index f08ca9535733..8b0563633442 100644 --- a/Documentation/00-INDEX +++ b/Documentation/00-INDEX | |||
@@ -12,6 +12,8 @@ Following translations are available on the WWW: | |||
12 | 12 | ||
13 | 00-INDEX | 13 | 00-INDEX |
14 | - this file. | 14 | - this file. |
15 | ABI/ | ||
16 | - info on kernel <-> userspace ABI and relative interface stability. | ||
15 | BUG-HUNTING | 17 | BUG-HUNTING |
16 | - brute force method of doing binary search of patches to find bug. | 18 | - brute force method of doing binary search of patches to find bug. |
17 | Changes | 19 | Changes |
@@ -25,37 +27,57 @@ DMA-mapping.txt | |||
25 | DocBook/ | 27 | DocBook/ |
26 | - directory with DocBook templates etc. for kernel documentation. | 28 | - directory with DocBook templates etc. for kernel documentation. |
27 | HOWTO | 29 | HOWTO |
28 | - The process and procedures of how to do Linux kernel development. | 30 | - the process and procedures of how to do Linux kernel development. |
29 | IO-mapping.txt | 31 | IO-mapping.txt |
30 | - how to access I/O mapped memory from within device drivers. | 32 | - how to access I/O mapped memory from within device drivers. |
31 | IPMI.txt | 33 | IPMI.txt |
32 | - info on Linux Intelligent Platform Management Interface (IPMI) Driver. | 34 | - info on Linux Intelligent Platform Management Interface (IPMI) Driver. |
33 | IRQ-affinity.txt | 35 | IRQ-affinity.txt |
34 | - how to select which CPU(s) handle which interrupt events on SMP. | 36 | - how to select which CPU(s) handle which interrupt events on SMP. |
37 | IRQ.txt | ||
38 | - description of what an IRQ is. | ||
35 | ManagementStyle | 39 | ManagementStyle |
36 | - how to (attempt to) manage kernel hackers. | 40 | - how to (attempt to) manage kernel hackers. |
37 | MSI-HOWTO.txt | 41 | MSI-HOWTO.txt |
38 | - the Message Signaled Interrupts (MSI) Driver Guide HOWTO and FAQ. | 42 | - the Message Signaled Interrupts (MSI) Driver Guide HOWTO and FAQ. |
43 | PCIEBUS-HOWTO.txt | ||
44 | - a guide describing the PCI Express Port Bus driver. | ||
39 | RCU/ | 45 | RCU/ |
40 | - directory with info on RCU (read-copy update). | 46 | - directory with info on RCU (read-copy update). |
41 | README.DAC960 | 47 | README.DAC960 |
42 | - info on Mylex DAC960/DAC1100 PCI RAID Controller Driver for Linux. | 48 | - info on Mylex DAC960/DAC1100 PCI RAID Controller Driver for Linux. |
49 | README.cycladesZ | ||
50 | - info on Cyclades-Z firmware loading. | ||
43 | SAK.txt | 51 | SAK.txt |
44 | - info on Secure Attention Keys. | 52 | - info on Secure Attention Keys. |
53 | SecurityBugs | ||
54 | - procedure for reporting security bugs found in the kernel. | ||
55 | SubmitChecklist | ||
56 | - Linux kernel patch submission checklist. | ||
45 | SubmittingDrivers | 57 | SubmittingDrivers |
46 | - procedure to get a new driver source included into the kernel tree. | 58 | - procedure to get a new driver source included into the kernel tree. |
47 | SubmittingPatches | 59 | SubmittingPatches |
48 | - procedure to get a source patch included into the kernel tree. | 60 | - procedure to get a source patch included into the kernel tree. |
49 | VGA-softcursor.txt | 61 | VGA-softcursor.txt |
50 | - how to change your VGA cursor from a blinking underscore. | 62 | - how to change your VGA cursor from a blinking underscore. |
63 | accounting/ | ||
64 | - documentation on accounting and taskstats. | ||
65 | aoe/ | ||
66 | - description of AoE (ATA over Ethernet) along with config examples. | ||
51 | applying-patches.txt | 67 | applying-patches.txt |
52 | - description of various trees and how to apply their patches. | 68 | - description of various trees and how to apply their patches. |
53 | arm/ | 69 | arm/ |
54 | - directory with info about Linux on the ARM architecture. | 70 | - directory with info about Linux on the ARM architecture. |
71 | atomic_ops.txt | ||
72 | - semantics and behavior of atomic and bitmask operations. | ||
73 | auxdisplay/ | ||
74 | - misc. LCD driver documentation (cfag12864b, ks0108). | ||
55 | basic_profiling.txt | 75 | basic_profiling.txt |
56 | - basic instructions for those who wants to profile Linux kernel. | 76 | - basic instructions for those who wants to profile Linux kernel. |
57 | binfmt_misc.txt | 77 | binfmt_misc.txt |
58 | - info on the kernel support for extra binary formats. | 78 | - info on the kernel support for extra binary formats. |
79 | blackfin/ | ||
80 | - directory with documentation for the Blackfin arch. | ||
59 | block/ | 81 | block/ |
60 | - info on the Block I/O (BIO) layer. | 82 | - info on the Block I/O (BIO) layer. |
61 | cachetlb.txt | 83 | cachetlb.txt |
@@ -68,16 +90,32 @@ cli-sti-removal.txt | |||
68 | - cli()/sti() removal guide. | 90 | - cli()/sti() removal guide. |
69 | computone.txt | 91 | computone.txt |
70 | - info on Computone Intelliport II/Plus Multiport Serial Driver. | 92 | - info on Computone Intelliport II/Plus Multiport Serial Driver. |
93 | connector/ | ||
94 | - docs on the netlink based userspace<->kernel space communication mod. | ||
95 | console/ | ||
96 | - documentation on Linux console drivers. | ||
71 | cpqarray.txt | 97 | cpqarray.txt |
72 | - info on using Compaq's SMART2 Intelligent Disk Array Controllers. | 98 | - info on using Compaq's SMART2 Intelligent Disk Array Controllers. |
73 | cpu-freq/ | 99 | cpu-freq/ |
74 | - info on CPU frequency and voltage scaling. | 100 | - info on CPU frequency and voltage scaling. |
101 | cpu-hotplug.txt | ||
102 | - document describing CPU hotplug support in the Linux kernel. | ||
103 | cpu-load.txt | ||
104 | - document describing how CPU load statistics are collected. | ||
105 | cpusets.txt | ||
106 | - documents the cpusets feature; assign CPUs and Mem to a set of tasks. | ||
107 | cputopology.txt | ||
108 | - documentation on how CPU topology info is exported via sysfs. | ||
75 | cris/ | 109 | cris/ |
76 | - directory with info about Linux on CRIS architecture. | 110 | - directory with info about Linux on CRIS architecture. |
77 | crypto/ | 111 | crypto/ |
78 | - directory with info on the Crypto API. | 112 | - directory with info on the Crypto API. |
113 | dcdbas.txt | ||
114 | - information on the Dell Systems Management Base Driver. | ||
79 | debugging-modules.txt | 115 | debugging-modules.txt |
80 | - some notes on debugging modules after Linux 2.6.3. | 116 | - some notes on debugging modules after Linux 2.6.3. |
117 | dell_rbu.txt | ||
118 | - document demonstrating the use of the Dell Remote BIOS Update driver. | ||
81 | device-mapper/ | 119 | device-mapper/ |
82 | - directory with info on Device Mapper. | 120 | - directory with info on Device Mapper. |
83 | devices.txt | 121 | devices.txt |
@@ -86,32 +124,52 @@ digiepca.txt | |||
86 | - info on Digi Intl. {PC,PCI,EISA}Xx and Xem series cards. | 124 | - info on Digi Intl. {PC,PCI,EISA}Xx and Xem series cards. |
87 | dnotify.txt | 125 | dnotify.txt |
88 | - info about directory notification in Linux. | 126 | - info about directory notification in Linux. |
127 | dontdiff | ||
128 | - file containing a list of files that should never be diff'ed. | ||
89 | driver-model/ | 129 | driver-model/ |
90 | - directory with info about Linux driver model. | 130 | - directory with info about Linux driver model. |
131 | drivers/ | ||
132 | - directory with driver documentation (currently only EDAC). | ||
91 | dvb/ | 133 | dvb/ |
92 | - info on Linux Digital Video Broadcast (DVB) subsystem. | 134 | - info on Linux Digital Video Broadcast (DVB) subsystem. |
93 | early-userspace/ | 135 | early-userspace/ |
94 | - info about initramfs, klibc, and userspace early during boot. | 136 | - info about initramfs, klibc, and userspace early during boot. |
137 | ecryptfs.txt | ||
138 | - docs on eCryptfs: stacked cryptographic filesystem for Linux. | ||
95 | eisa.txt | 139 | eisa.txt |
96 | - info on EISA bus support. | 140 | - info on EISA bus support. |
97 | exception.txt | 141 | exception.txt |
98 | - how Linux v2.2 handles exceptions without verify_area etc. | 142 | - how Linux v2.2 handles exceptions without verify_area etc. |
143 | fault-injection/ | ||
144 | - dir with docs about the fault injection capabilities infrastructure. | ||
99 | fb/ | 145 | fb/ |
100 | - directory with info on the frame buffer graphics abstraction layer. | 146 | - directory with info on the frame buffer graphics abstraction layer. |
147 | feature-removal-schedule.txt | ||
148 | - list of files and features that are going to be removed. | ||
101 | filesystems/ | 149 | filesystems/ |
102 | - directory with info on the various filesystems that Linux supports. | 150 | - directory with info on the various filesystems that Linux supports. |
103 | firmware_class/ | 151 | firmware_class/ |
104 | - request_firmware() hotplug interface info. | 152 | - request_firmware() hotplug interface info. |
105 | floppy.txt | 153 | floppy.txt |
106 | - notes and driver options for the floppy disk driver. | 154 | - notes and driver options for the floppy disk driver. |
155 | fujitsu/ | ||
156 | - Fujitsu FR-V Linux documentation. | ||
157 | gpio.txt | ||
158 | - overview of GPIO (General Purpose Input/Output) access conventions. | ||
107 | hayes-esp.txt | 159 | hayes-esp.txt |
108 | - info on using the Hayes ESP serial driver. | 160 | - info on using the Hayes ESP serial driver. |
109 | highuid.txt | 161 | highuid.txt |
110 | - notes on the change from 16 bit to 32 bit user/group IDs. | 162 | - notes on the change from 16 bit to 32 bit user/group IDs. |
111 | hpet.txt | 163 | hpet.txt |
112 | - High Precision Event Timer Driver for Linux. | 164 | - High Precision Event Timer Driver for Linux. |
165 | hrtimer/ | ||
166 | - info on the timer_stats debugging facility for timer (ab)use. | ||
167 | hrtimers/ | ||
168 | - info on the hrtimers subsystem for high-resolution kernel timers. | ||
113 | hw_random.txt | 169 | hw_random.txt |
114 | - info on Linux support for random number generator in i8xx chipsets. | 170 | - info on Linux support for random number generator in i8xx chipsets. |
171 | hwmon/ | ||
172 | - directory with docs on various hardware monitoring drivers. | ||
115 | i2c/ | 173 | i2c/ |
116 | - directory with info about the I2C bus/protocol (2 wire, kHz speed). | 174 | - directory with info about the I2C bus/protocol (2 wire, kHz speed). |
117 | i2o/ | 175 | i2o/ |
@@ -122,16 +180,22 @@ ia64/ | |||
122 | - directory with info about Linux on Intel 64 bit architecture. | 180 | - directory with info about Linux on Intel 64 bit architecture. |
123 | ide.txt | 181 | ide.txt |
124 | - important info for users of ATA devices (IDE/EIDE disks and CD-ROMS). | 182 | - important info for users of ATA devices (IDE/EIDE disks and CD-ROMS). |
183 | infiniband/ | ||
184 | - directory with documents concerning Linux InfiniBand support. | ||
125 | initrd.txt | 185 | initrd.txt |
126 | - how to use the RAM disk as an initial/temporary root filesystem. | 186 | - how to use the RAM disk as an initial/temporary root filesystem. |
127 | input/ | 187 | input/ |
128 | - info on Linux input device support. | 188 | - info on Linux input device support. |
129 | io_ordering.txt | 189 | io_ordering.txt |
130 | - info on ordering I/O writes to memory-mapped addresses. | 190 | - info on ordering I/O writes to memory-mapped addresses. |
191 | ioctl/ | ||
192 | - directory with documents describing various IOCTL calls. | ||
131 | ioctl-number.txt | 193 | ioctl-number.txt |
132 | - how to implement and register device/driver ioctl calls. | 194 | - how to implement and register device/driver ioctl calls. |
133 | iostats.txt | 195 | iostats.txt |
134 | - info on I/O statistics Linux kernel provides. | 196 | - info on I/O statistics Linux kernel provides. |
197 | irqflags-tracing.txt | ||
198 | - how to use the irq-flags tracing feature. | ||
135 | isapnp.txt | 199 | isapnp.txt |
136 | - info on Linux ISA Plug & Play support. | 200 | - info on Linux ISA Plug & Play support. |
137 | isdn/ | 201 | isdn/ |
@@ -140,26 +204,40 @@ java.txt | |||
140 | - info on the in-kernel binary support for Java(tm). | 204 | - info on the in-kernel binary support for Java(tm). |
141 | kbuild/ | 205 | kbuild/ |
142 | - directory with info about the kernel build process. | 206 | - directory with info about the kernel build process. |
143 | kdumpt.txt | 207 | kdump/ |
144 | - mini HowTo on getting the crash dump code to work. | 208 | - directory with mini HowTo on getting the crash dump code to work. |
145 | kernel-doc-nano-HOWTO.txt | 209 | kernel-doc-nano-HOWTO.txt |
146 | - mini HowTo on generation and location of kernel documentation files. | 210 | - mini HowTo on generation and location of kernel documentation files. |
147 | kernel-docs.txt | 211 | kernel-docs.txt |
148 | - listing of various WWW + books that document kernel internals. | 212 | - listing of various WWW + books that document kernel internals. |
149 | kernel-parameters.txt | 213 | kernel-parameters.txt |
150 | - summary listing of command line / boot prompt args for the kernel. | 214 | - summary listing of command line / boot prompt args for the kernel. |
215 | keys-request-key.txt | ||
216 | - description of the kernel key request service. | ||
217 | keys.txt | ||
218 | - description of the kernel key retention service. | ||
151 | kobject.txt | 219 | kobject.txt |
152 | - info of the kobject infrastructure of the Linux kernel. | 220 | - info of the kobject infrastructure of the Linux kernel. |
221 | kprobes.txt | ||
222 | - documents the kernel probes debugging feature. | ||
223 | kref.txt | ||
224 | - docs on adding reference counters (krefs) to kernel objects. | ||
153 | laptop-mode.txt | 225 | laptop-mode.txt |
154 | - How to conserve battery power using laptop-mode. | 226 | - how to conserve battery power using laptop-mode. |
155 | ldm.txt | 227 | ldm.txt |
156 | - a brief description of LDM (Windows Dynamic Disks). | 228 | - a brief description of LDM (Windows Dynamic Disks). |
229 | leds-class.txt | ||
230 | - documents LED handling under Linux. | ||
231 | local_ops.txt | ||
232 | - semantics and behavior of local atomic operations. | ||
233 | lockdep-design.txt | ||
234 | - documentation on the runtime locking correctness validator. | ||
157 | locks.txt | 235 | locks.txt |
158 | - info on file locking implementations, flock() vs. fcntl(), etc. | 236 | - info on file locking implementations, flock() vs. fcntl(), etc. |
159 | logo.gif | 237 | logo.gif |
160 | - Full colour GIF image of Linux logo (penguin). | 238 | - full colour GIF image of Linux logo (penguin - Tux). |
161 | logo.txt | 239 | logo.txt |
162 | - Info on creator of above logo & site to get additional images from. | 240 | - info on creator of above logo & site to get additional images from. |
163 | m68k/ | 241 | m68k/ |
164 | - directory with info about Linux on Motorola 68k architecture. | 242 | - directory with info about Linux on Motorola 68k architecture. |
165 | magic-number.txt | 243 | magic-number.txt |
@@ -170,6 +248,8 @@ mca.txt | |||
170 | - info on supporting Micro Channel Architecture (e.g. PS/2) systems. | 248 | - info on supporting Micro Channel Architecture (e.g. PS/2) systems. |
171 | md.txt | 249 | md.txt |
172 | - info on boot arguments for the multiple devices driver. | 250 | - info on boot arguments for the multiple devices driver. |
251 | memory-barriers.txt | ||
252 | - info on Linux kernel memory barriers. | ||
173 | memory.txt | 253 | memory.txt |
174 | - info on typical Linux memory problems. | 254 | - info on typical Linux memory problems. |
175 | mips/ | 255 | mips/ |
@@ -177,9 +257,11 @@ mips/ | |||
177 | mono.txt | 257 | mono.txt |
178 | - how to execute Mono-based .NET binaries with the help of BINFMT_MISC. | 258 | - how to execute Mono-based .NET binaries with the help of BINFMT_MISC. |
179 | moxa-smartio | 259 | moxa-smartio |
180 | - info on installing/using Moxa multiport serial driver. | 260 | - file with info on installing/using Moxa multiport serial driver. |
181 | mtrr.txt | 261 | mtrr.txt |
182 | - how to use PPro Memory Type Range Registers to increase performance. | 262 | - how to use PPro Memory Type Range Registers to increase performance. |
263 | mutex-design.txt | ||
264 | - info on the generic mutex subsystem. | ||
183 | nbd.txt | 265 | nbd.txt |
184 | - info on a TCP implementation of a network block device. | 266 | - info on a TCP implementation of a network block device. |
185 | netlabel/ | 267 | netlabel/ |
@@ -190,6 +272,8 @@ nfsroot.txt | |||
190 | - short guide on setting up a diskless box with NFS root filesystem. | 272 | - short guide on setting up a diskless box with NFS root filesystem. |
191 | nmi_watchdog.txt | 273 | nmi_watchdog.txt |
192 | - info on NMI watchdog for SMP systems. | 274 | - info on NMI watchdog for SMP systems. |
275 | nommu-mmap.txt | ||
276 | - documentation about no-mmu memory mapping support. | ||
193 | numastat.txt | 277 | numastat.txt |
194 | - info on how to read Numa policy hit/miss statistics in sysfs. | 278 | - info on how to read Numa policy hit/miss statistics in sysfs. |
195 | oops-tracing.txt | 279 | oops-tracing.txt |
@@ -202,8 +286,16 @@ parport.txt | |||
202 | - how to use the parallel-port driver. | 286 | - how to use the parallel-port driver. |
203 | parport-lowlevel.txt | 287 | parport-lowlevel.txt |
204 | - description and usage of the low level parallel port functions. | 288 | - description and usage of the low level parallel port functions. |
289 | pci-error-recovery.txt | ||
290 | - info on PCI error recovery. | ||
205 | pci.txt | 291 | pci.txt |
206 | - info on the PCI subsystem for device driver authors. | 292 | - info on the PCI subsystem for device driver authors. |
293 | pcieaer-howto.txt | ||
294 | - the PCI Express Advanced Error Reporting Driver Guide HOWTO. | ||
295 | pcmcia/ | ||
296 | - info on the Linux PCMCIA driver. | ||
297 | pi-futex.txt | ||
298 | - documentation on lightweight PI-futexes. | ||
207 | pm.txt | 299 | pm.txt |
208 | - info on Linux power management support. | 300 | - info on Linux power management support. |
209 | pnp.txt | 301 | pnp.txt |
@@ -214,18 +306,32 @@ powerpc/ | |||
214 | - directory with info on using Linux with the PowerPC. | 306 | - directory with info on using Linux with the PowerPC. |
215 | preempt-locking.txt | 307 | preempt-locking.txt |
216 | - info on locking under a preemptive kernel. | 308 | - info on locking under a preemptive kernel. |
309 | prio_tree.txt | ||
310 | - info on radix-priority-search-tree use for indexing vmas. | ||
217 | ramdisk.txt | 311 | ramdisk.txt |
218 | - short guide on how to set up and use the RAM disk. | 312 | - short guide on how to set up and use the RAM disk. |
313 | rbtree.txt | ||
314 | - info on what red-black trees are and what they are for. | ||
219 | riscom8.txt | 315 | riscom8.txt |
220 | - notes on using the RISCom/8 multi-port serial driver. | 316 | - notes on using the RISCom/8 multi-port serial driver. |
317 | robust-futex-ABI.txt | ||
318 | - documentation of the robust futex ABI. | ||
319 | robust-futexes.txt | ||
320 | - a description of what robust futexes are. | ||
221 | rocket.txt | 321 | rocket.txt |
222 | - info on the Comtrol RocketPort multiport serial driver. | 322 | - info on the Comtrol RocketPort multiport serial driver. |
223 | rpc-cache.txt | 323 | rpc-cache.txt |
224 | - introduction to the caching mechanisms in the sunrpc layer. | 324 | - introduction to the caching mechanisms in the sunrpc layer. |
325 | rt-mutex-design.txt | ||
326 | - description of the RealTime mutex implementation design. | ||
327 | rt-mutex.txt | ||
328 | - desc. of RT-mutex subsystem with PI (Priority Inheritance) support. | ||
225 | rtc.txt | 329 | rtc.txt |
226 | - notes on how to use the Real Time Clock (aka CMOS clock) driver. | 330 | - notes on how to use the Real Time Clock (aka CMOS clock) driver. |
227 | s390/ | 331 | s390/ |
228 | - directory with info on using Linux on the IBM S390. | 332 | - directory with info on using Linux on the IBM S390. |
333 | sched-arch.txt | ||
334 | - CPU Scheduler implementation hints for architecture specific code. | ||
229 | sched-coding.txt | 335 | sched-coding.txt |
230 | - reference for various scheduler-related methods in the O(1) scheduler. | 336 | - reference for various scheduler-related methods in the O(1) scheduler. |
231 | sched-design.txt | 337 | sched-design.txt |
@@ -240,22 +346,32 @@ serial/ | |||
240 | - directory with info on the low level serial API. | 346 | - directory with info on the low level serial API. |
241 | serial-console.txt | 347 | serial-console.txt |
242 | - how to set up Linux with a serial line console as the default. | 348 | - how to set up Linux with a serial line console as the default. |
349 | sgi-ioc4.txt | ||
350 | - description of the SGI IOC4 PCI (multi function) device. | ||
243 | sgi-visws.txt | 351 | sgi-visws.txt |
244 | - short blurb on the SGI Visual Workstations. | 352 | - short blurb on the SGI Visual Workstations. |
245 | sh/ | 353 | sh/ |
246 | - directory with info on porting Linux to a new architecture. | 354 | - directory with info on porting Linux to a new architecture. |
355 | sharedsubtree.txt | ||
356 | - a description of shared subtrees for namespaces. | ||
247 | smart-config.txt | 357 | smart-config.txt |
248 | - description of the Smart Config makefile feature. | 358 | - description of the Smart Config makefile feature. |
249 | smp.txt | 359 | smp.txt |
250 | - a few notes on symmetric multi-processing. | 360 | - a few notes on symmetric multi-processing. |
361 | sony-laptop.txt | ||
362 | - Sony Notebook Control Driver (SNC) Readme. | ||
251 | sonypi.txt | 363 | sonypi.txt |
252 | - info on Linux Sony Programmable I/O Device support. | 364 | - info on Linux Sony Programmable I/O Device support. |
253 | sound/ | 365 | sound/ |
254 | - directory with info on sound card support. | 366 | - directory with info on sound card support. |
255 | sparc/ | 367 | sparc/ |
256 | - directory with info on using Linux on Sparc architecture. | 368 | - directory with info on using Linux on Sparc architecture. |
369 | sparse.txt | ||
370 | - info on how to obtain and use the sparse tool for typechecking. | ||
257 | specialix.txt | 371 | specialix.txt |
258 | - info on hardware/driver for specialix IO8+ multiport serial card. | 372 | - info on hardware/driver for specialix IO8+ multiport serial card. |
373 | spi/ | ||
374 | - overview of Linux kernel Serial Peripheral Interface (SPI) support. | ||
259 | spinlocks.txt | 375 | spinlocks.txt |
260 | - info on using spinlocks to provide exclusive access in kernel. | 376 | - info on using spinlocks to provide exclusive access in kernel. |
261 | stable_api_nonsense.txt | 377 | stable_api_nonsense.txt |
@@ -274,24 +390,32 @@ sysrq.txt | |||
274 | - info on the magic SysRq key. | 390 | - info on the magic SysRq key. |
275 | telephony/ | 391 | telephony/ |
276 | - directory with info on telephony (e.g. voice over IP) support. | 392 | - directory with info on telephony (e.g. voice over IP) support. |
393 | thinkpad-acpi.txt | ||
394 | - information on the (IBM and Lenovo) ThinkPad ACPI Extras driver. | ||
277 | time_interpolators.txt | 395 | time_interpolators.txt |
278 | - info on time interpolators. | 396 | - info on time interpolators. |
279 | tipar.txt | 397 | tipar.txt |
280 | - information about Parallel link cable for Texas Instruments handhelds. | 398 | - information about Parallel link cable for Texas Instruments handhelds. |
281 | tty.txt | 399 | tty.txt |
282 | - guide to the locking policies of the tty layer. | 400 | - guide to the locking policies of the tty layer. |
283 | unicode.txt | ||
284 | - info on the Unicode character/font mapping used in Linux. | ||
285 | uml/ | 401 | uml/ |
286 | - directory with information about User Mode Linux. | 402 | - directory with information about User Mode Linux. |
403 | unicode.txt | ||
404 | - info on the Unicode character/font mapping used in Linux. | ||
405 | unshare.txt | ||
406 | - description of the Linux unshare system call. | ||
287 | usb/ | 407 | usb/ |
288 | - directory with info regarding the Universal Serial Bus. | 408 | - directory with info regarding the Universal Serial Bus. |
409 | video-output.txt | ||
410 | - sysfs class driver interface to enable/disable a video output device. | ||
289 | video4linux/ | 411 | video4linux/ |
290 | - directory with info regarding video/TV/radio cards and linux. | 412 | - directory with info regarding video/TV/radio cards and linux. |
291 | vm/ | 413 | vm/ |
292 | - directory with info on the Linux vm code. | 414 | - directory with info on the Linux vm code. |
293 | voyager.txt | 415 | voyager.txt |
294 | - guide to running Linux on the Voyager architecture. | 416 | - guide to running Linux on the Voyager architecture. |
417 | w1/ | ||
418 | - directory with documents regarding the 1-wire (w1) subsystem. | ||
295 | watchdog/ | 419 | watchdog/ |
296 | - how to auto-reboot Linux if it has "fallen and can't get up". ;-) | 420 | - how to auto-reboot Linux if it has "fallen and can't get up". ;-) |
297 | x86_64/ | 421 | x86_64/ |
diff --git a/Documentation/ABI/testing/sysfs-bus-usb b/Documentation/ABI/testing/sysfs-bus-usb index f9937add033d..9734577d1711 100644 --- a/Documentation/ABI/testing/sysfs-bus-usb +++ b/Documentation/ABI/testing/sysfs-bus-usb | |||
@@ -39,3 +39,16 @@ Description: | |||
39 | If you want to suspend a device immediately but leave it | 39 | If you want to suspend a device immediately but leave it |
40 | free to wake up in response to I/O requests, you should | 40 | free to wake up in response to I/O requests, you should |
41 | write "0" to power/autosuspend. | 41 | write "0" to power/autosuspend. |
42 | |||
43 | What: /sys/bus/usb/devices/.../power/persist | ||
44 | Date: May 2007 | ||
45 | KernelVersion: 2.6.23 | ||
46 | Contact: Alan Stern <stern@rowland.harvard.edu> | ||
47 | Description: | ||
48 | If CONFIG_USB_PERSIST is set, then each USB device directory | ||
49 | will contain a file named power/persist. The file holds a | ||
50 | boolean value (0 or 1) indicating whether or not the | ||
51 | "USB-Persist" facility is enabled for the device. Since the | ||
52 | facility is inherently dangerous, it is disabled by default | ||
53 | for all devices except hubs. For more information, see | ||
54 | Documentation/usb/persist.txt. | ||
diff --git a/Documentation/CodingStyle b/Documentation/CodingStyle index b49b92edb396..a667eb1fc26e 100644 --- a/Documentation/CodingStyle +++ b/Documentation/CodingStyle | |||
@@ -218,6 +218,18 @@ no space after the prefix increment & decrement unary operators: | |||
218 | 218 | ||
219 | and no space around the '.' and "->" structure member operators. | 219 | and no space around the '.' and "->" structure member operators. |
220 | 220 | ||
221 | Do not leave trailing whitespace at the ends of lines. Some editors with | ||
222 | "smart" indentation will insert whitespace at the beginning of new lines as | ||
223 | appropriate, so you can start typing the next line of code right away. | ||
224 | However, some such editors do not remove the whitespace if you end up not | ||
225 | putting a line of code there, such as if you leave a blank line. As a result, | ||
226 | you end up with lines containing trailing whitespace. | ||
227 | |||
228 | Git will warn you about patches that introduce trailing whitespace, and can | ||
229 | optionally strip the trailing whitespace for you; however, if applying a series | ||
230 | of patches, this may make later patches in the series fail by changing their | ||
231 | context lines. | ||
232 | |||
221 | 233 | ||
222 | Chapter 4: Naming | 234 | Chapter 4: Naming |
223 | 235 | ||
@@ -726,6 +738,33 @@ need them. Feel free to peruse that header file to see what else is already | |||
726 | defined that you shouldn't reproduce in your code. | 738 | defined that you shouldn't reproduce in your code. |
727 | 739 | ||
728 | 740 | ||
741 | Chapter 18: Editor modelines and other cruft | ||
742 | |||
743 | Some editors can interpret configuration information embedded in source files, | ||
744 | indicated with special markers. For example, emacs interprets lines marked | ||
745 | like this: | ||
746 | |||
747 | -*- mode: c -*- | ||
748 | |||
749 | Or like this: | ||
750 | |||
751 | /* | ||
752 | Local Variables: | ||
753 | compile-command: "gcc -DMAGIC_DEBUG_FLAG foo.c" | ||
754 | End: | ||
755 | */ | ||
756 | |||
757 | Vim interprets markers that look like this: | ||
758 | |||
759 | /* vim:set sw=8 noet */ | ||
760 | |||
761 | Do not include any of these in source files. People have their own personal | ||
762 | editor configurations, and your source files should not override them. This | ||
763 | includes markers for indentation and mode configuration. People may use their | ||
764 | own custom mode, or may have some other magic method for making indentation | ||
765 | work correctly. | ||
766 | |||
767 | |||
729 | 768 | ||
730 | Appendix I: References | 769 | Appendix I: References |
731 | 770 | ||
diff --git a/Documentation/DMA-mapping.txt b/Documentation/DMA-mapping.txt index 028614cdd062..e07f2530326b 100644 --- a/Documentation/DMA-mapping.txt +++ b/Documentation/DMA-mapping.txt | |||
@@ -664,109 +664,6 @@ It is that simple. | |||
664 | Well, not for some odd devices. See the next section for information | 664 | Well, not for some odd devices. See the next section for information |
665 | about that. | 665 | about that. |
666 | 666 | ||
667 | DAC Addressing for Address Space Hungry Devices | ||
668 | |||
669 | There exists a class of devices which do not mesh well with the PCI | ||
670 | DMA mapping API. By definition these "mappings" are a finite | ||
671 | resource. The number of total available mappings per bus is platform | ||
672 | specific, but there will always be a reasonable amount. | ||
673 | |||
674 | What is "reasonable"? Reasonable means that networking and block I/O | ||
675 | devices need not worry about using too many mappings. | ||
676 | |||
677 | As an example of a problematic device, consider compute cluster cards. | ||
678 | They can potentially need to access gigabytes of memory at once via | ||
679 | DMA. Dynamic mappings are unsuitable for this kind of access pattern. | ||
680 | |||
681 | To this end we've provided a small API by which a device driver | ||
682 | may use DAC cycles to directly address all of physical memory. | ||
683 | Not all platforms support this, but most do. It is easy to determine | ||
684 | whether the platform will work properly at probe time. | ||
685 | |||
686 | First, understand that there may be a SEVERE performance penalty for | ||
687 | using these interfaces on some platforms. Therefore, you MUST only | ||
688 | use these interfaces if it is absolutely required. %99 of devices can | ||
689 | use the normal APIs without any problems. | ||
690 | |||
691 | Note that for streaming type mappings you must either use these | ||
692 | interfaces, or the dynamic mapping interfaces above. You may not mix | ||
693 | usage of both for the same device. Such an act is illegal and is | ||
694 | guaranteed to put a banana in your tailpipe. | ||
695 | |||
696 | However, consistent mappings may in fact be used in conjunction with | ||
697 | these interfaces. Remember that, as defined, consistent mappings are | ||
698 | always going to be SAC addressable. | ||
699 | |||
700 | The first thing your driver needs to do is query the PCI platform | ||
701 | layer if it is capable of handling your devices DAC addressing | ||
702 | capabilities: | ||
703 | |||
704 | int pci_dac_dma_supported(struct pci_dev *hwdev, u64 mask); | ||
705 | |||
706 | You may not use the following interfaces if this routine fails. | ||
707 | |||
708 | Next, DMA addresses using this API are kept track of using the | ||
709 | dma64_addr_t type. It is guaranteed to be big enough to hold any | ||
710 | DAC address the platform layer will give to you from the following | ||
711 | routines. If you have consistent mappings as well, you still | ||
712 | use plain dma_addr_t to keep track of those. | ||
713 | |||
714 | All mappings obtained here will be direct. The mappings are not | ||
715 | translated, and this is the purpose of this dialect of the DMA API. | ||
716 | |||
717 | All routines work with page/offset pairs. This is the _ONLY_ way to | ||
718 | portably refer to any piece of memory. If you have a cpu pointer | ||
719 | (which may be validly DMA'd too) you may easily obtain the page | ||
720 | and offset using something like this: | ||
721 | |||
722 | struct page *page = virt_to_page(ptr); | ||
723 | unsigned long offset = offset_in_page(ptr); | ||
724 | |||
725 | Here are the interfaces: | ||
726 | |||
727 | dma64_addr_t pci_dac_page_to_dma(struct pci_dev *pdev, | ||
728 | struct page *page, | ||
729 | unsigned long offset, | ||
730 | int direction); | ||
731 | |||
732 | The DAC address for the tuple PAGE/OFFSET are returned. The direction | ||
733 | argument is the same as for pci_{map,unmap}_single(). The same rules | ||
734 | for cpu/device access apply here as for the streaming mapping | ||
735 | interfaces. To reiterate: | ||
736 | |||
737 | The cpu may touch the buffer before pci_dac_page_to_dma. | ||
738 | The device may touch the buffer after pci_dac_page_to_dma | ||
739 | is made, but the cpu may NOT. | ||
740 | |||
741 | When the DMA transfer is complete, invoke: | ||
742 | |||
743 | void pci_dac_dma_sync_single_for_cpu(struct pci_dev *pdev, | ||
744 | dma64_addr_t dma_addr, | ||
745 | size_t len, int direction); | ||
746 | |||
747 | This must be done before the CPU looks at the buffer again. | ||
748 | This interface behaves identically to pci_dma_sync_{single,sg}_for_cpu(). | ||
749 | |||
750 | And likewise, if you wish to let the device get back at the buffer after | ||
751 | the cpu has read/written it, invoke: | ||
752 | |||
753 | void pci_dac_dma_sync_single_for_device(struct pci_dev *pdev, | ||
754 | dma64_addr_t dma_addr, | ||
755 | size_t len, int direction); | ||
756 | |||
757 | before letting the device access the DMA area again. | ||
758 | |||
759 | If you need to get back to the PAGE/OFFSET tuple from a dma64_addr_t | ||
760 | the following interfaces are provided: | ||
761 | |||
762 | struct page *pci_dac_dma_to_page(struct pci_dev *pdev, | ||
763 | dma64_addr_t dma_addr); | ||
764 | unsigned long pci_dac_dma_to_offset(struct pci_dev *pdev, | ||
765 | dma64_addr_t dma_addr); | ||
766 | |||
767 | This is possible with the DAC interfaces purely because they are | ||
768 | not translated in any way. | ||
769 | |||
770 | Optimizing Unmap State Space Consumption | 667 | Optimizing Unmap State Space Consumption |
771 | 668 | ||
772 | On many platforms, pci_unmap_{single,page}() is simply a nop. | 669 | On many platforms, pci_unmap_{single,page}() is simply a nop. |
diff --git a/Documentation/DocBook/kernel-api.tmpl b/Documentation/DocBook/kernel-api.tmpl index 8c5698a8c2e1..46bcff2849bd 100644 --- a/Documentation/DocBook/kernel-api.tmpl +++ b/Documentation/DocBook/kernel-api.tmpl | |||
@@ -643,6 +643,60 @@ X!Idrivers/video/console/fonts.c | |||
643 | !Edrivers/spi/spi.c | 643 | !Edrivers/spi/spi.c |
644 | </chapter> | 644 | </chapter> |
645 | 645 | ||
646 | <chapter id="i2c"> | ||
647 | <title>I<superscript>2</superscript>C and SMBus Subsystem</title> | ||
648 | |||
649 | <para> | ||
650 | I<superscript>2</superscript>C (or without fancy typography, "I2C") | ||
651 | is an acronym for the "Inter-IC" bus, a simple bus protocol which is | ||
652 | widely used where low data rate communications suffice. | ||
653 | Since it's also a licensed trademark, some vendors use another | ||
654 | name (such as "Two-Wire Interface", TWI) for the same bus. | ||
655 | I2C only needs two signals (SCL for clock, SDA for data), conserving | ||
656 | board real estate and minimizing signal quality issues. | ||
657 | Most I2C devices use seven bit addresses, and bus speeds of up | ||
658 | to 400 kHz; there's a high speed extension (3.4 MHz) that's not yet | ||
659 | found wide use. | ||
660 | I2C is a multi-master bus; open drain signaling is used to | ||
661 | arbitrate between masters, as well as to handshake and to | ||
662 | synchronize clocks from slower clients. | ||
663 | </para> | ||
664 | |||
665 | <para> | ||
666 | The Linux I2C programming interfaces support only the master | ||
667 | side of bus interactions, not the slave side. | ||
668 | The programming interface is structured around two kinds of driver, | ||
669 | and two kinds of device. | ||
670 | An I2C "Adapter Driver" abstracts the controller hardware; it binds | ||
671 | to a physical device (perhaps a PCI device or platform_device) and | ||
672 | exposes a <structname>struct i2c_adapter</structname> representing | ||
673 | each I2C bus segment it manages. | ||
674 | On each I2C bus segment will be I2C devices represented by a | ||
675 | <structname>struct i2c_client</structname>. Those devices will | ||
676 | be bound to a <structname>struct i2c_driver</structname>, | ||
677 | which should follow the standard Linux driver model. | ||
678 | (At this writing, a legacy model is more widely used.) | ||
679 | There are functions to perform various I2C protocol operations; at | ||
680 | this writing all such functions are usable only from task context. | ||
681 | </para> | ||
682 | |||
683 | <para> | ||
684 | The System Management Bus (SMBus) is a sibling protocol. Most SMBus | ||
685 | systems are also I2C conformant. The electrical constraints are | ||
686 | tighter for SMBus, and it standardizes particular protocol messages | ||
687 | and idioms. Controllers that support I2C can also support most | ||
688 | SMBus operations, but SMBus controllers don't support all the protocol | ||
689 | options that an I2C controller will. | ||
690 | There are functions to perform various SMBus protocol operations, | ||
691 | either using I2C primitives or by issuing SMBus commands to | ||
692 | i2c_adapter devices which don't support those I2C operations. | ||
693 | </para> | ||
694 | |||
695 | !Iinclude/linux/i2c.h | ||
696 | !Fdrivers/i2c/i2c-boardinfo.c i2c_register_board_info | ||
697 | !Edrivers/i2c/i2c-core.c | ||
698 | </chapter> | ||
699 | |||
646 | <chapter id="splice"> | 700 | <chapter id="splice"> |
647 | <title>splice API</title> | 701 | <title>splice API</title> |
648 | <para>) | 702 | <para>) |
@@ -654,4 +708,5 @@ X!Idrivers/video/console/fonts.c | |||
654 | !Ffs/splice.c | 708 | !Ffs/splice.c |
655 | </chapter> | 709 | </chapter> |
656 | 710 | ||
711 | |||
657 | </book> | 712 | </book> |
diff --git a/Documentation/DocBook/procfs-guide.tmpl b/Documentation/DocBook/procfs-guide.tmpl index 45cad23efefa..2de84dc195a8 100644 --- a/Documentation/DocBook/procfs-guide.tmpl +++ b/Documentation/DocBook/procfs-guide.tmpl | |||
@@ -352,49 +352,93 @@ entry->write_proc = write_proc_foo; | |||
352 | <funcsynopsis> | 352 | <funcsynopsis> |
353 | <funcprototype> | 353 | <funcprototype> |
354 | <funcdef>int <function>read_func</function></funcdef> | 354 | <funcdef>int <function>read_func</function></funcdef> |
355 | <paramdef>char* <parameter>page</parameter></paramdef> | 355 | <paramdef>char* <parameter>buffer</parameter></paramdef> |
356 | <paramdef>char** <parameter>start</parameter></paramdef> | 356 | <paramdef>char** <parameter>start</parameter></paramdef> |
357 | <paramdef>off_t <parameter>off</parameter></paramdef> | 357 | <paramdef>off_t <parameter>off</parameter></paramdef> |
358 | <paramdef>int <parameter>count</parameter></paramdef> | 358 | <paramdef>int <parameter>count</parameter></paramdef> |
359 | <paramdef>int* <parameter>eof</parameter></paramdef> | 359 | <paramdef>int* <parameter>peof</parameter></paramdef> |
360 | <paramdef>void* <parameter>data</parameter></paramdef> | 360 | <paramdef>void* <parameter>data</parameter></paramdef> |
361 | </funcprototype> | 361 | </funcprototype> |
362 | </funcsynopsis> | 362 | </funcsynopsis> |
363 | 363 | ||
364 | <para> | 364 | <para> |
365 | The read function should write its information into the | 365 | The read function should write its information into the |
366 | <parameter>page</parameter>. For proper use, the function | 366 | <parameter>buffer</parameter>, which will be exactly |
367 | should start writing at an offset of | 367 | <literal>PAGE_SIZE</literal> bytes long. |
368 | <parameter>off</parameter> in <parameter>page</parameter> and | ||
369 | write at most <parameter>count</parameter> bytes, but because | ||
370 | most read functions are quite simple and only return a small | ||
371 | amount of information, these two parameters are usually | ||
372 | ignored (it breaks pagers like <literal>more</literal> and | ||
373 | <literal>less</literal>, but <literal>cat</literal> still | ||
374 | works). | ||
375 | </para> | 368 | </para> |
376 | 369 | ||
377 | <para> | 370 | <para> |
378 | If the <parameter>off</parameter> and | 371 | The parameter |
379 | <parameter>count</parameter> parameters are properly used, | 372 | <parameter>peof</parameter> should be used to signal that the |
380 | <parameter>eof</parameter> should be used to signal that the | ||
381 | end of the file has been reached by writing | 373 | end of the file has been reached by writing |
382 | <literal>1</literal> to the memory location | 374 | <literal>1</literal> to the memory location |
383 | <parameter>eof</parameter> points to. | 375 | <parameter>peof</parameter> points to. |
384 | </para> | 376 | </para> |
385 | 377 | ||
386 | <para> | 378 | <para> |
387 | The parameter <parameter>start</parameter> doesn't seem to be | 379 | The <parameter>data</parameter> |
388 | used anywhere in the kernel. The <parameter>data</parameter> | ||
389 | parameter can be used to create a single call back function for | 380 | parameter can be used to create a single call back function for |
390 | several files, see <xref linkend="usingdata"/>. | 381 | several files, see <xref linkend="usingdata"/>. |
391 | </para> | 382 | </para> |
392 | 383 | ||
393 | <para> | 384 | <para> |
394 | The <function>read_func</function> function must return the | 385 | The rest of the parameters and the return value are described |
395 | number of bytes written into the <parameter>page</parameter>. | 386 | by a comment in <filename>fs/proc/generic.c</filename> as follows: |
396 | </para> | 387 | </para> |
397 | 388 | ||
389 | <blockquote> | ||
390 | <para> | ||
391 | You have three ways to return data: | ||
392 | </para> | ||
393 | <orderedlist> | ||
394 | <listitem> | ||
395 | <para> | ||
396 | Leave <literal>*start = NULL</literal>. (This is the default.) | ||
397 | Put the data of the requested offset at that | ||
398 | offset within the buffer. Return the number (<literal>n</literal>) | ||
399 | of bytes there are from the beginning of the | ||
400 | buffer up to the last byte of data. If the | ||
401 | number of supplied bytes (<literal>= n - offset</literal>) is | ||
402 | greater than zero and you didn't signal eof | ||
403 | and the reader is prepared to take more data | ||
404 | you will be called again with the requested | ||
405 | offset advanced by the number of bytes | ||
406 | absorbed. This interface is useful for files | ||
407 | no larger than the buffer. | ||
408 | </para> | ||
409 | </listitem> | ||
410 | <listitem> | ||
411 | <para> | ||
412 | Set <literal>*start</literal> to an unsigned long value less than | ||
413 | the buffer address but greater than zero. | ||
414 | Put the data of the requested offset at the | ||
415 | beginning of the buffer. Return the number of | ||
416 | bytes of data placed there. If this number is | ||
417 | greater than zero and you didn't signal eof | ||
418 | and the reader is prepared to take more data | ||
419 | you will be called again with the requested | ||
420 | offset advanced by <literal>*start</literal>. This interface is | ||
421 | useful when you have a large file consisting | ||
422 | of a series of blocks which you want to count | ||
423 | and return as wholes. | ||
424 | (Hack by Paul.Russell@rustcorp.com.au) | ||
425 | </para> | ||
426 | </listitem> | ||
427 | <listitem> | ||
428 | <para> | ||
429 | Set <literal>*start</literal> to an address within the buffer. | ||
430 | Put the data of the requested offset at <literal>*start</literal>. | ||
431 | Return the number of bytes of data placed there. | ||
432 | If this number is greater than zero and you | ||
433 | didn't signal eof and the reader is prepared to | ||
434 | take more data you will be called again with the | ||
435 | requested offset advanced by the number of bytes | ||
436 | absorbed. | ||
437 | </para> | ||
438 | </listitem> | ||
439 | </orderedlist> | ||
440 | </blockquote> | ||
441 | |||
398 | <para> | 442 | <para> |
399 | <xref linkend="example"/> shows how to use a read call back | 443 | <xref linkend="example"/> shows how to use a read call back |
400 | function. | 444 | function. |
diff --git a/Documentation/RCU/checklist.txt b/Documentation/RCU/checklist.txt index f4dffadbcb00..42b01bc2e1b4 100644 --- a/Documentation/RCU/checklist.txt +++ b/Documentation/RCU/checklist.txt | |||
@@ -222,7 +222,15 @@ over a rather long period of time, but improvements are always welcome! | |||
222 | deadlock as soon as the RCU callback happens to interrupt that | 222 | deadlock as soon as the RCU callback happens to interrupt that |
223 | acquisition's critical section. | 223 | acquisition's critical section. |
224 | 224 | ||
225 | 13. SRCU (srcu_read_lock(), srcu_read_unlock(), and synchronize_srcu()) | 225 | 13. RCU callbacks can be and are executed in parallel. In many cases, |
226 | the callback code simply wrappers around kfree(), so that this | ||
227 | is not an issue (or, more accurately, to the extent that it is | ||
228 | an issue, the memory-allocator locking handles it). However, | ||
229 | if the callbacks do manipulate a shared data structure, they | ||
230 | must use whatever locking or other synchronization is required | ||
231 | to safely access and/or modify that data structure. | ||
232 | |||
233 | 14. SRCU (srcu_read_lock(), srcu_read_unlock(), and synchronize_srcu()) | ||
226 | may only be invoked from process context. Unlike other forms of | 234 | may only be invoked from process context. Unlike other forms of |
227 | RCU, it -is- permissible to block in an SRCU read-side critical | 235 | RCU, it -is- permissible to block in an SRCU read-side critical |
228 | section (demarked by srcu_read_lock() and srcu_read_unlock()), | 236 | section (demarked by srcu_read_lock() and srcu_read_unlock()), |
diff --git a/Documentation/SubmitChecklist b/Documentation/SubmitChecklist index 6ebffb57e3db..19e7f65c269f 100644 --- a/Documentation/SubmitChecklist +++ b/Documentation/SubmitChecklist | |||
@@ -1,4 +1,4 @@ | |||
1 | Linux Kernel patch sumbittal checklist | 1 | Linux Kernel patch submission checklist |
2 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 2 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
3 | 3 | ||
4 | Here are some basic things that developers should do if they want to see their | 4 | Here are some basic things that developers should do if they want to see their |
@@ -9,7 +9,6 @@ Documentation/SubmittingPatches and elsewhere regarding submitting Linux | |||
9 | kernel patches. | 9 | kernel patches. |
10 | 10 | ||
11 | 11 | ||
12 | |||
13 | 1: Builds cleanly with applicable or modified CONFIG options =y, =m, and | 12 | 1: Builds cleanly with applicable or modified CONFIG options =y, =m, and |
14 | =n. No gcc warnings/errors, no linker warnings/errors. | 13 | =n. No gcc warnings/errors, no linker warnings/errors. |
15 | 14 | ||
diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches index 0958e97d4bf4..3f9a7912e69b 100644 --- a/Documentation/SubmittingPatches +++ b/Documentation/SubmittingPatches | |||
@@ -464,9 +464,25 @@ section Linus Computer Science 101. | |||
464 | Nuff said. If your code deviates too much from this, it is likely | 464 | Nuff said. If your code deviates too much from this, it is likely |
465 | to be rejected without further review, and without comment. | 465 | to be rejected without further review, and without comment. |
466 | 466 | ||
467 | Once significant exception is when moving code from one file to | ||
468 | another in this case you should not modify the moved code at all in | ||
469 | the same patch which moves it. This clearly delineates the act of | ||
470 | moving the code and your changes. This greatly aids review of the | ||
471 | actual differences and allows tools to better track the history of | ||
472 | the code itself. | ||
473 | |||
467 | Check your patches with the patch style checker prior to submission | 474 | Check your patches with the patch style checker prior to submission |
468 | (scripts/checkpatch.pl). You should be able to justify all | 475 | (scripts/checkpatch.pl). The style checker should be viewed as |
469 | violations that remain in your patch. | 476 | a guide not as the final word. If your code looks better with |
477 | a violation then its probably best left alone. | ||
478 | |||
479 | The checker reports at three levels: | ||
480 | - ERROR: things that are very likely to be wrong | ||
481 | - WARNING: things requiring careful review | ||
482 | - CHECK: things requiring thought | ||
483 | |||
484 | You should be able to justify all violations that remain in your | ||
485 | patch. | ||
470 | 486 | ||
471 | 487 | ||
472 | 488 | ||
diff --git a/Documentation/accounting/getdelays.c b/Documentation/accounting/getdelays.c index 71acc28ed0d1..24c5aade8998 100644 --- a/Documentation/accounting/getdelays.c +++ b/Documentation/accounting/getdelays.c | |||
@@ -49,6 +49,7 @@ char name[100]; | |||
49 | int dbg; | 49 | int dbg; |
50 | int print_delays; | 50 | int print_delays; |
51 | int print_io_accounting; | 51 | int print_io_accounting; |
52 | int print_task_context_switch_counts; | ||
52 | __u64 stime, utime; | 53 | __u64 stime, utime; |
53 | 54 | ||
54 | #define PRINTF(fmt, arg...) { \ | 55 | #define PRINTF(fmt, arg...) { \ |
@@ -195,7 +196,7 @@ void print_delayacct(struct taskstats *t) | |||
195 | "IO %15s%15s\n" | 196 | "IO %15s%15s\n" |
196 | " %15llu%15llu\n" | 197 | " %15llu%15llu\n" |
197 | "MEM %15s%15s\n" | 198 | "MEM %15s%15s\n" |
198 | " %15llu%15llu\n\n", | 199 | " %15llu%15llu\n" |
199 | "count", "real total", "virtual total", "delay total", | 200 | "count", "real total", "virtual total", "delay total", |
200 | t->cpu_count, t->cpu_run_real_total, t->cpu_run_virtual_total, | 201 | t->cpu_count, t->cpu_run_real_total, t->cpu_run_virtual_total, |
201 | t->cpu_delay_total, | 202 | t->cpu_delay_total, |
@@ -204,6 +205,14 @@ void print_delayacct(struct taskstats *t) | |||
204 | "count", "delay total", t->swapin_count, t->swapin_delay_total); | 205 | "count", "delay total", t->swapin_count, t->swapin_delay_total); |
205 | } | 206 | } |
206 | 207 | ||
208 | void task_context_switch_counts(struct taskstats *t) | ||
209 | { | ||
210 | printf("\n\nTask %15s%15s\n" | ||
211 | " %15lu%15lu\n", | ||
212 | "voluntary", "nonvoluntary", | ||
213 | t->nvcsw, t->nivcsw); | ||
214 | } | ||
215 | |||
207 | void print_ioacct(struct taskstats *t) | 216 | void print_ioacct(struct taskstats *t) |
208 | { | 217 | { |
209 | printf("%s: read=%llu, write=%llu, cancelled_write=%llu\n", | 218 | printf("%s: read=%llu, write=%llu, cancelled_write=%llu\n", |
@@ -235,7 +244,7 @@ int main(int argc, char *argv[]) | |||
235 | struct msgtemplate msg; | 244 | struct msgtemplate msg; |
236 | 245 | ||
237 | while (1) { | 246 | while (1) { |
238 | c = getopt(argc, argv, "diw:r:m:t:p:vl"); | 247 | c = getopt(argc, argv, "qdiw:r:m:t:p:vl"); |
239 | if (c < 0) | 248 | if (c < 0) |
240 | break; | 249 | break; |
241 | 250 | ||
@@ -248,6 +257,10 @@ int main(int argc, char *argv[]) | |||
248 | printf("printing IO accounting\n"); | 257 | printf("printing IO accounting\n"); |
249 | print_io_accounting = 1; | 258 | print_io_accounting = 1; |
250 | break; | 259 | break; |
260 | case 'q': | ||
261 | printf("printing task/process context switch rates\n"); | ||
262 | print_task_context_switch_counts = 1; | ||
263 | break; | ||
251 | case 'w': | 264 | case 'w': |
252 | logfile = strdup(optarg); | 265 | logfile = strdup(optarg); |
253 | printf("write to file %s\n", logfile); | 266 | printf("write to file %s\n", logfile); |
@@ -389,6 +402,8 @@ int main(int argc, char *argv[]) | |||
389 | print_delayacct((struct taskstats *) NLA_DATA(na)); | 402 | print_delayacct((struct taskstats *) NLA_DATA(na)); |
390 | if (print_io_accounting) | 403 | if (print_io_accounting) |
391 | print_ioacct((struct taskstats *) NLA_DATA(na)); | 404 | print_ioacct((struct taskstats *) NLA_DATA(na)); |
405 | if (print_task_context_switch_counts) | ||
406 | task_context_switch_counts((struct taskstats *) NLA_DATA(na)); | ||
392 | if (fd) { | 407 | if (fd) { |
393 | if (write(fd, NLA_DATA(na), na->nla_len) < 0) { | 408 | if (write(fd, NLA_DATA(na), na->nla_len) < 0) { |
394 | err(1,"write error\n"); | 409 | err(1,"write error\n"); |
diff --git a/Documentation/accounting/taskstats-struct.txt b/Documentation/accounting/taskstats-struct.txt index 661c797eaf79..8aa7529f8258 100644 --- a/Documentation/accounting/taskstats-struct.txt +++ b/Documentation/accounting/taskstats-struct.txt | |||
@@ -22,6 +22,8 @@ There are three different groups of fields in the struct taskstats: | |||
22 | /* Extended accounting fields end */ | 22 | /* Extended accounting fields end */ |
23 | Their values are collected if CONFIG_TASK_XACCT is set. | 23 | Their values are collected if CONFIG_TASK_XACCT is set. |
24 | 24 | ||
25 | 4) Per-task and per-thread context switch count statistics | ||
26 | |||
25 | Future extension should add fields to the end of the taskstats struct, and | 27 | Future extension should add fields to the end of the taskstats struct, and |
26 | should not change the relative position of each field within the struct. | 28 | should not change the relative position of each field within the struct. |
27 | 29 | ||
@@ -158,4 +160,8 @@ struct taskstats { | |||
158 | 160 | ||
159 | /* Extended accounting fields end */ | 161 | /* Extended accounting fields end */ |
160 | 162 | ||
163 | 4) Per-task and per-thread statistics | ||
164 | __u64 nvcsw; /* Context voluntary switch counter */ | ||
165 | __u64 nivcsw; /* Context involuntary switch counter */ | ||
166 | |||
161 | } | 167 | } |
diff --git a/Documentation/blackfin/kgdb.txt b/Documentation/blackfin/kgdb.txt new file mode 100644 index 000000000000..84f6a484ae9a --- /dev/null +++ b/Documentation/blackfin/kgdb.txt | |||
@@ -0,0 +1,155 @@ | |||
1 | A Simple Guide to Configure KGDB | ||
2 | |||
3 | Sonic Zhang <sonic.zhang@analog.com> | ||
4 | Aug. 24th 2006 | ||
5 | |||
6 | |||
7 | This KGDB patch enables the kernel developer to do source level debugging on | ||
8 | the kernel for the Blackfin architecture. The debugging works over either the | ||
9 | ethernet interface or one of the uarts. Both software breakpoints and | ||
10 | hardware breakpoints are supported in this version. | ||
11 | http://docs.blackfin.uclinux.org/doku.php?id=kgdb | ||
12 | |||
13 | |||
14 | 2 known issues: | ||
15 | 1. This bug: | ||
16 | http://blackfin.uclinux.org/tracker/index.php?func=detail&aid=544&group_id=18&atid=145 | ||
17 | The GDB client for Blackfin uClinux causes incorrect values of local | ||
18 | variables to be displayed when the user breaks the running of kernel in GDB. | ||
19 | 2. Because of a hardware bug in Blackfin 533 v1.0.3: | ||
20 | 05000067 - Watchpoints (Hardware Breakpoints) are not supported | ||
21 | Hardware breakpoints cannot be set properly. | ||
22 | |||
23 | |||
24 | Debug over Ethernet: | ||
25 | |||
26 | 1. Compile and install the cross platform version of gdb for blackfin, which | ||
27 | can be found at $(BINROOT)/bfin-elf-gdb. | ||
28 | |||
29 | 2. Apply this patch to the 2.6.x kernel. Select the menuconfig option under | ||
30 | "Kernel hacking" -> "Kernel debugging" -> "KGDB: kernel debug with remote gdb". | ||
31 | With this selected, option "Full Symbolic/Source Debugging support" and | ||
32 | "Compile the kernel with frame pointers" are also selected. | ||
33 | |||
34 | 3. Select option "KGDB: connect over (Ethernet)". Add "kgdboe=@target-IP/,@host-IP/" to | ||
35 | the option "Compiled-in Kernel Boot Parameter" under "Kernel hacking". | ||
36 | |||
37 | 4. Connect minicom to the serial port and boot the kernel image. | ||
38 | |||
39 | 5. Configure the IP "/> ifconfig eth0 target-IP" | ||
40 | |||
41 | 6. Start GDB client "bfin-elf-gdb vmlinux". | ||
42 | |||
43 | 7. Connect to the target "(gdb) target remote udp:target-IP:6443". | ||
44 | |||
45 | 8. Set software breakpoint "(gdb) break sys_open". | ||
46 | |||
47 | 9. Continue "(gdb) c". | ||
48 | |||
49 | 10. Run ls in the target console "/> ls". | ||
50 | |||
51 | 11. Breakpoint hits. "Breakpoint 1: sys_open(..." | ||
52 | |||
53 | 12. Display local variables and function paramters. | ||
54 | (*) This operation gives wrong results, see known issue 1. | ||
55 | |||
56 | 13. Single stepping "(gdb) si". | ||
57 | |||
58 | 14. Remove breakpoint 1. "(gdb) del 1" | ||
59 | |||
60 | 15. Set hardware breakpoint "(gdb) hbreak sys_open". | ||
61 | |||
62 | 16. Continue "(gdb) c". | ||
63 | |||
64 | 17. Run ls in the target console "/> ls". | ||
65 | |||
66 | 18. Hardware breakpoint hits. "Breakpoint 1: sys_open(...". | ||
67 | (*) This hardware breakpoint will not be hit, see known issue 2. | ||
68 | |||
69 | 19. Continue "(gdb) c". | ||
70 | |||
71 | 20. Interrupt the target in GDB "Ctrl+C". | ||
72 | |||
73 | 21. Detach from the target "(gdb) detach". | ||
74 | |||
75 | 22. Exit GDB "(gdb) quit". | ||
76 | |||
77 | |||
78 | Debug over the UART: | ||
79 | |||
80 | 1. Compile and install the cross platform version of gdb for blackfin, which | ||
81 | can be found at $(BINROOT)/bfin-elf-gdb. | ||
82 | |||
83 | 2. Apply this patch to the 2.6.x kernel. Select the menuconfig option under | ||
84 | "Kernel hacking" -> "Kernel debugging" -> "KGDB: kernel debug with remote gdb". | ||
85 | With this selected, option "Full Symbolic/Source Debugging support" and | ||
86 | "Compile the kernel with frame pointers" are also selected. | ||
87 | |||
88 | 3. Select option "KGDB: connect over (UART)". Set "KGDB: UART port number" to be | ||
89 | a different one from the console. Don't forget to change the mode of | ||
90 | blackfin serial driver to PIO. Otherwise kgdb works incorrectly on UART. | ||
91 | |||
92 | 4. If you want connect to kgdb when the kernel boots, enable | ||
93 | "KGDB: Wait for gdb connection early" | ||
94 | |||
95 | 5. Compile kernel. | ||
96 | |||
97 | 6. Connect minicom to the serial port of the console and boot the kernel image. | ||
98 | |||
99 | 7. Start GDB client "bfin-elf-gdb vmlinux". | ||
100 | |||
101 | 8. Set the baud rate in GDB "(gdb) set remotebaud 57600". | ||
102 | |||
103 | 9. Connect to the target on the second serial port "(gdb) target remote /dev/ttyS1". | ||
104 | |||
105 | 10. Set software breakpoint "(gdb) break sys_open". | ||
106 | |||
107 | 11. Continue "(gdb) c". | ||
108 | |||
109 | 12. Run ls in the target console "/> ls". | ||
110 | |||
111 | 13. A breakpoint is hit. "Breakpoint 1: sys_open(..." | ||
112 | |||
113 | 14. All other operations are the same as that in KGDB over Ethernet. | ||
114 | |||
115 | |||
116 | Debug over the same UART as console: | ||
117 | |||
118 | 1. Compile and install the cross platform version of gdb for blackfin, which | ||
119 | can be found at $(BINROOT)/bfin-elf-gdb. | ||
120 | |||
121 | 2. Apply this patch to the 2.6.x kernel. Select the menuconfig option under | ||
122 | "Kernel hacking" -> "Kernel debugging" -> "KGDB: kernel debug with remote gdb". | ||
123 | With this selected, option "Full Symbolic/Source Debugging support" and | ||
124 | "Compile the kernel with frame pointers" are also selected. | ||
125 | |||
126 | 3. Select option "KGDB: connect over UART". Set "KGDB: UART port number" to console. | ||
127 | Don't forget to change the mode of blackfin serial driver to PIO. | ||
128 | Otherwise kgdb works incorrectly on UART. | ||
129 | |||
130 | 4. If you want connect to kgdb when the kernel boots, enable | ||
131 | "KGDB: Wait for gdb connection early" | ||
132 | |||
133 | 5. Connect minicom to the serial port and boot the kernel image. | ||
134 | |||
135 | 6. (Optional) Ask target to wait for gdb connection by entering Ctrl+A. In minicom, you should enter Ctrl+A+A. | ||
136 | |||
137 | 7. Start GDB client "bfin-elf-gdb vmlinux". | ||
138 | |||
139 | 8. Set the baud rate in GDB "(gdb) set remotebaud 57600". | ||
140 | |||
141 | 9. Connect to the target "(gdb) target remote /dev/ttyS0". | ||
142 | |||
143 | 10. Set software breakpoint "(gdb) break sys_open". | ||
144 | |||
145 | 11. Continue "(gdb) c". Then enter Ctrl+C twice to stop GDB connection. | ||
146 | |||
147 | 12. Run ls in the target console "/> ls". Dummy string can be seen on the console. | ||
148 | |||
149 | 13. Then connect the gdb to target again. "(gdb) target remote /dev/ttyS0". | ||
150 | Now you will find a breakpoint is hit. "Breakpoint 1: sys_open(..." | ||
151 | |||
152 | 14. All other operations are the same as that in KGDB over Ethernet. The only | ||
153 | difference is that after continue command in GDB, please stop GDB | ||
154 | connection by 2 "Ctrl+C"s and connect again after breakpoints are hit or | ||
155 | Ctrl+A is entered. | ||
diff --git a/Documentation/cdrom/00-INDEX b/Documentation/cdrom/00-INDEX index 916dafe29d3f..433edf23dc49 100644 --- a/Documentation/cdrom/00-INDEX +++ b/Documentation/cdrom/00-INDEX | |||
@@ -2,32 +2,10 @@ | |||
2 | - this file (info on CD-ROMs and Linux) | 2 | - this file (info on CD-ROMs and Linux) |
3 | Makefile | 3 | Makefile |
4 | - only used to generate TeX output from the documentation. | 4 | - only used to generate TeX output from the documentation. |
5 | aztcd | ||
6 | - info on Aztech/Orchid/Okano/Wearnes/Conrad/CyCDROM driver. | ||
7 | cdrom-standard.tex | 5 | cdrom-standard.tex |
8 | - LaTeX document on standardizing the CD-ROM programming interface. | 6 | - LaTeX document on standardizing the CD-ROM programming interface. |
9 | cdu31a | ||
10 | - info on the Sony CDU31A/CDU33A CD-ROM driver. | ||
11 | cm206 | ||
12 | - info on the Philips/LMS cm206/cm260 CD-ROM driver. | ||
13 | gscd | ||
14 | - info on the Goldstar R420 CD-ROM driver. | ||
15 | ide-cd | 7 | ide-cd |
16 | - info on setting up and using ATAPI (aka IDE) CD-ROMs. | 8 | - info on setting up and using ATAPI (aka IDE) CD-ROMs. |
17 | isp16 | ||
18 | - info on the CD-ROM interface on ISP16, MAD16 or Mozart sound card. | ||
19 | mcd | ||
20 | - info on limitations of standard Mitsumi CD-ROM driver. | ||
21 | mcdx | ||
22 | - info on improved Mitsumi CD-ROM driver. | ||
23 | optcd | ||
24 | - info on the Optics Storage 8000 AT CD-ROM driver | ||
25 | packet-writing.txt | 9 | packet-writing.txt |
26 | - Info on the CDRW packet writing module | 10 | - Info on the CDRW packet writing module |
27 | sbpcd | ||
28 | - info on the SoundBlaster/Panasonic CD-ROM interface driver. | ||
29 | sjcd | ||
30 | - info on the SANYO CDR-H94A CD-ROM interface driver. | ||
31 | sonycd535 | ||
32 | - info on the Sony CDU-535 (and 531) CD-ROM driver. | ||
33 | 11 | ||
diff --git a/Documentation/cdrom/aztcd b/Documentation/cdrom/aztcd deleted file mode 100644 index 6bf0290ef7ce..000000000000 --- a/Documentation/cdrom/aztcd +++ /dev/null | |||
@@ -1,822 +0,0 @@ | |||
1 | $Id: README.aztcd,v 2.60 1997/11/29 09:51:25 root Exp root $ | ||
2 | Readme-File Documentation/cdrom/aztcd | ||
3 | for | ||
4 | AZTECH CD-ROM CDA268-01A, ORCHID CD-3110, | ||
5 | OKANO/WEARNES CDD110, CONRAD TXC, CyCDROM CR520, CR540 | ||
6 | CD-ROM Drives | ||
7 | Version 2.6 and newer | ||
8 | (for other drives see 6.-8.) | ||
9 | |||
10 | NOTE: THIS DRIVER WILL WORK WITH THE CD-ROM DRIVES LISTED, WHICH HAVE | ||
11 | A PROPRIETARY INTERFACE (implemented on a sound card or on an | ||
12 | ISA-AT-bus card). | ||
13 | IT WILL DEFINITELY NOT WORK WITH CD-ROM DRIVES WITH *IDE*-INTERFACE, | ||
14 | such as the Aztech CDA269-031SE !!! (The only known exceptions are | ||
15 | 'faked' IDE drives like the CyCDROM CR520ie which work with aztcd | ||
16 | under certain conditions, see 7.). IF YOU'RE USING A CD-ROM DRIVE | ||
17 | WITH IDE-INTERFACE, SOMETIMES ALSO CALLED ATAPI-COMPATIBLE, PLEASE | ||
18 | USE THE ide-cd.c DRIVER, WRITTEN BY MARK LORD AND SCOTT SNYDER ! | ||
19 | THE STANDARD-KERNEL 1.2.x NOW ALSO SUPPORTS IDE-CDROM-DRIVES, SEE THE | ||
20 | HARDDISK (!) SECTION OF make config, WHEN COMPILING A NEW KERNEL!!! | ||
21 | ---------------------------------------------------------------------------- | ||
22 | |||
23 | Contents of this file: | ||
24 | 1. NOTE | ||
25 | 2. INSTALLATION | ||
26 | 3. CONFIGURING YOUR KERNEL | ||
27 | 4. RECOMPILING YOUR KERNEL | ||
28 | 4.1 AZTCD AS A RUN-TIME LOADABLE MODULE | ||
29 | 4.2 CDROM CONNECTED TO A SOUNDCARD | ||
30 | 5. KNOWN PROBLEMS, FUTURE DEVELOPMENTS | ||
31 | 5.1 MULTISESSION SUPPORT | ||
32 | 5.2 STATUS RECOGNITION | ||
33 | 5.3 DOSEMU's CDROM SUPPORT | ||
34 | 6. BUG REPORTS | ||
35 | 7. OTHER DRIVES | ||
36 | 8. IF YOU DON'T SUCCEED ... DEBUGGING | ||
37 | 9. TECHNICAL HISTORY OF THE DRIVER | ||
38 | 10. ACKNOWLEDGMENTS | ||
39 | 11. PROGRAMMING ADD ONS: CDPLAY.C | ||
40 | APPENDIX: Source code of cdplay.c | ||
41 | ---------------------------------------------------------------------------- | ||
42 | |||
43 | 1. NOTE | ||
44 | This software has been successfully in alpha and beta test and is part of | ||
45 | the standard kernel since kernel 1.1.8x since December 1994. It works with | ||
46 | AZTECH CDA268-01A, ORCHID CDS-3110, ORCHID/WEARNES CDD110 and CONRAD TXC | ||
47 | (Nr.99 31 23 -series 04) and has proven to be stable with kernel | ||
48 | versions 1.0.9 and newer. But with any software there still may be bugs in it. | ||
49 | So if you encounter problems, you are invited to help us improve this software. | ||
50 | Please send me a detailed bug report (see chapter BUG REPORTS). You are also | ||
51 | invited in helping us to increase the number of drives, which are supported. | ||
52 | |||
53 | Please read the README-files carefully and always keep a backup copy of your | ||
54 | old kernel, in order to reboot if something goes wrong! | ||
55 | |||
56 | 2. INSTALLATION | ||
57 | The driver consists of a header file 'aztcd.h', which normally should reside | ||
58 | in /usr/src/linux/drivers/cdrom and the source code 'aztcd.c', which normally | ||
59 | resides in the same place. It uses /dev/aztcd (/dev/aztcd0 in some distri- | ||
60 | butions), which must be a valid block device with major number 29 and reside | ||
61 | in directory /dev. To mount a CD-ROM, your kernel needs to have the ISO9660- | ||
62 | filesystem support included. | ||
63 | |||
64 | PLEASE NOTE: aztcd.c has been developed in parallel to the linux kernel, | ||
65 | which had and is having many major and minor changes which are not backward | ||
66 | compatible. Quite definitely aztcd.c version 1.80 and newer will NOT work | ||
67 | in kernels older than 1.3.33. So please always use the most recent version | ||
68 | of aztcd.c with the appropriate linux-kernel. | ||
69 | |||
70 | 3. CONFIGURING YOUR KERNEL | ||
71 | If your kernel is already configured for using the AZTECH driver you will | ||
72 | see the following message while Linux boots: | ||
73 | Aztech CD-ROM Init: DriverVersion=<version number> BaseAddress=<baseaddress> | ||
74 | Aztech CD-ROM Init: FirmwareVersion=<firmware version id of your I/O-card>>> | ||
75 | Aztech CD-ROM Init: <drive type> detected | ||
76 | Aztech CD-ROM Init: End | ||
77 | If the message looks different and you are sure to have a supported drive, | ||
78 | it may have a different base address. The Aztech driver does look for the | ||
79 | CD-ROM drive at the base address specified in aztcd.h at compile time. This | ||
80 | address can be overwritten by boot parameter aztcd=....You should reboot and | ||
81 | start Linux with boot parameter aztcd=<base address>, e.g. aztcd=0x320. If | ||
82 | you do not know the base address, start your PC with DOS and look at the boot | ||
83 | message of your CD-ROM's DOS driver. If that still does not help, use boot | ||
84 | parameter aztcd=<base address>,0x79 , this tells aztcd to try a little harder. | ||
85 | aztcd may be configured to use autoprobing the base address by recompiling | ||
86 | it (see chapter 4.). | ||
87 | |||
88 | If the message looks correct, as user 'root' you should be able to mount the | ||
89 | drive by | ||
90 | mount -t iso9660 -r /dev/aztcd0 /mnt | ||
91 | and use it as any other filesystem. (If this does not work, check if | ||
92 | /dev/aztcd0 and /mnt do exist and create them, if necessary by doing | ||
93 | mknod /dev/aztcd0 b 29 0 | ||
94 | mkdir /mnt | ||
95 | |||
96 | If you still get a different message while Linux boots or when you get the | ||
97 | message, that the ISO9660-filesystem is not supported by your kernel, when | ||
98 | you try to mount the CD-ROM drive, you have to recompile your kernel. | ||
99 | |||
100 | If you do *not* have an Aztech/Orchid/Okano/Wearnes/TXC drive and want to | ||
101 | bypass drive detection during Linux boot up, start with boot parameter aztcd=0. | ||
102 | |||
103 | Most distributions nowadays do contain a boot disk image containing aztcd. | ||
104 | Please note, that this driver will not work with IDE/ATAPI drives! With these | ||
105 | you must use ide-cd.c instead. | ||
106 | |||
107 | 4. RECOMPILING YOUR KERNEL | ||
108 | If your kernel is not yet configured for the AZTECH driver and the ISO9660- | ||
109 | filesystem, you have to recompile your kernel: | ||
110 | |||
111 | - Edit aztcd.h to set the I/O-address to your I/O-Base address (AZT_BASE_ADDR), | ||
112 | the driver does not use interrupts or DMA, so if you are using an AZTECH | ||
113 | CD268, an ORCHID CD-3110 or ORCHID/WEARNES CDD110 that's the only item you | ||
114 | have to set up. If you have a soundcard, read chapter 4.2. | ||
115 | Users of other drives should read chapter OTHER DRIVES of this file. | ||
116 | You also can configure that address by kernel boot parameter aztcd=... | ||
117 | - aztcd may be configured to use autoprobing the base address by setting | ||
118 | AZT_BASE_ADDR to '-1'. In that case aztcd probes the addresses listed | ||
119 | under AZT_BASE_AUTO. But please remember, that autoprobing always may | ||
120 | incorrectly influence other hardware components too! | ||
121 | - There are some other points, which may be configured, e.g. auto-eject the | ||
122 | CD when unmounting a drive, tray locking etc., see aztcd.h for details. | ||
123 | - If you're using a linux kernel version prior to 2.1.0, in aztcd.h | ||
124 | uncomment the line '#define AZT_KERNEL_PRIOR_2_1' | ||
125 | - Build a new kernel, configure it for 'Aztech/Orchid/Okano/Wearnes support' | ||
126 | (if you want aztcd to be part of the kernel). Do not configure it for | ||
127 | 'Aztech... support', if you want to use aztcd as a run time loadable module. | ||
128 | But in any case you must have the ISO9660-filesystem included in your | ||
129 | kernel. | ||
130 | - Activate the new kernel, normally this is done by running LILO (don't for- | ||
131 | get to configure it before and to keep a copy of your old kernel in case | ||
132 | something goes wrong!). | ||
133 | - Reboot | ||
134 | - If you've included aztcd in your kernel, you now should see during boot | ||
135 | some messages like | ||
136 | Aztech CD-ROM Init: DriverVersion=<version number> BaseAddress=<baseaddress> | ||
137 | Aztech CD-ROM Init: FirmwareVersion=<firmware version id of your I/O-card> | ||
138 | Aztech CD-ROM Init: <drive type> detected | ||
139 | Aztech CD-ROM Init: End | ||
140 | - If you have not included aztcd in your kernel, but want to load aztcd as a | ||
141 | run time loadable module see 4.1. | ||
142 | - If the message looks correct, as user 'root' you should be able to mount | ||
143 | the drive by | ||
144 | mount -t iso9660 -r /dev/aztcd0 /mnt | ||
145 | and use it as any other filesystem. (If this does not work, check if | ||
146 | /dev/aztcd0 and /mnt do exist and create them, if necessary by doing | ||
147 | mknod /dev/aztcd0 b 29 0 | ||
148 | mkdir /mnt | ||
149 | - If this still does not help, see chapters OTHER DRIVES and DEBUGGING. | ||
150 | |||
151 | 4.1 AZTCD AS A RUN-TIME LOADABLE MODULE | ||
152 | If you do not need aztcd permanently, you can also load and remove the driver | ||
153 | during runtime via insmod and rmmod. To build aztcd as a loadable module you | ||
154 | must configure your kernel for AZTECH module support (answer 'm' when con- | ||
155 | figuring the kernel). Anyhow, you may run into problems, if the version of | ||
156 | your boot kernel is not the same than the source kernel version, from which | ||
157 | you create the modules. So rebuild your kernel, if necessary. | ||
158 | |||
159 | Now edit the base address of your AZTECH interface card in | ||
160 | /usr/src/linux/drivers/cdrom/aztcd.h to the appropriate value. | ||
161 | aztcd may be configured to use autoprobing the base address by setting | ||
162 | AZT_BASE_ADDR to '-1'. In that case aztcd probes the addresses listed | ||
163 | under AZT_BASE_AUTO. But please remember, that autoprobing always may | ||
164 | incorrectly influence other hardware components too! | ||
165 | There are also some special features which may be configured, e.g. | ||
166 | auto-eject a CD when unmounting the drive etc; see aztcd.h for details. | ||
167 | Then change to /usr/src/linux and do a | ||
168 | make modules | ||
169 | make modules_install | ||
170 | After that you can run-time load the driver via | ||
171 | insmod /lib/modules/X.X.X/misc/aztcd.o | ||
172 | and remove it via rmmod aztcd. | ||
173 | If you did not set the correct base address in aztcd.h, you can also supply the | ||
174 | base address when loading the driver via | ||
175 | insmod /lib/modules/X.X.X/misc/aztcd.o aztcd=<base address> | ||
176 | Again specifying aztcd=-1 will cause autoprobing. | ||
177 | If you do not have the iso9660-filesystem in your boot kernel, you also have | ||
178 | to load it before you can mount the CDROM: | ||
179 | insmod /lib/modules/X.X.X/fs/isofs.o | ||
180 | The mount procedure works as described in 4. above. | ||
181 | (In all commands 'X.X.X' is the current linux kernel version number) | ||
182 | |||
183 | 4.2 CDROM CONNECTED TO A SOUNDCARD | ||
184 | Most soundcards do have a bus interface to the CDROM-drive. In many cases | ||
185 | this soundcard needs to be configured, before the CDROM can be used. This | ||
186 | configuration procedure consists of writing some kind of initialization | ||
187 | data to the soundcard registers. The AZTECH-CDROM driver in the moment does | ||
188 | only support one type of soundcard (SoundWave32). Users of other soundcards | ||
189 | should try to boot DOS first and let their DOS drivers initialize the | ||
190 | soundcard and CDROM, then warm boot (or use loadlin) their PC to start | ||
191 | Linux. | ||
192 | Support for the CDROM-interface of SoundWave32-soundcards is directly | ||
193 | implemented in the AZTECH driver. Please edit linux/drivers/cdrom/aztdc.h, | ||
194 | uncomment line '#define AZT_SW32' and set the appropriate value for | ||
195 | AZT_BASE_ADDR and AZT_SW32_BASE_ADDR. This support was tested with an Orchid | ||
196 | CDS-3110 connected to a SoundWave32. | ||
197 | If you want your soundcard to be supported, find out, how it needs to be | ||
198 | configured and mail me (see 6.) the appropriate information. | ||
199 | |||
200 | 5. KNOWN PROBLEMS, FUTURE DEVELOPMENTS | ||
201 | 5.1 MULTISESSION SUPPORT | ||
202 | Multisession support for CD's still is a myth. I implemented and tested a basic | ||
203 | support for multisession and XA CDs, but I still have not enough CDs and appli- | ||
204 | cations to test it rigorously. So if you'd like to help me, please contact me | ||
205 | (Email address see below). As of version 1.4 and newer you can enable the | ||
206 | multisession support in aztcd.h by setting AZT_MULTISESSION to 1. Doing so | ||
207 | will cause the ISO9660-filesystem to deal with multisession CDs, ie. redirect | ||
208 | requests to the Table of Contents (TOC) information from the last session, | ||
209 | which contains the info of all previous sessions etc.. If you do set | ||
210 | AZT_MULTISESSION to 0, you can use multisession CDs anyway. In that case the | ||
211 | drive's firmware will do automatic redirection. For the ISO9660-filesystem any | ||
212 | multisession CD will then look like a 'normal' single session CD. But never- | ||
213 | theless the data of all sessions are viewable and accessible. So with practical- | ||
214 | ly all real world applications you won't notice the difference. But as future | ||
215 | applications may make use of advanced multisession features, I've started to | ||
216 | implement the interface for the ISO9660 multisession interface via ioctl | ||
217 | CDROMMULTISESSION. | ||
218 | |||
219 | 5.2 STATUS RECOGNITION | ||
220 | The drive status recognition does not work correctly in all cases. Changing | ||
221 | a disk or having the door open, when a drive is already mounted, is detected | ||
222 | by the Aztech driver itself, but nevertheless causes multiple read attempts | ||
223 | by the different layers of the ISO9660-filesystem driver, which finally timeout, | ||
224 | so you have to wait quite a little... But isn't it bad style to change a disk | ||
225 | in a mounted drive, anyhow ?! | ||
226 | |||
227 | The driver uses busy wait in most cases for the drive handshake (macros | ||
228 | STEN_LOW and DTEN_LOW). I tested with a 486/DX2 at 66MHz and a Pentium at | ||
229 | 60MHz and 90MHz. Whenever you use a much faster machine you are likely to get | ||
230 | timeout messages. In that case edit aztcd.h and increase the timeout value | ||
231 | AZT_TIMEOUT. | ||
232 | |||
233 | For some 'slow' drive commands I implemented waiting with a timer waitqueue | ||
234 | (macro STEN_LOW_WAIT). If you get this timeout message, you may also edit | ||
235 | aztcd.h and increase the timeout value AZT_STATUS_DELAY. The waitqueue has | ||
236 | shown to be a little critical. If you get kernel panic messages, edit aztcd.c | ||
237 | and substitute STEN_LOW_WAIT by STEN_LOW. Busy waiting with STEN_LOW is more | ||
238 | stable, but also causes CPU overhead. | ||
239 | |||
240 | 5.3 DOSEMU's CD-ROM SUPPORT | ||
241 | With release 1.20 aztcd was modified to allow access to CD-ROMS when running | ||
242 | under dosemu-0.60.0 aztcd-versions before 1.20 are most likely to crash | ||
243 | Linux, when a CD-ROM is accessed under dosemu. This problem has partly been | ||
244 | fixed, but still when accessing a directory for the first time the system | ||
245 | might hang for some 30sec. So be patient, when using dosemu's CD-ROM support | ||
246 | in combination with aztcd :-) ! | ||
247 | This problem has now (July 1995) been fixed by a modification to dosemu's | ||
248 | CD-ROM driver. The new version came with dosemu-0.60.2, see dosemu's | ||
249 | README.CDROM. | ||
250 | |||
251 | 6. BUG REPORTS | ||
252 | Please send detailed bug reports and bug fixes via EMail to | ||
253 | |||
254 | Werner.Zimmermann@fht-esslingen.de | ||
255 | |||
256 | Please include a description of your CD-ROM drive type and interface card, | ||
257 | the exact firmware message during Linux bootup, the version number of the | ||
258 | AZTECH-CDROM-driver and the Linux kernel version. Also a description of your | ||
259 | system's other hardware could be of interest, especially microprocessor type, | ||
260 | clock frequency, other interface cards such as soundcards, ethernet adapter, | ||
261 | game cards etc.. | ||
262 | |||
263 | I will try to collect the reports and make the necessary modifications from | ||
264 | time to time. I may also come back to you directly with some bug fixes and | ||
265 | ask you to do further testing and debugging. | ||
266 | |||
267 | Editors of CD-ROMs are invited to send a 'cooperation' copy of their | ||
268 | CD-ROMs to the volunteers, who provided the CD-ROM support for Linux. My | ||
269 | snail mail address for such 'stuff' is | ||
270 | Prof. Dr. W. Zimmermann | ||
271 | Fachhochschule fuer Technik Esslingen | ||
272 | Fachbereich IT | ||
273 | Flandernstrasse 101 | ||
274 | D-73732 Esslingen | ||
275 | Germany | ||
276 | |||
277 | |||
278 | 7. OTHER DRIVES | ||
279 | The following drives ORCHID CDS3110, OKANO CDD110, WEARNES CDD110 and Conrad | ||
280 | TXC Nr. 993123-series 04 nearly look the same as AZTECH CDA268-01A, especially | ||
281 | they seem to use the same command codes. So it was quite simple to make the | ||
282 | AZTECH driver work with these drives. | ||
283 | |||
284 | Unfortunately I do not have any of these drives available, so I couldn't test | ||
285 | it myself. In some installations, it seems necessary to initialize the drive | ||
286 | with the DOS driver before (especially if combined with a sound card) and then | ||
287 | do a warm boot (CTRL-ALT-RESET) or start Linux from DOS, e.g. with 'loadlin'. | ||
288 | |||
289 | If you do not succeed, read chapter DEBUGGING. Thanks in advance! | ||
290 | |||
291 | Sorry for the inconvenience, but it is difficult to develop for hardware, | ||
292 | which you don't have available for testing. So if you like, please help us. | ||
293 | |||
294 | If you do have a CyCDROM CR520ie thanks to Hilmar Berger's help your chances | ||
295 | are good, that it will work with aztcd. The CR520ie is sold as an IDE-drive | ||
296 | and really is connected to the IDE interface (primary at 0x1F0 or secondary | ||
297 | at 0x170, configured as slave, not as master). Nevertheless it is not ATAPI | ||
298 | compatible but still uses Aztech's command codes. | ||
299 | |||
300 | |||
301 | 8. DEBUGGING : IF YOU DON'T SUCCEED, TRY THE FOLLOWING | ||
302 | -reread the complete README file | ||
303 | -make sure, that your drive is hardware configured for | ||
304 | transfer mode: polled | ||
305 | IRQ: not used | ||
306 | DMA: not used | ||
307 | Base Address: something like 300, 320 ... | ||
308 | You can check this, when you start the DOS driver, which came with your | ||
309 | drive. By appropriately configuring the drive and the DOS driver you can | ||
310 | check, whether your drive does operate in this mode correctly under DOS. If | ||
311 | it does not operate under DOS, it won't under Linux. | ||
312 | If your drive's base address is something like 0x170 or 0x1F0 (and it is | ||
313 | not a CyCDROM CR520ie or CR 940ie) you most likely are having an IDE/ATAPI- | ||
314 | compatible drive, which is not supported by aztcd.c, use ide-cd.c instead. | ||
315 | Make sure the Base Address is configured correctly in aztcd.h, also make | ||
316 | sure, that /dev/aztcd0 exists with the correct major number (compare it with | ||
317 | the entry in file /usr/include/linux/major.h for the Aztech drive). | ||
318 | -insert a CD-ROM and close the tray | ||
319 | -cold boot your PC (i.e. via the power on switch or the reset button) | ||
320 | -if you start Linux via DOS, e.g. using loadlin, make sure, that the DOS | ||
321 | driver for the CD-ROM drive is not loaded (comment out the calling lines | ||
322 | in DOS' config.sys!) | ||
323 | -look for the aztcd: init message during Linux init and note them exactly | ||
324 | -log in as root and do a mount -t iso9660 /dev/aztcd0 /mnt | ||
325 | -if you don't succeed in the first time, try several times. Try also to open | ||
326 | and close the tray, then mount again. Please note carefully all commands | ||
327 | you typed in and the aztcd-messages, which you get. | ||
328 | -if you get an 'Aztech CD-ROM init: aborted' message, read the remarks about | ||
329 | the version string below. | ||
330 | |||
331 | If this does not help, do the same with the following differences | ||
332 | -start DOS before; make now sure, that the DOS driver for the CD-ROM is | ||
333 | loaded under DOS (i.e. uncomment it again in config.sys) | ||
334 | -warm boot your PC (i.e. via CTRL-ALT-DEL) | ||
335 | if you have it, you can also start via loadlin (try both). | ||
336 | ... | ||
337 | Again note all commands and the aztcd-messages. | ||
338 | |||
339 | If you see STEN_LOW or STEN_LOW_WAIT error messages, increase the timeout | ||
340 | values. | ||
341 | |||
342 | If this still does not help, | ||
343 | -look in aztcd.c for the lines #if 0 | ||
344 | #define AZT_TEST1 | ||
345 | ... | ||
346 | #endif | ||
347 | and substitute '#if 0' by '#if 1'. | ||
348 | -recompile your kernel and repeat the above two procedures. You will now get | ||
349 | a bundle of debugging messages from the driver. Again note your commands | ||
350 | and the appropriate messages. If you have syslogd running, these messages | ||
351 | may also be found in syslogd's kernel log file. Nevertheless in some | ||
352 | installations syslogd does not yet run, when init() is called, thus look for | ||
353 | the aztcd-messages during init, before the login-prompt appears. | ||
354 | Then look in aztcd.c, to find out, what happened. The normal calling sequence | ||
355 | is: aztcd_init() during Linux bootup procedure init() | ||
356 | after doing a 'mount -t iso9660 /dev/aztcd0 /mnt' the normal calling sequence is | ||
357 | aztcd_open() -> Status 2c after cold reboot with CDROM or audio CD inserted | ||
358 | -> Status 8 after warm reboot with CDROM inserted | ||
359 | -> Status 2e after cold reboot with no disk, closed tray | ||
360 | -> Status 6e after cold reboot, mount with door open | ||
361 | aztUpdateToc() | ||
362 | aztGetDiskInfo() | ||
363 | aztGetQChannelInfo() repeated several times | ||
364 | aztGetToc() | ||
365 | aztGetQChannelInfo() repeated several times | ||
366 | a list of track information | ||
367 | do_aztcd_request() } | ||
368 | azt_transfer() } repeated several times | ||
369 | azt_poll } | ||
370 | Check, if there is a difference in the calling sequence or the status flags! | ||
371 | |||
372 | There are a lot of other messages, eg. the ACMD-command code (defined in | ||
373 | aztcd.h), status info from the getAztStatus-command and the state sequence of | ||
374 | the finite state machine in azt_poll(). The most important are the status | ||
375 | messages, look how they are defined and try to understand, if they make | ||
376 | sense in the context where they appear. With a CD-ROM inserted the status | ||
377 | should always be 8, except in aztcd_open(). Try to open the tray, insert an | ||
378 | audio disk, insert no disk or reinsert the CD-ROM and check, if the status | ||
379 | bits change accordingly. The status bits are the most likely point, where | ||
380 | the drive manufacturers may implement changes. | ||
381 | |||
382 | If you still don't succeed, a good point to start is to look in aztcd.c in | ||
383 | function aztcd_init, where the drive should be detected during init. Do the | ||
384 | following: | ||
385 | -reboot the system with boot parameter 'aztcd=<your base address>,0x79'. With | ||
386 | parameter 0x79 most of the drive version detection is bypassed. After that | ||
387 | you should see the complete version string including leading and trailing | ||
388 | blanks during init. | ||
389 | Now adapt the statement | ||
390 | if ((result[1]=='A')&&(result[2]=='Z' ...) | ||
391 | in aztcd_init() to exactly match the first 3 or 4 letters you have seen. | ||
392 | -Another point is the 'smart' card detection feature in aztcd_init(). Normally | ||
393 | the CD-ROM drive is ready, when aztcd_init is trying to read the version | ||
394 | string and a time consuming ACMD_SOFT_RESET command can be avoided. This is | ||
395 | detected by looking, if AFL_OP_OK can be read correctly. If the CD-ROM drive | ||
396 | hangs in some unknown state, e.g. because of an error before a warm start or | ||
397 | because you first operated under DOS, even the version string may be correct, | ||
398 | but the following commands will not. Then change the code in such a way, | ||
399 | that the ACMD_SOFT_RESET is issued in any case, by substituting the | ||
400 | if-statement 'if ( ...=AFL_OP_OK)' by 'if (1)'. | ||
401 | |||
402 | If you succeed, please mail me the exact version string of your drive and | ||
403 | the code modifications, you have made together with a short explanation. | ||
404 | If you don't succeed, you may mail me the output of the debugging messages. | ||
405 | But remember, they are only useful, if they are exact and complete and you | ||
406 | describe in detail your hardware setup and what you did (cold/warm reboot, | ||
407 | with/without DOS, DOS-driver started/not started, which Linux-commands etc.) | ||
408 | |||
409 | |||
410 | 9. TECHNICAL HISTORY OF THE DRIVER | ||
411 | The AZTECH-Driver is a rework of the Mitsumi-Driver. Four major items had to | ||
412 | be reworked: | ||
413 | |||
414 | a) The Mitsumi drive does issue complete status information acknowledging | ||
415 | each command, the Aztech drive does only signal that the command was | ||
416 | processed. So whenever the complete status information is needed, an extra | ||
417 | ACMD_GET_STATUS command is issued. The handshake procedure for the drive | ||
418 | can be found in the functions aztSendCmd(), sendAztCmd() and getAztStatus(). | ||
419 | |||
420 | b) The Aztech Drive does not have a ACMD_GET_DISK_INFO command, so the | ||
421 | necessary info about the number of tracks (firstTrack, lastTrack), disk | ||
422 | length etc. has to be read from the TOC in the lead in track (see function | ||
423 | aztGetDiskInfo()). | ||
424 | |||
425 | c) Whenever data is read from the drive, the Mitsumi drive is started with a | ||
426 | command to read an indefinite (0xffffff) number of sectors. When the appropriate | ||
427 | number of sectors is read, the drive is stopped by a ACDM_STOP command. This | ||
428 | does not work with the Aztech drive. I did not find a way to stop it. The | ||
429 | stop and pause commands do only work in AUDIO mode but not in DATA mode. | ||
430 | Therefore I had to modify the 'finite state machine' in function azt_poll to | ||
431 | only read a certain number of sectors and then start a new read on demand. As I | ||
432 | have not completely understood, how the buffer/caching scheme of the Mitsumi | ||
433 | driver was implemented, I am not sure, if I have covered all cases correctly, | ||
434 | whenever you get timeout messages, the bug is most likely to be in that | ||
435 | function azt_poll() around switch(cmd) .... case ACD_S_DATA. | ||
436 | |||
437 | d) I did not get information about changing drive mode. So I doubt, that the | ||
438 | code around function azt_poll() case AZT_S_MODE does work. In my test I have | ||
439 | not been able to switch to reading in raw mode. For reading raw mode, Aztech | ||
440 | uses a different command than for cooked mode, which I only have implemen- | ||
441 | ted in the ioctl-section but not in the section which is used by the ISO9660. | ||
442 | |||
443 | The driver was developed on an AST PC with Intel 486/DX2, 8MB RAM, 340MB IDE | ||
444 | hard disk and on an AST PC with Intel Pentium 60MHz, 16MB RAM, 520MB IDE | ||
445 | running Linux kernel version 1.0.9 from the LST 1.8 Distribution. The kernel | ||
446 | was compiled with gcc.2.5.8. My CD-ROM drive is an Aztech CDA268-01A. My | ||
447 | drive says, that it has Firmware Version AZT26801A1.3. It came with an ISA-bus | ||
448 | interface card and works with polled I/O without DMA and without interrupts. | ||
449 | The code for all other drives was 'remote' tested and debugged by a number of | ||
450 | volunteers on the Internet. | ||
451 | |||
452 | Points, where I feel that possible problems might be and all points where I | ||
453 | did not completely understand the drive's behaviour or trust my own code are | ||
454 | marked with /*???*/ in the source code. There are also some parts in the | ||
455 | Mitsumi driver, where I did not completely understand their code. | ||
456 | |||
457 | |||
458 | 10. ACKNOWLEDGMENTS | ||
459 | Without the help of P.Bush, Aztech, who delivered technical information | ||
460 | about the Aztech Drive and without the help of E.Moenkeberg, GWDG, who did a | ||
461 | great job in analyzing the command structure of various CD-ROM drives, this | ||
462 | work would not have been possible. E.Moenkeberg was also a great help in | ||
463 | making the software 'kernel ready' and in answering many of the CDROM-related | ||
464 | questions in the newsgroups. He really is *the* Linux CD-ROM guru. Thanks | ||
465 | also to all the guys on the Internet, who collected valuable technical | ||
466 | information about CDROMs. | ||
467 | |||
468 | Joe Nardone (joe@access.digex.net) was a patient tester even for my first | ||
469 | trial, which was more than slow, and made suggestions for code improvement. | ||
470 | Especially the 'finite state machine' azt_poll() was rewritten by Joe to get | ||
471 | clean C code and avoid the ugly 'gotos', which I copied from mcd.c. | ||
472 | |||
473 | Robby Schirmer (schirmer@fmi.uni-passau.de) tested the audio stuff (ioctls) | ||
474 | and suggested a lot of patches for them. | ||
475 | |||
476 | Joseph Piskor and Peter Nugent were the first users with the ORCHID CD3110 | ||
477 | and also were very patient with the problems which occurred. | ||
478 | |||
479 | Reinhard Max delivered the information for the CDROM-interface of the | ||
480 | SoundWave32 soundcards. | ||
481 | |||
482 | Jochen Kunz and Olaf Kaluza delivered the information for supporting Conrad's | ||
483 | TXC drive. | ||
484 | |||
485 | Hilmar Berger delivered the patches for supporting CyCDROM CR520ie. | ||
486 | |||
487 | Anybody, who is interested in these items should have a look at 'ftp.gwdg.de', | ||
488 | directory 'pub/linux/cdrom' and at 'ftp.cdrom.com', directory 'pub/cdrom'. | ||
489 | |||
490 | 11. PROGRAMMING ADD ONs: cdplay.c | ||
491 | You can use the ioctl-functions included in aztcd.c in your own programs. As | ||
492 | an example on how to do this, you will find a tiny CD Player for audio CDs | ||
493 | named 'cdplay.c'. It allows you to play audio CDs. You can play a specified | ||
494 | track, pause and resume or skip tracks forward and backwards. If you quit the | ||
495 | program without stopping the drive, playing is continued. You can also | ||
496 | (mis)use cdplay to read and hexdump data disks. You can find the code in the | ||
497 | APPENDIX of this file, which you should cut out with an editor and store in a | ||
498 | separate file 'cdplay.c'. To compile it and make it executable, do | ||
499 | gcc -s -Wall -O2 -L/usr/lib cdplay.c -o /usr/local/bin/cdplay # compiles it | ||
500 | chmod +755 /usr/local/bin/cdplay # makes it executable | ||
501 | ln -s /dev/aztcd0 /dev/cdrom # creates a link | ||
502 | (for /usr/lib substitute the top level directory, where your include files | ||
503 | reside, and for /usr/local/bin the directory, where you want the executable | ||
504 | binary to reside ) | ||
505 | |||
506 | You have to set the correct permissions for cdplay *and* for /dev/mcd0 or | ||
507 | /dev/aztcd0 in order to use it. Remember, that you should not have /dev/cdrom | ||
508 | mounted, when you're playing audio CDs. | ||
509 | |||
510 | This program is just a hack for testing the ioctl-functions in aztcd.c. I will | ||
511 | not maintain it, so if you run into problems, discard it or have a look into | ||
512 | the source code 'cdplay.c'. The program does only contain a minimum of user | ||
513 | protection and input error detection. If you use the commands in the wrong | ||
514 | order or if you try to read a CD at wrong addresses, you may get error messages | ||
515 | or even hang your machine. If you get STEN_LOW, STEN_LOW_WAIT or segment violation | ||
516 | error messages when using cdplay, after that, the system might not be stable | ||
517 | any more, so you'd better reboot. As the ioctl-functions run in kernel mode, | ||
518 | most normal Linux-multitasking protection features do not work. By using | ||
519 | uninitialized 'wild' pointers etc., it is easy to write to other users' data | ||
520 | and program areas, destroy kernel tables etc.. So if you experiment with ioctls | ||
521 | as always when you are doing systems programming and kernel hacking, you | ||
522 | should have a backup copy of your system in a safe place (and you also | ||
523 | should try restoring from a backup copy first)! | ||
524 | |||
525 | A reworked and improved version called 'cdtester.c', which has yet more | ||
526 | features for testing CDROM-drives can be found in | ||
527 | Documentation/cdrom/sbpcd, written by E.Moenkeberg. | ||
528 | |||
529 | Werner Zimmermann | ||
530 | Fachhochschule fuer Technik Esslingen | ||
531 | (EMail: Werner.Zimmermann@fht-esslingen.de) | ||
532 | October, 1997 | ||
533 | |||
534 | --------------------------------------------------------------------------- | ||
535 | APPENDIX: Source code of cdplay.c | ||
536 | |||
537 | /* Tiny Audio CD Player | ||
538 | |||
539 | Copyright 1994, 1995, 1996 Werner Zimmermann (Werner.Zimmermann@fht-esslingen.de) | ||
540 | |||
541 | This program originally was written to test the audio functions of the | ||
542 | AZTECH.CDROM-driver, but it should work with every CD-ROM drive. Before | ||
543 | using it, you should set a symlink from /dev/cdrom to your real CDROM | ||
544 | device. | ||
545 | |||
546 | The GNU General Public License applies to this program. | ||
547 | |||
548 | History: V0.1 W.Zimmermann: First release. Nov. 8, 1994 | ||
549 | V0.2 W.Zimmermann: Enhanced functionality. Nov. 9, 1994 | ||
550 | V0.3 W.Zimmermann: Additional functions. Nov. 28, 1994 | ||
551 | V0.4 W.Zimmermann: fixed some bugs. Dec. 17, 1994 | ||
552 | V0.5 W.Zimmermann: clean 'scanf' commands without compiler warnings | ||
553 | Jan. 6, 1995 | ||
554 | V0.6 W.Zimmermann: volume control (still experimental). Jan. 24, 1995 | ||
555 | V0.7 W.Zimmermann: read raw modified. July 26, 95 | ||
556 | */ | ||
557 | |||
558 | #include <stdio.h> | ||
559 | #include <ctype.h> | ||
560 | #include <sys/ioctl.h> | ||
561 | #include <sys/types.h> | ||
562 | #include <fcntl.h> | ||
563 | #include <unistd.h> | ||
564 | #include <linux/cdrom.h> | ||
565 | #include <linux/../../drivers/cdrom/aztcd.h> | ||
566 | |||
567 | void help(void) | ||
568 | { printf("Available Commands: STOP s EJECT/CLOSE e QUIT q\n"); | ||
569 | printf(" PLAY TRACK t PAUSE p RESUME r\n"); | ||
570 | printf(" NEXT TRACK n REPEAT LAST l HELP h\n"); | ||
571 | printf(" SUB CHANNEL c TRACK INFO i PLAY AT a\n"); | ||
572 | printf(" READ d READ RAW w VOLUME v\n"); | ||
573 | } | ||
574 | |||
575 | int main(void) | ||
576 | { int handle; | ||
577 | unsigned char command=' ', ini=0, first=1, last=1; | ||
578 | unsigned int cmd, i,j,k, arg1,arg2,arg3; | ||
579 | struct cdrom_ti ti; | ||
580 | struct cdrom_tochdr tocHdr; | ||
581 | struct cdrom_subchnl subchnl; | ||
582 | struct cdrom_tocentry entry; | ||
583 | struct cdrom_msf msf; | ||
584 | union { struct cdrom_msf msf; | ||
585 | unsigned char buf[CD_FRAMESIZE_RAW]; | ||
586 | } azt; | ||
587 | struct cdrom_volctrl volctrl; | ||
588 | |||
589 | printf("\nMini-Audio CD-Player V0.72 (C) 1994,1995,1996 W.Zimmermann\n"); | ||
590 | handle=open("/dev/cdrom",O_RDWR); | ||
591 | ioctl(handle,CDROMRESUME); | ||
592 | |||
593 | if (handle<=0) | ||
594 | { printf("Drive Error: already playing, no audio disk, door open\n"); | ||
595 | printf(" or no permission (you must be ROOT in order to use this program)\n"); | ||
596 | } | ||
597 | else | ||
598 | { help(); | ||
599 | while (1) | ||
600 | { printf("Type command (h = help): "); | ||
601 | scanf("%s",&command); | ||
602 | switch (command) | ||
603 | { case 'e': cmd=CDROMEJECT; | ||
604 | ioctl(handle,cmd); | ||
605 | break; | ||
606 | case 'p': if (!ini) | ||
607 | { printf("Command not allowed - play track first\n"); | ||
608 | } | ||
609 | else | ||
610 | { cmd=CDROMPAUSE; | ||
611 | if (ioctl(handle,cmd)) printf("Drive Error\n"); | ||
612 | } | ||
613 | break; | ||
614 | case 'r': if (!ini) | ||
615 | { printf("Command not allowed - play track first\n"); | ||
616 | } | ||
617 | else | ||
618 | { cmd=CDROMRESUME; | ||
619 | if (ioctl(handle,cmd)) printf("Drive Error\n"); | ||
620 | } | ||
621 | break; | ||
622 | case 's': cmd=CDROMPAUSE; | ||
623 | if (ioctl(handle,cmd)) printf("Drive error or already stopped\n"); | ||
624 | cmd=CDROMSTOP; | ||
625 | if (ioctl(handle,cmd)) printf("Drive error\n"); | ||
626 | break; | ||
627 | case 't': cmd=CDROMREADTOCHDR; | ||
628 | if (ioctl(handle,cmd,&tocHdr)) printf("Drive Error\n"); | ||
629 | first=tocHdr.cdth_trk0; | ||
630 | last= tocHdr.cdth_trk1; | ||
631 | if ((first==0)||(first>last)) | ||
632 | { printf ("--could not read TOC\n"); | ||
633 | } | ||
634 | else | ||
635 | { printf("--first track: %d --last track: %d --enter track number: ",first,last); | ||
636 | cmd=CDROMPLAYTRKIND; | ||
637 | scanf("%i",&arg1); | ||
638 | ti.cdti_trk0=arg1; | ||
639 | if (ti.cdti_trk0<first) ti.cdti_trk0=first; | ||
640 | if (ti.cdti_trk0>last) ti.cdti_trk0=last; | ||
641 | ti.cdti_ind0=0; | ||
642 | ti.cdti_trk1=last; | ||
643 | ti.cdti_ind1=0; | ||
644 | if (ioctl(handle,cmd,&ti)) printf("Drive Error\n"); | ||
645 | ini=1; | ||
646 | } | ||
647 | break; | ||
648 | case 'n': if (!ini++) | ||
649 | { if (ioctl(handle,CDROMREADTOCHDR,&tocHdr)) printf("Drive Error\n"); | ||
650 | first=tocHdr.cdth_trk0; | ||
651 | last= tocHdr.cdth_trk1; | ||
652 | ti.cdti_trk0=first-1; | ||
653 | } | ||
654 | if ((first==0)||(first>last)) | ||
655 | { printf ("--could not read TOC\n"); | ||
656 | } | ||
657 | else | ||
658 | { cmd=CDROMPLAYTRKIND; | ||
659 | if (++ti.cdti_trk0 > last) ti.cdti_trk0=last; | ||
660 | ti.cdti_ind0=0; | ||
661 | ti.cdti_trk1=last; | ||
662 | ti.cdti_ind1=0; | ||
663 | if (ioctl(handle,cmd,&ti)) printf("Drive Error\n"); | ||
664 | ini=1; | ||
665 | } | ||
666 | break; | ||
667 | case 'l': if (!ini++) | ||
668 | { if (ioctl(handle,CDROMREADTOCHDR,&tocHdr)) printf("Drive Error\n"); | ||
669 | first=tocHdr.cdth_trk0; | ||
670 | last= tocHdr.cdth_trk1; | ||
671 | ti.cdti_trk0=first+1; | ||
672 | } | ||
673 | if ((first==0)||(first>last)) | ||
674 | { printf ("--could not read TOC\n"); | ||
675 | } | ||
676 | else | ||
677 | { cmd=CDROMPLAYTRKIND; | ||
678 | if (--ti.cdti_trk0 < first) ti.cdti_trk0=first; | ||
679 | ti.cdti_ind0=0; | ||
680 | ti.cdti_trk1=last; | ||
681 | ti.cdti_ind1=0; | ||
682 | if (ioctl(handle,cmd,&ti)) printf("Drive Error\n"); | ||
683 | ini=1; | ||
684 | } | ||
685 | break; | ||
686 | case 'c': subchnl.cdsc_format=CDROM_MSF; | ||
687 | if (ioctl(handle,CDROMSUBCHNL,&subchnl)) | ||
688 | printf("Drive Error\n"); | ||
689 | else | ||
690 | { printf("AudioStatus:%s Track:%d Mode:%d MSF=%d:%d:%d\n", \ | ||
691 | subchnl.cdsc_audiostatus==CDROM_AUDIO_PLAY ? "PLAYING":"NOT PLAYING",\ | ||
692 | subchnl.cdsc_trk,subchnl.cdsc_adr, \ | ||
693 | subchnl.cdsc_absaddr.msf.minute, subchnl.cdsc_absaddr.msf.second, \ | ||
694 | subchnl.cdsc_absaddr.msf.frame); | ||
695 | } | ||
696 | break; | ||
697 | case 'i': if (!ini) | ||
698 | { printf("Command not allowed - play track first\n"); | ||
699 | } | ||
700 | else | ||
701 | { cmd=CDROMREADTOCENTRY; | ||
702 | printf("Track No.: "); | ||
703 | scanf("%d",&arg1); | ||
704 | entry.cdte_track=arg1; | ||
705 | if (entry.cdte_track<first) entry.cdte_track=first; | ||
706 | if (entry.cdte_track>last) entry.cdte_track=last; | ||
707 | entry.cdte_format=CDROM_MSF; | ||
708 | if (ioctl(handle,cmd,&entry)) | ||
709 | { printf("Drive error or invalid track no.\n"); | ||
710 | } | ||
711 | else | ||
712 | { printf("Mode %d Track, starts at %d:%d:%d\n", \ | ||
713 | entry.cdte_adr,entry.cdte_addr.msf.minute, \ | ||
714 | entry.cdte_addr.msf.second,entry.cdte_addr.msf.frame); | ||
715 | } | ||
716 | } | ||
717 | break; | ||
718 | case 'a': cmd=CDROMPLAYMSF; | ||
719 | printf("Address (min:sec:frame) "); | ||
720 | scanf("%d:%d:%d",&arg1,&arg2,&arg3); | ||
721 | msf.cdmsf_min0 =arg1; | ||
722 | msf.cdmsf_sec0 =arg2; | ||
723 | msf.cdmsf_frame0=arg3; | ||
724 | if (msf.cdmsf_sec0 > 59) msf.cdmsf_sec0 =59; | ||
725 | if (msf.cdmsf_frame0> 74) msf.cdmsf_frame0=74; | ||
726 | msf.cdmsf_min1=60; | ||
727 | msf.cdmsf_sec1=00; | ||
728 | msf.cdmsf_frame1=00; | ||
729 | if (ioctl(handle,cmd,&msf)) | ||
730 | { printf("Drive error or invalid address\n"); | ||
731 | } | ||
732 | break; | ||
733 | #ifdef AZT_PRIVATE_IOCTLS /*not supported by every CDROM driver*/ | ||
734 | case 'd': cmd=CDROMREADCOOKED; | ||
735 | printf("Address (min:sec:frame) "); | ||
736 | scanf("%d:%d:%d",&arg1,&arg2,&arg3); | ||
737 | azt.msf.cdmsf_min0 =arg1; | ||
738 | azt.msf.cdmsf_sec0 =arg2; | ||
739 | azt.msf.cdmsf_frame0=arg3; | ||
740 | if (azt.msf.cdmsf_sec0 > 59) azt.msf.cdmsf_sec0 =59; | ||
741 | if (azt.msf.cdmsf_frame0> 74) azt.msf.cdmsf_frame0=74; | ||
742 | if (ioctl(handle,cmd,&azt.msf)) | ||
743 | { printf("Drive error, invalid address or unsupported command\n"); | ||
744 | } | ||
745 | k=0; | ||
746 | getchar(); | ||
747 | for (i=0;i<128;i++) | ||
748 | { printf("%4d:",i*16); | ||
749 | for (j=0;j<16;j++) | ||
750 | { printf("%2x ",azt.buf[i*16+j]); | ||
751 | } | ||
752 | for (j=0;j<16;j++) | ||
753 | { if (isalnum(azt.buf[i*16+j])) | ||
754 | printf("%c",azt.buf[i*16+j]); | ||
755 | else | ||
756 | printf("."); | ||
757 | } | ||
758 | printf("\n"); | ||
759 | k++; | ||
760 | if (k>=20) | ||
761 | { printf("press ENTER to continue\n"); | ||
762 | getchar(); | ||
763 | k=0; | ||
764 | } | ||
765 | } | ||
766 | break; | ||
767 | case 'w': cmd=CDROMREADRAW; | ||
768 | printf("Address (min:sec:frame) "); | ||
769 | scanf("%d:%d:%d",&arg1,&arg2,&arg3); | ||
770 | azt.msf.cdmsf_min0 =arg1; | ||
771 | azt.msf.cdmsf_sec0 =arg2; | ||
772 | azt.msf.cdmsf_frame0=arg3; | ||
773 | if (azt.msf.cdmsf_sec0 > 59) azt.msf.cdmsf_sec0 =59; | ||
774 | if (azt.msf.cdmsf_frame0> 74) azt.msf.cdmsf_frame0=74; | ||
775 | if (ioctl(handle,cmd,&azt)) | ||
776 | { printf("Drive error, invalid address or unsupported command\n"); | ||
777 | } | ||
778 | k=0; | ||
779 | for (i=0;i<147;i++) | ||
780 | { printf("%4d:",i*16); | ||
781 | for (j=0;j<16;j++) | ||
782 | { printf("%2x ",azt.buf[i*16+j]); | ||
783 | } | ||
784 | for (j=0;j<16;j++) | ||
785 | { if (isalnum(azt.buf[i*16+j])) | ||
786 | printf("%c",azt.buf[i*16+j]); | ||
787 | else | ||
788 | printf("."); | ||
789 | } | ||
790 | printf("\n"); | ||
791 | k++; | ||
792 | if (k>=20) | ||
793 | { getchar(); | ||
794 | k=0; | ||
795 | } | ||
796 | } | ||
797 | break; | ||
798 | #endif | ||
799 | case 'v': cmd=CDROMVOLCTRL; | ||
800 | printf("--Channel 0 Left (0-255): "); | ||
801 | scanf("%d",&arg1); | ||
802 | printf("--Channel 1 Right (0-255): "); | ||
803 | scanf("%d",&arg2); | ||
804 | volctrl.channel0=arg1; | ||
805 | volctrl.channel1=arg2; | ||
806 | volctrl.channel2=0; | ||
807 | volctrl.channel3=0; | ||
808 | if (ioctl(handle,cmd,&volctrl)) | ||
809 | { printf("Drive error or unsupported command\n"); | ||
810 | } | ||
811 | break; | ||
812 | case 'q': if (close(handle)) printf("Drive Error: CLOSE\n"); | ||
813 | exit(0); | ||
814 | case 'h': help(); | ||
815 | break; | ||
816 | default: printf("unknown command\n"); | ||
817 | break; | ||
818 | } | ||
819 | } | ||
820 | } | ||
821 | return 0; | ||
822 | } | ||
diff --git a/Documentation/cdrom/cdu31a b/Documentation/cdrom/cdu31a deleted file mode 100644 index c0667da09c00..000000000000 --- a/Documentation/cdrom/cdu31a +++ /dev/null | |||
@@ -1,196 +0,0 @@ | |||
1 | |||
2 | CDU31A/CDU33A Driver Info | ||
3 | ------------------------- | ||
4 | |||
5 | Information on the Sony CDU31A/CDU33A CDROM driver for the Linux | ||
6 | kernel. | ||
7 | |||
8 | Corey Minyard (minyard@metronet.com) | ||
9 | |||
10 | Colossians 3:17 | ||
11 | |||
12 | Crude Table of Contents | ||
13 | ----------------------- | ||
14 | |||
15 | Setting Up the Hardware | ||
16 | Configuring the Kernel | ||
17 | Configuring as a Module | ||
18 | Driver Special Features | ||
19 | |||
20 | |||
21 | This device driver handles Sony CDU31A/CDU33A CDROM drives and | ||
22 | provides a complete block-level interface as well as an ioctl() | ||
23 | interface as specified in include/linux/cdrom.h). With this | ||
24 | interface, CDROMs can be accessed, standard audio CDs can be played | ||
25 | back normally, and CD audio information can be read off the drive. | ||
26 | |||
27 | Note that this will only work for CDU31A/CDU33A drives. Some vendors | ||
28 | market their drives as CDU31A compatible. They lie. Their drives are | ||
29 | really CDU31A hardware interface compatible (they can plug into the | ||
30 | same card). They are not software compatible. | ||
31 | |||
32 | Setting Up the Hardware | ||
33 | ----------------------- | ||
34 | |||
35 | The CDU31A driver is unable to safely tell if an interface card is | ||
36 | present that it can use because the interface card does not announce | ||
37 | its presence in any way besides placing 4 I/O locations in memory. It | ||
38 | used to just probe memory and attempt commands, but Linus wisely asked | ||
39 | me to remove that because it could really screw up other hardware in | ||
40 | the system. | ||
41 | |||
42 | Because of this, you must tell the kernel where the drive interface | ||
43 | is, what interrupts are used, and possibly if you are on a PAS-16 | ||
44 | soundcard. | ||
45 | |||
46 | If you have the Sony CDU31A/CDU33A drive interface card, the following | ||
47 | diagram will help you set it up. If you have another card, you are on | ||
48 | your own. You need to make sure that the I/O address and interrupt is | ||
49 | not used by another card in the system. You will need to know the I/O | ||
50 | address and interrupt you have set. Note that use of interrupts is | ||
51 | highly recommended, if possible, it really cuts down on CPU used. | ||
52 | Unfortunately, most soundcards do not support interrupts for their | ||
53 | CDROM interfaces. By default, the Sony interface card comes with | ||
54 | interrupts disabled. | ||
55 | |||
56 | +----------+-----------------+----------------------+ | ||
57 | | JP1 | 34 Pin Conn | | | ||
58 | | JP2 +-----------------+ | | ||
59 | | JP3 | | ||
60 | | JP4 | | ||
61 | | +--+ | ||
62 | | | +-+ | ||
63 | | | | | External | ||
64 | | | | | Connector | ||
65 | | | | | | ||
66 | | | +-+ | ||
67 | | +--+ | ||
68 | | | | ||
69 | | +--------+ | ||
70 | | | | ||
71 | +------------------------------------------+ | ||
72 | |||
73 | JP1 sets the Base Address, using the following settings: | ||
74 | |||
75 | Address Pin 1 Pin 2 | ||
76 | ------- ----- ----- | ||
77 | 0x320 Short Short | ||
78 | 0x330 Short Open | ||
79 | 0x340 Open Short | ||
80 | 0x360 Open Open | ||
81 | |||
82 | JP2 and JP3 configure the DMA channel; they must be set the same. | ||
83 | |||
84 | DMA Pin 1 Pin 2 Pin 3 | ||
85 | --- ----- ----- ----- | ||
86 | 1 On Off On | ||
87 | 2 Off On Off | ||
88 | 3 Off Off On | ||
89 | |||
90 | JP4 Configures the IRQ: | ||
91 | |||
92 | IRQ Pin 1 Pin 2 Pin 3 Pin 4 | ||
93 | --- ----- ----- ----- ----- | ||
94 | 3 Off Off On Off | ||
95 | 4 Off Off* Off On | ||
96 | 5 On Off Off Off | ||
97 | 6 Off On Off Off | ||
98 | |||
99 | The documentation states to set this for interrupt | ||
100 | 4, but I think that is a mistake. | ||
101 | |||
102 | Note that if you have another interface card, you will need to look at | ||
103 | the documentation to find the I/O base address. This is specified to | ||
104 | the SLCD.SYS driver for DOS with the /B: parameter, so you can look at | ||
105 | you DOS driver setup to find the address, if necessary. | ||
106 | |||
107 | Configuring the Kernel | ||
108 | ---------------------- | ||
109 | |||
110 | You must tell the kernel where the drive is at boot time. This can be | ||
111 | done at the Linux boot prompt, by using LILO, or by using Bootlin. | ||
112 | Note that this is no substitute for HOWTOs and LILO documentation, if | ||
113 | you are confused please read those for info on bootline configuration | ||
114 | and LILO. | ||
115 | |||
116 | At the linux boot prompt, press the ALT key and add the following line | ||
117 | after the boot name (you can let the kernel boot, it will tell you the | ||
118 | default boot name while booting): | ||
119 | |||
120 | cdu31a=<base address>,<interrupt>[,PAS] | ||
121 | |||
122 | The base address needs to have "0x" in front of it, since it is in | ||
123 | hex. For instance, to configure a drive at address 320 on interrupt 5, | ||
124 | use the following: | ||
125 | |||
126 | cdu31a=0x320,5 | ||
127 | |||
128 | I use the following boot line: | ||
129 | |||
130 | cdu31a=0x1f88,0,PAS | ||
131 | |||
132 | because I have a PAS-16 which does not support interrupt for the | ||
133 | CDU31A interface. | ||
134 | |||
135 | Adding this as an append line at the beginning of the /etc/lilo.conf | ||
136 | file will set it for lilo configurations. I have the following as the | ||
137 | first line in my lilo.conf file: | ||
138 | |||
139 | append="cdu31a=0x1f88,0" | ||
140 | |||
141 | I'm not sure how to set up Bootlin (I have never used it), if someone | ||
142 | would like to fill in this section please do. | ||
143 | |||
144 | |||
145 | Configuring as a Module | ||
146 | ----------------------- | ||
147 | |||
148 | The driver supports loading as a module. However, you must specify | ||
149 | the boot address and interrupt on the boot line to insmod. You can't | ||
150 | use modprobe to load it, since modprobe doesn't support setting | ||
151 | variables. | ||
152 | |||
153 | Anyway, I use the following line to load my driver as a module | ||
154 | |||
155 | /sbin/insmod /lib/modules/`uname -r`/misc/cdu31a.o cdu31a_port=0x1f88 | ||
156 | |||
157 | You can set the following variables in the driver: | ||
158 | |||
159 | cdu31a_port=<I/O address> - sets the base I/O. If hex, put 0x in | ||
160 | front of it. This must be specified. | ||
161 | |||
162 | cdu31a_irq=<interrupt> - Sets the interrupt number. Leaving this | ||
163 | off will turn interrupts off. | ||
164 | |||
165 | |||
166 | Driver Special Features | ||
167 | ----------------------- | ||
168 | |||
169 | This section describes features beyond the normal audio and CD-ROM | ||
170 | functions of the drive. | ||
171 | |||
172 | 2048 byte buffer mode | ||
173 | |||
174 | If a disk is mounted with -o block=2048, data is copied straight from | ||
175 | the drive data port to the buffer. Otherwise, the readahead buffer | ||
176 | must be involved to hold the other 1K of data when a 1K block | ||
177 | operation is done. Note that with 2048 byte blocks you cannot execute | ||
178 | files from the CD. | ||
179 | |||
180 | XA compatibility | ||
181 | |||
182 | The driver should support XA disks for both the CDU31A and CDU33A. It | ||
183 | does this transparently, the using program doesn't need to set it. | ||
184 | |||
185 | Multi-Session | ||
186 | |||
187 | A multi-session disk looks just like a normal disk to the user. Just | ||
188 | mount one normally, and all the data should be there. A special | ||
189 | thanks to Koen for help with this! | ||
190 | |||
191 | Raw sector I/O | ||
192 | |||
193 | Using the CDROMREADAUDIO it is possible to read raw audio and data | ||
194 | tracks. Both operations return 2352 bytes per sector. On the data | ||
195 | tracks, the first 12 bytes is not returned by the drive and the value | ||
196 | of that data is indeterminate. | ||
diff --git a/Documentation/cdrom/cm206 b/Documentation/cdrom/cm206 deleted file mode 100644 index 810368f4f7c4..000000000000 --- a/Documentation/cdrom/cm206 +++ /dev/null | |||
@@ -1,185 +0,0 @@ | |||
1 | This is the readme file for the driver for the Philips/LMS cdrom drive | ||
2 | cm206 in combination with the cm260 host adapter card. | ||
3 | |||
4 | (c) 1995 David A. van Leeuwen | ||
5 | |||
6 | Changes since version 0.99 | ||
7 | -------------------------- | ||
8 | - Interfacing to the kernel is routed though an extra interface layer, | ||
9 | cdrom.c. This allows runtime-configurable `behavior' of the cdrom-drive, | ||
10 | independent of the driver. | ||
11 | |||
12 | Features since version 0.33 | ||
13 | --------------------------- | ||
14 | - Full audio support, that is, both workman, workbone and cdp work | ||
15 | now reasonably. Reading TOC still takes some time. xmcd has been | ||
16 | reported to run successfully. | ||
17 | - Made auto-probe code a little better, I hope | ||
18 | |||
19 | Features since version 0.28 | ||
20 | --------------------------- | ||
21 | - Full speed transfer rate (300 kB/s). | ||
22 | - Minimum kernel memory usage for buffering (less than 3 kB). | ||
23 | - Multisession support. | ||
24 | - Tray locking. | ||
25 | - Statistics of driver accessible to the user. | ||
26 | - Module support. | ||
27 | - Auto-probing of adapter card's base port and irq line, | ||
28 | also configurable at boot time or module load time. | ||
29 | |||
30 | |||
31 | Decide how you are going to use the driver. There are two | ||
32 | options: | ||
33 | |||
34 | (a) installing the driver as a resident part of the kernel | ||
35 | (b) compiling the driver as a loadable module | ||
36 | |||
37 | Further, you must decide if you are going to specify the base port | ||
38 | address and the interrupt request line of the adapter card cm260 as | ||
39 | boot options for (a), module parameters for (b), use automatic | ||
40 | probing of these values, or hard-wire your adaptor card's settings | ||
41 | into the source code. If you don't care, you can choose | ||
42 | autoprobing, which is the default. In that case you can move on to | ||
43 | the next step. | ||
44 | |||
45 | Compiling the kernel | ||
46 | -------------------- | ||
47 | 1) move to /usr/src/linux and do a | ||
48 | |||
49 | make config | ||
50 | |||
51 | If you have chosen option (a), answer yes to CONFIG_CM206 and | ||
52 | CONFIG_ISO9660_FS. | ||
53 | |||
54 | If you have chosen option (b), answer yes to CONFIG_MODVERSIONS | ||
55 | and no (!) to CONFIG_CM206 and CONFIG_ISO9660_FS. | ||
56 | |||
57 | 2) then do a | ||
58 | |||
59 | make clean; make zImage; make modules | ||
60 | |||
61 | 3) do the usual things to install a new image (backup the old one, run | ||
62 | `rdev -R zImage 1', copy the new image in place, run lilo). Might | ||
63 | be `make zlilo'. | ||
64 | |||
65 | Using the driver as a module | ||
66 | ---------------------------- | ||
67 | If you will only occasionally use the cd-rom driver, you can choose | ||
68 | option (b), install as a loadable module. You may have to re-compile | ||
69 | the module when you upgrade the kernel to a new version. | ||
70 | |||
71 | Since version 0.96, much of the functionality has been transferred to | ||
72 | a generic cdrom interface in the file cdrom.c. The module cm206.o | ||
73 | depends on cdrom.o. If the latter is not compiled into the kernel, | ||
74 | you must explicitly load it before cm206.o: | ||
75 | |||
76 | insmod /usr/src/linux/modules/cdrom.o | ||
77 | |||
78 | To install the module, you use the command, as root | ||
79 | |||
80 | insmod /usr/src/linux/modules/cm206.o | ||
81 | |||
82 | You can specify the base address on the command line as well as the irq | ||
83 | line to be used, e.g. | ||
84 | |||
85 | insmod /usr/src/linux/modules/cm206.o cm206=0x300,11 | ||
86 | |||
87 | The order of base port and irq line doesn't matter; if you specify only | ||
88 | one, the other will have the value of the compiled-in default. You | ||
89 | may also have to install the file-system module `iso9660.o', if you | ||
90 | didn't compile that into the kernel. | ||
91 | |||
92 | |||
93 | Using the driver as part of the kernel | ||
94 | -------------------------------------- | ||
95 | If you have chosen option (a), you can specify the base-port | ||
96 | address and irq on the lilo boot command line, e.g.: | ||
97 | |||
98 | LILO: linux cm206=0x340,11 | ||
99 | |||
100 | This assumes that your linux kernel image keyword is `linux'. | ||
101 | If you specify either IRQ (3--11) or base port (0x300--0x370), | ||
102 | auto probing is turned off for both settings, thus setting the | ||
103 | other value to the compiled-in default. | ||
104 | |||
105 | Note that you can also put these parameters in the lilo configuration file: | ||
106 | |||
107 | # linux config | ||
108 | image = /vmlinuz | ||
109 | root = /dev/hda1 | ||
110 | label = Linux | ||
111 | append = "cm206=0x340,11" | ||
112 | read-only | ||
113 | |||
114 | |||
115 | If module parameters and LILO config options don't work | ||
116 | ------------------------------------------------------- | ||
117 | If autoprobing does not work, you can hard-wire the default values | ||
118 | of the base port address (CM206_BASE) and interrupt request line | ||
119 | (CM206_IRQ) into the file /usr/src/linux/drivers/cdrom/cm206.h. Change | ||
120 | the defines of CM206_IRQ and CM206_BASE. | ||
121 | |||
122 | |||
123 | Mounting the cdrom | ||
124 | ------------------ | ||
125 | 1) Make sure that the right device is installed in /dev. | ||
126 | |||
127 | mknod /dev/cm206cd b 32 0 | ||
128 | |||
129 | 2) Make sure there is a mount point, e.g., /cdrom | ||
130 | |||
131 | mkdir /cdrom | ||
132 | |||
133 | 3) mount using a command like this (run as root): | ||
134 | |||
135 | mount -rt iso9660 /dev/cm206cd /cdrom | ||
136 | |||
137 | 4) For user-mounts, add a line in /etc/fstab | ||
138 | |||
139 | /dev/cm206cd /cdrom iso9660 ro,noauto,user | ||
140 | |||
141 | This will allow users to give the commands | ||
142 | |||
143 | mount /cdrom | ||
144 | umount /cdrom | ||
145 | |||
146 | If things don't work | ||
147 | -------------------- | ||
148 | |||
149 | - Try to do a `dmesg' to find out if the driver said anything about | ||
150 | what is going wrong during the initialization. | ||
151 | |||
152 | - Try to do a `dd if=/dev/cm206cd | od -tc | less' to read from the | ||
153 | CD. | ||
154 | |||
155 | - Look in the /proc directory to see if `cm206' shows up under one of | ||
156 | `interrupts', `ioports', `devices' or `modules' (if applicable). | ||
157 | |||
158 | |||
159 | DISCLAIMER | ||
160 | ---------- | ||
161 | I cannot guarantee that this driver works, or that the hardware will | ||
162 | not be harmed, although I consider it most unlikely. | ||
163 | |||
164 | I hope that you'll find this driver in some way useful. | ||
165 | |||
166 | David van Leeuwen | ||
167 | david@tm.tno.nl | ||
168 | |||
169 | Note for Linux CDROM vendors | ||
170 | ----------------------------- | ||
171 | You are encouraged to include this driver on your Linux CDROM. If | ||
172 | you do, you might consider sending me a free copy of that cd-rom. | ||
173 | You can contact me through my e-mail address, david@tm.tno.nl. | ||
174 | If this driver is compiled into a kernel to boot off a cdrom, | ||
175 | you should actually send me a free copy of that cd-rom. | ||
176 | |||
177 | Copyright | ||
178 | --------- | ||
179 | The copyright of the cm206 driver for Linux is | ||
180 | |||
181 | (c) 1995 David A. van Leeuwen | ||
182 | |||
183 | The driver is released under the conditions of the GNU general public | ||
184 | license, which can be found in the file COPYING in the root of this | ||
185 | source tree. | ||
diff --git a/Documentation/cdrom/gscd b/Documentation/cdrom/gscd deleted file mode 100644 index d01ca36b5c43..000000000000 --- a/Documentation/cdrom/gscd +++ /dev/null | |||
@@ -1,60 +0,0 @@ | |||
1 | Goldstar R420 CD-Rom device driver README | ||
2 | |||
3 | For all kind of other information about the GoldStar R420 CDROM | ||
4 | and this Linux device driver see the WWW page: | ||
5 | |||
6 | http://linux.rz.fh-hannover.de/~raupach | ||
7 | |||
8 | |||
9 | If you are the editor of a Linux CD, you should | ||
10 | enable gscd.c within your boot floppy kernel. Please, | ||
11 | send me one of your CDs for free. | ||
12 | |||
13 | |||
14 | This current driver version 0.4a only supports reading data from the disk. | ||
15 | Currently we have no audio and no multisession or XA support. | ||
16 | The polling interface is used, no DMA. | ||
17 | |||
18 | |||
19 | Sometimes the GoldStar R420 is sold in a 'Reveal Multimedia Kit'. This kit's | ||
20 | drive interface is compatible, too. | ||
21 | |||
22 | |||
23 | Installation | ||
24 | ------------ | ||
25 | |||
26 | Change to '/usr/src/linux/drivers/cdrom' and edit the file 'gscd.h'. Insert | ||
27 | the i/o address of your interface card. | ||
28 | |||
29 | The default base address is 0x340. This will work for most applications. | ||
30 | Address selection is accomplished by jumpers PN801-1 to PN801-4 on the | ||
31 | GoldStar Interface Card. | ||
32 | Appropriate settings are: 0x300, 0x310, 0x320, 0x330, 0x340, 0x350, 0x360 | ||
33 | 0x370, 0x380, 0x390, 0x3A0, 0x3B0, 0x3C0, 0x3D0, 0x3E0, 0x3F0 | ||
34 | |||
35 | Then go back to '/usr/src/linux/' and 'make config' to build the new | ||
36 | configuration for your kernel. If you want to use the GoldStar driver | ||
37 | like a module, don't select 'GoldStar CDROM support'. By the way, you | ||
38 | have to include the iso9660 filesystem. | ||
39 | |||
40 | Now start compiling the kernel with 'make zImage'. | ||
41 | If you want to use the driver as a module, you have to do 'make modules' | ||
42 | and 'make modules_install', additionally. | ||
43 | Install your new kernel as usual - maybe you do it with 'make zlilo'. | ||
44 | |||
45 | Before you can use the driver, you have to | ||
46 | mknod /dev/gscd0 b 16 0 | ||
47 | to create the appropriate device file (you only need to do this once). | ||
48 | |||
49 | If you use modules, you can try to insert the driver. | ||
50 | Say: 'insmod /usr/src/linux/modules/gscd.o' | ||
51 | or: 'insmod /usr/src/linux/modules/gscd.o gscd=<address>' | ||
52 | The driver should report its results. | ||
53 | |||
54 | That's it! Mount a disk, i.e. 'mount -rt iso9660 /dev/gscd0 /cdrom' | ||
55 | |||
56 | Feel free to report errors and suggestions to the following address. | ||
57 | Be sure, I'm very happy to receive your comments! | ||
58 | |||
59 | Oliver Raupach Hannover, Juni 1995 | ||
60 | (raupach@nwfs1.rz.fh-hannover.de) | ||
diff --git a/Documentation/cdrom/isp16 b/Documentation/cdrom/isp16 deleted file mode 100644 index cc86533ac9f3..000000000000 --- a/Documentation/cdrom/isp16 +++ /dev/null | |||
@@ -1,100 +0,0 @@ | |||
1 | -- Documentation/cdrom/isp16 | ||
2 | |||
3 | Docs by Eric van der Maarel <H.T.M.v.d.Maarel@marin.nl> | ||
4 | |||
5 | This is the README for version 0.6 of the cdrom interface on an | ||
6 | ISP16, MAD16 or Mozart sound card. | ||
7 | |||
8 | The detection and configuration of this interface used to be included | ||
9 | in both the sjcd and optcd cdrom driver. Drives supported by these | ||
10 | drivers came packed with Media Magic's multi media kit, which also | ||
11 | included the ISP16 card. The idea (thanks Leo Spiekman) | ||
12 | to move it from these drivers into a separate module and moreover, not to | ||
13 | rely on the MAD16 sound driver, are as follows: | ||
14 | -duplication of code in the kernel is a waste of resources and should | ||
15 | be avoided; | ||
16 | -however, kernels and notably those included with Linux distributions | ||
17 | (cf Slackware 3.0 included version 0.5 of the isp16 configuration | ||
18 | code included in the drivers) don't always come with sound support | ||
19 | included. Especially when they already include a bunch of cdrom drivers. | ||
20 | Hence, the cdrom interface should be configurable _independently_ of | ||
21 | sound support. | ||
22 | |||
23 | The ISP16, MAD16 and Mozart sound cards have an OPTi 82C928 or an | ||
24 | OPTi 82C929 chip. The interface on these cards should work with | ||
25 | any cdrom attached to the card, which is 'electrically' compatible | ||
26 | with Sanyo/Panasonic, Sony or Mitsumi non-ide drives. However, the | ||
27 | command sets for any proprietary drives may differ | ||
28 | (and hence may not be supported in the kernel) from these four types. | ||
29 | For a fact I know the interface works and the way of configuration | ||
30 | as described in this documentation works in combination with the | ||
31 | sjcd (in Sanyo/Panasonic compatibility mode) cdrom drivers | ||
32 | (probably with the optcd (in Sony compatibility mode) as well). | ||
33 | If you have such an OPTi based sound card and you want to use the | ||
34 | cdrom interface with a cdrom drive supported by any of the other cdrom | ||
35 | drivers, it will probably work. Please let me know any experience you | ||
36 | might have). | ||
37 | I understand that cards based on the OPTi 82C929 chips may be configured | ||
38 | (hardware jumpers that is) as an IDE interface. Initialisation of such a | ||
39 | card in this mode is not supported (yet?). | ||
40 | |||
41 | The suggestion to configure the ISP16 etc. sound card by booting DOS and | ||
42 | do a warm reboot to boot Linux somehow doesn't work, at least not | ||
43 | on my machine (IPC P90), with the OPTi 82C928 based card. | ||
44 | |||
45 | Booting the kernel through the boot manager LILO allows the use | ||
46 | of some command line options on the 'LILO boot:' prompt. At boot time | ||
47 | press Alt or Shift while the LILO prompt is written on the screen and enter | ||
48 | any kernel options. Alternatively these options may be used in | ||
49 | the appropriate section in /etc/lilo.conf. Adding 'append="<cmd_line_options>"' | ||
50 | will do the trick as well. | ||
51 | The syntax of 'cmd_line_options' is | ||
52 | |||
53 | isp16=[<port>[,<irq>[,<dma>]]][[,]<drive_type>] | ||
54 | |||
55 | If there is no ISP16 or compatibles detected, there's probably no harm done. | ||
56 | These options indicate the values that your cdrom drive has been (or will be) | ||
57 | configured to use. | ||
58 | Valid values for the base i/o address are: | ||
59 | port=0x340,0x320,0x330,0x360 | ||
60 | for the interrupt request number | ||
61 | irq=0,3,5,7,9,10,11 | ||
62 | for the direct memory access line | ||
63 | dma=0,3,5,6,7 | ||
64 | and for the type of drive | ||
65 | drive_type=noisp16,Sanyo,Panasonic,Sony,Mitsumi. | ||
66 | Note that these options are case sensitive. | ||
67 | The values 0 for irq and dma indicate that they are not used, and | ||
68 | the drive will be used in 'polling' mode. The values 5 and 7 for irq | ||
69 | should be avoided in order to avoid any conflicts with optional | ||
70 | sound card configuration. | ||
71 | The syntax of the command line does not allow the specification of | ||
72 | irq when there's nothing specified for the base address and no | ||
73 | specification of dma when there is no specification of irq. | ||
74 | The value 'noisp16' for drive_type, which may be used as the first | ||
75 | non-integer option value (e.g. 'isp16=noisp16'), makes sure that probing | ||
76 | for and subsequent configuration of an ISP16-compatible card is skipped | ||
77 | all together. This can be useful to overcome possible conflicts which | ||
78 | may arise while the kernel is probing your hardware. | ||
79 | The default values are | ||
80 | port=0x340 | ||
81 | irq=0 | ||
82 | dma=0 | ||
83 | drive_type=Sanyo | ||
84 | reflecting my own configuration. The defaults can be changed in | ||
85 | the file linux/drivers/cdrom/ips16.h. | ||
86 | |||
87 | The cdrom interface can be configured at run time by loading the | ||
88 | initialisation driver as a module. In that case, the interface | ||
89 | parameters can be set by giving appropriate values on the command | ||
90 | line. Configuring the driver can then be done by the following | ||
91 | command (assuming you have iso16.o installed in a proper place): | ||
92 | |||
93 | insmod isp16.o isp16_cdrom_base=<port> isp16_cdrom_irq=<irq> \ | ||
94 | isp16_cdrom_dma=<dma> isp16_cdrom_type=<drive_type> | ||
95 | |||
96 | where port, irq, dma and drive_type can have any of the values mentioned | ||
97 | above. | ||
98 | |||
99 | |||
100 | Have fun! | ||
diff --git a/Documentation/cdrom/mcdx b/Documentation/cdrom/mcdx deleted file mode 100644 index 2bac4b7ff6da..000000000000 --- a/Documentation/cdrom/mcdx +++ /dev/null | |||
@@ -1,29 +0,0 @@ | |||
1 | If you are using the driver as a module, you can specify your ports and IRQs | ||
2 | like | ||
3 | |||
4 | # insmod mcdx.o mcdx=0x300,11,0x304,5 | ||
5 | |||
6 | and so on ("address,IRQ" pairs). | ||
7 | This will override the configuration in mcdx.h. | ||
8 | |||
9 | This driver: | ||
10 | |||
11 | o handles XA and (hopefully) multi session CDs as well as | ||
12 | ordinary CDs; | ||
13 | o supports up to 5 drives (of course, you'll need free | ||
14 | IRQs, i/o ports and slots); | ||
15 | o plays audio | ||
16 | |||
17 | This version doesn't support yet: | ||
18 | |||
19 | o shared IRQs (but it seems to be possible - I've successfully | ||
20 | connected two drives to the same irq. So it's `only' a | ||
21 | problem of the driver.) | ||
22 | |||
23 | This driver never will: | ||
24 | |||
25 | o Read digital audio (i.e. copy directly), due to missing | ||
26 | hardware features. | ||
27 | |||
28 | |||
29 | heiko@lotte.sax.de | ||
diff --git a/Documentation/cdrom/optcd b/Documentation/cdrom/optcd deleted file mode 100644 index 6f46c7adb243..000000000000 --- a/Documentation/cdrom/optcd +++ /dev/null | |||
@@ -1,57 +0,0 @@ | |||
1 | This is the README file for the Optics Storage 8000 AT CDROM device driver. | ||
2 | |||
3 | This is the driver for the so-called 'DOLPHIN' drive, with the 34-pin | ||
4 | Sony-compatible interface. For the IDE-compatible Optics Storage 8001 | ||
5 | drive, you will want the ATAPI CDROM driver. The driver also seems to | ||
6 | work with the Lasermate CR328A. If you have a drive that works with | ||
7 | this driver, and that doesn't report itself as DOLPHIN, please drop me | ||
8 | a mail. | ||
9 | |||
10 | The support for multisession CDs is in ALPHA stage. If you use it, | ||
11 | please mail me your experiences. Multisession support can be disabled | ||
12 | at compile time. | ||
13 | |||
14 | You can find some older versions of the driver at | ||
15 | dutette.et.tudelft.nl:/pub/linux/ | ||
16 | and at Eberhard's mirror | ||
17 | ftp.gwdg.de:/pub/linux/cdrom/drivers/optics/ | ||
18 | |||
19 | Before you can use the driver, you have to create the device file once: | ||
20 | # mknod /dev/optcd0 b 17 0 | ||
21 | |||
22 | To specify the base address if the driver is "compiled-in" to your kernel, | ||
23 | you can use the kernel command line item (LILO option) | ||
24 | optcd=0x340 | ||
25 | with the right address. | ||
26 | |||
27 | If you have compiled optcd as a module, you can load it with | ||
28 | # insmod /usr/src/linux/modules/optcd.o | ||
29 | or | ||
30 | # insmod /usr/src/linux/modules/optcd.o optcd=0x340 | ||
31 | with the matching address value of your interface card. | ||
32 | |||
33 | The driver employs a number of buffers to do read-ahead and block size | ||
34 | conversion. The number of buffers is configurable in optcd.h, and has | ||
35 | influence on the driver performance. For my machine (a P75), 6 buffers | ||
36 | seems optimal, as can be seen from this table: | ||
37 | |||
38 | #bufs kb/s %cpu | ||
39 | 1 97 0.1 | ||
40 | 2 191 0.3 | ||
41 | 3 188 0.2 | ||
42 | 4 246 0.3 | ||
43 | 5 189 19 | ||
44 | 6 280 0.4 | ||
45 | 7 281 7.0 | ||
46 | 8 246 2.8 | ||
47 | 16 281 3.4 | ||
48 | |||
49 | If you get a throughput significantly below 300 kb/s, try tweaking | ||
50 | N_BUFS, and don't forget to mail me your results! | ||
51 | |||
52 | I'd appreciate success/failure reports. If you find a bug, try | ||
53 | recompiling the driver with some strategically chosen debug options | ||
54 | (these can be found in optcd.h) and include the messages generated in | ||
55 | your bug report. Good luck. | ||
56 | |||
57 | Leo Spiekman (spiekman@dutette.et.tudelft.nl) | ||
diff --git a/Documentation/cdrom/sbpcd b/Documentation/cdrom/sbpcd deleted file mode 100644 index b3ba63f4ce3e..000000000000 --- a/Documentation/cdrom/sbpcd +++ /dev/null | |||
@@ -1,1061 +0,0 @@ | |||
1 | This README belongs to release 4.2 or newer of the SoundBlaster Pro | ||
2 | (Matsushita, Kotobuki, Panasonic, CreativeLabs, Longshine and Teac) | ||
3 | CD-ROM driver for Linux. | ||
4 | |||
5 | sbpcd really, really is NOT for ANY IDE/ATAPI drive! | ||
6 | Not even if you have an "original" SoundBlaster card with an IDE interface! | ||
7 | So, you'd better have a look into README.ide if your port address is 0x1F0, | ||
8 | 0x170, 0x1E8, 0x168 or similar. | ||
9 | I get tons of mails from IDE/ATAPI drive users - I really can't continue | ||
10 | any more to answer them all. So, if your drive/interface information sheets | ||
11 | mention "IDE" (primary, secondary, tertiary, quaternary) and the DOS driver | ||
12 | invoking line within your CONFIG.SYS is using an address below 0x230: | ||
13 | DON'T ROB MY LAST NERVE - jumper your interface to address 0x170 and IRQ 15 | ||
14 | (that is the "secondary IDE" configuration), set your drive to "master" and | ||
15 | use ide-cd as your driver. If you do not have a second IDE hard disk, use the | ||
16 | LILO commands | ||
17 | hdb=noprobe hdc=cdrom | ||
18 | and get lucky. | ||
19 | To make it fully clear to you: if you mail me about IDE/ATAPI drive problems, | ||
20 | my answer is above, and I simply will discard your mail, hoping to stop the | ||
21 | flood and to find time to lead my 12-year old son towards happy computing. | ||
22 | |||
23 | The driver is able to drive the whole family of "traditional" AT-style (that | ||
24 | is NOT the new "Enhanced IDE" or "ATAPI" drive standard) Matsushita, | ||
25 | Kotobuki, Panasonic drives, sometimes labelled as "CreativeLabs". The | ||
26 | well-known drives are CR-521, CR-522, CR-523, CR-562, CR-563. | ||
27 | CR-574 is an IDE/ATAPI drive. | ||
28 | |||
29 | The Longshine LCS-7260 is a double-speed drive which uses the "old" | ||
30 | Matsushita command set. It is supported - with help by Serge Robyns. | ||
31 | Vertos ("Elitegroup Computer Systems", ECS) has a similar drive - support | ||
32 | has started; get in contact if you have such a "Vertos 100" or "ECS-AT" | ||
33 | drive. | ||
34 | |||
35 | There exists an "IBM External ISA CD-ROM Drive" which in fact is a CR-563 | ||
36 | with a special controller board. This drive is supported (the interface is | ||
37 | of the "LaserMate" type), and it is possibly the best buy today (cheaper than | ||
38 | an internal drive, and you can use it as an internal, too - e.g. plug it into | ||
39 | a soundcard). | ||
40 | |||
41 | CreativeLabs has a new drive "CD200" and a similar drive "CD200F". The latter | ||
42 | is made by Funai and sometimes named "E2550UA", newer models may be named | ||
43 | "MK4015". The CD200F drives should fully work. | ||
44 | CD200 drives without "F" are still giving problems: drive detection and | ||
45 | playing audio should work, data access will result in errors. I need qualified | ||
46 | feedback about the bugs within the data functions or a drive (I never saw a | ||
47 | CD200). | ||
48 | |||
49 | The quad-speed Teac CD-55A drive is supported, but still does not reach "full | ||
50 | speed". The data rate already reaches 500 kB/sec if you set SBP_BUFFER_FRAMES | ||
51 | to 64 (it is not recommended to do that for normal "file access" usage, but it | ||
52 | can speed up things a lot if you use something like "dd" to read from the | ||
53 | drive; I use it for verifying self-written CDs this way). | ||
54 | The drive itself is able to deliver 600 kB/sec, so this needs | ||
55 | work; with the normal setup, the performance currently is not even as good as | ||
56 | double-speed. | ||
57 | |||
58 | This driver is NOT for Mitsumi or Sony or Aztech or Philips or XXX drives, | ||
59 | and again: this driver is in no way usable for any IDE/ATAPI drive. If you | ||
60 | think your drive should work and it doesn't: send me the DOS driver for your | ||
61 | beast (gzipped + uuencoded) and your CONFIG.SYS if you want to ask me for help, | ||
62 | and include an original log message excerpt, and try to give all information | ||
63 | a complete idiot needs to understand your hassle already with your first | ||
64 | mail. And if you want to say "as I have mailed you before", be sure that I | ||
65 | don't remember your "case" by such remarks; at the moment, I have some | ||
66 | hundreds of open correspondences about Linux CDROM questions (hope to reduce if | ||
67 | the IDE/ATAPI user questions disappear). | ||
68 | |||
69 | |||
70 | This driver will work with the soundcard interfaces (SB Pro, SB 16, Galaxy, | ||
71 | SoundFX, Mozart, MAD16 ...) and with the "no-sound" cards (Panasonic CI-101P, | ||
72 | LaserMate, WDH-7001C, Longshine LCS-6853, Teac ...). | ||
73 | |||
74 | It works with the "configurable" interface "Sequoia S-1000", too, which is | ||
75 | used on the Spea Media FX and Ensonic Soundscape sound cards. You have to | ||
76 | specify the type "SBPRO 2" and the true CDROM port address with it, not the | ||
77 | "configuration port" address. | ||
78 | |||
79 | If you have a sound card which needs a "configuration driver" instead of | ||
80 | jumpers for interface types and addresses (like Mozart cards) - those | ||
81 | drivers get invoked before the DOS CDROM driver in your CONFIG.SYS, typical | ||
82 | names are "cdsetup.sys" and "mztinit.sys" - let the sound driver do the | ||
83 | CDROM port configuration (the leading comments in linux/drivers/sound/mad16.c | ||
84 | are just for you!). Hannu Savolainen's mad16.c code is able to set up my | ||
85 | Mozart card - I simply had to add | ||
86 | #define MAD16_CONF 0x06 | ||
87 | #define MAD16_CDSEL 0x03 | ||
88 | to configure the CDROM interface for type "Panasonic" (LaserMate) and address | ||
89 | 0x340. | ||
90 | |||
91 | The interface type has to get configured in linux/drivers/cdrom/sbpcd.h, | ||
92 | because the register layout is different between the "SoundBlaster" and the | ||
93 | "LaserMate" type. | ||
94 | |||
95 | I got a report that the Teac interface card "I/F E117098" is of type | ||
96 | "SoundBlaster" (i.e. you have to set SBPRO to 1) even with the addresses | ||
97 | 0x300 and above. This is unusual, and it can't get covered by the auto | ||
98 | probing scheme. | ||
99 | The Teac 16-bit interface cards (like P/N E950228-00A, default address 0x2C0) | ||
100 | need the SBPRO 3 setup. | ||
101 | |||
102 | If auto-probing found the drive, the address is correct. The reported type | ||
103 | may be wrong. A "mount" will give success only if the interface type is set | ||
104 | right. Playing audio should work with a wrong set interface type, too. | ||
105 | |||
106 | With some Teac and some CD200 drives I have seen interface cards which seem | ||
107 | to lack the "drive select" lines; always drive 0 gets addressed. To avoid | ||
108 | "mirror drives" (four drives detected where you only have one) with such | ||
109 | interface cards, set MAX_DRIVES to 1 and jumper your drive to ID 0 (if | ||
110 | possible). | ||
111 | |||
112 | |||
113 | Up to 4 drives per interface card, and up to 4 interface cards are supported. | ||
114 | All supported drive families can be mixed, but the CR-521 drives are | ||
115 | hard-wired to drive ID 0. The drives have to use different drive IDs, and each | ||
116 | drive has to get a unique minor number (0...3), corresponding indirectly to | ||
117 | its drive ID. | ||
118 | The drive IDs may be selected freely from 0 to 3 - they do not have to be in | ||
119 | consecutive order. | ||
120 | |||
121 | As Don Carroll, don@ds9.us.dell.com or FIDO 1:382/14, told me, it is possible | ||
122 | to change old drives to any ID, too. He writes in this sense: | ||
123 | "In order to be able to use more than one single speed drive | ||
124 | (they do not have the ID jumpers) you must add a DIP switch | ||
125 | and two resistors. The pads are already on the board next to | ||
126 | the power connector. You will see the silkscreen for the | ||
127 | switch if you remove the top cover. | ||
128 | 1 2 3 4 | ||
129 | ID 0 = x F F x O = "on" | ||
130 | ID 1 = x O F x F = "off" | ||
131 | ID 2 = x F O x x = "don't care" | ||
132 | ID 3 = x O O x | ||
133 | Next to the switch are the positions for R76 (7k) and R78 | ||
134 | (12k). I had to play around with the resistor values - ID 3 | ||
135 | did not work with other values. If the values are not good, | ||
136 | ID 3 behaves like ID 0." | ||
137 | |||
138 | To use more than 4 drives, you simply need a second controller card at a | ||
139 | different address and a second cable. | ||
140 | |||
141 | The driver supports reading of data from the CD and playing of audio tracks. | ||
142 | The audio part should run with WorkMan, xcdplayer, with the "non-X11" products | ||
143 | CDplayer and WorkBone - tell me if it is not compatible with other software. | ||
144 | The only accepted measure for correctness with the audio functions is the | ||
145 | "cdtester" utility (appended) - most audio player programmers seem to be | ||
146 | better musicians than programmers. ;-) | ||
147 | |||
148 | With the CR-56x and the CD200 drives, the reading of audio frames is possible. | ||
149 | This is implemented by an IOCTL function which reads READ_AUDIO frames of | ||
150 | 2352 bytes at once (configurable with the "READ_AUDIO" define, default is 0). | ||
151 | Reading the same frame a second time gives different data; the frame data | ||
152 | start at a different position, but all read bytes are valid, and we always | ||
153 | read 98 consecutive chunks (of 24 Bytes) as a frame. Reading more than 1 frame | ||
154 | at once possibly misses some chunks at each frame boundary. This lack has to | ||
155 | get corrected by external, "higher level" software which reads the same frame | ||
156 | again and tries to find and eliminate overlapping chunks (24-byte-pieces). | ||
157 | |||
158 | The transfer rate with reading audio (1-frame-pieces) currently is very slow. | ||
159 | This can be better reading bigger chunks, but the "missing" chunks possibly | ||
160 | occur at the beginning of each single frame. | ||
161 | The software interface possibly may change a bit the day the SCSI driver | ||
162 | supports it too. | ||
163 | |||
164 | With all but the CR-52x drives, MultiSession is supported. | ||
165 | Photo CDs work (the "old" drives like CR-521 can access only the first | ||
166 | session of a photoCD). | ||
167 | At ftp.gwdg.de:/pub/linux/hpcdtoppm/ you will find Hadmut Danisch's package to | ||
168 | convert photo CD image files and Gerd Knorr's viewing utility. | ||
169 | |||
170 | The transfer rate will reach 150 kB/sec with CR-52x drives, 300 kB/sec with | ||
171 | CR-56x drives, and currently not more than 500 kB/sec (usually less than | ||
172 | 250 kB/sec) with the Teac quad speed drives. | ||
173 | XA (PhotoCD) disks with "old" drives give only 50 kB/sec. | ||
174 | |||
175 | This release consists of | ||
176 | - this README file | ||
177 | - the driver file linux/drivers/cdrom/sbpcd.c | ||
178 | - the stub files linux/drivers/cdrom/sbpcd[234].c | ||
179 | - the header file linux/drivers/cdrom/sbpcd.h. | ||
180 | |||
181 | |||
182 | To install: | ||
183 | ----------- | ||
184 | |||
185 | 1. Setup your hardware parameters. Though the driver does "auto-probing" at a | ||
186 | lot of (not all possible!) addresses, this step is recommended for | ||
187 | everyday use. You should let sbpcd auto-probe once and use the reported | ||
188 | address if a drive got found. The reported type may be incorrect; it is | ||
189 | correct if you can mount a data CD. There is no choice for you with the | ||
190 | type; only one is right, the others are deadly wrong. | ||
191 | |||
192 | a. Go into /usr/src/linux/drivers/cdrom/sbpcd.h and configure it for your | ||
193 | hardware (near the beginning): | ||
194 | a1. Set it up for the appropriate type of interface board. | ||
195 | "Original" CreativeLabs sound cards need "SBPRO 1". | ||
196 | Most "compatible" sound cards (almost all "non-CreativeLabs" cards) | ||
197 | need "SBPRO 0". | ||
198 | The "no-sound" board from OmniCd needs the "SBPRO 1" setup. | ||
199 | The Teac 8-bit "no-sound" boards need the "SBPRO 1" setup. | ||
200 | The Teac 16-bit "no-sound" boards need the "SBPRO 3" setup. | ||
201 | All other "no-sound" boards need the "SBPRO 0" setup. | ||
202 | The Spea Media FX and Ensoniq SoundScape cards need "SBPRO 2". | ||
203 | sbpcd.c holds some examples in its auto-probe list. | ||
204 | If you configure "SBPRO" wrong, the playing of audio CDs will work, | ||
205 | but you will not be able to mount a data CD. | ||
206 | a2. Tell the address of your CDROM_PORT (not of the sound port). | ||
207 | a3. If 4 drives get found, but you have only one, set MAX_DRIVES to 1. | ||
208 | a4. Set DISTRIBUTION to 0. | ||
209 | b. Additionally for 2.a1 and 2.a2, the setup may be done during | ||
210 | boot time (via the "kernel command line" or "LILO option"): | ||
211 | sbpcd=0x320,LaserMate | ||
212 | or | ||
213 | sbpcd=0x230,SoundBlaster | ||
214 | or | ||
215 | sbpcd=0x338,SoundScape | ||
216 | or | ||
217 | sbpcd=0x2C0,Teac16bit | ||
218 | This is especially useful if you install a fresh distribution. | ||
219 | If the second parameter is a number, it gets taken as the type | ||
220 | setting; 0 is "LaserMate", 1 is "SoundBlaster", 2 is "SoundScape", | ||
221 | 3 is "Teac16bit". | ||
222 | So, for example | ||
223 | sbpcd=0x230,1 | ||
224 | is equivalent to | ||
225 | sbpcd=0x230,SoundBlaster | ||
226 | |||
227 | 2. "cd /usr/src/linux" and do a "make config" and select "y" for Matsushita | ||
228 | CD-ROM support and for ISO9660 FileSystem support. If you do not have a | ||
229 | second, third, or fourth controller installed, do not say "y" to the | ||
230 | secondary Matsushita CD-ROM questions. | ||
231 | |||
232 | 3. Then make the kernel image ("make zlilo" or similar). | ||
233 | |||
234 | 4. Make the device file(s). This step usually already has been done by the | ||
235 | MAKEDEV script. | ||
236 | The driver uses MAJOR 25, so, if necessary, do | ||
237 | mknod /dev/sbpcd b 25 0 (if you have only one drive) | ||
238 | and/or | ||
239 | mknod /dev/sbpcd0 b 25 0 | ||
240 | mknod /dev/sbpcd1 b 25 1 | ||
241 | mknod /dev/sbpcd2 b 25 2 | ||
242 | mknod /dev/sbpcd3 b 25 3 | ||
243 | to make the node(s). | ||
244 | |||
245 | The "first found" drive gets MINOR 0 (regardless of its jumpered ID), the | ||
246 | "next found" (at the same cable) gets MINOR 1, ... | ||
247 | |||
248 | For a second interface board, you have to make nodes like | ||
249 | mknod /dev/sbpcd4 b 26 0 | ||
250 | mknod /dev/sbpcd5 b 26 1 | ||
251 | and so on. Use the MAJORs 26, 27, 28. | ||
252 | |||
253 | If you further make a link like | ||
254 | ln -s sbpcd /dev/cdrom | ||
255 | you can use the name /dev/cdrom, too. | ||
256 | |||
257 | 5. Reboot with the new kernel. | ||
258 | |||
259 | You should now be able to do | ||
260 | mkdir /CD | ||
261 | and | ||
262 | mount -rt iso9660 /dev/sbpcd /CD | ||
263 | or | ||
264 | mount -rt iso9660 -o block=2048 /dev/sbpcd /CD | ||
265 | and see the contents of your CD in the /CD directory. | ||
266 | To use audio CDs, a mounting is not recommended (and it would fail if the | ||
267 | first track is not a data track). | ||
268 | |||
269 | |||
270 | Using sbpcd as a "loadable module": | ||
271 | ----------------------------------- | ||
272 | |||
273 | If you do NOT select "Matsushita/Panasonic CDROM driver support" during the | ||
274 | "make config" of your kernel, you can build the "loadable module" sbpcd.o. | ||
275 | |||
276 | If sbpcd gets used as a module, the support of more than one interface | ||
277 | card (i.e. drives 4...15) is disabled. | ||
278 | |||
279 | You can specify interface address and type with the "insmod" command like: | ||
280 | # insmod /usr/src/linux/modules/sbpcd.o sbpcd=0x340,0 | ||
281 | or | ||
282 | # insmod /usr/src/linux/modules/sbpcd.o sbpcd=0x230,1 | ||
283 | or | ||
284 | # insmod /usr/src/linux/modules/sbpcd.o sbpcd=0x338,2 | ||
285 | where the last number represents the SBPRO setting (no strings allowed here). | ||
286 | |||
287 | |||
288 | Things of interest: | ||
289 | ------------------- | ||
290 | |||
291 | The driver is configured to try the LaserMate type of interface at I/O port | ||
292 | 0x0340 first. If this is not appropriate, sbpcd.h should get changed | ||
293 | (you will find the right place - just at the beginning). | ||
294 | |||
295 | No DMA and no IRQ is used. | ||
296 | |||
297 | To reduce or increase the amount of kernel messages, edit sbpcd.c and play | ||
298 | with the "DBG_xxx" switches (initialization of the variable "sbpcd_debug"). | ||
299 | Don't forget to reflect on what you do; enabling all DBG_xxx switches at once | ||
300 | may crash your system, and each message line is accompanied by a delay. | ||
301 | |||
302 | The driver uses the "variable BLOCK_SIZE" feature. To use it, you have to | ||
303 | specify "block=2048" as a mount option. Doing this will disable the direct | ||
304 | execution of a binary from the CD; you have to copy it to a device with the | ||
305 | standard BLOCK_SIZE (1024) first. So, do not use this if your system is | ||
306 | directly "running from the CDROM" (like some of Yggdrasil's installation | ||
307 | variants). There are CDs on the market (like the German "unifix" Linux | ||
308 | distribution) which MUST get handled with a block_size of 1024. Generally, | ||
309 | one can say all the CDs which hold files of the name YMTRANS.TBL are defective; | ||
310 | do not use block=2048 with those. | ||
311 | |||
312 | Within sbpcd.h, you will find some "#define"s (e.g. EJECT and JUKEBOX). With | ||
313 | these, you can configure the driver for some special things. | ||
314 | You can use the appended program "cdtester" to set the auto-eject feature | ||
315 | during runtime. Jeff Tranter's "eject" utility can do this, too (and more) | ||
316 | for you. | ||
317 | |||
318 | There is an ioctl CDROMMULTISESSION to obtain with a user program if | ||
319 | the CD is an XA disk and - if it is - where the last session starts. The | ||
320 | "cdtester" program illustrates how to call it. | ||
321 | |||
322 | |||
323 | Auto-probing at boot time: | ||
324 | -------------------------- | ||
325 | |||
326 | The driver does auto-probing at many well-known interface card addresses, | ||
327 | but not all: | ||
328 | Some probings can cause a hang if an NE2000 ethernet card gets touched, because | ||
329 | SBPCD's auto-probing happens before the initialization of the net drivers. | ||
330 | Those "hazardous" addresses are excluded from auto-probing; the "kernel | ||
331 | command line" feature has to be used during installation if you have your | ||
332 | drive at those addresses. The "module" version is allowed to probe at those | ||
333 | addresses, too. | ||
334 | |||
335 | The auto-probing looks first at the configured address resp. the address | ||
336 | submitted by the kernel command line. With this, it is possible to use this | ||
337 | driver within installation boot floppies, and for any non-standard address, | ||
338 | too. | ||
339 | |||
340 | Auto-probing will make an assumption about the interface type ("SBPRO" or not), | ||
341 | based upon the address. That assumption may be wrong (initialization will be | ||
342 | o.k., but you will get I/O errors during mount). In that case, use the "kernel | ||
343 | command line" feature and specify address & type at boot time to find out the | ||
344 | right setup. | ||
345 | |||
346 | For everyday use, address and type should get configured within sbpcd.h. That | ||
347 | will stop the auto-probing due to success with the first try. | ||
348 | |||
349 | The kernel command "sbpcd=0" suppresses each auto-probing and causes | ||
350 | the driver not to find any drive; it is meant for people who love sbpcd | ||
351 | so much that they do not want to miss it, even if they miss the drives. ;-) | ||
352 | |||
353 | If you configure "#define CDROM_PORT 0" in sbpcd.h, the auto-probing is | ||
354 | initially disabled and needs an explicit kernel command to get activated. | ||
355 | Once activated, it does not stop before success or end-of-list. This may be | ||
356 | useful within "universal" CDROM installation boot floppies (but using the | ||
357 | loadable module would be better because it allows an "extended" auto-probing | ||
358 | without fearing NE2000 cards). | ||
359 | |||
360 | To shorten the auto-probing list to a single entry, set DISTRIBUTION 0 within | ||
361 | sbpcd.h. | ||
362 | |||
363 | |||
364 | Setting up address and interface type: | ||
365 | -------------------------------------- | ||
366 | |||
367 | If your I/O port address is not 0x340, you have to look for the #defines near | ||
368 | the beginning of sbpcd.h and configure them: set SBPRO to 0 or 1 or 2, and | ||
369 | change CDROM_PORT to the address of your CDROM I/O port. | ||
370 | |||
371 | Almost all of the "SoundBlaster compatible" cards behave like the no-sound | ||
372 | interfaces, i.e. need SBPRO 0! | ||
373 | |||
374 | With "original" SB Pro cards, an initial setting of CD_volume through the | ||
375 | sound card's MIXER register gets done. | ||
376 | If you are using a "compatible" sound card of types "LaserMate" or "SPEA", | ||
377 | you can set SOUND_BASE (in sbpcd.h) to get it done with your card, too... | ||
378 | |||
379 | |||
380 | Using audio CDs: | ||
381 | ---------------- | ||
382 | |||
383 | Workman, WorkBone, xcdplayer, cdplayer and the nice little tool "cdplay" (see | ||
384 | README.aztcd from the Aztech driver package) should work. | ||
385 | |||
386 | The program CDplayer likes to talk to "/dev/mcd" only, xcdplayer wants | ||
387 | "/dev/rsr0", workman loves "/dev/sr0" or "/dev/cdrom" - so, make the | ||
388 | appropriate links to use them without the need to supply parameters. | ||
389 | |||
390 | |||
391 | Copying audio tracks: | ||
392 | --------------------- | ||
393 | |||
394 | The following program will copy track 1 (or a piece of it) from an audio CD | ||
395 | into the file "track01": | ||
396 | |||
397 | /*=================== begin program ========================================*/ | ||
398 | /* | ||
399 | * read an audio track from a CD | ||
400 | * | ||
401 | * (c) 1994 Eberhard Moenkeberg <emoenke@gwdg.de> | ||
402 | * may be used & enhanced freely | ||
403 | * | ||
404 | * Due to non-existent sync bytes at the beginning of each audio frame (or due | ||
405 | * to a firmware bug within all known drives?), it is currently a kind of | ||
406 | * fortune if two consecutive frames fit together. | ||
407 | * Usually, they overlap, or a little piece is missing. This happens in units | ||
408 | * of 24-byte chunks. It has to get fixed by higher-level software (reading | ||
409 | * until an overlap occurs, and then eliminate the overlapping chunks). | ||
410 | * ftp.gwdg.de:/pub/linux/misc/cdda2wav-sbpcd.*.tar.gz holds an example of | ||
411 | * such an algorithm. | ||
412 | * This example program further is missing to obtain the SubChannel data | ||
413 | * which belong to each frame. | ||
414 | * | ||
415 | * This is only an example of the low-level access routine. The read data are | ||
416 | * pure 16-bit CDDA values; they have to get converted to make sound out of | ||
417 | * them. | ||
418 | * It is no fun to listen to it without prior overlap/underlap correction! | ||
419 | */ | ||
420 | #include <stdio.h> | ||
421 | #include <sys/ioctl.h> | ||
422 | #include <sys/types.h> | ||
423 | #include <linux/cdrom.h> | ||
424 | |||
425 | static struct cdrom_tochdr hdr; | ||
426 | static struct cdrom_tocentry entry[101]; | ||
427 | static struct cdrom_read_audio arg; | ||
428 | static u_char buffer[CD_FRAMESIZE_RAW]; | ||
429 | static int datafile, drive; | ||
430 | static int i, j, limit, track, err; | ||
431 | static char filename[32]; | ||
432 | |||
433 | int main(int argc, char *argv[]) | ||
434 | { | ||
435 | /* | ||
436 | * open /dev/cdrom | ||
437 | */ | ||
438 | drive=open("/dev/cdrom", 0); | ||
439 | if (drive<0) | ||
440 | { | ||
441 | fprintf(stderr, "can't open drive.\n"); | ||
442 | exit (-1); | ||
443 | } | ||
444 | /* | ||
445 | * get TocHeader | ||
446 | */ | ||
447 | fprintf(stdout, "getting TocHeader...\n"); | ||
448 | err=ioctl(drive, CDROMREADTOCHDR, &hdr); | ||
449 | if (err!=0) | ||
450 | { | ||
451 | fprintf(stderr, "can't get TocHeader (error %d).\n", err); | ||
452 | exit (-1); | ||
453 | } | ||
454 | else | ||
455 | fprintf(stdout, "TocHeader: %d %d\n", hdr.cdth_trk0, hdr.cdth_trk1); | ||
456 | /* | ||
457 | * get and display all TocEntries | ||
458 | */ | ||
459 | fprintf(stdout, "getting TocEntries...\n"); | ||
460 | for (i=1;i<=hdr.cdth_trk1+1;i++) | ||
461 | { | ||
462 | if (i!=hdr.cdth_trk1+1) entry[i].cdte_track = i; | ||
463 | else entry[i].cdte_track = CDROM_LEADOUT; | ||
464 | entry[i].cdte_format = CDROM_LBA; | ||
465 | err=ioctl(drive, CDROMREADTOCENTRY, &entry[i]); | ||
466 | if (err!=0) | ||
467 | { | ||
468 | fprintf(stderr, "can't get TocEntry #%d (error %d).\n", i, err); | ||
469 | exit (-1); | ||
470 | } | ||
471 | else | ||
472 | { | ||
473 | fprintf(stdout, "TocEntry #%d: %1X %1X %06X %02X\n", | ||
474 | entry[i].cdte_track, | ||
475 | entry[i].cdte_adr, | ||
476 | entry[i].cdte_ctrl, | ||
477 | entry[i].cdte_addr.lba, | ||
478 | entry[i].cdte_datamode); | ||
479 | } | ||
480 | } | ||
481 | fprintf(stdout, "got all TocEntries.\n"); | ||
482 | /* | ||
483 | * ask for track number (not implemented here) | ||
484 | */ | ||
485 | track=1; | ||
486 | #if 0 /* just read a little piece (4 seconds) */ | ||
487 | entry[track+1].cdte_addr.lba=entry[track].cdte_addr.lba+300; | ||
488 | #endif | ||
489 | /* | ||
490 | * read track into file | ||
491 | */ | ||
492 | sprintf(filename, "track%02d\0", track); | ||
493 | datafile=creat(filename, 0755); | ||
494 | if (datafile<0) | ||
495 | { | ||
496 | fprintf(stderr, "can't open datafile %s.\n", filename); | ||
497 | exit (-1); | ||
498 | } | ||
499 | arg.addr.lba=entry[track].cdte_addr.lba; | ||
500 | arg.addr_format=CDROM_LBA; /* CDROM_MSF would be possible here, too. */ | ||
501 | arg.nframes=1; | ||
502 | arg.buf=&buffer[0]; | ||
503 | limit=entry[track+1].cdte_addr.lba; | ||
504 | for (;arg.addr.lba<limit;arg.addr.lba++) | ||
505 | { | ||
506 | err=ioctl(drive, CDROMREADAUDIO, &arg); | ||
507 | if (err!=0) | ||
508 | { | ||
509 | fprintf(stderr, "can't read abs. frame #%d (error %d).\n", | ||
510 | arg.addr.lba, err); | ||
511 | } | ||
512 | j=write(datafile, &buffer[0], CD_FRAMESIZE_RAW); | ||
513 | if (j!=CD_FRAMESIZE_RAW) | ||
514 | { | ||
515 | fprintf(stderr,"I/O error (datafile) at rel. frame %d\n", | ||
516 | arg.addr.lba-entry[track].cdte_addr.lba); | ||
517 | } | ||
518 | arg.addr.lba++; | ||
519 | } | ||
520 | return 0; | ||
521 | } | ||
522 | /*===================== end program ========================================*/ | ||
523 | |||
524 | At ftp.gwdg.de:/pub/linux/misc/cdda2wav-sbpcd.*.tar.gz is an adapted version of | ||
525 | Heiko Eissfeldt's digital-audio to .WAV converter (the original is there, too). | ||
526 | This is preliminary, as Heiko himself will care about it. | ||
527 | |||
528 | |||
529 | Known problems: | ||
530 | --------------- | ||
531 | |||
532 | Currently, the detection of disk change or removal is actively disabled. | ||
533 | |||
534 | Most attempts to read the UPC/EAN code result in a stream of zeroes. All my | ||
535 | drives are mostly telling there is no UPC/EAN code on disk or there is, but it | ||
536 | is an all-zero number. I guess now almost no CD holds such a number. | ||
537 | |||
538 | Bug reports, comments, wishes, donations (technical information is a donation, | ||
539 | too :-) etc. to emoenke@gwdg.de. | ||
540 | |||
541 | SnailMail address, preferable for CD editors if they want to submit a free | ||
542 | "cooperation" copy: | ||
543 | Eberhard Moenkeberg | ||
544 | Reinholdstr. 14 | ||
545 | D-37083 Goettingen | ||
546 | Germany | ||
547 | --- | ||
548 | |||
549 | |||
550 | Appendix -- the "cdtester" utility: | ||
551 | |||
552 | /* | ||
553 | * cdtester.c -- test the audio functions of a CD driver | ||
554 | * | ||
555 | * (c) 1995 Eberhard Moenkeberg <emoenke@gwdg.de> | ||
556 | * published under the GPL | ||
557 | * | ||
558 | * made under heavy use of the "Tiny Audio CD Player" | ||
559 | * from Werner Zimmermann <zimmerma@rz.fht-esslingen.de> | ||
560 | * (see linux/drivers/block/README.aztcd) | ||
561 | */ | ||
562 | #undef AZT_PRIVATE_IOCTLS /* not supported by every CDROM driver */ | ||
563 | #define SBP_PRIVATE_IOCTLS /* not supported by every CDROM driver */ | ||
564 | |||
565 | #include <stdio.h> | ||
566 | #include <stdio.h> | ||
567 | #include <malloc.h> | ||
568 | #include <sys/ioctl.h> | ||
569 | #include <sys/types.h> | ||
570 | #include <linux/cdrom.h> | ||
571 | |||
572 | #ifdef AZT_PRIVATE_IOCTLS | ||
573 | #include <linux/../../drivers/cdrom/aztcd.h> | ||
574 | #endif /* AZT_PRIVATE_IOCTLS */ | ||
575 | #ifdef SBP_PRIVATE_IOCTLS | ||
576 | #include <linux/../../drivers/cdrom/sbpcd.h> | ||
577 | #include <linux/fs.h> | ||
578 | #endif /* SBP_PRIVATE_IOCTLS */ | ||
579 | |||
580 | struct cdrom_tochdr hdr; | ||
581 | struct cdrom_tochdr tocHdr; | ||
582 | struct cdrom_tocentry TocEntry[101]; | ||
583 | struct cdrom_tocentry entry; | ||
584 | struct cdrom_multisession ms_info; | ||
585 | struct cdrom_read_audio read_audio; | ||
586 | struct cdrom_ti ti; | ||
587 | struct cdrom_subchnl subchnl; | ||
588 | struct cdrom_msf msf; | ||
589 | struct cdrom_volctrl volctrl; | ||
590 | #ifdef AZT_PRIVATE_IOCTLS | ||
591 | union | ||
592 | { | ||
593 | struct cdrom_msf msf; | ||
594 | unsigned char buf[CD_FRAMESIZE_RAW]; | ||
595 | } azt; | ||
596 | #endif /* AZT_PRIVATE_IOCTLS */ | ||
597 | int i, i1, i2, i3, j, k; | ||
598 | unsigned char sequence=0; | ||
599 | unsigned char command[80]; | ||
600 | unsigned char first=1, last=1; | ||
601 | char *default_device="/dev/cdrom"; | ||
602 | char dev[20]; | ||
603 | char filename[20]; | ||
604 | int drive; | ||
605 | int datafile; | ||
606 | int rc; | ||
607 | |||
608 | void help(void) | ||
609 | { | ||
610 | printf("Available Commands:\n"); | ||
611 | printf("STOP s EJECT e QUIT q\n"); | ||
612 | printf("PLAY TRACK t PAUSE p RESUME r\n"); | ||
613 | printf("NEXT TRACK n REPEAT LAST l HELP h\n"); | ||
614 | printf("SUBCHANNEL_Q c TRACK INFO i PLAY AT a\n"); | ||
615 | printf("READ d READ RAW w READ AUDIO A\n"); | ||
616 | printf("MS-INFO M TOC T START S\n"); | ||
617 | printf("SET EJECTSW X DEVICE D DEBUG Y\n"); | ||
618 | printf("AUDIO_BUFSIZ Z RESET R SET VOLUME v\n"); | ||
619 | printf("GET VOLUME V\n"); | ||
620 | } | ||
621 | |||
622 | /* | ||
623 | * convert MSF number (3 bytes only) to Logical_Block_Address | ||
624 | */ | ||
625 | int msf2lba(u_char *msf) | ||
626 | { | ||
627 | int i; | ||
628 | |||
629 | i=(msf[0] * CD_SECS + msf[1]) * CD_FRAMES + msf[2] - CD_BLOCK_OFFSET; | ||
630 | if (i<0) return (0); | ||
631 | return (i); | ||
632 | } | ||
633 | /* | ||
634 | * convert logical_block_address to m-s-f_number (3 bytes only) | ||
635 | */ | ||
636 | void lba2msf(int lba, unsigned char *msf) | ||
637 | { | ||
638 | lba += CD_BLOCK_OFFSET; | ||
639 | msf[0] = lba / (CD_SECS*CD_FRAMES); | ||
640 | lba %= CD_SECS*CD_FRAMES; | ||
641 | msf[1] = lba / CD_FRAMES; | ||
642 | msf[2] = lba % CD_FRAMES; | ||
643 | } | ||
644 | |||
645 | int init_drive(char *dev) | ||
646 | { | ||
647 | unsigned char msf_ent[3]; | ||
648 | |||
649 | /* | ||
650 | * open the device | ||
651 | */ | ||
652 | drive=open(dev,0); | ||
653 | if (drive<0) return (-1); | ||
654 | /* | ||
655 | * get TocHeader | ||
656 | */ | ||
657 | printf("getting TocHeader...\n"); | ||
658 | rc=ioctl(drive,CDROMREADTOCHDR,&hdr); | ||
659 | if (rc!=0) | ||
660 | { | ||
661 | printf("can't get TocHeader (error %d).\n",rc); | ||
662 | return (-2); | ||
663 | } | ||
664 | else | ||
665 | first=hdr.cdth_trk0; | ||
666 | last=hdr.cdth_trk1; | ||
667 | printf("TocHeader: %d %d\n",hdr.cdth_trk0,hdr.cdth_trk1); | ||
668 | /* | ||
669 | * get and display all TocEntries | ||
670 | */ | ||
671 | printf("getting TocEntries...\n"); | ||
672 | for (i=1;i<=hdr.cdth_trk1+1;i++) | ||
673 | { | ||
674 | if (i!=hdr.cdth_trk1+1) TocEntry[i].cdte_track = i; | ||
675 | else TocEntry[i].cdte_track = CDROM_LEADOUT; | ||
676 | TocEntry[i].cdte_format = CDROM_LBA; | ||
677 | rc=ioctl(drive,CDROMREADTOCENTRY,&TocEntry[i]); | ||
678 | if (rc!=0) | ||
679 | { | ||
680 | printf("can't get TocEntry #%d (error %d).\n",i,rc); | ||
681 | } | ||
682 | else | ||
683 | { | ||
684 | lba2msf(TocEntry[i].cdte_addr.lba,&msf_ent[0]); | ||
685 | if (TocEntry[i].cdte_track==CDROM_LEADOUT) | ||
686 | { | ||
687 | printf("TocEntry #%02X: %1X %1X %02d:%02d:%02d (lba: 0x%06X) %02X\n", | ||
688 | TocEntry[i].cdte_track, | ||
689 | TocEntry[i].cdte_adr, | ||
690 | TocEntry[i].cdte_ctrl, | ||
691 | msf_ent[0], | ||
692 | msf_ent[1], | ||
693 | msf_ent[2], | ||
694 | TocEntry[i].cdte_addr.lba, | ||
695 | TocEntry[i].cdte_datamode); | ||
696 | } | ||
697 | else | ||
698 | { | ||
699 | printf("TocEntry #%02d: %1X %1X %02d:%02d:%02d (lba: 0x%06X) %02X\n", | ||
700 | TocEntry[i].cdte_track, | ||
701 | TocEntry[i].cdte_adr, | ||
702 | TocEntry[i].cdte_ctrl, | ||
703 | msf_ent[0], | ||
704 | msf_ent[1], | ||
705 | msf_ent[2], | ||
706 | TocEntry[i].cdte_addr.lba, | ||
707 | TocEntry[i].cdte_datamode); | ||
708 | } | ||
709 | } | ||
710 | } | ||
711 | return (hdr.cdth_trk1); /* number of tracks */ | ||
712 | } | ||
713 | |||
714 | void display(int size,unsigned char *buffer) | ||
715 | { | ||
716 | k=0; | ||
717 | getchar(); | ||
718 | for (i=0;i<(size+1)/16;i++) | ||
719 | { | ||
720 | printf("%4d:",i*16); | ||
721 | for (j=0;j<16;j++) | ||
722 | { | ||
723 | printf(" %02X",buffer[i*16+j]); | ||
724 | } | ||
725 | printf(" "); | ||
726 | for (j=0;j<16;j++) | ||
727 | { | ||
728 | if (isalnum(buffer[i*16+j])) | ||
729 | printf("%c",buffer[i*16+j]); | ||
730 | else | ||
731 | printf("."); | ||
732 | } | ||
733 | printf("\n"); | ||
734 | k++; | ||
735 | if (k>=20) | ||
736 | { | ||
737 | printf("press ENTER to continue\n"); | ||
738 | getchar(); | ||
739 | k=0; | ||
740 | } | ||
741 | } | ||
742 | } | ||
743 | |||
744 | int main(int argc, char *argv[]) | ||
745 | { | ||
746 | printf("\nTesting tool for a CDROM driver's audio functions V0.1\n"); | ||
747 | printf("(C) 1995 Eberhard Moenkeberg <emoenke@gwdg.de>\n"); | ||
748 | printf("initializing...\n"); | ||
749 | |||
750 | rc=init_drive(default_device); | ||
751 | if (rc<0) printf("could not open %s (rc=%d).\n",default_device,rc); | ||
752 | help(); | ||
753 | while (1) | ||
754 | { | ||
755 | printf("Give a one-letter command (h = help): "); | ||
756 | scanf("%s",command); | ||
757 | command[1]=0; | ||
758 | switch (command[0]) | ||
759 | { | ||
760 | case 'D': | ||
761 | printf("device name (f.e. /dev/sbpcd3): ? "); | ||
762 | scanf("%s",&dev); | ||
763 | close(drive); | ||
764 | rc=init_drive(dev); | ||
765 | if (rc<0) printf("could not open %s (rc %d).\n",dev,rc); | ||
766 | break; | ||
767 | case 'e': | ||
768 | rc=ioctl(drive,CDROMEJECT); | ||
769 | if (rc<0) printf("CDROMEJECT: rc=%d.\n",rc); | ||
770 | break; | ||
771 | case 'p': | ||
772 | rc=ioctl(drive,CDROMPAUSE); | ||
773 | if (rc<0) printf("CDROMPAUSE: rc=%d.\n",rc); | ||
774 | break; | ||
775 | case 'r': | ||
776 | rc=ioctl(drive,CDROMRESUME); | ||
777 | if (rc<0) printf("CDROMRESUME: rc=%d.\n",rc); | ||
778 | break; | ||
779 | case 's': | ||
780 | rc=ioctl(drive,CDROMSTOP); | ||
781 | if (rc<0) printf("CDROMSTOP: rc=%d.\n",rc); | ||
782 | break; | ||
783 | case 'S': | ||
784 | rc=ioctl(drive,CDROMSTART); | ||
785 | if (rc<0) printf("CDROMSTART: rc=%d.\n",rc); | ||
786 | break; | ||
787 | case 't': | ||
788 | rc=ioctl(drive,CDROMREADTOCHDR,&tocHdr); | ||
789 | if (rc<0) | ||
790 | { | ||
791 | printf("CDROMREADTOCHDR: rc=%d.\n",rc); | ||
792 | break; | ||
793 | } | ||
794 | first=tocHdr.cdth_trk0; | ||
795 | last= tocHdr.cdth_trk1; | ||
796 | if ((first==0)||(first>last)) | ||
797 | { | ||
798 | printf ("--got invalid TOC data.\n"); | ||
799 | } | ||
800 | else | ||
801 | { | ||
802 | printf("--enter track number(first=%d, last=%d): ",first,last); | ||
803 | scanf("%d",&i1); | ||
804 | ti.cdti_trk0=i1; | ||
805 | if (ti.cdti_trk0<first) ti.cdti_trk0=first; | ||
806 | if (ti.cdti_trk0>last) ti.cdti_trk0=last; | ||
807 | ti.cdti_ind0=0; | ||
808 | ti.cdti_trk1=last; | ||
809 | ti.cdti_ind1=0; | ||
810 | rc=ioctl(drive,CDROMSTOP); | ||
811 | rc=ioctl(drive,CDROMPLAYTRKIND,&ti); | ||
812 | if (rc<0) printf("CDROMPLAYTRKIND: rc=%d.\n",rc); | ||
813 | } | ||
814 | break; | ||
815 | case 'n': | ||
816 | rc=ioctl(drive,CDROMSTOP); | ||
817 | if (++ti.cdti_trk0>last) ti.cdti_trk0=last; | ||
818 | ti.cdti_ind0=0; | ||
819 | ti.cdti_trk1=last; | ||
820 | ti.cdti_ind1=0; | ||
821 | rc=ioctl(drive,CDROMPLAYTRKIND,&ti); | ||
822 | if (rc<0) printf("CDROMPLAYTRKIND: rc=%d.\n",rc); | ||
823 | break; | ||
824 | case 'l': | ||
825 | rc=ioctl(drive,CDROMSTOP); | ||
826 | if (--ti.cdti_trk0<first) ti.cdti_trk0=first; | ||
827 | ti.cdti_ind0=0; | ||
828 | ti.cdti_trk1=last; | ||
829 | ti.cdti_ind1=0; | ||
830 | rc=ioctl(drive,CDROMPLAYTRKIND,&ti); | ||
831 | if (rc<0) printf("CDROMPLAYTRKIND: rc=%d.\n",rc); | ||
832 | break; | ||
833 | case 'c': | ||
834 | subchnl.cdsc_format=CDROM_MSF; | ||
835 | rc=ioctl(drive,CDROMSUBCHNL,&subchnl); | ||
836 | if (rc<0) printf("CDROMSUBCHNL: rc=%d.\n",rc); | ||
837 | else | ||
838 | { | ||
839 | printf("AudioStatus:%s Track:%d Mode:%d MSF=%02d:%02d:%02d\n", | ||
840 | subchnl.cdsc_audiostatus==CDROM_AUDIO_PLAY ? "PLAYING":"NOT PLAYING", | ||
841 | subchnl.cdsc_trk,subchnl.cdsc_adr, | ||
842 | subchnl.cdsc_absaddr.msf.minute, | ||
843 | subchnl.cdsc_absaddr.msf.second, | ||
844 | subchnl.cdsc_absaddr.msf.frame); | ||
845 | } | ||
846 | break; | ||
847 | case 'i': | ||
848 | printf("Track No.: "); | ||
849 | scanf("%d",&i1); | ||
850 | entry.cdte_track=i1; | ||
851 | if (entry.cdte_track<first) entry.cdte_track=first; | ||
852 | if (entry.cdte_track>last) entry.cdte_track=last; | ||
853 | entry.cdte_format=CDROM_MSF; | ||
854 | rc=ioctl(drive,CDROMREADTOCENTRY,&entry); | ||
855 | if (rc<0) printf("CDROMREADTOCENTRY: rc=%d.\n",rc); | ||
856 | else | ||
857 | { | ||
858 | printf("Mode %d Track, starts at %02d:%02d:%02d\n", | ||
859 | entry.cdte_adr, | ||
860 | entry.cdte_addr.msf.minute, | ||
861 | entry.cdte_addr.msf.second, | ||
862 | entry.cdte_addr.msf.frame); | ||
863 | } | ||
864 | break; | ||
865 | case 'a': | ||
866 | printf("Address (min:sec:frm) "); | ||
867 | scanf("%d:%d:%d",&i1,&i2,&i3); | ||
868 | msf.cdmsf_min0=i1; | ||
869 | msf.cdmsf_sec0=i2; | ||
870 | msf.cdmsf_frame0=i3; | ||
871 | if (msf.cdmsf_sec0>59) msf.cdmsf_sec0=59; | ||
872 | if (msf.cdmsf_frame0>74) msf.cdmsf_frame0=74; | ||
873 | lba2msf(TocEntry[last+1].cdte_addr.lba-1,&msf.cdmsf_min1); | ||
874 | rc=ioctl(drive,CDROMSTOP); | ||
875 | rc=ioctl(drive,CDROMPLAYMSF,&msf); | ||
876 | if (rc<0) printf("CDROMPLAYMSF: rc=%d.\n",rc); | ||
877 | break; | ||
878 | case 'V': | ||
879 | rc=ioctl(drive,CDROMVOLREAD,&volctrl); | ||
880 | if (rc<0) printf("CDROMVOLCTRL: rc=%d.\n",rc); | ||
881 | printf("Volume: channel 0 (left) %d, channel 1 (right) %d\n",volctrl.channel0,volctrl.channel1); | ||
882 | break; | ||
883 | case 'R': | ||
884 | rc=ioctl(drive,CDROMRESET); | ||
885 | if (rc<0) printf("CDROMRESET: rc=%d.\n",rc); | ||
886 | break; | ||
887 | #ifdef AZT_PRIVATE_IOCTLS /*not supported by every CDROM driver*/ | ||
888 | case 'd': | ||
889 | printf("Address (min:sec:frm) "); | ||
890 | scanf("%d:%d:%d",&i1,&i2,&i3); | ||
891 | azt.msf.cdmsf_min0=i1; | ||
892 | azt.msf.cdmsf_sec0=i2; | ||
893 | azt.msf.cdmsf_frame0=i3; | ||
894 | if (azt.msf.cdmsf_sec0>59) azt.msf.cdmsf_sec0=59; | ||
895 | if (azt.msf.cdmsf_frame0>74) azt.msf.cdmsf_frame0=74; | ||
896 | rc=ioctl(drive,CDROMREADMODE1,&azt.msf); | ||
897 | if (rc<0) printf("CDROMREADMODE1: rc=%d.\n",rc); | ||
898 | else display(CD_FRAMESIZE,azt.buf); | ||
899 | break; | ||
900 | case 'w': | ||
901 | printf("Address (min:sec:frame) "); | ||
902 | scanf("%d:%d:%d",&i1,&i2,&i3); | ||
903 | azt.msf.cdmsf_min0=i1; | ||
904 | azt.msf.cdmsf_sec0=i2; | ||
905 | azt.msf.cdmsf_frame0=i3; | ||
906 | if (azt.msf.cdmsf_sec0>59) azt.msf.cdmsf_sec0=59; | ||
907 | if (azt.msf.cdmsf_frame0>74) azt.msf.cdmsf_frame0=74; | ||
908 | rc=ioctl(drive,CDROMREADMODE2,&azt.msf); | ||
909 | if (rc<0) printf("CDROMREADMODE2: rc=%d.\n",rc); | ||
910 | else display(CD_FRAMESIZE_RAW,azt.buf); /* currently only 2336 */ | ||
911 | break; | ||
912 | #endif | ||
913 | case 'v': | ||
914 | printf("--Channel 0 (Left) (0-255): "); | ||
915 | scanf("%d",&i1); | ||
916 | volctrl.channel0=i1; | ||
917 | printf("--Channel 1 (Right) (0-255): "); | ||
918 | scanf("%d",&i1); | ||
919 | volctrl.channel1=i1; | ||
920 | volctrl.channel2=0; | ||
921 | volctrl.channel3=0; | ||
922 | rc=ioctl(drive,CDROMVOLCTRL,&volctrl); | ||
923 | if (rc<0) printf("CDROMVOLCTRL: rc=%d.\n",rc); | ||
924 | break; | ||
925 | case 'q': | ||
926 | close(drive); | ||
927 | exit(0); | ||
928 | case 'h': | ||
929 | help(); | ||
930 | break; | ||
931 | case 'T': /* display TOC entry - without involving the driver */ | ||
932 | scanf("%d",&i); | ||
933 | if ((i<hdr.cdth_trk0)||(i>hdr.cdth_trk1)) | ||
934 | printf("invalid track number.\n"); | ||
935 | else | ||
936 | printf("TocEntry %02d: adr=%01X ctrl=%01X msf=%02d:%02d:%02d mode=%02X\n", | ||
937 | TocEntry[i].cdte_track, | ||
938 | TocEntry[i].cdte_adr, | ||
939 | TocEntry[i].cdte_ctrl, | ||
940 | TocEntry[i].cdte_addr.msf.minute, | ||
941 | TocEntry[i].cdte_addr.msf.second, | ||
942 | TocEntry[i].cdte_addr.msf.frame, | ||
943 | TocEntry[i].cdte_datamode); | ||
944 | break; | ||
945 | case 'A': /* read audio data into file */ | ||
946 | printf("Address (min:sec:frm) ? "); | ||
947 | scanf("%d:%d:%d",&i1,&i2,&i3); | ||
948 | read_audio.addr.msf.minute=i1; | ||
949 | read_audio.addr.msf.second=i2; | ||
950 | read_audio.addr.msf.frame=i3; | ||
951 | read_audio.addr_format=CDROM_MSF; | ||
952 | printf("# of frames ? "); | ||
953 | scanf("%d",&i1); | ||
954 | read_audio.nframes=i1; | ||
955 | k=read_audio.nframes*CD_FRAMESIZE_RAW; | ||
956 | read_audio.buf=malloc(k); | ||
957 | if (read_audio.buf==NULL) | ||
958 | { | ||
959 | printf("can't malloc %d bytes.\n",k); | ||
960 | break; | ||
961 | } | ||
962 | sprintf(filename,"audio_%02d%02d%02d_%02d.%02d\0", | ||
963 | read_audio.addr.msf.minute, | ||
964 | read_audio.addr.msf.second, | ||
965 | read_audio.addr.msf.frame, | ||
966 | read_audio.nframes, | ||
967 | ++sequence); | ||
968 | datafile=creat(filename, 0755); | ||
969 | if (datafile<0) | ||
970 | { | ||
971 | printf("can't open datafile %s.\n",filename); | ||
972 | break; | ||
973 | } | ||
974 | rc=ioctl(drive,CDROMREADAUDIO,&read_audio); | ||
975 | if (rc!=0) | ||
976 | { | ||
977 | printf("CDROMREADAUDIO: rc=%d.\n",rc); | ||
978 | } | ||
979 | else | ||
980 | { | ||
981 | rc=write(datafile,&read_audio.buf,k); | ||
982 | if (rc!=k) printf("datafile I/O error (%d).\n",rc); | ||
983 | } | ||
984 | close(datafile); | ||
985 | break; | ||
986 | case 'X': /* set EJECT_SW (0: disable, 1: enable auto-ejecting) */ | ||
987 | scanf("%d",&i); | ||
988 | rc=ioctl(drive,CDROMEJECT_SW,i); | ||
989 | if (rc!=0) | ||
990 | printf("CDROMEJECT_SW: rc=%d.\n",rc); | ||
991 | else | ||
992 | printf("EJECT_SW set to %d\n",i); | ||
993 | break; | ||
994 | case 'M': /* get the multisession redirection info */ | ||
995 | ms_info.addr_format=CDROM_LBA; | ||
996 | rc=ioctl(drive,CDROMMULTISESSION,&ms_info); | ||
997 | if (rc!=0) | ||
998 | { | ||
999 | printf("CDROMMULTISESSION(lba): rc=%d.\n",rc); | ||
1000 | } | ||
1001 | else | ||
1002 | { | ||
1003 | if (ms_info.xa_flag) printf("MultiSession offset (lba): %d (0x%06X)\n",ms_info.addr.lba,ms_info.addr.lba); | ||
1004 | else | ||
1005 | { | ||
1006 | printf("this CD is not an XA disk.\n"); | ||
1007 | break; | ||
1008 | } | ||
1009 | } | ||
1010 | ms_info.addr_format=CDROM_MSF; | ||
1011 | rc=ioctl(drive,CDROMMULTISESSION,&ms_info); | ||
1012 | if (rc!=0) | ||
1013 | { | ||
1014 | printf("CDROMMULTISESSION(msf): rc=%d.\n",rc); | ||
1015 | } | ||
1016 | else | ||
1017 | { | ||
1018 | if (ms_info.xa_flag) | ||
1019 | printf("MultiSession offset (msf): %02d:%02d:%02d (0x%02X%02X%02X)\n", | ||
1020 | ms_info.addr.msf.minute, | ||
1021 | ms_info.addr.msf.second, | ||
1022 | ms_info.addr.msf.frame, | ||
1023 | ms_info.addr.msf.minute, | ||
1024 | ms_info.addr.msf.second, | ||
1025 | ms_info.addr.msf.frame); | ||
1026 | else printf("this CD is not an XA disk.\n"); | ||
1027 | } | ||
1028 | break; | ||
1029 | #ifdef SBP_PRIVATE_IOCTLS | ||
1030 | case 'Y': /* set the driver's message level */ | ||
1031 | #if 0 /* not implemented yet */ | ||
1032 | printf("enter switch name (f.e. DBG_CMD): "); | ||
1033 | scanf("%s",&dbg_switch); | ||
1034 | j=get_dbg_num(dbg_switch); | ||
1035 | #else | ||
1036 | printf("enter DDIOCSDBG switch number: "); | ||
1037 | scanf("%d",&j); | ||
1038 | #endif | ||
1039 | printf("enter 0 for \"off\", 1 for \"on\": "); | ||
1040 | scanf("%d",&i); | ||
1041 | if (i==0) j|=0x80; | ||
1042 | printf("calling \"ioctl(drive,DDIOCSDBG,%d)\"\n",j); | ||
1043 | rc=ioctl(drive,DDIOCSDBG,j); | ||
1044 | printf("DDIOCSDBG: rc=%d.\n",rc); | ||
1045 | break; | ||
1046 | case 'Z': /* set the audio buffer size */ | ||
1047 | printf("# frames wanted: ? "); | ||
1048 | scanf("%d",&j); | ||
1049 | rc=ioctl(drive,CDROMAUDIOBUFSIZ,j); | ||
1050 | printf("%d frames granted.\n",rc); | ||
1051 | break; | ||
1052 | #endif /* SBP_PRIVATE_IOCTLS */ | ||
1053 | default: | ||
1054 | printf("unknown command: \"%s\".\n",command); | ||
1055 | break; | ||
1056 | } | ||
1057 | } | ||
1058 | return 0; | ||
1059 | } | ||
1060 | /*==========================================================================*/ | ||
1061 | |||
diff --git a/Documentation/cdrom/sjcd b/Documentation/cdrom/sjcd deleted file mode 100644 index 74a14847b93a..000000000000 --- a/Documentation/cdrom/sjcd +++ /dev/null | |||
@@ -1,60 +0,0 @@ | |||
1 | -- Documentation/cdrom/sjcd | ||
2 | 80% of the work takes 20% of the time, | ||
3 | 20% of the work takes 80% of the time... | ||
4 | (Murphy's law) | ||
5 | |||
6 | Once started, training can not be stopped... | ||
7 | (Star Wars) | ||
8 | |||
9 | This is the README for the sjcd cdrom driver, version 1.6. | ||
10 | |||
11 | This file is meant as a tips & tricks edge for the usage of the SANYO CDR-H94A | ||
12 | cdrom drive. It will grow as the questions arise. ;-) | ||
13 | For info on configuring the ISP16 sound card look at Documentation/cdrom/isp16. | ||
14 | |||
15 | The driver should work with any of the Panasonic, Sony or Mitsumi style | ||
16 | CDROM interfaces. | ||
17 | The cdrom interface on Media Magic's soft configurable sound card ISP16, | ||
18 | which used to be included in the driver, is now supported in a separate module. | ||
19 | This initialisation module will probably also work with other interfaces | ||
20 | based on an OPTi 82C928 or 82C929 chip (like MAD16 and Mozart): see the | ||
21 | documentation Documentation/cdrom/isp16. | ||
22 | |||
23 | The device major for sjcd is 18, and minor is 0. Create a block special | ||
24 | file in your /dev directory (e.g., /dev/sjcd) with these numbers. | ||
25 | (For those who don't know, being root and doing the following should do | ||
26 | the trick: | ||
27 | mknod -m 644 /dev/sjcd b 18 0 | ||
28 | and mount the cdrom by /dev/sjcd). | ||
29 | |||
30 | The default configuration parameters are: | ||
31 | base address 0x340 | ||
32 | no irq | ||
33 | no dma | ||
34 | (Actually the CDR-H94A doesn't know how to use irq and dma.) | ||
35 | As of version 1.2, setting base address at boot time is supported | ||
36 | through the use of command line options: type at the "boot:" prompt: | ||
37 | linux sjcd=<base_address> | ||
38 | (where you would use the kernel labeled "linux" in lilo's configuration | ||
39 | file /etc/lilo.conf). You could also use 'append="sjcd=<configuration_info>"' | ||
40 | in the appropriate section of /etc/lilo.conf | ||
41 | If you're building a kernel yourself you can set your default base | ||
42 | i/o address with SJCD_BASE_ADDR in /usr/src/linux/drivers/cdrom/sjcd.h. | ||
43 | |||
44 | The sjcd driver supports being loaded as a module. The following | ||
45 | command will set the base i/o address on the fly (assuming you | ||
46 | have installed the module in an appropriate place). | ||
47 | insmod sjcd.o sjcd_base=<base_address> | ||
48 | |||
49 | |||
50 | Have fun! | ||
51 | |||
52 | If something is wrong, please email to vadim@rbrf.ru | ||
53 | or vadim@ipsun.ras.ru | ||
54 | or model@cecmow.enet.dec.com | ||
55 | or H.T.M.v.d.Maarel@marin.nl | ||
56 | |||
57 | It happens sometimes that Vadim is not reachable by mail. For these | ||
58 | instances, Eric van der Maarel will help too. | ||
59 | |||
60 | Vadim V. Model, Eric van der Maarel, Eberhard Moenkeberg | ||
diff --git a/Documentation/cdrom/sonycd535 b/Documentation/cdrom/sonycd535 deleted file mode 100644 index b81e109970aa..000000000000 --- a/Documentation/cdrom/sonycd535 +++ /dev/null | |||
@@ -1,122 +0,0 @@ | |||
1 | README FOR LINUX SONY CDU-535/531 DRIVER | ||
2 | ======================================== | ||
3 | |||
4 | This is the Sony CDU-535 (and 531) driver version 0.7 for Linux. | ||
5 | I do not think I have the documentation to add features like DMA support | ||
6 | so if anyone else wants to pursue it or help me with it, please do. | ||
7 | (I need to see what was done for the CDU-31A driver -- perhaps I can | ||
8 | steal some of that code.) | ||
9 | |||
10 | This is a Linux device driver for the Sony CDU-535 CDROM drive. This is | ||
11 | one of the older Sony drives with its own interface card (Sony bus). | ||
12 | The DOS driver for this drive is named SONY_CDU.SYS - when you boot DOS | ||
13 | your drive should be identified as a SONY CDU-535. The driver works | ||
14 | with a CDU-531 also. One user reported that the driver worked on drives | ||
15 | OEM'ed by Procomm, drive and interface board were labelled Procomm. | ||
16 | |||
17 | The Linux driver is based on Corey Minyard's sonycd 0.3 driver for | ||
18 | the CDU-31A. Ron Jeppesen just changed the commands that were sent | ||
19 | to the drive to correspond to the CDU-535 commands and registers. | ||
20 | There were enough changes to let bugs creep in but it seems to be stable. | ||
21 | Ron was able to tar an entire CDROM (should read all blocks) and built | ||
22 | ghostview and xfig off Walnut Creek's X11R5/GNU CDROM. xcdplayer and | ||
23 | workman work with the driver. Others have used the driver without | ||
24 | problems except those dealing with wait loops (fixed in third release). | ||
25 | Like Minyard's original driver this one uses a polled interface (this | ||
26 | is also the default setup for the DOS driver). It has not been tried | ||
27 | with interrupts or DMA enabled on the board. | ||
28 | |||
29 | REQUIREMENTS | ||
30 | ============ | ||
31 | |||
32 | - Sony CDU-535 drive, preferably without interrupts and DMA | ||
33 | enabled on the card. | ||
34 | |||
35 | - Drive must be set up as unit 1. Only the first unit will be | ||
36 | recognized | ||
37 | |||
38 | - You must enter your interface address into | ||
39 | /usr/src/linux/drivers/cdrom/sonycd535.h and build the | ||
40 | appropriate kernel or use the "kernel command line" parameter | ||
41 | sonycd535=0x320 | ||
42 | with the correct interface address. | ||
43 | |||
44 | NOTES: | ||
45 | ====== | ||
46 | |||
47 | 1) The drive MUST be turned on when booting or it will not be recognized! | ||
48 | (but see comments on modularized version below) | ||
49 | |||
50 | 2) when the cdrom device is opened the eject button is disabled to keep the | ||
51 | user from ejecting a mounted disk and replacing it with another. | ||
52 | Unfortunately xcdplayer and workman also open the cdrom device so you | ||
53 | have to use the eject button in the software. Keep this in mind if your | ||
54 | cdrom player refuses to give up its disk -- exit workman or xcdplayer, or | ||
55 | umount the drive if it has been mounted. | ||
56 | |||
57 | THANKS | ||
58 | ====== | ||
59 | |||
60 | Many thanks to Ron Jeppesen (ronj.an@site007.saic.com) for getting | ||
61 | this project off the ground. He wrote the initial release | ||
62 | and the first two patches to this driver (0.1, 0.2, and 0.3). | ||
63 | Thanks also to Eberhard Moenkeberg (emoenke@gwdg.de) for prodding | ||
64 | me to place this code into the mainstream Linux source tree | ||
65 | (as of Linux version 1.1.91), as well as some patches to make | ||
66 | it a better device citizen. Further thanks to Joel Katz | ||
67 | <joelkatz@webchat.org> for his MODULE patches (see details below), | ||
68 | Porfiri Claudio <C.Porfiri@nisms.tei.ericsson.se> for patches | ||
69 | to make the driver work with the older CDU-510/515 series, and | ||
70 | Heiko Eissfeldt <heiko@colossus.escape.de> for pointing out that | ||
71 | the verify_area() checks were ignoring the results of said checks | ||
72 | (note: verify_area() has since been replaced by access_ok()). | ||
73 | |||
74 | (Acknowledgments from Ron Jeppesen in the 0.3 release:) | ||
75 | Thanks to Corey Minyard who wrote the original CDU-31A driver on which | ||
76 | this driver is based. Thanks to Ken Pizzini and Bob Blair who provided | ||
77 | patches and feedback on the first release of this driver. | ||
78 | |||
79 | Ken Pizzini | ||
80 | ken@halcyon.com | ||
81 | |||
82 | ------------------------------------------------------------------------------ | ||
83 | (The following is from Joel Katz <joelkatz@webchat.org>.) | ||
84 | |||
85 | To build a version of sony535.o that can be installed as a module, | ||
86 | use the following command: | ||
87 | |||
88 | gcc -c -D__KERNEL__ -DMODULE -O2 sonycd535.c -o sonycd535.o | ||
89 | |||
90 | To install the module, simply type: | ||
91 | |||
92 | insmod sony535.o | ||
93 | or | ||
94 | insmod sony535.o sonycd535=<address> | ||
95 | |||
96 | And to remove it: | ||
97 | |||
98 | rmmod sony535 | ||
99 | |||
100 | The code checks to see if MODULE is defined and behaves as it used | ||
101 | to if MODULE is not defined. That means your patched file should behave | ||
102 | exactly as it used to if compiled into the kernel. | ||
103 | |||
104 | I have an external drive, and I usually leave it powered off. I used | ||
105 | to have to reboot if I needed to use the CDROM drive. Now I don't. | ||
106 | |||
107 | Even if you have an internal drive, why waste the 96K of memory | ||
108 | (unswappable) that the driver uses if you use your CD-ROM drive infrequently? | ||
109 | |||
110 | This driver will not install (whether compiled in or loaded as a | ||
111 | module) if the CDROM drive is not available during its initialization. This | ||
112 | means that you can have the driver compiled into the kernel and still load | ||
113 | the module later (assuming the driver doesn't install itself during | ||
114 | power-on). This only wastes 12K when you boot with the CDROM drive off. | ||
115 | |||
116 | This is what I usually do; I leave the driver compiled into the | ||
117 | kernel, but load it as a module if I powered the system up with the drive | ||
118 | off and then later decided to use the CDROM drive. | ||
119 | |||
120 | Since the driver only uses a single page to point to the chunks, | ||
121 | attempting to set the buffer cache to more than 2 Megabytes would be very | ||
122 | bad; don't do that. | ||
diff --git a/Documentation/fault-injection/failcmd.sh b/Documentation/fault-injection/failcmd.sh deleted file mode 100644 index 63177aba8106..000000000000 --- a/Documentation/fault-injection/failcmd.sh +++ /dev/null | |||
@@ -1,4 +0,0 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | echo 1 > /proc/self/make-it-fail | ||
4 | exec $* | ||
diff --git a/Documentation/fault-injection/failmodule.sh b/Documentation/fault-injection/failmodule.sh deleted file mode 100644 index 474a8b971f9c..000000000000 --- a/Documentation/fault-injection/failmodule.sh +++ /dev/null | |||
@@ -1,31 +0,0 @@ | |||
1 | #!/bin/bash | ||
2 | # | ||
3 | # Usage: failmodule <failname> <modulename> [stacktrace-depth] | ||
4 | # | ||
5 | # <failname>: "failslab", "fail_alloc_page", or "fail_make_request" | ||
6 | # | ||
7 | # <modulename>: module name that you want to inject faults. | ||
8 | # | ||
9 | # [stacktrace-depth]: the maximum number of stacktrace walking allowed | ||
10 | # | ||
11 | |||
12 | STACKTRACE_DEPTH=5 | ||
13 | if [ $# -gt 2 ]; then | ||
14 | STACKTRACE_DEPTH=$3 | ||
15 | fi | ||
16 | |||
17 | if [ ! -d /debug/$1 ]; then | ||
18 | echo "Fault-injection $1 does not exist" >&2 | ||
19 | exit 1 | ||
20 | fi | ||
21 | if [ ! -d /sys/module/$2 ]; then | ||
22 | echo "Module $2 does not exist" >&2 | ||
23 | exit 1 | ||
24 | fi | ||
25 | |||
26 | # Disable any fault injection | ||
27 | echo 0 > /debug/$1/stacktrace-depth | ||
28 | |||
29 | echo `cat /sys/module/$2/sections/.text` > /debug/$1/require-start | ||
30 | echo `cat /sys/module/$2/sections/.exit.text` > /debug/$1/require-end | ||
31 | echo $STACKTRACE_DEPTH > /debug/$1/stacktrace-depth | ||
diff --git a/Documentation/fault-injection/fault-injection.txt b/Documentation/fault-injection/fault-injection.txt index b7ca560b9340..4bc374a14345 100644 --- a/Documentation/fault-injection/fault-injection.txt +++ b/Documentation/fault-injection/fault-injection.txt | |||
@@ -103,6 +103,11 @@ configuration of fault-injection capabilities. | |||
103 | default is 'N', setting it to 'Y' will inject failures | 103 | default is 'N', setting it to 'Y' will inject failures |
104 | only into non-sleep allocations (GFP_ATOMIC allocations). | 104 | only into non-sleep allocations (GFP_ATOMIC allocations). |
105 | 105 | ||
106 | - /debug/fail_page_alloc/min-order: | ||
107 | |||
108 | specifies the minimum page allocation order to be injected | ||
109 | failures. | ||
110 | |||
106 | o Boot option | 111 | o Boot option |
107 | 112 | ||
108 | In order to inject faults while debugfs is not available (early boot time), | 113 | In order to inject faults while debugfs is not available (early boot time), |
@@ -156,70 +161,77 @@ o add a hook to insert failures | |||
156 | Application Examples | 161 | Application Examples |
157 | -------------------- | 162 | -------------------- |
158 | 163 | ||
159 | o inject slab allocation failures into module init/cleanup code | 164 | o Inject slab allocation failures into module init/exit code |
160 | 165 | ||
161 | ------------------------------------------------------------------------------ | ||
162 | #!/bin/bash | 166 | #!/bin/bash |
163 | 167 | ||
164 | FAILCMD=Documentation/fault-injection/failcmd.sh | 168 | FAILTYPE=failslab |
165 | BLACKLIST="root_plug evbug" | 169 | echo Y > /debug/$FAILTYPE/task-filter |
166 | 170 | echo 10 > /debug/$FAILTYPE/probability | |
167 | FAILNAME=failslab | 171 | echo 100 > /debug/$FAILTYPE/interval |
168 | echo Y > /debug/$FAILNAME/task-filter | 172 | echo -1 > /debug/$FAILTYPE/times |
169 | echo 10 > /debug/$FAILNAME/probability | 173 | echo 0 > /debug/$FAILTYPE/space |
170 | echo 100 > /debug/$FAILNAME/interval | 174 | echo 2 > /debug/$FAILTYPE/verbose |
171 | echo -1 > /debug/$FAILNAME/times | 175 | echo 1 > /debug/$FAILTYPE/ignore-gfp-wait |
172 | echo 2 > /debug/$FAILNAME/verbose | ||
173 | echo 1 > /debug/$FAILNAME/ignore-gfp-wait | ||
174 | 176 | ||
175 | blacklist() | 177 | faulty_system() |
176 | { | 178 | { |
177 | echo $BLACKLIST | grep $1 > /dev/null 2>&1 | 179 | bash -c "echo 1 > /proc/self/make-it-fail && exec $*" |
178 | } | 180 | } |
179 | 181 | ||
180 | oops() | 182 | if [ $# -eq 0 ] |
181 | { | 183 | then |
182 | dmesg | grep BUG > /dev/null 2>&1 | 184 | echo "Usage: $0 modulename [ modulename ... ]" |
183 | } | 185 | exit 1 |
186 | fi | ||
187 | |||
188 | for m in $* | ||
189 | do | ||
190 | echo inserting $m... | ||
191 | faulty_system modprobe $m | ||
184 | 192 | ||
185 | find /lib/modules/`uname -r` -name '*.ko' -exec basename {} .ko \; | | 193 | echo removing $m... |
186 | while read i | 194 | faulty_system modprobe -r $m |
187 | do | 195 | done |
188 | oops && exit 1 | ||
189 | |||
190 | if ! blacklist $i | ||
191 | then | ||
192 | echo inserting $i... | ||
193 | bash $FAILCMD modprobe $i | ||
194 | fi | ||
195 | done | ||
196 | |||
197 | lsmod | awk '{ if ($3 == 0) { print $1 } }' | | ||
198 | while read i | ||
199 | do | ||
200 | oops && exit 1 | ||
201 | |||
202 | if ! blacklist $i | ||
203 | then | ||
204 | echo removing $i... | ||
205 | bash $FAILCMD modprobe -r $i | ||
206 | fi | ||
207 | done | ||
208 | 196 | ||
209 | ------------------------------------------------------------------------------ | 197 | ------------------------------------------------------------------------------ |
210 | 198 | ||
211 | o inject slab allocation failures only for a specific module | 199 | o Inject page allocation failures only for a specific module |
212 | 200 | ||
213 | ------------------------------------------------------------------------------ | ||
214 | #!/bin/bash | 201 | #!/bin/bash |
215 | 202 | ||
216 | FAILMOD=Documentation/fault-injection/failmodule.sh | 203 | FAILTYPE=fail_page_alloc |
204 | module=$1 | ||
217 | 205 | ||
218 | echo injecting errors into the module $1... | 206 | if [ -z $module ] |
207 | then | ||
208 | echo "Usage: $0 <modulename>" | ||
209 | exit 1 | ||
210 | fi | ||
219 | 211 | ||
220 | modprobe $1 | 212 | modprobe $module |
221 | bash $FAILMOD failslab $1 10 | ||
222 | echo 25 > /debug/failslab/probability | ||
223 | 213 | ||
224 | ------------------------------------------------------------------------------ | 214 | if [ ! -d /sys/module/$module/sections ] |
215 | then | ||
216 | echo Module $module is not loaded | ||
217 | exit 1 | ||
218 | fi | ||
219 | |||
220 | cat /sys/module/$module/sections/.text > /debug/$FAILTYPE/require-start | ||
221 | cat /sys/module/$module/sections/.data > /debug/$FAILTYPE/require-end | ||
222 | |||
223 | echo N > /debug/$FAILTYPE/task-filter | ||
224 | echo 10 > /debug/$FAILTYPE/probability | ||
225 | echo 100 > /debug/$FAILTYPE/interval | ||
226 | echo -1 > /debug/$FAILTYPE/times | ||
227 | echo 0 > /debug/$FAILTYPE/space | ||
228 | echo 2 > /debug/$FAILTYPE/verbose | ||
229 | echo 1 > /debug/$FAILTYPE/ignore-gfp-wait | ||
230 | echo 1 > /debug/$FAILTYPE/ignore-gfp-highmem | ||
231 | echo 10 > /debug/$FAILTYPE/stacktrace-depth | ||
232 | |||
233 | trap "echo 0 > /debug/$FAILTYPE/probability" SIGINT SIGTERM EXIT | ||
234 | |||
235 | echo "Injecting errors into the module $module... (interrupt to stop)" | ||
236 | sleep 1000000 | ||
225 | 237 | ||
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index 55b5d6a210d8..d05e6243b4df 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt | |||
@@ -41,14 +41,6 @@ Who: Pavel Machek <pavel@suse.cz> | |||
41 | 41 | ||
42 | --------------------------- | 42 | --------------------------- |
43 | 43 | ||
44 | What: RAW driver (CONFIG_RAW_DRIVER) | ||
45 | When: December 2005 | ||
46 | Why: declared obsolete since kernel 2.6.3 | ||
47 | O_DIRECT can be used instead | ||
48 | Who: Adrian Bunk <bunk@stusta.de> | ||
49 | |||
50 | --------------------------- | ||
51 | |||
52 | What: old NCR53C9x driver | 44 | What: old NCR53C9x driver |
53 | When: October 2007 | 45 | When: October 2007 |
54 | Why: Replaced by the much better esp_scsi driver. Actual low-level | 46 | Why: Replaced by the much better esp_scsi driver. Actual low-level |
@@ -119,13 +111,6 @@ Who: Adrian Bunk <bunk@stusta.de> | |||
119 | 111 | ||
120 | --------------------------- | 112 | --------------------------- |
121 | 113 | ||
122 | What: drivers depending on OSS_OBSOLETE_DRIVER | ||
123 | When: options in 2.6.20, code in 2.6.22 | ||
124 | Why: OSS drivers with ALSA replacements | ||
125 | Who: Adrian Bunk <bunk@stusta.de> | ||
126 | |||
127 | --------------------------- | ||
128 | |||
129 | What: Unused EXPORT_SYMBOL/EXPORT_SYMBOL_GPL exports | 114 | What: Unused EXPORT_SYMBOL/EXPORT_SYMBOL_GPL exports |
130 | (temporary transition config option provided until then) | 115 | (temporary transition config option provided until then) |
131 | The transition config option will also be removed at the same time. | 116 | The transition config option will also be removed at the same time. |
@@ -196,28 +181,6 @@ Who: Adrian Bunk <bunk@stusta.de> | |||
196 | 181 | ||
197 | --------------------------- | 182 | --------------------------- |
198 | 183 | ||
199 | What: ACPI hooks (X86_SPEEDSTEP_CENTRINO_ACPI) in speedstep-centrino driver | ||
200 | When: December 2006 | ||
201 | Why: Speedstep-centrino driver with ACPI hooks and acpi-cpufreq driver are | ||
202 | functionally very much similar. They talk to ACPI in same way. Only | ||
203 | difference between them is the way they do frequency transitions. | ||
204 | One uses MSRs and the other one uses IO ports. Functionaliy of | ||
205 | speedstep_centrino with ACPI hooks is now merged into acpi-cpufreq. | ||
206 | That means one common driver will support all Intel Enhanced Speedstep | ||
207 | capable CPUs. That means less confusion over name of | ||
208 | speedstep-centrino driver (with that driver supposed to be used on | ||
209 | non-centrino platforms). That means less duplication of code and | ||
210 | less maintenance effort and no possibility of these two drivers | ||
211 | going out of sync. | ||
212 | Current users of speedstep_centrino with ACPI hooks are requested to | ||
213 | switch over to acpi-cpufreq driver. speedstep-centrino will continue | ||
214 | to work using older non-ACPI static table based scheme even after this | ||
215 | date. | ||
216 | |||
217 | Who: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> | ||
218 | |||
219 | --------------------------- | ||
220 | |||
221 | What: /sys/firmware/acpi/namespace | 184 | What: /sys/firmware/acpi/namespace |
222 | When: 2.6.21 | 185 | When: 2.6.21 |
223 | Why: The ACPI namespace is effectively the symbol list for | 186 | Why: The ACPI namespace is effectively the symbol list for |
@@ -262,25 +225,6 @@ Who: Richard Purdie <rpurdie@rpsys.net> | |||
262 | 225 | ||
263 | --------------------------- | 226 | --------------------------- |
264 | 227 | ||
265 | What: Multipath cached routing support in ipv4 | ||
266 | When: in 2.6.23 | ||
267 | Why: Code was merged, then submitter immediately disappeared leaving | ||
268 | us with no maintainer and lots of bugs. The code should not have | ||
269 | been merged in the first place, and many aspects of it's | ||
270 | implementation are blocking more critical core networking | ||
271 | development. It's marked EXPERIMENTAL and no distribution | ||
272 | enables it because it cause obscure crashes due to unfixable bugs | ||
273 | (interfaces don't return errors so memory allocation can't be | ||
274 | handled, calling contexts of these interfaces make handling | ||
275 | errors impossible too because they get called after we've | ||
276 | totally commited to creating a route object, for example). | ||
277 | This problem has existed for years and no forward progress | ||
278 | has ever been made, and nobody steps up to try and salvage | ||
279 | this code, so we're going to finally just get rid of it. | ||
280 | Who: David S. Miller <davem@davemloft.net> | ||
281 | |||
282 | --------------------------- | ||
283 | |||
284 | What: read_dev_chars(), read_conf_data{,_lpm}() (s390 common I/O layer) | 228 | What: read_dev_chars(), read_conf_data{,_lpm}() (s390 common I/O layer) |
285 | When: December 2007 | 229 | When: December 2007 |
286 | Why: These functions are a leftover from 2.4 times. They have several | 230 | Why: These functions are a leftover from 2.4 times. They have several |
@@ -305,6 +249,14 @@ Who: Jean Delvare <khali@linux-fr.org> | |||
305 | 249 | ||
306 | --------------------------- | 250 | --------------------------- |
307 | 251 | ||
252 | What: 'time' kernel boot parameter | ||
253 | When: January 2008 | ||
254 | Why: replaced by 'printk.time=<value>' so that printk timestamps can be | ||
255 | enabled or disabled as needed | ||
256 | Who: Randy Dunlap <randy.dunlap@oracle.com> | ||
257 | |||
258 | --------------------------- | ||
259 | |||
308 | What: drivers depending on OSS_OBSOLETE | 260 | What: drivers depending on OSS_OBSOLETE |
309 | When: options in 2.6.23, code in 2.6.25 | 261 | When: options in 2.6.23, code in 2.6.25 |
310 | Why: obsolete OSS drivers | 262 | Why: obsolete OSS drivers |
@@ -330,6 +282,22 @@ Who: Tejun Heo <htejun@gmail.com> | |||
330 | 282 | ||
331 | --------------------------- | 283 | --------------------------- |
332 | 284 | ||
285 | What: Legacy RTC drivers (under drivers/i2c/chips) | ||
286 | When: November 2007 | ||
287 | Why: Obsolete. We have a RTC subsystem with better drivers. | ||
288 | Who: Jean Delvare <khali@linux-fr.org> | ||
289 | |||
290 | --------------------------- | ||
291 | |||
292 | What: iptables SAME target | ||
293 | When: 1.1. 2008 | ||
294 | Files: net/ipv4/netfilter/ipt_SAME.c, include/linux/netfilter_ipv4/ipt_SAME.h | ||
295 | Why: Obsolete for multiple years now, NAT core provides the same behaviour. | ||
296 | Unfixable broken wrt. 32/64 bit cleanness. | ||
297 | Who: Patrick McHardy <kaber@trash.net> | ||
298 | |||
299 | --------------------------- | ||
300 | |||
333 | What: The arch/ppc and include/asm-ppc directories | 301 | What: The arch/ppc and include/asm-ppc directories |
334 | When: Jun 2008 | 302 | When: Jun 2008 |
335 | Why: The arch/powerpc tree is the merged architecture for ppc32 and ppc64 | 303 | Why: The arch/powerpc tree is the merged architecture for ppc32 and ppc64 |
diff --git a/Documentation/filesystems/configfs/configfs.txt b/Documentation/filesystems/configfs/configfs.txt index b34cdb50eab4..d1b98257d000 100644 --- a/Documentation/filesystems/configfs/configfs.txt +++ b/Documentation/filesystems/configfs/configfs.txt | |||
@@ -238,6 +238,8 @@ config_item_type. | |||
238 | struct config_group *(*make_group)(struct config_group *group, | 238 | struct config_group *(*make_group)(struct config_group *group, |
239 | const char *name); | 239 | const char *name); |
240 | int (*commit_item)(struct config_item *item); | 240 | int (*commit_item)(struct config_item *item); |
241 | void (*disconnect_notify)(struct config_group *group, | ||
242 | struct config_item *item); | ||
241 | void (*drop_item)(struct config_group *group, | 243 | void (*drop_item)(struct config_group *group, |
242 | struct config_item *item); | 244 | struct config_item *item); |
243 | }; | 245 | }; |
@@ -268,6 +270,16 @@ the item in other threads, the memory is safe. It may take some time | |||
268 | for the item to actually disappear from the subsystem's usage. But it | 270 | for the item to actually disappear from the subsystem's usage. But it |
269 | is gone from configfs. | 271 | is gone from configfs. |
270 | 272 | ||
273 | When drop_item() is called, the item's linkage has already been torn | ||
274 | down. It no longer has a reference on its parent and has no place in | ||
275 | the item hierarchy. If a client needs to do some cleanup before this | ||
276 | teardown happens, the subsystem can implement the | ||
277 | ct_group_ops->disconnect_notify() method. The method is called after | ||
278 | configfs has removed the item from the filesystem view but before the | ||
279 | item is removed from its parent group. Like drop_item(), | ||
280 | disconnect_notify() is void and cannot fail. Client subsystems should | ||
281 | not drop any references here, as they still must do it in drop_item(). | ||
282 | |||
271 | A config_group cannot be removed while it still has child items. This | 283 | A config_group cannot be removed while it still has child items. This |
272 | is implemented in the configfs rmdir(2) code. ->drop_item() will not be | 284 | is implemented in the configfs rmdir(2) code. ->drop_item() will not be |
273 | called, as the item has not been dropped. rmdir(2) will fail, as the | 285 | called, as the item has not been dropped. rmdir(2) will fail, as the |
@@ -280,18 +292,18 @@ tells configfs to make the subsystem appear in the file tree. | |||
280 | 292 | ||
281 | struct configfs_subsystem { | 293 | struct configfs_subsystem { |
282 | struct config_group su_group; | 294 | struct config_group su_group; |
283 | struct semaphore su_sem; | 295 | struct mutex su_mutex; |
284 | }; | 296 | }; |
285 | 297 | ||
286 | int configfs_register_subsystem(struct configfs_subsystem *subsys); | 298 | int configfs_register_subsystem(struct configfs_subsystem *subsys); |
287 | void configfs_unregister_subsystem(struct configfs_subsystem *subsys); | 299 | void configfs_unregister_subsystem(struct configfs_subsystem *subsys); |
288 | 300 | ||
289 | A subsystem consists of a toplevel config_group and a semaphore. | 301 | A subsystem consists of a toplevel config_group and a mutex. |
290 | The group is where child config_items are created. For a subsystem, | 302 | The group is where child config_items are created. For a subsystem, |
291 | this group is usually defined statically. Before calling | 303 | this group is usually defined statically. Before calling |
292 | configfs_register_subsystem(), the subsystem must have initialized the | 304 | configfs_register_subsystem(), the subsystem must have initialized the |
293 | group via the usual group _init() functions, and it must also have | 305 | group via the usual group _init() functions, and it must also have |
294 | initialized the semaphore. | 306 | initialized the mutex. |
295 | When the register call returns, the subsystem is live, and it | 307 | When the register call returns, the subsystem is live, and it |
296 | will be visible via configfs. At that point, mkdir(2) can be called and | 308 | will be visible via configfs. At that point, mkdir(2) can be called and |
297 | the subsystem must be ready for it. | 309 | the subsystem must be ready for it. |
@@ -303,7 +315,7 @@ subsystem/group and the simple_child item in configfs_example.c It | |||
303 | shows a trivial object displaying and storing an attribute, and a simple | 315 | shows a trivial object displaying and storing an attribute, and a simple |
304 | group creating and destroying these children. | 316 | group creating and destroying these children. |
305 | 317 | ||
306 | [Hierarchy Navigation and the Subsystem Semaphore] | 318 | [Hierarchy Navigation and the Subsystem Mutex] |
307 | 319 | ||
308 | There is an extra bonus that configfs provides. The config_groups and | 320 | There is an extra bonus that configfs provides. The config_groups and |
309 | config_items are arranged in a hierarchy due to the fact that they | 321 | config_items are arranged in a hierarchy due to the fact that they |
@@ -314,19 +326,19 @@ and config_item->ci_parent structure members. | |||
314 | 326 | ||
315 | A subsystem can navigate the cg_children list and the ci_parent pointer | 327 | A subsystem can navigate the cg_children list and the ci_parent pointer |
316 | to see the tree created by the subsystem. This can race with configfs' | 328 | to see the tree created by the subsystem. This can race with configfs' |
317 | management of the hierarchy, so configfs uses the subsystem semaphore to | 329 | management of the hierarchy, so configfs uses the subsystem mutex to |
318 | protect modifications. Whenever a subsystem wants to navigate the | 330 | protect modifications. Whenever a subsystem wants to navigate the |
319 | hierarchy, it must do so under the protection of the subsystem | 331 | hierarchy, it must do so under the protection of the subsystem |
320 | semaphore. | 332 | mutex. |
321 | 333 | ||
322 | A subsystem will be prevented from acquiring the semaphore while a newly | 334 | A subsystem will be prevented from acquiring the mutex while a newly |
323 | allocated item has not been linked into this hierarchy. Similarly, it | 335 | allocated item has not been linked into this hierarchy. Similarly, it |
324 | will not be able to acquire the semaphore while a dropping item has not | 336 | will not be able to acquire the mutex while a dropping item has not |
325 | yet been unlinked. This means that an item's ci_parent pointer will | 337 | yet been unlinked. This means that an item's ci_parent pointer will |
326 | never be NULL while the item is in configfs, and that an item will only | 338 | never be NULL while the item is in configfs, and that an item will only |
327 | be in its parent's cg_children list for the same duration. This allows | 339 | be in its parent's cg_children list for the same duration. This allows |
328 | a subsystem to trust ci_parent and cg_children while they hold the | 340 | a subsystem to trust ci_parent and cg_children while they hold the |
329 | semaphore. | 341 | mutex. |
330 | 342 | ||
331 | [Item Aggregation Via symlink(2)] | 343 | [Item Aggregation Via symlink(2)] |
332 | 344 | ||
@@ -386,6 +398,33 @@ As a consequence of this, default_groups cannot be removed directly via | |||
386 | rmdir(2). They also are not considered when rmdir(2) on the parent | 398 | rmdir(2). They also are not considered when rmdir(2) on the parent |
387 | group is checking for children. | 399 | group is checking for children. |
388 | 400 | ||
401 | [Dependant Subsystems] | ||
402 | |||
403 | Sometimes other drivers depend on particular configfs items. For | ||
404 | example, ocfs2 mounts depend on a heartbeat region item. If that | ||
405 | region item is removed with rmdir(2), the ocfs2 mount must BUG or go | ||
406 | readonly. Not happy. | ||
407 | |||
408 | configfs provides two additional API calls: configfs_depend_item() and | ||
409 | configfs_undepend_item(). A client driver can call | ||
410 | configfs_depend_item() on an existing item to tell configfs that it is | ||
411 | depended on. configfs will then return -EBUSY from rmdir(2) for that | ||
412 | item. When the item is no longer depended on, the client driver calls | ||
413 | configfs_undepend_item() on it. | ||
414 | |||
415 | These API cannot be called underneath any configfs callbacks, as | ||
416 | they will conflict. They can block and allocate. A client driver | ||
417 | probably shouldn't calling them of its own gumption. Rather it should | ||
418 | be providing an API that external subsystems call. | ||
419 | |||
420 | How does this work? Imagine the ocfs2 mount process. When it mounts, | ||
421 | it asks for a heartbeat region item. This is done via a call into the | ||
422 | heartbeat code. Inside the heartbeat code, the region item is looked | ||
423 | up. Here, the heartbeat code calls configfs_depend_item(). If it | ||
424 | succeeds, then heartbeat knows the region is safe to give to ocfs2. | ||
425 | If it fails, it was being torn down anyway, and heartbeat can gracefully | ||
426 | pass up an error. | ||
427 | |||
389 | [Committable Items] | 428 | [Committable Items] |
390 | 429 | ||
391 | NOTE: Committable items are currently unimplemented. | 430 | NOTE: Committable items are currently unimplemented. |
diff --git a/Documentation/filesystems/configfs/configfs_example.c b/Documentation/filesystems/configfs/configfs_example.c index 2d6a14a463e0..e56d49264b39 100644 --- a/Documentation/filesystems/configfs/configfs_example.c +++ b/Documentation/filesystems/configfs/configfs_example.c | |||
@@ -453,7 +453,7 @@ static int __init configfs_example_init(void) | |||
453 | subsys = example_subsys[i]; | 453 | subsys = example_subsys[i]; |
454 | 454 | ||
455 | config_group_init(&subsys->su_group); | 455 | config_group_init(&subsys->su_group); |
456 | init_MUTEX(&subsys->su_sem); | 456 | mutex_init(&subsys->su_mutex); |
457 | ret = configfs_register_subsystem(subsys); | 457 | ret = configfs_register_subsystem(subsys); |
458 | if (ret) { | 458 | if (ret) { |
459 | printk(KERN_ERR "Error %d while registering subsystem %s\n", | 459 | printk(KERN_ERR "Error %d while registering subsystem %s\n", |
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt index 8756a07f4dc3..460b892d089e 100644 --- a/Documentation/filesystems/proc.txt +++ b/Documentation/filesystems/proc.txt | |||
@@ -171,7 +171,9 @@ read the file /proc/PID/status: | |||
171 | This shows you nearly the same information you would get if you viewed it with | 171 | This shows you nearly the same information you would get if you viewed it with |
172 | the ps command. In fact, ps uses the proc file system to obtain its | 172 | the ps command. In fact, ps uses the proc file system to obtain its |
173 | information. The statm file contains more detailed information about the | 173 | information. The statm file contains more detailed information about the |
174 | process memory usage. Its seven fields are explained in Table 1-2. | 174 | process memory usage. Its seven fields are explained in Table 1-2. The stat |
175 | file contains details information about the process itself. Its fields are | ||
176 | explained in Table 1-3. | ||
175 | 177 | ||
176 | 178 | ||
177 | Table 1-2: Contents of the statm files (as of 2.6.8-rc3) | 179 | Table 1-2: Contents of the statm files (as of 2.6.8-rc3) |
@@ -188,16 +190,65 @@ Table 1-2: Contents of the statm files (as of 2.6.8-rc3) | |||
188 | dt number of dirty pages (always 0 on 2.6) | 190 | dt number of dirty pages (always 0 on 2.6) |
189 | .............................................................................. | 191 | .............................................................................. |
190 | 192 | ||
193 | |||
194 | Table 1-3: Contents of the stat files (as of 2.6.22-rc3) | ||
195 | .............................................................................. | ||
196 | Field Content | ||
197 | pid process id | ||
198 | tcomm filename of the executable | ||
199 | state state (R is running, S is sleeping, D is sleeping in an | ||
200 | uninterruptible wait, Z is zombie, T is traced or stopped) | ||
201 | ppid process id of the parent process | ||
202 | pgrp pgrp of the process | ||
203 | sid session id | ||
204 | tty_nr tty the process uses | ||
205 | tty_pgrp pgrp of the tty | ||
206 | flags task flags | ||
207 | min_flt number of minor faults | ||
208 | cmin_flt number of minor faults with child's | ||
209 | maj_flt number of major faults | ||
210 | cmaj_flt number of major faults with child's | ||
211 | utime user mode jiffies | ||
212 | stime kernel mode jiffies | ||
213 | cutime user mode jiffies with child's | ||
214 | cstime kernel mode jiffies with child's | ||
215 | priority priority level | ||
216 | nice nice level | ||
217 | num_threads number of threads | ||
218 | start_time time the process started after system boot | ||
219 | vsize virtual memory size | ||
220 | rss resident set memory size | ||
221 | rsslim current limit in bytes on the rss | ||
222 | start_code address above which program text can run | ||
223 | end_code address below which program text can run | ||
224 | start_stack address of the start of the stack | ||
225 | esp current value of ESP | ||
226 | eip current value of EIP | ||
227 | pending bitmap of pending signals (obsolete) | ||
228 | blocked bitmap of blocked signals (obsolete) | ||
229 | sigign bitmap of ignored signals (obsolete) | ||
230 | sigcatch bitmap of catched signals (obsolete) | ||
231 | wchan address where process went to sleep | ||
232 | 0 (place holder) | ||
233 | 0 (place holder) | ||
234 | exit_signal signal to send to parent thread on exit | ||
235 | task_cpu which CPU the task is scheduled on | ||
236 | rt_priority realtime priority | ||
237 | policy scheduling policy (man sched_setscheduler) | ||
238 | blkio_ticks time spent waiting for block IO | ||
239 | .............................................................................. | ||
240 | |||
241 | |||
191 | 1.2 Kernel data | 242 | 1.2 Kernel data |
192 | --------------- | 243 | --------------- |
193 | 244 | ||
194 | Similar to the process entries, the kernel data files give information about | 245 | Similar to the process entries, the kernel data files give information about |
195 | the running kernel. The files used to obtain this information are contained in | 246 | the running kernel. The files used to obtain this information are contained in |
196 | /proc and are listed in Table 1-3. Not all of these will be present in your | 247 | /proc and are listed in Table 1-4. Not all of these will be present in your |
197 | system. It depends on the kernel configuration and the loaded modules, which | 248 | system. It depends on the kernel configuration and the loaded modules, which |
198 | files are there, and which are missing. | 249 | files are there, and which are missing. |
199 | 250 | ||
200 | Table 1-3: Kernel info in /proc | 251 | Table 1-4: Kernel info in /proc |
201 | .............................................................................. | 252 | .............................................................................. |
202 | File Content | 253 | File Content |
203 | apm Advanced power management info | 254 | apm Advanced power management info |
@@ -473,10 +524,10 @@ IDE devices: | |||
473 | 524 | ||
474 | More detailed information can be found in the controller specific | 525 | More detailed information can be found in the controller specific |
475 | subdirectories. These are named ide0, ide1 and so on. Each of these | 526 | subdirectories. These are named ide0, ide1 and so on. Each of these |
476 | directories contains the files shown in table 1-4. | 527 | directories contains the files shown in table 1-5. |
477 | 528 | ||
478 | 529 | ||
479 | Table 1-4: IDE controller info in /proc/ide/ide? | 530 | Table 1-5: IDE controller info in /proc/ide/ide? |
480 | .............................................................................. | 531 | .............................................................................. |
481 | File Content | 532 | File Content |
482 | channel IDE channel (0 or 1) | 533 | channel IDE channel (0 or 1) |
@@ -486,11 +537,11 @@ Table 1-4: IDE controller info in /proc/ide/ide? | |||
486 | .............................................................................. | 537 | .............................................................................. |
487 | 538 | ||
488 | Each device connected to a controller has a separate subdirectory in the | 539 | Each device connected to a controller has a separate subdirectory in the |
489 | controllers directory. The files listed in table 1-5 are contained in these | 540 | controllers directory. The files listed in table 1-6 are contained in these |
490 | directories. | 541 | directories. |
491 | 542 | ||
492 | 543 | ||
493 | Table 1-5: IDE device information | 544 | Table 1-6: IDE device information |
494 | .............................................................................. | 545 | .............................................................................. |
495 | File Content | 546 | File Content |
496 | cache The cache | 547 | cache The cache |
diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt index a47cc819f37b..045f3e055a28 100644 --- a/Documentation/filesystems/vfs.txt +++ b/Documentation/filesystems/vfs.txt | |||
@@ -3,7 +3,7 @@ | |||
3 | 3 | ||
4 | Original author: Richard Gooch <rgooch@atnf.csiro.au> | 4 | Original author: Richard Gooch <rgooch@atnf.csiro.au> |
5 | 5 | ||
6 | Last updated on October 28, 2005 | 6 | Last updated on June 24, 2007. |
7 | 7 | ||
8 | Copyright (C) 1999 Richard Gooch | 8 | Copyright (C) 1999 Richard Gooch |
9 | Copyright (C) 2005 Pekka Enberg | 9 | Copyright (C) 2005 Pekka Enberg |
@@ -107,7 +107,7 @@ file /proc/filesystems. | |||
107 | struct file_system_type | 107 | struct file_system_type |
108 | ----------------------- | 108 | ----------------------- |
109 | 109 | ||
110 | This describes the filesystem. As of kernel 2.6.13, the following | 110 | This describes the filesystem. As of kernel 2.6.22, the following |
111 | members are defined: | 111 | members are defined: |
112 | 112 | ||
113 | struct file_system_type { | 113 | struct file_system_type { |
@@ -119,6 +119,8 @@ struct file_system_type { | |||
119 | struct module *owner; | 119 | struct module *owner; |
120 | struct file_system_type * next; | 120 | struct file_system_type * next; |
121 | struct list_head fs_supers; | 121 | struct list_head fs_supers; |
122 | struct lock_class_key s_lock_key; | ||
123 | struct lock_class_key s_umount_key; | ||
122 | }; | 124 | }; |
123 | 125 | ||
124 | name: the name of the filesystem type, such as "ext2", "iso9660", | 126 | name: the name of the filesystem type, such as "ext2", "iso9660", |
@@ -137,11 +139,12 @@ struct file_system_type { | |||
137 | 139 | ||
138 | next: for internal VFS use: you should initialize this to NULL | 140 | next: for internal VFS use: you should initialize this to NULL |
139 | 141 | ||
142 | s_lock_key, s_umount_key: lockdep-specific | ||
143 | |||
140 | The get_sb() method has the following arguments: | 144 | The get_sb() method has the following arguments: |
141 | 145 | ||
142 | struct super_block *sb: the superblock structure. This is partially | 146 | struct file_system_type *fs_type: decribes the filesystem, partly initialized |
143 | initialized by the VFS and the rest must be initialized by the | 147 | by the specific filesystem code |
144 | get_sb() method | ||
145 | 148 | ||
146 | int flags: mount flags | 149 | int flags: mount flags |
147 | 150 | ||
@@ -150,12 +153,13 @@ The get_sb() method has the following arguments: | |||
150 | void *data: arbitrary mount options, usually comes as an ASCII | 153 | void *data: arbitrary mount options, usually comes as an ASCII |
151 | string | 154 | string |
152 | 155 | ||
153 | int silent: whether or not to be silent on error | 156 | struct vfsmount *mnt: a vfs-internal representation of a mount point |
154 | 157 | ||
155 | The get_sb() method must determine if the block device specified | 158 | The get_sb() method must determine if the block device specified |
156 | in the superblock contains a filesystem of the type the method | 159 | in the dev_name and fs_type contains a filesystem of the type the method |
157 | supports. On success the method returns the superblock pointer, on | 160 | supports. If it succeeds in opening the named block device, it initializes a |
158 | failure it returns NULL. | 161 | struct super_block descriptor for the filesystem contained by the block device. |
162 | On failure it returns an error. | ||
159 | 163 | ||
160 | The most interesting member of the superblock structure that the | 164 | The most interesting member of the superblock structure that the |
161 | get_sb() method fills in is the "s_op" field. This is a pointer to | 165 | get_sb() method fills in is the "s_op" field. This is a pointer to |
@@ -193,7 +197,7 @@ struct super_operations | |||
193 | ----------------------- | 197 | ----------------------- |
194 | 198 | ||
195 | This describes how the VFS can manipulate the superblock of your | 199 | This describes how the VFS can manipulate the superblock of your |
196 | filesystem. As of kernel 2.6.13, the following members are defined: | 200 | filesystem. As of kernel 2.6.22, the following members are defined: |
197 | 201 | ||
198 | struct super_operations { | 202 | struct super_operations { |
199 | struct inode *(*alloc_inode)(struct super_block *sb); | 203 | struct inode *(*alloc_inode)(struct super_block *sb); |
@@ -216,8 +220,6 @@ struct super_operations { | |||
216 | void (*clear_inode) (struct inode *); | 220 | void (*clear_inode) (struct inode *); |
217 | void (*umount_begin) (struct super_block *); | 221 | void (*umount_begin) (struct super_block *); |
218 | 222 | ||
219 | void (*sync_inodes) (struct super_block *sb, | ||
220 | struct writeback_control *wbc); | ||
221 | int (*show_options)(struct seq_file *, struct vfsmount *); | 223 | int (*show_options)(struct seq_file *, struct vfsmount *); |
222 | 224 | ||
223 | ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t); | 225 | ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t); |
@@ -300,9 +302,6 @@ or bottom half). | |||
300 | 302 | ||
301 | umount_begin: called when the VFS is unmounting a filesystem. | 303 | umount_begin: called when the VFS is unmounting a filesystem. |
302 | 304 | ||
303 | sync_inodes: called when the VFS is writing out dirty data associated with | ||
304 | a superblock. | ||
305 | |||
306 | show_options: called by the VFS to show mount options for /proc/<pid>/mounts. | 305 | show_options: called by the VFS to show mount options for /proc/<pid>/mounts. |
307 | 306 | ||
308 | quota_read: called by the VFS to read from filesystem quota file. | 307 | quota_read: called by the VFS to read from filesystem quota file. |
@@ -324,7 +323,7 @@ struct inode_operations | |||
324 | ----------------------- | 323 | ----------------------- |
325 | 324 | ||
326 | This describes how the VFS can manipulate an inode in your | 325 | This describes how the VFS can manipulate an inode in your |
327 | filesystem. As of kernel 2.6.13, the following members are defined: | 326 | filesystem. As of kernel 2.6.22, the following members are defined: |
328 | 327 | ||
329 | struct inode_operations { | 328 | struct inode_operations { |
330 | int (*create) (struct inode *,struct dentry *,int, struct nameidata *); | 329 | int (*create) (struct inode *,struct dentry *,int, struct nameidata *); |
@@ -348,6 +347,7 @@ struct inode_operations { | |||
348 | ssize_t (*getxattr) (struct dentry *, const char *, void *, size_t); | 347 | ssize_t (*getxattr) (struct dentry *, const char *, void *, size_t); |
349 | ssize_t (*listxattr) (struct dentry *, char *, size_t); | 348 | ssize_t (*listxattr) (struct dentry *, char *, size_t); |
350 | int (*removexattr) (struct dentry *, const char *); | 349 | int (*removexattr) (struct dentry *, const char *); |
350 | void (*truncate_range)(struct inode *, loff_t, loff_t); | ||
351 | }; | 351 | }; |
352 | 352 | ||
353 | Again, all methods are called without any locks being held, unless | 353 | Again, all methods are called without any locks being held, unless |
@@ -444,6 +444,9 @@ otherwise noted. | |||
444 | removexattr: called by the VFS to remove an extended attribute from | 444 | removexattr: called by the VFS to remove an extended attribute from |
445 | a file. This method is called by removexattr(2) system call. | 445 | a file. This method is called by removexattr(2) system call. |
446 | 446 | ||
447 | truncate_range: a method provided by the underlying filesystem to truncate a | ||
448 | range of blocks , i.e. punch a hole somewhere in a file. | ||
449 | |||
447 | 450 | ||
448 | The Address Space Object | 451 | The Address Space Object |
449 | ======================== | 452 | ======================== |
@@ -522,7 +525,7 @@ struct address_space_operations | |||
522 | ------------------------------- | 525 | ------------------------------- |
523 | 526 | ||
524 | This describes how the VFS can manipulate mapping of a file to page cache in | 527 | This describes how the VFS can manipulate mapping of a file to page cache in |
525 | your filesystem. As of kernel 2.6.16, the following members are defined: | 528 | your filesystem. As of kernel 2.6.22, the following members are defined: |
526 | 529 | ||
527 | struct address_space_operations { | 530 | struct address_space_operations { |
528 | int (*writepage)(struct page *page, struct writeback_control *wbc); | 531 | int (*writepage)(struct page *page, struct writeback_control *wbc); |
@@ -543,6 +546,7 @@ struct address_space_operations { | |||
543 | int); | 546 | int); |
544 | /* migrate the contents of a page to the specified target */ | 547 | /* migrate the contents of a page to the specified target */ |
545 | int (*migratepage) (struct page *, struct page *); | 548 | int (*migratepage) (struct page *, struct page *); |
549 | int (*launder_page) (struct page *); | ||
546 | }; | 550 | }; |
547 | 551 | ||
548 | writepage: called by the VM to write a dirty page to backing store. | 552 | writepage: called by the VM to write a dirty page to backing store. |
@@ -689,6 +693,10 @@ struct address_space_operations { | |||
689 | transfer any private data across and update any references | 693 | transfer any private data across and update any references |
690 | that it has to the page. | 694 | that it has to the page. |
691 | 695 | ||
696 | launder_page: Called before freeing a page - it writes back the dirty page. To | ||
697 | prevent redirtying the page, it is kept locked during the whole | ||
698 | operation. | ||
699 | |||
692 | The File Object | 700 | The File Object |
693 | =============== | 701 | =============== |
694 | 702 | ||
@@ -699,9 +707,10 @@ struct file_operations | |||
699 | ---------------------- | 707 | ---------------------- |
700 | 708 | ||
701 | This describes how the VFS can manipulate an open file. As of kernel | 709 | This describes how the VFS can manipulate an open file. As of kernel |
702 | 2.6.17, the following members are defined: | 710 | 2.6.22, the following members are defined: |
703 | 711 | ||
704 | struct file_operations { | 712 | struct file_operations { |
713 | struct module *owner; | ||
705 | loff_t (*llseek) (struct file *, loff_t, int); | 714 | loff_t (*llseek) (struct file *, loff_t, int); |
706 | ssize_t (*read) (struct file *, char __user *, size_t, loff_t *); | 715 | ssize_t (*read) (struct file *, char __user *, size_t, loff_t *); |
707 | ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *); | 716 | ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *); |
@@ -728,10 +737,8 @@ struct file_operations { | |||
728 | int (*check_flags)(int); | 737 | int (*check_flags)(int); |
729 | int (*dir_notify)(struct file *filp, unsigned long arg); | 738 | int (*dir_notify)(struct file *filp, unsigned long arg); |
730 | int (*flock) (struct file *, int, struct file_lock *); | 739 | int (*flock) (struct file *, int, struct file_lock *); |
731 | ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, size_t, unsigned | 740 | ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, size_t, unsigned int); |
732 | int); | 741 | ssize_t (*splice_read)(struct file *, struct pipe_inode_info *, size_t, unsigned int); |
733 | ssize_t (*splice_read)(struct file *, struct pipe_inode_info *, size_t, unsigned | ||
734 | int); | ||
735 | }; | 742 | }; |
736 | 743 | ||
737 | Again, all methods are called without any locks being held, unless | 744 | Again, all methods are called without any locks being held, unless |
diff --git a/Documentation/firmware_class/firmware_sample_firmware_class.c b/Documentation/firmware_class/firmware_sample_firmware_class.c index 4994f1f28f8c..fba943aacf93 100644 --- a/Documentation/firmware_class/firmware_sample_firmware_class.c +++ b/Documentation/firmware_class/firmware_sample_firmware_class.c | |||
@@ -78,6 +78,7 @@ static CLASS_DEVICE_ATTR(loading, 0644, | |||
78 | firmware_loading_show, firmware_loading_store); | 78 | firmware_loading_show, firmware_loading_store); |
79 | 79 | ||
80 | static ssize_t firmware_data_read(struct kobject *kobj, | 80 | static ssize_t firmware_data_read(struct kobject *kobj, |
81 | struct bin_attribute *bin_attr, | ||
81 | char *buffer, loff_t offset, size_t count) | 82 | char *buffer, loff_t offset, size_t count) |
82 | { | 83 | { |
83 | struct class_device *class_dev = to_class_dev(kobj); | 84 | struct class_device *class_dev = to_class_dev(kobj); |
@@ -88,6 +89,7 @@ static ssize_t firmware_data_read(struct kobject *kobj, | |||
88 | return count; | 89 | return count; |
89 | } | 90 | } |
90 | static ssize_t firmware_data_write(struct kobject *kobj, | 91 | static ssize_t firmware_data_write(struct kobject *kobj, |
92 | struct bin_attribute *bin_attr, | ||
91 | char *buffer, loff_t offset, size_t count) | 93 | char *buffer, loff_t offset, size_t count) |
92 | { | 94 | { |
93 | struct class_device *class_dev = to_class_dev(kobj); | 95 | struct class_device *class_dev = to_class_dev(kobj); |
diff --git a/Documentation/hrtimer/timer_stats.txt b/Documentation/hrtimer/timer_stats.txt index 22b0814d0ad0..20d368c59814 100644 --- a/Documentation/hrtimer/timer_stats.txt +++ b/Documentation/hrtimer/timer_stats.txt | |||
@@ -67,3 +67,7 @@ executed on expiry. | |||
67 | 67 | ||
68 | Thomas, Ingo | 68 | Thomas, Ingo |
69 | 69 | ||
70 | Added flag to indicate 'deferrable timer' in /proc/timer_stats. A deferrable | ||
71 | timer will appear as follows | ||
72 | 10D, 1 swapper queue_delayed_work_on (delayed_work_timer_fn) | ||
73 | |||
diff --git a/Documentation/i2c/busses/i2c-i801 b/Documentation/i2c/busses/i2c-i801 index c34f0db78a30..fe6406f2f9a6 100644 --- a/Documentation/i2c/busses/i2c-i801 +++ b/Documentation/i2c/busses/i2c-i801 | |||
@@ -5,8 +5,8 @@ Supported adapters: | |||
5 | '810' and '810E' chipsets) | 5 | '810' and '810E' chipsets) |
6 | * Intel 82801BA (ICH2 - part of the '815E' chipset) | 6 | * Intel 82801BA (ICH2 - part of the '815E' chipset) |
7 | * Intel 82801CA/CAM (ICH3) | 7 | * Intel 82801CA/CAM (ICH3) |
8 | * Intel 82801DB (ICH4) (HW PEC supported, 32 byte buffer not supported) | 8 | * Intel 82801DB (ICH4) (HW PEC supported) |
9 | * Intel 82801EB/ER (ICH5) (HW PEC supported, 32 byte buffer not supported) | 9 | * Intel 82801EB/ER (ICH5) (HW PEC supported) |
10 | * Intel 6300ESB | 10 | * Intel 6300ESB |
11 | * Intel 82801FB/FR/FW/FRW (ICH6) | 11 | * Intel 82801FB/FR/FW/FRW (ICH6) |
12 | * Intel 82801G (ICH7) | 12 | * Intel 82801G (ICH7) |
diff --git a/Documentation/i2c/busses/i2c-piix4 b/Documentation/i2c/busses/i2c-piix4 index 7cbe43fa2701..fa0c786a8bf5 100644 --- a/Documentation/i2c/busses/i2c-piix4 +++ b/Documentation/i2c/busses/i2c-piix4 | |||
@@ -6,7 +6,7 @@ Supported adapters: | |||
6 | Datasheet: Publicly available at the Intel website | 6 | Datasheet: Publicly available at the Intel website |
7 | * ServerWorks OSB4, CSB5, CSB6 and HT-1000 southbridges | 7 | * ServerWorks OSB4, CSB5, CSB6 and HT-1000 southbridges |
8 | Datasheet: Only available via NDA from ServerWorks | 8 | Datasheet: Only available via NDA from ServerWorks |
9 | * ATI IXP200, IXP300, IXP400 and SB600 southbridges | 9 | * ATI IXP200, IXP300, IXP400, SB600 and SB700 southbridges |
10 | Datasheet: Not publicly available | 10 | Datasheet: Not publicly available |
11 | * Standard Microsystems (SMSC) SLC90E66 (Victory66) southbridge | 11 | * Standard Microsystems (SMSC) SLC90E66 (Victory66) southbridge |
12 | Datasheet: Publicly available at the SMSC website http://www.smsc.com | 12 | Datasheet: Publicly available at the SMSC website http://www.smsc.com |
diff --git a/Documentation/i2c/busses/i2c-taos-evm b/Documentation/i2c/busses/i2c-taos-evm new file mode 100644 index 000000000000..9146e33be6dd --- /dev/null +++ b/Documentation/i2c/busses/i2c-taos-evm | |||
@@ -0,0 +1,46 @@ | |||
1 | Kernel driver i2c-taos-evm | ||
2 | |||
3 | Author: Jean Delvare <khali@linux-fr.org> | ||
4 | |||
5 | This is a driver for the evaluation modules for TAOS I2C/SMBus chips. | ||
6 | The modules include an SMBus master with limited capabilities, which can | ||
7 | be controlled over the serial port. Virtually all evaluation modules | ||
8 | are supported, but a few lines of code need to be added for each new | ||
9 | module to instantiate the right I2C chip on the bus. Obviously, a driver | ||
10 | for the chip in question is also needed. | ||
11 | |||
12 | Currently supported devices are: | ||
13 | |||
14 | * TAOS TSL2550 EVM | ||
15 | |||
16 | For addtional information on TAOS products, please see | ||
17 | http://www.taosinc.com/ | ||
18 | |||
19 | |||
20 | Using this driver | ||
21 | ----------------- | ||
22 | |||
23 | In order to use this driver, you'll need the serport driver, and the | ||
24 | inputattach tool, which is part of the input-utils package. The following | ||
25 | commands will tell the kernel that you have a TAOS EVM on the first | ||
26 | serial port: | ||
27 | |||
28 | # modprobe serport | ||
29 | # inputattach --taos-evm /dev/ttyS0 | ||
30 | |||
31 | |||
32 | Technical details | ||
33 | ----------------- | ||
34 | |||
35 | Only 4 SMBus transaction types are supported by the TAOS evaluation | ||
36 | modules: | ||
37 | * Receive Byte | ||
38 | * Send Byte | ||
39 | * Read Byte | ||
40 | * Write Byte | ||
41 | |||
42 | The communication protocol is text-based and pretty simple. It is | ||
43 | described in a PDF document on the CD which comes with the evaluation | ||
44 | module. The communication is rather slow, because the serial port has | ||
45 | to operate at 1200 bps. However, I don't think this is a big concern in | ||
46 | practice, as these modules are meant for evaluation and testing only. | ||
diff --git a/Documentation/i2c/chips/max6875 b/Documentation/i2c/chips/max6875 index 96fec562a8e9..a0cd8af2f408 100644 --- a/Documentation/i2c/chips/max6875 +++ b/Documentation/i2c/chips/max6875 | |||
@@ -99,7 +99,7 @@ And then read the data | |||
99 | 99 | ||
100 | or | 100 | or |
101 | 101 | ||
102 | count = i2c_smbus_read_i2c_block_data(fd, 0x84, buffer); | 102 | count = i2c_smbus_read_i2c_block_data(fd, 0x84, 16, buffer); |
103 | 103 | ||
104 | The block read should read 16 bytes. | 104 | The block read should read 16 bytes. |
105 | 0x84 is the block read command. | 105 | 0x84 is the block read command. |
diff --git a/Documentation/i2c/chips/x1205 b/Documentation/i2c/chips/x1205 deleted file mode 100644 index 09407c991fe5..000000000000 --- a/Documentation/i2c/chips/x1205 +++ /dev/null | |||
@@ -1,38 +0,0 @@ | |||
1 | Kernel driver x1205 | ||
2 | =================== | ||
3 | |||
4 | Supported chips: | ||
5 | * Xicor X1205 RTC | ||
6 | Prefix: 'x1205' | ||
7 | Addresses scanned: none | ||
8 | Datasheet: http://www.intersil.com/cda/deviceinfo/0,1477,X1205,00.html | ||
9 | |||
10 | Authors: | ||
11 | Karen Spearel <kas11@tampabay.rr.com>, | ||
12 | Alessandro Zummo <a.zummo@towertech.it> | ||
13 | |||
14 | Description | ||
15 | ----------- | ||
16 | |||
17 | This module aims to provide complete access to the Xicor X1205 RTC. | ||
18 | Recently Xicor has merged with Intersil, but the chip is | ||
19 | still sold under the Xicor brand. | ||
20 | |||
21 | This chip is located at address 0x6f and uses a 2-byte register addressing. | ||
22 | Two bytes need to be written to read a single register, while most | ||
23 | other chips just require one and take the second one as the data | ||
24 | to be written. To prevent corrupting unknown chips, the user must | ||
25 | explicitely set the probe parameter. | ||
26 | |||
27 | example: | ||
28 | |||
29 | modprobe x1205 probe=0,0x6f | ||
30 | |||
31 | The module supports one more option, hctosys, which is used to set the | ||
32 | software clock from the x1205. On systems where the x1205 is the | ||
33 | only hardware rtc, this parameter could be used to achieve a correct | ||
34 | date/time earlier in the system boot sequence. | ||
35 | |||
36 | example: | ||
37 | |||
38 | modprobe x1205 probe=0,0x6f hctosys=1 | ||
diff --git a/Documentation/i2c/summary b/Documentation/i2c/summary index aea60bf7e8f0..003c7319b8c7 100644 --- a/Documentation/i2c/summary +++ b/Documentation/i2c/summary | |||
@@ -67,7 +67,6 @@ i2c-proc: The /proc/sys/dev/sensors interface for device (client) drivers | |||
67 | Algorithm drivers | 67 | Algorithm drivers |
68 | ----------------- | 68 | ----------------- |
69 | 69 | ||
70 | i2c-algo-8xx: An algorithm for CPM's I2C device in Motorola 8xx processors (NOT BUILT BY DEFAULT) | ||
71 | i2c-algo-bit: A bit-banging algorithm | 70 | i2c-algo-bit: A bit-banging algorithm |
72 | i2c-algo-pcf: A PCF 8584 style algorithm | 71 | i2c-algo-pcf: A PCF 8584 style algorithm |
73 | i2c-algo-ibm_ocp: An algorithm for the I2C device in IBM 4xx processors (NOT BUILT BY DEFAULT) | 72 | i2c-algo-ibm_ocp: An algorithm for the I2C device in IBM 4xx processors (NOT BUILT BY DEFAULT) |
@@ -81,6 +80,5 @@ i2c-pcf-epp: PCF8584 on a EPP parallel port (uses i2c-algo-pcf) (NOT mkpatch | |||
81 | i2c-philips-par: Philips style parallel port adapter (uses i2c-algo-bit) | 80 | i2c-philips-par: Philips style parallel port adapter (uses i2c-algo-bit) |
82 | i2c-adap-ibm_ocp: IBM 4xx processor I2C device (uses i2c-algo-ibm_ocp) (NOT BUILT BY DEFAULT) | 81 | i2c-adap-ibm_ocp: IBM 4xx processor I2C device (uses i2c-algo-ibm_ocp) (NOT BUILT BY DEFAULT) |
83 | i2c-pport: Primitive parallel port adapter (uses i2c-algo-bit) | 82 | i2c-pport: Primitive parallel port adapter (uses i2c-algo-bit) |
84 | i2c-rpx: RPX board Motorola 8xx I2C device (uses i2c-algo-8xx) (NOT BUILT BY DEFAULT) | ||
85 | i2c-velleman: Velleman K8000 parallel port adapter (uses i2c-algo-bit) | 83 | i2c-velleman: Velleman K8000 parallel port adapter (uses i2c-algo-bit) |
86 | 84 | ||
diff --git a/Documentation/i2c/writing-clients b/Documentation/i2c/writing-clients index 3d8d36b0ad12..2c170032bf37 100644 --- a/Documentation/i2c/writing-clients +++ b/Documentation/i2c/writing-clients | |||
@@ -571,7 +571,7 @@ SMBus communication | |||
571 | u8 command, u8 length, | 571 | u8 command, u8 length, |
572 | u8 *values); | 572 | u8 *values); |
573 | extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client, | 573 | extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client, |
574 | u8 command, u8 *values); | 574 | u8 command, u8 length, u8 *values); |
575 | 575 | ||
576 | These ones were removed in Linux 2.6.10 because they had no users, but could | 576 | These ones were removed in Linux 2.6.10 because they had no users, but could |
577 | be added back later if needed: | 577 | be added back later if needed: |
diff --git a/Documentation/i386/zero-page.txt b/Documentation/i386/zero-page.txt index c04a421f4a7c..75b3680c41eb 100644 --- a/Documentation/i386/zero-page.txt +++ b/Documentation/i386/zero-page.txt | |||
@@ -37,6 +37,7 @@ Offset Type Description | |||
37 | 0x1d0 unsigned long EFI memory descriptor map pointer | 37 | 0x1d0 unsigned long EFI memory descriptor map pointer |
38 | 0x1d4 unsigned long EFI memory descriptor map size | 38 | 0x1d4 unsigned long EFI memory descriptor map size |
39 | 0x1e0 unsigned long ALT_MEM_K, alternative mem check, in Kb | 39 | 0x1e0 unsigned long ALT_MEM_K, alternative mem check, in Kb |
40 | 0x1e4 unsigned long Scratch field for the kernel setup code | ||
40 | 0x1e8 char number of entries in E820MAP (below) | 41 | 0x1e8 char number of entries in E820MAP (below) |
41 | 0x1e9 unsigned char number of entries in EDDBUF (below) | 42 | 0x1e9 unsigned char number of entries in EDDBUF (below) |
42 | 0x1ea unsigned char number of entries in EDD_MBR_SIG_BUFFER (below) | 43 | 0x1ea unsigned char number of entries in EDD_MBR_SIG_BUFFER (below) |
diff --git a/Documentation/ia64/aliasing-test.c b/Documentation/ia64/aliasing-test.c index d485256ee1ce..773a814d4093 100644 --- a/Documentation/ia64/aliasing-test.c +++ b/Documentation/ia64/aliasing-test.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <sys/mman.h> | 19 | #include <sys/mman.h> |
20 | #include <sys/stat.h> | 20 | #include <sys/stat.h> |
21 | #include <unistd.h> | 21 | #include <unistd.h> |
22 | #include <linux/pci.h> | ||
22 | 23 | ||
23 | int sum; | 24 | int sum; |
24 | 25 | ||
@@ -34,13 +35,19 @@ int map_mem(char *path, off_t offset, size_t length, int touch) | |||
34 | return -1; | 35 | return -1; |
35 | } | 36 | } |
36 | 37 | ||
38 | if (fnmatch("/proc/bus/pci/*", path, 0) == 0) { | ||
39 | rc = ioctl(fd, PCIIOC_MMAP_IS_MEM); | ||
40 | if (rc == -1) | ||
41 | perror("PCIIOC_MMAP_IS_MEM ioctl"); | ||
42 | } | ||
43 | |||
37 | addr = mmap(NULL, length, PROT_READ|PROT_WRITE, MAP_SHARED, fd, offset); | 44 | addr = mmap(NULL, length, PROT_READ|PROT_WRITE, MAP_SHARED, fd, offset); |
38 | if (addr == MAP_FAILED) | 45 | if (addr == MAP_FAILED) |
39 | return 1; | 46 | return 1; |
40 | 47 | ||
41 | if (touch) { | 48 | if (touch) { |
42 | c = (int *) addr; | 49 | c = (int *) addr; |
43 | while (c < (int *) (offset + length)) | 50 | while (c < (int *) (addr + length)) |
44 | sum += *c++; | 51 | sum += *c++; |
45 | } | 52 | } |
46 | 53 | ||
@@ -54,7 +61,7 @@ int map_mem(char *path, off_t offset, size_t length, int touch) | |||
54 | return 0; | 61 | return 0; |
55 | } | 62 | } |
56 | 63 | ||
57 | int scan_sysfs(char *path, char *file, off_t offset, size_t length, int touch) | 64 | int scan_tree(char *path, char *file, off_t offset, size_t length, int touch) |
58 | { | 65 | { |
59 | struct dirent **namelist; | 66 | struct dirent **namelist; |
60 | char *name, *path2; | 67 | char *name, *path2; |
@@ -93,7 +100,7 @@ int scan_sysfs(char *path, char *file, off_t offset, size_t length, int touch) | |||
93 | } else { | 100 | } else { |
94 | r = lstat(path2, &buf); | 101 | r = lstat(path2, &buf); |
95 | if (r == 0 && S_ISDIR(buf.st_mode)) { | 102 | if (r == 0 && S_ISDIR(buf.st_mode)) { |
96 | rc = scan_sysfs(path2, file, offset, length, touch); | 103 | rc = scan_tree(path2, file, offset, length, touch); |
97 | if (rc < 0) | 104 | if (rc < 0) |
98 | return rc; | 105 | return rc; |
99 | } | 106 | } |
@@ -238,10 +245,15 @@ int main() | |||
238 | else | 245 | else |
239 | fprintf(stderr, "FAIL: /dev/mem 0x0-0x100000 not accessible\n"); | 246 | fprintf(stderr, "FAIL: /dev/mem 0x0-0x100000 not accessible\n"); |
240 | 247 | ||
241 | scan_sysfs("/sys/class/pci_bus", "legacy_mem", 0, 0xA0000, 1); | 248 | scan_tree("/sys/class/pci_bus", "legacy_mem", 0, 0xA0000, 1); |
242 | scan_sysfs("/sys/class/pci_bus", "legacy_mem", 0xA0000, 0x20000, 0); | 249 | scan_tree("/sys/class/pci_bus", "legacy_mem", 0xA0000, 0x20000, 0); |
243 | scan_sysfs("/sys/class/pci_bus", "legacy_mem", 0xC0000, 0x40000, 1); | 250 | scan_tree("/sys/class/pci_bus", "legacy_mem", 0xC0000, 0x40000, 1); |
244 | scan_sysfs("/sys/class/pci_bus", "legacy_mem", 0, 1024*1024, 0); | 251 | scan_tree("/sys/class/pci_bus", "legacy_mem", 0, 1024*1024, 0); |
245 | 252 | ||
246 | scan_rom("/sys/devices", "rom"); | 253 | scan_rom("/sys/devices", "rom"); |
254 | |||
255 | scan_tree("/proc/bus/pci", "??.?", 0, 0xA0000, 1); | ||
256 | scan_tree("/proc/bus/pci", "??.?", 0xA0000, 0x20000, 0); | ||
257 | scan_tree("/proc/bus/pci", "??.?", 0xC0000, 0x40000, 1); | ||
258 | scan_tree("/proc/bus/pci", "??.?", 0, 1024*1024, 0); | ||
247 | } | 259 | } |
diff --git a/Documentation/ia64/aliasing.txt b/Documentation/ia64/aliasing.txt index 9a431a7d0f5d..aa3e953f0f7b 100644 --- a/Documentation/ia64/aliasing.txt +++ b/Documentation/ia64/aliasing.txt | |||
@@ -112,6 +112,18 @@ POTENTIAL ATTRIBUTE ALIASING CASES | |||
112 | 112 | ||
113 | The /dev/mem mmap constraints apply. | 113 | The /dev/mem mmap constraints apply. |
114 | 114 | ||
115 | mmap of /proc/bus/pci/.../??.? | ||
116 | |||
117 | This is an MMIO mmap of PCI functions, which additionally may or | ||
118 | may not be requested as using the WC attribute. | ||
119 | |||
120 | If WC is requested, and the region in kern_memmap is either WC | ||
121 | or UC, and the EFI memory map designates the region as WC, then | ||
122 | the WC mapping is allowed. | ||
123 | |||
124 | Otherwise, the user mapping must use the same attribute as the | ||
125 | kernel mapping. | ||
126 | |||
115 | read/write of /dev/mem | 127 | read/write of /dev/mem |
116 | 128 | ||
117 | This uses copy_from_user(), which implicitly uses a kernel | 129 | This uses copy_from_user(), which implicitly uses a kernel |
diff --git a/Documentation/ioctl-number.txt b/Documentation/ioctl-number.txt index 3de7d379cf07..5c7fbf9d96b4 100644 --- a/Documentation/ioctl-number.txt +++ b/Documentation/ioctl-number.txt | |||
@@ -67,7 +67,7 @@ Code Seq# Include File Comments | |||
67 | 0x00 00-1F linux/wavefront.h conflict! | 67 | 0x00 00-1F linux/wavefront.h conflict! |
68 | 0x02 all linux/fd.h | 68 | 0x02 all linux/fd.h |
69 | 0x03 all linux/hdreg.h | 69 | 0x03 all linux/hdreg.h |
70 | 0x04 all linux/umsdos_fs.h | 70 | 0x04 D2-DC linux/umsdos_fs.h Dead since 2.6.11, but don't reuse these. |
71 | 0x06 all linux/lp.h | 71 | 0x06 all linux/lp.h |
72 | 0x09 all linux/md.h | 72 | 0x09 all linux/md.h |
73 | 0x12 all linux/fs.h | 73 | 0x12 all linux/fs.h |
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 4d880b3d1f35..8363ad3ba018 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -34,7 +34,6 @@ parameter is applicable: | |||
34 | APIC APIC support is enabled. | 34 | APIC APIC support is enabled. |
35 | APM Advanced Power Management support is enabled. | 35 | APM Advanced Power Management support is enabled. |
36 | AX25 Appropriate AX.25 support is enabled. | 36 | AX25 Appropriate AX.25 support is enabled. |
37 | CD Appropriate CD support is enabled. | ||
38 | DRM Direct Rendering Management support is enabled. | 37 | DRM Direct Rendering Management support is enabled. |
39 | EDD BIOS Enhanced Disk Drive Services (EDD) is enabled | 38 | EDD BIOS Enhanced Disk Drive Services (EDD) is enabled |
40 | EFI EFI Partitioning (GPT) is enabled | 39 | EFI EFI Partitioning (GPT) is enabled |
@@ -238,16 +237,9 @@ and is between 256 and 4096 characters. It is defined in the file | |||
238 | Disable PIN 1 of APIC timer | 237 | Disable PIN 1 of APIC timer |
239 | Can be useful to work around chipset bugs. | 238 | Can be useful to work around chipset bugs. |
240 | 239 | ||
241 | ad1816= [HW,OSS] | ||
242 | Format: <io>,<irq>,<dma>,<dma2> | ||
243 | See also Documentation/sound/oss/AD1816. | ||
244 | |||
245 | ad1848= [HW,OSS] | 240 | ad1848= [HW,OSS] |
246 | Format: <io>,<irq>,<dma>,<dma2>,<type> | 241 | Format: <io>,<irq>,<dma>,<dma2>,<type> |
247 | 242 | ||
248 | adlib= [HW,OSS] | ||
249 | Format: <io> | ||
250 | |||
251 | advansys= [HW,SCSI] | 243 | advansys= [HW,SCSI] |
252 | See header of drivers/scsi/advansys.c. | 244 | See header of drivers/scsi/advansys.c. |
253 | 245 | ||
@@ -326,9 +318,6 @@ and is between 256 and 4096 characters. It is defined in the file | |||
326 | 318 | ||
327 | autotest [IA64] | 319 | autotest [IA64] |
328 | 320 | ||
329 | aztcd= [HW,CD] Aztech CD268 CDROM driver | ||
330 | Format: <io>,0x79 (?) | ||
331 | |||
332 | baycom_epp= [HW,AX25] | 321 | baycom_epp= [HW,AX25] |
333 | Format: <io>,<mode> | 322 | Format: <io>,<mode> |
334 | 323 | ||
@@ -371,10 +360,6 @@ and is between 256 and 4096 characters. It is defined in the file | |||
371 | possible to determine what the correct size should be. | 360 | possible to determine what the correct size should be. |
372 | This option provides an override for these situations. | 361 | This option provides an override for these situations. |
373 | 362 | ||
374 | cdu31a= [HW,CD] | ||
375 | Format: <io>,<irq>[,PAS] | ||
376 | See header of drivers/cdrom/cdu31a.c. | ||
377 | |||
378 | chandev= [HW,NET] Generic channel device initialisation | 363 | chandev= [HW,NET] Generic channel device initialisation |
379 | 364 | ||
380 | checkreqprot [SELINUX] Set initial checkreqprot flag value. | 365 | checkreqprot [SELINUX] Set initial checkreqprot flag value. |
@@ -428,9 +413,6 @@ and is between 256 and 4096 characters. It is defined in the file | |||
428 | hpet= [IA-32,HPET] option to disable HPET and use PIT. | 413 | hpet= [IA-32,HPET] option to disable HPET and use PIT. |
429 | Format: disable | 414 | Format: disable |
430 | 415 | ||
431 | cm206= [HW,CD] | ||
432 | Format: { auto | [<io>,][<irq>] } | ||
433 | |||
434 | com20020= [HW,NET] ARCnet - COM20020 chipset | 416 | com20020= [HW,NET] ARCnet - COM20020 chipset |
435 | Format: | 417 | Format: |
436 | <io>[,<irq>[,<nodeID>[,<backplane>[,<ckp>[,<timeout>]]]]] | 418 | <io>[,<irq>[,<nodeID>[,<backplane>[,<ckp>[,<timeout>]]]]] |
@@ -462,13 +444,20 @@ and is between 256 and 4096 characters. It is defined in the file | |||
462 | Documentation/networking/netconsole.txt for an | 444 | Documentation/networking/netconsole.txt for an |
463 | alternative. | 445 | alternative. |
464 | 446 | ||
465 | uart,io,<addr>[,options] | 447 | uart[8250],io,<addr>[,options] |
466 | uart,mmio,<addr>[,options] | 448 | uart[8250],mmio,<addr>[,options] |
467 | Start an early, polled-mode console on the 8250/16550 | 449 | Start an early, polled-mode console on the 8250/16550 |
468 | UART at the specified I/O port or MMIO address, | 450 | UART at the specified I/O port or MMIO address, |
469 | switching to the matching ttyS device later. The | 451 | switching to the matching ttyS device later. The |
470 | options are the same as for ttyS, above. | 452 | options are the same as for ttyS, above. |
471 | 453 | ||
454 | earlycon= [KNL] Output early console device and options. | ||
455 | uart[8250],io,<addr>[,options] | ||
456 | uart[8250],mmio,<addr>[,options] | ||
457 | Start an early, polled-mode console on the 8250/16550 | ||
458 | UART at the specified I/O port or MMIO address. | ||
459 | The options are the same as for ttyS, above. | ||
460 | |||
472 | cpcihp_generic= [HW,PCI] Generic port I/O CompactPCI driver | 461 | cpcihp_generic= [HW,PCI] Generic port I/O CompactPCI driver |
473 | Format: | 462 | Format: |
474 | <first_slot>,<last_slot>,<port>,<enum_bit>[,<debug>] | 463 | <first_slot>,<last_slot>,<port>,<enum_bit>[,<debug>] |
@@ -660,9 +649,6 @@ and is between 256 and 4096 characters. It is defined in the file | |||
660 | gpt [EFI] Forces disk with valid GPT signature but | 649 | gpt [EFI] Forces disk with valid GPT signature but |
661 | invalid Protective MBR to be treated as GPT. | 650 | invalid Protective MBR to be treated as GPT. |
662 | 651 | ||
663 | gscd= [HW,CD] | ||
664 | Format: <io> | ||
665 | |||
666 | gvp11= [HW,SCSI] | 652 | gvp11= [HW,SCSI] |
667 | 653 | ||
668 | hashdist= [KNL,NUMA] Large hashes allocated during boot | 654 | hashdist= [KNL,NUMA] Large hashes allocated during boot |
@@ -826,9 +812,6 @@ and is between 256 and 4096 characters. It is defined in the file | |||
826 | tasks in the system -- can cause problems and | 812 | tasks in the system -- can cause problems and |
827 | suboptimal load balancer performance. | 813 | suboptimal load balancer performance. |
828 | 814 | ||
829 | isp16= [HW,CD] | ||
830 | Format: <io>,<irq>,<dma>,<setup> | ||
831 | |||
832 | iucv= [HW,NET] | 815 | iucv= [HW,NET] |
833 | 816 | ||
834 | js= [HW,JOY] Analog joystick | 817 | js= [HW,JOY] Analog joystick |
@@ -967,11 +950,6 @@ and is between 256 and 4096 characters. It is defined in the file | |||
967 | 950 | ||
968 | mcatest= [IA-64] | 951 | mcatest= [IA-64] |
969 | 952 | ||
970 | mcd= [HW,CD] | ||
971 | Format: <port>,<irq>,<mitsumi_bug_93_wait> | ||
972 | |||
973 | mcdx= [HW,CD] | ||
974 | |||
975 | mce [IA-32] Machine Check Exception | 953 | mce [IA-32] Machine Check Exception |
976 | 954 | ||
977 | md= [HW] RAID subsystems devices and level | 955 | md= [HW] RAID subsystems devices and level |
@@ -1181,6 +1159,8 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1181 | 1159 | ||
1182 | nosmp [SMP] Tells an SMP kernel to act as a UP kernel. | 1160 | nosmp [SMP] Tells an SMP kernel to act as a UP kernel. |
1183 | 1161 | ||
1162 | nosoftlockup [KNL] Disable the soft-lockup detector. | ||
1163 | |||
1184 | nosync [HW,M68K] Disables sync negotiation for all devices. | 1164 | nosync [HW,M68K] Disables sync negotiation for all devices. |
1185 | 1165 | ||
1186 | notsc [BUGS=IA-32] Disable Time Stamp Counter | 1166 | notsc [BUGS=IA-32] Disable Time Stamp Counter |
@@ -1189,20 +1169,19 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1189 | 1169 | ||
1190 | nowb [ARM] | 1170 | nowb [ARM] |
1191 | 1171 | ||
1172 | numa_zonelist_order= [KNL, BOOT] Select zonelist order for NUMA. | ||
1173 | one of ['zone', 'node', 'default'] can be specified | ||
1174 | This can be set from sysctl after boot. | ||
1175 | See Documentation/sysctl/vm.txt for details. | ||
1176 | |||
1192 | nr_uarts= [SERIAL] maximum number of UARTs to be registered. | 1177 | nr_uarts= [SERIAL] maximum number of UARTs to be registered. |
1193 | 1178 | ||
1194 | opl3= [HW,OSS] | 1179 | opl3= [HW,OSS] |
1195 | Format: <io> | 1180 | Format: <io> |
1196 | 1181 | ||
1197 | opl3sa2= [HW,OSS] Format: | ||
1198 | <io>,<irq>,<dma>,<dma2>,<mss_io>,<mpu_io>,<ymode>,<loopback>[,<isapnp>,<multiple] | ||
1199 | |||
1200 | oprofile.timer= [HW] | 1182 | oprofile.timer= [HW] |
1201 | Use timer interrupt instead of performance counters | 1183 | Use timer interrupt instead of performance counters |
1202 | 1184 | ||
1203 | optcd= [HW,CD] | ||
1204 | Format: <io> | ||
1205 | |||
1206 | osst= [HW,SCSI] SCSI Tape Driver | 1185 | osst= [HW,SCSI] SCSI Tape Driver |
1207 | Format: <buffer_size>,<write_threshold> | 1186 | Format: <buffer_size>,<write_threshold> |
1208 | See also Documentation/scsi/st.txt. | 1187 | See also Documentation/scsi/st.txt. |
@@ -1381,6 +1360,15 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1381 | autoconfiguration. | 1360 | autoconfiguration. |
1382 | Ranges are in pairs (memory base and size). | 1361 | Ranges are in pairs (memory base and size). |
1383 | 1362 | ||
1363 | print-fatal-signals= | ||
1364 | [KNL] debug: print fatal signals | ||
1365 | print-fatal-signals=1: print segfault info to | ||
1366 | the kernel console. | ||
1367 | default: off. | ||
1368 | |||
1369 | printk.time= Show timing data prefixed to each printk message line | ||
1370 | Format: <bool> (1/Y/y=enable, 0/N/n=disable) | ||
1371 | |||
1384 | profile= [KNL] Enable kernel profiling via /proc/profile | 1372 | profile= [KNL] Enable kernel profiling via /proc/profile |
1385 | Format: [schedule,]<number> | 1373 | Format: [schedule,]<number> |
1386 | Param: "schedule" - profile schedule points. | 1374 | Param: "schedule" - profile schedule points. |
@@ -1493,6 +1481,10 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1493 | 1481 | ||
1494 | rootfstype= [KNL] Set root filesystem type | 1482 | rootfstype= [KNL] Set root filesystem type |
1495 | 1483 | ||
1484 | rootwait [KNL] Wait (indefinitely) for root device to show up. | ||
1485 | Useful for devices that are detected asynchronously | ||
1486 | (e.g. USB and MMC devices). | ||
1487 | |||
1496 | rw [KNL] Mount root device read-write on boot | 1488 | rw [KNL] Mount root device read-write on boot |
1497 | 1489 | ||
1498 | S [KNL] Run init in single mode | 1490 | S [KNL] Run init in single mode |
@@ -1505,11 +1497,6 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1505 | 1497 | ||
1506 | sbni= [NET] Granch SBNI12 leased line adapter | 1498 | sbni= [NET] Granch SBNI12 leased line adapter |
1507 | 1499 | ||
1508 | sbpcd= [HW,CD] Soundblaster CD adapter | ||
1509 | Format: <io>,<type> | ||
1510 | See a comment before function sbpcd_setup() in | ||
1511 | drivers/cdrom/sbpcd.c. | ||
1512 | |||
1513 | sc1200wdt= [HW,WDT] SC1200 WDT (watchdog) driver | 1500 | sc1200wdt= [HW,WDT] SC1200 WDT (watchdog) driver |
1514 | Format: <io>[,<timeout>[,<isapnp>]] | 1501 | Format: <io>[,<timeout>[,<isapnp>]] |
1515 | 1502 | ||
@@ -1562,41 +1549,41 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1562 | simeth= [IA-64] | 1549 | simeth= [IA-64] |
1563 | simscsi= | 1550 | simscsi= |
1564 | 1551 | ||
1565 | sjcd= [HW,CD] | ||
1566 | Format: <io>,<irq>,<dma> | ||
1567 | See header of drivers/cdrom/sjcd.c. | ||
1568 | |||
1569 | slram= [HW,MTD] | 1552 | slram= [HW,MTD] |
1570 | 1553 | ||
1571 | slub_debug [MM, SLUB] | 1554 | slub_debug[=options[,slabs]] [MM, SLUB] |
1572 | Enabling slub_debug allows one to determine the culprit | 1555 | Enabling slub_debug allows one to determine the |
1573 | if slab objects become corrupted. Enabling slub_debug | 1556 | culprit if slab objects become corrupted. Enabling |
1574 | creates guard zones around objects and poisons objects | 1557 | slub_debug can create guard zones around objects and |
1575 | when not in use. Also tracks the last alloc / free. | 1558 | may poison objects when not in use. Also tracks the |
1576 | For more information see Documentation/vm/slub.txt. | 1559 | last alloc / free. For more information see |
1560 | Documentation/vm/slub.txt. | ||
1577 | 1561 | ||
1578 | slub_max_order= [MM, SLUB] | 1562 | slub_max_order= [MM, SLUB] |
1579 | Determines the maximum allowed order for slabs. Setting | 1563 | Determines the maximum allowed order for slabs. |
1580 | this too high may cause fragmentation. | 1564 | A high setting may cause OOMs due to memory |
1581 | For more information see Documentation/vm/slub.txt. | 1565 | fragmentation. For more information see |
1566 | Documentation/vm/slub.txt. | ||
1582 | 1567 | ||
1583 | slub_min_objects= [MM, SLUB] | 1568 | slub_min_objects= [MM, SLUB] |
1584 | The minimum objects per slab. SLUB will increase the | 1569 | The minimum number of objects per slab. SLUB will |
1585 | slab order up to slub_max_order to generate a | 1570 | increase the slab order up to slub_max_order to |
1586 | sufficiently big slab to satisfy the number of objects. | 1571 | generate a sufficiently large slab able to contain |
1587 | The higher the number of objects the smaller the overhead | 1572 | the number of objects indicated. The higher the number |
1588 | of tracking slabs. | 1573 | of objects the smaller the overhead of tracking slabs |
1574 | and the less frequently locks need to be acquired. | ||
1589 | For more information see Documentation/vm/slub.txt. | 1575 | For more information see Documentation/vm/slub.txt. |
1590 | 1576 | ||
1591 | slub_min_order= [MM, SLUB] | 1577 | slub_min_order= [MM, SLUB] |
1592 | Determines the mininum page order for slabs. Must be | 1578 | Determines the mininum page order for slabs. Must be |
1593 | lower than slub_max_order | 1579 | lower than slub_max_order. |
1594 | For more information see Documentation/vm/slub.txt. | 1580 | For more information see Documentation/vm/slub.txt. |
1595 | 1581 | ||
1596 | slub_nomerge [MM, SLUB] | 1582 | slub_nomerge [MM, SLUB] |
1597 | Disable merging of slabs of similar size. May be | 1583 | Disable merging of slabs with similar size. May be |
1598 | necessary if there is some reason to distinguish | 1584 | necessary if there is some reason to distinguish |
1599 | allocs to different slabs. | 1585 | allocs to different slabs. Debug options disable |
1586 | merging on their own. | ||
1600 | For more information see Documentation/vm/slub.txt. | 1587 | For more information see Documentation/vm/slub.txt. |
1601 | 1588 | ||
1602 | smart2= [HW] | 1589 | smart2= [HW] |
@@ -1738,9 +1725,6 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1738 | 1725 | ||
1739 | snd-ymfpci= [HW,ALSA] | 1726 | snd-ymfpci= [HW,ALSA] |
1740 | 1727 | ||
1741 | sonycd535= [HW,CD] | ||
1742 | Format: <io>[,<irq>] | ||
1743 | |||
1744 | sonypi.*= [HW] Sony Programmable I/O Control Device driver | 1728 | sonypi.*= [HW] Sony Programmable I/O Control Device driver |
1745 | See Documentation/sonypi.txt | 1729 | See Documentation/sonypi.txt |
1746 | 1730 | ||
@@ -1812,6 +1796,7 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1812 | Set number of hash buckets for TCP connection | 1796 | Set number of hash buckets for TCP connection |
1813 | 1797 | ||
1814 | time Show timing data prefixed to each printk message line | 1798 | time Show timing data prefixed to each printk message line |
1799 | [deprecated, see 'printk.time'] | ||
1815 | 1800 | ||
1816 | tipar.timeout= [HW,PPT] | 1801 | tipar.timeout= [HW,PPT] |
1817 | Set communications timeout in tenths of a second | 1802 | Set communications timeout in tenths of a second |
diff --git a/Documentation/m68k/kernel-options.txt b/Documentation/m68k/kernel-options.txt index 1c41db21d3c1..59108cebe163 100644 --- a/Documentation/m68k/kernel-options.txt +++ b/Documentation/m68k/kernel-options.txt | |||
@@ -82,13 +82,6 @@ Valid names are: | |||
82 | /dev/fd : -> 0x0200 (floppy disk) | 82 | /dev/fd : -> 0x0200 (floppy disk) |
83 | /dev/xda: -> 0x0c00 (first XT disk, unused in Linux/m68k) | 83 | /dev/xda: -> 0x0c00 (first XT disk, unused in Linux/m68k) |
84 | /dev/xdb: -> 0x0c40 (second XT disk, unused in Linux/m68k) | 84 | /dev/xdb: -> 0x0c40 (second XT disk, unused in Linux/m68k) |
85 | /dev/ada: -> 0x1c00 (first ACSI device) | ||
86 | /dev/adb: -> 0x1c10 (second ACSI device) | ||
87 | /dev/adc: -> 0x1c20 (third ACSI device) | ||
88 | /dev/add: -> 0x1c30 (forth ACSI device) | ||
89 | |||
90 | The last four names are available only if the kernel has been compiled | ||
91 | with Atari and ACSI support. | ||
92 | 85 | ||
93 | The name must be followed by a decimal number, that stands for the | 86 | The name must be followed by a decimal number, that stands for the |
94 | partition number. Internally, the value of the number is just | 87 | partition number. Internally, the value of the number is just |
diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt index af6a63ab9026..32c2e9da5f3a 100644 --- a/Documentation/networking/ip-sysctl.txt +++ b/Documentation/networking/ip-sysctl.txt | |||
@@ -433,6 +433,12 @@ tcp_workaround_signed_windows - BOOLEAN | |||
433 | not receive a window scaling option from them. | 433 | not receive a window scaling option from them. |
434 | Default: 0 | 434 | Default: 0 |
435 | 435 | ||
436 | tcp_dma_copybreak - INTEGER | ||
437 | Lower limit, in bytes, of the size of socket reads that will be | ||
438 | offloaded to a DMA copy engine, if one is present in the system | ||
439 | and CONFIG_NET_DMA is enabled. | ||
440 | Default: 4096 | ||
441 | |||
436 | CIPSOv4 Variables: | 442 | CIPSOv4 Variables: |
437 | 443 | ||
438 | cipso_cache_enable - BOOLEAN | 444 | cipso_cache_enable - BOOLEAN |
@@ -874,8 +880,7 @@ accept_redirects - BOOLEAN | |||
874 | accept_source_route - INTEGER | 880 | accept_source_route - INTEGER |
875 | Accept source routing (routing extension header). | 881 | Accept source routing (routing extension header). |
876 | 882 | ||
877 | > 0: Accept routing header. | 883 | >= 0: Accept only routing header type 2. |
878 | = 0: Accept only routing header type 2. | ||
879 | < 0: Do not accept routing header. | 884 | < 0: Do not accept routing header. |
880 | 885 | ||
881 | Default: 0 | 886 | Default: 0 |
diff --git a/Documentation/networking/l2tp.txt b/Documentation/networking/l2tp.txt new file mode 100644 index 000000000000..2451f551c505 --- /dev/null +++ b/Documentation/networking/l2tp.txt | |||
@@ -0,0 +1,169 @@ | |||
1 | This brief document describes how to use the kernel's PPPoL2TP driver | ||
2 | to provide L2TP functionality. L2TP is a protocol that tunnels one or | ||
3 | more PPP sessions over a UDP tunnel. It is commonly used for VPNs | ||
4 | (L2TP/IPSec) and by ISPs to tunnel subscriber PPP sessions over an IP | ||
5 | network infrastructure. | ||
6 | |||
7 | Design | ||
8 | ====== | ||
9 | |||
10 | The PPPoL2TP driver, drivers/net/pppol2tp.c, provides a mechanism by | ||
11 | which PPP frames carried through an L2TP session are passed through | ||
12 | the kernel's PPP subsystem. The standard PPP daemon, pppd, handles all | ||
13 | PPP interaction with the peer. PPP network interfaces are created for | ||
14 | each local PPP endpoint. | ||
15 | |||
16 | The L2TP protocol http://www.faqs.org/rfcs/rfc2661.html defines L2TP | ||
17 | control and data frames. L2TP control frames carry messages between | ||
18 | L2TP clients/servers and are used to setup / teardown tunnels and | ||
19 | sessions. An L2TP client or server is implemented in userspace and | ||
20 | will use a regular UDP socket per tunnel. L2TP data frames carry PPP | ||
21 | frames, which may be PPP control or PPP data. The kernel's PPP | ||
22 | subsystem arranges for PPP control frames to be delivered to pppd, | ||
23 | while data frames are forwarded as usual. | ||
24 | |||
25 | Each tunnel and session within a tunnel is assigned a unique tunnel_id | ||
26 | and session_id. These ids are carried in the L2TP header of every | ||
27 | control and data packet. The pppol2tp driver uses them to lookup | ||
28 | internal tunnel and/or session contexts. Zero tunnel / session ids are | ||
29 | treated specially - zero ids are never assigned to tunnels or sessions | ||
30 | in the network. In the driver, the tunnel context keeps a pointer to | ||
31 | the tunnel UDP socket. The session context keeps a pointer to the | ||
32 | PPPoL2TP socket, as well as other data that lets the driver interface | ||
33 | to the kernel PPP subsystem. | ||
34 | |||
35 | Note that the pppol2tp kernel driver handles only L2TP data frames; | ||
36 | L2TP control frames are simply passed up to userspace in the UDP | ||
37 | tunnel socket. The kernel handles all datapath aspects of the | ||
38 | protocol, including data packet resequencing (if enabled). | ||
39 | |||
40 | There are a number of requirements on the userspace L2TP daemon in | ||
41 | order to use the pppol2tp driver. | ||
42 | |||
43 | 1. Use a UDP socket per tunnel. | ||
44 | |||
45 | 2. Create a single PPPoL2TP socket per tunnel bound to a special null | ||
46 | session id. This is used only for communicating with the driver but | ||
47 | must remain open while the tunnel is active. Opening this tunnel | ||
48 | management socket causes the driver to mark the tunnel socket as an | ||
49 | L2TP UDP encapsulation socket and flags it for use by the | ||
50 | referenced tunnel id. This hooks up the UDP receive path via | ||
51 | udp_encap_rcv() in net/ipv4/udp.c. PPP data frames are never passed | ||
52 | in this special PPPoX socket. | ||
53 | |||
54 | 3. Create a PPPoL2TP socket per L2TP session. This is typically done | ||
55 | by starting pppd with the pppol2tp plugin and appropriate | ||
56 | arguments. A PPPoL2TP tunnel management socket (Step 2) must be | ||
57 | created before the first PPPoL2TP session socket is created. | ||
58 | |||
59 | When creating PPPoL2TP sockets, the application provides information | ||
60 | to the driver about the socket in a socket connect() call. Source and | ||
61 | destination tunnel and session ids are provided, as well as the file | ||
62 | descriptor of a UDP socket. See struct pppol2tp_addr in | ||
63 | include/linux/if_ppp.h. Note that zero tunnel / session ids are | ||
64 | treated specially. When creating the per-tunnel PPPoL2TP management | ||
65 | socket in Step 2 above, zero source and destination session ids are | ||
66 | specified, which tells the driver to prepare the supplied UDP file | ||
67 | descriptor for use as an L2TP tunnel socket. | ||
68 | |||
69 | Userspace may control behavior of the tunnel or session using | ||
70 | setsockopt and ioctl on the PPPoX socket. The following socket | ||
71 | options are supported:- | ||
72 | |||
73 | DEBUG - bitmask of debug message categories. See below. | ||
74 | SENDSEQ - 0 => don't send packets with sequence numbers | ||
75 | 1 => send packets with sequence numbers | ||
76 | RECVSEQ - 0 => receive packet sequence numbers are optional | ||
77 | 1 => drop receive packets without sequence numbers | ||
78 | LNSMODE - 0 => act as LAC. | ||
79 | 1 => act as LNS. | ||
80 | REORDERTO - reorder timeout (in millisecs). If 0, don't try to reorder. | ||
81 | |||
82 | Only the DEBUG option is supported by the special tunnel management | ||
83 | PPPoX socket. | ||
84 | |||
85 | In addition to the standard PPP ioctls, a PPPIOCGL2TPSTATS is provided | ||
86 | to retrieve tunnel and session statistics from the kernel using the | ||
87 | PPPoX socket of the appropriate tunnel or session. | ||
88 | |||
89 | Debugging | ||
90 | ========= | ||
91 | |||
92 | The driver supports a flexible debug scheme where kernel trace | ||
93 | messages may be optionally enabled per tunnel and per session. Care is | ||
94 | needed when debugging a live system since the messages are not | ||
95 | rate-limited and a busy system could be swamped. Userspace uses | ||
96 | setsockopt on the PPPoX socket to set a debug mask. | ||
97 | |||
98 | The following debug mask bits are available: | ||
99 | |||
100 | PPPOL2TP_MSG_DEBUG verbose debug (if compiled in) | ||
101 | PPPOL2TP_MSG_CONTROL userspace - kernel interface | ||
102 | PPPOL2TP_MSG_SEQ sequence numbers handling | ||
103 | PPPOL2TP_MSG_DATA data packets | ||
104 | |||
105 | Sample Userspace Code | ||
106 | ===================== | ||
107 | |||
108 | 1. Create tunnel management PPPoX socket | ||
109 | |||
110 | kernel_fd = socket(AF_PPPOX, SOCK_DGRAM, PX_PROTO_OL2TP); | ||
111 | if (kernel_fd >= 0) { | ||
112 | struct sockaddr_pppol2tp sax; | ||
113 | struct sockaddr_in const *peer_addr; | ||
114 | |||
115 | peer_addr = l2tp_tunnel_get_peer_addr(tunnel); | ||
116 | memset(&sax, 0, sizeof(sax)); | ||
117 | sax.sa_family = AF_PPPOX; | ||
118 | sax.sa_protocol = PX_PROTO_OL2TP; | ||
119 | sax.pppol2tp.fd = udp_fd; /* fd of tunnel UDP socket */ | ||
120 | sax.pppol2tp.addr.sin_addr.s_addr = peer_addr->sin_addr.s_addr; | ||
121 | sax.pppol2tp.addr.sin_port = peer_addr->sin_port; | ||
122 | sax.pppol2tp.addr.sin_family = AF_INET; | ||
123 | sax.pppol2tp.s_tunnel = tunnel_id; | ||
124 | sax.pppol2tp.s_session = 0; /* special case: mgmt socket */ | ||
125 | sax.pppol2tp.d_tunnel = 0; | ||
126 | sax.pppol2tp.d_session = 0; /* special case: mgmt socket */ | ||
127 | |||
128 | if(connect(kernel_fd, (struct sockaddr *)&sax, sizeof(sax) ) < 0 ) { | ||
129 | perror("connect failed"); | ||
130 | result = -errno; | ||
131 | goto err; | ||
132 | } | ||
133 | } | ||
134 | |||
135 | 2. Create session PPPoX data socket | ||
136 | |||
137 | struct sockaddr_pppol2tp sax; | ||
138 | int fd; | ||
139 | |||
140 | /* Note, the target socket must be bound already, else it will not be ready */ | ||
141 | sax.sa_family = AF_PPPOX; | ||
142 | sax.sa_protocol = PX_PROTO_OL2TP; | ||
143 | sax.pppol2tp.fd = tunnel_fd; | ||
144 | sax.pppol2tp.addr.sin_addr.s_addr = addr->sin_addr.s_addr; | ||
145 | sax.pppol2tp.addr.sin_port = addr->sin_port; | ||
146 | sax.pppol2tp.addr.sin_family = AF_INET; | ||
147 | sax.pppol2tp.s_tunnel = tunnel_id; | ||
148 | sax.pppol2tp.s_session = session_id; | ||
149 | sax.pppol2tp.d_tunnel = peer_tunnel_id; | ||
150 | sax.pppol2tp.d_session = peer_session_id; | ||
151 | |||
152 | /* session_fd is the fd of the session's PPPoL2TP socket. | ||
153 | * tunnel_fd is the fd of the tunnel UDP socket. | ||
154 | */ | ||
155 | fd = connect(session_fd, (struct sockaddr *)&sax, sizeof(sax)); | ||
156 | if (fd < 0 ) { | ||
157 | return -errno; | ||
158 | } | ||
159 | return 0; | ||
160 | |||
161 | Miscellanous | ||
162 | ============ | ||
163 | |||
164 | The PPPoL2TP driver was developed as part of the OpenL2TP project by | ||
165 | Katalix Systems Ltd. OpenL2TP is a full-featured L2TP client / server, | ||
166 | designed from the ground up to have the L2TP datapath in the | ||
167 | kernel. The project also implemented the pppol2tp plugin for pppd | ||
168 | which allows pppd to use the kernel driver. Details can be found at | ||
169 | http://openl2tp.sourceforge.net. | ||
diff --git a/Documentation/networking/mac80211-injection.txt b/Documentation/networking/mac80211-injection.txt new file mode 100644 index 000000000000..53ef7a06f49c --- /dev/null +++ b/Documentation/networking/mac80211-injection.txt | |||
@@ -0,0 +1,59 @@ | |||
1 | How to use packet injection with mac80211 | ||
2 | ========================================= | ||
3 | |||
4 | mac80211 now allows arbitrary packets to be injected down any Monitor Mode | ||
5 | interface from userland. The packet you inject needs to be composed in the | ||
6 | following format: | ||
7 | |||
8 | [ radiotap header ] | ||
9 | [ ieee80211 header ] | ||
10 | [ payload ] | ||
11 | |||
12 | The radiotap format is discussed in | ||
13 | ./Documentation/networking/radiotap-headers.txt. | ||
14 | |||
15 | Despite 13 radiotap argument types are currently defined, most only make sense | ||
16 | to appear on received packets. Currently three kinds of argument are used by | ||
17 | the injection code, although it knows to skip any other arguments that are | ||
18 | present (facilitating replay of captured radiotap headers directly): | ||
19 | |||
20 | - IEEE80211_RADIOTAP_RATE - u8 arg in 500kbps units (0x02 --> 1Mbps) | ||
21 | |||
22 | - IEEE80211_RADIOTAP_ANTENNA - u8 arg, 0x00 = ant1, 0x01 = ant2 | ||
23 | |||
24 | - IEEE80211_RADIOTAP_DBM_TX_POWER - u8 arg, dBm | ||
25 | |||
26 | Here is an example valid radiotap header defining these three parameters | ||
27 | |||
28 | 0x00, 0x00, // <-- radiotap version | ||
29 | 0x0b, 0x00, // <- radiotap header length | ||
30 | 0x04, 0x0c, 0x00, 0x00, // <-- bitmap | ||
31 | 0x6c, // <-- rate | ||
32 | 0x0c, //<-- tx power | ||
33 | 0x01 //<-- antenna | ||
34 | |||
35 | The ieee80211 header follows immediately afterwards, looking for example like | ||
36 | this: | ||
37 | |||
38 | 0x08, 0x01, 0x00, 0x00, | ||
39 | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, | ||
40 | 0x13, 0x22, 0x33, 0x44, 0x55, 0x66, | ||
41 | 0x13, 0x22, 0x33, 0x44, 0x55, 0x66, | ||
42 | 0x10, 0x86 | ||
43 | |||
44 | Then lastly there is the payload. | ||
45 | |||
46 | After composing the packet contents, it is sent by send()-ing it to a logical | ||
47 | mac80211 interface that is in Monitor mode. Libpcap can also be used, | ||
48 | (which is easier than doing the work to bind the socket to the right | ||
49 | interface), along the following lines: | ||
50 | |||
51 | ppcap = pcap_open_live(szInterfaceName, 800, 1, 20, szErrbuf); | ||
52 | ... | ||
53 | r = pcap_inject(ppcap, u8aSendBuffer, nLength); | ||
54 | |||
55 | You can also find sources for a complete inject test applet here: | ||
56 | |||
57 | http://penumbra.warmcat.com/_twk/tiki-index.php?page=packetspammer | ||
58 | |||
59 | Andy Green <andy@warmcat.com> | ||
diff --git a/Documentation/networking/multiqueue.txt b/Documentation/networking/multiqueue.txt new file mode 100644 index 000000000000..00b60cce2224 --- /dev/null +++ b/Documentation/networking/multiqueue.txt | |||
@@ -0,0 +1,111 @@ | |||
1 | |||
2 | HOWTO for multiqueue network device support | ||
3 | =========================================== | ||
4 | |||
5 | Section 1: Base driver requirements for implementing multiqueue support | ||
6 | Section 2: Qdisc support for multiqueue devices | ||
7 | Section 3: Brief howto using PRIO or RR for multiqueue devices | ||
8 | |||
9 | |||
10 | Intro: Kernel support for multiqueue devices | ||
11 | --------------------------------------------------------- | ||
12 | |||
13 | Kernel support for multiqueue devices is only an API that is presented to the | ||
14 | netdevice layer for base drivers to implement. This feature is part of the | ||
15 | core networking stack, and all network devices will be running on the | ||
16 | multiqueue-aware stack. If a base driver only has one queue, then these | ||
17 | changes are transparent to that driver. | ||
18 | |||
19 | |||
20 | Section 1: Base driver requirements for implementing multiqueue support | ||
21 | ----------------------------------------------------------------------- | ||
22 | |||
23 | Base drivers are required to use the new alloc_etherdev_mq() or | ||
24 | alloc_netdev_mq() functions to allocate the subqueues for the device. The | ||
25 | underlying kernel API will take care of the allocation and deallocation of | ||
26 | the subqueue memory, as well as netdev configuration of where the queues | ||
27 | exist in memory. | ||
28 | |||
29 | The base driver will also need to manage the queues as it does the global | ||
30 | netdev->queue_lock today. Therefore base drivers should use the | ||
31 | netif_{start|stop|wake}_subqueue() functions to manage each queue while the | ||
32 | device is still operational. netdev->queue_lock is still used when the device | ||
33 | comes online or when it's completely shut down (unregister_netdev(), etc.). | ||
34 | |||
35 | Finally, the base driver should indicate that it is a multiqueue device. The | ||
36 | feature flag NETIF_F_MULTI_QUEUE should be added to the netdev->features | ||
37 | bitmap on device initialization. Below is an example from e1000: | ||
38 | |||
39 | #ifdef CONFIG_E1000_MQ | ||
40 | if ( (adapter->hw.mac.type == e1000_82571) || | ||
41 | (adapter->hw.mac.type == e1000_82572) || | ||
42 | (adapter->hw.mac.type == e1000_80003es2lan)) | ||
43 | netdev->features |= NETIF_F_MULTI_QUEUE; | ||
44 | #endif | ||
45 | |||
46 | |||
47 | Section 2: Qdisc support for multiqueue devices | ||
48 | ----------------------------------------------- | ||
49 | |||
50 | Currently two qdiscs support multiqueue devices. A new round-robin qdisc, | ||
51 | sch_rr, and sch_prio. The qdisc is responsible for classifying the skb's to | ||
52 | bands and queues, and will store the queue mapping into skb->queue_mapping. | ||
53 | Use this field in the base driver to determine which queue to send the skb | ||
54 | to. | ||
55 | |||
56 | sch_rr has been added for hardware that doesn't want scheduling policies from | ||
57 | software, so it's a straight round-robin qdisc. It uses the same syntax and | ||
58 | classification priomap that sch_prio uses, so it should be intuitive to | ||
59 | configure for people who've used sch_prio. | ||
60 | |||
61 | The PRIO qdisc naturally plugs into a multiqueue device. If PRIO has been | ||
62 | built with NET_SCH_PRIO_MQ, then upon load, it will make sure the number of | ||
63 | bands requested is equal to the number of queues on the hardware. If they | ||
64 | are equal, it sets a one-to-one mapping up between the queues and bands. If | ||
65 | they're not equal, it will not load the qdisc. This is the same behavior | ||
66 | for RR. Once the association is made, any skb that is classified will have | ||
67 | skb->queue_mapping set, which will allow the driver to properly queue skb's | ||
68 | to multiple queues. | ||
69 | |||
70 | |||
71 | Section 3: Brief howto using PRIO and RR for multiqueue devices | ||
72 | --------------------------------------------------------------- | ||
73 | |||
74 | The userspace command 'tc,' part of the iproute2 package, is used to configure | ||
75 | qdiscs. To add the PRIO qdisc to your network device, assuming the device is | ||
76 | called eth0, run the following command: | ||
77 | |||
78 | # tc qdisc add dev eth0 root handle 1: prio bands 4 multiqueue | ||
79 | |||
80 | This will create 4 bands, 0 being highest priority, and associate those bands | ||
81 | to the queues on your NIC. Assuming eth0 has 4 Tx queues, the band mapping | ||
82 | would look like: | ||
83 | |||
84 | band 0 => queue 0 | ||
85 | band 1 => queue 1 | ||
86 | band 2 => queue 2 | ||
87 | band 3 => queue 3 | ||
88 | |||
89 | Traffic will begin flowing through each queue if your TOS values are assigning | ||
90 | traffic across the various bands. For example, ssh traffic will always try to | ||
91 | go out band 0 based on TOS -> Linux priority conversion (realtime traffic), | ||
92 | so it will be sent out queue 0. ICMP traffic (pings) fall into the "normal" | ||
93 | traffic classification, which is band 1. Therefore pings will be send out | ||
94 | queue 1 on the NIC. | ||
95 | |||
96 | Note the use of the multiqueue keyword. This is only in versions of iproute2 | ||
97 | that support multiqueue networking devices; if this is omitted when loading | ||
98 | a qdisc onto a multiqueue device, the qdisc will load and operate the same | ||
99 | if it were loaded onto a single-queue device (i.e. - sends all traffic to | ||
100 | queue 0). | ||
101 | |||
102 | Another alternative to multiqueue band allocation can be done by using the | ||
103 | multiqueue option and specify 0 bands. If this is the case, the qdisc will | ||
104 | allocate the number of bands to equal the number of queues that the device | ||
105 | reports, and bring the qdisc online. | ||
106 | |||
107 | The behavior of tc filters remains the same, where it will override TOS priority | ||
108 | classification. | ||
109 | |||
110 | |||
111 | Author: Peter P. Waskiewicz Jr. <peter.p.waskiewicz.jr@intel.com> | ||
diff --git a/Documentation/networking/net-modules.txt b/Documentation/networking/net-modules.txt index 0b27863f155c..98c4392dd0fd 100644 --- a/Documentation/networking/net-modules.txt +++ b/Documentation/networking/net-modules.txt | |||
@@ -146,12 +146,6 @@ at1700.c: | |||
146 | irq = 0 | 146 | irq = 0 |
147 | (Probes ports: 0x260, 0x280, 0x2A0, 0x240, 0x340, 0x320, 0x380, 0x300) | 147 | (Probes ports: 0x260, 0x280, 0x2A0, 0x240, 0x340, 0x320, 0x380, 0x300) |
148 | 148 | ||
149 | atari_bionet.c: | ||
150 | Supports full autoprobing. (m68k/Atari) | ||
151 | |||
152 | atari_pamsnet.c: | ||
153 | Supports full autoprobing. (m68k/Atari) | ||
154 | |||
155 | atarilance.c: | 149 | atarilance.c: |
156 | Supports full autoprobing. (m68k/Atari) | 150 | Supports full autoprobing. (m68k/Atari) |
157 | 151 | ||
diff --git a/Documentation/networking/netdevices.txt b/Documentation/networking/netdevices.txt index ce1361f95243..37869295fc70 100644 --- a/Documentation/networking/netdevices.txt +++ b/Documentation/networking/netdevices.txt | |||
@@ -20,6 +20,30 @@ private data which gets freed when the network device is freed. If | |||
20 | separately allocated data is attached to the network device | 20 | separately allocated data is attached to the network device |
21 | (dev->priv) then it is up to the module exit handler to free that. | 21 | (dev->priv) then it is up to the module exit handler to free that. |
22 | 22 | ||
23 | MTU | ||
24 | === | ||
25 | Each network device has a Maximum Transfer Unit. The MTU does not | ||
26 | include any link layer protocol overhead. Upper layer protocols must | ||
27 | not pass a socket buffer (skb) to a device to transmit with more data | ||
28 | than the mtu. The MTU does not include link layer header overhead, so | ||
29 | for example on Ethernet if the standard MTU is 1500 bytes used, the | ||
30 | actual skb will contain up to 1514 bytes because of the Ethernet | ||
31 | header. Devices should allow for the 4 byte VLAN header as well. | ||
32 | |||
33 | Segmentation Offload (GSO, TSO) is an exception to this rule. The | ||
34 | upper layer protocol may pass a large socket buffer to the device | ||
35 | transmit routine, and the device will break that up into separate | ||
36 | packets based on the current MTU. | ||
37 | |||
38 | MTU is symmetrical and applies both to receive and transmit. A device | ||
39 | must be able to receive at least the maximum size packet allowed by | ||
40 | the MTU. A network device may use the MTU as mechanism to size receive | ||
41 | buffers, but the device should allow packets with VLAN header. With | ||
42 | standard Ethernet mtu of 1500 bytes, the device should allow up to | ||
43 | 1518 byte packets (1500 + 14 header + 4 tag). The device may either: | ||
44 | drop, truncate, or pass up oversize packets, but dropping oversize | ||
45 | packets is preferred. | ||
46 | |||
23 | 47 | ||
24 | struct net_device synchronization rules | 48 | struct net_device synchronization rules |
25 | ======================================= | 49 | ======================================= |
@@ -43,16 +67,17 @@ dev->get_stats: | |||
43 | 67 | ||
44 | dev->hard_start_xmit: | 68 | dev->hard_start_xmit: |
45 | Synchronization: netif_tx_lock spinlock. | 69 | Synchronization: netif_tx_lock spinlock. |
70 | |||
46 | When the driver sets NETIF_F_LLTX in dev->features this will be | 71 | When the driver sets NETIF_F_LLTX in dev->features this will be |
47 | called without holding netif_tx_lock. In this case the driver | 72 | called without holding netif_tx_lock. In this case the driver |
48 | has to lock by itself when needed. It is recommended to use a try lock | 73 | has to lock by itself when needed. It is recommended to use a try lock |
49 | for this and return -1 when the spin lock fails. | 74 | for this and return NETDEV_TX_LOCKED when the spin lock fails. |
50 | The locking there should also properly protect against | 75 | The locking there should also properly protect against |
51 | set_multicast_list | 76 | set_multicast_list. |
52 | Context: Process with BHs disabled or BH (timer). | 77 | |
53 | Notes: netif_queue_stopped() is guaranteed false | 78 | Context: Process with BHs disabled or BH (timer), |
54 | Interrupts must be enabled when calling hard_start_xmit. | 79 | will be called with interrupts disabled by netconsole. |
55 | (Interrupts must also be enabled when enabling the BH handler.) | 80 | |
56 | Return codes: | 81 | Return codes: |
57 | o NETDEV_TX_OK everything ok. | 82 | o NETDEV_TX_OK everything ok. |
58 | o NETDEV_TX_BUSY Cannot transmit packet, try later | 83 | o NETDEV_TX_BUSY Cannot transmit packet, try later |
@@ -74,4 +99,5 @@ dev->poll: | |||
74 | Synchronization: __LINK_STATE_RX_SCHED bit in dev->state. See | 99 | Synchronization: __LINK_STATE_RX_SCHED bit in dev->state. See |
75 | dev_close code and comments in net/core/dev.c for more info. | 100 | dev_close code and comments in net/core/dev.c for more info. |
76 | Context: softirq | 101 | Context: softirq |
102 | will be called with interrupts disabled by netconsole. | ||
77 | 103 | ||
diff --git a/Documentation/networking/radiotap-headers.txt b/Documentation/networking/radiotap-headers.txt new file mode 100644 index 000000000000..953331c7984f --- /dev/null +++ b/Documentation/networking/radiotap-headers.txt | |||
@@ -0,0 +1,152 @@ | |||
1 | How to use radiotap headers | ||
2 | =========================== | ||
3 | |||
4 | Pointer to the radiotap include file | ||
5 | ------------------------------------ | ||
6 | |||
7 | Radiotap headers are variable-length and extensible, you can get most of the | ||
8 | information you need to know on them from: | ||
9 | |||
10 | ./include/net/ieee80211_radiotap.h | ||
11 | |||
12 | This document gives an overview and warns on some corner cases. | ||
13 | |||
14 | |||
15 | Structure of the header | ||
16 | ----------------------- | ||
17 | |||
18 | There is a fixed portion at the start which contains a u32 bitmap that defines | ||
19 | if the possible argument associated with that bit is present or not. So if b0 | ||
20 | of the it_present member of ieee80211_radiotap_header is set, it means that | ||
21 | the header for argument index 0 (IEEE80211_RADIOTAP_TSFT) is present in the | ||
22 | argument area. | ||
23 | |||
24 | < 8-byte ieee80211_radiotap_header > | ||
25 | [ <possible argument bitmap extensions ... > ] | ||
26 | [ <argument> ... ] | ||
27 | |||
28 | At the moment there are only 13 possible argument indexes defined, but in case | ||
29 | we run out of space in the u32 it_present member, it is defined that b31 set | ||
30 | indicates that there is another u32 bitmap following (shown as "possible | ||
31 | argument bitmap extensions..." above), and the start of the arguments is moved | ||
32 | forward 4 bytes each time. | ||
33 | |||
34 | Note also that the it_len member __le16 is set to the total number of bytes | ||
35 | covered by the ieee80211_radiotap_header and any arguments following. | ||
36 | |||
37 | |||
38 | Requirements for arguments | ||
39 | -------------------------- | ||
40 | |||
41 | After the fixed part of the header, the arguments follow for each argument | ||
42 | index whose matching bit is set in the it_present member of | ||
43 | ieee80211_radiotap_header. | ||
44 | |||
45 | - the arguments are all stored little-endian! | ||
46 | |||
47 | - the argument payload for a given argument index has a fixed size. So | ||
48 | IEEE80211_RADIOTAP_TSFT being present always indicates an 8-byte argument is | ||
49 | present. See the comments in ./include/net/ieee80211_radiotap.h for a nice | ||
50 | breakdown of all the argument sizes | ||
51 | |||
52 | - the arguments must be aligned to a boundary of the argument size using | ||
53 | padding. So a u16 argument must start on the next u16 boundary if it isn't | ||
54 | already on one, a u32 must start on the next u32 boundary and so on. | ||
55 | |||
56 | - "alignment" is relative to the start of the ieee80211_radiotap_header, ie, | ||
57 | the first byte of the radiotap header. The absolute alignment of that first | ||
58 | byte isn't defined. So even if the whole radiotap header is starting at, eg, | ||
59 | address 0x00000003, still the first byte of the radiotap header is treated as | ||
60 | 0 for alignment purposes. | ||
61 | |||
62 | - the above point that there may be no absolute alignment for multibyte | ||
63 | entities in the fixed radiotap header or the argument region means that you | ||
64 | have to take special evasive action when trying to access these multibyte | ||
65 | entities. Some arches like Blackfin cannot deal with an attempt to | ||
66 | dereference, eg, a u16 pointer that is pointing to an odd address. Instead | ||
67 | you have to use a kernel API get_unaligned() to dereference the pointer, | ||
68 | which will do it bytewise on the arches that require that. | ||
69 | |||
70 | - The arguments for a given argument index can be a compound of multiple types | ||
71 | together. For example IEEE80211_RADIOTAP_CHANNEL has an argument payload | ||
72 | consisting of two u16s of total length 4. When this happens, the padding | ||
73 | rule is applied dealing with a u16, NOT dealing with a 4-byte single entity. | ||
74 | |||
75 | |||
76 | Example valid radiotap header | ||
77 | ----------------------------- | ||
78 | |||
79 | 0x00, 0x00, // <-- radiotap version + pad byte | ||
80 | 0x0b, 0x00, // <- radiotap header length | ||
81 | 0x04, 0x0c, 0x00, 0x00, // <-- bitmap | ||
82 | 0x6c, // <-- rate (in 500kHz units) | ||
83 | 0x0c, //<-- tx power | ||
84 | 0x01 //<-- antenna | ||
85 | |||
86 | |||
87 | Using the Radiotap Parser | ||
88 | ------------------------- | ||
89 | |||
90 | If you are having to parse a radiotap struct, you can radically simplify the | ||
91 | job by using the radiotap parser that lives in net/wireless/radiotap.c and has | ||
92 | its prototypes available in include/net/cfg80211.h. You use it like this: | ||
93 | |||
94 | #include <net/cfg80211.h> | ||
95 | |||
96 | /* buf points to the start of the radiotap header part */ | ||
97 | |||
98 | int MyFunction(u8 * buf, int buflen) | ||
99 | { | ||
100 | int pkt_rate_100kHz = 0, antenna = 0, pwr = 0; | ||
101 | struct ieee80211_radiotap_iterator iterator; | ||
102 | int ret = ieee80211_radiotap_iterator_init(&iterator, buf, buflen); | ||
103 | |||
104 | while (!ret) { | ||
105 | |||
106 | ret = ieee80211_radiotap_iterator_next(&iterator); | ||
107 | |||
108 | if (ret) | ||
109 | continue; | ||
110 | |||
111 | /* see if this argument is something we can use */ | ||
112 | |||
113 | switch (iterator.this_arg_index) { | ||
114 | /* | ||
115 | * You must take care when dereferencing iterator.this_arg | ||
116 | * for multibyte types... the pointer is not aligned. Use | ||
117 | * get_unaligned((type *)iterator.this_arg) to dereference | ||
118 | * iterator.this_arg for type "type" safely on all arches. | ||
119 | */ | ||
120 | case IEEE80211_RADIOTAP_RATE: | ||
121 | /* radiotap "rate" u8 is in | ||
122 | * 500kbps units, eg, 0x02=1Mbps | ||
123 | */ | ||
124 | pkt_rate_100kHz = (*iterator.this_arg) * 5; | ||
125 | break; | ||
126 | |||
127 | case IEEE80211_RADIOTAP_ANTENNA: | ||
128 | /* radiotap uses 0 for 1st ant */ | ||
129 | antenna = *iterator.this_arg); | ||
130 | break; | ||
131 | |||
132 | case IEEE80211_RADIOTAP_DBM_TX_POWER: | ||
133 | pwr = *iterator.this_arg; | ||
134 | break; | ||
135 | |||
136 | default: | ||
137 | break; | ||
138 | } | ||
139 | } /* while more rt headers */ | ||
140 | |||
141 | if (ret != -ENOENT) | ||
142 | return TXRX_DROP; | ||
143 | |||
144 | /* discard the radiotap header part */ | ||
145 | buf += iterator.max_length; | ||
146 | buflen -= iterator.max_length; | ||
147 | |||
148 | ... | ||
149 | |||
150 | } | ||
151 | |||
152 | Andy Green <andy@warmcat.com> | ||
diff --git a/Documentation/oops-tracing.txt b/Documentation/oops-tracing.txt index 7d5b60dea551..23e6dde7eea6 100644 --- a/Documentation/oops-tracing.txt +++ b/Documentation/oops-tracing.txt | |||
@@ -86,6 +86,20 @@ stuff are the values reported by the Oops - you can just cut-and-paste | |||
86 | and do a replace of spaces to "\x" - that's what I do, as I'm too lazy | 86 | and do a replace of spaces to "\x" - that's what I do, as I'm too lazy |
87 | to write a program to automate this all). | 87 | to write a program to automate this all). |
88 | 88 | ||
89 | Alternatively, you can use the shell script in scripts/decodecode. | ||
90 | Its usage is: decodecode < oops.txt | ||
91 | |||
92 | The hex bytes that follow "Code:" may (in some architectures) have a series | ||
93 | of bytes that precede the current instruction pointer as well as bytes at and | ||
94 | following the current instruction pointer. In some cases, one instruction | ||
95 | byte or word is surrounded by <> or (), as in "<86>" or "(f00d)". These | ||
96 | <> or () markings indicate the current instruction pointer. Example from | ||
97 | i386, split into multiple lines for readability: | ||
98 | |||
99 | Code: f9 0f 8d f9 00 00 00 8d 42 0c e8 dd 26 11 c7 a1 60 ea 2b f9 8b 50 08 a1 | ||
100 | 64 ea 2b f9 8d 34 82 8b 1e 85 db 74 6d 8b 15 60 ea 2b f9 <8b> 43 04 39 42 54 | ||
101 | 7e 04 40 89 42 54 8b 43 04 3b 05 00 f6 52 c0 | ||
102 | |||
89 | Finally, if you want to see where the code comes from, you can do | 103 | Finally, if you want to see where the code comes from, you can do |
90 | 104 | ||
91 | cd /usr/src/linux | 105 | cd /usr/src/linux |
diff --git a/Documentation/pci.txt b/Documentation/pci.txt index d38261b67905..7754f5aea4e9 100644 --- a/Documentation/pci.txt +++ b/Documentation/pci.txt | |||
@@ -113,9 +113,6 @@ initialization with a pointer to a structure describing the driver | |||
113 | (Please see Documentation/power/pci.txt for descriptions | 113 | (Please see Documentation/power/pci.txt for descriptions |
114 | of PCI Power Management and the related functions.) | 114 | of PCI Power Management and the related functions.) |
115 | 115 | ||
116 | enable_wake Enable device to generate wake events from a low power | ||
117 | state. | ||
118 | |||
119 | shutdown Hook into reboot_notifier_list (kernel/sys.c). | 116 | shutdown Hook into reboot_notifier_list (kernel/sys.c). |
120 | Intended to stop any idling DMA operations. | 117 | Intended to stop any idling DMA operations. |
121 | Useful for enabling wake-on-lan (NIC) or changing | 118 | Useful for enabling wake-on-lan (NIC) or changing |
@@ -299,7 +296,10 @@ If the PCI device can use the PCI Memory-Write-Invalidate transaction, | |||
299 | call pci_set_mwi(). This enables the PCI_COMMAND bit for Mem-Wr-Inval | 296 | call pci_set_mwi(). This enables the PCI_COMMAND bit for Mem-Wr-Inval |
300 | and also ensures that the cache line size register is set correctly. | 297 | and also ensures that the cache line size register is set correctly. |
301 | Check the return value of pci_set_mwi() as not all architectures | 298 | Check the return value of pci_set_mwi() as not all architectures |
302 | or chip-sets may support Memory-Write-Invalidate. | 299 | or chip-sets may support Memory-Write-Invalidate. Alternatively, |
300 | if Mem-Wr-Inval would be nice to have but is not required, call | ||
301 | pci_try_set_mwi() to have the system do its best effort at enabling | ||
302 | Mem-Wr-Inval. | ||
303 | 303 | ||
304 | 304 | ||
305 | 3.2 Request MMIO/IOP resources | 305 | 3.2 Request MMIO/IOP resources |
diff --git a/Documentation/power/pci.txt b/Documentation/power/pci.txt index e00b099a4b86..dd8fe43888d3 100644 --- a/Documentation/power/pci.txt +++ b/Documentation/power/pci.txt | |||
@@ -164,7 +164,6 @@ struct pci_driver: | |||
164 | 164 | ||
165 | int (*suspend) (struct pci_dev *dev, pm_message_t state); | 165 | int (*suspend) (struct pci_dev *dev, pm_message_t state); |
166 | int (*resume) (struct pci_dev *dev); | 166 | int (*resume) (struct pci_dev *dev); |
167 | int (*enable_wake) (struct pci_dev *dev, pci_power_t state, int enable); | ||
168 | 167 | ||
169 | 168 | ||
170 | suspend | 169 | suspend |
@@ -251,42 +250,6 @@ The driver should update the current_state field in its pci_dev structure in | |||
251 | this function, except for PM-capable devices when pci_set_power_state is used. | 250 | this function, except for PM-capable devices when pci_set_power_state is used. |
252 | 251 | ||
253 | 252 | ||
254 | enable_wake | ||
255 | ----------- | ||
256 | |||
257 | Usage: | ||
258 | |||
259 | if (dev->driver && dev->driver->enable_wake) | ||
260 | dev->driver->enable_wake(dev,state,enable); | ||
261 | |||
262 | This callback is generally only relevant for devices that support the PCI PM | ||
263 | spec and have the ability to generate a PME# (Power Management Event Signal) | ||
264 | to wake the system up. (However, it is possible that a device may support | ||
265 | some non-standard way of generating a wake event on sleep.) | ||
266 | |||
267 | Bits 15:11 of the PMC (Power Mgmt Capabilities) Register in a device's | ||
268 | PM Capabilities describe what power states the device supports generating a | ||
269 | wake event from: | ||
270 | |||
271 | +------------------+ | ||
272 | | Bit | State | | ||
273 | +------------------+ | ||
274 | | 11 | D0 | | ||
275 | | 12 | D1 | | ||
276 | | 13 | D2 | | ||
277 | | 14 | D3hot | | ||
278 | | 15 | D3cold | | ||
279 | +------------------+ | ||
280 | |||
281 | A device can use this to enable wake events: | ||
282 | |||
283 | pci_enable_wake(dev,state,enable); | ||
284 | |||
285 | Note that to enable PME# from D3cold, a value of 4 should be passed to | ||
286 | pci_enable_wake (since it uses an index into a bitmask). If a driver gets | ||
287 | a request to enable wake events from D3, two calls should be made to | ||
288 | pci_enable_wake (one for both D3hot and D3cold). | ||
289 | |||
290 | 253 | ||
291 | A reference implementation | 254 | A reference implementation |
292 | ------------------------- | 255 | ------------------------- |
diff --git a/Documentation/power/swsusp.txt b/Documentation/power/swsusp.txt index 5b8d6953f05e..152b510d1bbb 100644 --- a/Documentation/power/swsusp.txt +++ b/Documentation/power/swsusp.txt | |||
@@ -393,6 +393,9 @@ safest thing is to unmount all filesystems on removable media (such USB, | |||
393 | Firewire, CompactFlash, MMC, external SATA, or even IDE hotplug bays) | 393 | Firewire, CompactFlash, MMC, external SATA, or even IDE hotplug bays) |
394 | before suspending; then remount them after resuming. | 394 | before suspending; then remount them after resuming. |
395 | 395 | ||
396 | There is a work-around for this problem. For more information, see | ||
397 | Documentation/usb/persist.txt. | ||
398 | |||
396 | Q: I upgraded the kernel from 2.6.15 to 2.6.16. Both kernels were | 399 | Q: I upgraded the kernel from 2.6.15 to 2.6.16. Both kernels were |
397 | compiled with the similar configuration files. Anyway I found that | 400 | compiled with the similar configuration files. Anyway I found that |
398 | suspend to disk (and resume) is much slower on 2.6.16 compared to | 401 | suspend to disk (and resume) is much slower on 2.6.16 compared to |
diff --git a/Documentation/scsi/aacraid.txt b/Documentation/scsi/aacraid.txt index ce3cb42507bd..cc12b55d4b3d 100644 --- a/Documentation/scsi/aacraid.txt +++ b/Documentation/scsi/aacraid.txt | |||
@@ -50,6 +50,9 @@ Supported Cards/Chipsets | |||
50 | 9005:0285:9005:02be Adaptec 31605 (Marauder160) | 50 | 9005:0285:9005:02be Adaptec 31605 (Marauder160) |
51 | 9005:0285:9005:02c3 Adaptec 51205 (Voodoo120) | 51 | 9005:0285:9005:02c3 Adaptec 51205 (Voodoo120) |
52 | 9005:0285:9005:02c4 Adaptec 51605 (Voodoo160) | 52 | 9005:0285:9005:02c4 Adaptec 51605 (Voodoo160) |
53 | 9005:0285:9005:02ce Adaptec 51245 (Voodoo124) | ||
54 | 9005:0285:9005:02cf Adaptec 51645 (Voodoo164) | ||
55 | 9005:0285:9005:02d0 Adaptec 52445 (Voodoo244) | ||
53 | 1011:0046:9005:0364 Adaptec 5400S (Mustang) | 56 | 1011:0046:9005:0364 Adaptec 5400S (Mustang) |
54 | 9005:0287:9005:0800 Adaptec Themisto (Jupiter) | 57 | 9005:0287:9005:0800 Adaptec Themisto (Jupiter) |
55 | 9005:0200:9005:0200 Adaptec Themisto (Jupiter) | 58 | 9005:0200:9005:0200 Adaptec Themisto (Jupiter) |
diff --git a/Documentation/scsi/scsi_fc_transport.txt b/Documentation/scsi/scsi_fc_transport.txt new file mode 100644 index 000000000000..d403e46d8463 --- /dev/null +++ b/Documentation/scsi/scsi_fc_transport.txt | |||
@@ -0,0 +1,450 @@ | |||
1 | SCSI FC Tansport | ||
2 | ============================================= | ||
3 | |||
4 | Date: 4/12/2007 | ||
5 | Kernel Revisions for features: | ||
6 | rports : <<TBS>> | ||
7 | vports : 2.6.22 (? TBD) | ||
8 | |||
9 | |||
10 | Introduction | ||
11 | ============ | ||
12 | This file documents the features and components of the SCSI FC Transport. | ||
13 | It also provides documents the API between the transport and FC LLDDs. | ||
14 | The FC transport can be found at: | ||
15 | drivers/scsi/scsi_transport_fc.c | ||
16 | include/scsi/scsi_transport_fc.h | ||
17 | include/scsi/scsi_netlink_fc.h | ||
18 | |||
19 | This file is found at Documentation/scsi/scsi_fc_transport.txt | ||
20 | |||
21 | |||
22 | FC Remote Ports (rports) | ||
23 | ======================================================================== | ||
24 | << To Be Supplied >> | ||
25 | |||
26 | |||
27 | FC Virtual Ports (vports) | ||
28 | ======================================================================== | ||
29 | |||
30 | Overview: | ||
31 | ------------------------------- | ||
32 | |||
33 | New FC standards have defined mechanisms which allows for a single physical | ||
34 | port to appear on as multiple communication ports. Using the N_Port Id | ||
35 | Virtualization (NPIV) mechanism, a point-to-point connection to a Fabric | ||
36 | can be assigned more than 1 N_Port_ID. Each N_Port_ID appears as a | ||
37 | separate port to other endpoints on the fabric, even though it shares one | ||
38 | physical link to the switch for communication. Each N_Port_ID can have a | ||
39 | unique view of the fabric based on fabric zoning and array lun-masking | ||
40 | (just like a normal non-NPIV adapter). Using the Virtual Fabric (VF) | ||
41 | mechanism, adding a fabric header to each frame allows the port to | ||
42 | interact with the Fabric Port to join multiple fabrics. The port will | ||
43 | obtain an N_Port_ID on each fabric it joins. Each fabric will have its | ||
44 | own unique view of endpoints and configuration parameters. NPIV may be | ||
45 | used together with VF so that the port can obtain multiple N_Port_IDs | ||
46 | on each virtual fabric. | ||
47 | |||
48 | The FC transport is now recognizing a new object - a vport. A vport is | ||
49 | an entity that has a world-wide unique World Wide Port Name (wwpn) and | ||
50 | World Wide Node Name (wwnn). The transport also allows for the FC4's to | ||
51 | be specified for the vport, with FCP_Initiator being the primary role | ||
52 | expected. Once instantiated by one of the above methods, it will have a | ||
53 | distinct N_Port_ID and view of fabric endpoints and storage entities. | ||
54 | The fc_host associated with the physical adapter will export the ability | ||
55 | to create vports. The transport will create the vport object within the | ||
56 | Linux device tree, and instruct the fc_host's driver to instantiate the | ||
57 | virtual port. Typically, the driver will create a new scsi_host instance | ||
58 | on the vport, resulting in a unique <H,C,T,L> namespace for the vport. | ||
59 | Thus, whether a FC port is based on a physical port or on a virtual port, | ||
60 | each will appear as a unique scsi_host with its own target and lun space. | ||
61 | |||
62 | Note: At this time, the transport is written to create only NPIV-based | ||
63 | vports. However, consideration was given to VF-based vports and it | ||
64 | should be a minor change to add support if needed. The remaining | ||
65 | discussion will concentrate on NPIV. | ||
66 | |||
67 | Note: World Wide Name assignment (and uniqueness guarantees) are left | ||
68 | up to an administrative entity controling the vport. For example, | ||
69 | if vports are to be associated with virtual machines, a XEN mgmt | ||
70 | utility would be responsible for creating wwpn/wwnn's for the vport, | ||
71 | using it's own naming authority and OUI. (Note: it already does this | ||
72 | for virtual MAC addresses). | ||
73 | |||
74 | |||
75 | Device Trees and Vport Objects: | ||
76 | ------------------------------- | ||
77 | |||
78 | Today, the device tree typically contains the scsi_host object, | ||
79 | with rports and scsi target objects underneath it. Currently the FC | ||
80 | transport creates the vport object and places it under the scsi_host | ||
81 | object corresponding to the physical adapter. The LLDD will allocate | ||
82 | a new scsi_host for the vport and link it's object under the vport. | ||
83 | The remainder of the tree under the vports scsi_host is the same | ||
84 | as the non-NPIV case. The transport is written currently to easily | ||
85 | allow the parent of the vport to be something other than the scsi_host. | ||
86 | This could be used in the future to link the object onto a vm-specific | ||
87 | device tree. If the vport's parent is not the physical port's scsi_host, | ||
88 | a symbolic link to the vport object will be placed in the physical | ||
89 | port's scsi_host. | ||
90 | |||
91 | Here's what to expect in the device tree : | ||
92 | The typical Physical Port's Scsi_Host: | ||
93 | /sys/devices/.../host17/ | ||
94 | and it has the typical decendent tree: | ||
95 | /sys/devices/.../host17/rport-17:0-0/target17:0:0/17:0:0:0: | ||
96 | and then the vport is created on the Physical Port: | ||
97 | /sys/devices/.../host17/vport-17:0-0 | ||
98 | and the vport's Scsi_Host is then created: | ||
99 | /sys/devices/.../host17/vport-17:0-0/host18 | ||
100 | and then the rest of the tree progresses, such as: | ||
101 | /sys/devices/.../host17/vport-17:0-0/host18/rport-18:0-0/target18:0:0/18:0:0:0: | ||
102 | |||
103 | Here's what to expect in the sysfs tree : | ||
104 | scsi_hosts: | ||
105 | /sys/class/scsi_host/host17 physical port's scsi_host | ||
106 | /sys/class/scsi_host/host18 vport's scsi_host | ||
107 | fc_hosts: | ||
108 | /sys/class/fc_host/host17 physical port's fc_host | ||
109 | /sys/class/fc_host/host18 vport's fc_host | ||
110 | fc_vports: | ||
111 | /sys/class/fc_vports/vport-17:0-0 the vport's fc_vport | ||
112 | fc_rports: | ||
113 | /sys/class/fc_remote_ports/rport-17:0-0 rport on the physical port | ||
114 | /sys/class/fc_remote_ports/rport-18:0-0 rport on the vport | ||
115 | |||
116 | |||
117 | Vport Attributes: | ||
118 | ------------------------------- | ||
119 | |||
120 | The new fc_vport class object has the following attributes | ||
121 | |||
122 | node_name: Read_Only | ||
123 | The WWNN of the vport | ||
124 | |||
125 | port_name: Read_Only | ||
126 | The WWPN of the vport | ||
127 | |||
128 | roles: Read_Only | ||
129 | Indicates the FC4 roles enabled on the vport. | ||
130 | |||
131 | symbolic_name: Read_Write | ||
132 | A string, appended to the driver's symbolic port name string, which | ||
133 | is registered with the switch to identify the vport. For example, | ||
134 | a hypervisor could set this string to "Xen Domain 2 VM 5 Vport 2", | ||
135 | and this set of identifiers can be seen on switch management screens | ||
136 | to identify the port. | ||
137 | |||
138 | vport_delete: Write_Only | ||
139 | When written with a "1", will tear down the vport. | ||
140 | |||
141 | vport_disable: Write_Only | ||
142 | When written with a "1", will transition the vport to a disabled. | ||
143 | state. The vport will still be instantiated with the Linux kernel, | ||
144 | but it will not be active on the FC link. | ||
145 | When written with a "0", will enable the vport. | ||
146 | |||
147 | vport_last_state: Read_Only | ||
148 | Indicates the previous state of the vport. See the section below on | ||
149 | "Vport States". | ||
150 | |||
151 | vport_state: Read_Only | ||
152 | Indicates the state of the vport. See the section below on | ||
153 | "Vport States". | ||
154 | |||
155 | vport_type: Read_Only | ||
156 | Reflects the FC mechanism used to create the virtual port. | ||
157 | Only NPIV is supported currently. | ||
158 | |||
159 | |||
160 | For the fc_host class object, the following attributes are added for vports: | ||
161 | |||
162 | max_npiv_vports: Read_Only | ||
163 | Indicates the maximum number of NPIV-based vports that the | ||
164 | driver/adapter can support on the fc_host. | ||
165 | |||
166 | npiv_vports_inuse: Read_Only | ||
167 | Indicates how many NPIV-based vports have been instantiated on the | ||
168 | fc_host. | ||
169 | |||
170 | vport_create: Write_Only | ||
171 | A "simple" create interface to instantiate a vport on an fc_host. | ||
172 | A "<WWPN>:<WWNN>" string is written to the attribute. The transport | ||
173 | then instantiates the vport object and calls the LLDD to create the | ||
174 | vport with the role of FCP_Initiator. Each WWN is specified as 16 | ||
175 | hex characters and may *not* contain any prefixes (e.g. 0x, x, etc). | ||
176 | |||
177 | vport_delete: Write_Only | ||
178 | A "simple" delete interface to teardown a vport. A "<WWPN>:<WWNN>" | ||
179 | string is written to the attribute. The transport will locate the | ||
180 | vport on the fc_host with the same WWNs and tear it down. Each WWN | ||
181 | is specified as 16 hex characters and may *not* contain any prefixes | ||
182 | (e.g. 0x, x, etc). | ||
183 | |||
184 | |||
185 | Vport States: | ||
186 | ------------------------------- | ||
187 | |||
188 | Vport instantiation consists of two parts: | ||
189 | - Creation with the kernel and LLDD. This means all transport and | ||
190 | driver data structures are built up, and device objects created. | ||
191 | This is equivalent to a driver "attach" on an adapter, which is | ||
192 | independent of the adapter's link state. | ||
193 | - Instantiation of the vport on the FC link via ELS traffic, etc. | ||
194 | This is equivalent to a "link up" and successfull link initialization. | ||
195 | Futher information can be found in the interfaces section below for | ||
196 | Vport Creation. | ||
197 | |||
198 | Once a vport has been instantiated with the kernel/LLDD, a vport state | ||
199 | can be reported via the sysfs attribute. The following states exist: | ||
200 | |||
201 | FC_VPORT_UNKNOWN - Unknown | ||
202 | An temporary state, typically set only while the vport is being | ||
203 | instantiated with the kernel and LLDD. | ||
204 | |||
205 | FC_VPORT_ACTIVE - Active | ||
206 | The vport has been successfully been created on the FC link. | ||
207 | It is fully functional. | ||
208 | |||
209 | FC_VPORT_DISABLED - Disabled | ||
210 | The vport instantiated, but "disabled". The vport is not instantiated | ||
211 | on the FC link. This is equivalent to a physical port with the | ||
212 | link "down". | ||
213 | |||
214 | FC_VPORT_LINKDOWN - Linkdown | ||
215 | The vport is not operational as the physical link is not operational. | ||
216 | |||
217 | FC_VPORT_INITIALIZING - Initializing | ||
218 | The vport is in the process of instantiating on the FC link. | ||
219 | The LLDD will set this state just prior to starting the ELS traffic | ||
220 | to create the vport. This state will persist until the vport is | ||
221 | successfully created (state becomes FC_VPORT_ACTIVE) or it fails | ||
222 | (state is one of the values below). As this state is transitory, | ||
223 | it will not be preserved in the "vport_last_state". | ||
224 | |||
225 | FC_VPORT_NO_FABRIC_SUPP - No Fabric Support | ||
226 | The vport is not operational. One of the following conditions were | ||
227 | encountered: | ||
228 | - The FC topology is not Point-to-Point | ||
229 | - The FC port is not connected to an F_Port | ||
230 | - The F_Port has indicated that NPIV is not supported. | ||
231 | |||
232 | FC_VPORT_NO_FABRIC_RSCS - No Fabric Resources | ||
233 | The vport is not operational. The Fabric failed FDISC with a status | ||
234 | indicating that it does not have sufficient resources to complete | ||
235 | the operation. | ||
236 | |||
237 | FC_VPORT_FABRIC_LOGOUT - Fabric Logout | ||
238 | The vport is not operational. The Fabric has LOGO'd the N_Port_ID | ||
239 | associated with the vport. | ||
240 | |||
241 | FC_VPORT_FABRIC_REJ_WWN - Fabric Rejected WWN | ||
242 | The vport is not operational. The Fabric failed FDISC with a status | ||
243 | indicating that the WWN's are not valid. | ||
244 | |||
245 | FC_VPORT_FAILED - VPort Failed | ||
246 | The vport is not operational. This is a catchall for all other | ||
247 | error conditions. | ||
248 | |||
249 | |||
250 | The following state table indicates the different state transitions: | ||
251 | |||
252 | State Event New State | ||
253 | -------------------------------------------------------------------- | ||
254 | n/a Initialization Unknown | ||
255 | Unknown: Link Down Linkdown | ||
256 | Link Up & Loop No Fabric Support | ||
257 | Link Up & no Fabric No Fabric Support | ||
258 | Link Up & FLOGI response No Fabric Support | ||
259 | indicates no NPIV support | ||
260 | Link Up & FDISC being sent Initializing | ||
261 | Disable request Disable | ||
262 | Linkdown: Link Up Unknown | ||
263 | Initializing: FDISC ACC Active | ||
264 | FDISC LS_RJT w/ no resources No Fabric Resources | ||
265 | FDISC LS_RJT w/ invalid Fabric Rejected WWN | ||
266 | pname or invalid nport_id | ||
267 | FDISC LS_RJT failed for Vport Failed | ||
268 | other reasons | ||
269 | Link Down Linkdown | ||
270 | Disable request Disable | ||
271 | Disable: Enable request Unknown | ||
272 | Active: LOGO received from fabric Fabric Logout | ||
273 | Link Down Linkdown | ||
274 | Disable request Disable | ||
275 | Fabric Logout: Link still up Unknown | ||
276 | |||
277 | The following 4 error states all have the same transitions: | ||
278 | No Fabric Support: | ||
279 | No Fabric Resources: | ||
280 | Fabric Rejected WWN: | ||
281 | Vport Failed: | ||
282 | Disable request Disable | ||
283 | Link goes down Linkdown | ||
284 | |||
285 | |||
286 | Transport <-> LLDD Interfaces : | ||
287 | ------------------------------- | ||
288 | |||
289 | Vport support by LLDD: | ||
290 | |||
291 | The LLDD indicates support for vports by supplying a vport_create() | ||
292 | function in the transport template. The presense of this function will | ||
293 | cause the creation of the new attributes on the fc_host. As part of | ||
294 | the physical port completing its initialization relative to the | ||
295 | transport, it should set the max_npiv_vports attribute to indicate the | ||
296 | maximum number of vports the driver and/or adapter supports. | ||
297 | |||
298 | |||
299 | Vport Creation: | ||
300 | |||
301 | The LLDD vport_create() syntax is: | ||
302 | |||
303 | int vport_create(struct fc_vport *vport, bool disable) | ||
304 | |||
305 | where: | ||
306 | vport: Is the newly allocated vport object | ||
307 | disable: If "true", the vport is to be created in a disabled stated. | ||
308 | If "false", the vport is to be enabled upon creation. | ||
309 | |||
310 | When a request is made to create a new vport (via sgio/netlink, or the | ||
311 | vport_create fc_host attribute), the transport will validate that the LLDD | ||
312 | can support another vport (e.g. max_npiv_vports > npiv_vports_inuse). | ||
313 | If not, the create request will be failed. If space remains, the transport | ||
314 | will increment the vport count, create the vport object, and then call the | ||
315 | LLDD's vport_create() function with the newly allocated vport object. | ||
316 | |||
317 | As mentioned above, vport creation is divided into two parts: | ||
318 | - Creation with the kernel and LLDD. This means all transport and | ||
319 | driver data structures are built up, and device objects created. | ||
320 | This is equivalent to a driver "attach" on an adapter, which is | ||
321 | independent of the adapter's link state. | ||
322 | - Instantiation of the vport on the FC link via ELS traffic, etc. | ||
323 | This is equivalent to a "link up" and successfull link initialization. | ||
324 | |||
325 | The LLDD's vport_create() function will not synchronously wait for both | ||
326 | parts to be fully completed before returning. It must validate that the | ||
327 | infrastructure exists to support NPIV, and complete the first part of | ||
328 | vport creation (data structure build up) before returning. We do not | ||
329 | hinge vport_create() on the link-side operation mainly because: | ||
330 | - The link may be down. It is not a failure if it is. It simply | ||
331 | means the vport is in an inoperable state until the link comes up. | ||
332 | This is consistent with the link bouncing post vport creation. | ||
333 | - The vport may be created in a disabled state. | ||
334 | - This is consistent with a model where: the vport equates to a | ||
335 | FC adapter. The vport_create is synonymous with driver attachment | ||
336 | to the adapter, which is independent of link state. | ||
337 | |||
338 | Note: special error codes have been defined to delineate infrastructure | ||
339 | failure cases for quicker resolution. | ||
340 | |||
341 | The expected behavior for the LLDD's vport_create() function is: | ||
342 | - Validate Infrastructure: | ||
343 | - If the driver or adapter cannot support another vport, whether | ||
344 | due to improper firmware, (a lie about) max_npiv, or a lack of | ||
345 | some other resource - return VPCERR_UNSUPPORTED. | ||
346 | - If the driver validates the WWN's against those already active on | ||
347 | the adapter and detects an overlap - return VPCERR_BAD_WWN. | ||
348 | - If the driver detects the topology is loop, non-fabric, or the | ||
349 | FLOGI did not support NPIV - return VPCERR_NO_FABRIC_SUPP. | ||
350 | - Allocate data structures. If errors are encountered, such as out | ||
351 | of memory conditions, return the respective negative Exxx error code. | ||
352 | - If the role is FCP Initiator, the LLDD is to : | ||
353 | - Call scsi_host_alloc() to allocate a scsi_host for the vport. | ||
354 | - Call scsi_add_host(new_shost, &vport->dev) to start the scsi_host | ||
355 | and bind it as a child of the vport device. | ||
356 | - Initializes the fc_host attribute values. | ||
357 | - Kick of further vport state transitions based on the disable flag and | ||
358 | link state - and return success (zero). | ||
359 | |||
360 | LLDD Implementers Notes: | ||
361 | - It is suggested that there be a different fc_function_templates for | ||
362 | the physical port and the virtual port. The physical port's template | ||
363 | would have the vport_create, vport_delete, and vport_disable functions, | ||
364 | while the vports would not. | ||
365 | - It is suggested that there be different scsi_host_templates | ||
366 | for the physical port and virtual port. Likely, there are driver | ||
367 | attributes, embedded into the scsi_host_template, that are applicable | ||
368 | for the physical port only (link speed, topology setting, etc). This | ||
369 | ensures that the attributes are applicable to the respective scsi_host. | ||
370 | |||
371 | |||
372 | Vport Disable/Enable: | ||
373 | |||
374 | The LLDD vport_disable() syntax is: | ||
375 | |||
376 | int vport_disable(struct fc_vport *vport, bool disable) | ||
377 | |||
378 | where: | ||
379 | vport: Is vport to to be enabled or disabled | ||
380 | disable: If "true", the vport is to be disabled. | ||
381 | If "false", the vport is to be enabled. | ||
382 | |||
383 | When a request is made to change the disabled state on a vport, the | ||
384 | transport will validate the request against the existing vport state. | ||
385 | If the request is to disable and the vport is already disabled, the | ||
386 | request will fail. Similarly, if the request is to enable, and the | ||
387 | vport is not in a disabled state, the request will fail. If the request | ||
388 | is valid for the vport state, the transport will call the LLDD to | ||
389 | change the vport's state. | ||
390 | |||
391 | Within the LLDD, if a vport is disabled, it remains instantiated with | ||
392 | the kernel and LLDD, but it is not active or visible on the FC link in | ||
393 | any way. (see Vport Creation and the 2 part instantiation discussion). | ||
394 | The vport will remain in this state until it is deleted or re-enabled. | ||
395 | When enabling a vport, the LLDD reinstantiates the vport on the FC | ||
396 | link - essentially restarting the LLDD statemachine (see Vport States | ||
397 | above). | ||
398 | |||
399 | |||
400 | Vport Deletion: | ||
401 | |||
402 | The LLDD vport_delete() syntax is: | ||
403 | |||
404 | int vport_delete(struct fc_vport *vport) | ||
405 | |||
406 | where: | ||
407 | vport: Is vport to delete | ||
408 | |||
409 | When a request is made to delete a vport (via sgio/netlink, or via the | ||
410 | fc_host or fc_vport vport_delete attributes), the transport will call | ||
411 | the LLDD to terminate the vport on the FC link, and teardown all other | ||
412 | datastructures and references. If the LLDD completes successfully, | ||
413 | the transport will teardown the vport objects and complete the vport | ||
414 | removal. If the LLDD delete request fails, the vport object will remain, | ||
415 | but will be in an indeterminate state. | ||
416 | |||
417 | Within the LLDD, the normal code paths for a scsi_host teardown should | ||
418 | be followed. E.g. If the vport has a FCP Initiator role, the LLDD | ||
419 | will call fc_remove_host() for the vports scsi_host, followed by | ||
420 | scsi_remove_host() and scsi_host_put() for the vports scsi_host. | ||
421 | |||
422 | |||
423 | Other: | ||
424 | fc_host port_type attribute: | ||
425 | There is a new fc_host port_type value - FC_PORTTYPE_NPIV. This value | ||
426 | must be set on all vport-based fc_hosts. Normally, on a physical port, | ||
427 | the port_type attribute would be set to NPORT, NLPORT, etc based on the | ||
428 | topology type and existence of the fabric. As this is not applicable to | ||
429 | a vport, it makes more sense to report the FC mechanism used to create | ||
430 | the vport. | ||
431 | |||
432 | Driver unload: | ||
433 | FC drivers are required to call fc_remove_host() prior to calling | ||
434 | scsi_remove_host(). This allows the fc_host to tear down all remote | ||
435 | ports prior the scsi_host being torn down. The fc_remove_host() call | ||
436 | was updated to remove all vports for the fc_host as well. | ||
437 | |||
438 | |||
439 | Credits | ||
440 | ======= | ||
441 | The following people have contributed to this document: | ||
442 | |||
443 | |||
444 | |||
445 | |||
446 | |||
447 | |||
448 | James Smart | ||
449 | james.smart@emulex.com | ||
450 | |||
diff --git a/Documentation/sound/oss/AD1816 b/Documentation/sound/oss/AD1816 deleted file mode 100644 index 14bd8f25d523..000000000000 --- a/Documentation/sound/oss/AD1816 +++ /dev/null | |||
@@ -1,84 +0,0 @@ | |||
1 | Documentation for the AD1816(A) sound driver | ||
2 | ============================================ | ||
3 | |||
4 | Installation: | ||
5 | ------------- | ||
6 | |||
7 | To get your AD1816(A) based sound card work, you'll have to enable support for | ||
8 | experimental code ("Prompt for development and/or incomplete code/drivers") | ||
9 | and isapnp ("Plug and Play support", "ISA Plug and Play support"). Enable | ||
10 | "Sound card support", "OSS modules support" and "Support for AD1816(A) based | ||
11 | cards (EXPERIMENTAL)" in the sound configuration menu, too. Now build, install | ||
12 | and reboot the new kernel as usual. | ||
13 | |||
14 | Features: | ||
15 | --------- | ||
16 | |||
17 | List of features supported by this driver: | ||
18 | - full-duplex support | ||
19 | - supported audio formats: unsigned 8bit, signed 16bit little endian, | ||
20 | signed 16bit big endian, µ-law, A-law | ||
21 | - supported channels: mono and stereo | ||
22 | - supported recording sources: Master, CD, Line, Line1, Line2, Mic | ||
23 | - supports phat 3d stereo circuit (Line 3) | ||
24 | |||
25 | |||
26 | Supported cards: | ||
27 | ---------------- | ||
28 | |||
29 | The following cards are known to work with this driver: | ||
30 | - Terratec Base 1 | ||
31 | - Terratec Base 64 | ||
32 | - HP Kayak | ||
33 | - Acer FX-3D | ||
34 | - SY-1816 | ||
35 | - Highscreen Sound-Boostar 32 Wave 3D | ||
36 | - Highscreen Sound-Boostar 16 | ||
37 | - AVM Apex Pro card | ||
38 | - (Aztech SC-16 3D) | ||
39 | - (Newcom SC-16 3D) | ||
40 | - (Terratec EWS64S) | ||
41 | |||
42 | Cards listed in brackets are not supported reliable. If you have such a card | ||
43 | you should add the extra parameter: | ||
44 | options=1 | ||
45 | when loading the ad1816 module via modprobe. | ||
46 | |||
47 | |||
48 | Troubleshooting: | ||
49 | ---------------- | ||
50 | |||
51 | First of all you should check, if the driver has been loaded | ||
52 | properly. | ||
53 | |||
54 | If loading of the driver succeeds, but playback/capture fails, check | ||
55 | if you used the correct values for irq, dma and dma2 when loading the module. | ||
56 | If one of them is wrong you usually get the following error message: | ||
57 | |||
58 | Nov 6 17:06:13 tek01 kernel: Sound: DMA (output) timed out - IRQ/DRQ config error? | ||
59 | |||
60 | If playback/capture is too fast or to slow, you should have a look at | ||
61 | the clock chip of your sound card. The AD1816 was designed for a 33MHz | ||
62 | oscillator, however most sound card manufacturer use slightly | ||
63 | different oscillators as they are cheaper than 33MHz oscillators. If | ||
64 | you have such a card you have to adjust the ad1816_clockfreq parameter | ||
65 | above. For example: For a card using a 32.875MHz oscillator use | ||
66 | ad1816_clockfreq=32875 instead of ad1816_clockfreq=33000. | ||
67 | |||
68 | |||
69 | Updates, bugfixes and bugreports: | ||
70 | -------------------------------- | ||
71 | |||
72 | As the driver is still experimental and under development, you should | ||
73 | watch out for updates. Updates of the driver are available on the | ||
74 | Internet from one of my home pages: | ||
75 | http://www.student.informatik.tu-darmstadt.de/~tek/projects/linux.html | ||
76 | or: | ||
77 | http://www.tu-darmstadt.de/~tek01/projects/linux.html | ||
78 | |||
79 | Bugreports, bugfixes and related questions should be sent via E-Mail to: | ||
80 | tek@rbg.informatik.tu-darmstadt.de | ||
81 | |||
82 | Thorsten Knabe <tek@rbg.informatik.tu-darmstadt.de> | ||
83 | Christoph Hellwig <hch@infradead.org> | ||
84 | Last modified: 2000/09/20 | ||
diff --git a/Documentation/sound/oss/NM256 b/Documentation/sound/oss/NM256 deleted file mode 100644 index b503217488b3..000000000000 --- a/Documentation/sound/oss/NM256 +++ /dev/null | |||
@@ -1,280 +0,0 @@ | |||
1 | ======================================================= | ||
2 | Documentation for the NeoMagic 256AV/256ZX sound driver | ||
3 | ======================================================= | ||
4 | |||
5 | You're looking at version 1.1 of the driver. (Woohoo!) It has been | ||
6 | successfully tested against the following laptop models: | ||
7 | |||
8 | Sony Z505S/Z505SX/Z505DX/Z505RX | ||
9 | Sony F150, F160, F180, F250, F270, F280, PCG-F26 | ||
10 | Dell Latitude CPi, CPt (various submodels) | ||
11 | |||
12 | There are a few caveats, which is why you should read the entirety of | ||
13 | this document first. | ||
14 | |||
15 | This driver was developed without any support or assistance from | ||
16 | NeoMagic. There is no warranty, expressed, implied, or otherwise. It | ||
17 | is free software in the public domain; feel free to use it, sell it, | ||
18 | give it to your best friends, even claim that you wrote it (but why?!) | ||
19 | but don't go whining to me, NeoMagic, Sony, Dell, or anyone else | ||
20 | when it blows up your computer. | ||
21 | |||
22 | Version 1.1 contains a change to try and detect non-AC97 versions of | ||
23 | the hardware, and not install itself appropriately. It should also | ||
24 | reinitialize the hardware on an APM resume event, assuming that APM | ||
25 | was configured into your kernel. | ||
26 | |||
27 | ============ | ||
28 | Installation | ||
29 | ============ | ||
30 | |||
31 | Enable the sound drivers, the OSS sound drivers, and then the NM256 | ||
32 | driver. The NM256 driver *must* be configured as a module (it won't | ||
33 | give you any other choice). | ||
34 | |||
35 | Next, do the usual "make modules" and "make modules_install". | ||
36 | Finally, insmod the soundcore, sound and nm256 modules. | ||
37 | |||
38 | When the nm256 driver module is loaded, you should see a couple of | ||
39 | confirmation messages in the kernel logfile indicating that it found | ||
40 | the device (the device does *not* use any I/O ports or DMA channels). | ||
41 | Now try playing a wav file, futz with the CD-ROM if you have one, etc. | ||
42 | |||
43 | The NM256 is entirely a PCI-based device, and all the necessary | ||
44 | information is automatically obtained from the card. It can only be | ||
45 | configured as a module in a vain attempt to prevent people from | ||
46 | hurting themselves. It works correctly if it shares an IRQ with | ||
47 | another device (it normally shares IRQ 9 with the builtin eepro100 | ||
48 | ethernet on the Sony Z505 laptops). | ||
49 | |||
50 | It does not run the card in any sort of compatibility mode. It will | ||
51 | not work on laptops that have the SB16-compatible, AD1848-compatible | ||
52 | or CS4232-compatible codec/mixer; you will want to use the appropriate | ||
53 | compatible OSS driver with these chipsets. I cannot provide any | ||
54 | assistance with machines using the SB16, AD1848 or CS4232 compatible | ||
55 | versions. (The driver now attempts to detect the mixer version, and | ||
56 | will refuse to load if it believes the hardware is not | ||
57 | AC97-compatible.) | ||
58 | |||
59 | The sound support is very basic, but it does include simultaneous | ||
60 | playback and record capability. The mixer support is also quite | ||
61 | simple, although this is in keeping with the rather limited | ||
62 | functionality of the chipset. | ||
63 | |||
64 | There is no hardware synthesizer available, as the Losedows OPL-3 and | ||
65 | MIDI support is done via hardware emulation. | ||
66 | |||
67 | Only three recording devices are available on the Sony: the | ||
68 | microphone, the CD-ROM input, and the volume device (which corresponds | ||
69 | to the stereo output). (Other devices may be available on other | ||
70 | models of laptops.) The Z505 series does not have a builtin CD-ROM, | ||
71 | so of course the CD-ROM input doesn't work. It does work on laptops | ||
72 | with a builtin CD-ROM drive. | ||
73 | |||
74 | The mixer device does not appear to have any tone controls, at least | ||
75 | on the Z505 series. The mixer module checks for tone controls in the | ||
76 | AC97 mixer, and will enable them if they are available. | ||
77 | |||
78 | ============== | ||
79 | Known problems | ||
80 | ============== | ||
81 | |||
82 | * There are known problems with PCMCIA cards and the eepro100 ethernet | ||
83 | driver on the Z505S/Z505SX/Z505DX. Keep reading. | ||
84 | |||
85 | * There are also potential problems with using a virtual X display, and | ||
86 | also problems loading the module after the X server has been started. | ||
87 | Keep reading. | ||
88 | |||
89 | * The volume control isn't anywhere near linear. Sorry. This will be | ||
90 | fixed eventually, when I get sufficiently annoyed with it. (I doubt | ||
91 | it will ever be fixed now, since I've never gotten sufficiently | ||
92 | annoyed with it and nobody else seems to care.) | ||
93 | |||
94 | * There are reports that the CD-ROM volume is very low. Since I do not | ||
95 | have a CD-ROM equipped laptop, I cannot test this (it's kinda hard to | ||
96 | do remotely). | ||
97 | |||
98 | * Only 8 fixed-rate speeds are supported. This is mainly a chipset | ||
99 | limitation. It may be possible to support other speeds in the future. | ||
100 | |||
101 | * There is no support for the telephone mixer/codec. There is support | ||
102 | for a phonein/phoneout device in the mixer driver; whether or not | ||
103 | it does anything is anyone's guess. (Reports on this would be | ||
104 | appreciated. You'll have to figure out how to get the phone to | ||
105 | go off-hook before it'll work, tho.) | ||
106 | |||
107 | * This driver was not written with any cooperation or support from | ||
108 | NeoMagic. If you have any questions about this, see their website | ||
109 | for their official stance on supporting open source drivers. | ||
110 | |||
111 | ============ | ||
112 | Video memory | ||
113 | ============ | ||
114 | |||
115 | The NeoMagic sound engine uses a portion of the display memory to hold | ||
116 | the sound buffer. (Crazy, eh?) The NeoMagic video BIOS sets up a | ||
117 | special pointer at the top of video RAM to indicate where the top of | ||
118 | the audio buffer should be placed. | ||
119 | |||
120 | At the present time XFree86 is apparently not aware of this. It will | ||
121 | thus write over either the pointer or the sound buffer with abandon. | ||
122 | (Accelerated-X seems to do a better job here.) | ||
123 | |||
124 | This implies a few things: | ||
125 | |||
126 | * Sometimes the NM256 driver has to guess at where the buffer | ||
127 | should be placed, especially if the module is loaded after the | ||
128 | X server is started. It's usually correct, but it will consistently | ||
129 | fail on the Sony F250. | ||
130 | |||
131 | * Virtual screens greater than 1024x768x16 under XFree86 are | ||
132 | problematic on laptops with only 2.5MB of screen RAM. This | ||
133 | includes all of the 256AV-equipped laptops. (Virtual displays | ||
134 | may or may not work on the 256ZX, which has at least 4MB of | ||
135 | video RAM.) | ||
136 | |||
137 | If you start having problems with random noise being output either | ||
138 | constantly (this is the usual symptom on the F250), or when windows | ||
139 | are moved around (this is the usual symptom when using a virtual | ||
140 | screen), the best fix is to | ||
141 | |||
142 | * Don't use a virtual frame buffer. | ||
143 | * Make sure you load the NM256 module before the X server is | ||
144 | started. | ||
145 | |||
146 | On the F250, it is possible to force the driver to load properly even | ||
147 | after the XFree86 server is started by doing: | ||
148 | |||
149 | insmod nm256 buffertop=0x25a800 | ||
150 | |||
151 | This forces the audio buffers to the correct offset in screen RAM. | ||
152 | |||
153 | One user has reported a similar problem on the Sony F270, although | ||
154 | others apparently aren't seeing any problems. His suggested command | ||
155 | is | ||
156 | |||
157 | insmod nm256 buffertop=0x272800 | ||
158 | |||
159 | ================= | ||
160 | Official WWW site | ||
161 | ================= | ||
162 | |||
163 | The official site for the NM256 driver is: | ||
164 | |||
165 | http://www.uglx.org/sony.html | ||
166 | |||
167 | You should always be able to get the latest version of the driver there, | ||
168 | and the driver will be supported for the foreseeable future. | ||
169 | |||
170 | ============== | ||
171 | Z505RX and IDE | ||
172 | ============== | ||
173 | |||
174 | There appears to be a problem with the IDE chipset on the Z505RX; one | ||
175 | of the symptoms is that sound playback periodically hangs (when the | ||
176 | disk is accessed). The user reporting the problem also reported that | ||
177 | enabling all of the IDE chipset workarounds in the kernel solved the | ||
178 | problem, tho obviously only one of them should be needed--if someone | ||
179 | can give me more details I would appreciate it. | ||
180 | |||
181 | ============================== | ||
182 | Z505S/Z505SX on-board Ethernet | ||
183 | ============================== | ||
184 | |||
185 | If you're using the on-board Ethernet Pro/100 ethernet support on the Z505 | ||
186 | series, I strongly encourage you to download the latest eepro100 driver from | ||
187 | Donald Becker's site: | ||
188 | |||
189 | ftp://cesdis.gsfc.nasa.gov/pub/linux/drivers/test/eepro100.c | ||
190 | |||
191 | There was a reported problem on the Z505SX that if the ethernet | ||
192 | interface is disabled and reenabled while the sound driver is loaded, | ||
193 | the machine would lock up. I have included a workaround that is | ||
194 | working satisfactorily. However, you may occasionally see a message | ||
195 | about "Releasing interrupts, over 1000 bad interrupts" which indicates | ||
196 | that the workaround is doing its job. | ||
197 | |||
198 | ================================== | ||
199 | PCMCIA and the Z505S/Z505SX/Z505DX | ||
200 | ================================== | ||
201 | |||
202 | There is also a known problem with the Sony Z505S and Z505SX hanging | ||
203 | if a PCMCIA card is inserted while the ethernet driver is loaded, or | ||
204 | in some cases if the laptop is suspended. This is caused by tons of | ||
205 | spurious IRQ 9s, probably generated from the PCMCIA or ACPI bridges. | ||
206 | |||
207 | There is currently no fix for the problem that works in every case. | ||
208 | The only known workarounds are to disable the ethernet interface | ||
209 | before inserting or removing a PCMCIA card, or with some cards | ||
210 | disabling the PCMCIA card before ejecting it will also help the | ||
211 | problem with the laptop hanging when the card is ejected. | ||
212 | |||
213 | One user has reported that setting the tcic's cs_irq to some value | ||
214 | other than 9 (like 11) fixed the problem. This doesn't work on my | ||
215 | Z505S, however--changing the value causes the cardmgr to stop seeing | ||
216 | card insertions and removals, cards don't seem to work correctly, and | ||
217 | I still get hangs if a card is inserted when the kernel is booted. | ||
218 | |||
219 | Using the latest ethernet driver and pcmcia package allows me to | ||
220 | insert an Adaptec 1480A SlimScsi card without the laptop hanging, | ||
221 | although I still have to shut down the card before ejecting or | ||
222 | powering down the laptop. However, similar experiments with a DE-660 | ||
223 | ethernet card still result in hangs when the card is inserted. I am | ||
224 | beginning to think that the interrupts are CardBus-related, since the | ||
225 | Adaptec card is a CardBus card, and the DE-660 is not; however, I | ||
226 | don't have any other CardBus cards to test with. | ||
227 | |||
228 | ====== | ||
229 | Thanks | ||
230 | ====== | ||
231 | |||
232 | First, I want to thank everyone (except NeoMagic of course) for their | ||
233 | generous support and encouragement. I'd like to list everyone's name | ||
234 | here that replied during the development phase, but the list is | ||
235 | amazingly long. | ||
236 | |||
237 | I will be rather unfair and single out a few people, however: | ||
238 | |||
239 | Justin Maurer, for being the first random net.person to try it, | ||
240 | and for letting me login to his Z505SX to get it working there | ||
241 | |||
242 | Edi Weitz for trying out several different versions, and giving | ||
243 | me a lot of useful feedback | ||
244 | |||
245 | Greg Rumple for letting me login remotely to get the driver | ||
246 | functional on the 256ZX, for his assistance on tracking | ||
247 | down all sorts of random stuff, and for trying out Accel-X | ||
248 | |||
249 | Zach Brown, for the initial AC97 mixer interface design | ||
250 | |||
251 | Jeff Garzik, for various helpful suggestions on the AC97 | ||
252 | interface | ||
253 | |||
254 | "Mr. Bumpy" for feedback on the Z505RX | ||
255 | |||
256 | Bill Nottingham, for generous assistance in getting the mixer ID | ||
257 | code working | ||
258 | |||
259 | ================= | ||
260 | Previous versions | ||
261 | ================= | ||
262 | |||
263 | Versions prior to 0.3 (aka `noname') had problems with weird artifacts | ||
264 | in the output and failed to set the recording rate properly. These | ||
265 | problems have long since been fixed. | ||
266 | |||
267 | Versions prior to 0.5 had problems with clicks in the output when | ||
268 | anything other than 16-bit stereo sound was being played, and also had | ||
269 | periodic clicks when recording. | ||
270 | |||
271 | Version 0.7 first incorporated support for the NM256ZX chipset, which | ||
272 | is found on some Dell Latitude laptops (the CPt, and apparently | ||
273 | some CPi models as well). It also included the generic AC97 | ||
274 | mixer module. | ||
275 | |||
276 | Version 0.75 renamed all the functions and files with slightly more | ||
277 | generic names. | ||
278 | |||
279 | Note that previous versions of this document claimed that recording was | ||
280 | 8-bit only; it actually has been working for 16-bits all along. | ||
diff --git a/Documentation/sound/oss/OPL3-SA2 b/Documentation/sound/oss/OPL3-SA2 deleted file mode 100644 index d8b6d2bbada6..000000000000 --- a/Documentation/sound/oss/OPL3-SA2 +++ /dev/null | |||
@@ -1,210 +0,0 @@ | |||
1 | Documentation for the OPL3-SA2, SA3, and SAx driver (opl3sa2.o) | ||
2 | --------------------------------------------------------------- | ||
3 | |||
4 | Scott Murray, scott@spiteful.org | ||
5 | January 7, 2001 | ||
6 | |||
7 | NOTE: All trade-marked terms mentioned below are properties of their | ||
8 | respective owners. | ||
9 | |||
10 | |||
11 | Supported Devices | ||
12 | ----------------- | ||
13 | |||
14 | This driver is for PnP soundcards based on the following Yamaha audio | ||
15 | controller chipsets: | ||
16 | |||
17 | YMF711 aka OPL3-SA2 | ||
18 | YMF715 and YMF719 aka OPL3-SA3 | ||
19 | |||
20 | Up until recently (December 2000), I'd thought the 719 to be a | ||
21 | different chipset, the OPL3-SAx. After an email exhange with | ||
22 | Yamaha, however, it turns out that the 719 is just a re-badged | ||
23 | 715, and the chipsets are identical. The chipset detection code | ||
24 | has been updated to reflect this. | ||
25 | |||
26 | Anyways, all of these chipsets implement the following devices: | ||
27 | |||
28 | OPL3 FM synthesizer | ||
29 | Soundblaster Pro | ||
30 | Microsoft/Windows Sound System | ||
31 | MPU401 MIDI interface | ||
32 | |||
33 | Note that this driver uses the MSS device, and to my knowledge these | ||
34 | chipsets enforce an either/or situation with the Soundblaster Pro | ||
35 | device and the MSS device. Since the MSS device has better | ||
36 | capabilities, I have implemented the driver to use it. | ||
37 | |||
38 | |||
39 | Mixer Channels | ||
40 | -------------- | ||
41 | |||
42 | Older versions of this driver (pre-December 2000) had two mixers, | ||
43 | an OPL3-SA2 or SA3 mixer and a MSS mixer. The OPL3-SA[23] mixer | ||
44 | device contained a superset of mixer channels consisting of its own | ||
45 | channels and all of the MSS mixer channels. To simplify the driver | ||
46 | considerably, and to partition functionality better, the OPL3-SA[23] | ||
47 | mixer device now contains has its own specific mixer channels. They | ||
48 | are: | ||
49 | |||
50 | Volume - Hardware master volume control | ||
51 | Bass - SA3 only, now supports left and right channels | ||
52 | Treble - SA3 only, now supports left and right channels | ||
53 | Microphone - Hardware microphone input volume control | ||
54 | Digital1 - Yamaha 3D enhancement "Wide" mixer | ||
55 | |||
56 | All other mixer channels (e.g. "PCM", "CD", etc.) now have to be | ||
57 | controlled via the "MS Sound System (CS4231)" mixer. To facilitate | ||
58 | this, the mixer device creation order has been switched so that | ||
59 | the MSS mixer is created first. This allows accessing the majority | ||
60 | of the useful mixer channels even via single mixer-aware tools | ||
61 | such as "aumix". | ||
62 | |||
63 | |||
64 | Plug 'n Play | ||
65 | ------------ | ||
66 | |||
67 | In previous kernels (2.2.x), some configuration was required to | ||
68 | get the driver to talk to the card. Being the new millennium and | ||
69 | all, the 2.4.x kernels now support auto-configuration if ISA PnP | ||
70 | support is configured in. Theoretically, the driver even supports | ||
71 | having more than one card in this case. | ||
72 | |||
73 | With the addition of PnP support to the driver, two new parameters | ||
74 | have been added to control it: | ||
75 | |||
76 | isapnp - set to 0 to disable ISA PnP card detection | ||
77 | |||
78 | multiple - set to 0 to disable multiple PnP card detection | ||
79 | |||
80 | |||
81 | Optional Parameters | ||
82 | ------------------- | ||
83 | |||
84 | Recent (December 2000) additions to the driver (based on a patch | ||
85 | provided by Peter Englmaier) are two new parameters: | ||
86 | |||
87 | ymode - Set Yamaha 3D enhancement mode: | ||
88 | 0 = Desktop/Normal 5-12 cm speakers | ||
89 | 1 = Notebook PC (1) 3 cm speakers | ||
90 | 2 = Notebook PC (2) 1.5 cm speakers | ||
91 | 3 = Hi-Fi 16-38 cm speakers | ||
92 | |||
93 | loopback - Set A/D input source. Useful for echo cancellation: | ||
94 | 0 = Mic Right channel (default) | ||
95 | 1 = Mono output loopback | ||
96 | |||
97 | The ymode parameter has been tested and does work. The loopback | ||
98 | parameter, however, is untested. Any feedback on its usefulness | ||
99 | would be appreciated. | ||
100 | |||
101 | |||
102 | Manual Configuration | ||
103 | -------------------- | ||
104 | |||
105 | If for some reason you decide not to compile ISA PnP support into | ||
106 | your kernel, or disabled the driver's usage of it by setting the | ||
107 | isapnp parameter as discussed above, then you will need to do some | ||
108 | manual configuration. There are two ways of doing this. The most | ||
109 | common is to use the isapnptools package to initialize the card, and | ||
110 | use the kernel module form of the sound subsystem and sound drivers. | ||
111 | Alternatively, some BIOS's allow manual configuration of installed | ||
112 | PnP devices in a BIOS menu, which should allow using the non-modular | ||
113 | sound drivers, i.e. built into the kernel. | ||
114 | |||
115 | I personally use isapnp and modules, and do not have access to a PnP | ||
116 | BIOS machine to test. If you have such a beast, configuring the | ||
117 | driver to be built into the kernel should just work (thanks to work | ||
118 | done by David Luyer <luyer@ucs.uwa.edu.au>). You will still need | ||
119 | to specify settings, which can be done by adding: | ||
120 | |||
121 | opl3sa2=<io>,<irq>,<dma>,<dma2>,<mssio>,<mpuio> | ||
122 | |||
123 | to the kernel command line. For example: | ||
124 | |||
125 | opl3sa2=0x370,5,0,1,0x530,0x330 | ||
126 | |||
127 | If you are instead using the isapnp tools (as most people have been | ||
128 | before Linux 2.4.x), follow the directions in their documentation to | ||
129 | produce a configuration file. Here is the relevant excerpt I used to | ||
130 | use for my SA3 card from my isapnp.conf: | ||
131 | |||
132 | (CONFIGURE YMH0800/-1 (LD 0 | ||
133 | |||
134 | # NOTE: IO 0 is for the unused SoundBlaster part of the chipset. | ||
135 | (IO 0 (BASE 0x0220)) | ||
136 | (IO 1 (BASE 0x0530)) | ||
137 | (IO 2 (BASE 0x0388)) | ||
138 | (IO 3 (BASE 0x0330)) | ||
139 | (IO 4 (BASE 0x0370)) | ||
140 | (INT 0 (IRQ 5 (MODE +E))) | ||
141 | (DMA 0 (CHANNEL 0)) | ||
142 | (DMA 1 (CHANNEL 1)) | ||
143 | |||
144 | Here, note that: | ||
145 | |||
146 | Port Acceptable Range Purpose | ||
147 | ---- ---------------- ------- | ||
148 | IO 0 0x0220 - 0x0280 SB base address, unused. | ||
149 | IO 1 0x0530 - 0x0F48 MSS base address | ||
150 | IO 2 0x0388 - 0x03F8 OPL3 base address | ||
151 | IO 3 0x0300 - 0x0334 MPU base address | ||
152 | IO 4 0x0100 - 0x0FFE card's own base address for its control I/O ports | ||
153 | |||
154 | The IRQ and DMA values can be any that are considered acceptable for a | ||
155 | MSS. Assuming you've got isapnp all happy, then you should be able to | ||
156 | do something like the following (which matches up with the isapnp | ||
157 | configuration above): | ||
158 | |||
159 | modprobe mpu401 | ||
160 | modprobe ad1848 | ||
161 | modprobe opl3sa2 io=0x370 mss_io=0x530 mpu_io=0x330 irq=5 dma=0 dma2=1 | ||
162 | modprobe opl3 io=0x388 | ||
163 | |||
164 | See the section "Automatic Module Loading" below for how to set up | ||
165 | /etc/modprobe.conf to automate this. | ||
166 | |||
167 | An important thing to remember that the opl3sa2 module's io argument is | ||
168 | for it's own control port, which handles the card's master mixer for | ||
169 | volume (on all cards), and bass and treble (on SA3 cards). | ||
170 | |||
171 | |||
172 | Troubleshooting | ||
173 | --------------- | ||
174 | |||
175 | If all goes well and you see no error messages, you should be able to | ||
176 | start using the sound capabilities of your system. If you get an | ||
177 | error message while trying to insert the opl3sa2 module, then make | ||
178 | sure that the values of the various arguments match what you specified | ||
179 | in your isapnp configuration file, and that there is no conflict with | ||
180 | another device for an I/O port or interrupt. Checking the contents of | ||
181 | /proc/ioports and /proc/interrupts can be useful to see if you're | ||
182 | butting heads with another device. | ||
183 | |||
184 | If you still cannot get the module to load, look at the contents of | ||
185 | your system log file, usually /var/log/messages. If you see the | ||
186 | message "opl3sa2: Unknown Yamaha audio controller version", then you | ||
187 | have a different chipset version than I've encountered so far. Look | ||
188 | for all messages in the log file that start with "opl3sa2: " and see | ||
189 | if they provide any clues. If you do not see the chipset version | ||
190 | message, and none of the other messages present in the system log are | ||
191 | helpful, email me some details and I'll try my best to help. | ||
192 | |||
193 | |||
194 | Automatic Module Loading | ||
195 | ------------------------ | ||
196 | |||
197 | Lastly, if you're using modules and want to set up automatic module | ||
198 | loading with kmod, the kernel module loader, here is the section I | ||
199 | currently use in my modprobe.conf file: | ||
200 | |||
201 | # Sound | ||
202 | alias sound-slot-0 opl3sa2 | ||
203 | options opl3sa2 io=0x370 mss_io=0x530 mpu_io=0x330 irq=7 dma=0 dma2=3 | ||
204 | options opl3 io=0x388 | ||
205 | |||
206 | That's all it currently takes to get an OPL3-SA3 card working on my | ||
207 | system. Once again, if you have any other problems, email me at the | ||
208 | address listed above. | ||
209 | |||
210 | Scott | ||
diff --git a/Documentation/sound/oss/VIA-chipset b/Documentation/sound/oss/VIA-chipset deleted file mode 100644 index 37865234e54d..000000000000 --- a/Documentation/sound/oss/VIA-chipset +++ /dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | Running sound cards on VIA chipsets | ||
2 | |||
3 | o There are problems with VIA chipsets and sound cards that appear to | ||
4 | lock the hardware solidly. Test programs under DOS have verified the | ||
5 | problem exists on at least some (but apparently not all) VIA boards | ||
6 | |||
7 | o VIA have so far failed to bother to answer support mail on the subject | ||
8 | so if you are a VIA engineer feeling aggrieved as you read this | ||
9 | document go chase your own people. If there is a workaround please | ||
10 | let us know so we can implement it. | ||
11 | |||
12 | |||
13 | Certain patterns of ISA DMA access used for most PC sound cards cause the | ||
14 | VIA chipsets to lock up. From the collected reports this appears to cover a | ||
15 | wide range of boards. Some also lock up with sound cards under Win* as well. | ||
16 | |||
17 | Linux implements a workaround providing your chipset is PCI and you compiled | ||
18 | with PCI Quirks enabled. If so you will see a message | ||
19 | "Activating ISA DMA bug workarounds" | ||
20 | |||
21 | during booting. If you have a VIA PCI chipset that hangs when you use the | ||
22 | sound and is not generating this message even with PCI quirks enabled | ||
23 | please report the information to the linux-kernel list (see REPORTING-BUGS). | ||
24 | |||
25 | If you are one of the tiny number of unfortunates with a 486 ISA/VLB VIA | ||
26 | chipset board you need to do the following to build a special kernel for | ||
27 | your board | ||
28 | |||
29 | edit linux/include/asm-i386/dma.h | ||
30 | |||
31 | change | ||
32 | |||
33 | #define isa_dma_bridge_buggy (0) | ||
34 | |||
35 | to | ||
36 | |||
37 | #define isa_dma_bridge_buggy (1) | ||
38 | |||
39 | and rebuild a kernel without PCI quirk support. | ||
40 | |||
41 | |||
42 | Other than this particular glitch the VIA [M]VP* chipsets appear to work | ||
43 | perfectly with Linux. | ||
diff --git a/Documentation/sound/oss/cs46xx b/Documentation/sound/oss/cs46xx deleted file mode 100644 index b54432709863..000000000000 --- a/Documentation/sound/oss/cs46xx +++ /dev/null | |||
@@ -1,138 +0,0 @@ | |||
1 | |||
2 | Documentation for the Cirrus Logic/Crystal SoundFusion cs46xx/cs4280 audio | ||
3 | controller chips (2001/05/11) | ||
4 | |||
5 | The cs46xx audio driver supports the DSP line of Cirrus controllers. | ||
6 | Specifically, the cs4610, cs4612, cs4614, cs4622, cs4624, cs4630 and the cs4280 | ||
7 | products. This driver uses the generic ac97_codec driver for AC97 codec | ||
8 | support. | ||
9 | |||
10 | |||
11 | Features: | ||
12 | |||
13 | Full Duplex Playback/Capture supported from 8k-48k. | ||
14 | 16Bit Signed LE & 8Bit Unsigned, with Mono or Stereo supported. | ||
15 | |||
16 | APM/PM - 2.2.x PM is enabled and functional. APM can also | ||
17 | be enabled for 2.4.x by modifying the CS46XX_ACPI_SUPPORT macro | ||
18 | definition. | ||
19 | |||
20 | DMA playback buffer size is configurable from 16k (defaultorder=2) up to 2Meg | ||
21 | (defaultorder=11). DMA capture buffer size is fixed at a single 4k page as | ||
22 | two 2k fragments. | ||
23 | |||
24 | MMAP seems to work well with QuakeIII, and test XMMS plugin. | ||
25 | |||
26 | Myth2 works, but the polling logic is not fully correct, but is functional. | ||
27 | |||
28 | The 2.4.4-ac6 gameport code in the cs461x joystick driver has been tested | ||
29 | with a Microsoft Sidewinder joystick (cs461x.o and sidewinder.o). This | ||
30 | audio driver must be loaded prior to the joystick driver to enable the | ||
31 | DSP task image supporting the joystick device. | ||
32 | |||
33 | |||
34 | Limitations: | ||
35 | |||
36 | SPDIF is currently not supported. | ||
37 | |||
38 | Primary codec support only. No secondary codec support is implemented. | ||
39 | |||
40 | |||
41 | |||
42 | NOTES: | ||
43 | |||
44 | Hercules Game Theatre XP - the EGPIO2 pin controls the external Amp, | ||
45 | and has been tested. | ||
46 | Module parameter hercules_egpio_disable set to 1, will force a 0 to EGPIODR | ||
47 | to disable the external amplifier. | ||
48 | |||
49 | VTB Santa Cruz - the GPIO7/GPIO8 on the Secondary Codec control | ||
50 | the external amplifier for the "back" speakers, since we do not | ||
51 | support the secondary codec then this external amp is not | ||
52 | turned on. The primary codec external amplifier is supported but | ||
53 | note that the AC97 EAPD bit is inverted logic (amp_voyetra()). | ||
54 | |||
55 | DMA buffer size - there are issues with many of the Linux applications | ||
56 | concerning the optimal buffer size. Several applications request a | ||
57 | certain fragment size and number and then do not verify that the driver | ||
58 | has the ability to support the requested configuration. | ||
59 | SNDCTL_DSP_SETFRAGMENT ioctl is used to request a fragment size and | ||
60 | number of fragments. Some applications exit if an error is returned | ||
61 | on this particular ioctl. Therefore, in alignment with the other OSS audio | ||
62 | drivers, no error is returned when a SETFRAGs IOCTL is received, but the | ||
63 | values passed from the app are not used in any buffer calculation | ||
64 | (ossfragshift/ossmaxfrags are not used). | ||
65 | Use the "defaultorder=N" module parameter to change the buffer size if | ||
66 | you have an application that requires a specific number of fragments | ||
67 | or a specific buffer size (see below). | ||
68 | |||
69 | Debug Interface | ||
70 | --------------- | ||
71 | There is an ioctl debug interface to allow runtime modification of the | ||
72 | debug print levels. This debug interface code can be disabled from the | ||
73 | compilation process with commenting the following define: | ||
74 | #define CSDEBUG_INTERFACE 1 | ||
75 | There is also a debug print methodolgy to select printf statements from | ||
76 | different areas of the driver. A debug print level is also used to allow | ||
77 | additional printfs to be active. Comment out the following line in the | ||
78 | driver to disable compilation of the CS_DBGOUT print statements: | ||
79 | #define CSDEBUG 1 | ||
80 | |||
81 | Please see the definitions for cs_debuglevel and cs_debugmask for additional | ||
82 | information on the debug levels and sections. | ||
83 | |||
84 | There is also a csdbg executable to allow runtime manipulation of these | ||
85 | parameters. for a copy email: twoller@crystal.cirrus.com | ||
86 | |||
87 | |||
88 | |||
89 | MODULE_PARMS definitions | ||
90 | ------------------------ | ||
91 | module_param(defaultorder, ulong, 0); | ||
92 | defaultorder=N | ||
93 | where N is a value from 1 to 12 | ||
94 | The buffer order determines the size of the dma buffer for the driver. | ||
95 | under Linux, a smaller buffer allows more responsiveness from many of the | ||
96 | applications (e.g. games). A larger buffer allows some of the apps (esound) | ||
97 | to not underrun the dma buffer as easily. As default, use 32k (order=3) | ||
98 | rather than 64k as some of the games work more responsively. | ||
99 | (2^N) * PAGE_SIZE = allocated buffer size | ||
100 | |||
101 | module_param(cs_debuglevel, ulong, 0644); | ||
102 | module_param(cs_debugmask, ulong, 0644); | ||
103 | cs_debuglevel=N | ||
104 | cs_debugmask=0xMMMMMMMM | ||
105 | where N is a value from 0 (no debug printfs), to 9 (maximum) | ||
106 | 0xMMMMMMMM is a debug mask corresponding to the CS_xxx bits (see driver source). | ||
107 | |||
108 | module_param(hercules_egpio_disable, ulong, 0); | ||
109 | hercules_egpio_disable=N | ||
110 | where N is a 0 (enable egpio), or a 1 (disable egpio support) | ||
111 | |||
112 | module_param(initdelay, ulong, 0); | ||
113 | initdelay=N | ||
114 | This value is used to determine the millescond delay during the initialization | ||
115 | code prior to powering up the PLL. On laptops this value can be used to | ||
116 | assist with errors on resume, mostly with IBM laptops. Basically, if the | ||
117 | system is booted under battery power then the mdelay()/udelay() functions fail to | ||
118 | properly delay the required time. Also, if the system is booted under AC power | ||
119 | and then the power removed, the mdelay()/udelay() functions will not delay properly. | ||
120 | |||
121 | module_param(powerdown, ulong, 0); | ||
122 | powerdown=N | ||
123 | where N is 0 (disable any powerdown of the internal blocks) or 1 (enable powerdown) | ||
124 | |||
125 | |||
126 | module_param(external_amp, bool, 0); | ||
127 | external_amp=1 | ||
128 | if N is set to 1, then force enabling the EAPD support in the primary AC97 codec. | ||
129 | override the detection logic and force the external amp bit in the AC97 0x26 register | ||
130 | to be reset (0). EAPD should be 0 for powerup, and 1 for powerdown. The VTB Santa Cruz | ||
131 | card has inverted logic, so there is a special function for these cards. | ||
132 | |||
133 | module_param(thinkpad, bool, 0); | ||
134 | thinkpad=1 | ||
135 | if N is set to 1, then force enabling the clkrun functionality. | ||
136 | Currently, when the part is being used, then clkrun is disabled for the entire system, | ||
137 | but re-enabled when the driver is released or there is no outstanding open count. | ||
138 | |||
diff --git a/Documentation/spinlocks.txt b/Documentation/spinlocks.txt index a661d684768e..471e75389778 100644 --- a/Documentation/spinlocks.txt +++ b/Documentation/spinlocks.txt | |||
@@ -1,7 +1,12 @@ | |||
1 | UPDATE March 21 2005 Amit Gud <gud@eth.net> | 1 | SPIN_LOCK_UNLOCKED and RW_LOCK_UNLOCKED defeat lockdep state tracking and |
2 | are hence deprecated. | ||
2 | 3 | ||
3 | Macros SPIN_LOCK_UNLOCKED and RW_LOCK_UNLOCKED are deprecated and will be | 4 | Please use DEFINE_SPINLOCK()/DEFINE_RWLOCK() or |
4 | removed soon. So for any new code dynamic initialization should be used: | 5 | __SPIN_LOCK_UNLOCKED()/__RW_LOCK_UNLOCKED() as appropriate for static |
6 | initialization. | ||
7 | |||
8 | Dynamic initialization, when necessary, may be performed as | ||
9 | demonstrated below. | ||
5 | 10 | ||
6 | spinlock_t xxx_lock; | 11 | spinlock_t xxx_lock; |
7 | rwlock_t xxx_rw_lock; | 12 | rwlock_t xxx_rw_lock; |
@@ -15,12 +20,9 @@ removed soon. So for any new code dynamic initialization should be used: | |||
15 | 20 | ||
16 | module_init(xxx_init); | 21 | module_init(xxx_init); |
17 | 22 | ||
18 | Reasons for deprecation | 23 | The following discussion is still valid, however, with the dynamic |
19 | - it hurts automatic lock validators | 24 | initialization of spinlocks or with DEFINE_SPINLOCK, etc., used |
20 | - it becomes intrusive for the realtime preemption patches | 25 | instead of SPIN_LOCK_UNLOCKED. |
21 | |||
22 | Following discussion is still valid, however, with the dynamic initialization | ||
23 | of spinlocks instead of static. | ||
24 | 26 | ||
25 | ----------------------- | 27 | ----------------------- |
26 | 28 | ||
diff --git a/Documentation/sysctl/ctl_unnumbered.txt b/Documentation/sysctl/ctl_unnumbered.txt new file mode 100644 index 000000000000..23003a8ea3e7 --- /dev/null +++ b/Documentation/sysctl/ctl_unnumbered.txt | |||
@@ -0,0 +1,22 @@ | |||
1 | |||
2 | Except for a few extremely rare exceptions user space applications do not use | ||
3 | the binary sysctl interface. Instead everyone uses /proc/sys/... with | ||
4 | readable ascii names. | ||
5 | |||
6 | Recently the kernel has started supporting setting the binary sysctl value to | ||
7 | CTL_UNNUMBERED so we no longer need to assign a binary sysctl path to allow | ||
8 | sysctls to show up in /proc/sys. | ||
9 | |||
10 | Assigning binary sysctl numbers is an endless source of conflicts in sysctl.h, | ||
11 | breaking of the user space ABI (because of those conflicts), and maintenance | ||
12 | problems. A complete pass through all of the sysctl users revealed multiple | ||
13 | instances where the sysctl binary interface was broken and had gone undetected | ||
14 | for years. | ||
15 | |||
16 | So please do not add new binary sysctl numbers. They are unneeded and | ||
17 | problematic. | ||
18 | |||
19 | If you really need a new binary sysctl number please first merge your sysctl | ||
20 | into the kernel and then as a separate patch allocate a binary sysctl number. | ||
21 | |||
22 | (ebiederm@xmission.com, June 2007) | ||
diff --git a/Documentation/sysctl/vm.txt b/Documentation/sysctl/vm.txt index 1d192565e182..df3ff2095f9d 100644 --- a/Documentation/sysctl/vm.txt +++ b/Documentation/sysctl/vm.txt | |||
@@ -31,6 +31,8 @@ Currently, these files are in /proc/sys/vm: | |||
31 | - min_unmapped_ratio | 31 | - min_unmapped_ratio |
32 | - min_slab_ratio | 32 | - min_slab_ratio |
33 | - panic_on_oom | 33 | - panic_on_oom |
34 | - mmap_min_address | ||
35 | - numa_zonelist_order | ||
34 | 36 | ||
35 | ============================================================== | 37 | ============================================================== |
36 | 38 | ||
@@ -216,3 +218,61 @@ above-mentioned. | |||
216 | The default value is 0. | 218 | The default value is 0. |
217 | 1 and 2 are for failover of clustering. Please select either | 219 | 1 and 2 are for failover of clustering. Please select either |
218 | according to your policy of failover. | 220 | according to your policy of failover. |
221 | |||
222 | ============================================================== | ||
223 | |||
224 | mmap_min_addr | ||
225 | |||
226 | This file indicates the amount of address space which a user process will | ||
227 | be restricted from mmaping. Since kernel null dereference bugs could | ||
228 | accidentally operate based on the information in the first couple of pages | ||
229 | of memory userspace processes should not be allowed to write to them. By | ||
230 | default this value is set to 0 and no protections will be enforced by the | ||
231 | security module. Setting this value to something like 64k will allow the | ||
232 | vast majority of applications to work correctly and provide defense in depth | ||
233 | against future potential kernel bugs. | ||
234 | |||
235 | ============================================================== | ||
236 | |||
237 | numa_zonelist_order | ||
238 | |||
239 | This sysctl is only for NUMA. | ||
240 | 'where the memory is allocated from' is controlled by zonelists. | ||
241 | (This documentation ignores ZONE_HIGHMEM/ZONE_DMA32 for simple explanation. | ||
242 | you may be able to read ZONE_DMA as ZONE_DMA32...) | ||
243 | |||
244 | In non-NUMA case, a zonelist for GFP_KERNEL is ordered as following. | ||
245 | ZONE_NORMAL -> ZONE_DMA | ||
246 | This means that a memory allocation request for GFP_KERNEL will | ||
247 | get memory from ZONE_DMA only when ZONE_NORMAL is not available. | ||
248 | |||
249 | In NUMA case, you can think of following 2 types of order. | ||
250 | Assume 2 node NUMA and below is zonelist of Node(0)'s GFP_KERNEL | ||
251 | |||
252 | (A) Node(0) ZONE_NORMAL -> Node(0) ZONE_DMA -> Node(1) ZONE_NORMAL | ||
253 | (B) Node(0) ZONE_NORMAL -> Node(1) ZONE_NORMAL -> Node(0) ZONE_DMA. | ||
254 | |||
255 | Type(A) offers the best locality for processes on Node(0), but ZONE_DMA | ||
256 | will be used before ZONE_NORMAL exhaustion. This increases possibility of | ||
257 | out-of-memory(OOM) of ZONE_DMA because ZONE_DMA is tend to be small. | ||
258 | |||
259 | Type(B) cannot offer the best locality but is more robust against OOM of | ||
260 | the DMA zone. | ||
261 | |||
262 | Type(A) is called as "Node" order. Type (B) is "Zone" order. | ||
263 | |||
264 | "Node order" orders the zonelists by node, then by zone within each node. | ||
265 | Specify "[Nn]ode" for zone order | ||
266 | |||
267 | "Zone Order" orders the zonelists by zone type, then by node within each | ||
268 | zone. Specify "[Zz]one"for zode order. | ||
269 | |||
270 | Specify "[Dd]efault" to request automatic configuration. Autoconfiguration | ||
271 | will select "node" order in following case. | ||
272 | (1) if the DMA zone does not exist or | ||
273 | (2) if the DMA zone comprises greater than 50% of the available memory or | ||
274 | (3) if any node's DMA zone comprises greater than 60% of its local memory and | ||
275 | the amount of local memory is big enough. | ||
276 | |||
277 | Otherwise, "zone" order will be selected. Default order is recommended unless | ||
278 | this is causing problems for your system/application. | ||
diff --git a/Documentation/sysfs-rules.txt b/Documentation/sysfs-rules.txt new file mode 100644 index 000000000000..42861bb0bc9b --- /dev/null +++ b/Documentation/sysfs-rules.txt | |||
@@ -0,0 +1,166 @@ | |||
1 | Rules on how to access information in the Linux kernel sysfs | ||
2 | |||
3 | The kernel exported sysfs exports internal kernel implementation-details | ||
4 | and depends on internal kernel structures and layout. It is agreed upon | ||
5 | by the kernel developers that the Linux kernel does not provide a stable | ||
6 | internal API. As sysfs is a direct export of kernel internal | ||
7 | structures, the sysfs interface can not provide a stable interface eighter, | ||
8 | it may always change along with internal kernel changes. | ||
9 | |||
10 | To minimize the risk of breaking users of sysfs, which are in most cases | ||
11 | low-level userspace applications, with a new kernel release, the users | ||
12 | of sysfs must follow some rules to use an as abstract-as-possible way to | ||
13 | access this filesystem. The current udev and HAL programs already | ||
14 | implement this and users are encouraged to plug, if possible, into the | ||
15 | abstractions these programs provide instead of accessing sysfs | ||
16 | directly. | ||
17 | |||
18 | But if you really do want or need to access sysfs directly, please follow | ||
19 | the following rules and then your programs should work with future | ||
20 | versions of the sysfs interface. | ||
21 | |||
22 | - Do not use libsysfs | ||
23 | It makes assumptions about sysfs which are not true. Its API does not | ||
24 | offer any abstraction, it exposes all the kernel driver-core | ||
25 | implementation details in its own API. Therefore it is not better than | ||
26 | reading directories and opening the files yourself. | ||
27 | Also, it is not actively maintained, in the sense of reflecting the | ||
28 | current kernel-development. The goal of providing a stable interface | ||
29 | to sysfs has failed, it causes more problems, than it solves. It | ||
30 | violates many of the rules in this document. | ||
31 | |||
32 | - sysfs is always at /sys | ||
33 | Parsing /proc/mounts is a waste of time. Other mount points are a | ||
34 | system configuration bug you should not try to solve. For test cases, | ||
35 | possibly support a SYSFS_PATH environment variable to overwrite the | ||
36 | applications behavior, but never try to search for sysfs. Never try | ||
37 | to mount it, if you are not an early boot script. | ||
38 | |||
39 | - devices are only "devices" | ||
40 | There is no such thing like class-, bus-, physical devices, | ||
41 | interfaces, and such that you can rely on in userspace. Everything is | ||
42 | just simply a "device". Class-, bus-, physical, ... types are just | ||
43 | kernel implementation details, which should not be expected by | ||
44 | applications that look for devices in sysfs. | ||
45 | |||
46 | The properties of a device are: | ||
47 | o devpath (/devices/pci0000:00/0000:00:1d.1/usb2/2-2/2-2:1.0) | ||
48 | - identical to the DEVPATH value in the event sent from the kernel | ||
49 | at device creation and removal | ||
50 | - the unique key to the device at that point in time | ||
51 | - the kernels path to the device-directory without the leading | ||
52 | /sys, and always starting with with a slash | ||
53 | - all elements of a devpath must be real directories. Symlinks | ||
54 | pointing to /sys/devices must always be resolved to their real | ||
55 | target, and the target path must be used to access the device. | ||
56 | That way the devpath to the device matches the devpath of the | ||
57 | kernel used at event time. | ||
58 | - using or exposing symlink values as elements in a devpath string | ||
59 | is a bug in the application | ||
60 | |||
61 | o kernel name (sda, tty, 0000:00:1f.2, ...) | ||
62 | - a directory name, identical to the last element of the devpath | ||
63 | - applications need to handle spaces and characters like '!' in | ||
64 | the name | ||
65 | |||
66 | o subsystem (block, tty, pci, ...) | ||
67 | - simple string, never a path or a link | ||
68 | - retrieved by reading the "subsystem"-link and using only the | ||
69 | last element of the target path | ||
70 | |||
71 | o driver (tg3, ata_piix, uhci_hcd) | ||
72 | - a simple string, which may contain spaces, never a path or a | ||
73 | link | ||
74 | - it is retrieved by reading the "driver"-link and using only the | ||
75 | last element of the target path | ||
76 | - devices which do not have "driver"-link, just do not have a | ||
77 | driver; copying the driver value in a child device context, is a | ||
78 | bug in the application | ||
79 | |||
80 | o attributes | ||
81 | - the files in the device directory or files below a subdirectories | ||
82 | of the same device directory | ||
83 | - accessing attributes reached by a symlink pointing to another device, | ||
84 | like the "device"-link, is a bug in the application | ||
85 | |||
86 | Everything else is just a kernel driver-core implementation detail, | ||
87 | that should not be assumed to be stable across kernel releases. | ||
88 | |||
89 | - Properties of parent devices never belong into a child device. | ||
90 | Always look at the parent devices themselves for determining device | ||
91 | context properties. If the device 'eth0' or 'sda' does not have a | ||
92 | "driver"-link, then this device does not have a driver. Its value is empty. | ||
93 | Never copy any property of the parent-device into a child-device. Parent | ||
94 | device-properties may change dynamically without any notice to the | ||
95 | child device. | ||
96 | |||
97 | - Hierarchy in a single device-tree | ||
98 | There is only one valid place in sysfs where hierarchy can be examined | ||
99 | and this is below: /sys/devices. | ||
100 | It is planned, that all device directories will end up in the tree | ||
101 | below this directory. | ||
102 | |||
103 | - Classification by subsystem | ||
104 | There are currently three places for classification of devices: | ||
105 | /sys/block, /sys/class and /sys/bus. It is planned that these will | ||
106 | not contain any device-directories themselves, but only flat lists of | ||
107 | symlinks pointing to the unified /sys/devices tree. | ||
108 | All three places have completely different rules on how to access | ||
109 | device information. It is planned to merge all three | ||
110 | classification-directories into one place at /sys/subsystem, | ||
111 | following the layout of the bus-directories. All buses and | ||
112 | classes, including the converted block-subsystem, will show up | ||
113 | there. | ||
114 | The devices belonging to a subsystem will create a symlink in the | ||
115 | "devices" directory at /sys/subsystem/<name>/devices. | ||
116 | |||
117 | If /sys/subsystem exists, /sys/bus, /sys/class and /sys/block can be | ||
118 | ignored. If it does not exist, you have always to scan all three | ||
119 | places, as the kernel is free to move a subsystem from one place to | ||
120 | the other, as long as the devices are still reachable by the same | ||
121 | subsystem name. | ||
122 | |||
123 | Assuming /sys/class/<subsystem> and /sys/bus/<subsystem>, or | ||
124 | /sys/block and /sys/class/block are not interchangeable, is a bug in | ||
125 | the application. | ||
126 | |||
127 | - Block | ||
128 | The converted block-subsystem at /sys/class/block, or | ||
129 | /sys/subsystem/block will contain the links for disks and partitions | ||
130 | at the same level, never in a hierarchy. Assuming the block-subsytem to | ||
131 | contain only disks and not partition-devices in the same flat list is | ||
132 | a bug in the application. | ||
133 | |||
134 | - "device"-link and <subsystem>:<kernel name>-links | ||
135 | Never depend on the "device"-link. The "device"-link is a workaround | ||
136 | for the old layout, where class-devices are not created in | ||
137 | /sys/devices/ like the bus-devices. If the link-resolving of a | ||
138 | device-directory does not end in /sys/devices/, you can use the | ||
139 | "device"-link to find the parent devices in /sys/devices/. That is the | ||
140 | single valid use of the "device"-link, it must never appear in any | ||
141 | path as an element. Assuming the existence of the "device"-link for | ||
142 | a device in /sys/devices/ is a bug in the application. | ||
143 | Accessing /sys/class/net/eth0/device is a bug in the application. | ||
144 | |||
145 | Never depend on the class-specific links back to the /sys/class | ||
146 | directory. These links are also a workaround for the design mistake | ||
147 | that class-devices are not created in /sys/devices. If a device | ||
148 | directory does not contain directories for child devices, these links | ||
149 | may be used to find the child devices in /sys/class. That is the single | ||
150 | valid use of these links, they must never appear in any path as an | ||
151 | element. Assuming the existence of these links for devices which are | ||
152 | real child device directories in the /sys/devices tree, is a bug in | ||
153 | the application. | ||
154 | |||
155 | It is planned to remove all these links when when all class-device | ||
156 | directories live in /sys/devices. | ||
157 | |||
158 | - Position of devices along device chain can change. | ||
159 | Never depend on a specific parent device position in the devpath, | ||
160 | or the chain of parent devices. The kernel is free to insert devices into | ||
161 | the chain. You must always request the parent device you are looking for | ||
162 | by its subsystem value. You need to walk up the chain until you find | ||
163 | the device that matches the expected subsystem. Depending on a specific | ||
164 | position of a parent device, or exposing relative paths, using "../" to | ||
165 | access the chain of parents, is a bug in the application. | ||
166 | |||
diff --git a/Documentation/usb/dma.txt b/Documentation/usb/dma.txt index 62844aeba69c..e8b50b7de9d9 100644 --- a/Documentation/usb/dma.txt +++ b/Documentation/usb/dma.txt | |||
@@ -32,12 +32,15 @@ ELIMINATING COPIES | |||
32 | It's good to avoid making CPUs copy data needlessly. The costs can add up, | 32 | It's good to avoid making CPUs copy data needlessly. The costs can add up, |
33 | and effects like cache-trashing can impose subtle penalties. | 33 | and effects like cache-trashing can impose subtle penalties. |
34 | 34 | ||
35 | - When you're allocating a buffer for DMA purposes anyway, use the buffer | 35 | - If you're doing lots of small data transfers from the same buffer all |
36 | primitives. Think of them as kmalloc and kfree that give you the right | 36 | the time, that can really burn up resources on systems which use an |
37 | kind of addresses to store in urb->transfer_buffer and urb->transfer_dma, | 37 | IOMMU to manage the DMA mappings. It can cost MUCH more to set up and |
38 | while guaranteeing that no hidden copies through DMA "bounce" buffers will | 38 | tear down the IOMMU mappings with each request than perform the I/O! |
39 | slow things down. You'd also set URB_NO_TRANSFER_DMA_MAP in | 39 | |
40 | urb->transfer_flags: | 40 | For those specific cases, USB has primitives to allocate less expensive |
41 | memory. They work like kmalloc and kfree versions that give you the right | ||
42 | kind of addresses to store in urb->transfer_buffer and urb->transfer_dma. | ||
43 | You'd also set URB_NO_TRANSFER_DMA_MAP in urb->transfer_flags: | ||
41 | 44 | ||
42 | void *usb_buffer_alloc (struct usb_device *dev, size_t size, | 45 | void *usb_buffer_alloc (struct usb_device *dev, size_t size, |
43 | int mem_flags, dma_addr_t *dma); | 46 | int mem_flags, dma_addr_t *dma); |
@@ -45,6 +48,10 @@ and effects like cache-trashing can impose subtle penalties. | |||
45 | void usb_buffer_free (struct usb_device *dev, size_t size, | 48 | void usb_buffer_free (struct usb_device *dev, size_t size, |
46 | void *addr, dma_addr_t dma); | 49 | void *addr, dma_addr_t dma); |
47 | 50 | ||
51 | Most drivers should *NOT* be using these primitives; they don't need | ||
52 | to use this type of memory ("dma-coherent"), and memory returned from | ||
53 | kmalloc() will work just fine. | ||
54 | |||
48 | For control transfers you can use the buffer primitives or not for each | 55 | For control transfers you can use the buffer primitives or not for each |
49 | of the transfer buffer and setup buffer independently. Set the flag bits | 56 | of the transfer buffer and setup buffer independently. Set the flag bits |
50 | URB_NO_TRANSFER_DMA_MAP and URB_NO_SETUP_DMA_MAP to indicate which | 57 | URB_NO_TRANSFER_DMA_MAP and URB_NO_SETUP_DMA_MAP to indicate which |
@@ -54,29 +61,39 @@ and effects like cache-trashing can impose subtle penalties. | |||
54 | The memory buffer returned is "dma-coherent"; sometimes you might need to | 61 | The memory buffer returned is "dma-coherent"; sometimes you might need to |
55 | force a consistent memory access ordering by using memory barriers. It's | 62 | force a consistent memory access ordering by using memory barriers. It's |
56 | not using a streaming DMA mapping, so it's good for small transfers on | 63 | not using a streaming DMA mapping, so it's good for small transfers on |
57 | systems where the I/O would otherwise tie up an IOMMU mapping. (See | 64 | systems where the I/O would otherwise thrash an IOMMU mapping. (See |
58 | Documentation/DMA-mapping.txt for definitions of "coherent" and "streaming" | 65 | Documentation/DMA-mapping.txt for definitions of "coherent" and "streaming" |
59 | DMA mappings.) | 66 | DMA mappings.) |
60 | 67 | ||
61 | Asking for 1/Nth of a page (as well as asking for N pages) is reasonably | 68 | Asking for 1/Nth of a page (as well as asking for N pages) is reasonably |
62 | space-efficient. | 69 | space-efficient. |
63 | 70 | ||
71 | On most systems the memory returned will be uncached, because the | ||
72 | semantics of dma-coherent memory require either bypassing CPU caches | ||
73 | or using cache hardware with bus-snooping support. While x86 hardware | ||
74 | has such bus-snooping, many other systems use software to flush cache | ||
75 | lines to prevent DMA conflicts. | ||
76 | |||
64 | - Devices on some EHCI controllers could handle DMA to/from high memory. | 77 | - Devices on some EHCI controllers could handle DMA to/from high memory. |
65 | Driver probe() routines can notice this using a generic DMA call, then | ||
66 | tell higher level code (network, scsi, etc) about it like this: | ||
67 | 78 | ||
68 | if (dma_supported (&intf->dev, 0xffffffffffffffffULL)) | 79 | Unfortunately, the current Linux DMA infrastructure doesn't have a sane |
69 | net->features |= NETIF_F_HIGHDMA; | 80 | way to expose these capabilities ... and in any case, HIGHMEM is mostly a |
81 | design wart specific to x86_32. So your best bet is to ensure you never | ||
82 | pass a highmem buffer into a USB driver. That's easy; it's the default | ||
83 | behavior. Just don't override it; e.g. with NETIF_F_HIGHDMA. | ||
70 | 84 | ||
71 | That can eliminate dma bounce buffering of requests that originate (or | 85 | This may force your callers to do some bounce buffering, copying from |
72 | terminate) in high memory, in cases where the buffers aren't allocated | 86 | high memory to "normal" DMA memory. If you can come up with a good way |
73 | with usb_buffer_alloc() but instead are dma-mapped. | 87 | to fix this issue (for x86_32 machines with over 1 GByte of memory), |
88 | feel free to submit patches. | ||
74 | 89 | ||
75 | 90 | ||
76 | WORKING WITH EXISTING BUFFERS | 91 | WORKING WITH EXISTING BUFFERS |
77 | 92 | ||
78 | Existing buffers aren't usable for DMA without first being mapped into the | 93 | Existing buffers aren't usable for DMA without first being mapped into the |
79 | DMA address space of the device. | 94 | DMA address space of the device. However, most buffers passed to your |
95 | driver can safely be used with such DMA mapping. (See the first section | ||
96 | of DMA-mapping.txt, titled "What memory is DMA-able?") | ||
80 | 97 | ||
81 | - When you're using scatterlists, you can map everything at once. On some | 98 | - When you're using scatterlists, you can map everything at once. On some |
82 | systems, this kicks in an IOMMU and turns the scatterlists into single | 99 | systems, this kicks in an IOMMU and turns the scatterlists into single |
@@ -114,3 +131,8 @@ DMA address space of the device. | |||
114 | The calls manage urb->transfer_dma for you, and set URB_NO_TRANSFER_DMA_MAP | 131 | The calls manage urb->transfer_dma for you, and set URB_NO_TRANSFER_DMA_MAP |
115 | so that usbcore won't map or unmap the buffer. The same goes for | 132 | so that usbcore won't map or unmap the buffer. The same goes for |
116 | urb->setup_dma and URB_NO_SETUP_DMA_MAP for control requests. | 133 | urb->setup_dma and URB_NO_SETUP_DMA_MAP for control requests. |
134 | |||
135 | Note that several of those interfaces are currently commented out, since | ||
136 | they don't have current users. See the source code. Other than the dmasync | ||
137 | calls (where the underlying DMA primitives have changed), most of them can | ||
138 | easily be commented back in if you want to use them. | ||
diff --git a/Documentation/usb/persist.txt b/Documentation/usb/persist.txt new file mode 100644 index 000000000000..df54d645cbb5 --- /dev/null +++ b/Documentation/usb/persist.txt | |||
@@ -0,0 +1,156 @@ | |||
1 | USB device persistence during system suspend | ||
2 | |||
3 | Alan Stern <stern@rowland.harvard.edu> | ||
4 | |||
5 | September 2, 2006 (Updated May 29, 2007) | ||
6 | |||
7 | |||
8 | What is the problem? | ||
9 | |||
10 | According to the USB specification, when a USB bus is suspended the | ||
11 | bus must continue to supply suspend current (around 1-5 mA). This | ||
12 | is so that devices can maintain their internal state and hubs can | ||
13 | detect connect-change events (devices being plugged in or unplugged). | ||
14 | The technical term is "power session". | ||
15 | |||
16 | If a USB device's power session is interrupted then the system is | ||
17 | required to behave as though the device has been unplugged. It's a | ||
18 | conservative approach; in the absence of suspend current the computer | ||
19 | has no way to know what has actually happened. Perhaps the same | ||
20 | device is still attached or perhaps it was removed and a different | ||
21 | device plugged into the port. The system must assume the worst. | ||
22 | |||
23 | By default, Linux behaves according to the spec. If a USB host | ||
24 | controller loses power during a system suspend, then when the system | ||
25 | wakes up all the devices attached to that controller are treated as | ||
26 | though they had disconnected. This is always safe and it is the | ||
27 | "officially correct" thing to do. | ||
28 | |||
29 | For many sorts of devices this behavior doesn't matter in the least. | ||
30 | If the kernel wants to believe that your USB keyboard was unplugged | ||
31 | while the system was asleep and a new keyboard was plugged in when the | ||
32 | system woke up, who cares? It'll still work the same when you type on | ||
33 | it. | ||
34 | |||
35 | Unfortunately problems _can_ arise, particularly with mass-storage | ||
36 | devices. The effect is exactly the same as if the device really had | ||
37 | been unplugged while the system was suspended. If you had a mounted | ||
38 | filesystem on the device, you're out of luck -- everything in that | ||
39 | filesystem is now inaccessible. This is especially annoying if your | ||
40 | root filesystem was located on the device, since your system will | ||
41 | instantly crash. | ||
42 | |||
43 | Loss of power isn't the only mechanism to worry about. Anything that | ||
44 | interrupts a power session will have the same effect. For example, | ||
45 | even though suspend current may have been maintained while the system | ||
46 | was asleep, on many systems during the initial stages of wakeup the | ||
47 | firmware (i.e., the BIOS) resets the motherboard's USB host | ||
48 | controllers. Result: all the power sessions are destroyed and again | ||
49 | it's as though you had unplugged all the USB devices. Yes, it's | ||
50 | entirely the BIOS's fault, but that doesn't do _you_ any good unless | ||
51 | you can convince the BIOS supplier to fix the problem (lots of luck!). | ||
52 | |||
53 | On many systems the USB host controllers will get reset after a | ||
54 | suspend-to-RAM. On almost all systems, no suspend current is | ||
55 | available during hibernation (also known as swsusp or suspend-to-disk). | ||
56 | You can check the kernel log after resuming to see if either of these | ||
57 | has happened; look for lines saying "root hub lost power or was reset". | ||
58 | |||
59 | In practice, people are forced to unmount any filesystems on a USB | ||
60 | device before suspending. If the root filesystem is on a USB device, | ||
61 | the system can't be suspended at all. (All right, it _can_ be | ||
62 | suspended -- but it will crash as soon as it wakes up, which isn't | ||
63 | much better.) | ||
64 | |||
65 | |||
66 | What is the solution? | ||
67 | |||
68 | Setting CONFIG_USB_PERSIST will cause the kernel to work around these | ||
69 | issues. It enables a mode in which the core USB device data | ||
70 | structures are allowed to persist across a power-session disruption. | ||
71 | It works like this. If the kernel sees that a USB host controller is | ||
72 | not in the expected state during resume (i.e., if the controller was | ||
73 | reset or otherwise had lost power) then it applies a persistence check | ||
74 | to each of the USB devices below that controller for which the | ||
75 | "persist" attribute is set. It doesn't try to resume the device; that | ||
76 | can't work once the power session is gone. Instead it issues a USB | ||
77 | port reset and then re-enumerates the device. (This is exactly the | ||
78 | same thing that happens whenever a USB device is reset.) If the | ||
79 | re-enumeration shows that the device now attached to that port has the | ||
80 | same descriptors as before, including the Vendor and Product IDs, then | ||
81 | the kernel continues to use the same device structure. In effect, the | ||
82 | kernel treats the device as though it had merely been reset instead of | ||
83 | unplugged. | ||
84 | |||
85 | If no device is now attached to the port, or if the descriptors are | ||
86 | different from what the kernel remembers, then the treatment is what | ||
87 | you would expect. The kernel destroys the old device structure and | ||
88 | behaves as though the old device had been unplugged and a new device | ||
89 | plugged in, just as it would without the CONFIG_USB_PERSIST option. | ||
90 | |||
91 | The end result is that the USB device remains available and usable. | ||
92 | Filesystem mounts and memory mappings are unaffected, and the world is | ||
93 | now a good and happy place. | ||
94 | |||
95 | Note that even when CONFIG_USB_PERSIST is set, the "persist" feature | ||
96 | will be applied only to those devices for which it is enabled. You | ||
97 | can enable the feature by doing (as root): | ||
98 | |||
99 | echo 1 >/sys/bus/usb/devices/.../power/persist | ||
100 | |||
101 | where the "..." should be filled in the with the device's ID. Disable | ||
102 | the feature by writing 0 instead of 1. For hubs the feature is | ||
103 | automatically and permanently enabled, so you only have to worry about | ||
104 | setting it for devices where it really matters. | ||
105 | |||
106 | |||
107 | Is this the best solution? | ||
108 | |||
109 | Perhaps not. Arguably, keeping track of mounted filesystems and | ||
110 | memory mappings across device disconnects should be handled by a | ||
111 | centralized Logical Volume Manager. Such a solution would allow you | ||
112 | to plug in a USB flash device, create a persistent volume associated | ||
113 | with it, unplug the flash device, plug it back in later, and still | ||
114 | have the same persistent volume associated with the device. As such | ||
115 | it would be more far-reaching than CONFIG_USB_PERSIST. | ||
116 | |||
117 | On the other hand, writing a persistent volume manager would be a big | ||
118 | job and using it would require significant input from the user. This | ||
119 | solution is much quicker and easier -- and it exists now, a giant | ||
120 | point in its favor! | ||
121 | |||
122 | Furthermore, the USB_PERSIST option applies to _all_ USB devices, not | ||
123 | just mass-storage devices. It might turn out to be equally useful for | ||
124 | other device types, such as network interfaces. | ||
125 | |||
126 | |||
127 | WARNING: Using CONFIG_USB_PERSIST can be dangerous!! | ||
128 | |||
129 | When recovering an interrupted power session the kernel does its best | ||
130 | to make sure the USB device hasn't been changed; that is, the same | ||
131 | device is still plugged into the port as before. But the checks | ||
132 | aren't guaranteed to be 100% accurate. | ||
133 | |||
134 | If you replace one USB device with another of the same type (same | ||
135 | manufacturer, same IDs, and so on) there's an excellent chance the | ||
136 | kernel won't detect the change. Serial numbers and other strings are | ||
137 | not compared. In many cases it wouldn't help if they were, because | ||
138 | manufacturers frequently omit serial numbers entirely in their | ||
139 | devices. | ||
140 | |||
141 | Furthermore it's quite possible to leave a USB device exactly the same | ||
142 | while changing its media. If you replace the flash memory card in a | ||
143 | USB card reader while the system is asleep, the kernel will have no | ||
144 | way to know you did it. The kernel will assume that nothing has | ||
145 | happened and will continue to use the partition tables, inodes, and | ||
146 | memory mappings for the old card. | ||
147 | |||
148 | If the kernel gets fooled in this way, it's almost certain to cause | ||
149 | data corruption and to crash your system. You'll have no one to blame | ||
150 | but yourself. | ||
151 | |||
152 | YOU HAVE BEEN WARNED! USE AT YOUR OWN RISK! | ||
153 | |||
154 | That having been said, most of the time there shouldn't be any trouble | ||
155 | at all. The "persist" feature can be extremely useful. Make the most | ||
156 | of it. | ||
diff --git a/Documentation/vm/hugetlbpage.txt b/Documentation/vm/hugetlbpage.txt index 687104bfd09a..51ccc48aa763 100644 --- a/Documentation/vm/hugetlbpage.txt +++ b/Documentation/vm/hugetlbpage.txt | |||
@@ -77,8 +77,9 @@ If the user applications are going to request hugepages using mmap system | |||
77 | call, then it is required that system administrator mount a file system of | 77 | call, then it is required that system administrator mount a file system of |
78 | type hugetlbfs: | 78 | type hugetlbfs: |
79 | 79 | ||
80 | mount none /mnt/huge -t hugetlbfs <uid=value> <gid=value> <mode=value> | 80 | mount -t hugetlbfs \ |
81 | <size=value> <nr_inodes=value> | 81 | -o uid=<value>,gid=<value>,mode=<value>,size=<value>,nr_inodes=<value> \ |
82 | none /mnt/huge | ||
82 | 83 | ||
83 | This command mounts a (pseudo) filesystem of type hugetlbfs on the directory | 84 | This command mounts a (pseudo) filesystem of type hugetlbfs on the directory |
84 | /mnt/huge. Any files created on /mnt/huge uses hugepages. The uid and gid | 85 | /mnt/huge. Any files created on /mnt/huge uses hugepages. The uid and gid |
@@ -88,11 +89,10 @@ mode of root of file system to value & 0777. This value is given in octal. | |||
88 | By default the value 0755 is picked. The size option sets the maximum value of | 89 | By default the value 0755 is picked. The size option sets the maximum value of |
89 | memory (huge pages) allowed for that filesystem (/mnt/huge). The size is | 90 | memory (huge pages) allowed for that filesystem (/mnt/huge). The size is |
90 | rounded down to HPAGE_SIZE. The option nr_inodes sets the maximum number of | 91 | rounded down to HPAGE_SIZE. The option nr_inodes sets the maximum number of |
91 | inodes that /mnt/huge can use. If the size or nr_inodes options are not | 92 | inodes that /mnt/huge can use. If the size or nr_inodes option is not |
92 | provided on command line then no limits are set. For size and nr_inodes | 93 | provided on command line then no limits are set. For size and nr_inodes |
93 | options, you can use [G|g]/[M|m]/[K|k] to represent giga/mega/kilo. For | 94 | options, you can use [G|g]/[M|m]/[K|k] to represent giga/mega/kilo. For |
94 | example, size=2K has the same meaning as size=2048. An example is given at | 95 | example, size=2K has the same meaning as size=2048. |
95 | the end of this document. | ||
96 | 96 | ||
97 | read and write system calls are not supported on files that reside on hugetlb | 97 | read and write system calls are not supported on files that reside on hugetlb |
98 | file systems. | 98 | file systems. |
diff --git a/Documentation/vm/slub.txt b/Documentation/vm/slub.txt index 1523320abd87..df812b03b65d 100644 --- a/Documentation/vm/slub.txt +++ b/Documentation/vm/slub.txt | |||
@@ -41,6 +41,8 @@ Possible debug options are | |||
41 | P Poisoning (object and padding) | 41 | P Poisoning (object and padding) |
42 | U User tracking (free and alloc) | 42 | U User tracking (free and alloc) |
43 | T Trace (please only use on single slabs) | 43 | T Trace (please only use on single slabs) |
44 | - Switch all debugging off (useful if the kernel is | ||
45 | configured with CONFIG_SLUB_DEBUG_ON) | ||
44 | 46 | ||
45 | F.e. in order to boot just with sanity checks and red zoning one would specify: | 47 | F.e. in order to boot just with sanity checks and red zoning one would specify: |
46 | 48 | ||