diff options
| author | David Howells <dhowells@redhat.com> | 2012-10-09 04:49:08 -0400 |
|---|---|---|
| committer | David Howells <dhowells@redhat.com> | 2012-10-09 04:49:08 -0400 |
| commit | 1e256b340d9574fd1bf31b73f16c4c474502692c (patch) | |
| tree | 7dece5b451dfbfa8625d400efcdf8e44ef71250c /include/uapi | |
| parent | 9e2d8656f5e8aa214e66b462680cf86b210b74a8 (diff) | |
UAPI: (Scripted) Disintegrate include/linux/wimax
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Michael Kerrisk <mtk.manpages@gmail.com>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Acked-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'include/uapi')
| -rw-r--r-- | include/uapi/linux/wimax/Kbuild | 1 | ||||
| -rw-r--r-- | include/uapi/linux/wimax/i2400m.h | 572 |
2 files changed, 573 insertions, 0 deletions
diff --git a/include/uapi/linux/wimax/Kbuild b/include/uapi/linux/wimax/Kbuild index aafaa5aa54d4..1c97be49971f 100644 --- a/include/uapi/linux/wimax/Kbuild +++ b/include/uapi/linux/wimax/Kbuild | |||
| @@ -1 +1,2 @@ | |||
| 1 | # UAPI Header export list | 1 | # UAPI Header export list |
| 2 | header-y += i2400m.h | ||
diff --git a/include/uapi/linux/wimax/i2400m.h b/include/uapi/linux/wimax/i2400m.h new file mode 100644 index 000000000000..62d356153565 --- /dev/null +++ b/include/uapi/linux/wimax/i2400m.h | |||
| @@ -0,0 +1,572 @@ | |||
| 1 | /* | ||
| 2 | * Intel Wireless WiMax Connection 2400m | ||
| 3 | * Host-Device protocol interface definitions | ||
| 4 | * | ||
| 5 | * | ||
| 6 | * Copyright (C) 2007-2008 Intel Corporation. All rights reserved. | ||
| 7 | * | ||
| 8 | * Redistribution and use in source and binary forms, with or without | ||
| 9 | * modification, are permitted provided that the following conditions | ||
| 10 | * are met: | ||
| 11 | * | ||
| 12 | * * Redistributions of source code must retain the above copyright | ||
| 13 | * notice, this list of conditions and the following disclaimer. | ||
| 14 | * * Redistributions in binary form must reproduce the above copyright | ||
| 15 | * notice, this list of conditions and the following disclaimer in | ||
| 16 | * the documentation and/or other materials provided with the | ||
| 17 | * distribution. | ||
| 18 | * * Neither the name of Intel Corporation nor the names of its | ||
| 19 | * contributors may be used to endorse or promote products derived | ||
| 20 | * from this software without specific prior written permission. | ||
| 21 | * | ||
| 22 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
| 23 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
| 24 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
| 25 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
| 26 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| 27 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
| 28 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
| 29 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
| 30 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| 31 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
| 32 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 33 | * | ||
| 34 | * | ||
| 35 | * Intel Corporation <linux-wimax@intel.com> | ||
| 36 | * Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com> | ||
| 37 | * - Initial implementation | ||
| 38 | * | ||
| 39 | * | ||
| 40 | * This header defines the data structures and constants used to | ||
| 41 | * communicate with the device. | ||
| 42 | * | ||
| 43 | * BOOTMODE/BOOTROM/FIRMWARE UPLOAD PROTOCOL | ||
| 44 | * | ||
| 45 | * The firmware upload protocol is quite simple and only requires a | ||
| 46 | * handful of commands. See drivers/net/wimax/i2400m/fw.c for more | ||
| 47 | * details. | ||
| 48 | * | ||
| 49 | * The BCF data structure is for the firmware file header. | ||
| 50 | * | ||
| 51 | * | ||
| 52 | * THE DATA / CONTROL PROTOCOL | ||
| 53 | * | ||
| 54 | * This is the normal protocol spoken with the device once the | ||
| 55 | * firmware is uploaded. It transports data payloads and control | ||
| 56 | * messages back and forth. | ||
| 57 | * | ||
| 58 | * It consists 'messages' that pack one or more payloads each. The | ||
| 59 | * format is described in detail in drivers/net/wimax/i2400m/rx.c and | ||
| 60 | * tx.c. | ||
| 61 | * | ||
| 62 | * | ||
| 63 | * THE L3L4 PROTOCOL | ||
| 64 | * | ||
| 65 | * The term L3L4 refers to Layer 3 (the device), Layer 4 (the | ||
| 66 | * driver/host software). | ||
| 67 | * | ||
| 68 | * This is the control protocol used by the host to control the i2400m | ||
| 69 | * device (scan, connect, disconnect...). This is sent to / received | ||
| 70 | * as control frames. These frames consist of a header and zero or | ||
| 71 | * more TLVs with information. We call each control frame a "message". | ||
| 72 | * | ||
| 73 | * Each message is composed of: | ||
| 74 | * | ||
| 75 | * HEADER | ||
| 76 | * [TLV0 + PAYLOAD0] | ||
| 77 | * [TLV1 + PAYLOAD1] | ||
| 78 | * [...] | ||
| 79 | * [TLVN + PAYLOADN] | ||
| 80 | * | ||
| 81 | * The HEADER is defined by 'struct i2400m_l3l4_hdr'. The payloads are | ||
| 82 | * defined by a TLV structure (Type Length Value) which is a 'header' | ||
| 83 | * (struct i2400m_tlv_hdr) and then the payload. | ||
| 84 | * | ||
| 85 | * All integers are represented as Little Endian. | ||
| 86 | * | ||
| 87 | * - REQUESTS AND EVENTS | ||
| 88 | * | ||
| 89 | * The requests can be clasified as follows: | ||
| 90 | * | ||
| 91 | * COMMAND: implies a request from the host to the device requesting | ||
| 92 | * an action being performed. The device will reply with a | ||
| 93 | * message (with the same type as the command), status and | ||
| 94 | * no (TLV) payload. Execution of a command might cause | ||
| 95 | * events (of different type) to be sent later on as | ||
| 96 | * device's state changes. | ||
| 97 | * | ||
| 98 | * GET/SET: similar to COMMAND, but will not cause other | ||
| 99 | * EVENTs. The reply, in the case of GET, will contain | ||
| 100 | * TLVs with the requested information. | ||
| 101 | * | ||
| 102 | * EVENT: asynchronous messages sent from the device, maybe as a | ||
| 103 | * consequence of previous COMMANDs but disassociated from | ||
| 104 | * them. | ||
| 105 | * | ||
| 106 | * Only one request might be pending at the same time (ie: don't | ||
| 107 | * parallelize nor post another GET request before the previous | ||
| 108 | * COMMAND has been acknowledged with it's corresponding reply by the | ||
| 109 | * device). | ||
| 110 | * | ||
| 111 | * The different requests and their formats are described below: | ||
| 112 | * | ||
| 113 | * I2400M_MT_* Message types | ||
| 114 | * I2400M_MS_* Message status (for replies, events) | ||
| 115 | * i2400m_tlv_* TLVs | ||
| 116 | * | ||
| 117 | * data types are named 'struct i2400m_msg_OPNAME', OPNAME matching the | ||
| 118 | * operation. | ||
| 119 | */ | ||
| 120 | |||
| 121 | #ifndef __LINUX__WIMAX__I2400M_H__ | ||
| 122 | #define __LINUX__WIMAX__I2400M_H__ | ||
| 123 | |||
| 124 | #include <linux/types.h> | ||
| 125 | |||
| 126 | |||
| 127 | /* | ||
| 128 | * Host Device Interface (HDI) common to all busses | ||
| 129 | */ | ||
| 130 | |||
| 131 | /* Boot-mode (firmware upload mode) commands */ | ||
| 132 | |||
| 133 | /* Header for the firmware file */ | ||
| 134 | struct i2400m_bcf_hdr { | ||
| 135 | __le32 module_type; | ||
| 136 | __le32 header_len; | ||
| 137 | __le32 header_version; | ||
| 138 | __le32 module_id; | ||
| 139 | __le32 module_vendor; | ||
| 140 | __le32 date; /* BCD YYYMMDD */ | ||
| 141 | __le32 size; /* in dwords */ | ||
| 142 | __le32 key_size; /* in dwords */ | ||
| 143 | __le32 modulus_size; /* in dwords */ | ||
| 144 | __le32 exponent_size; /* in dwords */ | ||
| 145 | __u8 reserved[88]; | ||
| 146 | } __attribute__ ((packed)); | ||
| 147 | |||
| 148 | /* Boot mode opcodes */ | ||
| 149 | enum i2400m_brh_opcode { | ||
| 150 | I2400M_BRH_READ = 1, | ||
| 151 | I2400M_BRH_WRITE = 2, | ||
| 152 | I2400M_BRH_JUMP = 3, | ||
| 153 | I2400M_BRH_SIGNED_JUMP = 8, | ||
| 154 | I2400M_BRH_HASH_PAYLOAD_ONLY = 9, | ||
| 155 | }; | ||
| 156 | |||
| 157 | /* Boot mode command masks and stuff */ | ||
| 158 | enum i2400m_brh { | ||
| 159 | I2400M_BRH_SIGNATURE = 0xcbbc0000, | ||
| 160 | I2400M_BRH_SIGNATURE_MASK = 0xffff0000, | ||
| 161 | I2400M_BRH_SIGNATURE_SHIFT = 16, | ||
| 162 | I2400M_BRH_OPCODE_MASK = 0x0000000f, | ||
| 163 | I2400M_BRH_RESPONSE_MASK = 0x000000f0, | ||
| 164 | I2400M_BRH_RESPONSE_SHIFT = 4, | ||
| 165 | I2400M_BRH_DIRECT_ACCESS = 0x00000400, | ||
| 166 | I2400M_BRH_RESPONSE_REQUIRED = 0x00000200, | ||
| 167 | I2400M_BRH_USE_CHECKSUM = 0x00000100, | ||
| 168 | }; | ||
| 169 | |||
| 170 | |||
| 171 | /** | ||
| 172 | * i2400m_bootrom_header - Header for a boot-mode command | ||
| 173 | * | ||
| 174 | * @cmd: the above command descriptor | ||
| 175 | * @target_addr: where on the device memory should the action be performed. | ||
| 176 | * @data_size: for read/write, amount of data to be read/written | ||
| 177 | * @block_checksum: checksum value (if applicable) | ||
| 178 | * @payload: the beginning of data attached to this header | ||
| 179 | */ | ||
| 180 | struct i2400m_bootrom_header { | ||
| 181 | __le32 command; /* Compose with enum i2400_brh */ | ||
| 182 | __le32 target_addr; | ||
| 183 | __le32 data_size; | ||
