aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/feature-removal-schedule.txt12
-rw-r--r--Documentation/networking/bonding.txt110
-rw-r--r--Documentation/networking/dm9000.txt167
-rw-r--r--Documentation/networking/ip-sysctl.txt21
-rw-r--r--Documentation/networking/mac80211_hwsim/README67
-rw-r--r--Documentation/networking/mac80211_hwsim/hostapd.conf11
-rw-r--r--Documentation/networking/mac80211_hwsim/wpa_supplicant.conf10
-rw-r--r--Documentation/networking/multiqueue.txt79
-rw-r--r--Documentation/networking/s2io.txt7
-rw-r--r--Documentation/powerpc/booting-without-of.txt21
-rw-r--r--Documentation/rfkill.txt547
11 files changed, 881 insertions, 171 deletions
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt
index 46ece3fba6f9..8319c462c9f0 100644
--- a/Documentation/feature-removal-schedule.txt
+++ b/Documentation/feature-removal-schedule.txt
@@ -315,6 +315,18 @@ Who: Matthew Wilcox <willy@linux.intel.com>
315 315
316--------------------------- 316---------------------------
317 317
318What: SCTP_GET_PEER_ADDRS_NUM_OLD, SCTP_GET_PEER_ADDRS_OLD,
319 SCTP_GET_LOCAL_ADDRS_NUM_OLD, SCTP_GET_LOCAL_ADDRS_OLD
320When: June 2009
321Why: A newer version of the options have been introduced in 2005 that
322 removes the limitions of the old API. The sctp library has been
323 converted to use these new options at the same time. Any user
324 space app that directly uses the old options should convert to using
325 the new options.
326Who: Vlad Yasevich <vladislav.yasevich@hp.com>
327
328---------------------------
329
318What: CONFIG_THERMAL_HWMON 330What: CONFIG_THERMAL_HWMON
319When: January 2009 331When: January 2009
320Why: This option was introduced just to allow older lm-sensors userspace 332Why: This option was introduced just to allow older lm-sensors userspace
diff --git a/Documentation/networking/bonding.txt b/Documentation/networking/bonding.txt
index a0cda062bc33..7fa7fe71d7a8 100644
--- a/Documentation/networking/bonding.txt
+++ b/Documentation/networking/bonding.txt
@@ -289,35 +289,73 @@ downdelay
289fail_over_mac 289fail_over_mac
290 290
291 Specifies whether active-backup mode should set all slaves to 291 Specifies whether active-backup mode should set all slaves to
292 the same MAC address (the traditional behavior), or, when 292 the same MAC address at enslavement (the traditional
293 enabled, change the bond's MAC address when changing the 293 behavior), or, when enabled, perform special handling of the
294 active interface (i.e., fail over the MAC address itself). 294 bond's MAC address in accordance with the selected policy.
295 295
296 Fail over MAC is useful for devices that cannot ever alter 296 Possible values are:
297 their MAC address, or for devices that refuse incoming 297
298 broadcasts with their own source MAC (which interferes with 298 none or 0
299 the ARP monitor). 299
300 300 This setting disables fail_over_mac, and causes
301 The down side of fail over MAC is that every device on the 301 bonding to set all slaves of an active-backup bond to
302 network must be updated via gratuitous ARP, vs. just updating 302 the same MAC address at enslavement time. This is the
303 a switch or set of switches (which often takes place for any 303 default.
304 traffic, not just ARP traffic, if the switch snoops incoming 304
305 traffic to update its tables) for the traditional method. If 305 active or 1
306 the gratuitous ARP is lost, communication may be disrupted. 306
307 307 The "active" fail_over_mac policy indicates that the
308 When fail over MAC is used in conjuction with the mii monitor, 308 MAC address of the bond should always be the MAC
309 devices which assert link up prior to being able to actually 309 address of the currently active slave. The MAC
310 transmit and receive are particularly susecptible to loss of 310 address of the slaves is not changed; instead, the MAC
311 the gratuitous ARP, and an appropriate updelay setting may be 311 address of the bond changes during a failover.
312 required. 312
313 313 This policy is useful for devices that cannot ever
314 A value of 0 disables fail over MAC, and is the default. A 314 alter their MAC address, or for devices that refuse
315 value of 1 enables fail over MAC. This option is enabled 315 incoming broadcasts with their own source MAC (which
316 automatically if the first slave added cannot change its MAC 316 interferes with the ARP monitor).
317 address. This option may be modified via sysfs only when no 317
318 slaves are present in the bond. 318 The down side of this policy is that every device on
319 319 the network must be updated via gratuitous ARP,
320 This option was added in bonding version 3.2.0. 320 vs. just updating a switch or set of switches (which
321 often takes place for any traffic, not just ARP
322 traffic, if the switch snoops incoming traffic to
323 update its tables) for the traditional method. If the
324 gratuitous ARP is lost, communication may be
325 disrupted.
326
327 When this policy is used in conjuction with the mii
328 monitor, devices which assert link up prior to being
329 able to actually transmit and receive are particularly
330 susecptible to loss of the gratuitous ARP, and an
331 appropriate updelay setting may be required.
332
333 follow or 2
334
335 The "follow" fail_over_mac policy causes the MAC
336 address of the bond to be selected normally (normally
337 the MAC address of the first slave added to the bond).
338 However, the second and subsequent slaves are not set
339 to this MAC address while they are in a backup role; a
340 slave is programmed with the bond's MAC address at
341 failover time (and the formerly active slave receives
342 the newly active slave's MAC address).
343
344 This policy is useful for multiport devices that
345 either become confused or incur a performance penalty
346 when multiple ports are programmed with the same MAC
347 address.
348
349
350 The default policy is none, unless the first slave cannot
351 change its MAC address, in which case the active policy is
352 selected by default.
353
354 This option may be modified via sysfs only when no slaves are
355 present in the bond.
356
357 This option was added in bonding version 3.2.0. The "follow"
358 policy was added in bonding version 3.3.0.
321 359
322lacp_rate 360lacp_rate
323 361
@@ -338,7 +376,8 @@ max_bonds
338 Specifies the number of bonding devices to create for this 376 Specifies the number of bonding devices to create for this
339 instance of the bonding driver. E.g., if max_bonds is 3, and 377 instance of the bonding driver. E.g., if max_bonds is 3, and
340 the bonding driver is not already loaded, then bond0, bond1 378 the bonding driver is not already loaded, then bond0, bond1
341 and bond2 will be created. The default value is 1. 379 and bond2 will be created. The default value is 1. Specifying
380 a value of 0 will load bonding, but will not create any devices.
342 381
343miimon 382miimon
344 383
@@ -501,6 +540,17 @@ mode
501 swapped with the new curr_active_slave that was 540 swapped with the new curr_active_slave that was
502 chosen. 541 chosen.
503 542
543num_grat_arp
544
545 Specifies the number of gratuitous ARPs to be issued after a
546 failover event. One gratuitous ARP is issued immediately after
547 the failover, subsequent ARPs are sent at a rate of one per link
548 monitor interval (arp_interval or miimon, whichever is active).
549
550 The valid range is 0 - 255; the default value is 1. This option
551 affects only the active-backup mode. This option was added for
552 bonding version 3.3.0.
553
504primary 554primary
505 555
506 A string (eth0, eth2, etc) specifying which slave is the 556 A string (eth0, eth2, etc) specifying which slave is the
diff --git a/Documentation/networking/dm9000.txt b/Documentation/networking/dm9000.txt
new file mode 100644
index 000000000000..65df3dea5561
--- /dev/null
+++ b/Documentation/networking/dm9000.txt
@@ -0,0 +1,167 @@
1DM9000 Network driver
2=====================
3
4Copyright 2008 Simtec Electronics,
5 Ben Dooks <ben@simtec.co.uk> <ben-linux@fluff.org>
6
7
8Introduction
9------------
10
11This file describes how to use the DM9000 platform-device based network driver
12that is contained in the files drivers/net/dm9000.c and drivers/net/dm9000.h.
13
14The driver supports three DM9000 variants, the DM9000E which is the first chip
15supported as well as the newer DM9000A and DM9000B devices. It is currently
16maintained and tested by Ben Dooks, who should be CC: to any patches for this
17driver.
18
19
20Defining the platform device
21----------------------------
22
23The minimum set of resources attached to the platform device are as follows:
24
25 1) The physical address of the address register
26 2) The physical address of the data register
27 3) The IRQ line the device's interrupt pin is connected to.
28
29These resources should be specified in that order, as the ordering of the
30two address regions is important (the driver expects these to be address
31and then data).
32
33An example from arch/arm/mach-s3c2410/mach-bast.c is:
34
35static struct resource bast_dm9k_resource[] = {
36 [0] = {
37 .start = S3C2410_CS5 + BAST_PA_DM9000,
38 .end = S3C2410_CS5 + BAST_PA_DM9000 + 3,
39 .flags = IORESOURCE_MEM,
40 },
41 [1] = {
42 .start = S3C2410_CS5 + BAST_PA_DM9000 + 0x40,
43 .end = S3C2410_CS5 + BAST_PA_DM9000 + 0x40 + 0x3f,
44 .flags = IORESOURCE_MEM,
45 },
46 [2] = {
47 .start = IRQ_DM9000,
48 .end = IRQ_DM9000,
49 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
50 }
51};
52
53static struct platform_device bast_device_dm9k = {
54 .name = "dm9000",
55 .id = 0,
56 .num_resources = ARRAY_SIZE(bast_dm9k_resource),
57 .resource = bast_dm9k_resource,
58};
59
60Note the setting of the IRQ trigger flag in bast_dm9k_resource[2].flags,
61as this will generate a warning if it is not present. The trigger from
62the flags field will be passed to request_irq() when registering the IRQ
63handler to ensure that the IRQ is setup correctly.
64
65This shows a typical platform device, without the optional configuration
66platform data supplied. The next example uses the same resources, but adds
67the optional platform data to pass extra configuration data:
68
69static struct dm9000_plat_data bast_dm9k_platdata = {
70 .flags = DM9000_PLATF_16BITONLY,
71};
72
73static struct platform_device bast_device_dm9k = {
74 .name = "dm9000",
75 .id = 0,
76 .num_resources = ARRAY_SIZE(bast_dm9k_resource),
77 .resource = bast_dm9k_resource,
78 .dev = {
79 .platform_data = &bast_dm9k_platdata,
80 }
81};
82
83The platform data is defined in include/linux/dm9000.h and described below.
84
85
86Platform data
87-------------
88
89Extra platform data for the DM9000 can describe the IO bus width to the
90device, whether or not an external PHY is attached to the device and
91the availability of an external configuration EEPROM.
92
93The flags for the platform data .flags field are as follows:
94
95DM9000_PLATF_8BITONLY
96
97 The IO should be done with 8bit operations.
98
99DM9000_PLATF_16BITONLY
100
101 The IO should be done with 16bit operations.
102
103DM9000_PLATF_32BITONLY
104
105 The IO should be done with 32bit operations.
106
107DM9000_PLATF_EXT_PHY
108
109 The chip is connected to an external PHY.
110
111DM9000_PLATF_NO_EEPROM
112
113 This can be used to signify that the board does not have an
114 EEPROM, or that the EEPROM should be hidden from the user.
115
116DM9000_PLATF_SIMPLE_PHY
117
118 Switch to using the simpler PHY polling method which does not
119 try and read the MII PHY state regularly. This is only available
120 when using the internal PHY. See the section on link state polling
121 for more information.
122
123 The config symbol DM9000_FORCE_SIMPLE_PHY_POLL, Kconfig entry
124 "Force simple NSR based PHY polling" allows this flag to be
125 forced on at build time.
126
127
128PHY Link state polling
129----------------------
130
131The driver keeps track of the link state and informs the network core
132about link (carrier) availablilty. This is managed by several methods
133depending on the version of the chip and on which PHY is being used.
134
135For the internal PHY, the original (and currently default) method is
136to read the MII state, either when the status changes if we have the
137necessary interrupt support in the chip or every two seconds via a
138periodic timer.
139
140To reduce the overhead for the internal PHY, there is now the option
141of using the DM9000_FORCE_SIMPLE_PHY_POLL config, or DM9000_PLATF_SIMPLE_PHY
142platform data option to read the summary information without the
143expensive MII accesses. This method is faster, but does not print
144as much information.
145
146When using an external PHY, the driver currently has to poll the MII
147link status as there is no method for getting an interrupt on link change.
148
149
150DM9000A / DM9000B
151-----------------
152
153These chips are functionally similar to the DM9000E and are supported easily
154by the same driver. The features are:
155
156 1) Interrupt on internal PHY state change. This means that the periodic
157 polling of the PHY status may be disabled on these devices when using
158 the internal PHY.
159
160 2) TCP/UDP checksum offloading, which the driver does not currently support.
161
162
163ethtool
164-------
165
166The driver supports the ethtool interface for access to the driver
167state information, the PHY state and the EEPROM.
diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt
index 946b66e1b652..d84932650fd3 100644
--- a/Documentation/networking/ip-sysctl.txt
+++ b/Documentation/networking/ip-sysctl.txt
@@ -551,8 +551,9 @@ icmp_echo_ignore_broadcasts - BOOLEAN
551icmp_ratelimit - INTEGER 551icmp_ratelimit - INTEGER
552 Limit the maximal rates for sending ICMP packets whose type matches 552 Limit the maximal rates for sending ICMP packets whose type matches
553 icmp_ratemask (see below) to specific targets. 553 icmp_ratemask (see below) to specific targets.
554 0 to disable any limiting, otherwise the maximal rate in jiffies(1) 554 0 to disable any limiting,
555 Default: 100 555 otherwise the minimal space between responses in milliseconds.
556 Default: 1000
556 557
557icmp_ratemask - INTEGER 558icmp_ratemask - INTEGER
558 Mask made of ICMP types for which rates are being limited. 559 Mask made of ICMP types for which rates are being limited.
@@ -1023,11 +1024,23 @@ max_addresses - INTEGER
1023 autoconfigured addresses. 1024 autoconfigured addresses.
1024 Default: 16 1025 Default: 16
1025 1026
1027disable_ipv6 - BOOLEAN
1028 Disable IPv6 operation.
1029 Default: FALSE (enable IPv6 operation)
1030
1031accept_dad - INTEGER
1032 Whether to accept DAD (Duplicate Address Detection).
1033 0: Disable DAD
1034 1: Enable DAD (default)
1035 2: Enable DAD, and disable IPv6 operation if MAC-based duplicate
1036 link-local address has been found.
1037
1026icmp/*: 1038icmp/*:
1027ratelimit - INTEGER 1039ratelimit - INTEGER
1028 Limit the maximal rates for sending ICMPv6 packets. 1040 Limit the maximal rates for sending ICMPv6 packets.
1029 0 to disable any limiting, otherwise the maximal rate in jiffies(1) 1041 0 to disable any limiting,
1030 Default: 100 1042 otherwise the minimal space between responses in milliseconds.
1043 Default: 1000
1031 1044
1032 1045
1033IPv6 Update by: 1046IPv6 Update by:
diff --git a/Documentation/networking/mac80211_hwsim/README b/Documentation/networking/mac80211_hwsim/README
new file mode 100644
index 000000000000..2ff8ccb8dc37
--- /dev/null
+++ b/Documentation/networking/mac80211_hwsim/README
@@ -0,0 +1,67 @@
1mac80211_hwsim - software simulator of 802.11 radio(s) for mac80211
2Copyright (c) 2008, Jouni Malinen <j@w1.fi>
3
4This program is free software; you can redistribute it and/or modify
5it under the terms of the GNU General Public License version 2 as
6published by the Free Software Foundation.
7
8
9Introduction
10
11mac80211_hwsim is a Linux kernel module that can be used to simulate
12arbitrary number of IEEE 802.11 radios for mac80211. It can be used to
13test most of the mac80211 functionality and user space tools (e.g.,
14hostapd and wpa_supplicant) in a way that matches very closely with
15the normal case of using real WLAN hardware. From the mac80211 view
16point, mac80211_hwsim is yet another hardware driver, i.e., no changes
17to mac80211 are needed to use this testing tool.
18
19The main goal for mac80211_hwsim is to make it easier for developers
20to test their code and work with new features to mac80211, hostapd,
21and wpa_supplicant. The simulated radios do not have the limitations
22of real hardware, so it is easy to generate an arbitrary test setup
23and always reproduce the same setup for future tests. In addition,
24since all radio operation is simulated, any channel can be used in
25tests regardless of regulatory rules.
26
27mac80211_hwsim kernel module has a parameter 'radios' that can be used
28to select how many radios are simulated (default 2). This allows
29configuration of both very simply setups (e.g., just a single access
30point and a station) or large scale tests (multiple access points with
31hundreds of stations).
32
33mac80211_hwsim works by tracking the current channel of each virtual
34radio and copying all transmitted frames to all other radios that are
35currently enabled and on the same channel as the transmitting
36radio. Software encryption in mac80211 is used so that the frames are
37actually encrypted over the virtual air interface to allow more
38complete testing of encryption.
39
40A global monitoring netdev, hwsim#, is created independent of
41mac80211. This interface can be used to monitor all transmitted frames
42regardless of channel.
43
44
45Simple example
46
47This example shows how to use mac80211_hwsim to simulate two radios:
48one to act as an access point and the other as a station that
49associates with the AP. hostapd and wpa_supplicant are used to take
50care of WPA2-PSK authentication. In addition, hostapd is also
51processing access point side of association.
52
53Please note that the current Linux kernel does not enable AP mode, so a
54simple patch is needed to enable AP mode selection:
55http://johannes.sipsolutions.net/patches/kernel/all/LATEST/006-allow-ap-vlan-modes.patch
56
57
58# Build mac80211_hwsim as part of kernel configuration
59
60# Load the module
61modprobe mac80211_hwsim
62
63# Run hostapd (AP) for wlan0
64hostapd hostapd.conf
65
66# Run wpa_supplicant (station) for wlan1
67wpa_supplicant -Dwext -iwlan1 -c wpa_supplicant.conf
diff --git a/Documentation/networking/mac80211_hwsim/hostapd.conf b/Documentation/networking/mac80211_hwsim/hostapd.conf
new file mode 100644
index 000000000000..08cde7e35f2e
--- /dev/null
+++ b/Documentation/networking/mac80211_hwsim/hostapd.conf
@@ -0,0 +1,11 @@
1interface=wlan0
2driver=nl80211
3
4hw_mode=g
5channel=1
6ssid=mac80211 test
7
8wpa=2
9wpa_key_mgmt=WPA-PSK
10wpa_pairwise=CCMP
11wpa_passphrase=12345678
diff --git a/Documentation/networking/mac80211_hwsim/wpa_supplicant.conf b/Documentation/networking/mac80211_hwsim/wpa_supplicant.conf
new file mode 100644
index 000000000000..299128cff035
--- /dev/null
+++ b/Documentation/networking/mac80211_hwsim/wpa_supplicant.conf
@@ -0,0 +1,10 @@
1ctrl_interface=/var/run/wpa_supplicant
2
3network={
4 ssid="mac80211 test"
5 psk="12345678"
6 key_mgmt=WPA-PSK
7 proto=WPA2
8 pairwise=CCMP
9 group=CCMP
10}
diff --git a/Documentation/networking/multiqueue.txt b/Documentation/networking/multiqueue.txt
index ea5a42e8f79f..e6dc1ee9e8f1 100644
--- a/Documentation/networking/multiqueue.txt
+++ b/Documentation/networking/multiqueue.txt
@@ -3,19 +3,11 @@
3 =========================================== 3 ===========================================
4 4
5Section 1: Base driver requirements for implementing multiqueue support 5Section 1: Base driver requirements for implementing multiqueue support
6Section 2: Qdisc support for multiqueue devices
7Section 3: Brief howto using PRIO or RR for multiqueue devices
8
9 6
10Intro: Kernel support for multiqueue devices 7Intro: Kernel support for multiqueue devices
11--------------------------------------------------------- 8---------------------------------------------------------
12 9
13Kernel support for multiqueue devices is only an API that is presented to the 10Kernel support for multiqueue devices is always present.
14netdevice layer for base drivers to implement. This feature is part of the
15core networking stack, and all network devices will be running on the
16multiqueue-aware stack. If a base driver only has one queue, then these
17changes are transparent to that driver.
18
19 11
20Section 1: Base driver requirements for implementing multiqueue support 12Section 1: Base driver requirements for implementing multiqueue support
21----------------------------------------------------------------------- 13-----------------------------------------------------------------------
@@ -43,73 +35,4 @@ bitmap on device initialization. Below is an example from e1000:
43 netdev->features |= NETIF_F_MULTI_QUEUE; 35 netdev->features |= NETIF_F_MULTI_QUEUE;
44#endif 36#endif
45 37
46
47Section 2: Qdisc support for multiqueue devices
48-----------------------------------------------
49
50Currently two qdiscs support multiqueue devices. A new round-robin qdisc,
51sch_rr, and sch_prio. The qdisc is responsible for classifying the skb's to
52bands and queues, and will store the queue mapping into skb->queue_mapping.
53Use this field in the base driver to determine which queue to send the skb
54to.
55
56sch_rr has been added for hardware that doesn't want scheduling policies from
57software, so it's a straight round-robin qdisc. It uses the same syntax and
58classification priomap that sch_prio uses, so it should be intuitive to
59configure for people who've used sch_prio.
60
61In order to utilitize the multiqueue features of the qdiscs, the network
62device layer needs to enable multiple queue support. This can be done by
63selecting NETDEVICES_MULTIQUEUE under Drivers.
64
65The PRIO qdisc naturally plugs into a multiqueue device. If
66NETDEVICES_MULTIQUEUE is selected, then on qdisc load, the number of
67bands requested is compared to the number of queues on the hardware. If they
68are equal, it sets a one-to-one mapping up between the queues and bands. If
69they're not equal, it will not load the qdisc. This is the same behavior
70for RR. Once the association is made, any skb that is classified will have
71skb->queue_mapping set, which will allow the driver to properly queue skb's
72to multiple queues.
73
74
75Section 3: Brief howto using PRIO and RR for multiqueue devices
76---------------------------------------------------------------
77
78The userspace command 'tc,' part of the iproute2 package, is used to configure
79qdiscs. To add the PRIO qdisc to your network device, assuming the device is
80called eth0, run the following command:
81
82# tc qdisc add dev eth0 root handle 1: prio bands 4 multiqueue
83
84This will create 4 bands, 0 being highest priority, and associate those bands
85to the queues on your NIC. Assuming eth0 has 4 Tx queues, the band mapping
86would look like:
87
88band 0 => queue 0
89band 1 => queue 1
90band 2 => queue 2
91band 3 => queue 3
92
93Traffic will begin flowing through each queue if your TOS values are assigning
94traffic across the various bands. For example, ssh traffic will always try to
95go out band 0 based on TOS -> Linux priority conversion (realtime traffic),
96so it will be sent out queue 0. ICMP traffic (pings) fall into the "normal"
97traffic classification, which is band 1. Therefore pings will be send out
98queue 1 on the NIC.
99
100Note the use of the multiqueue keyword. This is only in versions of iproute2
101that support multiqueue networking devices; if this is omitted when loading
102a qdisc onto a multiqueue device, the qdisc will load and operate the same
103if it were loaded onto a single-queue device (i.e. - sends all traffic to
104queue 0).
105
106Another alternative to multiqueue band allocation can be done by using the
107multiqueue option and specify 0 bands. If this is the case, the qdisc will
108allocate the number of bands to equal the number of queues that the device
109reports, and bring the qdisc online.
110
111The behavior of tc filters remains the same, where it will override TOS priority
112classification.
113
114
115Author: Peter P. Waskiewicz Jr. <peter.p.waskiewicz.jr@intel.com> 38Author: Peter P. Waskiewicz Jr. <peter.p.waskiewicz.jr@intel.com>
diff --git a/Documentation/networking/s2io.txt b/Documentation/networking/s2io.txt
index 1e28e2ddb90a..c3d6b4d5d014 100644
--- a/Documentation/networking/s2io.txt
+++ b/Documentation/networking/s2io.txt
@@ -52,13 +52,10 @@ d. MSI/MSI-X. Can be enabled on platforms which support this feature
52(IA64, Xeon) resulting in noticeable performance improvement(upto 7% 52(IA64, Xeon) resulting in noticeable performance improvement(upto 7%
53on certain platforms). 53on certain platforms).
54 54
55e. NAPI. Compile-time option(CONFIG_S2IO_NAPI) for better Rx interrupt 55e. Statistics. Comprehensive MAC-level and software statistics displayed
56moderation.
57
58f. Statistics. Comprehensive MAC-level and software statistics displayed
59using "ethtool -S" option. 56using "ethtool -S" option.
60 57
61g. Multi-FIFO/Ring. Supports up to 8 transmit queues and receive rings, 58f. Multi-FIFO/Ring. Supports up to 8 transmit queues and receive rings,
62with multiple steering options. 59with multiple steering options.
63 60
644. Command line parameters 614. Command line parameters
diff --git a/Documentation/powerpc/booting-without-of.txt b/Documentation/powerpc/booting-without-of.txt
index 1d2a772506cf..46a9dba11f2f 100644
--- a/Documentation/powerpc/booting-without-of.txt
+++ b/Documentation/powerpc/booting-without-of.txt
@@ -58,6 +58,7 @@ Table of Contents
58 o) Xilinx IP cores 58 o) Xilinx IP cores
59 p) Freescale Synchronous Serial Interface 59 p) Freescale Synchronous Serial Interface
60 q) USB EHCI controllers 60 q) USB EHCI controllers
61 r) MDIO on GPIOs
61 62
62 VII - Marvell Discovery mv64[345]6x System Controller chips 63 VII - Marvell Discovery mv64[345]6x System Controller chips
63 1) The /system-controller node 64 1) The /system-controller node
@@ -2870,6 +2871,26 @@ platforms are moved over to use the flattened-device-tree model.
2870 reg = <0xe8000000 32>; 2871 reg = <0xe8000000 32>;
2871 }; 2872 };
2872 2873
2874 r) MDIO on GPIOs
2875
2876 Currently defined compatibles:
2877 - virtual,gpio-mdio
2878
2879 MDC and MDIO lines connected to GPIO controllers are listed in the
2880 gpios property as described in section VIII.1 in the following order:
2881
2882 MDC, MDIO.
2883
2884 Example:
2885
2886 mdio {
2887 compatible = "virtual,mdio-gpio";
2888 #address-cells = <1>;
2889 #size-cells = <0>;
2890 gpios = <&qe_pio_a 11
2891 &qe_pio_c 6>;
2892 };
2893
2873VII - Marvell Discovery mv64[345]6x System Controller chips 2894VII - Marvell Discovery mv64[345]6x System Controller chips
2874=========================================================== 2895===========================================================
2875 2896
diff --git a/Documentation/rfkill.txt b/Documentation/rfkill.txt
index a83ff23cd68c..0843ed0163a5 100644
--- a/Documentation/rfkill.txt
+++ b/Documentation/rfkill.txt
@@ -1,89 +1,528 @@
1rfkill - RF switch subsystem support 1rfkill - RF switch subsystem support
2==================================== 2====================================
3 3
41 Implementation details 41 Introduction
52 Driver support 52 Implementation details
63 Userspace support 63 Kernel driver guidelines
73.1 wireless device drivers
83.2 platform/switch drivers
93.3 input device drivers
104 Kernel API
115 Userspace support
7 12
8===============================================================================
91: Implementation details
10 13
11The rfkill switch subsystem offers support for keys often found on laptops 141. Introduction:
12to enable wireless devices like WiFi and Bluetooth. 15
16The rfkill switch subsystem exists to add a generic interface to circuitry that
17can enable or disable the signal output of a wireless *transmitter* of any
18type. By far, the most common use is to disable radio-frequency transmitters.
13 19
14This is done by providing the user 3 possibilities: 20Note that disabling the signal output means that the the transmitter is to be
15 1 - The rfkill system handles all events; userspace is not aware of events. 21made to not emit any energy when "blocked". rfkill is not about blocking data
16 2 - The rfkill system handles all events; userspace is informed about the events. 22transmissions, it is about blocking energy emission.
17 3 - The rfkill system does not handle events; userspace handles all events.
18 23
19The buttons to enable and disable the wireless radios are important in 24The rfkill subsystem offers support for keys and switches often found on
25laptops to enable wireless devices like WiFi and Bluetooth, so that these keys
26and switches actually perform an action in all wireless devices of a given type
27attached to the system.
28
29The buttons to enable and disable the wireless transmitters are important in
20situations where the user is for example using his laptop on a location where 30situations where the user is for example using his laptop on a location where
21wireless radios _must_ be disabled (e.g. airplanes). 31radio-frequency transmitters _must_ be disabled (e.g. airplanes).
22Because of this requirement, userspace support for the keys should not be 32
23made mandatory. Because userspace might want to perform some additional smarter 33Because of this requirement, userspace support for the keys should not be made
24tasks when the key is pressed, rfkill still provides userspace the possibility 34mandatory. Because userspace might want to perform some additional smarter
25to take over the task to handle the key events. 35tasks when the key is pressed, rfkill provides userspace the possibility to
36take over the task to handle the key events.
37
38===============================================================================
392: Implementation details
40
41The rfkill subsystem is composed of various components: the rfkill class, the
42rfkill-input module (an input layer handler), and some specific input layer
43events.
44
45The rfkill class provides kernel drivers with an interface that allows them to
46know when they should enable or disable a wireless network device transmitter.
47This is enabled by the CONFIG_RFKILL Kconfig option.
48
49The rfkill class support makes sure userspace will be notified of all state
50changes on rfkill devices through uevents. It provides a notification chain
51for interested parties in the kernel to also get notified of rfkill state
52changes in other drivers. It creates several sysfs entries which can be used
53by userspace. See section "Userspace support".
54
55The rfkill-input module provides the kernel with the ability to implement a
56basic response when the user presses a key or button (or toggles a switch)
57related to rfkill functionality. It is an in-kernel implementation of default
58policy of reacting to rfkill-related input events and neither mandatory nor
59required for wireless drivers to operate. It is enabled by the
60CONFIG_RFKILL_INPUT Kconfig option.
61
62rfkill-input is a rfkill-related events input layer handler. This handler will
63listen to all rfkill key events and will change the rfkill state of the
64wireless devices accordingly. With this option enabled userspace could either
65do nothing or simply perform monitoring tasks.
66
67The rfkill-input module also provides EPO (emergency power-off) functionality
68for all wireless transmitters. This function cannot be overridden, and it is
69always active. rfkill EPO is related to *_RFKILL_ALL input layer events.
70
71
72Important terms for the rfkill subsystem:
73
74In order to avoid confusion, we avoid the term "switch" in rfkill when it is
75referring to an electronic control circuit that enables or disables a
76transmitter. We reserve it for the physical device a human manipulates
77(which is an input device, by the way):
78
79rfkill switch:
80
81 A physical device a human manipulates. Its state can be perceived by
82 the kernel either directly (through a GPIO pin, ACPI GPE) or by its
83 effect on a rfkill line of a wireless device.
84
85rfkill controller:
86
87 A hardware circuit that controls the state of a rfkill line, which a
88 kernel driver can interact with *to modify* that state (i.e. it has
89 either write-only or read/write access).
90
91rfkill line:
92
93 An input channel (hardware or software) of a wireless device, which
94 causes a wireless transmitter to stop emitting energy (BLOCK) when it
95 is active. Point of view is extremely important here: rfkill lines are
96 always seen from the PoV of a wireless device (and its driver).
97
98soft rfkill line/software rfkill line:
99
100 A rfkill line the wireless device driver can directly change the state
101 of. Related to rfkill_state RFKILL_STATE_SOFT_BLOCKED.
102
103hard rfkill line/hardware rfkill line:
104
105 A rfkill line that works fully in hardware or firmware, and that cannot
106 be overridden by the kernel driver. The hardware device or the
107 firmware just exports its status to the driver, but it is read-only.
108 Related to rfkill_state RFKILL_STATE_HARD_BLOCKED.
109
110The enum rfkill_state describes the rfkill state of a transmitter:
111
112When a rfkill line or rfkill controller is in the RFKILL_STATE_UNBLOCKED state,
113the wireless transmitter (radio TX circuit for example) is *enabled*. When the
114it is in the RFKILL_STATE_SOFT_BLOCKED or RFKILL_STATE_HARD_BLOCKED, the
115wireless transmitter is to be *blocked* from operating.
116
117RFKILL_STATE_SOFT_BLOCKED indicates that a call to toggle_radio() can change
118that state. RFKILL_STATE_HARD_BLOCKED indicates that a call to toggle_radio()
119will not be able to change the state and will return with a suitable error if
120attempts are made to set the state to RFKILL_STATE_UNBLOCKED.
121
122RFKILL_STATE_HARD_BLOCKED is used by drivers to signal that the device is
123locked in the BLOCKED state by a hardwire rfkill line (typically an input pin
124that, when active, forces the transmitter to be disabled) which the driver
125CANNOT override.
126
127Full rfkill functionality requires two different subsystems to cooperate: the
128input layer and the rfkill class. The input layer issues *commands* to the
129entire system requesting that devices registered to the rfkill class change
130state. The way this interaction happens is not complex, but it is not obvious
131either:
132
133Kernel Input layer:
134
135 * Generates KEY_WWAN, KEY_WLAN, KEY_BLUETOOTH, SW_RFKILL_ALL, and
136 other such events when the user presses certain keys, buttons, or
137 toggles certain physical switches.
138
139 THE INPUT LAYER IS NEVER USED TO PROPAGATE STATUS, NOTIFICATIONS OR THE
140 KIND OF STUFF AN ON-SCREEN-DISPLAY APPLICATION WOULD REPORT. It is
141 used to issue *commands* for the system to change behaviour, and these
142 commands may or may not be carried out by some kernel driver or
143 userspace application. It follows that doing user feedback based only
144 on input events is broken, as there is no guarantee that an input event
145 will be acted upon.
146
147 Most wireless communication device drivers implementing rfkill
148 functionality MUST NOT generate these events, and have no reason to
149 register themselves with the input layer. Doing otherwise is a common
150 misconception. There is an API to propagate rfkill status change
151 information, and it is NOT the input layer.
152
153rfkill class:
154
155 * Calls a hook in a driver to effectively change the wireless
156 transmitter state;
157 * Keeps track of the wireless transmitter state (with help from
158 the driver);
159 * Generates userspace notifications (uevents) and a call to a
160 notification chain (kernel) when there is a wireless transmitter
161 state change;
162 * Connects a wireless communications driver with the common rfkill
163 control system, which, for example, allows actions such as
164 "switch all bluetooth devices offline" to be carried out by
165 userspace or by rfkill-input.
166
167 THE RFKILL CLASS NEVER ISSUES INPUT EVENTS. THE RFKILL CLASS DOES
168 NOT LISTEN TO INPUT EVENTS. NO DRIVER USING THE RFKILL CLASS SHALL
169 EVER LISTEN TO, OR ACT ON RFKILL INPUT EVENTS. Doing otherwise is
170 a layering violation.
171
172 Most wireless data communication drivers in the kernel have just to
173 implement the rfkill class API to work properly. Interfacing to the
174 input layer is not often required (and is very often a *bug*) on
175 wireless drivers.
176
177 Platform drivers often have to attach to the input layer to *issue*
178 (but never to listen to) rfkill events for rfkill switches, and also to
179 the rfkill class to export a control interface for the platform rfkill
180 controllers to the rfkill subsystem. This does NOT mean the rfkill
181 switch is attached to a rfkill class (doing so is almost always wrong).
182 It just means the same kernel module is the driver for different
183 devices (rfkill switches and rfkill controllers).
184
185
186Userspace input handlers (uevents) or kernel input handlers (rfkill-input):
187
188 * Implements the policy of what should happen when one of the input
189 layer events related to rfkill operation is received.
190 * Uses the sysfs interface (userspace) or private rfkill API calls
191 to tell the devices registered with the rfkill class to change
192 their state (i.e. translates the input layer event into real
193 action).
194 * rfkill-input implements EPO by handling EV_SW SW_RFKILL_ALL 0
195 (power off all transmitters) in a special way: it ignores any
196 overrides and local state cache and forces all transmitters to the
197 RFKILL_STATE_SOFT_BLOCKED state (including those which are already
198 supposed to be BLOCKED). Note that the opposite event (power on all
199 transmitters) is handled normally.
200
201Userspace uevent handler or kernel platform-specific drivers hooked to the
202rfkill notifier chain:
203
204 * Taps into the rfkill notifier chain or to KOBJ_CHANGE uevents,
205 in order to know when a device that is registered with the rfkill
206 class changes state;
207 * Issues feedback notifications to the user;
208 * In the rare platforms where this is required, synthesizes an input
209 event to command all *OTHER* rfkill devices to also change their
210 statues when a specific rfkill device changes state.
211
212
213===============================================================================
2143: Kernel driver guidelines
215
216Remember: point-of-view is everything for a driver that connects to the rfkill
217subsystem. All the details below must be measured/perceived from the point of
218view of the specific driver being modified.
219
220The first thing one needs to know is whether his driver should be talking to
221the rfkill class or to the input layer. In rare cases (platform drivers), it
222could happen that you need to do both, as platform drivers often handle a
223variety of devices in the same driver.
224
225Do not mistake input devices for rfkill controllers. The only type of "rfkill
226switch" device that is to be registered with the rfkill class are those
227directly controlling the circuits that cause a wireless transmitter to stop
228working (or the software equivalent of them), i.e. what we call a rfkill
229controller. Every other kind of "rfkill switch" is just an input device and
230MUST NOT be registered with the rfkill class.
231
232A driver should register a device with the rfkill class when ALL of the
233following conditions are met (they define a rfkill controller):
234
2351. The device is/controls a data communications wireless transmitter;
236
2372. The kernel can interact with the hardware/firmware to CHANGE the wireless
238 transmitter state (block/unblock TX operation);
239
2403. The transmitter can be made to not emit any energy when "blocked":
241 rfkill is not about blocking data transmissions, it is about blocking
242 energy emission;
243
244A driver should register a device with the input subsystem to issue
245rfkill-related events (KEY_WLAN, KEY_BLUETOOTH, KEY_WWAN, KEY_WIMAX,
246SW_RFKILL_ALL, etc) when ALL of the folowing conditions are met:
247
2481. It is directly related to some physical device the user interacts with, to
249 command the O.S./firmware/hardware to enable/disable a data communications
250 wireless transmitter.
251
252 Examples of the physical device are: buttons, keys and switches the user
253 will press/touch/slide/switch to enable or disable the wireless
254 communication device.
255
2562. It is NOT slaved to another device, i.e. there is no other device that
257 issues rfkill-related input events in preference to this one.
26 258
27The system inside the kernel has been split into 2 separate sections: 259 Please refer to the corner cases and examples section for more details.
28 1 - RFKILL
29 2 - RFKILL_INPUT
30 260
31The first option enables rfkill support and will make sure userspace will 261When in doubt, do not issue input events. For drivers that should generate
32be notified of any events through the input device. It also creates several 262input events in some platforms, but not in others (e.g. b43), the best solution
33sysfs entries which can be used by userspace. See section "Userspace support". 263is to NEVER generate input events in the first place. That work should be
264deferred to a platform-specific kernel module (which will know when to generate
265events through the rfkill notifier chain) or to userspace. This avoids the
266usual maintenance problems with DMI whitelisting.
34 267
35The second option provides an rfkill input handler. This handler will
36listen to all rfkill key events and will toggle the radio accordingly.
37With this option enabled userspace could either do nothing or simply
38perform monitoring tasks.
39 268
269Corner cases and examples:
40==================================== 270====================================
412: Driver support
42 271
43To build a driver with rfkill subsystem support, the driver should 2721. If the device is an input device that, because of hardware or firmware,
44depend on the Kconfig symbol RFKILL; it should _not_ depend on 273causes wireless transmitters to be blocked regardless of the kernel's will, it
45RKFILL_INPUT. 274is still just an input device, and NOT to be registered with the rfkill class.
46 275
47Unless key events trigger an interrupt to which the driver listens, polling 2762. If the wireless transmitter switch control is read-only, it is an input
48will be required to determine the key state changes. For this the input 277device and not to be registered with the rfkill class (and maybe not to be made
49layer providers the input-polldev handler. 278an input layer event source either, see below).
50 279
51A driver should implement a few steps to correctly make use of the 2803. If there is some other device driver *closer* to the actual hardware the
52rfkill subsystem. First for non-polling drivers: 281user interacted with (the button/switch/key) to issue an input event, THAT is
282the device driver that should be issuing input events.
53 283
54 - rfkill_allocate() 284E.g:
55 - input_allocate_device() 285 [RFKILL slider switch] -- [GPIO hardware] -- [WLAN card rf-kill input]
56 - rfkill_register() 286 (platform driver) (wireless card driver)
57 - input_register_device() 287
288The user is closer to the RFKILL slide switch plaform driver, so the driver
289which must issue input events is the platform driver looking at the GPIO
290hardware, and NEVER the wireless card driver (which is just a slave). It is
291very likely that there are other leaves than just the WLAN card rf-kill input
292(e.g. a bluetooth card, etc)...
293
294On the other hand, some embedded devices do this:
295
296 [RFKILL slider switch] -- [WLAN card rf-kill input]
297 (wireless card driver)
298
299In this situation, the wireless card driver *could* register itself as an input
300device and issue rf-kill related input events... but in order to AVOID the need
301for DMI whitelisting, the wireless card driver does NOT do it. Userspace (HAL)
302or a platform driver (that exists only on these embedded devices) will do the
303dirty job of issuing the input events.
304
305
306COMMON MISTAKES in kernel drivers, related to rfkill:
307====================================
308
3091. NEVER confuse input device keys and buttons with input device switches.
310
311 1a. Switches are always set or reset. They report the current state
312 (on position or off position).
313
314 1b. Keys and buttons are either in the pressed or not-pressed state, and
315 that's it. A "button" that latches down when you press it, and
316 unlatches when you press it again is in fact a switch as far as input
317 devices go.
318
319Add the SW_* events you need for switches, do NOT try to emulate a button using
320KEY_* events just because there is no such SW_* event yet. Do NOT try to use,
321for example, KEY_BLUETOOTH when you should be using SW_BLUETOOTH instead.
322
3232. Input device switches (sources of EV_SW events) DO store their current state
324(so you *must* initialize it by issuing a gratuitous input layer event on
325driver start-up and also when resuming from sleep), and that state CAN be
326queried from userspace through IOCTLs. There is no sysfs interface for this,
327but that doesn't mean you should break things trying to hook it to the rfkill
328class to get a sysfs interface :-)
329
3303. Do not issue *_RFKILL_ALL events by default, unless you are sure it is the
331correct event for your switch/button. These events are emergency power-off
332events when they are trying to turn the transmitters off. An example of an
333input device which SHOULD generate *_RFKILL_ALL events is the wireless-kill
334switch in a laptop which is NOT a hotkey, but a real switch that kills radios
335in hardware, even if the O.S. has gone to lunch. An example of an input device
336which SHOULD NOT generate *_RFKILL_ALL events by default, is any sort of hot
337key that does nothing by itself, as well as any hot key that is type-specific
338(e.g. the one for WLAN).
339
340
3413.1 Guidelines for wireless device drivers
342------------------------------------------
343
3441. Each independent transmitter in a wireless device (usually there is only one
345transmitter per device) should have a SINGLE rfkill class attached to it.
346
3472. If the device does not have any sort of hardware assistance to allow the
348driver to rfkill the device, the driver should emulate it by taking all actions
349required to silence the transmitter.
350
3513. If it is impossible to silence the transmitter (i.e. it still emits energy,
352even if it is just in brief pulses, when there is no data to transmit and there
353is no hardware support to turn it off) do NOT lie to the users. Do not attach
354it to a rfkill class. The rfkill subsystem does not deal with data
355transmission, it deals with energy emission. If the transmitter is emitting
356energy, it is not blocked in rfkill terms.
357
3584. It doesn't matter if the device has multiple rfkill input lines affecting
359the same transmitter, their combined state is to be exported as a single state
360per transmitter (see rule 1).
361
362This rule exists because users of the rfkill subsystem expect to get (and set,
363when possible) the overall transmitter rfkill state, not of a particular rfkill
364line.
365
366Example of a WLAN wireless driver connected to the rfkill subsystem:
367--------------------------------------------------------------------
368
369A certain WLAN card has one input pin that causes it to block the transmitter
370and makes the status of that input pin available (only for reading!) to the
371kernel driver. This is a hard rfkill input line (it cannot be overridden by
372the kernel driver).
373
374The card also has one PCI register that, if manipulated by the driver, causes
375it to block the transmitter. This is a soft rfkill input line.
376
377It has also a thermal protection circuitry that shuts down its transmitter if
378the card overheats, and makes the status of that protection available (only for
379reading!) to the kernel driver. This is also a hard rfkill input line.
380
381If either one of these rfkill lines are active, the transmitter is blocked by
382the hardware and forced offline.
383
384The driver should allocate and attach to its struct device *ONE* instance of
385the rfkill class (there is only one transmitter).
386
387It can implement the get_state() hook, and return RFKILL_STATE_HARD_BLOCKED if
388either one of its two hard rfkill input lines are active. If the two hard
389rfkill lines are inactive, it must return RFKILL_STATE_SOFT_BLOCKED if its soft
390rfkill input line is active. Only if none of the rfkill input lines are
391active, will it return RFKILL_STATE_UNBLOCKED.
58 392
59For polling drivers: 393If it doesn't implement the get_state() hook, it must make sure that its calls
394to rfkill_force_state() are enough to keep the status always up-to-date, and it
395must do a rfkill_force_state() on resume from sleep.
60 396
397Every time the driver gets a notification from the card that one of its rfkill
398lines changed state (polling might be needed on badly designed cards that don't
399generate interrupts for such events), it recomputes the rfkill state as per
400above, and calls rfkill_force_state() to update it.
401
402The driver should implement the toggle_radio() hook, that:
403
4041. Returns an error if one of the hardware rfkill lines are active, and the
405caller asked for RFKILL_STATE_UNBLOCKED.
406
4072. Activates the soft rfkill line if the caller asked for state
408RFKILL_STATE_SOFT_BLOCKED. It should do this even if one of the hard rfkill
409lines are active, effectively double-blocking the transmitter.
410
4113. Deactivates the soft rfkill line if none of the hardware rfkill lines are
412active and the caller asked for RFKILL_STATE_UNBLOCKED.
413
414===============================================================================
4154: Kernel API
416
417To build a driver with rfkill subsystem support, the driver should depend on
418(or select) the Kconfig symbol RFKILL; it should _not_ depend on RKFILL_INPUT.
419
420The hardware the driver talks to may be write-only (where the current state
421of the hardware is unknown), or read-write (where the hardware can be queried
422about its current state).
423
424The rfkill class will call the get_state hook of a device every time it needs
425to know the *real* current state of the hardware. This can happen often.
426
427Some hardware provides events when its status changes. In these cases, it is
428best for the driver to not provide a get_state hook, and instead register the
429rfkill class *already* with the correct status, and keep it updated using
430rfkill_force_state() when it gets an event from the hardware.
431
432There is no provision for a statically-allocated rfkill struct. You must
433use rfkill_allocate() to allocate one.
434
435You should:
61 - rfkill_allocate() 436 - rfkill_allocate()
62 - input_allocate_polled_device() 437 - modify rfkill fields (flags, name)
438 - modify state to the current hardware state (THIS IS THE ONLY TIME
439 YOU CAN ACCESS state DIRECTLY)
63 - rfkill_register() 440 - rfkill_register()
64 - input_register_polled_device()
65 441
66When a key event has been detected, the correct event should be 442The only way to set a device to the RFKILL_STATE_HARD_BLOCKED state is through
67sent over the input device which has been registered by the driver. 443a suitable return of get_state() or through rfkill_force_state().
68 444
69==================================== 445When a device is in the RFKILL_STATE_HARD_BLOCKED state, the only way to switch
703: Userspace support 446it to a different state is through a suitable return of get_state() or through
447rfkill_force_state().
448
449If toggle_radio() is called to set a device to state RFKILL_STATE_SOFT_BLOCKED
450when that device is already at the RFKILL_STATE_HARD_BLOCKED state, it should
451not return an error. Instead, it should try to double-block the transmitter,
452so that its state will change from RFKILL_STATE_HARD_BLOCKED to
453RFKILL_STATE_SOFT_BLOCKED should the hardware blocking cease.
71 454
72For each key an input device will be created which will send out the correct 455Please refer to the source for more documentation.
73key event when the rfkill key has been pressed. 456
457===============================================================================
4585: Userspace support
459
460rfkill devices issue uevents (with an action of "change"), with the following
461environment variables set:
462
463RFKILL_NAME
464RFKILL_STATE
465RFKILL_TYPE
466
467The ABI for these variables is defined by the sysfs attributes. It is best
468to take a quick look at the source to make sure of the possible values.
469
470It is expected that HAL will trap those, and bridge them to DBUS, etc. These
471events CAN and SHOULD be used to give feedback to the user about the rfkill
472status of the system.
473
474Input devices may issue events that are related to rfkill. These are the
475various KEY_* events and SW_* events supported by rfkill-input.c.
476
477******IMPORTANT******
478When rfkill-input is ACTIVE, userspace is NOT TO CHANGE THE STATE OF AN RFKILL
479SWITCH IN RESPONSE TO AN INPUT EVENT also handled by rfkill-input, unless it
480has set to true the user_claim attribute for that particular switch. This rule
481is *absolute*; do NOT violate it.
482******IMPORTANT******
483
484Userspace must not assume it is the only source of control for rfkill switches.
485Their state CAN and WILL change due to firmware actions, direct user actions,
486and the rfkill-input EPO override for *_RFKILL_ALL.
487
488When rfkill-input is not active, userspace must initiate a rfkill status
489change by writing to the "state" attribute in order for anything to happen.
490
491Take particular care to implement EV_SW SW_RFKILL_ALL properly. When that
492switch is set to OFF, *every* rfkill device *MUST* be immediately put into the
493RFKILL_STATE_SOFT_BLOCKED state, no questions asked.
74 494
75The following sysfs entries will be created: 495The following sysfs entries will be created:
76 496
77 name: Name assigned by driver to this key (interface or driver name). 497 name: Name assigned by driver to this key (interface or driver name).
78 type: Name of the key type ("wlan", "bluetooth", etc). 498 type: Name of the key type ("wlan", "bluetooth", etc).
79 state: Current state of the key. 1: On, 0: Off. 499 state: Current state of the transmitter
500 0: RFKILL_STATE_SOFT_BLOCKED
501 transmitter is forced off, but one can override it
502 by a write to the state attribute;
503 1: RFKILL_STATE_UNBLOCKED
504 transmiter is NOT forced off, and may operate if
505 all other conditions for such operation are met
506 (such as interface is up and configured, etc);
507 2: RFKILL_STATE_HARD_BLOCKED
508 transmitter is forced off by something outside of
509 the driver's control. One cannot set a device to
510 this state through writes to the state attribute;
80 claim: 1: Userspace handles events, 0: Kernel handles events 511 claim: 1: Userspace handles events, 0: Kernel handles events
81 512
82Both the "state" and "claim" entries are also writable. For the "state" entry 513Both the "state" and "claim" entries are also writable. For the "state" entry
83this means that when 1 or 0 is written all radios, not yet in the requested 514this means that when 1 or 0 is written, the device rfkill state (if not yet in
84state, will be will be toggled accordingly. 515the requested state), will be will be toggled accordingly.
516
85For the "claim" entry writing 1 to it means that the kernel no longer handles 517For the "claim" entry writing 1 to it means that the kernel no longer handles
86key events even though RFKILL_INPUT input was enabled. When "claim" has been 518key events even though RFKILL_INPUT input was enabled. When "claim" has been
87set to 0, userspace should make sure that it listens for the input events or 519set to 0, userspace should make sure that it listens for the input events or
88check the sysfs "state" entry regularly to correctly perform the required 520check the sysfs "state" entry regularly to correctly perform the required tasks
89tasks when the rkfill key is pressed. 521when the rkfill key is pressed.
522
523A note about input devices and EV_SW events:
524
525In order to know the current state of an input device switch (like
526SW_RFKILL_ALL), you will need to use an IOCTL. That information is not
527available through sysfs in a generic way at this time, and it is not available
528through the rfkill class AT ALL.