The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 1 | /**************************************************************************** |
| 2 | **************************************************************************** |
| 3 | *** |
| 4 | *** This header was automatically generated from a Linux kernel header |
| 5 | *** of the same name, to make information necessary for userspace to |
| 6 | *** call into the kernel available to libc. It contains only constants, |
| 7 | *** structures, and macros generated from the original header, and thus, |
| 8 | *** contains no copyrightable information. |
| 9 | *** |
Ben Cheng | 654325d | 2012-03-07 21:13:49 -0800 | [diff] [blame^] | 10 | *** To edit the content of this header, modify the corresponding |
| 11 | *** source file (e.g. under external/kernel-headers/original/) then |
| 12 | *** run bionic/libc/kernel/tools/update_all.py |
| 13 | *** |
| 14 | *** Any manual change here will be lost the next time this script will |
| 15 | *** be run. You've been warned! |
| 16 | *** |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 17 | **************************************************************************** |
| 18 | ****************************************************************************/ |
| 19 | #ifndef MMC_H |
| 20 | #define MMC_H |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 21 | #include <linux/list.h> |
| 22 | #include <linux/interrupt.h> |
Ben Cheng | 654325d | 2012-03-07 21:13:49 -0800 | [diff] [blame^] | 23 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 24 | #include <linux/device.h> |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 25 | struct request; |
| 26 | struct mmc_data; |
| 27 | struct mmc_request; |
Ben Cheng | 654325d | 2012-03-07 21:13:49 -0800 | [diff] [blame^] | 28 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 29 | struct mmc_command { |
| 30 | u32 opcode; |
| 31 | u32 arg; |
| 32 | u32 resp[4]; |
Ben Cheng | 654325d | 2012-03-07 21:13:49 -0800 | [diff] [blame^] | 33 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 34 | unsigned int flags; |
| 35 | #define MMC_RSP_PRESENT (1 << 0) |
| 36 | #define MMC_RSP_136 (1 << 1) |
| 37 | #define MMC_RSP_CRC (1 << 2) |
Ben Cheng | 654325d | 2012-03-07 21:13:49 -0800 | [diff] [blame^] | 38 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 39 | #define MMC_RSP_BUSY (1 << 3) |
| 40 | #define MMC_RSP_OPCODE (1 << 4) |
| 41 | #define MMC_CMD_MASK (3 << 5) |
| 42 | #define MMC_CMD_AC (0 << 5) |
Ben Cheng | 654325d | 2012-03-07 21:13:49 -0800 | [diff] [blame^] | 43 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 44 | #define MMC_CMD_ADTC (1 << 5) |
| 45 | #define MMC_CMD_BC (2 << 5) |
| 46 | #define MMC_CMD_BCR (3 << 5) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 47 | #define MMC_RSP_NONE (0) |
Ben Cheng | 654325d | 2012-03-07 21:13:49 -0800 | [diff] [blame^] | 48 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 49 | #define MMC_RSP_R1 (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE) |
| 50 | #define MMC_RSP_R1B (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE|MMC_RSP_BUSY) |
| 51 | #define MMC_RSP_R2 (MMC_RSP_PRESENT|MMC_RSP_136|MMC_RSP_CRC) |
| 52 | #define MMC_RSP_R3 (MMC_RSP_PRESENT) |
Ben Cheng | 654325d | 2012-03-07 21:13:49 -0800 | [diff] [blame^] | 53 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 54 | #define MMC_RSP_R6 (MMC_RSP_PRESENT|MMC_RSP_CRC) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 55 | #define mmc_resp_type(cmd) ((cmd)->flags & (MMC_RSP_PRESENT|MMC_RSP_136|MMC_RSP_CRC|MMC_RSP_BUSY|MMC_RSP_OPCODE)) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 56 | #define mmc_cmd_type(cmd) ((cmd)->flags & MMC_CMD_MASK) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 57 | unsigned int retries; |
Ben Cheng | 654325d | 2012-03-07 21:13:49 -0800 | [diff] [blame^] | 58 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 59 | unsigned int error; |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 60 | #define MMC_ERR_NONE 0 |
| 61 | #define MMC_ERR_TIMEOUT 1 |
| 62 | #define MMC_ERR_BADCRC 2 |
Ben Cheng | 654325d | 2012-03-07 21:13:49 -0800 | [diff] [blame^] | 63 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 64 | #define MMC_ERR_FIFO 3 |
| 65 | #define MMC_ERR_FAILED 4 |
| 66 | #define MMC_ERR_INVALID 5 |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 67 | struct mmc_data *data; |
Ben Cheng | 654325d | 2012-03-07 21:13:49 -0800 | [diff] [blame^] | 68 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 69 | struct mmc_request *mrq; |
| 70 | }; |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 71 | struct mmc_data { |
| 72 | unsigned int timeout_ns; |
Ben Cheng | 654325d | 2012-03-07 21:13:49 -0800 | [diff] [blame^] | 73 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 74 | unsigned int timeout_clks; |
| 75 | unsigned int blksz_bits; |
| 76 | unsigned int blksz; |
| 77 | unsigned int blocks; |
Ben Cheng | 654325d | 2012-03-07 21:13:49 -0800 | [diff] [blame^] | 78 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 79 | unsigned int error; |
| 80 | unsigned int flags; |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 81 | #define MMC_DATA_WRITE (1 << 8) |
| 82 | #define MMC_DATA_READ (1 << 9) |
Ben Cheng | 654325d | 2012-03-07 21:13:49 -0800 | [diff] [blame^] | 83 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 84 | #define MMC_DATA_STREAM (1 << 10) |
| 85 | #define MMC_DATA_MULTI (1 << 11) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 86 | unsigned int bytes_xfered; |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 87 | struct mmc_command *stop; |
Ben Cheng | 654325d | 2012-03-07 21:13:49 -0800 | [diff] [blame^] | 88 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 89 | struct mmc_request *mrq; |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 90 | unsigned int sg_len; |
| 91 | struct scatterlist *sg; |
| 92 | }; |
Ben Cheng | 654325d | 2012-03-07 21:13:49 -0800 | [diff] [blame^] | 93 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 94 | struct mmc_request { |
| 95 | struct mmc_command *cmd; |
| 96 | struct mmc_data *data; |
| 97 | struct mmc_command *stop; |
Ben Cheng | 654325d | 2012-03-07 21:13:49 -0800 | [diff] [blame^] | 98 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 99 | void *done_data; |
| 100 | void (*done)(struct mmc_request *); |
| 101 | }; |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 102 | struct mmc_host; |
Ben Cheng | 654325d | 2012-03-07 21:13:49 -0800 | [diff] [blame^] | 103 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 104 | struct mmc_card; |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 105 | #endif |