diff options
Diffstat (limited to 'Documentation')
36 files changed, 2460 insertions, 255 deletions
diff --git a/Documentation/DocBook/mcabook.tmpl b/Documentation/DocBook/mcabook.tmpl index 4367f4642f3d..42a760cd7467 100644 --- a/Documentation/DocBook/mcabook.tmpl +++ b/Documentation/DocBook/mcabook.tmpl | |||
@@ -96,7 +96,7 @@ | |||
96 | 96 | ||
97 | <chapter id="pubfunctions"> | 97 | <chapter id="pubfunctions"> |
98 | <title>Public Functions Provided</title> | 98 | <title>Public Functions Provided</title> |
99 | !Earch/i386/kernel/mca.c | 99 | !Edrivers/mca/mca-legacy.c |
100 | </chapter> | 100 | </chapter> |
101 | 101 | ||
102 | <chapter id="dmafunctions"> | 102 | <chapter id="dmafunctions"> |
diff --git a/Documentation/IPMI.txt b/Documentation/IPMI.txt index 84d3d4d10c17..bf1cf98d2a27 100644 --- a/Documentation/IPMI.txt +++ b/Documentation/IPMI.txt | |||
@@ -605,12 +605,13 @@ is in the ipmi_poweroff module. When the system requests a powerdown, | |||
605 | it will send the proper IPMI commands to do this. This is supported on | 605 | it will send the proper IPMI commands to do this. This is supported on |
606 | several platforms. | 606 | several platforms. |
607 | 607 | ||
608 | There is a module parameter named "poweroff_control" that may either be zero | 608 | There is a module parameter named "poweroff_powercycle" that may |
609 | (do a power down) or 2 (do a power cycle, power the system off, then power | 609 | either be zero (do a power down) or non-zero (do a power cycle, power |
610 | it on in a few seconds). Setting ipmi_poweroff.poweroff_control=x will do | 610 | the system off, then power it on in a few seconds). Setting |
611 | the same thing on the kernel command line. The parameter is also available | 611 | ipmi_poweroff.poweroff_control=x will do the same thing on the kernel |
612 | via the proc filesystem in /proc/ipmi/poweroff_control. Note that if the | 612 | command line. The parameter is also available via the proc filesystem |
613 | system does not support power cycling, it will always to the power off. | 613 | in /proc/sys/dev/ipmi/poweroff_powercycle. Note that if the system |
614 | does not support power cycling, it will always do the power off. | ||
614 | 615 | ||
615 | Note that if you have ACPI enabled, the system will prefer using ACPI to | 616 | Note that if you have ACPI enabled, the system will prefer using ACPI to |
616 | power off. | 617 | power off. |
diff --git a/Documentation/RCU/NMI-RCU.txt b/Documentation/RCU/NMI-RCU.txt new file mode 100644 index 000000000000..d0634a5c3445 --- /dev/null +++ b/Documentation/RCU/NMI-RCU.txt | |||
@@ -0,0 +1,112 @@ | |||
1 | Using RCU to Protect Dynamic NMI Handlers | ||
2 | |||
3 | |||
4 | Although RCU is usually used to protect read-mostly data structures, | ||
5 | it is possible to use RCU to provide dynamic non-maskable interrupt | ||
6 | handlers, as well as dynamic irq handlers. This document describes | ||
7 | how to do this, drawing loosely from Zwane Mwaikambo's NMI-timer | ||
8 | work in "arch/i386/oprofile/nmi_timer_int.c" and in | ||
9 | "arch/i386/kernel/traps.c". | ||
10 | |||
11 | The relevant pieces of code are listed below, each followed by a | ||
12 | brief explanation. | ||
13 | |||
14 | static int dummy_nmi_callback(struct pt_regs *regs, int cpu) | ||
15 | { | ||
16 | return 0; | ||
17 | } | ||
18 | |||
19 | The dummy_nmi_callback() function is a "dummy" NMI handler that does | ||
20 | nothing, but returns zero, thus saying that it did nothing, allowing | ||
21 | the NMI handler to take the default machine-specific action. | ||
22 | |||
23 | static nmi_callback_t nmi_callback = dummy_nmi_callback; | ||
24 | |||
25 | This nmi_callback variable is a global function pointer to the current | ||
26 | NMI handler. | ||
27 | |||
28 | fastcall void do_nmi(struct pt_regs * regs, long error_code) | ||
29 | { | ||
30 | int cpu; | ||
31 | |||
32 | nmi_enter(); | ||
33 | |||
34 | cpu = smp_processor_id(); | ||
35 | ++nmi_count(cpu); | ||
36 | |||
37 | if (!rcu_dereference(nmi_callback)(regs, cpu)) | ||
38 | default_do_nmi(regs); | ||
39 | |||
40 | nmi_exit(); | ||
41 | } | ||
42 | |||
43 | The do_nmi() function processes each NMI. It first disables preemption | ||
44 | in the same way that a hardware irq would, then increments the per-CPU | ||
45 | count of NMIs. It then invokes the NMI handler stored in the nmi_callback | ||
46 | function pointer. If this handler returns zero, do_nmi() invokes the | ||
47 | default_do_nmi() function to handle a machine-specific NMI. Finally, | ||
48 | preemption is restored. | ||
49 | |||
50 | Strictly speaking, rcu_dereference() is not needed, since this code runs | ||
51 | only on i386, which does not need rcu_dereference() anyway. However, | ||
52 | it is a good documentation aid, particularly for anyone attempting to | ||
53 | do something similar on Alpha. | ||
54 | |||
55 | Quick Quiz: Why might the rcu_dereference() be necessary on Alpha, | ||
56 | given that the code referenced by the pointer is read-only? | ||
57 | |||
58 | |||
59 | Back to the discussion of NMI and RCU... | ||
60 | |||
61 | void set_nmi_callback(nmi_callback_t callback) | ||
62 | { | ||
63 | rcu_assign_pointer(nmi_callback, callback); | ||
64 | } | ||
65 | |||
66 | The set_nmi_callback() function registers an NMI handler. Note that any | ||
67 | data that is to be used by the callback must be initialized up -before- | ||
68 | the call to set_nmi_callback(). On architectures that do not order | ||
69 | writes, the rcu_assign_pointer() ensures that the NMI handler sees the | ||
70 | initialized values. | ||
71 | |||
72 | void unset_nmi_callback(void) | ||
73 | { | ||
74 | rcu_assign_pointer(nmi_callback, dummy_nmi_callback); | ||
75 | } | ||
76 | |||
77 | This function unregisters an NMI handler, restoring the original | ||
78 | dummy_nmi_handler(). However, there may well be an NMI handler | ||
79 | currently executing on some other CPU. We therefore cannot free | ||
80 | up any data structures used by the old NMI handler until execution | ||
81 | of it completes on all other CPUs. | ||
82 | |||
83 | One way to accomplish this is via synchronize_sched(), perhaps as | ||
84 | follows: | ||
85 | |||
86 | unset_nmi_callback(); | ||
87 | synchronize_sched(); | ||
88 | kfree(my_nmi_data); | ||
89 | |||
90 | This works because synchronize_sched() blocks until all CPUs complete | ||
91 | any preemption-disabled segments of code that they were executing. | ||
92 | Since NMI handlers disable preemption, synchronize_sched() is guaranteed | ||
93 | not to return until all ongoing NMI handlers exit. It is therefore safe | ||
94 | to free up the handler's data as soon as synchronize_sched() returns. | ||
95 | |||
96 | |||
97 | Answer to Quick Quiz | ||
98 | |||
99 | Why might the rcu_dereference() be necessary on Alpha, given | ||
100 | that the code referenced by the pointer is read-only? | ||
101 | |||
102 | Answer: The caller to set_nmi_callback() might well have | ||
103 | initialized some data that is to be used by the | ||
104 | new NMI handler. In this case, the rcu_dereference() | ||
105 | would be needed, because otherwise a CPU that received | ||
106 | an NMI just after the new handler was set might see | ||
107 | the pointer to the new NMI handler, but the old | ||
108 | pre-initialized version of the handler's data. | ||
109 | |||
110 | More important, the rcu_dereference() makes it clear | ||
111 | to someone reading the code that the pointer is being | ||
112 | protected by RCU. | ||
diff --git a/Documentation/cdrom/sonycd535 b/Documentation/cdrom/sonycd535 index 59581a4b302a..b81e109970aa 100644 --- a/Documentation/cdrom/sonycd535 +++ b/Documentation/cdrom/sonycd535 | |||
@@ -68,7 +68,8 @@ it a better device citizen. Further thanks to Joel Katz | |||
68 | Porfiri Claudio <C.Porfiri@nisms.tei.ericsson.se> for patches | 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 | 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 | 70 | Heiko Eissfeldt <heiko@colossus.escape.de> for pointing out that |
71 | the verify_area() checks were ignoring the results of said checks. | 71 | the verify_area() checks were ignoring the results of said checks |
72 | (note: verify_area() has since been replaced by access_ok()). | ||
72 | 73 | ||
73 | (Acknowledgments from Ron Jeppesen in the 0.3 release:) | 74 | (Acknowledgments from Ron Jeppesen in the 0.3 release:) |
74 | Thanks to Corey Minyard who wrote the original CDU-31A driver on which | 75 | Thanks to Corey Minyard who wrote the original CDU-31A driver on which |
diff --git a/Documentation/cpusets.txt b/Documentation/cpusets.txt index ad944c060312..47f4114fbf54 100644 --- a/Documentation/cpusets.txt +++ b/Documentation/cpusets.txt | |||
@@ -60,6 +60,18 @@ all of the cpus in the system. This removes any overhead due to | |||
60 | load balancing code trying to pull tasks outside of the cpu exclusive | 60 | load balancing code trying to pull tasks outside of the cpu exclusive |
61 | cpuset only to be prevented by the tasks' cpus_allowed mask. | 61 | cpuset only to be prevented by the tasks' cpus_allowed mask. |
62 | 62 | ||
63 | A cpuset that is mem_exclusive restricts kernel allocations for | ||
64 | page, buffer and other data commonly shared by the kernel across | ||
65 | multiple users. All cpusets, whether mem_exclusive or not, restrict | ||
66 | allocations of memory for user space. This enables configuring a | ||
67 | system so that several independent jobs can share common kernel | ||
68 | data, such as file system pages, while isolating each jobs user | ||
69 | allocation in its own cpuset. To do this, construct a large | ||
70 | mem_exclusive cpuset to hold all the jobs, and construct child, | ||
71 | non-mem_exclusive cpusets for each individual job. Only a small | ||
72 | amount of typical kernel memory, such as requests from interrupt | ||
73 | handlers, is allowed to be taken outside even a mem_exclusive cpuset. | ||
74 | |||
63 | User level code may create and destroy cpusets by name in the cpuset | 75 | User level code may create and destroy cpusets by name in the cpuset |
64 | virtual file system, manage the attributes and permissions of these | 76 | virtual file system, manage the attributes and permissions of these |
65 | cpusets and which CPUs and Memory Nodes are assigned to each cpuset, | 77 | cpusets and which CPUs and Memory Nodes are assigned to each cpuset, |
diff --git a/Documentation/crypto/api-intro.txt b/Documentation/crypto/api-intro.txt index a2d5b4900772..74dffc68ff9f 100644 --- a/Documentation/crypto/api-intro.txt +++ b/Documentation/crypto/api-intro.txt | |||
@@ -223,6 +223,7 @@ CAST5 algorithm contributors: | |||
223 | 223 | ||
224 | TEA/XTEA algorithm contributors: | 224 | TEA/XTEA algorithm contributors: |
225 | Aaron Grothe | 225 | Aaron Grothe |
226 | Michael Ringe | ||
226 | 227 | ||
227 | Khazad algorithm contributors: | 228 | Khazad algorithm contributors: |
228 | Aaron Grothe | 229 | Aaron Grothe |
diff --git a/Documentation/dcdbas.txt b/Documentation/dcdbas.txt new file mode 100644 index 000000000000..e1c52e2dc361 --- /dev/null +++ b/Documentation/dcdbas.txt | |||
@@ -0,0 +1,91 @@ | |||
1 | Overview | ||
2 | |||
3 | The Dell Systems Management Base Driver provides a sysfs interface for | ||
4 | systems management software such as Dell OpenManage to perform system | ||
5 | management interrupts and host control actions (system power cycle or | ||
6 | power off after OS shutdown) on certain Dell systems. | ||
7 | |||
8 | Dell OpenManage requires this driver on the following Dell PowerEdge systems: | ||
9 | 300, 1300, 1400, 400SC, 500SC, 1500SC, 1550, 600SC, 1600SC, 650, 1655MC, | ||
10 | 700, and 750. Other Dell software such as the open source libsmbios project | ||
11 | is expected to make use of this driver, and it may include the use of this | ||
12 | driver on other Dell systems. | ||
13 | |||
14 | The Dell libsmbios project aims towards providing access to as much BIOS | ||
15 | information as possible. See http://linux.dell.com/libsmbios/main/ for | ||
16 | more information about the libsmbios project. | ||
17 | |||
18 | |||
19 | System Management Interrupt | ||
20 | |||
21 | On some Dell systems, systems management software must access certain | ||
22 | management information via a system management interrupt (SMI). The SMI data | ||
23 | buffer must reside in 32-bit address space, and the physical address of the | ||
24 | buffer is required for the SMI. The driver maintains the memory required for | ||
25 | the SMI and provides a way for the application to generate the SMI. | ||
26 | The driver creates the following sysfs entries for systems management | ||
27 | software to perform these system management interrupts: | ||
28 | |||
29 | /sys/devices/platform/dcdbas/smi_data | ||
30 | /sys/devices/platform/dcdbas/smi_data_buf_phys_addr | ||
31 | /sys/devices/platform/dcdbas/smi_data_buf_size | ||
32 | /sys/devices/platform/dcdbas/smi_request | ||
33 | |||
34 | Systems management software must perform the following steps to execute | ||
35 | a SMI using this driver: | ||
36 | |||
37 | 1) Lock smi_data. | ||
38 | 2) Write system management command to smi_data. | ||
39 | 3) Write "1" to smi_request to generate a calling interface SMI or | ||
40 | "2" to generate a raw SMI. | ||
41 | 4) Read system management command response from smi_data. | ||
42 | 5) Unlock smi_data. | ||
43 | |||
44 | |||
45 | Host Control Action | ||
46 | |||
47 | Dell OpenManage supports a host control feature that allows the administrator | ||
48 | to perform a power cycle or power off of the system after the OS has finished | ||
49 | shutting down. On some Dell systems, this host control feature requires that | ||
50 | a driver perform a SMI after the OS has finished shutting down. | ||
51 | |||
52 | The driver creates the following sysfs entries for systems management software | ||
53 | to schedule the driver to perform a power cycle or power off host control | ||
54 | action after the system has finished shutting down: | ||
55 | |||
56 | /sys/devices/platform/dcdbas/host_control_action | ||
57 | /sys/devices/platform/dcdbas/host_control_smi_type | ||
58 | /sys/devices/platform/dcdbas/host_control_on_shutdown | ||
59 | |||
60 | Dell OpenManage performs the following steps to execute a power cycle or | ||
61 | power off host control action using this driver: | ||
62 | |||
63 | 1) Write host control action to be performed to host_control_action. | ||
64 | 2) Write type of SMI that driver needs to perform to host_control_smi_type. | ||
65 | 3) Write "1" to host_control_on_shutdown to enable host control action. | ||
66 | 4) Initiate OS shutdown. | ||
67 | (Driver will perform host control SMI when it is notified that the OS | ||
68 | has finished shutting down.) | ||
69 | |||
70 | |||
71 | Host Control SMI Type | ||
72 | |||
73 | The following table shows the value to write to host_control_smi_type to | ||
74 | perform a power cycle or power off host control action: | ||
75 | |||
76 | PowerEdge System Host Control SMI Type | ||
77 | ---------------- --------------------- | ||
78 | 300 HC_SMITYPE_TYPE1 | ||
79 | 1300 HC_SMITYPE_TYPE1 | ||
80 | 1400 HC_SMITYPE_TYPE2 | ||
81 | 500SC HC_SMITYPE_TYPE2 | ||
82 | 1500SC HC_SMITYPE_TYPE2 | ||
83 | 1550 HC_SMITYPE_TYPE2 | ||
84 | 600SC HC_SMITYPE_TYPE2 | ||
85 | 1600SC HC_SMITYPE_TYPE2 | ||
86 | 650 HC_SMITYPE_TYPE2 | ||
87 | 1655MC HC_SMITYPE_TYPE2 | ||
88 | 700 HC_SMITYPE_TYPE3 | ||
89 | 750 HC_SMITYPE_TYPE3 | ||
90 | |||
91 | |||
diff --git a/Documentation/dell_rbu.txt b/Documentation/dell_rbu.txt new file mode 100644 index 000000000000..bcfa5c35036b --- /dev/null +++ b/Documentation/dell_rbu.txt | |||
@@ -0,0 +1,74 @@ | |||
1 | Purpose: | ||
2 | Demonstrate the usage of the new open sourced rbu (Remote BIOS Update) driver | ||
3 | for updating BIOS images on Dell servers and desktops. | ||
4 | |||
5 | Scope: | ||
6 | This document discusses the functionality of the rbu driver only. | ||
7 | It does not cover the support needed from aplications to enable the BIOS to | ||
8 | update itself with the image downloaded in to the memory. | ||
9 | |||
10 | Overview: | ||
11 | This driver works with Dell OpenManage or Dell Update Packages for updating | ||
12 | the BIOS on Dell servers (starting from servers sold since 1999), desktops | ||
13 | and notebooks (starting from those sold in 2005). | ||
14 | Please go to http://support.dell.com register and you can find info on | ||
15 | OpenManage and Dell Update packages (DUP). | ||
16 | |||
17 | Dell_RBU driver supports BIOS update using the monilothic image and packetized | ||
18 | image methods. In case of moniolithic the driver allocates a contiguous chunk | ||
19 | of physical pages having the BIOS image. In case of packetized the app | ||
20 | using the driver breaks the image in to packets of fixed sizes and the driver | ||
21 | would place each packet in contiguous physical memory. The driver also | ||
22 | maintains a link list of packets for reading them back. | ||
23 | If the dell_rbu driver is unloaded all the allocated memory is freed. | ||
24 | |||
25 | The rbu driver needs to have an application which will inform the BIOS to | ||
26 | enable the update in the next system reboot. | ||
27 | |||
28 | The user should not unload the rbu driver after downloading the BIOS image | ||
29 | or updating. | ||
30 | |||
31 | The driver load creates the following directories under the /sys file system. | ||
32 | /sys/class/firmware/dell_rbu/loading | ||
33 | /sys/class/firmware/dell_rbu/data | ||
34 | /sys/devices/platform/dell_rbu/image_type | ||
35 | /sys/devices/platform/dell_rbu/data | ||
36 | |||
37 | The driver supports two types of update mechanism; monolithic and packetized. | ||
38 | These update mechanism depends upon the BIOS currently running on the system. | ||
39 | Most of the Dell systems support a monolithic update where the BIOS image is | ||
40 | copied to a single contiguous block of physical memory. | ||
41 | In case of packet mechanism the single memory can be broken in smaller chuks | ||
42 | of contiguous memory and the BIOS image is scattered in these packets. | ||
43 | |||
44 | By default the driver uses monolithic memory for the update type. This can be | ||
45 | changed to contiguous during the driver load time by specifying the load | ||
46 | parameter image_type=packet. This can also be changed later as below | ||
47 | echo packet > /sys/devices/platform/dell_rbu/image_type | ||
48 | |||
49 | Do the steps below to download the BIOS image. | ||
50 | 1) echo 1 > /sys/class/firmware/dell_rbu/loading | ||
51 | 2) cp bios_image.hdr /sys/class/firmware/dell_rbu/data | ||
52 | 3) echo 0 > /sys/class/firmware/dell_rbu/loading | ||
53 | |||
54 | The /sys/class/firmware/dell_rbu/ entries will remain till the following is | ||
55 | done. | ||
56 | echo -1 > /sys/class/firmware/dell_rbu/loading | ||
57 | |||
58 | Until this step is completed the drivr cannot be unloaded. | ||
59 | |||
60 | Also the driver provides /sys/devices/platform/dell_rbu/data readonly file to | ||
61 | read back the image downloaded. This is useful in case of packet update | ||
62 | mechanism where the above steps 1,2,3 will repeated for every packet. | ||
63 | By reading the /sys/devices/platform/dell_rbu/data file all packet data | ||
64 | downloaded can be verified in a single file. | ||
65 | The packets are arranged in this file one after the other in a FIFO order. | ||
66 | |||
67 | NOTE: | ||
68 | This driver requires a patch for firmware_class.c which has the addition | ||
69 | of request_firmware_nowait_nohotplug function to wortk | ||
70 | Also after updating the BIOS image an user mdoe application neeeds to execute | ||
71 | code which message the BIOS update request to the BIOS. So on the next reboot | ||
72 | the BIOS knows about the new image downloaded and it updates it self. | ||
73 | Also don't unload the rbu drive if the image has to be updated. | ||
74 | |||
diff --git a/Documentation/dvb/bt8xx.txt b/Documentation/dvb/bt8xx.txt index e6b8d05bc08d..4b8c326c6aac 100644 --- a/Documentation/dvb/bt8xx.txt +++ b/Documentation/dvb/bt8xx.txt | |||
@@ -16,7 +16,7 @@ Enable the following options: | |||
16 | "Device drivers" => "Multimedia devices" | 16 | "Device drivers" => "Multimedia devices" |
17 | => "Video For Linux" => "BT848 Video For Linux" | 17 | => "Video For Linux" => "BT848 Video For Linux" |
18 | "Device drivers" => "Multimedia devices" => "Digital Video Broadcasting Devices" | 18 | "Device drivers" => "Multimedia devices" => "Digital Video Broadcasting Devices" |
19 | => "DVB for Linux" "DVB Core Support" "Nebula/Pinnacle PCTV/TwinHan PCI Cards" | 19 | => "DVB for Linux" "DVB Core Support" "BT8xx based PCI cards" |
20 | 20 | ||
21 | 3) Loading Modules, described by two approaches | 21 | 3) Loading Modules, described by two approaches |
22 | =============================================== | 22 | =============================================== |
diff --git a/Documentation/exception.txt b/Documentation/exception.txt index f1d436993eb1..3cb39ade290e 100644 --- a/Documentation/exception.txt +++ b/Documentation/exception.txt | |||
@@ -7,7 +7,7 @@ To protect itself the kernel has to verify this address. | |||
7 | 7 | ||
8 | In older versions of Linux this was done with the | 8 | In older versions of Linux this was done with the |
9 | int verify_area(int type, const void * addr, unsigned long size) | 9 | int verify_area(int type, const void * addr, unsigned long size) |
10 | function. | 10 | function (which has since been replaced by access_ok()). |
11 | 11 | ||
12 | This function verified that the memory area starting at address | 12 | This function verified that the memory area starting at address |
13 | addr and of size size was accessible for the operation specified | 13 | addr and of size size was accessible for the operation specified |
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index 8b1430b46655..2e0a01b21fe0 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt | |||
@@ -51,14 +51,6 @@ Who: Adrian Bunk <bunk@stusta.de> | |||
51 | 51 | ||
52 | --------------------------- | 52 | --------------------------- |
53 | 53 | ||
54 | What: register_ioctl32_conversion() / unregister_ioctl32_conversion() | ||
55 | When: April 2005 | ||
56 | Why: Replaced by ->compat_ioctl in file_operations and other method | ||
57 | vecors. | ||
58 | Who: Andi Kleen <ak@muc.de>, Christoph Hellwig <hch@lst.de> | ||
59 | |||
60 | --------------------------- | ||
61 | |||
62 | What: RCU API moves to EXPORT_SYMBOL_GPL | 54 | What: RCU API moves to EXPORT_SYMBOL_GPL |
63 | When: April 2006 | 55 | When: April 2006 |
64 | Files: include/linux/rcupdate.h, kernel/rcupdate.c | 56 | Files: include/linux/rcupdate.h, kernel/rcupdate.c |
@@ -74,14 +66,6 @@ Who: Paul E. McKenney <paulmck@us.ibm.com> | |||
74 | 66 | ||
75 | --------------------------- | 67 | --------------------------- |
76 | 68 | ||
77 | What: remove verify_area() | ||
78 | When: July 2006 | ||
79 | Files: Various uaccess.h headers. | ||
80 | Why: Deprecated and redundant. access_ok() should be used instead. | ||
81 | Who: Jesper Juhl <juhl-lkml@dif.dk> | ||
82 | |||
83 | --------------------------- | ||
84 | |||
85 | What: IEEE1394 Audio and Music Data Transmission Protocol driver, | 69 | What: IEEE1394 Audio and Music Data Transmission Protocol driver, |
86 | Connection Management Procedures driver | 70 | Connection Management Procedures driver |
87 | When: November 2005 | 71 | When: November 2005 |
@@ -102,16 +86,6 @@ Who: Jody McIntyre <scjody@steamballoon.com> | |||
102 | 86 | ||
103 | --------------------------- | 87 | --------------------------- |
104 | 88 | ||
105 | What: register_serial/unregister_serial | ||
106 | When: September 2005 | ||
107 | Why: This interface does not allow serial ports to be registered against | ||
108 | a struct device, and as such does not allow correct power management | ||
109 | of such ports. 8250-based ports should use serial8250_register_port | ||
110 | and serial8250_unregister_port, or platform devices instead. | ||
111 | Who: Russell King <rmk@arm.linux.org.uk> | ||
112 | |||
113 | --------------------------- | ||
114 | |||
115 | What: i2c sysfs name change: in1_ref, vid deprecated in favour of cpu0_vid | 89 | What: i2c sysfs name change: in1_ref, vid deprecated in favour of cpu0_vid |
116 | When: November 2005 | 90 | When: November 2005 |
117 | Files: drivers/i2c/chips/adm1025.c, drivers/i2c/chips/adm1026.c | 91 | Files: drivers/i2c/chips/adm1025.c, drivers/i2c/chips/adm1026.c |
@@ -135,3 +109,15 @@ Why: With the 16-bit PCMCIA subsystem now behaving (almost) like a | |||
135 | pcmciautils package available at | 109 | pcmciautils package available at |
136 | http://kernel.org/pub/linux/utils/kernel/pcmcia/ | 110 | http://kernel.org/pub/linux/utils/kernel/pcmcia/ |
137 | Who: Dominik Brodowski <linux@brodo.de> | 111 | Who: Dominik Brodowski <linux@brodo.de> |
112 | |||
113 | --------------------------- | ||
114 | |||
115 | What: ip_queue and ip6_queue (old ipv4-only and ipv6-only netfilter queue) | ||
116 | When: December 2005 | ||
117 | Why: This interface has been obsoleted by the new layer3-independent | ||
118 | "nfnetlink_queue". The Kernel interface is compatible, so the old | ||
119 | ip[6]tables "QUEUE" targets still work and will transparently handle | ||
120 | all packets into nfnetlink queue number 0. Userspace users will have | ||
121 | to link against API-compatible library on top of libnfnetlink_queue | ||
122 | instead of the current 'libipq'. | ||
123 | Who: Harald Welte <laforge@netfilter.org> | ||
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt index 6c98f2bd421e..5024ba7a592c 100644 --- a/Documentation/filesystems/proc.txt +++ b/Documentation/filesystems/proc.txt | |||
@@ -133,6 +133,7 @@ Table 1-1: Process specific entries in /proc | |||
133 | statm Process memory status information | 133 | statm Process memory status information |
134 | status Process status in human readable form | 134 | status Process status in human readable form |
135 | wchan If CONFIG_KALLSYMS is set, a pre-decoded wchan | 135 | wchan If CONFIG_KALLSYMS is set, a pre-decoded wchan |
136 | smaps Extension based on maps, presenting the rss size for each mapped file | ||
136 | .............................................................................. | 137 | .............................................................................. |
137 | 138 | ||
138 | For example, to get the status information of a process, all you have to do is | 139 | For example, to get the status information of a process, all you have to do is |
diff --git a/Documentation/filesystems/relayfs.txt b/Documentation/filesystems/relayfs.txt new file mode 100644 index 000000000000..d24e1b0d4f39 --- /dev/null +++ b/Documentation/filesystems/relayfs.txt | |||
@@ -0,0 +1,362 @@ | |||
1 | |||
2 | relayfs - a high-speed data relay filesystem | ||
3 | ============================================ | ||
4 | |||
5 | relayfs is a filesystem designed to provide an efficient mechanism for | ||
6 | tools and facilities to relay large and potentially sustained streams | ||
7 | of data from kernel space to user space. | ||
8 | |||
9 | The main abstraction of relayfs is the 'channel'. A channel consists | ||
10 | of a set of per-cpu kernel buffers each represented by a file in the | ||
11 | relayfs filesystem. Kernel clients write into a channel using | ||
12 | efficient write functions which automatically log to the current cpu's | ||
13 | channel buffer. User space applications mmap() the per-cpu files and | ||
14 | retrieve the data as it becomes available. | ||
15 | |||
16 | The format of the data logged into the channel buffers is completely | ||
17 | up to the relayfs client; relayfs does however provide hooks which | ||
18 | allow clients to impose some stucture on the buffer data. Nor does | ||
19 | relayfs implement any form of data filtering - this also is left to | ||
20 | the client. The purpose is to keep relayfs as simple as possible. | ||
21 | |||
22 | This document provides an overview of the relayfs API. The details of | ||
23 | the function parameters are documented along with the functions in the | ||
24 | filesystem code - please see that for details. | ||
25 | |||
26 | Semantics | ||
27 | ========= | ||
28 | |||
29 | Each relayfs channel has one buffer per CPU, each buffer has one or | ||
30 | more sub-buffers. Messages are written to the first sub-buffer until | ||
31 | it is too full to contain a new message, in which case it it is | ||
32 | written to the next (if available). Messages are never split across | ||
33 | sub-buffers. At this point, userspace can be notified so it empties | ||
34 | the first sub-buffer, while the kernel continues writing to the next. | ||
35 | |||
36 | When notified that a sub-buffer is full, the kernel knows how many | ||
37 | bytes of it are padding i.e. unused. Userspace can use this knowledge | ||
38 | to copy only valid data. | ||
39 | |||
40 | After copying it, userspace can notify the kernel that a sub-buffer | ||
41 | has been consumed. | ||
42 | |||
43 | relayfs can operate in a mode where it will overwrite data not yet | ||
44 | collected by userspace, and not wait for it to consume it. | ||
45 | |||
46 | relayfs itself does not provide for communication of such data between | ||
47 | userspace and kernel, allowing the kernel side to remain simple and not | ||
48 | impose a single interface on userspace. It does provide a separate | ||
49 | helper though, described below. | ||
50 | |||
51 | klog, relay-app & librelay | ||
52 | ========================== | ||
53 | |||
54 | relayfs itself is ready to use, but to make things easier, two | ||
55 | additional systems are provided. klog is a simple wrapper to make | ||
56 | writing formatted text or raw data to a channel simpler, regardless of | ||
57 | whether a channel to write into exists or not, or whether relayfs is | ||
58 | compiled into the kernel or is configured as a module. relay-app is | ||
59 | the kernel counterpart of userspace librelay.c, combined these two | ||
60 | files provide glue to easily stream data to disk, without having to | ||
61 | bother with housekeeping. klog and relay-app can be used together, | ||
62 | with klog providing high-level logging functions to the kernel and | ||
63 | relay-app taking care of kernel-user control and disk-logging chores. | ||
64 | |||
65 | It is possible to use relayfs without relay-app & librelay, but you'll | ||
66 | have to implement communication between userspace and kernel, allowing | ||
67 | both to convey the state of buffers (full, empty, amount of padding). | ||
68 | |||
69 | klog, relay-app and librelay can be found in the relay-apps tarball on | ||
70 | http://relayfs.sourceforge.net | ||
71 | |||
72 | The relayfs user space API | ||
73 | ========================== | ||
74 | |||
75 | relayfs implements basic file operations for user space access to | ||
76 | relayfs channel buffer data. Here are the file operations that are | ||
77 | available and some comments regarding their behavior: | ||
78 | |||
79 | open() enables user to open an _existing_ buffer. | ||
80 | |||
81 | mmap() results in channel buffer being mapped into the caller's | ||
82 | memory space. Note that you can't do a partial mmap - you must | ||
83 | map the entire file, which is NRBUF * SUBBUFSIZE. | ||
84 | |||
85 | read() read the contents of a channel buffer. The bytes read are | ||
86 | 'consumed' by the reader i.e. they won't be available again | ||
87 | to subsequent reads. If the channel is being used in | ||
88 | no-overwrite mode (the default), it can be read at any time | ||
89 | even if there's an active kernel writer. If the channel is | ||
90 | being used in overwrite mode and there are active channel | ||
91 | writers, results may be unpredictable - users should make | ||
92 | sure that all logging to the channel has ended before using | ||
93 | read() with overwrite mode. | ||
94 | |||
95 | poll() POLLIN/POLLRDNORM/POLLERR supported. User applications are | ||
96 | notified when sub-buffer boundaries are crossed. | ||
97 | |||
98 | close() decrements the channel buffer's refcount. When the refcount | ||
99 | reaches 0 i.e. when no process or kernel client has the buffer | ||
100 | open, the channel buffer is freed. | ||
101 | |||
102 | |||
103 | In order for a user application to make use of relayfs files, the | ||
104 | relayfs filesystem must be mounted. For example, | ||
105 | |||
106 | mount -t relayfs relayfs /mnt/relay | ||
107 | |||
108 | NOTE: relayfs doesn't need to be mounted for kernel clients to create | ||
109 | or use channels - it only needs to be mounted when user space | ||
110 | applications need access to the buffer data. | ||
111 | |||
112 | |||
113 | The relayfs kernel API | ||
114 | ====================== | ||
115 | |||
116 | Here's a summary of the API relayfs provides to in-kernel clients: | ||
117 | |||
118 | |||
119 | channel management functions: | ||
120 | |||
121 | relay_open(base_filename, parent, subbuf_size, n_subbufs, | ||
122 | callbacks) | ||
123 | relay_close(chan) | ||
124 | relay_flush(chan) | ||
125 | relay_reset(chan) | ||
126 | relayfs_create_dir(name, parent) | ||
127 | relayfs_remove_dir(dentry) | ||
128 | |||
129 | channel management typically called on instigation of userspace: | ||
130 | |||
131 | relay_subbufs_consumed(chan, cpu, subbufs_consumed) | ||
132 | |||
133 | write functions: | ||
134 | |||
135 | relay_write(chan, data, length) | ||
136 | __relay_write(chan, data, length) | ||
137 | relay_reserve(chan, length) | ||
138 | |||
139 | callbacks: | ||
140 | |||
141 | subbuf_start(buf, subbuf, prev_subbuf, prev_padding) | ||
142 | buf_mapped(buf, filp) | ||
143 | buf_unmapped(buf, filp) | ||
144 | |||
145 | helper functions: | ||
146 | |||
147 | relay_buf_full(buf) | ||
148 | subbuf_start_reserve(buf, length) | ||
149 | |||
150 | |||
151 | Creating a channel | ||
152 | ------------------ | ||
153 | |||
154 | relay_open() is used to create a channel, along with its per-cpu | ||
155 | channel buffers. Each channel buffer will have an associated file | ||
156 | created for it in the relayfs filesystem, which can be opened and | ||
157 | mmapped from user space if desired. The files are named | ||
158 | basename0...basenameN-1 where N is the number of online cpus, and by | ||
159 | default will be created in the root of the filesystem. If you want a | ||
160 | directory structure to contain your relayfs files, you can create it | ||
161 | with relayfs_create_dir() and pass the parent directory to | ||
162 | relay_open(). Clients are responsible for cleaning up any directory | ||
163 | structure they create when the channel is closed - use | ||
164 | relayfs_remove_dir() for that. | ||
165 | |||
166 | The total size of each per-cpu buffer is calculated by multiplying the | ||
167 | number of sub-buffers by the sub-buffer size passed into relay_open(). | ||
168 | The idea behind sub-buffers is that they're basically an extension of | ||
169 | double-buffering to N buffers, and they also allow applications to | ||
170 | easily implement random-access-on-buffer-boundary schemes, which can | ||
171 | be important for some high-volume applications. The number and size | ||
172 | of sub-buffers is completely dependent on the application and even for | ||
173 | the same application, different conditions will warrant different | ||
174 | values for these parameters at different times. Typically, the right | ||
175 | values to use are best decided after some experimentation; in general, | ||
176 | though, it's safe to assume that having only 1 sub-buffer is a bad | ||
177 | idea - you're guaranteed to either overwrite data or lose events | ||
178 | depending on the channel mode being used. | ||
179 | |||
180 | Channel 'modes' | ||
181 | --------------- | ||
182 | |||
183 | relayfs channels can be used in either of two modes - 'overwrite' or | ||
184 | 'no-overwrite'. The mode is entirely determined by the implementation | ||
185 | of the subbuf_start() callback, as described below. In 'overwrite' | ||
186 | mode, also known as 'flight recorder' mode, writes continuously cycle | ||
187 | around the buffer and will never fail, but will unconditionally | ||
188 | overwrite old data regardless of whether it's actually been consumed. | ||
189 | In no-overwrite mode, writes will fail i.e. data will be lost, if the | ||
190 | number of unconsumed sub-buffers equals the total number of | ||
191 | sub-buffers in the channel. It should be clear that if there is no | ||
192 | consumer or if the consumer can't consume sub-buffers fast enought, | ||
193 | data will be lost in either case; the only difference is whether data | ||
194 | is lost from the beginning or the end of a buffer. | ||
195 | |||
196 | As explained above, a relayfs channel is made of up one or more | ||
197 | per-cpu channel buffers, each implemented as a circular buffer | ||
198 | subdivided into one or more sub-buffers. Messages are written into | ||
199 | the current sub-buffer of the channel's current per-cpu buffer via the | ||
200 | write functions described below. Whenever a message can't fit into | ||
201 | the current sub-buffer, because there's no room left for it, the | ||
202 | client is notified via the subbuf_start() callback that a switch to a | ||
203 | new sub-buffer is about to occur. The client uses this callback to 1) | ||
204 | initialize the next sub-buffer if appropriate 2) finalize the previous | ||
205 | sub-buffer if appropriate and 3) return a boolean value indicating | ||
206 | whether or not to actually go ahead with the sub-buffer switch. | ||
207 | |||
208 | To implement 'no-overwrite' mode, the userspace client would provide | ||
209 | an implementation of the subbuf_start() callback something like the | ||
210 | following: | ||
211 | |||
212 | static int subbuf_start(struct rchan_buf *buf, | ||
213 | void *subbuf, | ||
214 | void *prev_subbuf, | ||
215 | unsigned int prev_padding) | ||
216 | { | ||
217 | if (prev_subbuf) | ||
218 | *((unsigned *)prev_subbuf) = prev_padding; | ||
219 | |||
220 | if (relay_buf_full(buf)) | ||
221 | return 0; | ||
222 | |||
223 | subbuf_start_reserve(buf, sizeof(unsigned int)); | ||
224 | |||
225 | return 1; | ||
226 | } | ||
227 | |||
228 | If the current buffer is full i.e. all sub-buffers remain unconsumed, | ||
229 | the callback returns 0 to indicate that the buffer switch should not | ||
230 | occur yet i.e. until the consumer has had a chance to read the current | ||
231 | set of ready sub-buffers. For the relay_buf_full() function to make | ||
232 | sense, the consumer is reponsible for notifying relayfs when | ||
233 | sub-buffers have been consumed via relay_subbufs_consumed(). Any | ||
234 | subsequent attempts to write into the buffer will again invoke the | ||
235 | subbuf_start() callback with the same parameters; only when the | ||
236 | consumer has consumed one or more of the ready sub-buffers will | ||
237 | relay_buf_full() return 0, in which case the buffer switch can | ||
238 | continue. | ||
239 | |||
240 | The implementation of the subbuf_start() callback for 'overwrite' mode | ||
241 | would be very similar: | ||
242 | |||
243 | static int subbuf_start(struct rchan_buf *buf, | ||
244 | void *subbuf, | ||
245 | void *prev_subbuf, | ||
246 | unsigned int prev_padding) | ||
247 | { | ||
248 | if (prev_subbuf) | ||
249 | *((unsigned *)prev_subbuf) = prev_padding; | ||
250 | |||
251 | subbuf_start_reserve(buf, sizeof(unsigned int)); | ||
252 | |||
253 | return 1; | ||
254 | } | ||
255 | |||
256 | In this case, the relay_buf_full() check is meaningless and the | ||
257 | callback always returns 1, causing the buffer switch to occur | ||
258 | unconditionally. It's also meaningless for the client to use the | ||
259 | relay_subbufs_consumed() function in this mode, as it's never | ||
260 | consulted. | ||
261 | |||
262 | The default subbuf_start() implementation, used if the client doesn't | ||
263 | define any callbacks, or doesn't define the subbuf_start() callback, | ||
264 | implements the simplest possible 'no-overwrite' mode i.e. it does | ||
265 | nothing but return 0. | ||
266 | |||
267 | Header information can be reserved at the beginning of each sub-buffer | ||
268 | by calling the subbuf_start_reserve() helper function from within the | ||
269 | subbuf_start() callback. This reserved area can be used to store | ||
270 | whatever information the client wants. In the example above, room is | ||
271 | reserved in each sub-buffer to store the padding count for that | ||
272 | sub-buffer. This is filled in for the previous sub-buffer in the | ||
273 | subbuf_start() implementation; the padding value for the previous | ||
274 | sub-buffer is passed into the subbuf_start() callback along with a | ||
275 | pointer to the previous sub-buffer, since the padding value isn't | ||
276 | known until a sub-buffer is filled. The subbuf_start() callback is | ||
277 | also called for the first sub-buffer when the channel is opened, to | ||
278 | give the client a chance to reserve space in it. In this case the | ||
279 | previous sub-buffer pointer passed into the callback will be NULL, so | ||
280 | the client should check the value of the prev_subbuf pointer before | ||
281 | writing into the previous sub-buffer. | ||
282 | |||
283 | Writing to a channel | ||
284 | -------------------- | ||
285 | |||
286 | kernel clients write data into the current cpu's channel buffer using | ||
287 | relay_write() or __relay_write(). relay_write() is the main logging | ||
288 | function - it uses local_irqsave() to protect the buffer and should be | ||
289 | used if you might be logging from interrupt context. If you know | ||
290 | you'll never be logging from interrupt context, you can use | ||
291 | __relay_write(), which only disables preemption. These functions | ||
292 | don't return a value, so you can't determine whether or not they | ||
293 | failed - the assumption is that you wouldn't want to check a return | ||
294 | value in the fast logging path anyway, and that they'll always succeed | ||
295 | unless the buffer is full and no-overwrite mode is being used, in | ||
296 | which case you can detect a failed write in the subbuf_start() | ||
297 | callback by calling the relay_buf_full() helper function. | ||
298 | |||
299 | relay_reserve() is used to reserve a slot in a channel buffer which | ||
300 | can be written to later. This would typically be used in applications | ||
301 | that need to write directly into a channel buffer without having to | ||
302 | stage data in a temporary buffer beforehand. Because the actual write | ||
303 | may not happen immediately after the slot is reserved, applications | ||
304 | using relay_reserve() can keep a count of the number of bytes actually | ||
305 | written, either in space reserved in the sub-buffers themselves or as | ||
306 | a separate array. See the 'reserve' example in the relay-apps tarball | ||
307 | at http://relayfs.sourceforge.net for an example of how this can be | ||
308 | done. Because the write is under control of the client and is | ||
309 | separated from the reserve, relay_reserve() doesn't protect the buffer | ||
310 | at all - it's up to the client to provide the appropriate | ||
311 | synchronization when using relay_reserve(). | ||
312 | |||
313 | Closing a channel | ||
314 | ----------------- | ||
315 | |||
316 | The client calls relay_close() when it's finished using the channel. | ||
317 | The channel and its associated buffers are destroyed when there are no | ||
318 | longer any references to any of the channel buffers. relay_flush() | ||
319 | forces a sub-buffer switch on all the channel buffers, and can be used | ||
320 | to finalize and process the last sub-buffers before the channel is | ||
321 | closed. | ||
322 | |||
323 | Misc | ||
324 | ---- | ||
325 | |||
326 | Some applications may want to keep a channel around and re-use it | ||
327 | rather than open and close a new channel for each use. relay_reset() | ||
328 | can be used for this purpose - it resets a channel to its initial | ||
329 | state without reallocating channel buffer memory or destroying | ||
330 | existing mappings. It should however only be called when it's safe to | ||
331 | do so i.e. when the channel isn't currently being written to. | ||
332 | |||
333 | Finally, there are a couple of utility callbacks that can be used for | ||
334 | different purposes. buf_mapped() is called whenever a channel buffer | ||
335 | is mmapped from user space and buf_unmapped() is called when it's | ||
336 | unmapped. The client can use this notification to trigger actions | ||
337 | within the kernel application, such as enabling/disabling logging to | ||
338 | the channel. | ||
339 | |||
340 | |||
341 | Resources | ||
342 | ========= | ||
343 | |||
344 | For news, example code, mailing list, etc. see the relayfs homepage: | ||
345 | |||
346 | http://relayfs.sourceforge.net | ||
347 | |||
348 | |||
349 | Credits | ||
350 | ======= | ||
351 | |||
352 | The ideas and specs for relayfs came about as a result of discussions | ||
353 | on tracing involving the following: | ||
354 | |||
355 | Michel Dagenais <michel.dagenais@polymtl.ca> | ||
356 | Richard Moore <richardj_moore@uk.ibm.com> | ||
357 | Bob Wisniewski <bob@watson.ibm.com> | ||
358 | Karim Yaghmour <karim@opersys.com> | ||
359 | Tom Zanussi <zanussi@us.ibm.com> | ||
360 | |||
361 | Also thanks to Hubertus Franke for a lot of useful suggestions and bug | ||
362 | reports. | ||
diff --git a/Documentation/filesystems/sysfs.txt b/Documentation/filesystems/sysfs.txt index dc276598a65a..c8bce82ddcac 100644 --- a/Documentation/filesystems/sysfs.txt +++ b/Documentation/filesystems/sysfs.txt | |||
@@ -90,7 +90,7 @@ void device_remove_file(struct device *, struct device_attribute *); | |||
90 | 90 | ||
91 | It also defines this helper for defining device attributes: | 91 | It also defines this helper for defining device attributes: |
92 | 92 | ||
93 | #define DEVICE_ATTR(_name,_mode,_show,_store) \ | 93 | #define DEVICE_ATTR(_name, _mode, _show, _store) \ |
94 | struct device_attribute dev_attr_##_name = { \ | 94 | struct device_attribute dev_attr_##_name = { \ |
95 | .attr = {.name = __stringify(_name) , .mode = _mode }, \ | 95 | .attr = {.name = __stringify(_name) , .mode = _mode }, \ |
96 | .show = _show, \ | 96 | .show = _show, \ |
@@ -99,14 +99,14 @@ struct device_attribute dev_attr_##_name = { \ | |||
99 | 99 | ||
100 | For example, declaring | 100 | For example, declaring |
101 | 101 | ||
102 | static DEVICE_ATTR(foo,0644,show_foo,store_foo); | 102 | static DEVICE_ATTR(foo, S_IWUSR | S_IRUGO, show_foo, store_foo); |
103 | 103 | ||
104 | is equivalent to doing: | 104 | is equivalent to doing: |
105 | 105 | ||
106 | static struct device_attribute dev_attr_foo = { | 106 | static struct device_attribute dev_attr_foo = { |
107 | .attr = { | 107 | .attr = { |
108 | .name = "foo", | 108 | .name = "foo", |
109 | .mode = 0644, | 109 | .mode = S_IWUSR | S_IRUGO, |
110 | }, | 110 | }, |
111 | .show = show_foo, | 111 | .show = show_foo, |
112 | .store = store_foo, | 112 | .store = store_foo, |
@@ -121,8 +121,8 @@ set of sysfs operations for forwarding read and write calls to the | |||
121 | show and store methods of the attribute owners. | 121 | show and store methods of the attribute owners. |
122 | 122 | ||
123 | struct sysfs_ops { | 123 | struct sysfs_ops { |
124 | ssize_t (*show)(struct kobject *, struct attribute *,char *); | 124 | ssize_t (*show)(struct kobject *, struct attribute *, char *); |
125 | ssize_t (*store)(struct kobject *,struct attribute *,const char *); | 125 | ssize_t (*store)(struct kobject *, struct attribute *, const char *); |
126 | }; | 126 | }; |
127 | 127 | ||
128 | [ Subsystems should have already defined a struct kobj_type as a | 128 | [ Subsystems should have already defined a struct kobj_type as a |
@@ -137,7 +137,7 @@ calls the associated methods. | |||
137 | 137 | ||
138 | To illustrate: | 138 | To illustrate: |
139 | 139 | ||
140 | #define to_dev_attr(_attr) container_of(_attr,struct device_attribute,attr) | 140 | #define to_dev_attr(_attr) container_of(_attr, struct device_attribute, attr) |
141 | #define to_dev(d) container_of(d, struct device, kobj) | 141 | #define to_dev(d) container_of(d, struct device, kobj) |
142 | 142 | ||
143 | static ssize_t | 143 | static ssize_t |
@@ -148,7 +148,7 @@ dev_attr_show(struct kobject * kobj, struct attribute * attr, char * buf) | |||
148 | ssize_t ret = 0; | 148 | ssize_t ret = 0; |
149 | 149 | ||
150 | if (dev_attr->show) | 150 | if (dev_attr->show) |
151 | ret = dev_attr->show(dev,buf); | 151 | ret = dev_attr->show(dev, buf); |
152 | return ret; | 152 | return ret; |
153 | } | 153 | } |
154 | 154 | ||
@@ -216,16 +216,16 @@ A very simple (and naive) implementation of a device attribute is: | |||
216 | 216 | ||
217 | static ssize_t show_name(struct device *dev, struct device_attribute *attr, char *buf) | 217 | static ssize_t show_name(struct device *dev, struct device_attribute *attr, char *buf) |
218 | { | 218 | { |
219 | return sprintf(buf,"%s\n",dev->name); | 219 | return snprintf(buf, PAGE_SIZE, "%s\n", dev->name); |
220 | } | 220 | } |
221 | 221 | ||
222 | static ssize_t store_name(struct device * dev, const char * buf) | 222 | static ssize_t store_name(struct device * dev, const char * buf) |
223 | { | 223 | { |
224 | sscanf(buf,"%20s",dev->name); | 224 | sscanf(buf, "%20s", dev->name); |
225 | return strlen(buf); | 225 | return strnlen(buf, PAGE_SIZE); |
226 | } | 226 | } |
227 | 227 | ||
228 | static DEVICE_ATTR(name,S_IRUGO,show_name,store_name); | 228 | static DEVICE_ATTR(name, S_IRUGO, show_name, store_name); |
229 | 229 | ||
230 | 230 | ||
231 | (Note that the real implementation doesn't allow userspace to set the | 231 | (Note that the real implementation doesn't allow userspace to set the |
@@ -290,7 +290,7 @@ struct device_attribute { | |||
290 | 290 | ||
291 | Declaring: | 291 | Declaring: |
292 | 292 | ||
293 | DEVICE_ATTR(_name,_str,_mode,_show,_store); | 293 | DEVICE_ATTR(_name, _str, _mode, _show, _store); |
294 | 294 | ||
295 | Creation/Removal: | 295 | Creation/Removal: |
296 | 296 | ||
@@ -310,7 +310,7 @@ struct bus_attribute { | |||
310 | 310 | ||
311 | Declaring: | 311 | Declaring: |
312 | 312 | ||
313 | BUS_ATTR(_name,_mode,_show,_store) | 313 | BUS_ATTR(_name, _mode, _show, _store) |
314 | 314 | ||
315 | Creation/Removal: | 315 | Creation/Removal: |
316 | 316 | ||
@@ -331,7 +331,7 @@ struct driver_attribute { | |||
331 | 331 | ||
332 | Declaring: | 332 | Declaring: |
333 | 333 | ||
334 | DRIVER_ATTR(_name,_mode,_show,_store) | 334 | DRIVER_ATTR(_name, _mode, _show, _store) |
335 | 335 | ||
336 | Creation/Removal: | 336 | Creation/Removal: |
337 | 337 | ||
diff --git a/Documentation/hwmon/lm78 b/Documentation/hwmon/lm78 index 357086ed7f64..fd5dc7a19f0e 100644 --- a/Documentation/hwmon/lm78 +++ b/Documentation/hwmon/lm78 | |||
@@ -2,16 +2,11 @@ Kernel driver lm78 | |||
2 | ================== | 2 | ================== |
3 | 3 | ||
4 | Supported chips: | 4 | Supported chips: |
5 | * National Semiconductor LM78 | 5 | * National Semiconductor LM78 / LM78-J |
6 | Prefix: 'lm78' | 6 | Prefix: 'lm78' |
7 | Addresses scanned: I2C 0x20 - 0x2f, ISA 0x290 (8 I/O ports) | 7 | Addresses scanned: I2C 0x20 - 0x2f, ISA 0x290 (8 I/O ports) |
8 | Datasheet: Publicly available at the National Semiconductor website | 8 | Datasheet: Publicly available at the National Semiconductor website |
9 | http://www.national.com/ | 9 | http://www.national.com/ |
10 | * National Semiconductor LM78-J | ||
11 | Prefix: 'lm78-j' | ||
12 | Addresses scanned: I2C 0x20 - 0x2f, ISA 0x290 (8 I/O ports) | ||
13 | Datasheet: Publicly available at the National Semiconductor website | ||
14 | http://www.national.com/ | ||
15 | * National Semiconductor LM79 | 10 | * National Semiconductor LM79 |
16 | Prefix: 'lm79' | 11 | Prefix: 'lm79' |
17 | Addresses scanned: I2C 0x20 - 0x2f, ISA 0x290 (8 I/O ports) | 12 | Addresses scanned: I2C 0x20 - 0x2f, ISA 0x290 (8 I/O ports) |
diff --git a/Documentation/hwmon/w83792d b/Documentation/hwmon/w83792d new file mode 100644 index 000000000000..8171c285bb55 --- /dev/null +++ b/Documentation/hwmon/w83792d | |||
@@ -0,0 +1,174 @@ | |||
1 | Kernel driver w83792d | ||
2 | ===================== | ||
3 | |||
4 | Supported chips: | ||
5 | * Winbond W83792D | ||
6 | Prefix: 'w83792d' | ||
7 | Addresses scanned: I2C 0x2c - 0x2f | ||
8 | Datasheet: http://www.winbond.com.tw/E-WINBONDHTM/partner/PDFresult.asp?Pname=1035 | ||
9 | |||
10 | Author: Chunhao Huang | ||
11 | Contact: DZShen <DZShen@Winbond.com.tw> | ||
12 | |||
13 | |||
14 | Module Parameters | ||
15 | ----------------- | ||
16 | |||
17 | * init int | ||
18 | (default 1) | ||
19 | Use 'init=0' to bypass initializing the chip. | ||
20 | Try this if your computer crashes when you load the module. | ||
21 | |||
22 | * force_subclients=bus,caddr,saddr,saddr | ||
23 | This is used to force the i2c addresses for subclients of | ||
24 | a certain chip. Example usage is `force_subclients=0,0x2f,0x4a,0x4b' | ||
25 | to force the subclients of chip 0x2f on bus 0 to i2c addresses | ||
26 | 0x4a and 0x4b. | ||
27 | |||
28 | |||
29 | Description | ||
30 | ----------- | ||
31 | |||
32 | This driver implements support for the Winbond W83792AD/D. | ||
33 | |||
34 | Detection of the chip can sometimes be foiled because it can be in an | ||
35 | internal state that allows no clean access (Bank with ID register is not | ||
36 | currently selected). If you know the address of the chip, use a 'force' | ||
37 | parameter; this will put it into a more well-behaved state first. | ||
38 | |||
39 | The driver implements three temperature sensors, seven fan rotation speed | ||
40 | sensors, nine voltage sensors, and two automatic fan regulation | ||
41 | strategies called: Smart Fan I (Thermal Cruise mode) and Smart Fan II. | ||
42 | Automatic fan control mode is possible only for fan1-fan3. Fan4-fan7 can run | ||
43 | synchronized with selected fan (fan1-fan3). This functionality and manual PWM | ||
44 | control for fan4-fan7 is not yet implemented. | ||
45 | |||
46 | Temperatures are measured in degrees Celsius and measurement resolution is 1 | ||
47 | degC for temp1 and 0.5 degC for temp2 and temp3. An alarm is triggered when | ||
48 | the temperature gets higher than the Overtemperature Shutdown value; it stays | ||
49 | on until the temperature falls below the Hysteresis value. | ||
50 | |||
51 | Fan rotation speeds are reported in RPM (rotations per minute). An alarm is | ||
52 | triggered if the rotation speed has dropped below a programmable limit. Fan | ||
53 | readings can be divided by a programmable divider (1, 2, 4, 8, 16, 32, 64 or | ||
54 | 128) to give the readings more range or accuracy. | ||
55 | |||
56 | Voltage sensors (also known as IN sensors) report their values in millivolts. | ||
57 | An alarm is triggered if the voltage has crossed a programmable minimum | ||
58 | or maximum limit. | ||
59 | |||
60 | Alarms are provided as output from "realtime status register". Following bits | ||
61 | are defined: | ||
62 | |||
63 | bit - alarm on: | ||
64 | 0 - in0 | ||
65 | 1 - in1 | ||
66 | 2 - temp1 | ||
67 | 3 - temp2 | ||
68 | 4 - temp3 | ||
69 | 5 - fan1 | ||
70 | 6 - fan2 | ||
71 | 7 - fan3 | ||
72 | 8 - in2 | ||
73 | 9 - in3 | ||
74 | 10 - in4 | ||
75 | 11 - in5 | ||
76 | 12 - in6 | ||
77 | 13 - VID change | ||
78 | 14 - chassis | ||
79 | 15 - fan7 | ||
80 | 16 - tart1 | ||
81 | 17 - tart2 | ||
82 | 18 - tart3 | ||
83 | 19 - in7 | ||
84 | 20 - in8 | ||
85 | 21 - fan4 | ||
86 | 22 - fan5 | ||
87 | 23 - fan6 | ||
88 | |||
89 | Tart will be asserted while target temperature cannot be achieved after 3 minutes | ||
90 | of full speed rotation of corresponding fan. | ||
91 | |||
92 | In addition to the alarms described above, there is a CHAS alarm on the chips | ||
93 | which triggers if your computer case is open (This one is latched, contrary | ||
94 | to realtime alarms). | ||
95 | |||
96 | The chips only update values each 3 seconds; reading them more often will | ||
97 | do no harm, but will return 'old' values. | ||
98 | |||
99 | |||
100 | W83792D PROBLEMS | ||
101 | ---------------- | ||
102 | Known problems: | ||
103 | - This driver is only for Winbond W83792D C version device, there | ||
104 | are also some motherboards with B version W83792D device. The | ||
105 | calculation method to in6-in7(measured value, limits) is a little | ||
106 | different between C and B version. C or B version can be identified | ||
107 | by CR[0x49h]. | ||
108 | - The function of vid and vrm has not been finished, because I'm NOT | ||
109 | very familiar with them. Adding support is welcome. | ||
110 | - The function of chassis open detection needs more tests. | ||
111 | - If you have ASUS server board and chip was not found: Then you will | ||
112 | need to upgrade to latest (or beta) BIOS. If it does not help please | ||
113 | contact us. | ||
114 | |||
115 | Fan control | ||
116 | ----------- | ||
117 | |||
118 | Manual mode | ||
119 | ----------- | ||
120 | |||
121 | Works as expected. You just need to specify desired PWM/DC value (fan speed) | ||
122 | in appropriate pwm# file. | ||
123 | |||
124 | Thermal cruise | ||
125 | -------------- | ||
126 | |||
127 | In this mode, W83792D provides the Smart Fan system to automatically control | ||
128 | fan speed to keep the temperatures of CPU and the system within specific | ||
129 | range. At first a wanted temperature and interval must be set. This is done | ||
130 | via thermal_cruise# file. The tolerance# file serves to create T +- tolerance | ||
131 | interval. The fan speed will be lowered as long as the current temperature | ||
132 | remains below the thermal_cruise# +- tolerance# value. Once the temperature | ||
133 | exceeds the high limit (T+tolerance), the fan will be turned on with a | ||
134 | specific speed set by pwm# and automatically controlled its PWM duty cycle | ||
135 | with the temperature varying. Three conditions may occur: | ||
136 | |||
137 | (1) If the temperature still exceeds the high limit, PWM duty | ||
138 | cycle will increase slowly. | ||
139 | |||
140 | (2) If the temperature goes below the high limit, but still above the low | ||
141 | limit (T-tolerance), the fan speed will be fixed at the current speed because | ||
142 | the temperature is in the target range. | ||
143 | |||
144 | (3) If the temperature goes below the low limit, PWM duty cycle will decrease | ||
145 | slowly to 0 or a preset stop value until the temperature exceeds the low | ||
146 | limit. (The preset stop value handling is not yet implemented in driver) | ||
147 | |||
148 | Smart Fan II | ||
149 | ------------ | ||
150 | |||
151 | W83792D also provides a special mode for fan. Four temperature points are | ||
152 | available. When related temperature sensors detects the temperature in preset | ||
153 | temperature region (sf2_point@_fan# +- tolerance#) it will cause fans to run | ||
154 | on programmed value from sf2_level@_fan#. You need to set four temperatures | ||
155 | for each fan. | ||
156 | |||
157 | |||
158 | /sys files | ||
159 | ---------- | ||
160 | |||
161 | pwm[1-3] - this file stores PWM duty cycle or DC value (fan speed) in range: | ||
162 | 0 (stop) to 255 (full) | ||
163 | pwm[1-3]_enable - this file controls mode of fan/temperature control: | ||
164 | * 0 Disabled | ||
165 | * 1 Manual mode | ||
166 | * 2 Smart Fan II | ||
167 | * 3 Thermal Cruise | ||
168 | pwm[1-3]_mode - Select PWM of DC mode | ||
169 | * 0 DC | ||
170 | * 1 PWM | ||
171 | thermal_cruise[1-3] - Selects the desired temperature for cruise (degC) | ||
172 | tolerance[1-3] - Value in degrees of Celsius (degC) for +- T | ||
173 | sf2_point[1-4]_fan[1-3] - four temperature points for each fan for Smart Fan II | ||
174 | sf2_level[1-3]_fan[1-3] - three PWM/DC levels for each fan for Smart Fan II | ||
diff --git a/Documentation/i2c/chips/max6875 b/Documentation/i2c/chips/max6875 index b02002898a09..96fec562a8e9 100644 --- a/Documentation/i2c/chips/max6875 +++ b/Documentation/i2c/chips/max6875 | |||
@@ -4,22 +4,13 @@ Kernel driver max6875 | |||
4 | Supported chips: | 4 | Supported chips: |
5 | * Maxim MAX6874, MAX6875 | 5 | * Maxim MAX6874, MAX6875 |
6 | Prefix: 'max6875' | 6 | Prefix: 'max6875' |
7 | Addresses scanned: 0x50, 0x52 | 7 | Addresses scanned: None (see below) |
8 | Datasheet: | 8 | Datasheet: |
9 | http://pdfserv.maxim-ic.com/en/ds/MAX6874-MAX6875.pdf | 9 | http://pdfserv.maxim-ic.com/en/ds/MAX6874-MAX6875.pdf |
10 | 10 | ||
11 | Author: Ben Gardner <bgardner@wabtec.com> | 11 | Author: Ben Gardner <bgardner@wabtec.com> |
12 | 12 | ||
13 | 13 | ||
14 | Module Parameters | ||
15 | ----------------- | ||
16 | |||
17 | * allow_write int | ||
18 | Set to non-zero to enable write permission: | ||
19 | *0: Read only | ||
20 | 1: Read and write | ||
21 | |||
22 | |||
23 | Description | 14 | Description |
24 | ----------- | 15 | ----------- |
25 | 16 | ||
@@ -33,34 +24,85 @@ registers. | |||
33 | 24 | ||
34 | The Maxim MAX6874 is a similar, mostly compatible device, with more intputs | 25 | The Maxim MAX6874 is a similar, mostly compatible device, with more intputs |
35 | and outputs: | 26 | and outputs: |
36 | |||
37 | vin gpi vout | 27 | vin gpi vout |
38 | MAX6874 6 4 8 | 28 | MAX6874 6 4 8 |
39 | MAX6875 4 3 5 | 29 | MAX6875 4 3 5 |
40 | 30 | ||
41 | MAX6874 chips can have four different addresses (as opposed to only two for | 31 | See the datasheet for more information. |
42 | the MAX6875). The additional addresses (0x54 and 0x56) are not probed by | ||
43 | this driver by default, but the probe module parameter can be used if | ||
44 | needed. | ||
45 | |||
46 | See the datasheet for details on how to program the EEPROM. | ||
47 | 32 | ||
48 | 33 | ||
49 | Sysfs entries | 34 | Sysfs entries |
50 | ------------- | 35 | ------------- |
51 | 36 | ||
52 | eeprom_user - 512 bytes of user-defined EEPROM space. Only writable if | 37 | eeprom - 512 bytes of user-defined EEPROM space. |
53 | allow_write was set and register 0x43 is 0. | ||
54 | |||
55 | eeprom_config - 70 bytes of config EEPROM. Note that changes will not get | ||
56 | loaded into register space until a power cycle or device reset. | ||
57 | |||
58 | reg_config - 70 bytes of register space. Any changes take affect immediately. | ||
59 | 38 | ||
60 | 39 | ||
61 | General Remarks | 40 | General Remarks |
62 | --------------- | 41 | --------------- |
63 | 42 | ||
64 | A typical application will require that the EEPROMs be programmed once and | 43 | Valid addresses for the MAX6875 are 0x50 and 0x52. |
65 | never altered afterwards. | 44 | Valid addresses for the MAX6874 are 0x50, 0x52, 0x54 and 0x56. |
45 | The driver does not probe any address, so you must force the address. | ||
46 | |||
47 | Example: | ||
48 | $ modprobe max6875 force=0,0x50 | ||
49 | |||
50 | The MAX6874/MAX6875 ignores address bit 0, so this driver attaches to multiple | ||
51 | addresses. For example, for address 0x50, it also reserves 0x51. | ||
52 | The even-address instance is called 'max6875', the odd one is 'max6875 subclient'. | ||
53 | |||
54 | |||
55 | Programming the chip using i2c-dev | ||
56 | ---------------------------------- | ||
57 | |||
58 | Use the i2c-dev interface to access and program the chips. | ||
59 | Reads and writes are performed differently depending on the address range. | ||
60 | |||
61 | The configuration registers are at addresses 0x00 - 0x45. | ||
62 | Use i2c_smbus_write_byte_data() to write a register and | ||
63 | i2c_smbus_read_byte_data() to read a register. | ||
64 | The command is the register number. | ||
65 | |||
66 | Examples: | ||
67 | To write a 1 to register 0x45: | ||
68 | i2c_smbus_write_byte_data(fd, 0x45, 1); | ||
69 | |||
70 | To read register 0x45: | ||
71 | value = i2c_smbus_read_byte_data(fd, 0x45); | ||
72 | |||
73 | |||
74 | The configuration EEPROM is at addresses 0x8000 - 0x8045. | ||
75 | The user EEPROM is at addresses 0x8100 - 0x82ff. | ||
76 | |||
77 | Use i2c_smbus_write_word_data() to write a byte to EEPROM. | ||
78 | |||
79 | The command is the upper byte of the address: 0x80, 0x81, or 0x82. | ||
80 | The data word is the lower part of the address or'd with data << 8. | ||
81 | cmd = address >> 8; | ||
82 | val = (address & 0xff) | (data << 8); | ||
83 | |||
84 | Example: | ||
85 | To write 0x5a to address 0x8003: | ||
86 | i2c_smbus_write_word_data(fd, 0x80, 0x5a03); | ||
87 | |||
88 | |||
89 | Reading data from the EEPROM is a little more complicated. | ||
90 | Use i2c_smbus_write_byte_data() to set the read address and then | ||
91 | i2c_smbus_read_byte() or i2c_smbus_read_i2c_block_data() to read the data. | ||
92 | |||
93 | Example: | ||
94 | To read data starting at offset 0x8100, first set the address: | ||
95 | i2c_smbus_write_byte_data(fd, 0x81, 0x00); | ||
96 | |||
97 | And then read the data | ||
98 | value = i2c_smbus_read_byte(fd); | ||
99 | |||
100 | or | ||
101 | |||
102 | count = i2c_smbus_read_i2c_block_data(fd, 0x84, buffer); | ||
103 | |||
104 | The block read should read 16 bytes. | ||
105 | 0x84 is the block read command. | ||
106 | |||
107 | See the datasheet for more details. | ||
66 | 108 | ||
diff --git a/Documentation/i2c/functionality b/Documentation/i2c/functionality index 8a78a95ae04e..41ffefbdc60c 100644 --- a/Documentation/i2c/functionality +++ b/Documentation/i2c/functionality | |||
@@ -115,7 +115,7 @@ CHECKING THROUGH /DEV | |||
115 | If you try to access an adapter from a userspace program, you will have | 115 | If you try to access an adapter from a userspace program, you will have |
116 | to use the /dev interface. You will still have to check whether the | 116 | to use the /dev interface. You will still have to check whether the |
117 | functionality you need is supported, of course. This is done using | 117 | functionality you need is supported, of course. This is done using |
118 | the I2C_FUNCS ioctl. An example, adapted from the lm_sensors i2c_detect | 118 | the I2C_FUNCS ioctl. An example, adapted from the lm_sensors i2cdetect |
119 | program, is below: | 119 | program, is below: |
120 | 120 | ||
121 | int file; | 121 | int file; |
diff --git a/Documentation/i2c/porting-clients b/Documentation/i2c/porting-clients index a7adbdd9ea8a..4849dfd6961c 100644 --- a/Documentation/i2c/porting-clients +++ b/Documentation/i2c/porting-clients | |||
@@ -1,4 +1,4 @@ | |||
1 | Revision 4, 2004-03-30 | 1 | Revision 5, 2005-07-29 |
2 | Jean Delvare <khali@linux-fr.org> | 2 | Jean Delvare <khali@linux-fr.org> |
3 | Greg KH <greg@kroah.com> | 3 | Greg KH <greg@kroah.com> |
4 | 4 | ||
@@ -17,20 +17,22 @@ yours for best results. | |||
17 | 17 | ||
18 | Technical changes: | 18 | Technical changes: |
19 | 19 | ||
20 | * [Includes] Get rid of "version.h". Replace <linux/i2c-proc.h> with | 20 | * [Includes] Get rid of "version.h" and <linux/i2c-proc.h>. |
21 | <linux/i2c-sensor.h>. Includes typically look like that: | 21 | Includes typically look like that: |
22 | #include <linux/module.h> | 22 | #include <linux/module.h> |
23 | #include <linux/init.h> | 23 | #include <linux/init.h> |
24 | #include <linux/slab.h> | 24 | #include <linux/slab.h> |
25 | #include <linux/i2c.h> | 25 | #include <linux/i2c.h> |
26 | #include <linux/i2c-sensor.h> | 26 | #include <linux/hwmon.h> /* for hardware monitoring drivers */ |
27 | #include <linux/i2c-vid.h> /* if you need VRM support */ | 27 | #include <linux/hwmon-sysfs.h> |
28 | #include <linux/hwmon-vid.h> /* if you need VRM support */ | ||
28 | #include <asm/io.h> /* if you have I/O operations */ | 29 | #include <asm/io.h> /* if you have I/O operations */ |
29 | Please respect this inclusion order. Some extra headers may be | 30 | Please respect this inclusion order. Some extra headers may be |
30 | required for a given driver (e.g. "lm75.h"). | 31 | required for a given driver (e.g. "lm75.h"). |
31 | 32 | ||
32 | * [Addresses] SENSORS_I2C_END becomes I2C_CLIENT_END, SENSORS_ISA_END | 33 | * [Addresses] SENSORS_I2C_END becomes I2C_CLIENT_END, ISA addresses |
33 | becomes I2C_CLIENT_ISA_END. | 34 | are no more handled by the i2c core. |
35 | SENSORS_INSMOD_<n> becomes I2C_CLIENT_INSMOD_<n>. | ||
34 | 36 | ||
35 | * [Client data] Get rid of sysctl_id. Try using standard names for | 37 | * [Client data] Get rid of sysctl_id. Try using standard names for |
36 | register values (for example, temp_os becomes temp_max). You're | 38 | register values (for example, temp_os becomes temp_max). You're |
@@ -66,13 +68,15 @@ Technical changes: | |||
66 | if (!(adapter->class & I2C_CLASS_HWMON)) | 68 | if (!(adapter->class & I2C_CLASS_HWMON)) |
67 | return 0; | 69 | return 0; |
68 | ISA-only drivers of course don't need this. | 70 | ISA-only drivers of course don't need this. |
71 | Call i2c_probe() instead of i2c_detect(). | ||
69 | 72 | ||
70 | * [Detect] As mentioned earlier, the flags parameter is gone. | 73 | * [Detect] As mentioned earlier, the flags parameter is gone. |
71 | The type_name and client_name strings are replaced by a single | 74 | The type_name and client_name strings are replaced by a single |
72 | name string, which will be filled with a lowercase, short string | 75 | name string, which will be filled with a lowercase, short string |
73 | (typically the driver name, e.g. "lm75"). | 76 | (typically the driver name, e.g. "lm75"). |
74 | In i2c-only drivers, drop the i2c_is_isa_adapter check, it's | 77 | In i2c-only drivers, drop the i2c_is_isa_adapter check, it's |
75 | useless. | 78 | useless. Same for isa-only drivers, as the test would always be |
79 | true. Only hybrid drivers (which are quite rare) still need it. | ||
76 | The errorN labels are reduced to the number needed. If that number | 80 | The errorN labels are reduced to the number needed. If that number |
77 | is 2 (i2c-only drivers), it is advised that the labels are named | 81 | is 2 (i2c-only drivers), it is advised that the labels are named |
78 | exit and exit_free. For i2c+isa drivers, labels should be named | 82 | exit and exit_free. For i2c+isa drivers, labels should be named |
@@ -86,6 +90,8 @@ Technical changes: | |||
86 | device_create_file. Move the driver initialization before any | 90 | device_create_file. Move the driver initialization before any |
87 | sysfs file creation. | 91 | sysfs file creation. |
88 | Drop client->id. | 92 | Drop client->id. |
93 | Drop any 24RF08 corruption prevention you find, as this is now done | ||
94 | at the i2c-core level, and doing it twice voids it. | ||
89 | 95 | ||
90 | * [Init] Limits must not be set by the driver (can be done later in | 96 | * [Init] Limits must not be set by the driver (can be done later in |
91 | user-space). Chip should not be reset default (although a module | 97 | user-space). Chip should not be reset default (although a module |
@@ -93,7 +99,8 @@ Technical changes: | |||
93 | limited to the strictly necessary steps. | 99 | limited to the strictly necessary steps. |
94 | 100 | ||
95 | * [Detach] Get rid of data, remove the call to | 101 | * [Detach] Get rid of data, remove the call to |
96 | i2c_deregister_entry. | 102 | i2c_deregister_entry. Do not log an error message if |
103 | i2c_detach_client fails, as i2c-core will now do it for you. | ||
97 | 104 | ||
98 | * [Update] Don't access client->data directly, use | 105 | * [Update] Don't access client->data directly, use |
99 | i2c_get_clientdata(client) instead. | 106 | i2c_get_clientdata(client) instead. |
diff --git a/Documentation/i2c/writing-clients b/Documentation/i2c/writing-clients index 91664be91ffc..077275722a7c 100644 --- a/Documentation/i2c/writing-clients +++ b/Documentation/i2c/writing-clients | |||
@@ -148,15 +148,15 @@ are defined in i2c.h to help you support them, as well as a generic | |||
148 | detection algorithm. | 148 | detection algorithm. |
149 | 149 | ||
150 | You do not have to use this parameter interface; but don't try to use | 150 | You do not have to use this parameter interface; but don't try to use |
151 | function i2c_probe() (or i2c_detect()) if you don't. | 151 | function i2c_probe() if you don't. |
152 | 152 | ||
153 | NOTE: If you want to write a `sensors' driver, the interface is slightly | 153 | NOTE: If you want to write a `sensors' driver, the interface is slightly |
154 | different! See below. | 154 | different! See below. |
155 | 155 | ||
156 | 156 | ||
157 | 157 | ||
158 | Probing classes (i2c) | 158 | Probing classes |
159 | --------------------- | 159 | --------------- |
160 | 160 | ||
161 | All parameters are given as lists of unsigned 16-bit integers. Lists are | 161 | All parameters are given as lists of unsigned 16-bit integers. Lists are |
162 | terminated by I2C_CLIENT_END. | 162 | terminated by I2C_CLIENT_END. |
@@ -171,12 +171,18 @@ The following lists are used internally: | |||
171 | ignore: insmod parameter. | 171 | ignore: insmod parameter. |
172 | A list of pairs. The first value is a bus number (-1 for any I2C bus), | 172 | A list of pairs. The first value is a bus number (-1 for any I2C bus), |
173 | the second is the I2C address. These addresses are never probed. | 173 | the second is the I2C address. These addresses are never probed. |
174 | This parameter overrules 'normal' and 'probe', but not the 'force' lists. | 174 | This parameter overrules the 'normal_i2c' list only. |
175 | force: insmod parameter. | 175 | force: insmod parameter. |
176 | A list of pairs. The first value is a bus number (-1 for any I2C bus), | 176 | A list of pairs. The first value is a bus number (-1 for any I2C bus), |
177 | the second is the I2C address. A device is blindly assumed to be on | 177 | the second is the I2C address. A device is blindly assumed to be on |
178 | the given address, no probing is done. | 178 | the given address, no probing is done. |
179 | 179 | ||
180 | Additionally, kind-specific force lists may optionally be defined if | ||
181 | the driver supports several chip kinds. They are grouped in a | ||
182 | NULL-terminated list of pointers named forces, those first element if the | ||
183 | generic force list mentioned above. Each additional list correspond to an | ||
184 | insmod parameter of the form force_<kind>. | ||
185 | |||
180 | Fortunately, as a module writer, you just have to define the `normal_i2c' | 186 | Fortunately, as a module writer, you just have to define the `normal_i2c' |
181 | parameter. The complete declaration could look like this: | 187 | parameter. The complete declaration could look like this: |
182 | 188 | ||
@@ -186,66 +192,17 @@ parameter. The complete declaration could look like this: | |||
186 | 192 | ||
187 | /* Magic definition of all other variables and things */ | 193 | /* Magic definition of all other variables and things */ |
188 | I2C_CLIENT_INSMOD; | 194 | I2C_CLIENT_INSMOD; |
195 | /* Or, if your driver supports, say, 2 kind of devices: */ | ||
196 | I2C_CLIENT_INSMOD_2(foo, bar); | ||
197 | |||
198 | If you use the multi-kind form, an enum will be defined for you: | ||
199 | enum chips { any_chip, foo, bar, ... } | ||
200 | You can then (and certainly should) use it in the driver code. | ||
189 | 201 | ||
190 | Note that you *have* to call the defined variable `normal_i2c', | 202 | Note that you *have* to call the defined variable `normal_i2c', |
191 | without any prefix! | 203 | without any prefix! |
192 | 204 | ||
193 | 205 | ||
194 | Probing classes (sensors) | ||
195 | ------------------------- | ||
196 | |||
197 | If you write a `sensors' driver, you use a slightly different interface. | ||
198 | As well as I2C addresses, we have to cope with ISA addresses. Also, we | ||
199 | use a enum of chip types. Don't forget to include `sensors.h'. | ||
200 | |||
201 | The following lists are used internally. They are all lists of integers. | ||
202 | |||
203 | normal_i2c: filled in by the module writer. Terminated by SENSORS_I2C_END. | ||
204 | A list of I2C addresses which should normally be examined. | ||
205 | normal_isa: filled in by the module writer. Terminated by SENSORS_ISA_END. | ||
206 | A list of ISA addresses which should normally be examined. | ||
207 | probe: insmod parameter. Initialize this list with SENSORS_I2C_END values. | ||
208 | A list of pairs. The first value is a bus number (SENSORS_ISA_BUS for | ||
209 | the ISA bus, -1 for any I2C bus), the second is the address. These | ||
210 | addresses are also probed, as if they were in the 'normal' list. | ||
211 | ignore: insmod parameter. Initialize this list with SENSORS_I2C_END values. | ||
212 | A list of pairs. The first value is a bus number (SENSORS_ISA_BUS for | ||
213 | the ISA bus, -1 for any I2C bus), the second is the I2C address. These | ||
214 | addresses are never probed. This parameter overrules 'normal' and | ||
215 | 'probe', but not the 'force' lists. | ||
216 | |||
217 | Also used is a list of pointers to sensors_force_data structures: | ||
218 | force_data: insmod parameters. A list, ending with an element of which | ||
219 | the force field is NULL. | ||
220 | Each element contains the type of chip and a list of pairs. | ||
221 | The first value is a bus number (SENSORS_ISA_BUS for the ISA bus, | ||
222 | -1 for any I2C bus), the second is the address. | ||
223 | These are automatically translated to insmod variables of the form | ||
224 | force_foo. | ||
225 | |||
226 | So we have a generic insmod variabled `force', and chip-specific variables | ||
227 | `force_CHIPNAME'. | ||
228 | |||
229 | Fortunately, as a module writer, you just have to define the `normal_i2c' | ||
230 | and `normal_isa' parameters, and define what chip names are used. | ||
231 | The complete declaration could look like this: | ||
232 | /* Scan i2c addresses 0x37, and 0x48 to 0x4f */ | ||
233 | static unsigned short normal_i2c[] = { 0x37, 0x48, 0x49, 0x4a, 0x4b, 0x4c, | ||
234 | 0x4d, 0x4e, 0x4f, I2C_CLIENT_END }; | ||
235 | /* Scan ISA address 0x290 */ | ||
236 | static unsigned int normal_isa[] = {0x0290,SENSORS_ISA_END}; | ||
237 | |||
238 | /* Define chips foo and bar, as well as all module parameters and things */ | ||
239 | SENSORS_INSMOD_2(foo,bar); | ||
240 | |||
241 | If you have one chip, you use macro SENSORS_INSMOD_1(chip), if you have 2 | ||
242 | you use macro SENSORS_INSMOD_2(chip1,chip2), etc. If you do not want to | ||
243 | bother with chip types, you can use SENSORS_INSMOD_0. | ||
244 | |||
245 | A enum is automatically defined as follows: | ||
246 | enum chips { any_chip, chip1, chip2, ... } | ||
247 | |||
248 | |||
249 | Attaching to an adapter | 206 | Attaching to an adapter |
250 | ----------------------- | 207 | ----------------------- |
251 | 208 | ||
@@ -264,17 +221,10 @@ detected at a specific address, another callback is called. | |||
264 | return i2c_probe(adapter,&addr_data,&foo_detect_client); | 221 | return i2c_probe(adapter,&addr_data,&foo_detect_client); |
265 | } | 222 | } |
266 | 223 | ||
267 | For `sensors' drivers, use the i2c_detect function instead: | ||
268 | |||
269 | int foo_attach_adapter(struct i2c_adapter *adapter) | ||
270 | { | ||
271 | return i2c_detect(adapter,&addr_data,&foo_detect_client); | ||
272 | } | ||
273 | |||
274 | Remember, structure `addr_data' is defined by the macros explained above, | 224 | Remember, structure `addr_data' is defined by the macros explained above, |
275 | so you do not have to define it yourself. | 225 | so you do not have to define it yourself. |
276 | 226 | ||
277 | The i2c_probe or i2c_detect function will call the foo_detect_client | 227 | The i2c_probe function will call the foo_detect_client |
278 | function only for those i2c addresses that actually have a device on | 228 | function only for those i2c addresses that actually have a device on |
279 | them (unless a `force' parameter was used). In addition, addresses that | 229 | them (unless a `force' parameter was used). In addition, addresses that |
280 | are already in use (by some other registered client) are skipped. | 230 | are already in use (by some other registered client) are skipped. |
@@ -283,19 +233,18 @@ are already in use (by some other registered client) are skipped. | |||
283 | The detect client function | 233 | The detect client function |
284 | -------------------------- | 234 | -------------------------- |
285 | 235 | ||
286 | The detect client function is called by i2c_probe or i2c_detect. | 236 | The detect client function is called by i2c_probe. The `kind' parameter |
287 | The `kind' parameter contains 0 if this call is due to a `force' | 237 | contains -1 for a probed detection, 0 for a forced detection, or a positive |
288 | parameter, and -1 otherwise (for i2c_detect, it contains 0 if | 238 | number for a forced detection with a chip type forced. |
289 | this call is due to the generic `force' parameter, and the chip type | ||
290 | number if it is due to a specific `force' parameter). | ||
291 | 239 | ||
292 | Below, some things are only needed if this is a `sensors' driver. Those | 240 | Below, some things are only needed if this is a `sensors' driver. Those |
293 | parts are between /* SENSORS ONLY START */ and /* SENSORS ONLY END */ | 241 | parts are between /* SENSORS ONLY START */ and /* SENSORS ONLY END */ |
294 | markers. | 242 | markers. |
295 | 243 | ||
296 | This function should only return an error (any value != 0) if there is | 244 | Returning an error different from -ENODEV in a detect function will cause |
297 | some reason why no more detection should be done anymore. If the | 245 | the detection to stop: other addresses and adapters won't be scanned. |
298 | detection just fails for this address, return 0. | 246 | This should only be done on fatal or internal errors, such as a memory |
247 | shortage or i2c_attach_client failing. | ||
299 | 248 | ||
300 | For now, you can ignore the `flags' parameter. It is there for future use. | 249 | For now, you can ignore the `flags' parameter. It is there for future use. |
301 | 250 | ||
@@ -320,11 +269,10 @@ For now, you can ignore the `flags' parameter. It is there for future use. | |||
320 | const char *type_name = ""; | 269 | const char *type_name = ""; |
321 | int is_isa = i2c_is_isa_adapter(adapter); | 270 | int is_isa = i2c_is_isa_adapter(adapter); |
322 | 271 | ||
323 | if (is_isa) { | 272 | /* Do this only if the chip can additionally be found on the ISA bus |
273 | (hybrid chip). */ | ||
324 | 274 | ||
325 | /* If this client can't be on the ISA bus at all, we can stop now | 275 | if (is_isa) { |
326 | (call `goto ERROR0'). But for kicks, we will assume it is all | ||
327 | right. */ | ||
328 | 276 | ||
329 | /* Discard immediately if this ISA range is already used */ | 277 | /* Discard immediately if this ISA range is already used */ |
330 | if (check_region(address,FOO_EXTENT)) | 278 | if (check_region(address,FOO_EXTENT)) |
@@ -495,15 +443,13 @@ much simpler than the attachment code, fortunately! | |||
495 | /* SENSORS ONLY END */ | 443 | /* SENSORS ONLY END */ |
496 | 444 | ||
497 | /* Try to detach the client from i2c space */ | 445 | /* Try to detach the client from i2c space */ |
498 | if ((err = i2c_detach_client(client))) { | 446 | if ((err = i2c_detach_client(client))) |
499 | printk("foo.o: Client deregistration failed, client not detached.\n"); | ||
500 | return err; | 447 | return err; |
501 | } | ||
502 | 448 | ||
503 | /* SENSORS ONLY START */ | 449 | /* HYBRID SENSORS CHIP ONLY START */ |
504 | if i2c_is_isa_client(client) | 450 | if i2c_is_isa_client(client) |
505 | release_region(client->addr,LM78_EXTENT); | 451 | release_region(client->addr,LM78_EXTENT); |
506 | /* SENSORS ONLY END */ | 452 | /* HYBRID SENSORS CHIP ONLY END */ |
507 | 453 | ||
508 | kfree(client); /* Frees client data too, if allocated at the same time */ | 454 | kfree(client); /* Frees client data too, if allocated at the same time */ |
509 | return 0; | 455 | return 0; |
diff --git a/Documentation/i386/boot.txt b/Documentation/i386/boot.txt index 1c48f0eba6fb..10312bebe55d 100644 --- a/Documentation/i386/boot.txt +++ b/Documentation/i386/boot.txt | |||
@@ -2,7 +2,7 @@ | |||
2 | ---------------------------- | 2 | ---------------------------- |
3 | 3 | ||
4 | H. Peter Anvin <hpa@zytor.com> | 4 | H. Peter Anvin <hpa@zytor.com> |
5 | Last update 2002-01-01 | 5 | Last update 2005-09-02 |
6 | 6 | ||
7 | On the i386 platform, the Linux kernel uses a rather complicated boot | 7 | On the i386 platform, the Linux kernel uses a rather complicated boot |
8 | convention. This has evolved partially due to historical aspects, as | 8 | convention. This has evolved partially due to historical aspects, as |
@@ -34,6 +34,8 @@ Protocol 2.02: (Kernel 2.4.0-test3-pre3) New command line protocol. | |||
34 | Protocol 2.03: (Kernel 2.4.18-pre1) Explicitly makes the highest possible | 34 | Protocol 2.03: (Kernel 2.4.18-pre1) Explicitly makes the highest possible |
35 | initrd address available to the bootloader. | 35 | initrd address available to the bootloader. |
36 | 36 | ||
37 | Protocol 2.04: (Kernel 2.6.14) Extend the syssize field to four bytes. | ||
38 | |||
37 | 39 | ||
38 | **** MEMORY LAYOUT | 40 | **** MEMORY LAYOUT |
39 | 41 | ||
@@ -103,10 +105,9 @@ The header looks like: | |||
103 | Offset Proto Name Meaning | 105 | Offset Proto Name Meaning |
104 | /Size | 106 | /Size |
105 | 107 | ||
106 | 01F1/1 ALL setup_sects The size of the setup in sectors | 108 | 01F1/1 ALL(1 setup_sects The size of the setup in sectors |
107 | 01F2/2 ALL root_flags If set, the root is mounted readonly | 109 | 01F2/2 ALL root_flags If set, the root is mounted readonly |
108 | 01F4/2 ALL syssize DO NOT USE - for bootsect.S use only | 110 | 01F4/4 2.04+(2 syssize The size of the 32-bit code in 16-byte paras |
109 | 01F6/2 ALL swap_dev DO NOT USE - obsolete | ||
110 | 01F8/2 ALL ram_size DO NOT USE - for bootsect.S use only | 111 | 01F8/2 ALL ram_size DO NOT USE - for bootsect.S use only |
111 | 01FA/2 ALL vid_mode Video mode control | 112 | 01FA/2 ALL vid_mode Video mode control |
112 | 01FC/2 ALL root_dev Default root device number | 113 | 01FC/2 ALL root_dev Default root device number |
@@ -129,8 +130,12 @@ Offset Proto Name Meaning | |||
129 | 0228/4 2.02+ cmd_line_ptr 32-bit pointer to the kernel command line | 130 | 0228/4 2.02+ cmd_line_ptr 32-bit pointer to the kernel command line |
130 | 022C/4 2.03+ initrd_addr_max Highest legal initrd address | 131 | 022C/4 2.03+ initrd_addr_max Highest legal initrd address |
131 | 132 | ||
132 | For backwards compatibility, if the setup_sects field contains 0, the | 133 | (1) For backwards compatibility, if the setup_sects field contains 0, the |
133 | real value is 4. | 134 | real value is 4. |
135 | |||
136 | (2) For boot protocol prior to 2.04, the upper two bytes of the syssize | ||
137 | field are unusable, which means the size of a bzImage kernel | ||
138 | cannot be determined. | ||
134 | 139 | ||
135 | If the "HdrS" (0x53726448) magic number is not found at offset 0x202, | 140 | If the "HdrS" (0x53726448) magic number is not found at offset 0x202, |
136 | the boot protocol version is "old". Loading an old kernel, the | 141 | the boot protocol version is "old". Loading an old kernel, the |
@@ -230,12 +235,16 @@ loader to communicate with the kernel. Some of its options are also | |||
230 | relevant to the boot loader itself, see "special command line options" | 235 | relevant to the boot loader itself, see "special command line options" |
231 | below. | 236 | below. |
232 | 237 | ||
233 | The kernel command line is a null-terminated string up to 255 | 238 | The kernel command line is a null-terminated string currently up to |
234 | characters long, plus the final null. | 239 | 255 characters long, plus the final null. A string that is too long |
240 | will be automatically truncated by the kernel, a boot loader may allow | ||
241 | a longer command line to be passed to permit future kernels to extend | ||
242 | this limit. | ||
235 | 243 | ||
236 | If the boot protocol version is 2.02 or later, the address of the | 244 | If the boot protocol version is 2.02 or later, the address of the |
237 | kernel command line is given by the header field cmd_line_ptr (see | 245 | kernel command line is given by the header field cmd_line_ptr (see |
238 | above.) | 246 | above.) This address can be anywhere between the end of the setup |
247 | heap and 0xA0000. | ||
239 | 248 | ||
240 | If the protocol version is *not* 2.02 or higher, the kernel | 249 | If the protocol version is *not* 2.02 or higher, the kernel |
241 | command line is entered using the following protocol: | 250 | command line is entered using the following protocol: |
@@ -255,7 +264,7 @@ command line is entered using the following protocol: | |||
255 | **** SAMPLE BOOT CONFIGURATION | 264 | **** SAMPLE BOOT CONFIGURATION |
256 | 265 | ||
257 | As a sample configuration, assume the following layout of the real | 266 | As a sample configuration, assume the following layout of the real |
258 | mode segment: | 267 | mode segment (this is a typical, and recommended layout): |
259 | 268 | ||
260 | 0x0000-0x7FFF Real mode kernel | 269 | 0x0000-0x7FFF Real mode kernel |
261 | 0x8000-0x8FFF Stack and heap | 270 | 0x8000-0x8FFF Stack and heap |
@@ -312,9 +321,9 @@ Such a boot loader should enter the following fields in the header: | |||
312 | 321 | ||
313 | **** LOADING THE REST OF THE KERNEL | 322 | **** LOADING THE REST OF THE KERNEL |
314 | 323 | ||
315 | The non-real-mode kernel starts at offset (setup_sects+1)*512 in the | 324 | The 32-bit (non-real-mode) kernel starts at offset (setup_sects+1)*512 |
316 | kernel file (again, if setup_sects == 0 the real value is 4.) It | 325 | in the kernel file (again, if setup_sects == 0 the real value is 4.) |
317 | should be loaded at address 0x10000 for Image/zImage kernels and | 326 | It should be loaded at address 0x10000 for Image/zImage kernels and |
318 | 0x100000 for bzImage kernels. | 327 | 0x100000 for bzImage kernels. |
319 | 328 | ||
320 | The kernel is a bzImage kernel if the protocol >= 2.00 and the 0x01 | 329 | The kernel is a bzImage kernel if the protocol >= 2.00 and the 0x01 |
diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt index 2616a58a5a4b..9a1586590d82 100644 --- a/Documentation/kbuild/makefiles.txt +++ b/Documentation/kbuild/makefiles.txt | |||
@@ -872,7 +872,13 @@ When kbuild executes the following steps are followed (roughly): | |||
872 | Assignments to $(targets) are without $(obj)/ prefix. | 872 | Assignments to $(targets) are without $(obj)/ prefix. |
873 | if_changed may be used in conjunction with custom commands as | 873 | if_changed may be used in conjunction with custom commands as |
874 | defined in 6.7 "Custom kbuild commands". | 874 | defined in 6.7 "Custom kbuild commands". |
875 | |||
875 | Note: It is a typical mistake to forget the FORCE prerequisite. | 876 | Note: It is a typical mistake to forget the FORCE prerequisite. |
877 | Another common pitfall is that whitespace is sometimes | ||
878 | significant; for instance, the below will fail (note the extra space | ||
879 | after the comma): | ||
880 | target: source(s) FORCE | ||
881 | #WRONG!# $(call if_changed, ld/objcopy/gzip) | ||
876 | 882 | ||
877 | ld | 883 | ld |
878 | Link target. Often LDFLAGS_$@ is used to set specific options to ld. | 884 | Link target. Often LDFLAGS_$@ is used to set specific options to ld. |
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 3d5cd7a09b2f..d2f0c67ba1fb 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -1174,6 +1174,11 @@ running once the system is up. | |||
1174 | New name for the ramdisk parameter. | 1174 | New name for the ramdisk parameter. |
1175 | See Documentation/ramdisk.txt. | 1175 | See Documentation/ramdisk.txt. |
1176 | 1176 | ||
1177 | rdinit= [KNL] | ||
1178 | Format: <full_path> | ||
1179 | Run specified binary instead of /init from the ramdisk, | ||
1180 | used for early userspace startup. See initrd. | ||
1181 | |||
1177 | reboot= [BUGS=IA-32,BUGS=ARM,BUGS=IA-64] Rebooting mode | 1182 | reboot= [BUGS=IA-32,BUGS=ARM,BUGS=IA-64] Rebooting mode |
1178 | Format: <reboot_mode>[,<reboot_mode2>[,...]] | 1183 | Format: <reboot_mode>[,<reboot_mode2>[,...]] |
1179 | See arch/*/kernel/reboot.c. | 1184 | See arch/*/kernel/reboot.c. |
diff --git a/Documentation/networking/README.ipw2100 b/Documentation/networking/README.ipw2100 new file mode 100644 index 000000000000..2046948b020d --- /dev/null +++ b/Documentation/networking/README.ipw2100 | |||
@@ -0,0 +1,246 @@ | |||
1 | |||
2 | =========================== | ||
3 | Intel(R) PRO/Wireless 2100 Network Connection Driver for Linux | ||
4 | README.ipw2100 | ||
5 | |||
6 | March 14, 2005 | ||
7 | |||
8 | =========================== | ||
9 | Index | ||
10 | --------------------------- | ||
11 | 0. Introduction | ||
12 | 1. Release 1.1.0 Current Features | ||
13 | 2. Command Line Parameters | ||
14 | 3. Sysfs Helper Files | ||
15 | 4. Radio Kill Switch | ||
16 | 5. Dynamic Firmware | ||
17 | 6. Power Management | ||
18 | 7. Support | ||
19 | 8. License | ||
20 | |||
21 | |||
22 | =========================== | ||
23 | 0. Introduction | ||
24 | ------------ ----- ----- ---- --- -- - | ||
25 | |||
26 | This document provides a brief overview of the features supported by the | ||
27 | IPW2100 driver project. The main project website, where the latest | ||
28 | development version of the driver can be found, is: | ||
29 | |||
30 | http://ipw2100.sourceforge.net | ||
31 | |||
32 | There you can find the not only the latest releases, but also information about | ||
33 | potential fixes and patches, as well as links to the development mailing list | ||
34 | for the driver project. | ||
35 | |||
36 | |||
37 | =========================== | ||
38 | 1. Release 1.1.0 Current Supported Features | ||
39 | --------------------------- | ||
40 | - Managed (BSS) and Ad-Hoc (IBSS) | ||
41 | - WEP (shared key and open) | ||
42 | - Wireless Tools support | ||
43 | - 802.1x (tested with XSupplicant 1.0.1) | ||
44 | |||
45 | Enabled (but not supported) features: | ||
46 | - Monitor/RFMon mode | ||
47 | - WPA/WPA2 | ||
48 | |||
49 | The distinction between officially supported and enabled is a reflection | ||
50 | on the amount of validation and interoperability testing that has been | ||
51 | performed on a given feature. | ||
52 | |||
53 | |||
54 | =========================== | ||
55 | 2. Command Line Parameters | ||
56 | --------------------------- | ||
57 | |||
58 | If the driver is built as a module, the following optional parameters are used | ||
59 | by entering them on the command line with the modprobe command using this | ||
60 | syntax: | ||
61 | |||
62 | modprobe ipw2100 [<option>=<VAL1><,VAL2>...] | ||
63 | |||
64 | For example, to disable the radio on driver loading, enter: | ||
65 | |||
66 | modprobe ipw2100 disable=1 | ||
67 | |||
68 | The ipw2100 driver supports the following module parameters: | ||
69 | |||
70 | Name Value Example: | ||
71 | debug 0x0-0xffffffff debug=1024 | ||
72 | mode 0,1,2 mode=1 /* AdHoc */ | ||
73 | channel int channel=3 /* Only valid in AdHoc or Monitor */ | ||
74 | associate boolean associate=0 /* Do NOT auto associate */ | ||
75 | disable boolean disable=1 /* Do not power the HW */ | ||
76 | |||
77 | |||
78 | =========================== | ||
79 | 3. Sysfs Helper Files | ||
80 | --------------------------- | ||
81 | |||
82 | There are several ways to control the behavior of the driver. Many of the | ||
83 | general capabilities are exposed through the Wireless Tools (iwconfig). There | ||
84 | are a few capabilities that are exposed through entries in the Linux Sysfs. | ||
85 | |||
86 | |||
87 | ----- Driver Level ------ | ||
88 | For the driver level files, look in /sys/bus/pci/drivers/ipw2100/ | ||
89 | |||
90 | debug_level | ||
91 | |||
92 | This controls the same global as the 'debug' module parameter. For | ||
93 | information on the various debugging levels available, run the 'dvals' | ||
94 | script found in the driver source directory. | ||
95 | |||
96 | NOTE: 'debug_level' is only enabled if CONFIG_IPW2100_DEBUG is turn | ||
97 | on. | ||
98 | |||
99 | ----- Device Level ------ | ||
100 | For the device level files look in | ||
101 | |||
102 | /sys/bus/pci/drivers/ipw2100/{PCI-ID}/ | ||
103 | |||
104 | For example: | ||
105 | /sys/bus/pci/drivers/ipw2100/0000:02:01.0 | ||
106 | |||
107 | For the device level files, see /sys/bus/pci/drivers/ipw2100: | ||
108 | |||
109 | rf_kill | ||
110 | read - | ||
111 | 0 = RF kill not enabled (radio on) | ||
112 | 1 = SW based RF kill active (radio off) | ||
113 | 2 = HW based RF kill active (radio off) | ||
114 | 3 = Both HW and SW RF kill active (radio off) | ||
115 | write - | ||
116 | 0 = If SW based RF kill active, turn the radio back on | ||
117 | 1 = If radio is on, activate SW based RF kill | ||
118 | |||
119 | NOTE: If you enable the SW based RF kill and then toggle the HW | ||
120 | based RF kill from ON -> OFF -> ON, the radio will NOT come back on | ||
121 | |||
122 | |||
123 | =========================== | ||
124 | 4. Radio Kill Switch | ||
125 | --------------------------- | ||
126 | Most laptops provide the ability for the user to physically disable the radio. | ||
127 | Some vendors have implemented this as a physical switch that requires no | ||
128 | software to turn the radio off and on. On other laptops, however, the switch | ||
129 | is controlled through a button being pressed and a software driver then making | ||
130 | calls to turn the radio off and on. This is referred to as a "software based | ||
131 | RF kill switch" | ||
132 | |||
133 | See the Sysfs helper file 'rf_kill' for determining the state of the RF switch | ||
134 | on your system. | ||
135 | |||
136 | |||
137 | =========================== | ||
138 | 5. Dynamic Firmware | ||
139 | --------------------------- | ||
140 | As the firmware is licensed under a restricted use license, it can not be | ||
141 | included within the kernel sources. To enable the IPW2100 you will need a | ||
142 | firmware image to load into the wireless NIC's processors. | ||
143 | |||
144 | You can obtain these images from <http://ipw2100.sf.net/firmware.php>. | ||
145 | |||
146 | See INSTALL for instructions on installing the firmware. | ||
147 | |||
148 | |||
149 | =========================== | ||
150 | 6. Power Management | ||
151 | --------------------------- | ||
152 | The IPW2100 supports the configuration of the Power Save Protocol | ||
153 | through a private wireless extension interface. The IPW2100 supports | ||
154 | the following different modes: | ||
155 | |||
156 | off No power management. Radio is always on. | ||
157 | on Automatic power management | ||
158 | 1-5 Different levels of power management. The higher the | ||
159 | number the greater the power savings, but with an impact to | ||
160 | packet latencies. | ||
161 | |||
162 | Power management works by powering down the radio after a certain | ||
163 | interval of time has passed where no packets are passed through the | ||
164 | radio. Once powered down, the radio remains in that state for a given | ||
165 | period of time. For higher power savings, the interval between last | ||
166 | packet processed to sleep is shorter and the sleep period is longer. | ||
167 | |||
168 | When the radio is asleep, the access point sending data to the station | ||
169 | must buffer packets at the AP until the station wakes up and requests | ||
170 | any buffered packets. If you have an AP that does not correctly support | ||
171 | the PSP protocol you may experience packet loss or very poor performance | ||
172 | while power management is enabled. If this is the case, you will need | ||
173 | to try and find a firmware update for your AP, or disable power | ||
174 | management (via `iwconfig eth1 power off`) | ||
175 | |||
176 | To configure the power level on the IPW2100 you use a combination of | ||
177 | iwconfig and iwpriv. iwconfig is used to turn power management on, off, | ||
178 | and set it to auto. | ||
179 | |||
180 | iwconfig eth1 power off Disables radio power down | ||
181 | iwconfig eth1 power on Enables radio power management to | ||
182 | last set level (defaults to AUTO) | ||
183 | iwpriv eth1 set_power 0 Sets power level to AUTO and enables | ||
184 | power management if not previously | ||
185 | enabled. | ||
186 | iwpriv eth1 set_power 1-5 Set the power level as specified, | ||
187 | enabling power management if not | ||
188 | previously enabled. | ||
189 | |||
190 | You can view the current power level setting via: | ||
191 | |||
192 | iwpriv eth1 get_power | ||
193 | |||
194 | It will return the current period or timeout that is configured as a string | ||
195 | in the form of xxxx/yyyy (z) where xxxx is the timeout interval (amount of | ||
196 | time after packet processing), yyyy is the period to sleep (amount of time to | ||
197 | wait before powering the radio and querying the access point for buffered | ||
198 | packets), and z is the 'power level'. If power management is turned off the | ||
199 | xxxx/yyyy will be replaced with 'off' -- the level reported will be the active | ||
200 | level if `iwconfig eth1 power on` is invoked. | ||
201 | |||
202 | |||
203 | =========================== | ||
204 | 7. Support | ||
205 | --------------------------- | ||
206 | |||
207 | For general development information and support, | ||
208 | go to: | ||
209 | |||
210 | http://ipw2100.sf.net/ | ||
211 | |||
212 | The ipw2100 1.1.0 driver and firmware can be downloaded from: | ||
213 | |||
214 | http://support.intel.com | ||
215 | |||
216 | For installation support on the ipw2100 1.1.0 driver on Linux kernels | ||
217 | 2.6.8 or greater, email support is available from: | ||
218 | |||
219 | http://supportmail.intel.com | ||
220 | |||
221 | =========================== | ||
222 | 8. License | ||
223 | --------------------------- | ||
224 | |||
225 | Copyright(c) 2003 - 2005 Intel Corporation. All rights reserved. | ||
226 | |||
227 | This program is free software; you can redistribute it and/or modify it | ||
228 | under the terms of the GNU General Public License (version 2) as | ||
229 | published by the Free Software Foundation. | ||
230 | |||
231 | This program is distributed in the hope that it will be useful, but WITHOUT | ||
232 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
233 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
234 | more details. | ||
235 | |||
236 | You should have received a copy of the GNU General Public License along with | ||
237 | this program; if not, write to the Free Software Foundation, Inc., 59 | ||
238 | Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
239 | |||
240 | The full GNU General Public License is included in this distribution in the | ||
241 | file called LICENSE. | ||
242 | |||
243 | License Contact Information: | ||
244 | James P. Ketrenos <ipw2100-admin@linux.intel.com> | ||
245 | Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 | ||
246 | |||
diff --git a/Documentation/networking/README.ipw2200 b/Documentation/networking/README.ipw2200 new file mode 100644 index 000000000000..6916080c5f03 --- /dev/null +++ b/Documentation/networking/README.ipw2200 | |||
@@ -0,0 +1,300 @@ | |||
1 | |||
2 | Intel(R) PRO/Wireless 2915ABG Driver for Linux in support of: | ||
3 | |||
4 | Intel(R) PRO/Wireless 2200BG Network Connection | ||
5 | Intel(R) PRO/Wireless 2915ABG Network Connection | ||
6 | |||
7 | Note: The Intel(R) PRO/Wireless 2915ABG Driver for Linux and Intel(R) | ||
8 | PRO/Wireless 2200BG Driver for Linux is a unified driver that works on | ||
9 | both hardware adapters listed above. In this document the Intel(R) | ||
10 | PRO/Wireless 2915ABG Driver for Linux will be used to reference the | ||
11 | unified driver. | ||
12 | |||
13 | Copyright (C) 2004-2005, Intel Corporation | ||
14 | |||
15 | README.ipw2200 | ||
16 | |||
17 | Version: 1.0.0 | ||
18 | Date : January 31, 2005 | ||
19 | |||
20 | |||
21 | Index | ||
22 | ----------------------------------------------- | ||
23 | 1. Introduction | ||
24 | 1.1. Overview of features | ||
25 | 1.2. Module parameters | ||
26 | 1.3. Wireless Extension Private Methods | ||
27 | 1.4. Sysfs Helper Files | ||
28 | 2. About the Version Numbers | ||
29 | 3. Support | ||
30 | 4. License | ||
31 | |||
32 | |||
33 | 1. Introduction | ||
34 | ----------------------------------------------- | ||
35 | The following sections attempt to provide a brief introduction to using | ||
36 | the Intel(R) PRO/Wireless 2915ABG Driver for Linux. | ||
37 | |||
38 | This document is not meant to be a comprehensive manual on | ||
39 | understanding or using wireless technologies, but should be sufficient | ||
40 | to get you moving without wires on Linux. | ||
41 | |||
42 | For information on building and installing the driver, see the INSTALL | ||
43 | file. | ||
44 | |||
45 | |||
46 | 1.1. Overview of Features | ||
47 | ----------------------------------------------- | ||
48 | The current release (1.0.0) supports the following features: | ||
49 | |||
50 | + BSS mode (Infrastructure, Managed) | ||
51 | + IBSS mode (Ad-Hoc) | ||
52 | + WEP (OPEN and SHARED KEY mode) | ||
53 | + 802.1x EAP via wpa_supplicant and xsupplicant | ||
54 | + Wireless Extension support | ||
55 | + Full B and G rate support (2200 and 2915) | ||
56 | + Full A rate support (2915 only) | ||
57 | + Transmit power control | ||
58 | + S state support (ACPI suspend/resume) | ||
59 | + long/short preamble support | ||
60 | |||
61 | |||
62 | |||
63 | 1.2. Command Line Parameters | ||
64 | ----------------------------------------------- | ||
65 | |||
66 | Like many modules used in the Linux kernel, the Intel(R) PRO/Wireless | ||
67 | 2915ABG Driver for Linux allows certain configuration options to be | ||
68 | provided as module parameters. The most common way to specify a module | ||
69 | parameter is via the command line. | ||
70 | |||
71 | The general form is: | ||
72 | |||
73 | % modprobe ipw2200 parameter=value | ||
74 | |||
75 | Where the supported parameter are: | ||
76 | |||
77 | associate | ||
78 | Set to 0 to disable the auto scan-and-associate functionality of the | ||
79 | driver. If disabled, the driver will not attempt to scan | ||
80 | for and associate to a network until it has been configured with | ||
81 | one or more properties for the target network, for example configuring | ||
82 | the network SSID. Default is 1 (auto-associate) | ||
83 | |||
84 | Example: % modprobe ipw2200 associate=0 | ||
85 | |||
86 | auto_create | ||
87 | Set to 0 to disable the auto creation of an Ad-Hoc network | ||
88 | matching the channel and network name parameters provided. | ||
89 | Default is 1. | ||
90 | |||
91 | channel | ||
92 | channel number for association. The normal method for setting | ||
93 | the channel would be to use the standard wireless tools | ||
94 | (i.e. `iwconfig eth1 channel 10`), but it is useful sometimes | ||
95 | to set this while debugging. Channel 0 means 'ANY' | ||
96 | |||
97 | debug | ||
98 | If using a debug build, this is used to control the amount of debug | ||
99 | info is logged. See the 'dval' and 'load' script for more info on | ||
100 | how to use this (the dval and load scripts are provided as part | ||
101 | of the ipw2200 development snapshot releases available from the | ||
102 | SourceForge project at http://ipw2200.sf.net) | ||
103 | |||
104 | mode | ||
105 | Can be used to set the default mode of the adapter. | ||
106 | 0 = Managed, 1 = Ad-Hoc | ||
107 | |||
108 | |||
109 | 1.3. Wireless Extension Private Methods | ||
110 | ----------------------------------------------- | ||
111 | |||
112 | As an interface designed to handle generic hardware, there are certain | ||
113 | capabilities not exposed through the normal Wireless Tool interface. As | ||
114 | such, a provision is provided for a driver to declare custom, or | ||
115 | private, methods. The Intel(R) PRO/Wireless 2915ABG Driver for Linux | ||
116 | defines several of these to configure various settings. | ||
117 | |||
118 | The general form of using the private wireless methods is: | ||
119 | |||
120 | % iwpriv $IFNAME method parameters | ||
121 | |||
122 | Where $IFNAME is the interface name the device is registered with | ||
123 | (typically eth1, customized via one of the various network interface | ||
124 | name managers, such as ifrename) | ||
125 | |||
126 | The supported private methods are: | ||
127 | |||
128 | get_mode | ||
129 | Can be used to report out which IEEE mode the driver is | ||
130 | configured to support. Example: | ||
131 | |||
132 | % iwpriv eth1 get_mode | ||
133 | eth1 get_mode:802.11bg (6) | ||
134 | |||
135 | set_mode | ||
136 | Can be used to configure which IEEE mode the driver will | ||
137 | support. | ||
138 | |||
139 | Usage: | ||
140 | % iwpriv eth1 set_mode {mode} | ||
141 | Where {mode} is a number in the range 1-7: | ||
142 | 1 802.11a (2915 only) | ||
143 | 2 802.11b | ||
144 | 3 802.11ab (2915 only) | ||
145 | 4 802.11g | ||
146 | 5 802.11ag (2915 only) | ||
147 | 6 802.11bg | ||
148 | 7 802.11abg (2915 only) | ||
149 | |||
150 | get_preamble | ||
151 | Can be used to report configuration of preamble length. | ||
152 | |||
153 | set_preamble | ||
154 | Can be used to set the configuration of preamble length: | ||
155 | |||
156 | Usage: | ||
157 | % iwpriv eth1 set_preamble {mode} | ||
158 | Where {mode} is one of: | ||
159 | 1 Long preamble only | ||
160 | 0 Auto (long or short based on connection) | ||
161 | |||
162 | |||
163 | 1.4. Sysfs Helper Files: | ||
164 | ----------------------------------------------- | ||
165 | |||
166 | The Linux kernel provides a pseudo file system that can be used to | ||
167 | access various components of the operating system. The Intel(R) | ||
168 | PRO/Wireless 2915ABG Driver for Linux exposes several configuration | ||
169 | parameters through this mechanism. | ||
170 | |||
171 | An entry in the sysfs can support reading and/or writing. You can | ||
172 | typically query the contents of a sysfs entry through the use of cat, | ||
173 | and can set the contents via echo. For example: | ||
174 | |||
175 | % cat /sys/bus/pci/drivers/ipw2200/debug_level | ||
176 | |||
177 | Will report the current debug level of the driver's logging subsystem | ||
178 | (only available if CONFIG_IPW_DEBUG was configured when the driver was | ||
179 | built). | ||
180 | |||
181 | You can set the debug level via: | ||
182 | |||
183 | % echo $VALUE > /sys/bus/pci/drivers/ipw2200/debug_level | ||
184 | |||
185 | Where $VALUE would be a number in the case of this sysfs entry. The | ||
186 | input to sysfs files does not have to be a number. For example, the | ||
187 | firmware loader used by hotplug utilizes sysfs entries for transferring | ||
188 | the firmware image from user space into the driver. | ||
189 | |||
190 | The Intel(R) PRO/Wireless 2915ABG Driver for Linux exposes sysfs entries | ||
191 | at two levels -- driver level, which apply to all instances of the | ||
192 | driver (in the event that there are more than one device installed) and | ||
193 | device level, which applies only to the single specific instance. | ||
194 | |||
195 | |||
196 | 1.4.1 Driver Level Sysfs Helper Files | ||
197 | ----------------------------------------------- | ||
198 | |||
199 | For the driver level files, look in /sys/bus/pci/drivers/ipw2200/ | ||
200 | |||
201 | debug_level | ||
202 | |||
203 | This controls the same global as the 'debug' module parameter | ||
204 | |||
205 | |||
206 | 1.4.2 Device Level Sysfs Helper Files | ||
207 | ----------------------------------------------- | ||
208 | |||
209 | For the device level files, look in | ||
210 | |||
211 | /sys/bus/pci/drivers/ipw2200/{PCI-ID}/ | ||
212 | |||
213 | For example: | ||
214 | /sys/bus/pci/drivers/ipw2200/0000:02:01.0 | ||
215 | |||
216 | For the device level files, see /sys/bus/pci/[drivers/ipw2200: | ||
217 | |||
218 | rf_kill | ||
219 | read - | ||
220 | 0 = RF kill not enabled (radio on) | ||
221 | 1 = SW based RF kill active (radio off) | ||
222 | 2 = HW based RF kill active (radio off) | ||
223 | 3 = Both HW and SW RF kill active (radio off) | ||
224 | write - | ||
225 | 0 = If SW based RF kill active, turn the radio back on | ||
226 | 1 = If radio is on, activate SW based RF kill | ||
227 | |||
228 | NOTE: If you enable the SW based RF kill and then toggle the HW | ||
229 | based RF kill from ON -> OFF -> ON, the radio will NOT come back on | ||
230 | |||
231 | ucode | ||
232 | read-only access to the ucode version number | ||
233 | |||
234 | |||
235 | 2. About the Version Numbers | ||
236 | ----------------------------------------------- | ||
237 | |||
238 | Due to the nature of open source development projects, there are | ||
239 | frequently changes being incorporated that have not gone through | ||
240 | a complete validation process. These changes are incorporated into | ||
241 | development snapshot releases. | ||
242 | |||
243 | Releases are numbered with a three level scheme: | ||
244 | |||
245 | major.minor.development | ||
246 | |||
247 | Any version where the 'development' portion is 0 (for example | ||
248 | 1.0.0, 1.1.0, etc.) indicates a stable version that will be made | ||
249 | available for kernel inclusion. | ||
250 | |||
251 | Any version where the 'development' portion is not a 0 (for | ||
252 | example 1.0.1, 1.1.5, etc.) indicates a development version that is | ||
253 | being made available for testing and cutting edge users. The stability | ||
254 | and functionality of the development releases are not know. We make | ||
255 | efforts to try and keep all snapshots reasonably stable, but due to the | ||
256 | frequency of their release, and the desire to get those releases | ||
257 | available as quickly as possible, unknown anomalies should be expected. | ||
258 | |||
259 | The major version number will be incremented when significant changes | ||
260 | are made to the driver. Currently, there are no major changes planned. | ||
261 | |||
262 | |||
263 | 3. Support | ||
264 | ----------------------------------------------- | ||
265 | |||
266 | For installation support of the 1.0.0 version, you can contact | ||
267 | http://supportmail.intel.com, or you can use the open source project | ||
268 | support. | ||
269 | |||
270 | For general information and support, go to: | ||
271 | |||
272 | http://ipw2200.sf.net/ | ||
273 | |||
274 | |||
275 | 4. License | ||
276 | ----------------------------------------------- | ||
277 | |||
278 | Copyright(c) 2003 - 2005 Intel Corporation. All rights reserved. | ||
279 | |||
280 | This program is free software; you can redistribute it and/or modify it | ||
281 | under the terms of the GNU General Public License version 2 as | ||
282 | published by the Free Software Foundation. | ||
283 | |||
284 | This program is distributed in the hope that it will be useful, but WITHOUT | ||
285 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
286 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
287 | more details. | ||
288 | |||
289 | You should have received a copy of the GNU General Public License along with | ||
290 | this program; if not, write to the Free Software Foundation, Inc., 59 | ||
291 | Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
292 | |||
293 | The full GNU General Public License is included in this distribution in the | ||
294 | file called LICENSE. | ||
295 | |||
296 | Contact Information: | ||
297 | James P. Ketrenos <ipw2100-admin@linux.intel.com> | ||
298 | Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 | ||
299 | |||
300 | |||
diff --git a/Documentation/networking/cxgb.txt b/Documentation/networking/cxgb.txt new file mode 100644 index 000000000000..76324638626b --- /dev/null +++ b/Documentation/networking/cxgb.txt | |||
@@ -0,0 +1,352 @@ | |||
1 | Chelsio N210 10Gb Ethernet Network Controller | ||
2 | |||
3 | Driver Release Notes for Linux | ||
4 | |||
5 | Version 2.1.1 | ||
6 | |||
7 | June 20, 2005 | ||
8 | |||
9 | CONTENTS | ||
10 | ======== | ||
11 | INTRODUCTION | ||
12 | FEATURES | ||
13 | PERFORMANCE | ||
14 | DRIVER MESSAGES | ||
15 | KNOWN ISSUES | ||
16 | SUPPORT | ||
17 | |||
18 | |||
19 | INTRODUCTION | ||
20 | ============ | ||
21 | |||
22 | This document describes the Linux driver for Chelsio 10Gb Ethernet Network | ||
23 | Controller. This driver supports the Chelsio N210 NIC and is backward | ||
24 | compatible with the Chelsio N110 model 10Gb NICs. | ||
25 | |||
26 | |||
27 | FEATURES | ||
28 | ======== | ||
29 | |||
30 | Adaptive Interrupts (adaptive-rx) | ||
31 | --------------------------------- | ||
32 | |||
33 | This feature provides an adaptive algorithm that adjusts the interrupt | ||
34 | coalescing parameters, allowing the driver to dynamically adapt the latency | ||
35 | settings to achieve the highest performance during various types of network | ||
36 | load. | ||
37 | |||
38 | The interface used to control this feature is ethtool. Please see the | ||
39 | ethtool manpage for additional usage information. | ||
40 | |||
41 | By default, adaptive-rx is disabled. | ||
42 | To enable adaptive-rx: | ||
43 | |||
44 | ethtool -C <interface> adaptive-rx on | ||
45 | |||
46 | To disable adaptive-rx, use ethtool: | ||
47 | |||
48 | ethtool -C <interface> adaptive-rx off | ||
49 | |||
50 | After disabling adaptive-rx, the timer latency value will be set to 50us. | ||
51 | You may set the timer latency after disabling adaptive-rx: | ||
52 | |||
53 | ethtool -C <interface> rx-usecs <microseconds> | ||
54 | |||
55 | An example to set the timer latency value to 100us on eth0: | ||
56 | |||
57 | ethtool -C eth0 rx-usecs 100 | ||
58 | |||
59 | You may also provide a timer latency value while disabling adpative-rx: | ||
60 | |||
61 | ethtool -C <interface> adaptive-rx off rx-usecs <microseconds> | ||
62 | |||
63 | If adaptive-rx is disabled and a timer latency value is specified, the timer | ||
64 | will be set to the specified value until changed by the user or until | ||
65 | adaptive-rx is enabled. | ||
66 | |||
67 | To view the status of the adaptive-rx and timer latency values: | ||
68 | |||
69 | ethtool -c <interface> | ||
70 | |||
71 | |||
72 | TCP Segmentation Offloading (TSO) Support | ||
73 | ----------------------------------------- | ||
74 | |||
75 | This feature, also known as "large send", enables a system's protocol stack | ||
76 | to offload portions of outbound TCP processing to a network interface card | ||
77 | thereby reducing system CPU utilization and enhancing performance. | ||
78 | |||
79 | The interface used to control this feature is ethtool version 1.8 or higher. | ||
80 | Please see the ethtool manpage for additional usage information. | ||
81 | |||
82 | By default, TSO is enabled. | ||
83 | To disable TSO: | ||
84 | |||
85 | ethtool -K <interface> tso off | ||
86 | |||
87 | To enable TSO: | ||
88 | |||
89 | ethtool -K <interface> tso on | ||
90 | |||
91 | To view the status of TSO: | ||
92 | |||
93 | ethtool -k <interface> | ||
94 | |||
95 | |||
96 | PERFORMANCE | ||
97 | =========== | ||
98 | |||
99 | The following information is provided as an example of how to change system | ||
100 | parameters for "performance tuning" an what value to use. You may or may not | ||
101 | want to change these system parameters, depending on your server/workstation | ||
102 | application. Doing so is not warranted in any way by Chelsio Communications, | ||
103 | and is done at "YOUR OWN RISK". Chelsio will not be held responsible for loss | ||
104 | of data or damage to equipment. | ||
105 | |||
106 | Your distribution may have a different way of doing things, or you may prefer | ||
107 | a different method. These commands are shown only to provide an example of | ||
108 | what to do and are by no means definitive. | ||
109 | |||
110 | Making any of the following system changes will only last until you reboot | ||
111 | your system. You may want to write a script that runs at boot-up which | ||
112 | includes the optimal settings for your system. | ||
113 | |||
114 | Setting PCI Latency Timer: | ||
115 | setpci -d 1425:* 0x0c.l=0x0000F800 | ||
116 | |||
117 | Disabling TCP timestamp: | ||
118 | sysctl -w net.ipv4.tcp_timestamps=0 | ||
119 | |||
120 | Disabling SACK: | ||
121 | sysctl -w net.ipv4.tcp_sack=0 | ||
122 | |||
123 | Setting large number of incoming connection requests: | ||
124 | sysctl -w net.ipv4.tcp_max_syn_backlog=3000 | ||
125 | |||
126 | Setting maximum receive socket buffer size: | ||
127 | sysctl -w net.core.rmem_max=1024000 | ||
128 | |||
129 | Setting maximum send socket buffer size: | ||
130 | sysctl -w net.core.wmem_max=1024000 | ||
131 | |||
132 | Set smp_affinity (on a multiprocessor system) to a single CPU: | ||
133 | echo 1 > /proc/irq/<interrupt_number>/smp_affinity | ||
134 | |||
135 | Setting default receive socket buffer size: | ||
136 | sysctl -w net.core.rmem_default=524287 | ||
137 | |||
138 | Setting default send socket buffer size: | ||
139 | sysctl -w net.core.wmem_default=524287 | ||
140 | |||
141 | Setting maximum option memory buffers: | ||
142 | sysctl -w net.core.optmem_max=524287 | ||
143 | |||
144 | Setting maximum backlog (# of unprocessed packets before kernel drops): | ||
145 | sysctl -w net.core.netdev_max_backlog=300000 | ||
146 | |||
147 | Setting TCP read buffers (min/default/max): | ||
148 | sysctl -w net.ipv4.tcp_rmem="10000000 10000000 10000000" | ||
149 | |||
150 | Setting TCP write buffers (min/pressure/max): | ||
151 | sysctl -w net.ipv4.tcp_wmem="10000000 10000000 10000000" | ||
152 | |||
153 | Setting TCP buffer space (min/pressure/max): | ||
154 | sysctl -w net.ipv4.tcp_mem="10000000 10000000 10000000" | ||
155 | |||
156 | TCP window size for single connections: | ||
157 | The receive buffer (RX_WINDOW) size must be at least as large as the | ||
158 | Bandwidth-Delay Product of the communication link between the sender and | ||
159 | receiver. Due to the variations of RTT, you may want to increase the buffer | ||
160 | size up to 2 times the Bandwidth-Delay Product. Reference page 289 of | ||
161 | "TCP/IP Illustrated, Volume 1, The Protocols" by W. Richard Stevens. | ||
162 | At 10Gb speeds, use the following formula: | ||
163 | RX_WINDOW >= 1.25MBytes * RTT(in milliseconds) | ||
164 | Example for RTT with 100us: RX_WINDOW = (1,250,000 * 0.1) = 125,000 | ||
165 | RX_WINDOW sizes of 256KB - 512KB should be sufficient. | ||
166 | Setting the min, max, and default receive buffer (RX_WINDOW) size: | ||
167 | sysctl -w net.ipv4.tcp_rmem="<min> <default> <max>" | ||
168 | |||
169 | TCP window size for multiple connections: | ||
170 | The receive buffer (RX_WINDOW) size may be calculated the same as single | ||
171 | connections, but should be divided by the number of connections. The | ||
172 | smaller window prevents congestion and facilitates better pacing, | ||
173 | especially if/when MAC level flow control does not work well or when it is | ||
174 | not supported on the machine. Experimentation may be necessary to attain | ||
175 | the correct value. This method is provided as a starting point fot the | ||
176 | correct receive buffer size. | ||
177 | Setting the min, max, and default receive buffer (RX_WINDOW) size is | ||
178 | performed in the same manner as single connection. | ||
179 | |||
180 | |||
181 | DRIVER MESSAGES | ||
182 | =============== | ||
183 | |||
184 | The following messages are the most common messages logged by syslog. These | ||
185 | may be found in /var/log/messages. | ||
186 | |||
187 | Driver up: | ||
188 | Chelsio Network Driver - version 2.1.1 | ||
189 | |||
190 | NIC detected: | ||
191 | eth#: Chelsio N210 1x10GBaseX NIC (rev #), PCIX 133MHz/64-bit | ||
192 | |||
193 | Link up: | ||
194 | eth#: link is up at 10 Gbps, full duplex | ||
195 | |||
196 | Link down: | ||
197 | eth#: link is down | ||
198 | |||
199 | |||
200 | KNOWN ISSUES | ||
201 | ============ | ||
202 | |||
203 | These issues have been identified during testing. The following information | ||
204 | is provided as a workaround to the problem. In some cases, this problem is | ||
205 | inherent to Linux or to a particular Linux Distribution and/or hardware | ||
206 | platform. | ||
207 | |||
208 | 1. Large number of TCP retransmits on a multiprocessor (SMP) system. | ||
209 | |||
210 | On a system with multiple CPUs, the interrupt (IRQ) for the network | ||
211 | controller may be bound to more than one CPU. This will cause TCP | ||
212 | retransmits if the packet data were to be split across different CPUs | ||
213 | and re-assembled in a different order than expected. | ||
214 | |||
215 | To eliminate the TCP retransmits, set smp_affinity on the particular | ||
216 | interrupt to a single CPU. You can locate the interrupt (IRQ) used on | ||
217 | the N110/N210 by using ifconfig: | ||
218 | ifconfig <dev_name> | grep Interrupt | ||
219 | Set the smp_affinity to a single CPU: | ||
220 | echo 1 > /proc/irq/<interrupt_number>/smp_affinity | ||
221 | |||
222 | It is highly suggested that you do not run the irqbalance daemon on your | ||
223 | system, as this will change any smp_affinity setting you have applied. | ||
224 | The irqbalance daemon runs on a 10 second interval and binds interrupts | ||
225 | to the least loaded CPU determined by the daemon. To disable this daemon: | ||
226 | chkconfig --level 2345 irqbalance off | ||
227 | |||
228 | By default, some Linux distributions enable the kernel feature, | ||
229 | irqbalance, which performs the same function as the daemon. To disable | ||
230 | this feature, add the following line to your bootloader: | ||
231 | noirqbalance | ||
232 | |||
233 | Example using the Grub bootloader: | ||
234 | title Red Hat Enterprise Linux AS (2.4.21-27.ELsmp) | ||
235 | root (hd0,0) | ||
236 | kernel /vmlinuz-2.4.21-27.ELsmp ro root=/dev/hda3 noirqbalance | ||
237 | initrd /initrd-2.4.21-27.ELsmp.img | ||
238 | |||
239 | 2. After running insmod, the driver is loaded and the incorrect network | ||
240 | interface is brought up without running ifup. | ||
241 | |||
242 | When using 2.4.x kernels, including RHEL kernels, the Linux kernel | ||
243 | invokes a script named "hotplug". This script is primarily used to | ||
244 | automatically bring up USB devices when they are plugged in, however, | ||
245 | the script also attempts to automatically bring up a network interface | ||
246 | after loading the kernel module. The hotplug script does this by scanning | ||
247 | the ifcfg-eth# config files in /etc/sysconfig/network-scripts, looking | ||
248 | for HWADDR=<mac_address>. | ||
249 | |||
250 | If the hotplug script does not find the HWADDRR within any of the | ||
251 | ifcfg-eth# files, it will bring up the device with the next available | ||
252 | interface name. If this interface is already configured for a different | ||
253 | network card, your new interface will have incorrect IP address and | ||
254 | network settings. | ||
255 | |||
256 | To solve this issue, you can add the HWADDR=<mac_address> key to the | ||
257 | interface config file of your network controller. | ||
258 | |||
259 | To disable this "hotplug" feature, you may add the driver (module name) | ||
260 | to the "blacklist" file located in /etc/hotplug. It has been noted that | ||
261 | this does not work for network devices because the net.agent script | ||
262 | does not use the blacklist file. Simply remove, or rename, the net.agent | ||
263 | script located in /etc/hotplug to disable this feature. | ||
264 | |||
265 | 3. Transport Protocol (TP) hangs when running heavy multi-connection traffic | ||
266 | on an AMD Opteron system with HyperTransport PCI-X Tunnel chipset. | ||
267 | |||
268 | If your AMD Opteron system uses the AMD-8131 HyperTransport PCI-X Tunnel | ||
269 | chipset, you may experience the "133-Mhz Mode Split Completion Data | ||
270 | Corruption" bug identified by AMD while using a 133Mhz PCI-X card on the | ||
271 | bus PCI-X bus. | ||
272 | |||
273 | AMD states, "Under highly specific conditions, the AMD-8131 PCI-X Tunnel | ||
274 | can provide stale data via split completion cycles to a PCI-X card that | ||
275 | is operating at 133 Mhz", causing data corruption. | ||
276 | |||
277 | AMD's provides three workarounds for this problem, however, Chelsio | ||
278 | recommends the first option for best performance with this bug: | ||
279 | |||
280 | For 133Mhz secondary bus operation, limit the transaction length and | ||
281 | the number of outstanding transactions, via BIOS configuration | ||
282 | programming of the PCI-X card, to the following: | ||
283 | |||
284 | Data Length (bytes): 1k | ||
285 | Total allowed outstanding transactions: 2 | ||
286 | |||
287 | Please refer to AMD 8131-HT/PCI-X Errata 26310 Rev 3.08 August 2004, | ||
288 | section 56, "133-MHz Mode Split Completion Data Corruption" for more | ||
289 | details with this bug and workarounds suggested by AMD. | ||
290 | |||
291 | It may be possible to work outside AMD's recommended PCI-X settings, try | ||
292 | increasing the Data Length to 2k bytes for increased performance. If you | ||
293 | have issues with these settings, please revert to the "safe" settings | ||
294 | and duplicate the problem before submitting a bug or asking for support. | ||
295 | |||
296 | NOTE: The default setting on most systems is 8 outstanding transactions | ||
297 | and 2k bytes data length. | ||
298 | |||
299 | 4. On multiprocessor systems, it has been noted that an application which | ||
300 | is handling 10Gb networking can switch between CPUs causing degraded | ||
301 | and/or unstable performance. | ||
302 | |||
303 | If running on an SMP system and taking performance measurements, it | ||
304 | is suggested you either run the latest netperf-2.4.0+ or use a binding | ||
305 | tool such as Tim Hockin's procstate utilities (runon) | ||
306 | <http://www.hockin.org/~thockin/procstate/>. | ||
307 | |||
308 | Binding netserver and netperf (or other applications) to particular | ||
309 | CPUs will have a significant difference in performance measurements. | ||
310 | You may need to experiment which CPU to bind the application to in | ||
311 | order to achieve the best performance for your system. | ||
312 | |||
313 | If you are developing an application designed for 10Gb networking, | ||
314 | please keep in mind you may want to look at kernel functions | ||
315 | sched_setaffinity & sched_getaffinity to bind your application. | ||
316 | |||
317 | If you are just running user-space applications such as ftp, telnet, | ||
318 | etc., you may want to try the runon tool provided by Tim Hockin's | ||
319 | procstate utility. You could also try binding the interface to a | ||
320 | particular CPU: runon 0 ifup eth0 | ||
321 | |||
322 | |||
323 | SUPPORT | ||
324 | ======= | ||
325 | |||
326 | If you have problems with the software or hardware, please contact our | ||
327 | customer support team via email at support@chelsio.com or check our website | ||
328 | at http://www.chelsio.com | ||
329 | |||
330 | =============================================================================== | ||
331 | |||
332 | Chelsio Communications | ||
333 | 370 San Aleso Ave. | ||
334 | Suite 100 | ||
335 | Sunnyvale, CA 94085 | ||
336 | http://www.chelsio.com | ||
337 | |||
338 | This program is free software; you can redistribute it and/or modify | ||
339 | it under the terms of the GNU General Public License, version 2, as | ||
340 | published by the Free Software Foundation. | ||
341 | |||
342 | You should have received a copy of the GNU General Public License along | ||
343 | with this program; if not, write to the Free Software Foundation, Inc., | ||
344 | 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
345 | |||
346 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED | ||
347 | WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF | ||
348 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
349 | |||
350 | Copyright (c) 2003-2005 Chelsio Communications. All rights reserved. | ||
351 | |||
352 | =============================================================================== | ||
diff --git a/Documentation/networking/phy.txt b/Documentation/networking/phy.txt new file mode 100644 index 000000000000..29ccae409031 --- /dev/null +++ b/Documentation/networking/phy.txt | |||
@@ -0,0 +1,288 @@ | |||
1 | |||
2 | ------- | ||
3 | PHY Abstraction Layer | ||
4 | (Updated 2005-07-21) | ||
5 | |||
6 | Purpose | ||
7 | |||
8 | Most network devices consist of set of registers which provide an interface | ||
9 | to a MAC layer, which communicates with the physical connection through a | ||
10 | PHY. The PHY concerns itself with negotiating link parameters with the link | ||
11 | partner on the other side of the network connection (typically, an ethernet | ||
12 | cable), and provides a register interface to allow drivers to determine what | ||
13 | settings were chosen, and to configure what settings are allowed. | ||
14 | |||
15 | While these devices are distinct from the network devices, and conform to a | ||
16 | standard layout for the registers, it has been common practice to integrate | ||
17 | the PHY management code with the network driver. This has resulted in large | ||
18 | amounts of redundant code. Also, on embedded systems with multiple (and | ||
19 | sometimes quite different) ethernet controllers connected to the same | ||
20 | management bus, it is difficult to ensure safe use of the bus. | ||
21 | |||
22 | Since the PHYs are devices, and the management busses through which they are | ||
23 | accessed are, in fact, busses, the PHY Abstraction Layer treats them as such. | ||
24 | In doing so, it has these goals: | ||
25 | |||
26 | 1) Increase code-reuse | ||
27 | 2) Increase overall code-maintainability | ||
28 | 3) Speed development time for new network drivers, and for new systems | ||
29 | |||
30 | Basically, this layer is meant to provide an interface to PHY devices which | ||
31 | allows network driver writers to write as little code as possible, while | ||
32 | still providing a full feature set. | ||
33 | |||
34 | The MDIO bus | ||
35 | |||
36 | Most network devices are connected to a PHY by means of a management bus. | ||
37 | Different devices use different busses (though some share common interfaces). | ||
38 | In order to take advantage of the PAL, each bus interface needs to be | ||
39 | registered as a distinct device. | ||
40 | |||
41 | 1) read and write functions must be implemented. Their prototypes are: | ||
42 | |||
43 | int write(struct mii_bus *bus, int mii_id, int regnum, u16 value); | ||
44 | int read(struct mii_bus *bus, int mii_id, int regnum); | ||
45 | |||
46 | mii_id is the address on the bus for the PHY, and regnum is the register | ||
47 | number. These functions are guaranteed not to be called from interrupt | ||
48 | time, so it is safe for them to block, waiting for an interrupt to signal | ||
49 | the operation is complete | ||
50 | |||
51 | 2) A reset function is necessary. This is used to return the bus to an | ||
52 | initialized state. | ||
53 | |||
54 | 3) A probe function is needed. This function should set up anything the bus | ||
55 | driver needs, setup the mii_bus structure, and register with the PAL using | ||
56 | mdiobus_register. Similarly, there's a remove function to undo all of | ||
57 | that (use mdiobus_unregister). | ||
58 | |||
59 | 4) Like any driver, the device_driver structure must be configured, and init | ||
60 | exit functions are used to register the driver. | ||
61 | |||
62 | 5) The bus must also be declared somewhere as a device, and registered. | ||
63 | |||
64 | As an example for how one driver implemented an mdio bus driver, see | ||
65 | drivers/net/gianfar_mii.c and arch/ppc/syslib/mpc85xx_devices.c | ||
66 | |||
67 | Connecting to a PHY | ||
68 | |||
69 | Sometime during startup, the network driver needs to establish a connection | ||
70 | between the PHY device, and the network device. At this time, the PHY's bus | ||
71 | and drivers need to all have been loaded, so it is ready for the connection. | ||
72 | At this point, there are several ways to connect to the PHY: | ||
73 | |||
74 | 1) The PAL handles everything, and only calls the network driver when | ||
75 | the link state changes, so it can react. | ||
76 | |||
77 | 2) The PAL handles everything except interrupts (usually because the | ||
78 | controller has the interrupt registers). | ||
79 | |||
80 | 3) The PAL handles everything, but checks in with the driver every second, | ||
81 | allowing the network driver to react first to any changes before the PAL | ||
82 | does. | ||
83 | |||
84 | 4) The PAL serves only as a library of functions, with the network device | ||
85 | manually calling functions to update status, and configure the PHY | ||
86 | |||
87 | |||
88 | Letting the PHY Abstraction Layer do Everything | ||
89 | |||
90 | If you choose option 1 (The hope is that every driver can, but to still be | ||
91 | useful to drivers that can't), connecting to the PHY is simple: | ||
92 | |||
93 | First, you need a function to react to changes in the link state. This | ||
94 | function follows this protocol: | ||
95 | |||
96 | static void adjust_link(struct net_device *dev); | ||
97 | |||
98 | Next, you need to know the device name of the PHY connected to this device. | ||
99 | The name will look something like, "phy0:0", where the first number is the | ||
100 | bus id, and the second is the PHY's address on that bus. | ||
101 | |||
102 | Now, to connect, just call this function: | ||
103 | |||
104 | phydev = phy_connect(dev, phy_name, &adjust_link, flags); | ||
105 | |||
106 | phydev is a pointer to the phy_device structure which represents the PHY. If | ||
107 | phy_connect is successful, it will return the pointer. dev, here, is the | ||
108 | pointer to your net_device. Once done, this function will have started the | ||
109 | PHY's software state machine, and registered for the PHY's interrupt, if it | ||
110 | has one. The phydev structure will be populated with information about the | ||
111 | current state, though the PHY will not yet be truly operational at this | ||
112 | point. | ||
113 | |||
114 | flags is a u32 which can optionally contain phy-specific flags. | ||
115 | This is useful if the system has put hardware restrictions on | ||
116 | the PHY/controller, of which the PHY needs to be aware. | ||
117 | |||
118 | Now just make sure that phydev->supported and phydev->advertising have any | ||
119 | values pruned from them which don't make sense for your controller (a 10/100 | ||
120 | controller may be connected to a gigabit capable PHY, so you would need to | ||
121 | mask off SUPPORTED_1000baseT*). See include/linux/ethtool.h for definitions | ||
122 | for these bitfields. Note that you should not SET any bits, or the PHY may | ||
123 | get put into an unsupported state. | ||
124 | |||
125 | Lastly, once the controller is ready to handle network traffic, you call | ||
126 | phy_start(phydev). This tells the PAL that you are ready, and configures the | ||
127 | PHY to connect to the network. If you want to handle your own interrupts, | ||
128 | just set phydev->irq to PHY_IGNORE_INTERRUPT before you call phy_start. | ||
129 | Similarly, if you don't want to use interrupts, set phydev->irq to PHY_POLL. | ||
130 | |||
131 | When you want to disconnect from the network (even if just briefly), you call | ||
132 | phy_stop(phydev). | ||
133 | |||
134 | Keeping Close Tabs on the PAL | ||
135 | |||
136 | It is possible that the PAL's built-in state machine needs a little help to | ||
137 | keep your network device and the PHY properly in sync. If so, you can | ||
138 | register a helper function when connecting to the PHY, which will be called | ||
139 | every second before the state machine reacts to any changes. To do this, you | ||
140 | need to manually call phy_attach() and phy_prepare_link(), and then call | ||
141 | phy_start_machine() with the second argument set to point to your special | ||
142 | handler. | ||
143 | |||
144 | Currently there are no examples of how to use this functionality, and testing | ||
145 | on it has been limited because the author does not have any drivers which use | ||
146 | it (they all use option 1). So Caveat Emptor. | ||
147 | |||
148 | Doing it all yourself | ||
149 | |||
150 | There's a remote chance that the PAL's built-in state machine cannot track | ||
151 | the complex interactions between the PHY and your network device. If this is | ||
152 | so, you can simply call phy_attach(), and not call phy_start_machine or | ||
153 | phy_prepare_link(). This will mean that phydev->state is entirely yours to | ||
154 | handle (phy_start and phy_stop toggle between some of the states, so you | ||
155 | might need to avoid them). | ||
156 | |||
157 | An effort has been made to make sure that useful functionality can be | ||
158 | accessed without the state-machine running, and most of these functions are | ||
159 | descended from functions which did not interact with a complex state-machine. | ||
160 | However, again, no effort has been made so far to test running without the | ||
161 | state machine, so tryer beware. | ||
162 | |||
163 | Here is a brief rundown of the functions: | ||
164 | |||
165 | int phy_read(struct phy_device *phydev, u16 regnum); | ||
166 | int phy_write(struct phy_device *phydev, u16 regnum, u16 val); | ||
167 | |||
168 | Simple read/write primitives. They invoke the bus's read/write function | ||
169 | pointers. | ||
170 | |||
171 | void phy_print_status(struct phy_device *phydev); | ||
172 | |||
173 | A convenience function to print out the PHY status neatly. | ||
174 | |||
175 | int phy_clear_interrupt(struct phy_device *phydev); | ||
176 | int phy_config_interrupt(struct phy_device *phydev, u32 interrupts); | ||
177 | |||
178 | Clear the PHY's interrupt, and configure which ones are allowed, | ||
179 | respectively. Currently only supports all on, or all off. | ||
180 | |||
181 | int phy_enable_interrupts(struct phy_device *phydev); | ||
182 | int phy_disable_interrupts(struct phy_device *phydev); | ||
183 | |||
184 | Functions which enable/disable PHY interrupts, clearing them | ||
185 | before and after, respectively. | ||
186 | |||
187 | int phy_start_interrupts(struct phy_device *phydev); | ||
188 | int phy_stop_interrupts(struct phy_device *phydev); | ||
189 | |||
190 | Requests the IRQ for the PHY interrupts, then enables them for | ||
191 | start, or disables then frees them for stop. | ||
192 | |||
193 | struct phy_device * phy_attach(struct net_device *dev, const char *phy_id, | ||
194 | u32 flags); | ||
195 | |||
196 | Attaches a network device to a particular PHY, binding the PHY to a generic | ||
197 | driver if none was found during bus initialization. Passes in | ||
198 | any phy-specific flags as needed. | ||
199 | |||
200 | int phy_start_aneg(struct phy_device *phydev); | ||
201 | |||
202 | Using variables inside the phydev structure, either configures advertising | ||
203 | and resets autonegotiation, or disables autonegotiation, and configures | ||
204 | forced settings. | ||
205 | |||
206 | static inline int phy_read_status(struct phy_device *phydev); | ||
207 | |||
208 | Fills the phydev structure with up-to-date information about the current | ||
209 | settings in the PHY. | ||
210 | |||
211 | void phy_sanitize_settings(struct phy_device *phydev) | ||
212 | |||
213 | Resolves differences between currently desired settings, and | ||
214 | supported settings for the given PHY device. Does not make | ||
215 | the changes in the hardware, though. | ||
216 | |||
217 | int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd); | ||
218 | int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd); | ||
219 | |||
220 | Ethtool convenience functions. | ||
221 | |||
222 | int phy_mii_ioctl(struct phy_device *phydev, | ||
223 | struct mii_ioctl_data *mii_data, int cmd); | ||
224 | |||
225 | The MII ioctl. Note that this function will completely screw up the state | ||
226 | machine if you write registers like BMCR, BMSR, ADVERTISE, etc. Best to | ||
227 | use this only to write registers which are not standard, and don't set off | ||
228 | a renegotiation. | ||
229 | |||
230 | |||
231 | PHY Device Drivers | ||
232 | |||
233 | With the PHY Abstraction Layer, adding support for new PHYs is | ||
234 | quite easy. In some cases, no work is required at all! However, | ||
235 | many PHYs require a little hand-holding to get up-and-running. | ||
236 | |||
237 | Generic PHY driver | ||
238 | |||
239 | If the desired PHY doesn't have any errata, quirks, or special | ||
240 | features you want to support, then it may be best to not add | ||
241 | support, and let the PHY Abstraction Layer's Generic PHY Driver | ||
242 | do all of the work. | ||
243 | |||
244 | Writing a PHY driver | ||
245 | |||
246 | If you do need to write a PHY driver, the first thing to do is | ||
247 | make sure it can be matched with an appropriate PHY device. | ||
248 | This is done during bus initialization by reading the device's | ||
249 | UID (stored in registers 2 and 3), then comparing it to each | ||
250 | driver's phy_id field by ANDing it with each driver's | ||
251 | phy_id_mask field. Also, it needs a name. Here's an example: | ||
252 | |||
253 | static struct phy_driver dm9161_driver = { | ||
254 | .phy_id = 0x0181b880, | ||
255 | .name = "Davicom DM9161E", | ||
256 | .phy_id_mask = 0x0ffffff0, | ||
257 | ... | ||
258 | } | ||
259 | |||
260 | Next, you need to specify what features (speed, duplex, autoneg, | ||
261 | etc) your PHY device and driver support. Most PHYs support | ||
262 | PHY_BASIC_FEATURES, but you can look in include/mii.h for other | ||
263 | features. | ||
264 | |||
265 | Each driver consists of a number of function pointers: | ||
266 | |||
267 | config_init: configures PHY into a sane state after a reset. | ||
268 | For instance, a Davicom PHY requires descrambling disabled. | ||
269 | probe: Does any setup needed by the driver | ||
270 | suspend/resume: power management | ||
271 | config_aneg: Changes the speed/duplex/negotiation settings | ||
272 | read_status: Reads the current speed/duplex/negotiation settings | ||
273 | ack_interrupt: Clear a pending interrupt | ||
274 | config_intr: Enable or disable interrupts | ||
275 | remove: Does any driver take-down | ||
276 | |||
277 | Of these, only config_aneg and read_status are required to be | ||
278 | assigned by the driver code. The rest are optional. Also, it is | ||
279 | preferred to use the generic phy driver's versions of these two | ||
280 | functions if at all possible: genphy_read_status and | ||
281 | genphy_config_aneg. If this is not possible, it is likely that | ||
282 | you only need to perform some actions before and after invoking | ||
283 | these functions, and so your functions will wrap the generic | ||
284 | ones. | ||
285 | |||
286 | Feel free to look at the Marvell, Cicada, and Davicom drivers in | ||
287 | drivers/net/phy/ for examples (the lxt and qsemi drivers have | ||
288 | not been tested as of this writing) | ||
diff --git a/Documentation/power/swsusp-dmcrypt.txt b/Documentation/power/swsusp-dmcrypt.txt new file mode 100644 index 000000000000..59931b46ff7e --- /dev/null +++ b/Documentation/power/swsusp-dmcrypt.txt | |||
@@ -0,0 +1,138 @@ | |||
1 | Author: Andreas Steinmetz <ast@domdv.de> | ||
2 | |||
3 | |||
4 | How to use dm-crypt and swsusp together: | ||
5 | ======================================== | ||
6 | |||
7 | Some prerequisites: | ||
8 | You know how dm-crypt works. If not, visit the following web page: | ||
9 | http://www.saout.de/misc/dm-crypt/ | ||
10 | You have read Documentation/power/swsusp.txt and understand it. | ||
11 | You did read Documentation/initrd.txt and know how an initrd works. | ||
12 | You know how to create or how to modify an initrd. | ||
13 | |||
14 | Now your system is properly set up, your disk is encrypted except for | ||
15 | the swap device(s) and the boot partition which may contain a mini | ||
16 | system for crypto setup and/or rescue purposes. You may even have | ||
17 | an initrd that does your current crypto setup already. | ||
18 | |||
19 | At this point you want to encrypt your swap, too. Still you want to | ||
20 | be able to suspend using swsusp. This, however, means that you | ||
21 | have to be able to either enter a passphrase or that you read | ||
22 | the key(s) from an external device like a pcmcia flash disk | ||
23 | or an usb stick prior to resume. So you need an initrd, that sets | ||
24 | up dm-crypt and then asks swsusp to resume from the encrypted | ||
25 | swap device. | ||
26 | |||
27 | The most important thing is that you set up dm-crypt in such | ||
28 | a way that the swap device you suspend to/resume from has | ||
29 | always the same major/minor within the initrd as well as | ||
30 | within your running system. The easiest way to achieve this is | ||
31 | to always set up this swap device first with dmsetup, so that | ||
32 | it will always look like the following: | ||
33 | |||
34 | brw------- 1 root root 254, 0 Jul 28 13:37 /dev/mapper/swap0 | ||
35 | |||
36 | Now set up your kernel to use /dev/mapper/swap0 as the default | ||
37 | resume partition, so your kernel .config contains: | ||
38 | |||
39 | CONFIG_PM_STD_PARTITION="/dev/mapper/swap0" | ||
40 | |||
41 | Prepare your boot loader to use the initrd you will create or | ||
42 | modify. For lilo the simplest setup looks like the following | ||
43 | lines: | ||
44 | |||
45 | image=/boot/vmlinuz | ||
46 | initrd=/boot/initrd.gz | ||
47 | label=linux | ||
48 | append="root=/dev/ram0 init=/linuxrc rw" | ||
49 | |||
50 | Finally you need to create or modify your initrd. Lets assume | ||
51 | you create an initrd that reads the required dm-crypt setup | ||
52 | from a pcmcia flash disk card. The card is formatted with an ext2 | ||
53 | fs which resides on /dev/hde1 when the card is inserted. The | ||
54 | card contains at least the encrypted swap setup in a file | ||
55 | named "swapkey". /etc/fstab of your initrd contains something | ||
56 | like the following: | ||
57 | |||
58 | /dev/hda1 /mnt ext3 ro 0 0 | ||
59 | none /proc proc defaults,noatime,nodiratime 0 0 | ||
60 | none /sys sysfs defaults,noatime,nodiratime 0 0 | ||
61 | |||
62 | /dev/hda1 contains an unencrypted mini system that sets up all | ||
63 | of your crypto devices, again by reading the setup from the | ||
64 | pcmcia flash disk. What follows now is a /linuxrc for your | ||
65 | initrd that allows you to resume from encrypted swap and that | ||
66 | continues boot with your mini system on /dev/hda1 if resume | ||
67 | does not happen: | ||
68 | |||
69 | #!/bin/sh | ||
70 | PATH=/sbin:/bin:/usr/sbin:/usr/bin | ||
71 | mount /proc | ||
72 | mount /sys | ||
73 | mapped=0 | ||
74 | noresume=`grep -c noresume /proc/cmdline` | ||
75 | if [ "$*" != "" ] | ||
76 | then | ||
77 | noresume=1 | ||
78 | fi | ||
79 | dmesg -n 1 | ||
80 | /sbin/cardmgr -q | ||
81 | for i in 1 2 3 4 5 6 7 8 9 0 | ||
82 | do | ||
83 | if [ -f /proc/ide/hde/media ] | ||
84 | then | ||
85 | usleep 500000 | ||
86 | mount -t ext2 -o ro /dev/hde1 /mnt | ||
87 | if [ -f /mnt/swapkey ] | ||
88 | then | ||
89 | dmsetup create swap0 /mnt/swapkey > /dev/null 2>&1 && mapped=1 | ||
90 | fi | ||
91 | umount /mnt | ||
92 | break | ||
93 | fi | ||
94 | usleep 500000 | ||
95 | done | ||
96 | killproc /sbin/cardmgr | ||
97 | dmesg -n 6 | ||
98 | if [ $mapped = 1 ] | ||
99 | then | ||
100 | if [ $noresume != 0 ] | ||
101 | then | ||
102 | mkswap /dev/mapper/swap0 > /dev/null 2>&1 | ||
103 | fi | ||
104 | echo 254:0 > /sys/power/resume | ||
105 | dmsetup remove swap0 | ||
106 | fi | ||
107 | umount /sys | ||
108 | mount /mnt | ||
109 | umount /proc | ||
110 | cd /mnt | ||
111 | pivot_root . mnt | ||
112 | mount /proc | ||
113 | umount -l /mnt | ||
114 | umount /proc | ||
115 | exec chroot . /sbin/init $* < dev/console > dev/console 2>&1 | ||
116 | |||
117 | Please don't mind the weird loop above, busybox's msh doesn't know | ||
118 | the let statement. Now, what is happening in the script? | ||
119 | First we have to decide if we want to try to resume, or not. | ||
120 | We will not resume if booting with "noresume" or any parameters | ||
121 | for init like "single" or "emergency" as boot parameters. | ||
122 | |||
123 | Then we need to set up dmcrypt with the setup data from the | ||
124 | pcmcia flash disk. If this succeeds we need to reset the swap | ||
125 | device if we don't want to resume. The line "echo 254:0 > /sys/power/resume" | ||
126 | then attempts to resume from the first device mapper device. | ||
127 | Note that it is important to set the device in /sys/power/resume, | ||
128 | regardless if resuming or not, otherwise later suspend will fail. | ||
129 | If resume starts, script execution terminates here. | ||
130 | |||
131 | Otherwise we just remove the encrypted swap device and leave it to the | ||
132 | mini system on /dev/hda1 to set the whole crypto up (it is up to | ||
133 | you to modify this to your taste). | ||
134 | |||
135 | What then follows is the well known process to change the root | ||
136 | file system and continue booting from there. I prefer to unmount | ||
137 | the initrd prior to continue booting but it is up to you to modify | ||
138 | this. | ||
diff --git a/Documentation/power/swsusp.txt b/Documentation/power/swsusp.txt index 7a6b78966459..b0d50840788e 100644 --- a/Documentation/power/swsusp.txt +++ b/Documentation/power/swsusp.txt | |||
@@ -1,22 +1,20 @@ | |||
1 | From kernel/suspend.c: | 1 | Some warnings, first. |
2 | 2 | ||
3 | * BIG FAT WARNING ********************************************************* | 3 | * BIG FAT WARNING ********************************************************* |
4 | * | 4 | * |
5 | * If you have unsupported (*) devices using DMA... | ||
6 | * ...say goodbye to your data. | ||
7 | * | ||
8 | * If you touch anything on disk between suspend and resume... | 5 | * If you touch anything on disk between suspend and resume... |
9 | * ...kiss your data goodbye. | 6 | * ...kiss your data goodbye. |
10 | * | 7 | * |
11 | * If your disk driver does not support suspend... (IDE does) | 8 | * If you do resume from initrd after your filesystems are mounted... |
12 | * ...you'd better find out how to get along | 9 | * ...bye bye root partition. |
13 | * without your data. | 10 | * [this is actually same case as above] |
14 | * | ||
15 | * If you change kernel command line between suspend and resume... | ||
16 | * ...prepare for nasty fsck or worse. | ||
17 | * | 11 | * |
18 | * If you change your hardware while system is suspended... | 12 | * If you have unsupported (*) devices using DMA, you may have some |
19 | * ...well, it was not good idea. | 13 | * problems. If your disk driver does not support suspend... (IDE does), |
14 | * it may cause some problems, too. If you change kernel command line | ||
15 | * between suspend and resume, it may do something wrong. If you change | ||
16 | * your hardware while system is suspended... well, it was not good idea; | ||
17 | * but it will probably only crash. | ||
20 | * | 18 | * |
21 | * (*) suspend/resume support is needed to make it safe. | 19 | * (*) suspend/resume support is needed to make it safe. |
22 | 20 | ||
@@ -30,6 +28,13 @@ echo shutdown > /sys/power/disk; echo disk > /sys/power/state | |||
30 | echo platform > /sys/power/disk; echo disk > /sys/power/state | 28 | echo platform > /sys/power/disk; echo disk > /sys/power/state |
31 | 29 | ||
32 | 30 | ||
31 | Encrypted suspend image: | ||
32 | ------------------------ | ||
33 | If you want to store your suspend image encrypted with a temporary | ||
34 | key to prevent data gathering after resume you must compile | ||
35 | crypto and the aes algorithm into the kernel - modules won't work | ||
36 | as they cannot be loaded at resume time. | ||
37 | |||
33 | 38 | ||
34 | Article about goals and implementation of Software Suspend for Linux | 39 | Article about goals and implementation of Software Suspend for Linux |
35 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 40 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
@@ -85,11 +90,6 @@ resume. | |||
85 | You have your server on UPS. Power died, and UPS is indicating 30 | 90 | You have your server on UPS. Power died, and UPS is indicating 30 |
86 | seconds to failure. What do you do? Suspend to disk. | 91 | seconds to failure. What do you do? Suspend to disk. |
87 | 92 | ||
88 | Ethernet card in your server died. You want to replace it. Your | ||
89 | server is not hotplug capable. What do you do? Suspend to disk, | ||
90 | replace ethernet card, resume. If you are fast your users will not | ||
91 | even see broken connections. | ||
92 | |||
93 | 93 | ||
94 | Q: Maybe I'm missing something, but why don't the regular I/O paths work? | 94 | Q: Maybe I'm missing something, but why don't the regular I/O paths work? |
95 | 95 | ||
@@ -117,31 +117,6 @@ Q: Does linux support ACPI S4? | |||
117 | 117 | ||
118 | A: Yes. That's what echo platform > /sys/power/disk does. | 118 | A: Yes. That's what echo platform > /sys/power/disk does. |
119 | 119 | ||
120 | Q: My machine doesn't work with ACPI. How can I use swsusp than ? | ||
121 | |||
122 | A: Do a reboot() syscall with right parameters. Warning: glibc gets in | ||
123 | its way, so check with strace: | ||
124 | |||
125 | reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, 0xd000fce2) | ||
126 | |||
127 | (Thanks to Peter Osterlund:) | ||
128 | |||
129 | #include <unistd.h> | ||
130 | #include <syscall.h> | ||
131 | |||
132 | #define LINUX_REBOOT_MAGIC1 0xfee1dead | ||
133 | #define LINUX_REBOOT_MAGIC2 672274793 | ||
134 | #define LINUX_REBOOT_CMD_SW_SUSPEND 0xD000FCE2 | ||
135 | |||
136 | int main() | ||
137 | { | ||
138 | syscall(SYS_reboot, LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, | ||
139 | LINUX_REBOOT_CMD_SW_SUSPEND, 0); | ||
140 | return 0; | ||
141 | } | ||
142 | |||
143 | Also /sys/ interface should be still present. | ||
144 | |||
145 | Q: What is 'suspend2'? | 120 | Q: What is 'suspend2'? |
146 | 121 | ||
147 | A: suspend2 is 'Software Suspend 2', a forked implementation of | 122 | A: suspend2 is 'Software Suspend 2', a forked implementation of |
@@ -311,3 +286,46 @@ As a rule of thumb use encrypted swap to protect your data while your | |||
311 | system is shut down or suspended. Additionally use the encrypted | 286 | system is shut down or suspended. Additionally use the encrypted |
312 | suspend image to prevent sensitive data from being stolen after | 287 | suspend image to prevent sensitive data from being stolen after |
313 | resume. | 288 | resume. |
289 | |||
290 | Q: Why can't we suspend to a swap file? | ||
291 | |||
292 | A: Because accessing swap file needs the filesystem mounted, and | ||
293 | filesystem might do something wrong (like replaying the journal) | ||
294 | during mount. | ||
295 | |||
296 | There are few ways to get that fixed: | ||
297 | |||
298 | 1) Probably could be solved by modifying every filesystem to support | ||
299 | some kind of "really read-only!" option. Patches welcome. | ||
300 | |||
301 | 2) suspend2 gets around that by storing absolute positions in on-disk | ||
302 | image (and blocksize), with resume parameter pointing directly to | ||
303 | suspend header. | ||
304 | |||
305 | Q: Is there a maximum system RAM size that is supported by swsusp? | ||
306 | |||
307 | A: It should work okay with highmem. | ||
308 | |||
309 | Q: Does swsusp (to disk) use only one swap partition or can it use | ||
310 | multiple swap partitions (aggregate them into one logical space)? | ||
311 | |||
312 | A: Only one swap partition, sorry. | ||
313 | |||
314 | Q: If my application(s) causes lots of memory & swap space to be used | ||
315 | (over half of the total system RAM), is it correct that it is likely | ||
316 | to be useless to try to suspend to disk while that app is running? | ||
317 | |||
318 | A: No, it should work okay, as long as your app does not mlock() | ||
319 | it. Just prepare big enough swap partition. | ||
320 | |||
321 | Q: What information is usefull for debugging suspend-to-disk problems? | ||
322 | |||
323 | A: Well, last messages on the screen are always useful. If something | ||
324 | is broken, it is usually some kernel driver, therefore trying with as | ||
325 | little as possible modules loaded helps a lot. I also prefer people to | ||
326 | suspend from console, preferably without X running. Booting with | ||
327 | init=/bin/bash, then swapon and starting suspend sequence manually | ||
328 | usually does the trick. Then it is good idea to try with latest | ||
329 | vanilla kernel. | ||
330 | |||
331 | |||
diff --git a/Documentation/power/video.txt b/Documentation/power/video.txt index 7a4a5036d123..526d6dd267ea 100644 --- a/Documentation/power/video.txt +++ b/Documentation/power/video.txt | |||
@@ -46,6 +46,12 @@ There are a few types of systems where video works after S3 resume: | |||
46 | POSTing bios works. Ole Rohne has patch to do just that at | 46 | POSTing bios works. Ole Rohne has patch to do just that at |
47 | http://dev.gentoo.org/~marineam/patch-radeonfb-2.6.11-rc2-mm2. | 47 | http://dev.gentoo.org/~marineam/patch-radeonfb-2.6.11-rc2-mm2. |
48 | 48 | ||
49 | (8) on some systems, you can use the video_post utility mentioned here: | ||
50 | http://bugzilla.kernel.org/show_bug.cgi?id=3670. Do echo 3 > /sys/power/state | ||
51 | && /usr/sbin/video_post - which will initialize the display in console mode. | ||
52 | If you are in X, you can switch to a virtual terminal and back to X using | ||
53 | CTRL+ALT+F1 - CTRL+ALT+F7 to get the display working in graphical mode again. | ||
54 | |||
49 | Now, if you pass acpi_sleep=something, and it does not work with your | 55 | Now, if you pass acpi_sleep=something, and it does not work with your |
50 | bios, you'll get a hard crash during resume. Be careful. Also it is | 56 | bios, you'll get a hard crash during resume. Be careful. Also it is |
51 | safest to do your experiments with plain old VGA console. The vesafb | 57 | safest to do your experiments with plain old VGA console. The vesafb |
@@ -64,7 +70,8 @@ Model hack (or "how to do it") | |||
64 | ------------------------------------------------------------------------------ | 70 | ------------------------------------------------------------------------------ |
65 | Acer Aspire 1406LC ole's late BIOS init (7), turn off DRI | 71 | Acer Aspire 1406LC ole's late BIOS init (7), turn off DRI |
66 | Acer TM 242FX vbetool (6) | 72 | Acer TM 242FX vbetool (6) |
67 | Acer TM C300 vga=normal (only suspend on console, not in X), vbetool (6) | 73 | Acer TM C110 video_post (8) |
74 | Acer TM C300 vga=normal (only suspend on console, not in X), vbetool (6) or video_post (8) | ||
68 | Acer TM 4052LCi s3_bios (2) | 75 | Acer TM 4052LCi s3_bios (2) |
69 | Acer TM 636Lci s3_bios vga=normal (2) | 76 | Acer TM 636Lci s3_bios vga=normal (2) |
70 | Acer TM 650 (Radeon M7) vga=normal plus boot-radeon (5) gets text console back | 77 | Acer TM 650 (Radeon M7) vga=normal plus boot-radeon (5) gets text console back |
@@ -113,6 +120,7 @@ IBM ThinkPad T42p (2373-GTG) s3_bios (2) | |||
113 | IBM TP X20 ??? (*) | 120 | IBM TP X20 ??? (*) |
114 | IBM TP X30 s3_bios (2) | 121 | IBM TP X30 s3_bios (2) |
115 | IBM TP X31 / Type 2672-XXH none (1), use radeontool (http://fdd.com/software/radeon/) to turn off backlight. | 122 | IBM TP X31 / Type 2672-XXH none (1), use radeontool (http://fdd.com/software/radeon/) to turn off backlight. |
123 | IBM TP X32 none (1), but backlight is on and video is trashed after long suspend | ||
116 | IBM Thinkpad X40 Type 2371-7JG s3_bios,s3_mode (4) | 124 | IBM Thinkpad X40 Type 2371-7JG s3_bios,s3_mode (4) |
117 | Medion MD4220 ??? (*) | 125 | Medion MD4220 ??? (*) |
118 | Samsung P35 vbetool needed (6) | 126 | Samsung P35 vbetool needed (6) |
diff --git a/Documentation/serial/driver b/Documentation/serial/driver index ac7eabbf662a..87856d3cfb67 100644 --- a/Documentation/serial/driver +++ b/Documentation/serial/driver | |||
@@ -111,24 +111,17 @@ hardware. | |||
111 | Interrupts: locally disabled. | 111 | Interrupts: locally disabled. |
112 | This call must not sleep | 112 | This call must not sleep |
113 | 113 | ||
114 | stop_tx(port,tty_stop) | 114 | stop_tx(port) |
115 | Stop transmitting characters. This might be due to the CTS | 115 | Stop transmitting characters. This might be due to the CTS |
116 | line becoming inactive or the tty layer indicating we want | 116 | line becoming inactive or the tty layer indicating we want |
117 | to stop transmission. | 117 | to stop transmission due to an XOFF character. |
118 | |||
119 | tty_stop: 1 if this call is due to the TTY layer issuing a | ||
120 | TTY stop to the driver (equiv to rs_stop). | ||
121 | 118 | ||
122 | Locking: port->lock taken. | 119 | Locking: port->lock taken. |
123 | Interrupts: locally disabled. | 120 | Interrupts: locally disabled. |
124 | This call must not sleep | 121 | This call must not sleep |
125 | 122 | ||
126 | start_tx(port,tty_start) | 123 | start_tx(port) |
127 | start transmitting characters. (incidentally, nonempty will | 124 | start transmitting characters. |
128 | always be nonzero, and shouldn't be used - it will be dropped). | ||
129 | |||
130 | tty_start: 1 if this call was due to the TTY layer issuing | ||
131 | a TTY start to the driver (equiv to rs_start) | ||
132 | 125 | ||
133 | Locking: port->lock taken. | 126 | Locking: port->lock taken. |
134 | Interrupts: locally disabled. | 127 | Interrupts: locally disabled. |
diff --git a/Documentation/sonypi.txt b/Documentation/sonypi.txt index 0f3b2405d09e..c1237a925505 100644 --- a/Documentation/sonypi.txt +++ b/Documentation/sonypi.txt | |||
@@ -99,6 +99,7 @@ statically linked into the kernel). Those options are: | |||
99 | SONYPI_MEYE_MASK 0x0400 | 99 | SONYPI_MEYE_MASK 0x0400 |
100 | SONYPI_MEMORYSTICK_MASK 0x0800 | 100 | SONYPI_MEMORYSTICK_MASK 0x0800 |
101 | SONYPI_BATTERY_MASK 0x1000 | 101 | SONYPI_BATTERY_MASK 0x1000 |
102 | SONYPI_WIRELESS_MASK 0x2000 | ||
102 | 103 | ||
103 | useinput: if set (which is the default) two input devices are | 104 | useinput: if set (which is the default) two input devices are |
104 | created, one which interprets the jogdial events as | 105 | created, one which interprets the jogdial events as |
@@ -137,6 +138,15 @@ Bugs: | |||
137 | speed handling etc). Use ACPI instead of APM if it works on your | 138 | speed handling etc). Use ACPI instead of APM if it works on your |
138 | laptop. | 139 | laptop. |
139 | 140 | ||
141 | - sonypi lacks the ability to distinguish between certain key | ||
142 | events on some models. | ||
143 | |||
144 | - some models with the nvidia card (geforce go 6200 tc) uses a | ||
145 | different way to adjust the backlighting of the screen. There | ||
146 | is a userspace utility to adjust the brightness on those models, | ||
147 | which can be downloaded from | ||
148 | http://www.acc.umu.se/~erikw/program/smartdimmer-0.1.tar.bz2 | ||
149 | |||
140 | - since all development was done by reverse engineering, there is | 150 | - since all development was done by reverse engineering, there is |
141 | _absolutely no guarantee_ that this driver will not crash your | 151 | _absolutely no guarantee_ that this driver will not crash your |
142 | laptop. Permanently. | 152 | laptop. Permanently. |
diff --git a/Documentation/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt index a18ecb92b356..5c49ba07e709 100644 --- a/Documentation/sound/alsa/ALSA-Configuration.txt +++ b/Documentation/sound/alsa/ALSA-Configuration.txt | |||
@@ -132,6 +132,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. | |||
132 | mpu_irq - IRQ # for MPU-401 UART (PnP setup) | 132 | mpu_irq - IRQ # for MPU-401 UART (PnP setup) |
133 | dma1 - first DMA # for AD1816A chip (PnP setup) | 133 | dma1 - first DMA # for AD1816A chip (PnP setup) |
134 | dma2 - second DMA # for AD1816A chip (PnP setup) | 134 | dma2 - second DMA # for AD1816A chip (PnP setup) |
135 | clockfreq - Clock frequency for AD1816A chip (default = 0, 33000Hz) | ||
135 | 136 | ||
136 | Module supports up to 8 cards, autoprobe and PnP. | 137 | Module supports up to 8 cards, autoprobe and PnP. |
137 | 138 | ||
diff --git a/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl b/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl index db0b7d2dc477..0475478c2484 100644 --- a/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl +++ b/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl | |||
@@ -3422,10 +3422,17 @@ struct _snd_pcm_runtime { | |||
3422 | 3422 | ||
3423 | <para> | 3423 | <para> |
3424 | The <structfield>iface</structfield> field specifies the type of | 3424 | The <structfield>iface</structfield> field specifies the type of |
3425 | the control, | 3425 | the control, <constant>SNDRV_CTL_ELEM_IFACE_XXX</constant>, which |
3426 | <constant>SNDRV_CTL_ELEM_IFACE_XXX</constant>. There are | 3426 | is usually <constant>MIXER</constant>. |
3427 | <constant>MIXER</constant>, <constant>PCM</constant>, | 3427 | Use <constant>CARD</constant> for global controls that are not |
3428 | <constant>CARD</constant>, etc. | 3428 | logically part of the mixer. |
3429 | If the control is closely associated with some specific device on | ||
3430 | the sound card, use <constant>HWDEP</constant>, | ||
3431 | <constant>PCM</constant>, <constant>RAWMIDI</constant>, | ||
3432 | <constant>TIMER</constant>, or <constant>SEQUENCER</constant>, and | ||
3433 | specify the device number with the | ||
3434 | <structfield>device</structfield> and | ||
3435 | <structfield>subdevice</structfield> fields. | ||
3429 | </para> | 3436 | </para> |
3430 | 3437 | ||
3431 | <para> | 3438 | <para> |
diff --git a/Documentation/vm/locking b/Documentation/vm/locking index c3ef09ae3bb1..f366fa956179 100644 --- a/Documentation/vm/locking +++ b/Documentation/vm/locking | |||
@@ -83,19 +83,18 @@ single address space optimization, so that the zap_page_range (from | |||
83 | vmtruncate) does not lose sending ipi's to cloned threads that might | 83 | vmtruncate) does not lose sending ipi's to cloned threads that might |
84 | be spawned underneath it and go to user mode to drag in pte's into tlbs. | 84 | be spawned underneath it and go to user mode to drag in pte's into tlbs. |
85 | 85 | ||
86 | swap_list_lock/swap_device_lock | 86 | swap_lock |
87 | ------------------------------- | 87 | -------------- |
88 | The swap devices are chained in priority order from the "swap_list" header. | 88 | The swap devices are chained in priority order from the "swap_list" header. |
89 | The "swap_list" is used for the round-robin swaphandle allocation strategy. | 89 | The "swap_list" is used for the round-robin swaphandle allocation strategy. |
90 | The #free swaphandles is maintained in "nr_swap_pages". These two together | 90 | The #free swaphandles is maintained in "nr_swap_pages". These two together |
91 | are protected by the swap_list_lock. | 91 | are protected by the swap_lock. |
92 | 92 | ||
93 | The swap_device_lock, which is per swap device, protects the reference | 93 | The swap_lock also protects all the device reference counts on the |
94 | counts on the corresponding swaphandles, maintained in the "swap_map" | 94 | corresponding swaphandles, maintained in the "swap_map" array, and the |
95 | array, and the "highest_bit" and "lowest_bit" fields. | 95 | "highest_bit" and "lowest_bit" fields. |
96 | 96 | ||
97 | Both of these are spinlocks, and are never acquired from intr level. The | 97 | The swap_lock is a spinlock, and is never acquired from intr level. |
98 | locking hierarchy is swap_list_lock -> swap_device_lock. | ||
99 | 98 | ||
100 | To prevent races between swap space deletion or async readahead swapins | 99 | To prevent races between swap space deletion or async readahead swapins |
101 | deciding whether a swap handle is being used, ie worthy of being read in | 100 | deciding whether a swap handle is being used, ie worthy of being read in |
diff --git a/Documentation/watchdog/watchdog-api.txt b/Documentation/watchdog/watchdog-api.txt index 28388aa700c6..c5beb548cfc4 100644 --- a/Documentation/watchdog/watchdog-api.txt +++ b/Documentation/watchdog/watchdog-api.txt | |||
@@ -228,6 +228,26 @@ advantechwdt.c -- Advantech Single Board Computer | |||
228 | The GETSTATUS call returns if the device is open or not. | 228 | The GETSTATUS call returns if the device is open or not. |
229 | [FIXME -- silliness again?] | 229 | [FIXME -- silliness again?] |
230 | 230 | ||
231 | booke_wdt.c -- PowerPC BookE Watchdog Timer | ||
232 | |||
233 | Timeout default varies according to frequency, supports | ||
234 | SETTIMEOUT | ||
235 | |||
236 | Watchdog can not be turned off, CONFIG_WATCHDOG_NOWAYOUT | ||
237 | does not make sense | ||
238 | |||
239 | GETSUPPORT returns the watchdog_info struct, and | ||
240 | GETSTATUS returns the supported options. GETBOOTSTATUS | ||
241 | returns a 1 if the last reset was caused by the | ||
242 | watchdog and a 0 otherwise. This watchdog can not be | ||
243 | disabled once it has been started. The wdt_period kernel | ||
244 | parameter selects which bit of the time base changing | ||
245 | from 0->1 will trigger the watchdog exception. Changing | ||
246 | the timeout from the ioctl calls will change the | ||
247 | wdt_period as defined above. Finally if you would like to | ||
248 | replace the default Watchdog Handler you can implement the | ||
249 | WatchdogHandler() function in your own code. | ||
250 | |||
231 | eurotechwdt.c -- Eurotech CPU-1220/1410 | 251 | eurotechwdt.c -- Eurotech CPU-1220/1410 |
232 | 252 | ||
233 | The timeout can be set using the SETTIMEOUT ioctl and defaults | 253 | The timeout can be set using the SETTIMEOUT ioctl and defaults |