diff options
Diffstat (limited to 'include/linux')
49 files changed, 1469 insertions, 471 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index f317c270d4bf..afae306b177c 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
| @@ -49,6 +49,7 @@ header-y += consolemap.h | |||
| 49 | header-y += const.h | 49 | header-y += const.h |
| 50 | header-y += cycx_cfm.h | 50 | header-y += cycx_cfm.h |
| 51 | header-y += dlm_device.h | 51 | header-y += dlm_device.h |
| 52 | header-y += dlm_netlink.h | ||
| 52 | header-y += dm-ioctl.h | 53 | header-y += dm-ioctl.h |
| 53 | header-y += dn.h | 54 | header-y += dn.h |
| 54 | header-y += dqblk_v1.h | 55 | header-y += dqblk_v1.h |
diff --git a/include/linux/ata.h b/include/linux/ata.h index 703febb2df31..407dc7e098bc 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h | |||
| @@ -126,6 +126,7 @@ enum { | |||
| 126 | ATA_REG_IRQ = ATA_REG_NSECT, | 126 | ATA_REG_IRQ = ATA_REG_NSECT, |
| 127 | 127 | ||
| 128 | /* ATA device commands */ | 128 | /* ATA device commands */ |
| 129 | ATA_CMD_DEV_RESET = 0x08, /* ATAPI device reset */ | ||
| 129 | ATA_CMD_CHK_POWER = 0xE5, /* check power mode */ | 130 | ATA_CMD_CHK_POWER = 0xE5, /* check power mode */ |
| 130 | ATA_CMD_STANDBY = 0xE2, /* place in standby power mode */ | 131 | ATA_CMD_STANDBY = 0xE2, /* place in standby power mode */ |
| 131 | ATA_CMD_IDLE = 0xE3, /* place in idle power mode */ | 132 | ATA_CMD_IDLE = 0xE3, /* place in idle power mode */ |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index db5b00a792f5..fae138bd2207 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
| @@ -868,11 +868,6 @@ void kblockd_flush_work(struct work_struct *work); | |||
| 868 | */ | 868 | */ |
| 869 | #define buffer_heads_over_limit 0 | 869 | #define buffer_heads_over_limit 0 |
| 870 | 870 | ||
| 871 | static inline long blk_congestion_wait(int rw, long timeout) | ||
| 872 | { | ||
| 873 | return io_schedule_timeout(timeout); | ||
| 874 | } | ||
| 875 | |||
| 876 | static inline long nr_blockdev_pages(void) | 871 | static inline long nr_blockdev_pages(void) |
| 877 | { | 872 | { |
| 878 | return 0; | 873 | return 0; |
diff --git a/include/linux/dlm.h b/include/linux/dlm.h index 1b1dcb9a40bb..be9d278761e0 100644 --- a/include/linux/dlm.h +++ b/include/linux/dlm.h | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | ******************************************************************************* | 2 | ******************************************************************************* |
| 3 | ** | 3 | ** |
| 4 | ** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. | 4 | ** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. |
| 5 | ** Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved. | 5 | ** Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved. |
| 6 | ** | 6 | ** |
| 7 | ** This copyrighted material is made available to anyone wishing to use, | 7 | ** This copyrighted material is made available to anyone wishing to use, |
| 8 | ** modify, copy, or redistribute it subject to the terms and conditions | 8 | ** modify, copy, or redistribute it subject to the terms and conditions |
| @@ -85,7 +85,11 @@ | |||
| 85 | * Only relevant to locks originating in userspace. A persistent lock will not | 85 | * Only relevant to locks originating in userspace. A persistent lock will not |
| 86 | * be removed if the process holding the lock exits. | 86 | * be removed if the process holding the lock exits. |
| 87 | * | 87 | * |
| 88 | * DLM_LKF_NODLKWT | 88 | * DLM_LKF_NODLCKWT |
| 89 | * | ||
| 90 | * Do not cancel the lock if it gets into conversion deadlock. | ||
| 91 | * Exclude this lock from being monitored due to DLM_LSFL_TIMEWARN. | ||
| 92 | * | ||
| 89 | * DLM_LKF_NODLCKBLK | 93 | * DLM_LKF_NODLCKBLK |
| 90 | * | 94 | * |
| 91 | * net yet implemented | 95 | * net yet implemented |
| @@ -149,6 +153,7 @@ | |||
| 149 | #define DLM_LKF_ALTPR 0x00008000 | 153 | #define DLM_LKF_ALTPR 0x00008000 |
| 150 | #define DLM_LKF_ALTCW 0x00010000 | 154 | #define DLM_LKF_ALTCW 0x00010000 |
| 151 | #define DLM_LKF_FORCEUNLOCK 0x00020000 | 155 | #define DLM_LKF_FORCEUNLOCK 0x00020000 |
| 156 | #define DLM_LKF_TIMEOUT 0x00040000 | ||
| 152 | 157 | ||
| 153 | /* | 158 | /* |
| 154 | * Some return codes that are not in errno.h | 159 | * Some return codes that are not in errno.h |
| @@ -199,11 +204,12 @@ struct dlm_lksb { | |||
| 199 | char * sb_lvbptr; | 204 | char * sb_lvbptr; |
| 200 | }; | 205 | }; |
| 201 | 206 | ||
| 207 | #define DLM_LSFL_NODIR 0x00000001 | ||
| 208 | #define DLM_LSFL_TIMEWARN 0x00000002 | ||
| 209 | #define DLM_LSFL_FS 0x00000004 | ||
| 202 | 210 | ||
| 203 | #ifdef __KERNEL__ | 211 | #ifdef __KERNEL__ |
| 204 | 212 | ||
| 205 | #define DLM_LSFL_NODIR 0x00000001 | ||
| 206 | |||
| 207 | /* | 213 | /* |
| 208 | * dlm_new_lockspace | 214 | * dlm_new_lockspace |
| 209 | * | 215 | * |
diff --git a/include/linux/dlm_device.h b/include/linux/dlm_device.h index c2735cab2ebf..9642277a152a 100644 --- a/include/linux/dlm_device.h +++ b/include/linux/dlm_device.h | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | ******************************************************************************* | 2 | ******************************************************************************* |
| 3 | ** | 3 | ** |
| 4 | ** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. | 4 | ** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. |
| 5 | ** Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved. | 5 | ** Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved. |
| 6 | ** | 6 | ** |
| 7 | ** This copyrighted material is made available to anyone wishing to use, | 7 | ** This copyrighted material is made available to anyone wishing to use, |
| 8 | ** modify, copy, or redistribute it subject to the terms and conditions | 8 | ** modify, copy, or redistribute it subject to the terms and conditions |
| @@ -18,21 +18,24 @@ | |||
| 18 | #define DLM_USER_LVB_LEN 32 | 18 | #define DLM_USER_LVB_LEN 32 |
| 19 | 19 | ||
| 20 | /* Version of the device interface */ | 20 | /* Version of the device interface */ |
| 21 | #define DLM_DEVICE_VERSION_MAJOR 5 | 21 | #define DLM_DEVICE_VERSION_MAJOR 6 |
| 22 | #define DLM_DEVICE_VERSION_MINOR 1 | 22 | #define DLM_DEVICE_VERSION_MINOR 0 |
| 23 | #define DLM_DEVICE_VERSION_PATCH 0 | 23 | #define DLM_DEVICE_VERSION_PATCH 0 |
| 24 | 24 | ||
| 25 | /* struct passed to the lock write */ | 25 | /* struct passed to the lock write */ |
| 26 | struct dlm_lock_params { | 26 | struct dlm_lock_params { |
| 27 | __u8 mode; | 27 | __u8 mode; |
| 28 | __u8 namelen; | 28 | __u8 namelen; |
| 29 | __u16 flags; | 29 | __u16 unused; |
| 30 | __u32 flags; | ||
| 30 | __u32 lkid; | 31 | __u32 lkid; |
| 31 | __u32 parent; | 32 | __u32 parent; |
| 32 | void __user *castparam; | 33 | __u64 xid; |
| 34 | __u64 timeout; | ||
| 35 | void __user *castparam; | ||
| 33 | void __user *castaddr; | 36 | void __user *castaddr; |
| 34 | void __user *bastparam; | 37 | void __user *bastparam; |
| 35 | void __user *bastaddr; | 38 | void __user *bastaddr; |
| 36 | struct dlm_lksb __user *lksb; | 39 | struct dlm_lksb __user *lksb; |
| 37 | char lvb[DLM_USER_LVB_LEN]; | 40 | char lvb[DLM_USER_LVB_LEN]; |
| 38 | char name[0]; | 41 | char name[0]; |
| @@ -62,9 +65,15 @@ struct dlm_write_request { | |||
| 62 | } i; | 65 | } i; |
| 63 | }; | 66 | }; |
| 64 | 67 | ||
| 68 | struct dlm_device_version { | ||
| 69 | __u32 version[3]; | ||
| 70 | }; | ||
| 71 | |||
| 65 | /* struct read from the "device" fd, | 72 | /* struct read from the "device" fd, |
| 66 | consists mainly of userspace pointers for the library to use */ | 73 | consists mainly of userspace pointers for the library to use */ |
| 74 | |||
| 67 | struct dlm_lock_result { | 75 | struct dlm_lock_result { |
| 76 | __u32 version[3]; | ||
| 68 | __u32 length; | 77 | __u32 length; |
| 69 | void __user * user_astaddr; | 78 | void __user * user_astaddr; |
| 70 | void __user * user_astparam; | 79 | void __user * user_astparam; |
| @@ -83,6 +92,7 @@ struct dlm_lock_result { | |||
| 83 | #define DLM_USER_CREATE_LOCKSPACE 4 | 92 | #define DLM_USER_CREATE_LOCKSPACE 4 |
| 84 | #define DLM_USER_REMOVE_LOCKSPACE 5 | 93 | #define DLM_USER_REMOVE_LOCKSPACE 5 |
| 85 | #define DLM_USER_PURGE 6 | 94 | #define DLM_USER_PURGE 6 |
| 95 | #define DLM_USER_DEADLOCK 7 | ||
| 86 | 96 | ||
| 87 | /* Arbitrary length restriction */ | 97 | /* Arbitrary length restriction */ |
| 88 | #define MAX_LS_NAME_LEN 64 | 98 | #define MAX_LS_NAME_LEN 64 |
diff --git a/include/linux/dlm_netlink.h b/include/linux/dlm_netlink.h new file mode 100644 index 000000000000..19276332707a --- /dev/null +++ b/include/linux/dlm_netlink.h | |||
| @@ -0,0 +1,56 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2007 Red Hat, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * This copyrighted material is made available to anyone wishing to use, | ||
| 5 | * modify, copy, or redistribute it subject to the terms and conditions | ||
| 6 | * of the GNU General Public License v.2. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #ifndef _DLM_NETLINK_H | ||
| 10 | #define _DLM_NETLINK_H | ||
| 11 | |||
| 12 | enum { | ||
| 13 | DLM_STATUS_WAITING = 1, | ||
| 14 | DLM_STATUS_GRANTED = 2, | ||
| 15 | DLM_STATUS_CONVERT = 3, | ||
| 16 | }; | ||
| 17 | |||
| 18 | #define DLM_LOCK_DATA_VERSION 1 | ||
| 19 | |||
| 20 | struct dlm_lock_data { | ||
| 21 | uint16_t version; | ||
| 22 | uint32_t lockspace_id; | ||
| 23 | int nodeid; | ||
| 24 | int ownpid; | ||
| 25 | uint32_t id; | ||
| 26 | uint32_t remid; | ||
| 27 | uint64_t xid; | ||
| 28 | int8_t status; | ||
| 29 | int8_t grmode; | ||
| 30 | int8_t rqmode; | ||
| 31 | unsigned long timestamp; | ||
| 32 | int resource_namelen; | ||
| 33 | char resource_name[DLM_RESNAME_MAXLEN]; | ||
| 34 | }; | ||
| 35 | |||
| 36 | enum { | ||
| 37 | DLM_CMD_UNSPEC = 0, | ||
| 38 | DLM_CMD_HELLO, /* user->kernel */ | ||
| 39 | DLM_CMD_TIMEOUT, /* kernel->user */ | ||
| 40 | __DLM_CMD_MAX, | ||
| 41 | }; | ||
| 42 | |||
| 43 | #define DLM_CMD_MAX (__DLM_CMD_MAX - 1) | ||
| 44 | |||
| 45 | enum { | ||
| 46 | DLM_TYPE_UNSPEC = 0, | ||
| 47 | DLM_TYPE_LOCK, | ||
| 48 | __DLM_TYPE_MAX, | ||
| 49 | }; | ||
| 50 | |||
| 51 | #define DLM_TYPE_MAX (__DLM_TYPE_MAX - 1) | ||
| 52 | |||
| 53 | #define DLM_GENL_VERSION 0x1 | ||
| 54 | #define DLM_GENL_NAME "DLM" | ||
| 55 | |||
| 56 | #endif /* _DLM_NETLINK_H */ | ||
diff --git a/include/linux/eeprom_93cx6.h b/include/linux/eeprom_93cx6.h new file mode 100644 index 000000000000..d774b7778c91 --- /dev/null +++ b/include/linux/eeprom_93cx6.h | |||
| @@ -0,0 +1,72 @@ | |||
| 1 | /* | ||
| 2 | Copyright (C) 2004 - 2006 rt2x00 SourceForge Project | ||
| 3 | <http://rt2x00.serialmonkey.com> | ||
| 4 | |||
| 5 | This program is free software; you can redistribute it and/or modify | ||
| 6 | it under the terms of the GNU General Public License as published by | ||
| 7 | the Free Software Foundation; either version 2 of the License, or | ||
| 8 | (at your option) any later version. | ||
| 9 | |||
| 10 | This program is distributed in the hope that it will be useful, | ||
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | GNU General Public License for more details. | ||
| 14 | |||
| 15 | You should have received a copy of the GNU General Public License | ||
| 16 | along with this program; if not, write to the | ||
| 17 | Free Software Foundation, Inc., | ||
| 18 | 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
| 19 | */ | ||
| 20 | |||
| 21 | /* | ||
| 22 | Module: eeprom_93cx6 | ||
| 23 | Abstract: EEPROM reader datastructures for 93cx6 chipsets. | ||
| 24 | Supported chipsets: 93c46 & 93c66. | ||
| 25 | */ | ||
| 26 | |||
| 27 | /* | ||
| 28 | * EEPROM operation defines. | ||
| 29 | */ | ||
| 30 | #define PCI_EEPROM_WIDTH_93C46 6 | ||
| 31 | #define PCI_EEPROM_WIDTH_93C66 8 | ||
| 32 | #define PCI_EEPROM_WIDTH_OPCODE 3 | ||
| 33 | #define PCI_EEPROM_WRITE_OPCODE 0x05 | ||
| 34 | #define PCI_EEPROM_READ_OPCODE 0x06 | ||
| 35 | #define PCI_EEPROM_EWDS_OPCODE 0x10 | ||
| 36 | #define PCI_EEPROM_EWEN_OPCODE 0x13 | ||
| 37 | |||
| 38 | /** | ||
| 39 | * struct eeprom_93cx6 - control structure for setting the commands | ||
| 40 | * for reading the eeprom data. | ||
| 41 | * @data: private pointer for the driver. | ||
| 42 | * @register_read(struct eeprom_93cx6 *eeprom): handler to | ||
| 43 | * read the eeprom register, this function should set all reg_* fields. | ||
| 44 | * @register_write(struct eeprom_93cx6 *eeprom): handler to | ||
| 45 | * write to the eeprom register by using all reg_* fields. | ||
| 46 | * @width: eeprom width, should be one of the PCI_EEPROM_WIDTH_* defines | ||
| 47 | * @reg_data_in: register field to indicate data input | ||
| 48 | * @reg_data_out: register field to indicate data output | ||
| 49 | * @reg_data_clock: register field to set the data clock | ||
| 50 | * @reg_chip_select: register field to set the chip select | ||
| 51 | * | ||
| 52 | * This structure is used for the communication between the driver | ||
| 53 | * and the eeprom_93cx6 handlers for reading the eeprom. | ||
| 54 | */ | ||
| 55 | struct eeprom_93cx6 { | ||
| 56 | void *data; | ||
| 57 | |||
| 58 | void (*register_read)(struct eeprom_93cx6 *eeprom); | ||
| 59 | void (*register_write)(struct eeprom_93cx6 *eeprom); | ||
| 60 | |||
| 61 | int width; | ||
| 62 | |||
| 63 | char reg_data_in; | ||
| 64 | char reg_data_out; | ||
| 65 | char reg_data_clock; | ||
| 66 | char reg_chip_select; | ||
| 67 | }; | ||
| 68 | |||
| 69 | extern void eeprom_93cx6_read(struct eeprom_93cx6 *eeprom, | ||
| 70 | const u8 word, u16 *data); | ||
| 71 | extern void eeprom_93cx6_multiread(struct eeprom_93cx6 *eeprom, | ||
| 72 | const u8 word, __le16 *data, const u16 words); | ||
diff --git a/include/linux/eventfd.h b/include/linux/eventfd.h index 0d6ecc60b94d..b489fc6d0b62 100644 --- a/include/linux/eventfd.h +++ b/include/linux/eventfd.h | |||
| @@ -19,7 +19,8 @@ int eventfd_signal(struct file *file, int n); | |||
| 19 | #else /* CONFIG_EVENTFD */ | 19 | #else /* CONFIG_EVENTFD */ |
| 20 | 20 | ||
| 21 | #define eventfd_fget(fd) ERR_PTR(-ENOSYS) | 21 | #define eventfd_fget(fd) ERR_PTR(-ENOSYS) |
| 22 | #define eventfd_signal(f, n) 0 | 22 | static inline int eventfd_signal(struct file *file, int n) |
| 23 | { return 0; } | ||
| 23 | 24 | ||
| 24 | #endif /* CONFIG_EVENTFD */ | 25 | #endif /* CONFIG_EVENTFD */ |
| 25 | 26 | ||
diff --git a/include/linux/firewire-cdev.h b/include/linux/firewire-cdev.h index efbe1fda1a22..1a45d6f41b09 100644 --- a/include/linux/firewire-cdev.h +++ b/include/linux/firewire-cdev.h | |||
| @@ -30,16 +30,38 @@ | |||
| 30 | #define FW_CDEV_EVENT_REQUEST 0x02 | 30 | #define FW_CDEV_EVENT_REQUEST 0x02 |
| 31 | #define FW_CDEV_EVENT_ISO_INTERRUPT 0x03 | 31 | #define FW_CDEV_EVENT_ISO_INTERRUPT 0x03 |
| 32 | 32 | ||
| 33 | /* The 'closure' fields are for user space to use. Data passed in the | 33 | /** |
| 34 | * 'closure' field for a request will be returned in the corresponding | 34 | * struct fw_cdev_event_common - Common part of all fw_cdev_event_ types |
| 35 | * event. It's a 64-bit type so that it's a fixed size type big | 35 | * @closure: For arbitrary use by userspace |
| 36 | * enough to hold a pointer on all platforms. */ | 36 | * @type: Discriminates the fw_cdev_event_ types |
| 37 | 37 | * | |
| 38 | * This struct may be used to access generic members of all fw_cdev_event_ | ||
| 39 | * types regardless of the specific type. | ||
| 40 | * | ||
| 41 | * Data passed in the @closure field for a request will be returned in the | ||
| 42 | * corresponding event. It is big enough to hold a pointer on all platforms. | ||
| 43 | * The ioctl used to set @closure depends on the @type of event. | ||
| 44 | */ | ||
| 38 | struct fw_cdev_event_common { | 45 | struct fw_cdev_event_common { |
| 39 | __u64 closure; | 46 | __u64 closure; |
| 40 | __u32 type; | 47 | __u32 type; |
| 41 | }; | 48 | }; |
| 42 | 49 | ||
| 50 | /** | ||
| 51 | * struct fw_cdev_event_bus_reset - Sent when a bus reset occurred | ||
| 52 | * @closure: See &fw_cdev_event_common; set by %FW_CDEV_IOC_GET_INFO ioctl | ||
| 53 | * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_BUS_RESET | ||
| 54 | * @node_id: New node ID of this node | ||
| 55 | * @local_node_id: Node ID of the local node, i.e. of the controller | ||
| 56 | * @bm_node_id: Node ID of the bus manager | ||
| 57 | * @irm_node_id: Node ID of the iso resource manager | ||
| 58 | * @root_node_id: Node ID of the root node | ||
| 59 | * @generation: New bus generation | ||
| 60 | * | ||
| 61 | * This event is sent when the bus the device belongs to goes through a bus | ||
| 62 | * reset. It provides information about the new bus configuration, such as | ||
| 63 | * new node ID for this device, new root ID, and others. | ||
| 64 | */ | ||
| 43 | struct fw_cdev_event_bus_reset { | 65 | struct fw_cdev_event_bus_reset { |
| 44 | __u64 closure; | 66 | __u64 closure; |
| 45 | __u32 type; | 67 | __u32 type; |
| @@ -51,6 +73,20 @@ struct fw_cdev_event_bus_reset { | |||
| 51 | __u32 generation; | 73 | __u32 generation; |
| 52 | }; | 74 | }; |
| 53 | 75 | ||
| 76 | /** | ||
| 77 | * struct fw_cdev_event_response - Sent when a response packet was received | ||
| 78 | * @closure: See &fw_cdev_event_common; | ||
| 79 | * set by %FW_CDEV_IOC_SEND_REQUEST ioctl | ||
| 80 | * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_RESPONSE | ||
| 81 | * @rcode: Response code returned by the remote node | ||
| 82 | * @length: Data length, i.e. the response's payload size in bytes | ||
| 83 | * @data: Payload data, if any | ||
| 84 | * | ||
| 85 | * This event is sent when the stack receives a response to an outgoing request | ||
| 86 | * sent by %FW_CDEV_IOC_SEND_REQUEST ioctl. The payload data for responses | ||
| 87 | * carrying data (read and lock responses) follows immediately and can be | ||
| 88 | * accessed through the @data field. | ||
| 89 | */ | ||
| 54 | struct fw_cdev_event_response { | 90 | struct fw_cdev_event_response { |
| 55 | __u64 closure; | 91 | __u64 closure; |
| 56 | __u32 type; | 92 | __u32 type; |
| @@ -59,6 +95,25 @@ struct fw_cdev_event_response { | |||
| 59 | __u32 data[0]; | 95 | __u32 data[0]; |
| 60 | }; | 96 | }; |
| 61 | 97 | ||
| 98 | /** | ||
| 99 | * struct fw_cdev_event_request - Sent on incoming request to an address region | ||
| 100 | * @closure: See &fw_cdev_event_common; set by %FW_CDEV_IOC_ALLOCATE ioctl | ||
| 101 | * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_REQUEST | ||
| 102 | * @tcode: Transaction code of the incoming request | ||
| 103 | * @offset: The offset into the 48-bit per-node address space | ||
| 104 | * @handle: Reference to the kernel-side pending request | ||
| 105 | * @length: Data length, i.e. the request's payload size in bytes | ||
| 106 | * @data: Incoming data, if any | ||
| 107 | * | ||
| 108 | * This event is sent when the stack receives an incoming request to an address | ||
| 109 | * region registered using the %FW_CDEV_IOC_ALLOCATE ioctl. The request is | ||
| 110 | * guaranteed to be completely contained in the specified region. Userspace is | ||
| 111 | * responsible for sending the response by %FW_CDEV_IOC_SEND_RESPONSE ioctl, | ||
| 112 | * using the same @handle. | ||
| 113 | * | ||
| 114 | * The payload data for requests carrying data (write and lock requests) | ||
| 115 | * follows immediately and can be accessed through the @data field. | ||
| 116 | */ | ||
| 62 | struct fw_cdev_event_request { | 117 | struct fw_cdev_event_request { |
| 63 | __u64 closure; | 118 | __u64 closure; |
| 64 | __u32 type; | 119 | __u32 type; |
| @@ -69,14 +124,39 @@ struct fw_cdev_event_request { | |||
| 69 | __u32 data[0]; | 124 | __u32 data[0]; |
| 70 | }; | 125 | }; |
| 71 | 126 | ||
| 127 | /** | ||
| 128 | * struct fw_cdev_event_iso_interrupt - Sent when an iso packet was completed | ||
| 129 | * @closure: See &fw_cdev_event_common; | ||
| 130 | * set by %FW_CDEV_CREATE_ISO_CONTEXT ioctl | ||
| 131 | * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_ISO_INTERRUPT | ||
| 132 | * @cycle: Cycle counter of the interrupt packet | ||
| 133 | * @header_length: Total length of following headers, in bytes | ||
| 134 | * @header: Stripped headers, if any | ||
| 135 | * | ||
| 136 | * This event is sent when the controller has completed an &fw_cdev_iso_packet | ||
| 137 | * with the %FW_CDEV_ISO_INTERRUPT bit set. In the receive case, the headers | ||
| 138 | * stripped of all packets up until and including the interrupt packet are | ||
| 139 | * returned in the @header field. | ||
| 140 | */ | ||
| 72 | struct fw_cdev_event_iso_interrupt { | 141 | struct fw_cdev_event_iso_interrupt { |
| 73 | __u64 closure; | 142 | __u64 closure; |
| 74 | __u32 type; | 143 | __u32 type; |
| 75 | __u32 cycle; | 144 | __u32 cycle; |
| 76 | __u32 header_length; /* Length in bytes of following headers. */ | 145 | __u32 header_length; |
| 77 | __u32 header[0]; | 146 | __u32 header[0]; |
| 78 | }; | 147 | }; |
| 79 | 148 | ||
| 149 | /** | ||
| 150 | * union fw_cdev_event - Convenience union of fw_cdev_event_ types | ||
| 151 | * @common: Valid for all types | ||
| 152 | * @bus_reset: Valid if @common.type == %FW_CDEV_EVENT_BUS_RESET | ||
| 153 | * @response: Valid if @common.type == %FW_CDEV_EVENT_RESPONSE | ||
| 154 | * @request: Valid if @common.type == %FW_CDEV_EVENT_REQUEST | ||
| 155 | * @iso_interrupt: Valid if @common.type == %FW_CDEV_EVENT_ISO_INTERRUPT | ||
| 156 | * | ||
| 157 | * Convenience union for userspace use. Events could be read(2) into a char | ||
| 158 | * buffer and then cast to this union for further processing. | ||
| 159 | */ | ||
| 80 | union fw_cdev_event { | 160 | union fw_cdev_event { |
| 81 | struct fw_cdev_event_common common; | 161 | struct fw_cdev_event_common common; |
| 82 | struct fw_cdev_event_bus_reset bus_reset; | 162 | struct fw_cdev_event_bus_reset bus_reset; |
| @@ -105,35 +185,47 @@ union fw_cdev_event { | |||
| 105 | */ | 185 | */ |
| 106 | #define FW_CDEV_VERSION 1 | 186 | #define FW_CDEV_VERSION 1 |
| 107 | 187 | ||
| 188 | /** | ||
| 189 | * struct fw_cdev_get_info - General purpose information ioctl | ||
| 190 | * @version: The version field is just a running serial number. | ||
| 191 | * We never break backwards compatibility, but may add more | ||
| 192 | * structs and ioctls in later revisions. | ||
| 193 | * @rom_length: If @rom is non-zero, at most rom_length bytes of configuration | ||
| 194 | * ROM will be copied into that user space address. In either | ||
| 195 | * case, @rom_length is updated with the actual length of the | ||
| 196 | * configuration ROM. | ||
| 197 | * @rom: If non-zero, address of a buffer to be filled by a copy of the | ||
| 198 | * local node's configuration ROM | ||
| 199 | * @bus_reset: If non-zero, address of a buffer to be filled by a | ||
| 200 | * &struct fw_cdev_event_bus_reset with the current state | ||
| 201 | * of the bus. This does not cause a bus reset to happen. | ||
| 202 | * @bus_reset_closure: Value of &closure in this and subsequent bus reset events | ||
| 203 | * @card: The index of the card this device belongs to | ||
| 204 | */ | ||
| 108 | struct fw_cdev_get_info { | 205 | struct fw_cdev_get_info { |
| 109 | /* The version field is just a running serial number. We | ||
| 110 | * never break backwards compatibility. Userspace passes in | ||
| 111 | * the version it expects and the kernel passes back the | ||
| 112 | * highest version it can provide. Even if the structs in | ||
| 113 | * this interface are extended in a later version, the kernel | ||
| 114 | * will not copy back more data than what was present in the | ||
| 115 | * interface version userspace expects. */ | ||
| 116 | __u32 version; | 206 | __u32 version; |
| 117 | |||
| 118 | /* If non-zero, at most rom_length bytes of config rom will be | ||
| 119 | * copied into that user space address. In either case, | ||
| 120 | * rom_length is updated with the actual length of the config | ||
| 121 | * rom. */ | ||
| 122 | __u32 rom_length; | 207 | __u32 rom_length; |
| 123 | __u64 rom; | 208 | __u64 rom; |
| 124 | |||
| 125 | /* If non-zero, a fw_cdev_event_bus_reset struct will be | ||
| 126 | * copied here with the current state of the bus. This does | ||
| 127 | * not cause a bus reset to happen. The value of closure in | ||
| 128 | * this and sub-sequent bus reset events is set to | ||
| 129 | * bus_reset_closure. */ | ||
| 130 | __u64 bus_reset; | 209 | __u64 bus_reset; |
| 131 | __u64 bus_reset_closure; | 210 | __u64 bus_reset_closure; |
| 132 | |||
| 133 | /* The index of the card this devices belongs to. */ | ||
| 134 | __u32 card; | 211 | __u32 card; |
| 135 | }; | 212 | }; |
| 136 | 213 | ||
| 214 | /** | ||
| 215 | * struct fw_cdev_send_request - Send an asynchronous request packet | ||
| 216 | * @tcode: Transaction code of the request | ||
| 217 | * @length: Length of outgoing payload, in bytes | ||
| 218 | * @offset: 48-bit offset at destination node | ||
| 219 | * @closure: Passed back to userspace in the response event | ||
| 220 | * @data: Userspace pointer to payload | ||
| 221 | * @generation: The bus generation where packet is valid | ||
| 222 | * | ||
| 223 | * Send a request to the device. This ioctl implements all outgoing requests. | ||
| 224 | * Both quadlet and block request specify the payload as a pointer to the data | ||
| 225 | * in the @data field. Once the transaction completes, the kernel writes an | ||
| 226 | * &fw_cdev_event_request event back. The @closure field is passed back to | ||
| 227 | * user space in the response event. | ||
| 228 | */ | ||
| 137 | struct fw_cdev_send_request { | 229 | struct fw_cdev_send_request { |
| 138 | __u32 tcode; | 230 | __u32 tcode; |
| 139 | __u32 length; | 231 | __u32 length; |
| @@ -143,6 +235,19 @@ struct fw_cdev_send_request { | |||
| 143 | __u32 generation; | 235 | __u32 generation; |
| 144 | }; | 236 | }; |
| 145 | 237 | ||
| 238 | /** | ||
| 239 | * struct fw_cdev_send_response - Send an asynchronous response packet | ||
| 240 | * @rcode: Response code as determined by the userspace handler | ||
| 241 | * @length: Length of outgoing payload, in bytes | ||
| 242 | * @data: Userspace pointer to payload | ||
| 243 | * @handle: The handle from the &fw_cdev_event_request | ||
| 244 | * | ||
| 245 | * Send a response to an incoming request. By setting up an address range using | ||
| 246 | * the %FW_CDEV_IOC_ALLOCATE ioctl, userspace can listen for incoming requests. An | ||
| 247 | * incoming request will generate an %FW_CDEV_EVENT_REQUEST, and userspace must | ||
| 248 | * send a reply using this ioctl. The event has a handle to the kernel-side | ||
| 249 | * pending transaction, which should be used with this ioctl. | ||
| 250 | */ | ||
| 146 | struct fw_cdev_send_response { | 251 | struct fw_cdev_send_response { |
| 147 | __u32 rcode; | 252 | __u32 rcode; |
| 148 | __u32 length; | 253 | __u32 length; |
| @@ -150,6 +255,21 @@ struct fw_cdev_send_response { | |||
| 150 | __u32 handle; | 255 | __u32 handle; |
| 151 | }; | 256 | }; |
| 152 | 257 | ||
| 258 | /** | ||
| 259 | * struct fw_cdev_allocate - Allocate a CSR address range | ||
| 260 | * @offset: Start offset of the address range | ||
| 261 | * @closure: To be passed back to userspace in request events | ||
| 262 | * @length: Length of the address range, in bytes | ||
| 263 | * @handle: Handle to the allocation, written by the kernel | ||
| 264 | * | ||
| 265 | * Allocate an address range in the 48-bit address space on the local node | ||
| 266 | * (the controller). This allows userspace to listen for requests with an | ||
| 267 | * offset within that address range. When the kernel receives a request | ||
| 268 | * within the range, an &fw_cdev_event_request event will be written back. | ||
| 269 | * The @closure field is passed back to userspace in the response event. | ||
| 270 | * The @handle field is an out parameter, returning a handle to the allocated | ||
| 271 | * range to be used for later deallocation of the range. | ||
| 272 | */ | ||
| 153 | struct fw_cdev_allocate { | 273 | struct fw_cdev_allocate { |
| 154 | __u64 offset; | 274 | __u64 offset; |
| 155 | __u64 closure; | 275 | __u64 closure; |
| @@ -157,6 +277,11 @@ struct fw_cdev_allocate { | |||
| 157 | __u32 handle; | 277 | __u32 handle; |
| 158 | }; | 278 | }; |
| 159 | 279 | ||
| 280 | /** | ||
| 281 | * struct fw_cdev_deallocate - Free an address range allocation | ||
| 282 | * @handle: Handle to the address range, as returned by the kernel when the | ||
| 283 | * range was allocated | ||
| 284 | */ | ||
| 160 | struct fw_cdev_deallocate { | 285 | struct fw_cdev_deallocate { |
| 161 | __u32 handle; | 286 | __u32 handle; |
| 162 | }; | 287 | }; |
| @@ -164,10 +289,41 @@ struct fw_cdev_deallocate { | |||
| 164 | #define FW_CDEV_LONG_RESET 0 | 289 | #define FW_CDEV_LONG_RESET 0 |
| 165 | #define FW_CDEV_SHORT_RESET 1 | 290 | #define FW_CDEV_SHORT_RESET 1 |
| 166 | 291 | ||
| 292 | /** | ||
| 293 | * struct fw_cdev_initiate_bus_reset - Initiate a bus reset | ||
| 294 | * @type: %FW_CDEV_SHORT_RESET or %FW_CDEV_LONG_RESET | ||
| 295 | * | ||
| 296 | * Initiate a bus reset for the bus this device is on. The bus reset can be | ||
| 297 | * either the original (long) bus reset or the arbitrated (short) bus reset | ||
| 298 | * introduced in 1394a-2000. | ||
| 299 | */ | ||
| 167 | struct fw_cdev_initiate_bus_reset { | 300 | struct fw_cdev_initiate_bus_reset { |
| 168 | __u32 type; | 301 | __u32 type; /* FW_CDEV_SHORT_RESET or FW_CDEV_LONG_RESET */ |
| 169 | }; | 302 | }; |
| 170 | 303 | ||
| 304 | /** | ||
| 305 | * struct fw_cdev_add_descriptor - Add contents to the local node's config ROM | ||
| 306 | * @immediate: If non-zero, immediate key to insert before pointer | ||
| 307 | * @key: Upper 8 bits of root directory pointer | ||
| 308 | * @data: Userspace pointer to contents of descriptor block | ||
| 309 | * @length: Length of descriptor block data, in bytes | ||
| 310 | * @handle: Handle to the descriptor, written by the kernel | ||
| 311 | * | ||
| 312 | * Add a descriptor block and optionally a preceding immediate key to the local | ||
| 313 | * node's configuration ROM. | ||
| 314 | * | ||
| 315 | * The @key field specifies the upper 8 bits of the descriptor root directory | ||
| 316 | * pointer and the @data and @length fields specify the contents. The @key | ||
| 317 | * should be of the form 0xXX000000. The offset part of the root directory entry | ||
| 318 | * will be filled in by the kernel. | ||
| 319 | * | ||
| 320 | * If not 0, the @immediate field specifies an immediate key which will be | ||
| 321 | * inserted before the root directory pointer. | ||
| 322 | * | ||
| 323 | * If successful, the kernel adds the descriptor and writes back a handle to the | ||
| 324 | * kernel-side object to be used for later removal of the descriptor block and | ||
| 325 | * immediate key. | ||
| 326 | */ | ||
| 171 | struct fw_cdev_add_descriptor { | 327 | struct fw_cdev_add_descriptor { |
| 172 | __u32 immediate; | 328 | __u32 immediate; |
| 173 | __u32 key; | 329 | __u32 key; |
| @@ -176,6 +332,14 @@ struct fw_cdev_add_descriptor { | |||
| 176 | __u32 handle; | 332 | __u32 handle; |
| 177 | }; | 333 | }; |
| 178 | 334 | ||
| 335 | /** | ||
| 336 | * struct fw_cdev_remove_descriptor - Remove contents from the configuration ROM | ||
| 337 | * @handle: Handle to the descriptor, as returned by the kernel when the | ||
| 338 | * descriptor was added | ||
| 339 | * | ||
| 340 | * Remove a descriptor block and accompanying immediate key from the local | ||
| 341 | * node's configuration ROM. | ||
| 342 | */ | ||
| 179 | struct fw_cdev_remove_descriptor { | 343 | struct fw_cdev_remove_descriptor { |
| 180 | __u32 handle; | 344 | __u32 handle; |
| 181 | }; | 345 | }; |
| @@ -183,12 +347,24 @@ struct fw_cdev_remove_descriptor { | |||
| 183 | #define FW_CDEV_ISO_CONTEXT_TRANSMIT 0 | 347 | #define FW_CDEV_ISO_CONTEXT_TRANSMIT 0 |
| 184 | #define FW_CDEV_ISO_CONTEXT_RECEIVE 1 | 348 | #define FW_CDEV_ISO_CONTEXT_RECEIVE 1 |
| 185 | 349 | ||
| 186 | #define FW_CDEV_ISO_CONTEXT_MATCH_TAG0 1 | 350 | /** |
| 187 | #define FW_CDEV_ISO_CONTEXT_MATCH_TAG1 2 | 351 | * struct fw_cdev_create_iso_context - Create a context for isochronous IO |
| 188 | #define FW_CDEV_ISO_CONTEXT_MATCH_TAG2 4 | 352 | * @type: %FW_CDEV_ISO_CONTEXT_TRANSMIT or %FW_CDEV_ISO_CONTEXT_RECEIVE |
| 189 | #define FW_CDEV_ISO_CONTEXT_MATCH_TAG3 8 | 353 | * @header_size: Header size to strip for receive contexts |
| 190 | #define FW_CDEV_ISO_CONTEXT_MATCH_ALL_TAGS 15 | 354 | * @channel: Channel to bind to |
| 191 | 355 | * @speed: Speed to transmit at | |
| 356 | * @closure: To be returned in &fw_cdev_event_iso_interrupt | ||
| 357 | * @handle: Handle to context, written back by kernel | ||
| 358 | * | ||
| 359 | * Prior to sending or receiving isochronous I/O, a context must be created. | ||
| 360 | * The context records information about the transmit or receive configuration | ||
| 361 | * and typically maps to an underlying hardware resource. A context is set up | ||
| 362 | * for either sending or receiving. It is bound to a specific isochronous | ||
| 363 | * channel. | ||
| 364 | * | ||
| 365 | * If a context was successfully created, the kernel writes back a handle to the | ||
| 366 | * context, which must be passed in for subsequent operations on that context. | ||
| 367 | */ | ||
| 192 | struct fw_cdev_create_iso_context { | 368 | struct fw_cdev_create_iso_context { |
| 193 | __u32 type; | 369 | __u32 type; |
| 194 | __u32 header_size; | 370 | __u32 header_size; |
| @@ -201,15 +377,49 @@ struct fw_cdev_create_iso_context { | |||
| 201 | #define FW_CDEV_ISO_PAYLOAD_LENGTH(v) (v) | 377 | #define FW_CDEV_ISO_PAYLOAD_LENGTH(v) (v) |
| 202 | #define FW_CDEV_ISO_INTERRUPT (1 << 16) | 378 | #define FW_CDEV_ISO_INTERRUPT (1 << 16) |
| 203 | #define FW_CDEV_ISO_SKIP (1 << 17) | 379 | #define FW_CDEV_ISO_SKIP (1 << 17) |
| 380 | #define FW_CDEV_ISO_SYNC (1 << 17) | ||
| 204 | #define FW_CDEV_ISO_TAG(v) ((v) << 18) | 381 | #define FW_CDEV_ISO_TAG(v) ((v) << 18) |
| 205 | #define FW_CDEV_ISO_SY(v) ((v) << 20) | 382 | #define FW_CDEV_ISO_SY(v) ((v) << 20) |
| 206 | #define FW_CDEV_ISO_HEADER_LENGTH(v) ((v) << 24) | 383 | #define FW_CDEV_ISO_HEADER_LENGTH(v) ((v) << 24) |
| 207 | 384 | ||
| 385 | /** | ||
| 386 | * struct fw_cdev_iso_packet - Isochronous packet | ||
| 387 | * @control: Contains the header length (8 uppermost bits), the sy field | ||
| 388 | * (4 bits), the tag field (2 bits), a sync flag (1 bit), | ||
| 389 | * a skip flag (1 bit), an interrupt flag (1 bit), and the | ||
| 390 | * payload length (16 lowermost bits) | ||
| 391 | * @header: Header and payload | ||
| 392 | * | ||
| 393 | * &struct fw_cdev_iso_packet is used to describe isochronous packet queues. | ||
| 394 | * | ||
| 395 | * Use the FW_CDEV_ISO_ macros to fill in @control. The sy and tag fields are | ||
| 396 | * specified by IEEE 1394a and IEC 61883. | ||
| 397 | * | ||
| 398 | * FIXME - finish this documentation | ||
| 399 | */ | ||
| 208 | struct fw_cdev_iso_packet { | 400 | struct fw_cdev_iso_packet { |
| 209 | __u32 control; | 401 | __u32 control; |
| 210 | __u32 header[0]; | 402 | __u32 header[0]; |
| 211 | }; | 403 | }; |
| 212 | 404 | ||
| 405 | /** | ||
| 406 | * struct fw_cdev_queue_iso - Queue isochronous packets for I/O | ||
| 407 | * @packets: Userspace pointer to packet data | ||
| 408 | * @data: Pointer into mmap()'ed payload buffer | ||
| 409 | * @size: Size of packet data in bytes | ||
| 410 | * @handle: Isochronous context handle | ||
| 411 | * | ||
| 412 | * Queue a number of isochronous packets for reception or transmission. | ||
| 413 | * This ioctl takes a pointer to an array of &fw_cdev_iso_packet structs, | ||
| 414 | * which describe how to transmit from or receive into a contiguous region | ||
| 415 | * of a mmap()'ed payload buffer. As part of the packet descriptors, | ||
| 416 | * a series of headers can be supplied, which will be prepended to the | ||
| 417 | * payload during DMA. | ||
| 418 | * | ||
| 419 | * The kernel may or may not queue all packets, but will write back updated | ||
| 420 | * values of the @packets, @data and @size fields, so the ioctl can be | ||
| 421 | * resubmitted easily. | ||
| 422 | */ | ||
| 213 | struct fw_cdev_queue_iso { | 423 | struct fw_cdev_queue_iso { |
| 214 | __u64 packets; | 424 | __u64 packets; |
| 215 | __u64 data; | 425 | __u64 data; |
| @@ -217,6 +427,23 @@ struct fw_cdev_queue_iso { | |||
| 217 | __u32 handle; | 427 | __u32 handle; |
| 218 | }; | 428 | }; |
| 219 | 429 | ||
| 430 | #define FW_CDEV_ISO_CONTEXT_MATCH_TAG0 1 | ||
| 431 | #define FW_CDEV_ISO_CONTEXT_MATCH_TAG1 2 | ||
| 432 | #define FW_CDEV_ISO_CONTEXT_MATCH_TAG2 4 | ||
| 433 | #define FW_CDEV_ISO_CONTEXT_MATCH_TAG3 8 | ||
| 434 | #define FW_CDEV_ISO_CONTEXT_MATCH_ALL_TAGS 15 | ||
| 435 | |||
| 436 | /** | ||
| 437 | * struct fw_cdev_start_iso - Start an isochronous transmission or reception | ||
| 438 | * @cycle: Cycle in which to start I/O. If @cycle is greater than or | ||
| 439 | * equal to 0, the I/O will start on that cycle. | ||
| 440 | * @sync: Determines the value to wait for for receive packets that have | ||
| 441 | * the %FW_CDEV_ISO_SYNC bit set | ||
| 442 | * @tags: Tag filter bit mask. Only valid for isochronous reception. | ||
| 443 | * Determines the tag values for which packets will be accepted. | ||
| 444 | * Use FW_CDEV_ISO_CONTEXT_MATCH_ macros to set @tags. | ||
| 445 | * @handle: Isochronous context handle within which to transmit or receive | ||
| 446 | */ | ||
| 220 | struct fw_cdev_start_iso { | 447 | struct fw_cdev_start_iso { |
| 221 | __s32 cycle; | 448 | __s32 cycle; |
| 222 | __u32 sync; | 449 | __u32 sync; |
| @@ -224,6 +451,10 @@ struct fw_cdev_start_iso { | |||
| 224 | __u32 handle; | 451 | __u32 handle; |
| 225 | }; | 452 | }; |
| 226 | 453 | ||
| 454 | /** | ||
| 455 | * struct fw_cdev_stop_iso - Stop an isochronous transmission or reception | ||
| 456 | * @handle: Handle of isochronous context to stop | ||
| 457 | */ | ||
| 227 | struct fw_cdev_stop_iso { | 458 | struct fw_cdev_stop_iso { |
| 228 | __u32 handle; | 459 | __u32 handle; |
| 229 | }; | 460 | }; |
diff --git a/include/linux/fs.h b/include/linux/fs.h index b3ae77cccbb6..4f0b3bf5983c 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -1054,7 +1054,7 @@ struct block_device_operations { | |||
| 1054 | }; | 1054 | }; |
| 1055 | 1055 | ||
| 1056 | /* | 1056 | /* |
| 1057 | * "descriptor" for what we're up to with a read for sendfile(). | 1057 | * "descriptor" for what we're up to with a read. |
| 1058 | * This allows us to use the same read code yet | 1058 | * This allows us to use the same read code yet |
| 1059 | * have multiple different users of the data that | 1059 | * have multiple different users of the data that |
| 1060 | * we read from a file. | 1060 | * we read from a file. |
| @@ -1105,7 +1105,6 @@ struct file_operations { | |||
| 1105 | int (*aio_fsync) (struct kiocb *, int datasync); | 1105 | int (*aio_fsync) (struct kiocb *, int datasync); |
| 1106 | int (*fasync) (int, struct file *, int); | 1106 | int (*fasync) (int, struct file *, int); |
| 1107 | int (*lock) (struct file *, int, struct file_lock *); | 1107 | int (*lock) (struct file *, int, struct file_lock *); |
| 1108 | ssize_t (*sendfile) (struct file *, loff_t *, size_t, read_actor_t, void *); | ||
| 1109 | ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int); | 1108 | ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int); |
| 1110 | unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); | 1109 | unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); |
| 1111 | int (*check_flags)(int); | 1110 | int (*check_flags)(int); |
| @@ -1211,6 +1210,14 @@ static inline void mark_inode_dirty_sync(struct inode *inode) | |||
| 1211 | __mark_inode_dirty(inode, I_DIRTY_SYNC); | 1210 | __mark_inode_dirty(inode, I_DIRTY_SYNC); |
| 1212 | } | 1211 | } |
| 1213 | 1212 | ||
| 1213 | /** | ||
| 1214 | * inc_nlink - directly increment an inode's link count | ||
| 1215 | * @inode: inode | ||
| 1216 | * | ||
| 1217 | * This is a low-level filesystem helper to replace any | ||
| 1218 | * direct filesystem manipulation of i_nlink. Currently, | ||
| 1219 | * it is only here for parity with dec_nlink(). | ||
| 1220 | */ | ||
| 1214 | static inline void inc_nlink(struct inode *inode) | 1221 | static inline void inc_nlink(struct inode *inode) |
| 1215 | { | 1222 | { |
| 1216 | inode->i_nlink++; | 1223 | inode->i_nlink++; |
| @@ -1222,11 +1229,30 @@ static inline void inode_inc_link_count(struct inode *inode) | |||
| 1222 | mark_inode_dirty(inode); | 1229 | mark_inode_dirty(inode); |
| 1223 | } | 1230 | } |
| 1224 | 1231 | ||
| 1232 | /** | ||
| 1233 | * drop_nlink - directly drop an inode's link count | ||
| 1234 | * @inode: inode | ||
| 1235 | * | ||
| 1236 | * This is a low-level filesystem helper to replace any | ||
| 1237 | * direct filesystem manipulation of i_nlink. In cases | ||
| 1238 | * where we are attempting to track writes to the | ||
| 1239 | * filesystem, a decrement to zero means an imminent | ||
| 1240 | * write when the file is truncated and actually unlinked | ||
| 1241 | * on the filesystem. | ||
| 1242 | */ | ||
| 1225 | static inline void drop_nlink(struct inode *inode) | 1243 | static inline void drop_nlink(struct inode *inode) |
| 1226 | { | 1244 | { |
| 1227 | inode->i_nlink--; | 1245 | inode->i_nlink--; |
| 1228 | } | 1246 | } |
| 1229 | 1247 | ||
| 1248 | /** | ||
| 1249 | * clear_nlink - directly zero an inode's link count | ||
| 1250 | * @inode: inode | ||
| 1251 | * | ||
| 1252 | * This is a low-level filesystem helper to replace any | ||
| 1253 | * direct filesystem manipulation of i_nlink. See | ||
| 1254 | * drop_nlink() for why we care about i_nlink hitting zero. | ||
| 1255 | */ | ||
| 1230 | static inline void clear_nlink(struct inode *inode) | 1256 | static inline void clear_nlink(struct inode *inode) |
| 1231 | { | 1257 | { |
| 1232 | inode->i_nlink = 0; | 1258 | inode->i_nlink = 0; |
| @@ -1735,7 +1761,6 @@ extern ssize_t generic_file_buffered_write(struct kiocb *, const struct iovec *, | |||
| 1735 | unsigned long, loff_t, loff_t *, size_t, ssize_t); | 1761 | unsigned long, loff_t, loff_t *, size_t, ssize_t); |
| 1736 | extern ssize_t do_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos); | 1762 | extern ssize_t do_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos); |
| 1737 | extern ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos); | 1763 | extern ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos); |
| 1738 | extern ssize_t generic_file_sendfile(struct file *, loff_t *, size_t, read_actor_t, void *); | ||
| 1739 | extern void do_generic_mapping_read(struct address_space *mapping, | 1764 | extern void do_generic_mapping_read(struct address_space *mapping, |
| 1740 | struct file_ra_state *, struct file *, | 1765 | struct file_ra_state *, struct file *, |
| 1741 | loff_t *, read_descriptor_t *, read_actor_t); | 1766 | loff_t *, read_descriptor_t *, read_actor_t); |
| @@ -1765,9 +1790,6 @@ extern int nonseekable_open(struct inode * inode, struct file * filp); | |||
| 1765 | #ifdef CONFIG_FS_XIP | 1790 | #ifdef CONFIG_FS_XIP |
| 1766 | extern ssize_t xip_file_read(struct file *filp, char __user *buf, size_t len, | 1791 | extern ssize_t xip_file_read(struct file *filp, char __user *buf, size_t len, |
| 1767 | loff_t *ppos); | 1792 | loff_t *ppos); |
| 1768 | extern ssize_t xip_file_sendfile(struct file *in_file, loff_t *ppos, | ||
| 1769 | size_t count, read_actor_t actor, | ||
| 1770 | void *target); | ||
| 1771 | extern int xip_file_mmap(struct file * file, struct vm_area_struct * vma); | 1793 | extern int xip_file_mmap(struct file * file, struct vm_area_struct * vma); |
| 1772 | extern ssize_t xip_file_write(struct file *filp, const char __user *buf, | 1794 | extern ssize_t xip_file_write(struct file *filp, const char __user *buf, |
| 1773 | size_t len, loff_t *ppos); | 1795 | size_t len, loff_t *ppos); |
diff --git a/include/linux/futex.h b/include/linux/futex.h index 899fc7f20edd..99650353adfa 100644 --- a/include/linux/futex.h +++ b/include/linux/futex.h | |||
| @@ -17,7 +17,6 @@ union ktime; | |||
| 17 | #define FUTEX_LOCK_PI 6 | 17 | #define FUTEX_LOCK_PI 6 |
| 18 | #define FUTEX_UNLOCK_PI 7 | 18 | #define FUTEX_UNLOCK_PI 7 |
| 19 | #define FUTEX_TRYLOCK_PI 8 | 19 | #define FUTEX_TRYLOCK_PI 8 |
| 20 | #define FUTEX_CMP_REQUEUE_PI 9 | ||
| 21 | 20 | ||
| 22 | #define FUTEX_PRIVATE_FLAG 128 | 21 | #define FUTEX_PRIVATE_FLAG 128 |
| 23 | #define FUTEX_CMD_MASK ~FUTEX_PRIVATE_FLAG | 22 | #define FUTEX_CMD_MASK ~FUTEX_PRIVATE_FLAG |
| @@ -98,14 +97,9 @@ struct robust_list_head { | |||
| 98 | #define FUTEX_OWNER_DIED 0x40000000 | 97 | #define FUTEX_OWNER_DIED 0x40000000 |
| 99 | 98 | ||
| 100 | /* | 99 | /* |
| 101 | * Some processes have been requeued on this PI-futex | ||
| 102 | */ | ||
| 103 | #define FUTEX_WAITER_REQUEUED 0x20000000 | ||
| 104 | |||
| 105 | /* | ||
| 106 | * The rest of the robust-futex field is for the TID: | 100 | * The rest of the robust-futex field is for the TID: |
| 107 | */ | 101 | */ |
| 108 | #define FUTEX_TID_MASK 0x0fffffff | 102 | #define FUTEX_TID_MASK 0x3fffffff |
| 109 | 103 | ||
| 110 | /* | 104 | /* |
| 111 | * This limit protects against a deliberately circular list. | 105 | * This limit protects against a deliberately circular list. |
| @@ -139,7 +133,6 @@ handle_futex_death(u32 __user *uaddr, struct task_struct *curr, int pi); | |||
| 139 | #define FUT_OFF_MMSHARED 2 /* We set bit 1 if key has a reference on mm */ | 133 | #define FUT_OFF_MMSHARED 2 /* We set bit 1 if key has a reference on mm */ |
| 140 | 134 | ||
| 141 | union futex_key { | 135 | union futex_key { |
| 142 | u32 __user *uaddr; | ||
| 143 | struct { | 136 | struct { |
| 144 | unsigned long pgoff; | 137 | unsigned long pgoff; |
| 145 | struct inode *inode; | 138 | struct inode *inode; |
diff --git a/include/linux/gfs2_ondisk.h b/include/linux/gfs2_ondisk.h index 8b7e4c1e32ae..a44a6a078f0a 100644 --- a/include/linux/gfs2_ondisk.h +++ b/include/linux/gfs2_ondisk.h | |||
| @@ -54,18 +54,6 @@ struct gfs2_inum { | |||
| 54 | __be64 no_addr; | 54 | __be64 no_addr; |
| 55 | }; | 55 | }; |
| 56 | 56 | ||
| 57 | struct gfs2_inum_host { | ||
| 58 | __u64 no_formal_ino; | ||
| 59 | __u64 no_addr; | ||
| 60 | }; | ||
| 61 | |||
| 62 | static inline int gfs2_inum_equal(const struct gfs2_inum_host *ino1, | ||
| 63 | const struct gfs2_inum_host *ino2) | ||
| 64 | { | ||
| 65 | return ino1->no_formal_ino == ino2->no_formal_ino && | ||
| 66 | ino1->no_addr == ino2->no_addr; | ||
| 67 | } | ||
| 68 | |||
| 69 | /* | 57 | /* |
| 70 | * Generic metadata head structure | 58 | * Generic metadata head structure |
| 71 | * Every inplace buffer logged in the journal must start with this. | 59 | * Every inplace buffer logged in the journal must start with this. |
| @@ -94,12 +82,6 @@ struct gfs2_meta_header { | |||
| 94 | __be32 __pad1; /* Was incarnation number in gfs1 */ | 82 | __be32 __pad1; /* Was incarnation number in gfs1 */ |
| 95 | }; | 83 | }; |
| 96 | 84 | ||
| 97 | struct gfs2_meta_header_host { | ||
| 98 | __u32 mh_magic; | ||
| 99 | __u32 mh_type; | ||
| 100 | __u32 mh_format; | ||
| 101 | }; | ||
| 102 | |||
| 103 | /* | 85 | /* |
| 104 | * super-block structure | 86 | * super-block structure |
| 105 | * | 87 | * |
| @@ -139,23 +121,6 @@ struct gfs2_sb { | |||
| 139 | /* In gfs1, quota and license dinodes followed */ | 121 | /* In gfs1, quota and license dinodes followed */ |
| 140 | }; | 122 | }; |
| 141 | 123 | ||
| 142 | struct gfs2_sb_host { | ||
| 143 | struct gfs2_meta_header_host sb_header; | ||
| 144 | |||
| 145 | __u32 sb_fs_format; | ||
| 146 | __u32 sb_multihost_format; | ||
| 147 | |||
| 148 | __u32 sb_bsize; | ||
| 149 | __u32 sb_bsize_shift; | ||
| 150 | |||
| 151 | struct gfs2_inum_host sb_master_dir; /* Was jindex dinode in gfs1 */ | ||
| 152 | struct gfs2_inum_host sb_root_dir; | ||
| 153 | |||
| 154 | char sb_lockproto[GFS2_LOCKNAME_LEN]; | ||
| 155 | char sb_locktable[GFS2_LOCKNAME_LEN]; | ||
| 156 | /* In gfs1, quota and license dinodes followed */ | ||
| 157 | }; | ||
| 158 | |||
| 159 | /* | 124 | /* |
| 160 | * resource index structure | 125 | * resource index structure |
| 161 | */ | 126 | */ |
| @@ -173,14 +138,6 @@ struct gfs2_rindex { | |||
| 173 | __u8 ri_reserved[64]; | 138 | __u8 ri_reserved[64]; |
| 174 | }; | 139 | }; |
| 175 | 140 | ||
| 176 | struct gfs2_rindex_host { | ||
| 177 | __u64 ri_addr; /* grp block disk address */ | ||
| 178 | __u64 ri_data0; /* first data location */ | ||
| 179 | __u32 ri_length; /* length of rgrp header in fs blocks */ | ||
| 180 | __u32 ri_data; /* num of data blocks in rgrp */ | ||
| 181 | __u32 ri_bitbytes; /* number of bytes in data bitmaps */ | ||
| 182 | }; | ||
| 183 | |||
| 184 | /* | 141 | /* |
| 185 | * resource group header structure | 142 | * resource group header structure |
| 186 | */ | 143 | */ |
| @@ -212,13 +169,6 @@ struct gfs2_rgrp { | |||
| 212 | __u8 rg_reserved[80]; /* Several fields from gfs1 now reserved */ | 169 | __u8 rg_reserved[80]; /* Several fields from gfs1 now reserved */ |
| 213 | }; | 170 | }; |
| 214 | 171 | ||
| 215 | struct gfs2_rgrp_host { | ||
| 216 | __u32 rg_flags; | ||
| 217 | __u32 rg_free; | ||
| 218 | __u32 rg_dinodes; | ||
| 219 | __u64 rg_igeneration; | ||
| 220 | }; | ||
| 221 | |||
| 222 | /* | 172 | /* |
| 223 | * quota structure | 173 | * quota structure |
| 224 | */ | 174 | */ |
| @@ -230,12 +180,6 @@ struct gfs2_quota { | |||
| 230 | __u8 qu_reserved[64]; | 180 | __u8 qu_reserved[64]; |
| 231 | }; | 181 | }; |
| 232 | 182 | ||
| 233 | struct gfs2_quota_host { | ||
| 234 | __u64 qu_limit; | ||
| 235 | __u64 qu_warn; | ||
| 236 | __u64 qu_value; | ||
| 237 | }; | ||
| 238 | |||
| 239 | /* | 183 | /* |
| 240 | * dinode structure | 184 | * dinode structure |
| 241 | */ | 185 | */ |
| @@ -315,29 +259,11 @@ struct gfs2_dinode { | |||
| 315 | struct gfs2_inum __pad4; /* Unused even in current gfs1 */ | 259 | struct gfs2_inum __pad4; /* Unused even in current gfs1 */ |
| 316 | 260 | ||
| 317 | __be64 di_eattr; /* extended attribute block number */ | 261 | __be64 di_eattr; /* extended attribute block number */ |
| 262 | __be32 di_atime_nsec; /* nsec portion of atime */ | ||
| 263 | __be32 di_mtime_nsec; /* nsec portion of mtime */ | ||
| 264 | __be32 di_ctime_nsec; /* nsec portion of ctime */ | ||
| 318 | 265 | ||
| 319 | __u8 di_reserved[56]; | 266 | __u8 di_reserved[44]; |
| 320 | }; | ||
| 321 | |||
| 322 | struct gfs2_dinode_host { | ||
| 323 | __u64 di_size; /* number of bytes in file */ | ||
| 324 | __u64 di_blocks; /* number of blocks in file */ | ||
| 325 | |||
| 326 | /* This section varies from gfs1. Padding added to align with | ||
| 327 | * remainder of dinode | ||
| 328 | */ | ||
| 329 | __u64 di_goal_meta; /* rgrp to alloc from next */ | ||
| 330 | __u64 di_goal_data; /* data block goal */ | ||
| 331 | __u64 di_generation; /* generation number for NFS */ | ||
| 332 | |||
| 333 | __u32 di_flags; /* GFS2_DIF_... */ | ||
| 334 | __u16 di_height; /* height of metadata */ | ||
| 335 | |||
| 336 | /* These only apply to directories */ | ||
| 337 | __u16 di_depth; /* Number of bits in the table */ | ||
| 338 | __u32 di_entries; /* The number of entries in the directory */ | ||
| 339 | |||
| 340 | __u64 di_eattr; /* extended attribute block number */ | ||
| 341 | }; | 267 | }; |
| 342 | 268 | ||
| 343 | /* | 269 | /* |
| @@ -414,16 +340,6 @@ struct gfs2_log_header { | |||
| 414 | __be32 lh_hash; | 340 | __be32 lh_hash; |
| 415 | }; | 341 | }; |
| 416 | 342 | ||
| 417 | struct gfs2_log_header_host { | ||
| 418 | struct gfs2_meta_header_host lh_header; | ||
| 419 | |||
| 420 | __u64 lh_sequence; /* Sequence number of this transaction */ | ||
| 421 | __u32 lh_flags; /* GFS2_LOG_HEAD_... */ | ||
| 422 | __u32 lh_tail; /* Block number of log tail */ | ||
| 423 | __u32 lh_blkno; | ||
| 424 | __u32 lh_hash; | ||
| 425 | }; | ||
| 426 | |||
| 427 | /* | 343 | /* |
| 428 | * Log type descriptor | 344 | * Log type descriptor |
| 429 | */ | 345 | */ |
| @@ -464,11 +380,6 @@ struct gfs2_inum_range { | |||
| 464 | __be64 ir_length; | 380 | __be64 ir_length; |
| 465 | }; | 381 | }; |
| 466 | 382 | ||
| 467 | struct gfs2_inum_range_host { | ||
| 468 | __u64 ir_start; | ||
| 469 | __u64 ir_length; | ||
| 470 | }; | ||
| 471 | |||
| 472 | /* | 383 | /* |
| 473 | * Statfs change | 384 | * Statfs change |
| 474 | * Describes an change to the pool of free and allocated | 385 | * Describes an change to the pool of free and allocated |
| @@ -481,12 +392,6 @@ struct gfs2_statfs_change { | |||
| 481 | __be64 sc_dinodes; | 392 | __be64 sc_dinodes; |
| 482 | }; | 393 | }; |
| 483 | 394 | ||
| 484 | struct gfs2_statfs_change_host { | ||
| 485 | __u64 sc_total; | ||
| 486 | __u64 sc_free; | ||
| 487 | __u64 sc_dinodes; | ||
| 488 | }; | ||
| 489 | |||
| 490 | /* | 395 | /* |
| 491 | * Quota change | 396 | * Quota change |
| 492 | * Describes an allocation change for a particular | 397 | * Describes an allocation change for a particular |
| @@ -501,39 +406,12 @@ struct gfs2_quota_change { | |||
| 501 | __be32 qc_id; | 406 | __be32 qc_id; |
| 502 | }; | 407 | }; |
| 503 | 408 | ||
| 504 | struct gfs2_quota_change_host { | 409 | struct gfs2_quota_lvb { |
| 505 | __u64 qc_change; | 410 | __be32 qb_magic; |
| 506 | __u32 qc_flags; /* GFS2_QCF_... */ | 411 | __u32 __pad; |
| 507 | __u32 qc_id; | 412 | __be64 qb_limit; /* Hard limit of # blocks to alloc */ |
| 413 | __be64 qb_warn; /* Warn user when alloc is above this # */ | ||
| 414 | __be64 qb_value; /* Current # blocks allocated */ | ||
| 508 | }; | 415 | }; |
| 509 | 416 | ||
| 510 | #ifdef __KERNEL__ | ||
| 511 | /* Translation functions */ | ||
| 512 | |||
| 513 | extern void gfs2_inum_in(struct gfs2_inum_host *no, const void *buf); | ||
| 514 | extern void gfs2_inum_out(const struct gfs2_inum_host *no, void *buf); | ||
| 515 | extern void gfs2_sb_in(struct gfs2_sb_host *sb, const void *buf); | ||
| 516 | extern void gfs2_rindex_in(struct gfs2_rindex_host *ri, const void *buf); | ||
| 517 | extern void gfs2_rindex_out(const struct gfs2_rindex_host *ri, void *buf); | ||
| 518 | extern void gfs2_rgrp_in(struct gfs2_rgrp_host *rg, const void *buf); | ||
| 519 | extern void gfs2_rgrp_out(const struct gfs2_rgrp_host *rg, void *buf); | ||
| 520 | extern void gfs2_quota_in(struct gfs2_quota_host *qu, const void *buf); | ||
| 521 | struct gfs2_inode; | ||
| 522 | extern void gfs2_dinode_out(const struct gfs2_inode *ip, void *buf); | ||
| 523 | extern void gfs2_ea_header_in(struct gfs2_ea_header *ea, const void *buf); | ||
| 524 | extern void gfs2_ea_header_out(const struct gfs2_ea_header *ea, void *buf); | ||
| 525 | extern void gfs2_log_header_in(struct gfs2_log_header_host *lh, const void *buf); | ||
| 526 | extern void gfs2_inum_range_in(struct gfs2_inum_range_host *ir, const void *buf); | ||
| 527 | extern void gfs2_inum_range_out(const struct gfs2_inum_range_host *ir, void *buf); | ||
| 528 | extern void gfs2_statfs_change_in(struct gfs2_statfs_change_host *sc, const void *buf); | ||
| 529 | extern void gfs2_statfs_change_out(const struct gfs2_statfs_change_host *sc, void *buf); | ||
| 530 | extern void gfs2_quota_change_in(struct gfs2_quota_change_host *qc, const void *buf); | ||
| 531 | |||
| 532 | /* Printing functions */ | ||
| 533 | |||
| 534 | extern void gfs2_rindex_print(const struct gfs2_rindex_host *ri); | ||
| 535 | extern void gfs2_dinode_print(const struct gfs2_inode *ip); | ||
| 536 | |||
| 537 | #endif /* __KERNEL__ */ | ||
| 538 | |||
| 539 | #endif /* __GFS2_ONDISK_DOT_H__ */ | 417 | #endif /* __GFS2_ONDISK_DOT_H__ */ |
diff --git a/include/linux/gpio_mouse.h b/include/linux/gpio_mouse.h new file mode 100644 index 000000000000..44ed7aa14d85 --- /dev/null +++ b/include/linux/gpio_mouse.h | |||
| @@ -0,0 +1,61 @@ | |||
| 1 | /* | ||
| 2 | * Driver for simulating a mouse on GPIO lines. | ||
| 3 | * | ||
| 4 | * Copyright (C) 2007 Atmel Corporation | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2 as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | */ | ||
| 10 | |||
| 11 | #ifndef _GPIO_MOUSE_H | ||
| 12 | #define _GPIO_MOUSE_H | ||
| 13 | |||
| 14 | #define GPIO_MOUSE_POLARITY_ACT_HIGH 0x00 | ||
| 15 | #define GPIO_MOUSE_POLARITY_ACT_LOW 0x01 | ||
| 16 | |||
| 17 | #define GPIO_MOUSE_PIN_UP 0 | ||
| 18 | #define GPIO_MOUSE_PIN_DOWN 1 | ||
| 19 | #define GPIO_MOUSE_PIN_LEFT 2 | ||
| 20 | #define GPIO_MOUSE_PIN_RIGHT 3 | ||
| 21 | #define GPIO_MOUSE_PIN_BLEFT 4 | ||
| 22 | #define GPIO_MOUSE_PIN_BMIDDLE 5 | ||
| 23 | #define GPIO_MOUSE_PIN_BRIGHT 6 | ||
| 24 | #define GPIO_MOUSE_PIN_MAX 7 | ||
| 25 | |||
| 26 | /** | ||
| 27 | * struct gpio_mouse_platform_data | ||
| 28 | * @scan_ms: integer in ms specifying the scan periode. | ||
| 29 | * @polarity: Pin polarity, active high or low. | ||
| 30 | * @up: GPIO line for up value. | ||
| 31 | * @down: GPIO line for down value. | ||
| 32 | * @left: GPIO line for left value. | ||
| 33 | * @right: GPIO line for right value. | ||
| 34 | * @bleft: GPIO line for left button. | ||
| 35 | * @bmiddle: GPIO line for middle button. | ||
| 36 | * @bright: GPIO line for right button. | ||
| 37 | * | ||
| 38 | * This struct must be added to the platform_device in the board code. | ||
| 39 | * It is used by the gpio_mouse driver to setup GPIO lines and to | ||
| 40 | * calculate mouse movement. | ||
| 41 | */ | ||
| 42 | struct gpio_mouse_platform_data { | ||
| 43 | int scan_ms; | ||
| 44 | int polarity; | ||
| 45 | |||
| 46 | union { | ||
| 47 | struct { | ||
| 48 | int up; | ||
| 49 | int down; | ||
| 50 | int left; | ||
| 51 | int right; | ||
| 52 | |||
| 53 | int bleft; | ||
| 54 | int bmiddle; | ||
| 55 | int bright; | ||
| 56 | }; | ||
| 57 | int pins[GPIO_MOUSE_PIN_MAX]; | ||
| 58 | }; | ||
| 59 | }; | ||
| 60 | |||
| 61 | #endif /* _GPIO_MOUSE_H */ | ||
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index 7803014f3a11..8d302298a161 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h | |||
| @@ -79,6 +79,19 @@ | |||
| 79 | #endif | 79 | #endif |
| 80 | 80 | ||
| 81 | #ifdef CONFIG_PREEMPT | 81 | #ifdef CONFIG_PREEMPT |
| 82 | # define PREEMPT_CHECK_OFFSET 1 | ||
| 83 | #else | ||
| 84 | # define PREEMPT_CHECK_OFFSET 0 | ||
| 85 | #endif | ||
| 86 | |||
| 87 | /* | ||
| 88 | * Check whether we were atomic before we did preempt_disable(): | ||
| 89 | * (used by the scheduler) | ||
| 90 | */ | ||
| 91 | #define in_atomic_preempt_off() \ | ||
| 92 | ((preempt_count() & ~PREEMPT_ACTIVE) != PREEMPT_CHECK_OFFSET) | ||
| 93 | |||
| 94 | #ifdef CONFIG_PREEMPT | ||
| 82 | # define preemptible() (preempt_count() == 0 && !irqs_disabled()) | 95 | # define preemptible() (preempt_count() == 0 && !irqs_disabled()) |
| 83 | # define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1) | 96 | # define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1) |
| 84 | #else | 97 | #else |
diff --git a/include/linux/hid.h b/include/linux/hid.h index 827ee748fd4c..898103b401f1 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h | |||
| @@ -263,19 +263,28 @@ struct hid_item { | |||
| 263 | #define HID_QUIRK_2WHEEL_MOUSE_HACK_5 0x00000100 | 263 | #define HID_QUIRK_2WHEEL_MOUSE_HACK_5 0x00000100 |
| 264 | #define HID_QUIRK_2WHEEL_MOUSE_HACK_ON 0x00000200 | 264 | #define HID_QUIRK_2WHEEL_MOUSE_HACK_ON 0x00000200 |
| 265 | #define HID_QUIRK_MIGHTYMOUSE 0x00000400 | 265 | #define HID_QUIRK_MIGHTYMOUSE 0x00000400 |
| 266 | #define HID_QUIRK_CYMOTION 0x00000800 | 266 | #define HID_QUIRK_POWERBOOK_HAS_FN 0x00000800 |
| 267 | #define HID_QUIRK_POWERBOOK_HAS_FN 0x00001000 | 267 | #define HID_QUIRK_POWERBOOK_FN_ON 0x00001000 |
| 268 | #define HID_QUIRK_POWERBOOK_FN_ON 0x00002000 | 268 | #define HID_QUIRK_INVERT_HWHEEL 0x00002000 |
| 269 | #define HID_QUIRK_INVERT_HWHEEL 0x00004000 | 269 | #define HID_QUIRK_POWERBOOK_ISO_KEYBOARD 0x00004000 |
| 270 | #define HID_QUIRK_POWERBOOK_ISO_KEYBOARD 0x00008000 | 270 | #define HID_QUIRK_BAD_RELATIVE_KEYS 0x00008000 |
| 271 | #define HID_QUIRK_BAD_RELATIVE_KEYS 0x00010000 | 271 | #define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00010000 |
| 272 | #define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00020000 | 272 | #define HID_QUIRK_IGNORE_MOUSE 0x00020000 |
| 273 | #define HID_QUIRK_IGNORE_MOUSE 0x00040000 | 273 | #define HID_QUIRK_SONY_PS3_CONTROLLER 0x00040000 |
| 274 | #define HID_QUIRK_SONY_PS3_CONTROLLER 0x00080000 | 274 | #define HID_QUIRK_DUPLICATE_USAGES 0x00080000 |
| 275 | #define HID_QUIRK_LOGITECH_DESCRIPTOR 0x00100000 | 275 | #define HID_QUIRK_RESET_LEDS 0x00100000 |
| 276 | #define HID_QUIRK_DUPLICATE_USAGES 0x00200000 | 276 | #define HID_QUIRK_HIDINPUT 0x00200000 |
| 277 | #define HID_QUIRK_RESET_LEDS 0x00400000 | 277 | #define HID_QUIRK_LOGITECH_IGNORE_DOUBLED_WHEEL 0x00400000 |
| 278 | #define HID_QUIRK_SWAPPED_MIN_MAX 0x00800000 | 278 | #define HID_QUIRK_LOGITECH_EXPANDED_KEYMAP 0x00800000 |
| 279 | |||
| 280 | /* | ||
| 281 | * Separate quirks for runtime report descriptor fixup | ||
| 282 | */ | ||
| 283 | |||
| 284 | #define HID_QUIRK_RDESC_CYMOTION 0x00000001 | ||
| 285 | #define HID_QUIRK_RDESC_LOGITECH 0x00000002 | ||
| 286 | #define HID_QUIRK_RDESC_SWAPPED_MIN_MAX 0x00000004 | ||
| 287 | #define HID_QUIRK_RDESC_PETALYNX 0x00000008 | ||
| 279 | 288 | ||
| 280 | /* | 289 | /* |
| 281 | * This is the global environment of the parser. This information is | 290 | * This is the global environment of the parser. This information is |
| @@ -488,6 +497,11 @@ struct hid_descriptor { | |||
| 488 | #define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || (a == 0x000c0001)) | 497 | #define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || (a == 0x000c0001)) |
| 489 | 498 | ||
| 490 | /* HID core API */ | 499 | /* HID core API */ |
| 500 | |||
| 501 | #ifdef CONFIG_HID_DEBUG | ||
| 502 | extern int hid_debug; | ||
| 503 | #endif | ||
| 504 | |||
| 491 | extern void hidinput_hid_event(struct hid_device *, struct hid_field *, struct hid_usage *, __s32); | 505 | extern void hidinput_hid_event(struct hid_device *, struct hid_field *, struct hid_usage *, __s32); |
| 492 | extern void hidinput_report_event(struct hid_device *hid, struct hid_report *report); | 506 | extern void hidinput_report_event(struct hid_device *hid, struct hid_report *report); |
| 493 | extern int hidinput_connect(struct hid_device *); | 507 | extern int hidinput_connect(struct hid_device *); |
| @@ -506,6 +520,7 @@ u32 usbhid_lookup_quirk(const u16 idVendor, const u16 idProduct); | |||
| 506 | int usbhid_modify_dquirk(const u16 idVendor, const u16 idProduct, const u32 quirks); | 520 | int usbhid_modify_dquirk(const u16 idVendor, const u16 idProduct, const u32 quirks); |
| 507 | int usbhid_quirks_init(char **quirks_param); | 521 | int usbhid_quirks_init(char **quirks_param); |
| 508 | void usbhid_quirks_exit(void); | 522 | void usbhid_quirks_exit(void); |
| 523 | void usbhid_fixup_report_descriptor(const u16, const u16, char *, unsigned, char **); | ||
| 509 | 524 | ||
| 510 | #ifdef CONFIG_HID_FF | 525 | #ifdef CONFIG_HID_FF |
| 511 | int hid_ff_init(struct hid_device *hid); | 526 | int hid_ff_init(struct hid_device *hid); |
| @@ -523,14 +538,19 @@ static inline int hid_pidff_init(struct hid_device *hid) { return -ENODEV; } | |||
| 523 | #else | 538 | #else |
| 524 | static inline int hid_ff_init(struct hid_device *hid) { return -1; } | 539 | static inline int hid_ff_init(struct hid_device *hid) { return -1; } |
| 525 | #endif | 540 | #endif |
| 526 | #ifdef DEBUG | 541 | |
| 527 | #define dbg(format, arg...) printk(KERN_DEBUG "%s: " format "\n" , \ | 542 | #ifdef CONFIG_HID_DEBUG |
| 528 | __FILE__ , ## arg) | 543 | #define dbg_hid(format, arg...) if (hid_debug) \ |
| 544 | printk(KERN_DEBUG "%s: " format ,\ | ||
| 545 | __FILE__ , ## arg) | ||
| 546 | #define dbg_hid_line(format, arg...) if (hid_debug) \ | ||
| 547 | printk(format, ## arg) | ||
| 529 | #else | 548 | #else |
| 530 | #define dbg(format, arg...) do {} while (0) | 549 | #define dbg_hid(format, arg...) do {} while (0) |
| 550 | #define dbg_hid_line dbg_hid | ||
| 531 | #endif | 551 | #endif |
| 532 | 552 | ||
| 533 | #define err(format, arg...) printk(KERN_ERR "%s: " format "\n" , \ | 553 | #define err_hid(format, arg...) printk(KERN_ERR "%s: " format "\n" , \ |
| 534 | __FILE__ , ## arg) | 554 | __FILE__ , ## arg) |
| 535 | #endif | 555 | #endif |
| 536 | 556 | ||
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index b4570b62ab85..2c13715e9dde 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
| @@ -163,7 +163,7 @@ static inline struct hugetlbfs_sb_info *HUGETLBFS_SB(struct super_block *sb) | |||
| 163 | 163 | ||
| 164 | extern const struct file_operations hugetlbfs_file_operations; | 164 | extern const struct file_operations hugetlbfs_file_operations; |
| 165 | extern struct vm_operations_struct hugetlb_vm_ops; | 165 | extern struct vm_operations_struct hugetlb_vm_ops; |
| 166 | struct file *hugetlb_zero_setup(size_t); | 166 | struct file *hugetlb_file_setup(const char *name, size_t); |
| 167 | int hugetlb_get_quota(struct address_space *mapping); | 167 | int hugetlb_get_quota(struct address_space *mapping); |
| 168 | void hugetlb_put_quota(struct address_space *mapping); | 168 | void hugetlb_put_quota(struct address_space *mapping); |
| 169 | 169 | ||
| @@ -185,7 +185,7 @@ static inline void set_file_hugepages(struct file *file) | |||
| 185 | 185 | ||
| 186 | #define is_file_hugepages(file) 0 | 186 | #define is_file_hugepages(file) 0 |
| 187 | #define set_file_hugepages(file) BUG() | 187 | #define set_file_hugepages(file) BUG() |
| 188 | #define hugetlb_zero_setup(size) ERR_PTR(-ENOSYS) | 188 | #define hugetlb_file_setup(name,size) ERR_PTR(-ENOSYS) |
| 189 | 189 | ||
| 190 | #endif /* !CONFIG_HUGETLBFS */ | 190 | #endif /* !CONFIG_HUGETLBFS */ |
| 191 | 191 | ||
diff --git a/include/linux/ide.h b/include/linux/ide.h index 1e365acdd369..19ab25804056 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | #include <asm/system.h> | 25 | #include <asm/system.h> |
| 26 | #include <asm/io.h> | 26 | #include <asm/io.h> |
| 27 | #include <asm/semaphore.h> | 27 | #include <asm/semaphore.h> |
| 28 | #include <asm/mutex.h> | ||
| 28 | 29 | ||
| 29 | /****************************************************************************** | 30 | /****************************************************************************** |
| 30 | * IDE driver configuration options (play with these as desired): | 31 | * IDE driver configuration options (play with these as desired): |
| @@ -685,6 +686,8 @@ typedef struct hwif_s { | |||
| 685 | u8 mwdma_mask; | 686 | u8 mwdma_mask; |
| 686 | u8 swdma_mask; | 687 | u8 swdma_mask; |
| 687 | 688 | ||
| 689 | u8 cbl; /* cable type */ | ||
| 690 | |||
| 688 | hwif_chipset_t chipset; /* sub-module for tuning.. */ | 691 | hwif_chipset_t chipset; /* sub-module for tuning.. */ |
| 689 | 692 | ||
| 690 | struct pci_dev *pci_dev; /* for pci chipsets */ | 693 | struct pci_dev *pci_dev; /* for pci chipsets */ |
| @@ -735,8 +738,8 @@ typedef struct hwif_s { | |||
| 735 | void (*ide_dma_clear_irq)(ide_drive_t *drive); | 738 | void (*ide_dma_clear_irq)(ide_drive_t *drive); |
| 736 | void (*dma_host_on)(ide_drive_t *drive); | 739 | void (*dma_host_on)(ide_drive_t *drive); |
| 737 | void (*dma_host_off)(ide_drive_t *drive); | 740 | void (*dma_host_off)(ide_drive_t *drive); |
| 738 | int (*ide_dma_lostirq)(ide_drive_t *drive); | 741 | void (*dma_lost_irq)(ide_drive_t *drive); |
| 739 | int (*ide_dma_timeout)(ide_drive_t *drive); | 742 | void (*dma_timeout)(ide_drive_t *drive); |
| 740 | 743 | ||
| 741 | void (*OUTB)(u8 addr, unsigned long port); | 744 | void (*OUTB)(u8 addr, unsigned long port); |
| 742 | void (*OUTBSYNC)(ide_drive_t *drive, u8 addr, unsigned long port); | 745 | void (*OUTBSYNC)(ide_drive_t *drive, u8 addr, unsigned long port); |
| @@ -791,7 +794,6 @@ typedef struct hwif_s { | |||
| 791 | unsigned sharing_irq: 1; /* 1 = sharing irq with another hwif */ | 794 | unsigned sharing_irq: 1; /* 1 = sharing irq with another hwif */ |
| 792 | unsigned reset : 1; /* reset after probe */ | 795 | unsigned reset : 1; /* reset after probe */ |
| 793 | unsigned autodma : 1; /* auto-attempt using DMA at boot */ | 796 | unsigned autodma : 1; /* auto-attempt using DMA at boot */ |
| 794 | unsigned udma_four : 1; /* 1=ATA-66 capable, 0=default */ | ||
| 795 | unsigned no_lba48 : 1; /* 1 = cannot do LBA48 */ | 797 | unsigned no_lba48 : 1; /* 1 = cannot do LBA48 */ |
| 796 | unsigned no_lba48_dma : 1; /* 1 = cannot do LBA48 DMA */ | 798 | unsigned no_lba48_dma : 1; /* 1 = cannot do LBA48 DMA */ |
| 797 | unsigned auto_poll : 1; /* supports nop auto-poll */ | 799 | unsigned auto_poll : 1; /* supports nop auto-poll */ |
| @@ -863,7 +865,7 @@ typedef struct hwgroup_s { | |||
| 863 | 865 | ||
| 864 | typedef struct ide_driver_s ide_driver_t; | 866 | typedef struct ide_driver_s ide_driver_t; |
| 865 | 867 | ||
| 866 | extern struct semaphore ide_setting_sem; | 868 | extern struct mutex ide_setting_mtx; |
| 867 | 869 | ||
| 868 | int set_io_32bit(ide_drive_t *, int); | 870 | int set_io_32bit(ide_drive_t *, int); |
| 869 | int set_pio_mode(ide_drive_t *, int); | 871 | int set_pio_mode(ide_drive_t *, int); |
| @@ -1304,8 +1306,8 @@ extern int __ide_dma_check(ide_drive_t *); | |||
| 1304 | extern int ide_dma_setup(ide_drive_t *); | 1306 | extern int ide_dma_setup(ide_drive_t *); |
| 1305 | extern void ide_dma_start(ide_drive_t *); | 1307 | extern void ide_dma_start(ide_drive_t *); |
| 1306 | extern int __ide_dma_end(ide_drive_t *); | 1308 | extern int __ide_dma_end(ide_drive_t *); |
| 1307 | extern int __ide_dma_lostirq(ide_drive_t *); | 1309 | extern void ide_dma_lost_irq(ide_drive_t *); |
| 1308 | extern int __ide_dma_timeout(ide_drive_t *); | 1310 | extern void ide_dma_timeout(ide_drive_t *); |
| 1309 | #endif /* CONFIG_BLK_DEV_IDEDMA_PCI */ | 1311 | #endif /* CONFIG_BLK_DEV_IDEDMA_PCI */ |
| 1310 | 1312 | ||
| 1311 | #else | 1313 | #else |
| @@ -1382,11 +1384,11 @@ extern const ide_pio_timings_t ide_pio_timings[6]; | |||
| 1382 | 1384 | ||
| 1383 | 1385 | ||
| 1384 | extern spinlock_t ide_lock; | 1386 | extern spinlock_t ide_lock; |
| 1385 | extern struct semaphore ide_cfg_sem; | 1387 | extern struct mutex ide_cfg_mtx; |
| 1386 | /* | 1388 | /* |
| 1387 | * Structure locking: | 1389 | * Structure locking: |
| 1388 | * | 1390 | * |
| 1389 | * ide_cfg_sem and ide_lock together protect changes to | 1391 | * ide_cfg_mtx and ide_lock together protect changes to |
| 1390 | * ide_hwif_t->{next,hwgroup} | 1392 | * ide_hwif_t->{next,hwgroup} |
| 1391 | * ide_drive_t->next | 1393 | * ide_drive_t->next |
| 1392 | * | 1394 | * |
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h index ae04901aa09a..d83fee2dc643 100644 --- a/include/linux/inetdevice.h +++ b/include/linux/inetdevice.h | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | #include <linux/netdevice.h> | 8 | #include <linux/netdevice.h> |
| 9 | #include <linux/rcupdate.h> | 9 | #include <linux/rcupdate.h> |
| 10 | #include <linux/timer.h> | 10 | #include <linux/timer.h> |
| 11 | #include <linux/sysctl.h> | ||
| 11 | 12 | ||
| 12 | struct ipv4_devconf | 13 | struct ipv4_devconf |
| 13 | { | 14 | { |
diff --git a/include/linux/input.h b/include/linux/input.h index be2bf3a2b031..18c98b543030 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
| @@ -108,6 +108,13 @@ struct input_absinfo { | |||
| 108 | 108 | ||
| 109 | /* | 109 | /* |
| 110 | * Keys and buttons | 110 | * Keys and buttons |
| 111 | * | ||
| 112 | * Most of the keys/buttons are modeled after USB HUT 1.12 | ||
| 113 | * (see http://www.usb.org/developers/hidpage). | ||
| 114 | * Abbreviations in the comments: | ||
| 115 | * AC - Application Control | ||
| 116 | * AL - Application Launch Button | ||
| 117 | * SC - System Control | ||
| 111 | */ | 118 | */ |
| 112 | 119 | ||
| 113 | #define KEY_RESERVED 0 | 120 | #define KEY_RESERVED 0 |
| @@ -226,7 +233,7 @@ struct input_absinfo { | |||
| 226 | #define KEY_MUTE 113 | 233 | #define KEY_MUTE 113 |
| 227 | #define KEY_VOLUMEDOWN 114 | 234 | #define KEY_VOLUMEDOWN 114 |
| 228 | #define KEY_VOLUMEUP 115 | 235 | #define KEY_VOLUMEUP 115 |
| 229 | #define KEY_POWER 116 | 236 | #define KEY_POWER 116 /* SC System Power Down */ |
| 230 | #define KEY_KPEQUAL 117 | 237 | #define KEY_KPEQUAL 117 |
| 231 | #define KEY_KPPLUSMINUS 118 | 238 | #define KEY_KPPLUSMINUS 118 |
| 232 | #define KEY_PAUSE 119 | 239 | #define KEY_PAUSE 119 |
| @@ -240,38 +247,39 @@ struct input_absinfo { | |||
| 240 | #define KEY_RIGHTMETA 126 | 247 | #define KEY_RIGHTMETA 126 |
| 241 | #define KEY_COMPOSE 127 | 248 | #define KEY_COMPOSE 127 |
| 242 | 249 | ||
| 243 | #define KEY_STOP 128 | 250 | #define KEY_STOP 128 /* AC Stop */ |
| 244 | #define KEY_AGAIN 129 | 251 | #define KEY_AGAIN 129 |
| 245 | #define KEY_PROPS 130 | 252 | #define KEY_PROPS 130 /* AC Properties */ |
| 246 | #define KEY_UNDO 131 | 253 | #define KEY_UNDO 131 /* AC Undo */ |
| 247 | #define KEY_FRONT 132 | 254 | #define KEY_FRONT 132 |
| 248 | #define KEY_COPY 133 | 255 | #define KEY_COPY 133 /* AC Copy */ |
| 249 | #define KEY_OPEN 134 | 256 | #define KEY_OPEN 134 /* AC Open */ |
| 250 | #define KEY_PASTE 135 | 257 | #define KEY_PASTE 135 /* AC Paste */ |
| 251 | #define KEY_FIND 136 | 258 | #define KEY_FIND 136 /* AC Search */ |
| 252 | #define KEY_CUT 137 | 259 | #define KEY_CUT 137 /* AC Cut */ |
| 253 | #define KEY_HELP 138 | 260 | #define KEY_HELP 138 /* AL Integrated Help Center */ |
| 254 | #define KEY_MENU 139 | 261 | #define KEY_MENU 139 /* Menu (show menu) */ |
| 255 | #define KEY_CALC 140 | 262 | #define KEY_CALC 140 /* AL Calculator */ |
| 256 | #define KEY_SETUP 141 | 263 | #define KEY_SETUP 141 |
| 257 | #define KEY_SLEEP 142 | 264 | #define KEY_SLEEP 142 /* SC System Sleep */ |
| 258 | #define KEY_WAKEUP 143 | 265 | #define KEY_WAKEUP 143 /* System Wake Up */ |
| 259 | #define KEY_FILE 144 | 266 | #define KEY_FILE 144 /* AL Local Machine Browser */ |
| 260 | #define KEY_SENDFILE 145 | 267 | #define KEY_SENDFILE 145 |
| 261 | #define KEY_DELETEFILE 146 | 268 | #define KEY_DELETEFILE 146 |
| 262 | #define KEY_XFER 147 | 269 | #define KEY_XFER 147 |
| 263 | #define KEY_PROG1 148 | 270 | #define KEY_PROG1 148 |
| 264 | #define KEY_PROG2 149 | 271 | #define KEY_PROG2 149 |
| 265 | #define KEY_WWW 150 | 272 | #define KEY_WWW 150 /* AL Internet Browser */ |
| 266 | #define KEY_MSDOS 151 | 273 | #define KEY_MSDOS 151 |
| 267 | #define KEY_COFFEE 152 | 274 | #define KEY_COFFEE 152 /* AL Terminal Lock/Screensaver */ |
| 275 | #define KEY_SCREENLOCK KEY_COFFEE | ||
| 268 | #define KEY_DIRECTION 153 | 276 | #define KEY_DIRECTION 153 |
| 269 | #define KEY_CYCLEWINDOWS 154 | 277 | #define KEY_CYCLEWINDOWS 154 |
| 270 | #define KEY_MAIL 155 | 278 | #define KEY_MAIL 155 |
| 271 | #define KEY_BOOKMARKS 156 | 279 | #define KEY_BOOKMARKS 156 /* AC Bookmarks */ |
| 272 | #define KEY_COMPUTER 157 | 280 | #define KEY_COMPUTER 157 |
| 273 | #define KEY_BACK 158 | 281 | #define KEY_BACK 158 /* AC Back */ |
| 274 | #define KEY_FORWARD 159 | 282 | #define KEY_FORWARD 159 /* AC Forward */ |
| 275 | #define KEY_CLOSECD 160 | 283 | #define KEY_CLOSECD 160 |
| 276 | #define KEY_EJECTCD 161 | 284 | #define KEY_EJECTCD 161 |
| 277 | #define KEY_EJECTCLOSECD 162 | 285 | #define KEY_EJECTCLOSECD 162 |
| @@ -281,20 +289,20 @@ struct input_absinfo { | |||
| 281 | #define KEY_STOPCD 166 | 289 | #define KEY_STOPCD 166 |
| 282 | #define KEY_RECORD 167 | 290 | #define KEY_RECORD 167 |
| 283 | #define KEY_REWIND 168 | 291 | #define KEY_REWIND 168 |
| 284 | #define KEY_PHONE 169 | 292 | #define KEY_PHONE 169 /* Media Select Telephone */ |
| 285 | #define KEY_ISO 170 | 293 | #define KEY_ISO 170 |
| 286 | #define KEY_CONFIG 171 | 294 | #define KEY_CONFIG 171 /* AL Consumer Control Configuration */ |
| 287 | #define KEY_HOMEPAGE 172 | 295 | #define KEY_HOMEPAGE 172 /* AC Home */ |
| 288 | #define KEY_REFRESH 173 | 296 | #define KEY_REFRESH 173 /* AC Refresh */ |
| 289 | #define KEY_EXIT 174 | 297 | #define KEY_EXIT 174 /* AC Exit */ |
| 290 | #define KEY_MOVE 175 | 298 | #define KEY_MOVE 175 |
| 291 | #define KEY_EDIT 176 | 299 | #define KEY_EDIT 176 |
| 292 | #define KEY_SCROLLUP 177 | 300 | #define KEY_SCROLLUP 177 |
| 293 | #define KEY_SCROLLDOWN 178 | 301 | #define KEY_SCROLLDOWN 178 |
| 294 | #define KEY_KPLEFTPAREN 179 | 302 | #define KEY_KPLEFTPAREN 179 |
| 295 | #define KEY_KPRIGHTPAREN 180 | 303 | #define KEY_KPRIGHTPAREN 180 |
| 296 | #define KEY_NEW 181 | 304 | #define KEY_NEW 181 /* AC New */ |
| 297 | #define KEY_REDO 182 | 305 | #define KEY_REDO 182 /* AC Redo/Repeat */ |
| 298 | 306 | ||
| 299 | #define KEY_F13 183 | 307 | #define KEY_F13 183 |
| 300 | #define KEY_F14 184 | 308 | #define KEY_F14 184 |
| @@ -314,11 +322,11 @@ struct input_absinfo { | |||
| 314 | #define KEY_PROG3 202 | 322 | #define KEY_PROG3 202 |
| 315 | #define KEY_PROG4 203 | 323 | #define KEY_PROG4 203 |
| 316 | #define KEY_SUSPEND 205 | 324 | #define KEY_SUSPEND 205 |
| 317 | #define KEY_CLOSE 206 | 325 | #define KEY_CLOSE 206 /* AC Close */ |
| 318 | #define KEY_PLAY 207 | 326 | #define KEY_PLAY 207 |
| 319 | #define KEY_FASTFORWARD 208 | 327 | #define KEY_FASTFORWARD 208 |
| 320 | #define KEY_BASSBOOST 209 | 328 | #define KEY_BASSBOOST 209 |
| 321 | #define KEY_PRINT 210 | 329 | #define KEY_PRINT 210 /* AC Print */ |
| 322 | #define KEY_HP 211 | 330 | #define KEY_HP 211 |
| 323 | #define KEY_CAMERA 212 | 331 | #define KEY_CAMERA 212 |
| 324 | #define KEY_SOUND 213 | 332 | #define KEY_SOUND 213 |
| @@ -327,11 +335,11 @@ struct input_absinfo { | |||
| 327 | #define KEY_CHAT 216 | 335 | #define KEY_CHAT 216 |
| 328 | #define KEY_SEARCH 217 | 336 | #define KEY_SEARCH 217 |
| 329 | #define KEY_CONNECT 218 | 337 | #define KEY_CONNECT 218 |
| 330 | #define KEY_FINANCE 219 | 338 | #define KEY_FINANCE 219 /* AL Checkbook/Finance */ |
| 331 | #define KEY_SPORT 220 | 339 | #define KEY_SPORT 220 |
| 332 | #define KEY_SHOP 221 | 340 | #define KEY_SHOP 221 |
| 333 | #define KEY_ALTERASE 222 | 341 | #define KEY_ALTERASE 222 |
| 334 | #define KEY_CANCEL 223 | 342 | #define KEY_CANCEL 223 /* AC Cancel */ |
| 335 | #define KEY_BRIGHTNESSDOWN 224 | 343 | #define KEY_BRIGHTNESSDOWN 224 |
| 336 | #define KEY_BRIGHTNESSUP 225 | 344 | #define KEY_BRIGHTNESSUP 225 |
| 337 | #define KEY_MEDIA 226 | 345 | #define KEY_MEDIA 226 |
| @@ -341,10 +349,10 @@ struct input_absinfo { | |||
| 341 | #define KEY_KBDILLUMDOWN 229 | 349 | #define KEY_KBDILLUMDOWN 229 |
| 342 | #define KEY_KBDILLUMUP 230 | 350 | #define KEY_KBDILLUMUP 230 |
| 343 | 351 | ||
| 344 | #define KEY_SEND 231 | 352 | #define KEY_SEND 231 /* AC Send */ |
| 345 | #define KEY_REPLY 232 | 353 | #define KEY_REPLY 232 /* AC Reply */ |
| 346 | #define KEY_FORWARDMAIL 233 | 354 | #define KEY_FORWARDMAIL 233 /* AC Forward Msg */ |
| 347 | #define KEY_SAVE 234 | 355 | #define KEY_SAVE 234 /* AC Save */ |
| 348 | #define KEY_DOCUMENTS 235 | 356 | #define KEY_DOCUMENTS 235 |
| 349 | 357 | ||
| 350 | #define KEY_BATTERY 236 | 358 | #define KEY_BATTERY 236 |
| @@ -433,15 +441,15 @@ struct input_absinfo { | |||
| 433 | #define KEY_CLEAR 0x163 | 441 | #define KEY_CLEAR 0x163 |
| 434 | #define KEY_POWER2 0x164 | 442 | #define KEY_POWER2 0x164 |
| 435 | #define KEY_OPTION 0x165 | 443 | #define KEY_OPTION 0x165 |
| 436 | #define KEY_INFO 0x166 | 444 | #define KEY_INFO 0x166 /* AL OEM Features/Tips/Tutorial */ |
| 437 | #define KEY_TIME 0x167 | 445 | #define KEY_TIME 0x167 |
| 438 | #define KEY_VENDOR 0x168 | 446 | #define KEY_VENDOR 0x168 |
| 439 | #define KEY_ARCHIVE 0x169 | 447 | #define KEY_ARCHIVE 0x169 |
| 440 | #define KEY_PROGRAM 0x16a | 448 | #define KEY_PROGRAM 0x16a /* Media Select Program Guide */ |
| 441 | #define KEY_CHANNEL 0x16b | 449 | #define KEY_CHANNEL 0x16b |
| 442 | #define KEY_FAVORITES 0x16c | 450 | #define KEY_FAVORITES 0x16c |
| 443 | #define KEY_EPG 0x16d | 451 | #define KEY_EPG 0x16d |
| 444 | #define KEY_PVR 0x16e | 452 | #define KEY_PVR 0x16e /* Media Select Home */ |
| 445 | #define KEY_MHP 0x16f | 453 | #define KEY_MHP 0x16f |
| 446 | #define KEY_LANGUAGE 0x170 | 454 | #define KEY_LANGUAGE 0x170 |
| 447 | #define KEY_TITLE 0x171 | 455 | #define KEY_TITLE 0x171 |
| @@ -451,36 +459,36 @@ struct input_absinfo { | |||
| 451 | #define KEY_MODE 0x175 | 459 | #define KEY_MODE 0x175 |
| 452 | #define KEY_KEYBOARD 0x176 | 460 | #define KEY_KEYBOARD 0x176 |
| 453 | #define KEY_SCREEN 0x177 | 461 | #define KEY_SCREEN 0x177 |
| 454 | #define KEY_PC 0x178 | 462 | #define KEY_PC 0x178 /* Media Select Computer */ |
| 455 | #define KEY_TV 0x179 | 463 | #define KEY_TV 0x179 /* Media Select TV */ |
| 456 | #define KEY_TV2 0x17a | 464 | #define KEY_TV2 0x17a /* Media Select Cable */ |
| 457 | #define KEY_VCR 0x17b | 465 | #define KEY_VCR 0x17b /* Media Select VCR */ |
| 458 | #define KEY_VCR2 0x17c | 466 | #define KEY_VCR2 0x17c /* VCR Plus */ |
| 459 | #define KEY_SAT 0x17d | 467 | #define KEY_SAT 0x17d /* Media Select Satellite */ |
| 460 | #define KEY_SAT2 0x17e | 468 | #define KEY_SAT2 0x17e |
| 461 | #define KEY_CD 0x17f | 469 | #define KEY_CD 0x17f /* Media Select CD */ |
| 462 | #define KEY_TAPE 0x180 | 470 | #define KEY_TAPE 0x180 /* Media Select Tape */ |
| 463 | #define KEY_RADIO 0x181 | 471 | #define KEY_RADIO 0x181 |
| 464 | #define KEY_TUNER 0x182 | 472 | #define KEY_TUNER 0x182 /* Media Select Tuner */ |
| 465 | #define KEY_PLAYER 0x183 | 473 | #define KEY_PLAYER 0x183 |
| 466 | #define KEY_TEXT 0x184 | 474 | #define KEY_TEXT 0x184 |
| 467 | #define KEY_DVD 0x185 | 475 | #define KEY_DVD 0x185 /* Media Select DVD */ |
| 468 | #define KEY_AUX 0x186 | 476 | #define KEY_AUX 0x186 |
| 469 | #define KEY_MP3 0x187 | 477 | #define KEY_MP3 0x187 |
| 470 | #define KEY_AUDIO 0x188 | 478 | #define KEY_AUDIO 0x188 |
| 471 | #define KEY_VIDEO 0x189 | 479 | #define KEY_VIDEO 0x189 |
| 472 | #define KEY_DIRECTORY 0x18a | 480 | #define KEY_DIRECTORY 0x18a |
| 473 | #define KEY_LIST 0x18b | 481 | #define KEY_LIST 0x18b |
| 474 | #define KEY_MEMO 0x18c | 482 | #define KEY_MEMO 0x18c /* Media Select Messages */ |
| 475 | #define KEY_CALENDAR 0x18d | 483 | #define KEY_CALENDAR 0x18d |
| 476 | #define KEY_RED 0x18e | 484 | #define KEY_RED 0x18e |
| 477 | #define KEY_GREEN 0x18f | 485 | #define KEY_GREEN 0x18f |
| 478 | #define KEY_YELLOW 0x190 | 486 | #define KEY_YELLOW 0x190 |
| 479 | #define KEY_BLUE 0x191 | 487 | #define KEY_BLUE 0x191 |
| 480 | #define KEY_CHANNELUP 0x192 | 488 | #define KEY_CHANNELUP 0x192 /* Channel Increment */ |
| 481 | #define KEY_CHANNELDOWN 0x193 | 489 | #define KEY_CHANNELDOWN 0x193 /* Channel Decrement */ |
| 482 | #define KEY_FIRST 0x194 | 490 | #define KEY_FIRST 0x194 |
| 483 | #define KEY_LAST 0x195 | 491 | #define KEY_LAST 0x195 /* Recall Last */ |
| 484 | #define KEY_AB 0x196 | 492 | #define KEY_AB 0x196 |
| 485 | #define KEY_NEXT 0x197 | 493 | #define KEY_NEXT 0x197 |
| 486 | #define KEY_RESTART 0x198 | 494 | #define KEY_RESTART 0x198 |
| @@ -491,21 +499,21 @@ struct input_absinfo { | |||
| 491 | #define KEY_DIGITS 0x19d | 499 | #define KEY_DIGITS 0x19d |
| 492 | #define KEY_TEEN 0x19e | 500 | #define KEY_TEEN 0x19e |
| 493 | #define KEY_TWEN 0x19f | 501 | #define KEY_TWEN 0x19f |
| 494 | #define KEY_VIDEOPHONE 0x1a0 | 502 | #define KEY_VIDEOPHONE 0x1a0 /* Media Select Video Phone */ |
| 495 | #define KEY_GAMES 0x1a1 | 503 | #define KEY_GAMES 0x1a1 /* Media Select Games */ |
| 496 | #define KEY_ZOOMIN 0x1a2 | 504 | #define KEY_ZOOMIN 0x1a2 /* AC Zoom In */ |
| 497 | #define KEY_ZOOMOUT 0x1a3 | 505 | #define KEY_ZOOMOUT 0x1a3 /* AC Zoom Out */ |
| 498 | #define KEY_ZOOMRESET 0x1a4 | 506 | #define KEY_ZOOMRESET 0x1a4 /* AC Zoom */ |
| 499 | #define KEY_WORDPROCESSOR 0x1a5 | 507 | #define KEY_WORDPROCESSOR 0x1a5 /* AL Word Processor */ |
| 500 | #define KEY_EDITOR 0x1a6 | 508 | #define KEY_EDITOR 0x1a6 /* AL Text Editor */ |
| 501 | #define KEY_SPREADSHEET 0x1a7 | 509 | #define KEY_SPREADSHEET 0x1a7 /* AL Spreadsheet */ |
| 502 | #define KEY_GRAPHICSEDITOR 0x1a8 | 510 | #define KEY_GRAPHICSEDITOR 0x1a8 /* AL Graphics Editor */ |
| 503 | #define KEY_PRESENTATION 0x1a9 | 511 | #define KEY_PRESENTATION 0x1a9 /* AL Presentation App */ |
| 504 | #define KEY_DATABASE 0x1aa | 512 | #define KEY_DATABASE 0x1aa /* AL Database App */ |
| 505 | #define KEY_NEWS 0x1ab | 513 | #define KEY_NEWS 0x1ab /* AL Newsreader */ |
| 506 | #define KEY_VOICEMAIL 0x1ac | 514 | #define KEY_VOICEMAIL 0x1ac /* AL Voicemail */ |
| 507 | #define KEY_ADDRESSBOOK 0x1ad | 515 | #define KEY_ADDRESSBOOK 0x1ad /* AL Contacts/Address Book */ |
| 508 | #define KEY_MESSENGER 0x1ae | 516 | #define KEY_MESSENGER 0x1ae /* AL Instant Messaging */ |
| 509 | #define KEY_DISPLAYTOGGLE 0x1af /* Turn display (LCD) on and off */ | 517 | #define KEY_DISPLAYTOGGLE 0x1af /* Turn display (LCD) on and off */ |
| 510 | 518 | ||
| 511 | #define KEY_DEL_EOL 0x1c0 | 519 | #define KEY_DEL_EOL 0x1c0 |
| @@ -603,6 +611,7 @@ struct input_absinfo { | |||
| 603 | #define SW_LID 0x00 /* set = lid shut */ | 611 | #define SW_LID 0x00 /* set = lid shut */ |
| 604 | #define SW_TABLET_MODE 0x01 /* set = tablet mode */ | 612 | #define SW_TABLET_MODE 0x01 /* set = tablet mode */ |
| 605 | #define SW_HEADPHONE_INSERT 0x02 /* set = inserted */ | 613 | #define SW_HEADPHONE_INSERT 0x02 /* set = inserted */ |
| 614 | #define SW_RADIO 0x03 /* set = radio enabled */ | ||
| 606 | #define SW_MAX 0x0f | 615 | #define SW_MAX 0x0f |
| 607 | 616 | ||
| 608 | /* | 617 | /* |
| @@ -972,15 +981,15 @@ struct input_dev { | |||
| 972 | struct mutex mutex; /* serializes open and close operations */ | 981 | struct mutex mutex; /* serializes open and close operations */ |
| 973 | unsigned int users; | 982 | unsigned int users; |
| 974 | 983 | ||
| 975 | struct class_device cdev; | 984 | struct device dev; |
| 976 | union { /* temporarily so while we switching to struct device */ | 985 | union { /* temporarily so while we switching to struct device */ |
| 977 | struct device *parent; | 986 | struct device *dev; |
| 978 | } dev; | 987 | } cdev; |
| 979 | 988 | ||
| 980 | struct list_head h_list; | 989 | struct list_head h_list; |
| 981 | struct list_head node; | 990 | struct list_head node; |
| 982 | }; | 991 | }; |
| 983 | #define to_input_dev(d) container_of(d, struct input_dev, cdev) | 992 | #define to_input_dev(d) container_of(d, struct input_dev, dev) |
| 984 | 993 | ||
| 985 | /* | 994 | /* |
| 986 | * Verify that we are in sync with input_device_id mod_devicetable.h #defines | 995 | * Verify that we are in sync with input_device_id mod_devicetable.h #defines |
| @@ -1087,22 +1096,22 @@ struct input_handle { | |||
| 1087 | struct list_head h_node; | 1096 | struct list_head h_node; |
| 1088 | }; | 1097 | }; |
| 1089 | 1098 | ||
| 1090 | #define to_dev(n) container_of(n,struct input_dev,node) | 1099 | #define to_dev(n) container_of(n, struct input_dev, node) |
| 1091 | #define to_handler(n) container_of(n,struct input_handler,node) | 1100 | #define to_handler(n) container_of(n, struct input_handler, node) |
| 1092 | #define to_handle(n) container_of(n,struct input_handle,d_node) | 1101 | #define to_handle(n) container_of(n, struct input_handle, d_node) |
| 1093 | #define to_handle_h(n) container_of(n,struct input_handle,h_node) | 1102 | #define to_handle_h(n) container_of(n, struct input_handle, h_node) |
| 1094 | 1103 | ||
| 1095 | struct input_dev *input_allocate_device(void); | 1104 | struct input_dev *input_allocate_device(void); |
| 1096 | void input_free_device(struct input_dev *dev); | 1105 | void input_free_device(struct input_dev *dev); |
| 1097 | 1106 | ||
| 1098 | static inline struct input_dev *input_get_device(struct input_dev *dev) | 1107 | static inline struct input_dev *input_get_device(struct input_dev *dev) |
| 1099 | { | 1108 | { |
| 1100 | return to_input_dev(class_device_get(&dev->cdev)); | 1109 | return to_input_dev(get_device(&dev->dev)); |
| 1101 | } | 1110 | } |
| 1102 | 1111 | ||
| 1103 | static inline void input_put_device(struct input_dev *dev) | 1112 | static inline void input_put_device(struct input_dev *dev) |
| 1104 | { | 1113 | { |
| 1105 | class_device_put(&dev->cdev); | 1114 | put_device(&dev->dev); |
| 1106 | } | 1115 | } |
| 1107 | 1116 | ||
| 1108 | static inline void *input_get_drvdata(struct input_dev *dev) | 1117 | static inline void *input_get_drvdata(struct input_dev *dev) |
diff --git a/include/linux/ioprio.h b/include/linux/ioprio.h index 8e2042b9d471..2eaa142cd061 100644 --- a/include/linux/ioprio.h +++ b/include/linux/ioprio.h | |||
| @@ -47,8 +47,10 @@ enum { | |||
| 47 | #define IOPRIO_NORM (4) | 47 | #define IOPRIO_NORM (4) |
| 48 | static inline int task_ioprio(struct task_struct *task) | 48 | static inline int task_ioprio(struct task_struct *task) |
| 49 | { | 49 | { |
| 50 | WARN_ON(!ioprio_valid(task->ioprio)); | 50 | if (ioprio_valid(task->ioprio)) |
| 51 | return IOPRIO_PRIO_DATA(task->ioprio); | 51 | return IOPRIO_PRIO_DATA(task->ioprio); |
| 52 | |||
| 53 | return IOPRIO_NORM; | ||
| 52 | } | 54 | } |
| 53 | 55 | ||
| 54 | static inline int task_nice_ioprio(struct task_struct *task) | 56 | static inline int task_nice_ioprio(struct task_struct *task) |
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h index 12178d2c882b..5f06527dca21 100644 --- a/include/linux/kallsyms.h +++ b/include/linux/kallsyms.h | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | #ifndef _LINUX_KALLSYMS_H | 5 | #ifndef _LINUX_KALLSYMS_H |
| 6 | #define _LINUX_KALLSYMS_H | 6 | #define _LINUX_KALLSYMS_H |
| 7 | 7 | ||
| 8 | #include <linux/errno.h> | ||
| 8 | 9 | ||
| 9 | #define KSYM_NAME_LEN 127 | 10 | #define KSYM_NAME_LEN 127 |
| 10 | #define KSYM_SYMBOL_LEN (sizeof("%s+%#lx/%#lx [%s]") + KSYM_NAME_LEN + \ | 11 | #define KSYM_SYMBOL_LEN (sizeof("%s+%#lx/%#lx [%s]") + KSYM_NAME_LEN + \ |
diff --git a/include/linux/ktime.h b/include/linux/ktime.h index c762954bda14..2b139f66027f 100644 --- a/include/linux/ktime.h +++ b/include/linux/ktime.h | |||
| @@ -261,6 +261,18 @@ static inline s64 ktime_to_ns(const ktime_t kt) | |||
| 261 | 261 | ||
| 262 | #endif | 262 | #endif |
| 263 | 263 | ||
| 264 | /** | ||
| 265 | * ktime_equal - Compares two ktime_t variables to see if they are equal | ||
| 266 | * @cmp1: comparable1 | ||
| 267 | * @cmp2: comparable2 | ||
| 268 | * | ||
| 269 | * Compare two ktime_t variables, returns 1 if equal | ||
| 270 | */ | ||
| 271 | static inline int ktime_equal(const ktime_t cmp1, const ktime_t cmp2) | ||
| 272 | { | ||
| 273 | return cmp1.tv64 == cmp2.tv64; | ||
| 274 | } | ||
| 275 | |||
| 264 | static inline s64 ktime_to_us(const ktime_t kt) | 276 | static inline s64 ktime_to_us(const ktime_t kt) |
| 265 | { | 277 | { |
| 266 | struct timeval tv = ktime_to_timeval(kt); | 278 | struct timeval tv = ktime_to_timeval(kt); |
diff --git a/include/linux/libata.h b/include/linux/libata.h index 745c4f9b4caa..a3df64677ac3 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
| @@ -116,6 +116,7 @@ static inline struct device *pci_dev_to_dev(struct pci_dev *pdev) | |||
| 116 | enum { | 116 | enum { |
| 117 | /* various global constants */ | 117 | /* various global constants */ |
| 118 | LIBATA_MAX_PRD = ATA_MAX_PRD / 2, | 118 | LIBATA_MAX_PRD = ATA_MAX_PRD / 2, |
| 119 | LIBATA_DUMB_MAX_PRD = ATA_MAX_PRD / 4, /* Worst case */ | ||
| 119 | ATA_MAX_PORTS = 8, | 120 | ATA_MAX_PORTS = 8, |
| 120 | ATA_DEF_QUEUE = 1, | 121 | ATA_DEF_QUEUE = 1, |
| 121 | /* tag ATA_MAX_QUEUE - 1 is reserved for internal commands */ | 122 | /* tag ATA_MAX_QUEUE - 1 is reserved for internal commands */ |
| @@ -136,6 +137,8 @@ enum { | |||
| 136 | ATA_DFLAG_CDB_INTR = (1 << 2), /* device asserts INTRQ when ready for CDB */ | 137 | ATA_DFLAG_CDB_INTR = (1 << 2), /* device asserts INTRQ when ready for CDB */ |
| 137 | ATA_DFLAG_NCQ = (1 << 3), /* device supports NCQ */ | 138 | ATA_DFLAG_NCQ = (1 << 3), /* device supports NCQ */ |
| 138 | ATA_DFLAG_FLUSH_EXT = (1 << 4), /* do FLUSH_EXT instead of FLUSH */ | 139 | ATA_DFLAG_FLUSH_EXT = (1 << 4), /* do FLUSH_EXT instead of FLUSH */ |
| 140 | ATA_DFLAG_ACPI_PENDING = (1 << 5), /* ACPI resume action pending */ | ||
| 141 | ATA_DFLAG_ACPI_FAILED = (1 << 6), /* ACPI on devcfg has failed */ | ||
| 139 | ATA_DFLAG_CFG_MASK = (1 << 8) - 1, | 142 | ATA_DFLAG_CFG_MASK = (1 << 8) - 1, |
| 140 | 143 | ||
| 141 | ATA_DFLAG_PIO = (1 << 8), /* device limited to PIO mode */ | 144 | ATA_DFLAG_PIO = (1 << 8), /* device limited to PIO mode */ |
| @@ -196,6 +199,7 @@ enum { | |||
| 196 | ATA_PFLAG_FLUSH_PORT_TASK = (1 << 16), /* flush port task */ | 199 | ATA_PFLAG_FLUSH_PORT_TASK = (1 << 16), /* flush port task */ |
| 197 | ATA_PFLAG_SUSPENDED = (1 << 17), /* port is suspended (power) */ | 200 | ATA_PFLAG_SUSPENDED = (1 << 17), /* port is suspended (power) */ |
| 198 | ATA_PFLAG_PM_PENDING = (1 << 18), /* PM operation pending */ | 201 | ATA_PFLAG_PM_PENDING = (1 << 18), /* PM operation pending */ |
| 202 | ATA_PFLAG_GTM_VALID = (1 << 19), /* acpi_gtm data valid */ | ||
| 199 | 203 | ||
| 200 | /* struct ata_queued_cmd flags */ | 204 | /* struct ata_queued_cmd flags */ |
| 201 | ATA_QCFLAG_ACTIVE = (1 << 0), /* cmd not yet ack'd to scsi lyer */ | 205 | ATA_QCFLAG_ACTIVE = (1 << 0), /* cmd not yet ack'd to scsi lyer */ |
| @@ -298,7 +302,6 @@ enum { | |||
| 298 | ATA_HORKAGE_NODMA = (1 << 1), /* DMA problems */ | 302 | ATA_HORKAGE_NODMA = (1 << 1), /* DMA problems */ |
| 299 | ATA_HORKAGE_NONCQ = (1 << 2), /* Don't use NCQ */ | 303 | ATA_HORKAGE_NONCQ = (1 << 2), /* Don't use NCQ */ |
| 300 | ATA_HORKAGE_MAX_SEC_128 = (1 << 3), /* Limit max sects to 128 */ | 304 | ATA_HORKAGE_MAX_SEC_128 = (1 << 3), /* Limit max sects to 128 */ |
| 301 | ATA_HORKAGE_DMA_RW_ONLY = (1 << 4), /* ATAPI DMA for RW only */ | ||
| 302 | }; | 305 | }; |
| 303 | 306 | ||
| 304 | enum hsm_task_states { | 307 | enum hsm_task_states { |
| @@ -364,6 +367,9 @@ struct ata_host { | |||
| 364 | void *private_data; | 367 | void *private_data; |
| 365 | const struct ata_port_operations *ops; | 368 | const struct ata_port_operations *ops; |
| 366 | unsigned long flags; | 369 | unsigned long flags; |
| 370 | #ifdef CONFIG_ATA_ACPI | ||
| 371 | acpi_handle acpi_handle; | ||
| 372 | #endif | ||
| 367 | struct ata_port *simplex_claimed; /* channel owning the DMA */ | 373 | struct ata_port *simplex_claimed; /* channel owning the DMA */ |
| 368 | struct ata_port *ports[0]; | 374 | struct ata_port *ports[0]; |
| 369 | }; | 375 | }; |
| @@ -430,6 +436,9 @@ struct ata_device { | |||
| 430 | unsigned int devno; /* 0 or 1 */ | 436 | unsigned int devno; /* 0 or 1 */ |
| 431 | unsigned long flags; /* ATA_DFLAG_xxx */ | 437 | unsigned long flags; /* ATA_DFLAG_xxx */ |
| 432 | struct scsi_device *sdev; /* attached SCSI device */ | 438 | struct scsi_device *sdev; /* attached SCSI device */ |
| 439 | #ifdef CONFIG_ATA_ACPI | ||
| 440 | acpi_handle acpi_handle; | ||
| 441 | #endif | ||
| 433 | /* n_sector is used as CLEAR_OFFSET, read comment above CLEAR_OFFSET */ | 442 | /* n_sector is used as CLEAR_OFFSET, read comment above CLEAR_OFFSET */ |
| 434 | u64 n_sectors; /* size of device, if ATA */ | 443 | u64 n_sectors; /* size of device, if ATA */ |
| 435 | unsigned int class; /* ATA_DEV_xxx */ | 444 | unsigned int class; /* ATA_DEV_xxx */ |
| @@ -458,10 +467,6 @@ struct ata_device { | |||
| 458 | struct ata_ering ering; | 467 | struct ata_ering ering; |
| 459 | int spdn_cnt; | 468 | int spdn_cnt; |
| 460 | unsigned int horkage; /* List of broken features */ | 469 | unsigned int horkage; /* List of broken features */ |
| 461 | #ifdef CONFIG_ATA_ACPI | ||
| 462 | /* ACPI objects info */ | ||
| 463 | acpi_handle obj_handle; | ||
| 464 | #endif | ||
| 465 | }; | 470 | }; |
| 466 | 471 | ||
| 467 | /* Offset into struct ata_device. Fields above it are maintained | 472 | /* Offset into struct ata_device. Fields above it are maintained |
| @@ -490,6 +495,17 @@ struct ata_eh_context { | |||
| 490 | unsigned int did_probe_mask; | 495 | unsigned int did_probe_mask; |
| 491 | }; | 496 | }; |
| 492 | 497 | ||
| 498 | struct ata_acpi_drive | ||
| 499 | { | ||
| 500 | u32 pio; | ||
| 501 | u32 dma; | ||
| 502 | } __packed; | ||
| 503 | |||
| 504 | struct ata_acpi_gtm { | ||
| 505 | struct ata_acpi_drive drive[2]; | ||
| 506 | u32 flags; | ||
| 507 | } __packed; | ||
| 508 | |||
| 493 | struct ata_port { | 509 | struct ata_port { |
| 494 | struct Scsi_Host *scsi_host; /* our co-allocated scsi host */ | 510 | struct Scsi_Host *scsi_host; /* our co-allocated scsi host */ |
| 495 | const struct ata_port_operations *ops; | 511 | const struct ata_port_operations *ops; |
| @@ -550,6 +566,10 @@ struct ata_port { | |||
| 550 | 566 | ||
| 551 | void *private_data; | 567 | void *private_data; |
| 552 | 568 | ||
| 569 | #ifdef CONFIG_ATA_ACPI | ||
| 570 | acpi_handle acpi_handle; | ||
| 571 | struct ata_acpi_gtm acpi_gtm; | ||
| 572 | #endif | ||
| 553 | u8 sector_buf[ATA_SECT_SIZE]; /* owned by EH */ | 573 | u8 sector_buf[ATA_SECT_SIZE]; /* owned by EH */ |
| 554 | }; | 574 | }; |
| 555 | 575 | ||
| @@ -759,6 +779,7 @@ extern void ata_data_xfer(struct ata_device *adev, unsigned char *buf, | |||
| 759 | unsigned int buflen, int write_data); | 779 | unsigned int buflen, int write_data); |
| 760 | extern void ata_data_xfer_noirq(struct ata_device *adev, unsigned char *buf, | 780 | extern void ata_data_xfer_noirq(struct ata_device *adev, unsigned char *buf, |
| 761 | unsigned int buflen, int write_data); | 781 | unsigned int buflen, int write_data); |
| 782 | extern void ata_dumb_qc_prep(struct ata_queued_cmd *qc); | ||
| 762 | extern void ata_qc_prep(struct ata_queued_cmd *qc); | 783 | extern void ata_qc_prep(struct ata_queued_cmd *qc); |
| 763 | extern void ata_noop_qc_prep(struct ata_queued_cmd *qc); | 784 | extern void ata_noop_qc_prep(struct ata_queued_cmd *qc); |
| 764 | extern unsigned int ata_qc_issue_prot(struct ata_queued_cmd *qc); | 785 | extern unsigned int ata_qc_issue_prot(struct ata_queued_cmd *qc); |
| @@ -1088,11 +1109,9 @@ static inline u8 ata_wait_idle(struct ata_port *ap) | |||
| 1088 | { | 1109 | { |
| 1089 | u8 status = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000); | 1110 | u8 status = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000); |
| 1090 | 1111 | ||
| 1091 | if (status != 0xff && (status & (ATA_BUSY | ATA_DRQ))) { | 1112 | if (status != 0xff && (status & (ATA_BUSY | ATA_DRQ))) |
| 1092 | if (ata_msg_warn(ap)) | 1113 | DPRINTK("ATA: abnormal status 0x%X on port 0x%p\n", |
| 1093 | printk(KERN_WARNING "ATA: abnormal status 0x%X on port 0x%p\n", | 1114 | status, ap->ioaddr.status_addr); |
| 1094 | status, ap->ioaddr.status_addr); | ||
| 1095 | } | ||
| 1096 | 1115 | ||
| 1097 | return status; | 1116 | return status; |
| 1098 | } | 1117 | } |
diff --git a/include/linux/lzo.h b/include/linux/lzo.h new file mode 100644 index 000000000000..582d8b711a13 --- /dev/null +++ b/include/linux/lzo.h | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | #ifndef __LZO_H__ | ||
| 2 | #define __LZO_H__ | ||
| 3 | /* | ||
| 4 | * LZO Public Kernel Interface | ||
| 5 | * A mini subset of the LZO real-time data compression library | ||
| 6 | * | ||
| 7 | * Copyright (C) 1996-2005 Markus F.X.J. Oberhumer <markus@oberhumer.com> | ||
| 8 | * | ||
| 9 | * The full LZO package can be found at: | ||
| 10 | * http://www.oberhumer.com/opensource/lzo/ | ||
| 11 | * | ||
| 12 | * Changed for kernel use by: | ||
| 13 | * Nitin Gupta <nitingupta910@gmail.com> | ||
| 14 | * Richard Purdie <rpurdie@openedhand.com> | ||
| 15 | */ | ||
| 16 | |||
| 17 | #define LZO1X_MEM_COMPRESS (16384 * sizeof(unsigned char *)) | ||
| 18 | #define LZO1X_1_MEM_COMPRESS LZO1X_MEM_COMPRESS | ||
| 19 | |||
| 20 | #define lzo1x_worst_compress(x) (x + (x / 64) + 16 + 3) | ||
| 21 | |||
| 22 | /* This requires 'workmem' of size LZO1X_1_MEM_COMPRESS */ | ||
| 23 | int lzo1x_1_compress(const unsigned char *src, size_t src_len, | ||
| 24 | unsigned char *dst, size_t *dst_len, void *wrkmem); | ||
| 25 | |||
| 26 | /* safe decompression with overrun testing */ | ||
| 27 | int lzo1x_decompress_safe(const unsigned char *src, size_t src_len, | ||
| 28 | unsigned char *dst, size_t *dst_len); | ||
| 29 | |||
| 30 | /* | ||
| 31 | * Return values (< 0 = Error) | ||
| 32 | */ | ||
| 33 | #define LZO_E_OK 0 | ||
| 34 | #define LZO_E_ERROR (-1) | ||
| 35 | #define LZO_E_OUT_OF_MEMORY (-2) | ||
| 36 | #define LZO_E_NOT_COMPRESSIBLE (-3) | ||
| 37 | #define LZO_E_INPUT_OVERRUN (-4) | ||
| 38 | #define LZO_E_OUTPUT_OVERRUN (-5) | ||
| 39 | #define LZO_E_LOOKBEHIND_OVERRUN (-6) | ||
| 40 | #define LZO_E_EOF_NOT_FOUND (-7) | ||
| 41 | #define LZO_E_INPUT_NOT_CONSUMED (-8) | ||
| 42 | #define LZO_E_NOT_YET_IMPLEMENTED (-9) | ||
| 43 | |||
| 44 | #endif | ||
diff --git a/include/linux/mlx4/cmd.h b/include/linux/mlx4/cmd.h index 4fb552d12f7a..7d1eaa97de13 100644 --- a/include/linux/mlx4/cmd.h +++ b/include/linux/mlx4/cmd.h | |||
| @@ -54,6 +54,7 @@ enum { | |||
| 54 | MLX4_CMD_INIT_PORT = 0x9, | 54 | MLX4_CMD_INIT_PORT = 0x9, |
| 55 | MLX4_CMD_CLOSE_PORT = 0xa, | 55 | MLX4_CMD_CLOSE_PORT = 0xa, |
| 56 | MLX4_CMD_QUERY_HCA = 0xb, | 56 | MLX4_CMD_QUERY_HCA = 0xb, |
| 57 | MLX4_CMD_QUERY_PORT = 0x43, | ||
| 57 | MLX4_CMD_SET_PORT = 0xc, | 58 | MLX4_CMD_SET_PORT = 0xc, |
| 58 | MLX4_CMD_ACCESS_DDR = 0x2e, | 59 | MLX4_CMD_ACCESS_DDR = 0x2e, |
| 59 | MLX4_CMD_MAP_ICM = 0xffa, | 60 | MLX4_CMD_MAP_ICM = 0xffa, |
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index 8c5f8fd86841..b372f5910fc1 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h | |||
| @@ -41,6 +41,7 @@ | |||
| 41 | 41 | ||
| 42 | enum { | 42 | enum { |
| 43 | MLX4_FLAG_MSI_X = 1 << 0, | 43 | MLX4_FLAG_MSI_X = 1 << 0, |
| 44 | MLX4_FLAG_OLD_PORT_CMDS = 1 << 1, | ||
| 44 | }; | 45 | }; |
| 45 | 46 | ||
| 46 | enum { | 47 | enum { |
| @@ -131,10 +132,10 @@ enum { | |||
| 131 | struct mlx4_caps { | 132 | struct mlx4_caps { |
| 132 | u64 fw_ver; | 133 | u64 fw_ver; |
| 133 | int num_ports; | 134 | int num_ports; |
| 134 | int vl_cap; | 135 | int vl_cap[MLX4_MAX_PORTS + 1]; |
| 135 | int mtu_cap; | 136 | int mtu_cap[MLX4_MAX_PORTS + 1]; |
| 136 | int gid_table_len; | 137 | int gid_table_len[MLX4_MAX_PORTS + 1]; |
| 137 | int pkey_table_len; | 138 | int pkey_table_len[MLX4_MAX_PORTS + 1]; |
| 138 | int local_ca_ack_delay; | 139 | int local_ca_ack_delay; |
| 139 | int num_uars; | 140 | int num_uars; |
| 140 | int bf_reg_size; | 141 | int bf_reg_size; |
| @@ -174,7 +175,7 @@ struct mlx4_caps { | |||
| 174 | u32 page_size_cap; | 175 | u32 page_size_cap; |
| 175 | u32 flags; | 176 | u32 flags; |
| 176 | u16 stat_rate_support; | 177 | u16 stat_rate_support; |
| 177 | u8 port_width_cap; | 178 | u8 port_width_cap[MLX4_MAX_PORTS + 1]; |
| 178 | }; | 179 | }; |
| 179 | 180 | ||
| 180 | struct mlx4_buf_list { | 181 | struct mlx4_buf_list { |
| @@ -322,7 +323,7 @@ int mlx4_srq_alloc(struct mlx4_dev *dev, u32 pdn, struct mlx4_mtt *mtt, | |||
| 322 | void mlx4_srq_free(struct mlx4_dev *dev, struct mlx4_srq *srq); | 323 | void mlx4_srq_free(struct mlx4_dev *dev, struct mlx4_srq *srq); |
| 323 | int mlx4_srq_arm(struct mlx4_dev *dev, struct mlx4_srq *srq, int limit_watermark); | 324 | int mlx4_srq_arm(struct mlx4_dev *dev, struct mlx4_srq *srq, int limit_watermark); |
| 324 | 325 | ||
| 325 | int mlx4_INIT_PORT(struct mlx4_dev *dev, struct mlx4_init_port_param *param, int port); | 326 | int mlx4_INIT_PORT(struct mlx4_dev *dev, int port); |
| 326 | int mlx4_CLOSE_PORT(struct mlx4_dev *dev, int port); | 327 | int mlx4_CLOSE_PORT(struct mlx4_dev *dev, int port); |
| 327 | 328 | ||
| 328 | int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16]); | 329 | int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16]); |
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h index 9eeb61adf6a3..10c57d279144 100644 --- a/include/linux/mlx4/qp.h +++ b/include/linux/mlx4/qp.h | |||
| @@ -269,6 +269,10 @@ struct mlx4_wqe_data_seg { | |||
| 269 | __be64 addr; | 269 | __be64 addr; |
| 270 | }; | 270 | }; |
| 271 | 271 | ||
| 272 | enum { | ||
| 273 | MLX4_INLINE_ALIGN = 64, | ||
| 274 | }; | ||
| 275 | |||
| 272 | struct mlx4_wqe_inline_seg { | 276 | struct mlx4_wqe_inline_seg { |
| 273 | __be32 byte_count; | 277 | __be32 byte_count; |
| 274 | }; | 278 | }; |
diff --git a/include/linux/mm.h b/include/linux/mm.h index e4183c6c7de3..1c1207472bb4 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
| @@ -603,6 +603,10 @@ static inline struct address_space *page_mapping(struct page *page) | |||
| 603 | 603 | ||
| 604 | if (unlikely(PageSwapCache(page))) | 604 | if (unlikely(PageSwapCache(page))) |
| 605 | mapping = &swapper_space; | 605 | mapping = &swapper_space; |
| 606 | #ifdef CONFIG_SLUB | ||
| 607 | else if (unlikely(PageSlab(page))) | ||
| 608 | mapping = NULL; | ||
| 609 | #endif | ||
| 606 | else if (unlikely((unsigned long)mapping & PAGE_MAPPING_ANON)) | 610 | else if (unlikely((unsigned long)mapping & PAGE_MAPPING_ANON)) |
| 607 | mapping = NULL; | 611 | mapping = NULL; |
| 608 | return mapping; | 612 | return mapping; |
diff --git a/include/linux/mv643xx.h b/include/linux/mv643xx.h index c6d4ab86b83c..b021b3a2b65a 100644 --- a/include/linux/mv643xx.h +++ b/include/linux/mv643xx.h | |||
| @@ -13,10 +13,6 @@ | |||
| 13 | #ifndef __ASM_MV643XX_H | 13 | #ifndef __ASM_MV643XX_H |
| 14 | #define __ASM_MV643XX_H | 14 | #define __ASM_MV643XX_H |
| 15 | 15 | ||
| 16 | #ifdef __mips__ | ||
| 17 | #include <asm/addrspace.h> | ||
| 18 | #include <asm/marvell.h> | ||
| 19 | #endif | ||
| 20 | #include <asm/types.h> | 16 | #include <asm/types.h> |
| 21 | 17 | ||
| 22 | /****************************************/ | 18 | /****************************************/ |
diff --git a/include/linux/pata_platform.h b/include/linux/pata_platform.h index 2d5fd647e0e9..5799e8d50623 100644 --- a/include/linux/pata_platform.h +++ b/include/linux/pata_platform.h | |||
| @@ -8,6 +8,11 @@ struct pata_platform_info { | |||
| 8 | * spacing used by ata_std_ports(). | 8 | * spacing used by ata_std_ports(). |
| 9 | */ | 9 | */ |
| 10 | unsigned int ioport_shift; | 10 | unsigned int ioport_shift; |
| 11 | /* | ||
| 12 | * Indicate platform specific irq types and initial | ||
| 13 | * IRQ flags when call request_irq() | ||
| 14 | */ | ||
| 15 | unsigned int irq_flags; | ||
| 11 | }; | 16 | }; |
| 12 | 17 | ||
| 13 | #endif /* __LINUX_PATA_PLATFORM_H */ | 18 | #endif /* __LINUX_PATA_PLATFORM_H */ |
diff --git a/include/linux/pci.h b/include/linux/pci.h index fbf3766dac1e..086a0e5a6318 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
| @@ -748,6 +748,17 @@ static inline void pci_release_regions(struct pci_dev *dev) { } | |||
| 748 | static inline void pci_block_user_cfg_access(struct pci_dev *dev) { } | 748 | static inline void pci_block_user_cfg_access(struct pci_dev *dev) { } |
| 749 | static inline void pci_unblock_user_cfg_access(struct pci_dev *dev) { } | 749 | static inline void pci_unblock_user_cfg_access(struct pci_dev *dev) { } |
| 750 | 750 | ||
| 751 | static inline struct pci_bus *pci_find_next_bus(const struct pci_bus *from) | ||
| 752 | { return NULL; } | ||
| 753 | |||
| 754 | static inline struct pci_dev *pci_get_slot(struct pci_bus *bus, | ||
| 755 | unsigned int devfn) | ||
| 756 | { return NULL; } | ||
| 757 | |||
| 758 | static inline struct pci_dev *pci_get_bus_and_slot(unsigned int bus, | ||
| 759 | unsigned int devfn) | ||
| 760 | { return NULL; } | ||
| 761 | |||
| 751 | #endif /* CONFIG_PCI */ | 762 | #endif /* CONFIG_PCI */ |
| 752 | 763 | ||
| 753 | /* Include architecture-dependent settings and functions */ | 764 | /* Include architecture-dependent settings and functions */ |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 9a03b47da603..75c4d4d06892 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
| @@ -661,6 +661,7 @@ | |||
| 661 | #define PCI_DEVICE_ID_SI_965 0x0965 | 661 | #define PCI_DEVICE_ID_SI_965 0x0965 |
| 662 | #define PCI_DEVICE_ID_SI_966 0x0966 | 662 | #define PCI_DEVICE_ID_SI_966 0x0966 |
| 663 | #define PCI_DEVICE_ID_SI_968 0x0968 | 663 | #define PCI_DEVICE_ID_SI_968 0x0968 |
| 664 | #define PCI_DEVICE_ID_SI_1180 0x1180 | ||
| 664 | #define PCI_DEVICE_ID_SI_5511 0x5511 | 665 | #define PCI_DEVICE_ID_SI_5511 0x5511 |
| 665 | #define PCI_DEVICE_ID_SI_5513 0x5513 | 666 | #define PCI_DEVICE_ID_SI_5513 0x5513 |
| 666 | #define PCI_DEVICE_ID_SI_5517 0x5517 | 667 | #define PCI_DEVICE_ID_SI_5517 0x5517 |
| @@ -1999,6 +2000,7 @@ | |||
| 1999 | 2000 | ||
| 2000 | #define PCI_VENDOR_ID_ENE 0x1524 | 2001 | #define PCI_VENDOR_ID_ENE 0x1524 |
| 2001 | #define PCI_DEVICE_ID_ENE_CB712_SD 0x0550 | 2002 | #define PCI_DEVICE_ID_ENE_CB712_SD 0x0550 |
| 2003 | #define PCI_DEVICE_ID_ENE_CB712_SD_2 0x0551 | ||
| 2002 | #define PCI_DEVICE_ID_ENE_1211 0x1211 | 2004 | #define PCI_DEVICE_ID_ENE_1211 0x1211 |
| 2003 | #define PCI_DEVICE_ID_ENE_1225 0x1225 | 2005 | #define PCI_DEVICE_ID_ENE_1225 0x1225 |
| 2004 | #define PCI_DEVICE_ID_ENE_1410 0x1410 | 2006 | #define PCI_DEVICE_ID_ENE_1410 0x1410 |
diff --git a/include/linux/pda_power.h b/include/linux/pda_power.h new file mode 100644 index 000000000000..1375f15797e7 --- /dev/null +++ b/include/linux/pda_power.h | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | /* | ||
| 2 | * Common power driver for PDAs and phones with one or two external | ||
| 3 | * power supplies (AC/USB) connected to main and backup batteries, | ||
| 4 | * and optional builtin charger. | ||
| 5 | * | ||
| 6 | * Copyright © 2007 Anton Vorontsov <cbou@mail.ru> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License version 2 as | ||
| 10 | * published by the Free Software Foundation. | ||
| 11 | */ | ||
| 12 | |||
| 13 | #ifndef __PDA_POWER_H__ | ||
| 14 | #define __PDA_POWER_H__ | ||
| 15 | |||
| 16 | #define PDA_POWER_CHARGE_AC (1 << 0) | ||
| 17 | #define PDA_POWER_CHARGE_USB (1 << 1) | ||
| 18 | |||
| 19 | struct pda_power_pdata { | ||
| 20 | int (*is_ac_online)(void); | ||
| 21 | int (*is_usb_online)(void); | ||
| 22 | void (*set_charge)(int flags); | ||
| 23 | |||
| 24 | char **supplied_to; | ||
| 25 | size_t num_supplicants; | ||
| 26 | |||
| 27 | unsigned int wait_for_status; /* msecs, default is 500 */ | ||
| 28 | unsigned int wait_for_charger; /* msecs, default is 500 */ | ||
| 29 | }; | ||
| 30 | |||
| 31 | #endif /* __PDA_POWER_H__ */ | ||
diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h index c8884f971228..8e4120285f72 100644 --- a/include/linux/pipe_fs_i.h +++ b/include/linux/pipe_fs_i.h | |||
| @@ -9,13 +9,39 @@ | |||
| 9 | #define PIPE_BUF_FLAG_ATOMIC 0x02 /* was atomically mapped */ | 9 | #define PIPE_BUF_FLAG_ATOMIC 0x02 /* was atomically mapped */ |
| 10 | #define PIPE_BUF_FLAG_GIFT 0x04 /* page is a gift */ | 10 | #define PIPE_BUF_FLAG_GIFT 0x04 /* page is a gift */ |
| 11 | 11 | ||
| 12 | /** | ||
| 13 | * struct pipe_buffer - a linux kernel pipe buffer | ||
| 14 | * @page: the page containing the data for the pipe buffer | ||
| 15 | * @offset: offset of data inside the @page | ||
| 16 | * @len: length of data inside the @page | ||
| 17 | * @ops: operations associated with this buffer. See @pipe_buf_operations. | ||
| 18 | * @flags: pipe buffer flags. See above. | ||
| 19 | * @private: private data owned by the ops. | ||
| 20 | **/ | ||
| 12 | struct pipe_buffer { | 21 | struct pipe_buffer { |
| 13 | struct page *page; | 22 | struct page *page; |
| 14 | unsigned int offset, len; | 23 | unsigned int offset, len; |
| 15 | const struct pipe_buf_operations *ops; | 24 | const struct pipe_buf_operations *ops; |
| 16 | unsigned int flags; | 25 | unsigned int flags; |
| 26 | unsigned long private; | ||
| 17 | }; | 27 | }; |
| 18 | 28 | ||
| 29 | /** | ||
| 30 | * struct pipe_inode_info - a linux kernel pipe | ||
| 31 | * @wait: reader/writer wait point in case of empty/full pipe | ||
| 32 | * @nrbufs: the number of non-empty pipe buffers in this pipe | ||
| 33 | * @curbuf: the current pipe buffer entry | ||
| 34 | * @tmp_page: cached released page | ||
| 35 | * @readers: number of current readers of this pipe | ||
| 36 | * @writers: number of current writers of this pipe | ||
| 37 | * @waiting_writers: number of writers blocked waiting for room | ||
| 38 | * @r_counter: reader counter | ||
| 39 | * @w_counter: writer counter | ||
| 40 | * @fasync_readers: reader side fasync | ||
| 41 | * @fasync_writers: writer side fasync | ||
| 42 | * @inode: inode this pipe is attached to | ||
| 43 | * @bufs: the circular array of pipe buffers | ||
| 44 | **/ | ||
| 19 | struct pipe_inode_info { | 45 | struct pipe_inode_info { |
| 20 | wait_queue_head_t wait; | 46 | wait_queue_head_t wait; |
| 21 | unsigned int nrbufs, curbuf; | 47 | unsigned int nrbufs, curbuf; |
| @@ -34,22 +60,73 @@ struct pipe_inode_info { | |||
| 34 | /* | 60 | /* |
| 35 | * Note on the nesting of these functions: | 61 | * Note on the nesting of these functions: |
| 36 | * | 62 | * |
| 37 | * ->pin() | 63 | * ->confirm() |
| 38 | * ->steal() | 64 | * ->steal() |
| 39 | * ... | 65 | * ... |
| 40 | * ->map() | 66 | * ->map() |
| 41 | * ... | 67 | * ... |
| 42 | * ->unmap() | 68 | * ->unmap() |
| 43 | * | 69 | * |
| 44 | * That is, ->map() must be called on a pinned buffer, same goes for ->steal(). | 70 | * That is, ->map() must be called on a confirmed buffer, |
| 71 | * same goes for ->steal(). See below for the meaning of each | ||
| 72 | * operation. Also see kerneldoc in fs/pipe.c for the pipe | ||
| 73 | * and generic variants of these hooks. | ||
| 45 | */ | 74 | */ |
| 46 | struct pipe_buf_operations { | 75 | struct pipe_buf_operations { |
| 76 | /* | ||
| 77 | * This is set to 1, if the generic pipe read/write may coalesce | ||
| 78 | * data into an existing buffer. If this is set to 0, a new pipe | ||
| 79 | * page segment is always used for new data. | ||
| 80 | */ | ||
| 47 | int can_merge; | 81 | int can_merge; |
| 82 | |||
| 83 | /* | ||
| 84 | * ->map() returns a virtual address mapping of the pipe buffer. | ||
| 85 | * The last integer flag reflects whether this should be an atomic | ||
| 86 | * mapping or not. The atomic map is faster, however you can't take | ||
| 87 | * page faults before calling ->unmap() again. So if you need to eg | ||
| 88 | * access user data through copy_to/from_user(), then you must get | ||
| 89 | * a non-atomic map. ->map() uses the KM_USER0 atomic slot for | ||
| 90 | * atomic maps, so you can't map more than one pipe_buffer at once | ||
| 91 | * and you have to be careful if mapping another page as source | ||
| 92 | * or destination for a copy (IOW, it has to use something else | ||
| 93 | * than KM_USER0). | ||
| 94 | */ | ||
| 48 | void * (*map)(struct pipe_inode_info *, struct pipe_buffer *, int); | 95 | void * (*map)(struct pipe_inode_info *, struct pipe_buffer *, int); |
| 96 | |||
| 97 | /* | ||
| 98 | * Undoes ->map(), finishes the virtual mapping of the pipe buffer. | ||
| 99 | */ | ||
| 49 | void (*unmap)(struct pipe_inode_info *, struct pipe_buffer *, void *); | 100 | void (*unmap)(struct pipe_inode_info *, struct pipe_buffer *, void *); |
| 50 | int (*pin)(struct pipe_inode_info *, struct pipe_buffer *); | 101 | |
| 102 | /* | ||
| 103 | * ->confirm() verifies that the data in the pipe buffer is there | ||
| 104 | * and that the contents are good. If the pages in the pipe belong | ||
| 105 | * to a file system, we may need to wait for IO completion in this | ||
| 106 | * hook. Returns 0 for good, or a negative error value in case of | ||
| 107 | * error. | ||
| 108 | */ | ||
| 109 | int (*confirm)(struct pipe_inode_info *, struct pipe_buffer *); | ||
| 110 | |||
| 111 | /* | ||
| 112 | * When the contents of this pipe buffer has been completely | ||
| 113 | * consumed by a reader, ->release() is called. | ||
| 114 | */ | ||
| 51 | void (*release)(struct pipe_inode_info *, struct pipe_buffer *); | 115 | void (*release)(struct pipe_inode_info *, struct pipe_buffer *); |
| 116 | |||
| 117 | /* | ||
| 118 | * Attempt to take ownership of the pipe buffer and its contents. | ||
| 119 | * ->steal() returns 0 for success, in which case the contents | ||
| 120 | * of the pipe (the buf->page) is locked and now completely owned | ||
| 121 | * by the caller. The page may then be transferred to a different | ||
| 122 | * mapping, the most often used case is insertion into different | ||
| 123 | * file address space cache. | ||
| 124 | */ | ||
| 52 | int (*steal)(struct pipe_inode_info *, struct pipe_buffer *); | 125 | int (*steal)(struct pipe_inode_info *, struct pipe_buffer *); |
| 126 | |||
| 127 | /* | ||
| 128 | * Get a reference to the pipe buffer. | ||
| 129 | */ | ||
| 53 | void (*get)(struct pipe_inode_info *, struct pipe_buffer *); | 130 | void (*get)(struct pipe_inode_info *, struct pipe_buffer *); |
| 54 | }; | 131 | }; |
| 55 | 132 | ||
| @@ -68,39 +145,7 @@ void __free_pipe_info(struct pipe_inode_info *); | |||
| 68 | void *generic_pipe_buf_map(struct pipe_inode_info *, struct pipe_buffer *, int); | 145 | void *generic_pipe_buf_map(struct pipe_inode_info *, struct pipe_buffer *, int); |
| 69 | void generic_pipe_buf_unmap(struct pipe_inode_info *, struct pipe_buffer *, void *); | 146 | void generic_pipe_buf_unmap(struct pipe_inode_info *, struct pipe_buffer *, void *); |
| 70 | void generic_pipe_buf_get(struct pipe_inode_info *, struct pipe_buffer *); | 147 | void generic_pipe_buf_get(struct pipe_inode_info *, struct pipe_buffer *); |
| 71 | int generic_pipe_buf_pin(struct pipe_inode_info *, struct pipe_buffer *); | 148 | int generic_pipe_buf_confirm(struct pipe_inode_info *, struct pipe_buffer *); |
| 72 | int generic_pipe_buf_steal(struct pipe_inode_info *, struct pipe_buffer *); | 149 | int generic_pipe_buf_steal(struct pipe_inode_info *, struct pipe_buffer *); |
| 73 | 150 | ||
| 74 | /* | ||
| 75 | * splice is tied to pipes as a transport (at least for now), so we'll just | ||
| 76 | * add the splice flags here. | ||
| 77 | */ | ||
| 78 | #define SPLICE_F_MOVE (0x01) /* move pages instead of copying */ | ||
| 79 | #define SPLICE_F_NONBLOCK (0x02) /* don't block on the pipe splicing (but */ | ||
| 80 | /* we may still block on the fd we splice */ | ||
| 81 | /* from/to, of course */ | ||
| 82 | #define SPLICE_F_MORE (0x04) /* expect more data */ | ||
| 83 | #define SPLICE_F_GIFT (0x08) /* pages passed in are a gift */ | ||
| 84 | |||
| 85 | /* | ||
| 86 | * Passed to the actors | ||
| 87 | */ | ||
| 88 | struct splice_desc { | ||
| 89 | unsigned int len, total_len; /* current and remaining length */ | ||
| 90 | unsigned int flags; /* splice flags */ | ||
| 91 | struct file *file; /* file to read/write */ | ||
| 92 | loff_t pos; /* file position */ | ||
| 93 | }; | ||
| 94 | |||
| 95 | typedef int (splice_actor)(struct pipe_inode_info *, struct pipe_buffer *, | ||
| 96 | struct splice_desc *); | ||
| 97 | |||
| 98 | extern ssize_t splice_from_pipe(struct pipe_inode_info *, struct file *, | ||
| 99 | loff_t *, size_t, unsigned int, | ||
| 100 | splice_actor *); | ||
| 101 | |||
| 102 | extern ssize_t __splice_from_pipe(struct pipe_inode_info *, struct file *, | ||
| 103 | loff_t *, size_t, unsigned int, | ||
| 104 | splice_actor *); | ||
| 105 | |||
| 106 | #endif | 151 | #endif |
diff --git a/include/linux/pm.h b/include/linux/pm.h index 87545e0f0b58..b2c4fde4e994 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
| @@ -110,37 +110,67 @@ typedef int __bitwise suspend_state_t; | |||
| 110 | #define PM_SUSPEND_MAX ((__force suspend_state_t) 4) | 110 | #define PM_SUSPEND_MAX ((__force suspend_state_t) 4) |
| 111 | 111 | ||
| 112 | /** | 112 | /** |
| 113 | * struct pm_ops - Callbacks for managing platform dependent suspend states. | 113 | * struct pm_ops - Callbacks for managing platform dependent system sleep |
| 114 | * @valid: Callback to determine whether the given state can be entered. | 114 | * states. |
| 115 | * Valid states are advertised in /sys/power/state but can still | ||
| 116 | * be rejected by prepare or enter if the conditions aren't right. | ||
| 117 | * There is a %pm_valid_only_mem function available that can be assigned | ||
| 118 | * to this if you only implement mem sleep. | ||
| 119 | * | 115 | * |
| 120 | * @prepare: Prepare the platform for the given suspend state. Can return a | 116 | * @valid: Callback to determine if given system sleep state is supported by |
| 121 | * negative error code if necessary. | 117 | * the platform. |
| 118 | * Valid (ie. supported) states are advertised in /sys/power/state. Note | ||
| 119 | * that it still may be impossible to enter given system sleep state if the | ||
| 120 | * conditions aren't right. | ||
| 121 | * There is the %pm_valid_only_mem function available that can be assigned | ||
| 122 | * to this if the platform only supports mem sleep. | ||
| 122 | * | 123 | * |
| 123 | * @enter: Enter the given suspend state, must be assigned. Can return a | 124 | * @set_target: Tell the platform which system sleep state is going to be |
| 124 | * negative error code if necessary. | 125 | * entered. |
| 126 | * @set_target() is executed right prior to suspending devices. The | ||
| 127 | * information conveyed to the platform code by @set_target() should be | ||
| 128 | * disregarded by the platform as soon as @finish() is executed and if | ||
| 129 | * @prepare() fails. If @set_target() fails (ie. returns nonzero), | ||
| 130 | * @prepare(), @enter() and @finish() will not be called by the PM core. | ||
| 131 | * This callback is optional. However, if it is implemented, the argument | ||
| 132 | * passed to @prepare(), @enter() and @finish() is meaningless and should | ||
| 133 | * be ignored. | ||
| 125 | * | 134 | * |
| 126 | * @finish: Called when the system has left the given state and all devices | 135 | * @prepare: Prepare the platform for entering the system sleep state indicated |
| 127 | * are resumed. The return value is ignored. | 136 | * by @set_target() or represented by the argument if @set_target() is not |
| 137 | * implemented. | ||
| 138 | * @prepare() is called right after devices have been suspended (ie. the | ||
| 139 | * appropriate .suspend() method has been executed for each device) and | ||
| 140 | * before the nonboot CPUs are disabled (it is executed with IRQs enabled). | ||
| 141 | * This callback is optional. It returns 0 on success or a negative | ||
| 142 | * error code otherwise, in which case the system cannot enter the desired | ||
| 143 | * sleep state (@enter() and @finish() will not be called in that case). | ||
| 144 | * | ||
| 145 | * @enter: Enter the system sleep state indicated by @set_target() or | ||
| 146 | * represented by the argument if @set_target() is not implemented. | ||
| 147 | * This callback is mandatory. It returns 0 on success or a negative | ||
| 148 | * error code otherwise, in which case the system cannot enter the desired | ||
| 149 | * sleep state. | ||
| 150 | * | ||
| 151 | * @finish: Called when the system has just left a sleep state, right after | ||
| 152 | * the nonboot CPUs have been enabled and before devices are resumed (it is | ||
| 153 | * executed with IRQs enabled). If @set_target() is not implemented, the | ||
| 154 | * argument represents the sleep state being left. | ||
| 155 | * This callback is optional, but should be implemented by the platforms | ||
| 156 | * that implement @prepare(). If implemented, it is always called after | ||
| 157 | * @enter() (even if @enter() fails). | ||
| 128 | */ | 158 | */ |
| 129 | struct pm_ops { | 159 | struct pm_ops { |
| 130 | int (*valid)(suspend_state_t state); | 160 | int (*valid)(suspend_state_t state); |
| 161 | int (*set_target)(suspend_state_t state); | ||
| 131 | int (*prepare)(suspend_state_t state); | 162 | int (*prepare)(suspend_state_t state); |
| 132 | int (*enter)(suspend_state_t state); | 163 | int (*enter)(suspend_state_t state); |
| 133 | int (*finish)(suspend_state_t state); | 164 | int (*finish)(suspend_state_t state); |
| 134 | }; | 165 | }; |
| 135 | 166 | ||
| 167 | extern struct pm_ops *pm_ops; | ||
| 168 | |||
| 136 | /** | 169 | /** |
| 137 | * pm_set_ops - set platform dependent power management ops | 170 | * pm_set_ops - set platform dependent power management ops |
| 138 | * @pm_ops: The new power management operations to set. | 171 | * @pm_ops: The new power management operations to set. |
| 139 | */ | 172 | */ |
| 140 | extern void pm_set_ops(struct pm_ops *pm_ops); | 173 | extern void pm_set_ops(struct pm_ops *pm_ops); |
| 141 | extern struct pm_ops *pm_ops; | ||
| 142 | extern int pm_suspend(suspend_state_t state); | ||
| 143 | |||
| 144 | extern int pm_valid_only_mem(suspend_state_t state); | 174 | extern int pm_valid_only_mem(suspend_state_t state); |
| 145 | 175 | ||
| 146 | /** | 176 | /** |
| @@ -161,6 +191,8 @@ extern void arch_suspend_disable_irqs(void); | |||
| 161 | */ | 191 | */ |
| 162 | extern void arch_suspend_enable_irqs(void); | 192 | extern void arch_suspend_enable_irqs(void); |
| 163 | 193 | ||
| 194 | extern int pm_suspend(suspend_state_t state); | ||
| 195 | |||
| 164 | /* | 196 | /* |
| 165 | * Device power management | 197 | * Device power management |
| 166 | */ | 198 | */ |
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h new file mode 100644 index 000000000000..606c0957997f --- /dev/null +++ b/include/linux/power_supply.h | |||
| @@ -0,0 +1,180 @@ | |||
| 1 | /* | ||
| 2 | * Universal power supply monitor class | ||
| 3 | * | ||
| 4 | * Copyright © 2007 Anton Vorontsov <cbou@mail.ru> | ||
| 5 | * Copyright © 2004 Szabolcs Gyurko | ||
| 6 | * Copyright © 2003 Ian Molton <spyro@f2s.com> | ||
| 7 | * | ||
| 8 | * Modified: 2004, Oct Szabolcs Gyurko | ||
| 9 | * | ||
| 10 | * You may use this code as per GPL version 2 | ||
| 11 | */ | ||
| 12 | |||
| 13 | #ifndef __LINUX_POWER_SUPPLY_H__ | ||
| 14 | #define __LINUX_POWER_SUPPLY_H__ | ||
| 15 | |||
| 16 | #include <linux/device.h> | ||
| 17 | #include <linux/workqueue.h> | ||
| 18 | #include <linux/leds.h> | ||
| 19 | |||
| 20 | /* | ||
| 21 | * All voltages, currents, charges, energies, time and temperatures in uV, | ||
| 22 | * µA, µAh, µWh, seconds and tenths of degree Celsius unless otherwise | ||
| 23 | * stated. It's driver's job to convert its raw values to units in which | ||
| 24 | * this class operates. | ||
| 25 | */ | ||
| 26 | |||
| 27 | /* | ||
| 28 | * For systems where the charger determines the maximum battery capacity | ||
| 29 | * the min and max fields should be used to present these values to user | ||
| 30 | * space. Unused/unknown fields will not appear in sysfs. | ||
| 31 | */ | ||
| 32 | |||
| 33 | enum { | ||
| 34 | POWER_SUPPLY_STATUS_UNKNOWN = 0, | ||
| 35 | POWER_SUPPLY_STATUS_CHARGING, | ||
| 36 | POWER_SUPPLY_STATUS_DISCHARGING, | ||
| 37 | POWER_SUPPLY_STATUS_NOT_CHARGING, | ||
| 38 | POWER_SUPPLY_STATUS_FULL, | ||
| 39 | }; | ||
| 40 | |||
| 41 | enum { | ||
| 42 | POWER_SUPPLY_HEALTH_UNKNOWN = 0, | ||
| 43 | POWER_SUPPLY_HEALTH_GOOD, | ||
| 44 | POWER_SUPPLY_HEALTH_OVERHEAT, | ||
| 45 | POWER_SUPPLY_HEALTH_DEAD, | ||
| 46 | POWER_SUPPLY_HEALTH_OVERVOLTAGE, | ||
| 47 | POWER_SUPPLY_HEALTH_UNSPEC_FAILURE, | ||
| 48 | }; | ||
| 49 | |||
| 50 | enum { | ||
| 51 | POWER_SUPPLY_TECHNOLOGY_UNKNOWN = 0, | ||
| 52 | POWER_SUPPLY_TECHNOLOGY_NiMH, | ||
| 53 | POWER_SUPPLY_TECHNOLOGY_LION, | ||
| 54 | POWER_SUPPLY_TECHNOLOGY_LIPO, | ||
| 55 | POWER_SUPPLY_TECHNOLOGY_LiFe, | ||
| 56 | POWER_SUPPLY_TECHNOLOGY_NiCd, | ||
| 57 | }; | ||
| 58 | |||
| 59 | enum { | ||
| 60 | POWER_SUPPLY_CAPACITY_LEVEL_UNKNOWN = 0, | ||
| 61 | POWER_SUPPLY_CAPACITY_LEVEL_CRITICAL, | ||
| 62 | POWER_SUPPLY_CAPACITY_LEVEL_LOW, | ||
| 63 | POWER_SUPPLY_CAPACITY_LEVEL_NORMAL, | ||
| 64 | POWER_SUPPLY_CAPACITY_LEVEL_HIGH, | ||
| 65 | POWER_SUPPLY_CAPACITY_LEVEL_FULL, | ||
| 66 | }; | ||
| 67 | |||
| 68 | enum power_supply_property { | ||
| 69 | /* Properties of type `int' */ | ||
| 70 | POWER_SUPPLY_PROP_STATUS = 0, | ||
| 71 | POWER_SUPPLY_PROP_HEALTH, | ||
| 72 | POWER_SUPPLY_PROP_PRESENT, | ||
| 73 | POWER_SUPPLY_PROP_ONLINE, | ||
| 74 | POWER_SUPPLY_PROP_TECHNOLOGY, | ||
| 75 | POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN, | ||
| 76 | POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN, | ||
| 77 | POWER_SUPPLY_PROP_VOLTAGE_NOW, | ||
| 78 | POWER_SUPPLY_PROP_VOLTAGE_AVG, | ||
| 79 | POWER_SUPPLY_PROP_CURRENT_NOW, | ||
| 80 | POWER_SUPPLY_PROP_CURRENT_AVG, | ||
| 81 | POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN, | ||
| 82 | POWER_SUPPLY_PROP_CHARGE_EMPTY_DESIGN, | ||
| 83 | POWER_SUPPLY_PROP_CHARGE_FULL, | ||
| 84 | POWER_SUPPLY_PROP_CHARGE_EMPTY, | ||
| 85 | POWER_SUPPLY_PROP_CHARGE_NOW, | ||
| 86 | POWER_SUPPLY_PROP_CHARGE_AVG, | ||
| 87 | POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN, | ||
| 88 | POWER_SUPPLY_PROP_ENERGY_EMPTY_DESIGN, | ||
| 89 | POWER_SUPPLY_PROP_ENERGY_FULL, | ||
| 90 | POWER_SUPPLY_PROP_ENERGY_EMPTY, | ||
| 91 | POWER_SUPPLY_PROP_ENERGY_NOW, | ||
| 92 | POWER_SUPPLY_PROP_ENERGY_AVG, | ||
| 93 | POWER_SUPPLY_PROP_CAPACITY, /* in percents! */ | ||
| 94 | POWER_SUPPLY_PROP_CAPACITY_LEVEL, | ||
| 95 | POWER_SUPPLY_PROP_TEMP, | ||
| 96 | POWER_SUPPLY_PROP_TEMP_AMBIENT, | ||
| 97 | POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW, | ||
| 98 | POWER_SUPPLY_PROP_TIME_TO_EMPTY_AVG, | ||
| 99 | POWER_SUPPLY_PROP_TIME_TO_FULL_NOW, | ||
| 100 | POWER_SUPPLY_PROP_TIME_TO_FULL_AVG, | ||
| 101 | /* Properties of type `const char *' */ | ||
| 102 | POWER_SUPPLY_PROP_MODEL_NAME, | ||
| 103 | POWER_SUPPLY_PROP_MANUFACTURER, | ||
| 104 | }; | ||
| 105 | |||
| 106 | enum power_supply_type { | ||
| 107 | POWER_SUPPLY_TYPE_BATTERY = 0, | ||
| 108 | POWER_SUPPLY_TYPE_UPS, | ||
| 109 | POWER_SUPPLY_TYPE_MAINS, | ||
| 110 | POWER_SUPPLY_TYPE_USB, | ||
| 111 | }; | ||
| 112 | |||
| 113 | union power_supply_propval { | ||
| 114 | int intval; | ||
| 115 | const char *strval; | ||
| 116 | }; | ||
| 117 | |||
| 118 | struct power_supply { | ||
| 119 | const char *name; | ||
| 120 | enum power_supply_type type; | ||
| 121 | enum power_supply_property *properties; | ||
| 122 | size_t num_properties; | ||
| 123 | |||
| 124 | char **supplied_to; | ||
| 125 | size_t num_supplicants; | ||
| 126 | |||
| 127 | int (*get_property)(struct power_supply *psy, | ||
| 128 | enum power_supply_property psp, | ||
| 129 | union power_supply_propval *val); | ||
| 130 | void (*external_power_changed)(struct power_supply *psy); | ||
| 131 | |||
| 132 | /* For APM emulation, think legacy userspace. */ | ||
| 133 | int use_for_apm; | ||
| 134 | |||
| 135 | /* private */ | ||
| 136 | struct device *dev; | ||
| 137 | struct work_struct changed_work; | ||
| 138 | |||
| 139 | #ifdef CONFIG_LEDS_TRIGGERS | ||
| 140 | struct led_trigger *charging_full_trig; | ||
| 141 | char *charging_full_trig_name; | ||
| 142 | struct led_trigger *charging_trig; | ||
| 143 | char *charging_trig_name; | ||
| 144 | struct led_trigger *full_trig; | ||
| 145 | char *full_trig_name; | ||
| 146 | struct led_trigger *online_trig; | ||
| 147 | char *online_trig_name; | ||
| 148 | #endif | ||
| 149 | }; | ||
| 150 | |||
| 151 | /* | ||
| 152 | * This is recommended structure to specify static power supply parameters. | ||
| 153 | * Generic one, parametrizable for different power supplies. Power supply | ||
| 154 | * class itself does not use it, but that's what implementing most platform | ||
| 155 | * drivers, should try reuse for consistency. | ||
| 156 | */ | ||
| 157 | |||
| 158 | struct power_supply_info { | ||
| 159 | const char *name; | ||
| 160 | int technology; | ||
| 161 | int voltage_max_design; | ||
| 162 | int voltage_min_design; | ||
| 163 | int charge_full_design; | ||
| 164 | int charge_empty_design; | ||
| 165 | int energy_full_design; | ||
| 166 | int energy_empty_design; | ||
| 167 | int use_for_apm; | ||
| 168 | }; | ||
| 169 | |||
| 170 | extern void power_supply_changed(struct power_supply *psy); | ||
| 171 | extern int power_supply_am_i_supplied(struct power_supply *psy); | ||
| 172 | |||
| 173 | extern int power_supply_register(struct device *parent, | ||
| 174 | struct power_supply *psy); | ||
| 175 | extern void power_supply_unregister(struct power_supply *psy); | ||
| 176 | |||
| 177 | /* For APM emulation, think legacy userspace. */ | ||
| 178 | extern struct class *power_supply_class; | ||
| 179 | |||
| 180 | #endif /* __LINUX_POWER_SUPPLY_H__ */ | ||
diff --git a/include/linux/sched.h b/include/linux/sched.h index 693f0e6c54d4..cfb680585ab8 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -34,6 +34,8 @@ | |||
| 34 | #define SCHED_FIFO 1 | 34 | #define SCHED_FIFO 1 |
| 35 | #define SCHED_RR 2 | 35 | #define SCHED_RR 2 |
| 36 | #define SCHED_BATCH 3 | 36 | #define SCHED_BATCH 3 |
| 37 | /* SCHED_ISO: reserved but not implemented yet */ | ||
| 38 | #define SCHED_IDLE 5 | ||
| 37 | 39 | ||
| 38 | #ifdef __KERNEL__ | 40 | #ifdef __KERNEL__ |
| 39 | 41 | ||
| @@ -130,6 +132,26 @@ extern unsigned long nr_active(void); | |||
| 130 | extern unsigned long nr_iowait(void); | 132 | extern unsigned long nr_iowait(void); |
| 131 | extern unsigned long weighted_cpuload(const int cpu); | 133 | extern unsigned long weighted_cpuload(const int cpu); |
| 132 | 134 | ||
| 135 | struct seq_file; | ||
| 136 | struct cfs_rq; | ||
| 137 | #ifdef CONFIG_SCHED_DEBUG | ||
| 138 | extern void proc_sched_show_task(struct task_struct *p, struct seq_file *m); | ||
| 139 | extern void proc_sched_set_task(struct task_struct *p); | ||
| 140 | extern void | ||
| 141 | print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq, u64 now); | ||
| 142 | #else | ||
| 143 | static inline void | ||
| 144 | proc_sched_show_task(struct task_struct *p, struct seq_file *m) | ||
| 145 | { | ||
| 146 | } | ||
| 147 | static inline void proc_sched_set_task(struct task_struct *p) | ||
| 148 | { | ||
| 149 | } | ||
| 150 | static inline void | ||
| 151 | print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq, u64 now) | ||
| 152 | { | ||
| 153 | } | ||
| 154 | #endif | ||
| 133 | 155 | ||
| 134 | /* | 156 | /* |
| 135 | * Task state bitmask. NOTE! These bits are also | 157 | * Task state bitmask. NOTE! These bits are also |
| @@ -193,6 +215,7 @@ struct task_struct; | |||
| 193 | extern void sched_init(void); | 215 | extern void sched_init(void); |
| 194 | extern void sched_init_smp(void); | 216 | extern void sched_init_smp(void); |
| 195 | extern void init_idle(struct task_struct *idle, int cpu); | 217 | extern void init_idle(struct task_struct *idle, int cpu); |
| 218 | extern void init_idle_bootup_task(struct task_struct *idle); | ||
| 196 | 219 | ||
| 197 | extern cpumask_t nohz_cpu_mask; | 220 | extern cpumask_t nohz_cpu_mask; |
| 198 | #if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ) | 221 | #if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ) |
| @@ -479,7 +502,7 @@ struct signal_struct { | |||
| 479 | * from jiffies_to_ns(utime + stime) if sched_clock uses something | 502 | * from jiffies_to_ns(utime + stime) if sched_clock uses something |
| 480 | * other than jiffies.) | 503 | * other than jiffies.) |
| 481 | */ | 504 | */ |
| 482 | unsigned long long sched_time; | 505 | unsigned long long sum_sched_runtime; |
| 483 | 506 | ||
| 484 | /* | 507 | /* |
| 485 | * We don't bother to synchronize most readers of this at all, | 508 | * We don't bother to synchronize most readers of this at all, |
| @@ -521,31 +544,6 @@ struct signal_struct { | |||
| 521 | #define SIGNAL_STOP_CONTINUED 0x00000004 /* SIGCONT since WCONTINUED reap */ | 544 | #define SIGNAL_STOP_CONTINUED 0x00000004 /* SIGCONT since WCONTINUED reap */ |
| 522 | #define SIGNAL_GROUP_EXIT 0x00000008 /* group exit in progress */ | 545 | #define SIGNAL_GROUP_EXIT 0x00000008 /* group exit in progress */ |
| 523 | 546 | ||
| 524 | |||
| 525 | /* | ||
| 526 | * Priority of a process goes from 0..MAX_PRIO-1, valid RT | ||
| 527 | * priority is 0..MAX_RT_PRIO-1, and SCHED_NORMAL/SCHED_BATCH | ||
| 528 | * tasks are in the range MAX_RT_PRIO..MAX_PRIO-1. Priority | ||
| 529 | * values are inverted: lower p->prio value means higher priority. | ||
| 530 | * | ||
| 531 | * The MAX_USER_RT_PRIO value allows the actual maximum | ||
| 532 | * RT priority to be separate from the value exported to | ||
| 533 | * user-space. This allows kernel threads to set their | ||
| 534 | * priority to a value higher than any user task. Note: | ||
| 535 | * MAX_RT_PRIO must not be smaller than MAX_USER_RT_PRIO. | ||
| 536 | */ | ||
| 537 | |||
| 538 | #define MAX_USER_RT_PRIO 100 | ||
| 539 | #define MAX_RT_PRIO MAX_USER_RT_PRIO | ||
| 540 | |||
| 541 | #define MAX_PRIO (MAX_RT_PRIO + 40) | ||
| 542 | |||
| 543 | #define rt_prio(prio) unlikely((prio) < MAX_RT_PRIO) | ||
| 544 | #define rt_task(p) rt_prio((p)->prio) | ||
| 545 | #define batch_task(p) (unlikely((p)->policy == SCHED_BATCH)) | ||
| 546 | #define is_rt_policy(p) ((p) != SCHED_NORMAL && (p) != SCHED_BATCH) | ||
| 547 | #define has_rt_policy(p) unlikely(is_rt_policy((p)->policy)) | ||
| 548 | |||
| 549 | /* | 547 | /* |
| 550 | * Some day this will be a full-fledged user tracking system.. | 548 | * Some day this will be a full-fledged user tracking system.. |
| 551 | */ | 549 | */ |
| @@ -583,13 +581,13 @@ struct reclaim_state; | |||
| 583 | #if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) | 581 | #if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) |
| 584 | struct sched_info { | 582 | struct sched_info { |
| 585 | /* cumulative counters */ | 583 | /* cumulative counters */ |
| 586 | unsigned long cpu_time, /* time spent on the cpu */ | 584 | unsigned long pcnt; /* # of times run on this cpu */ |
| 587 | run_delay, /* time spent waiting on a runqueue */ | 585 | unsigned long long cpu_time, /* time spent on the cpu */ |
| 588 | pcnt; /* # of timeslices run on this cpu */ | 586 | run_delay; /* time spent waiting on a runqueue */ |
| 589 | 587 | ||
| 590 | /* timestamps */ | 588 | /* timestamps */ |
| 591 | unsigned long last_arrival, /* when we last ran on a cpu */ | 589 | unsigned long long last_arrival,/* when we last ran on a cpu */ |
| 592 | last_queued; /* when we were last queued to run */ | 590 | last_queued; /* when we were last queued to run */ |
| 593 | }; | 591 | }; |
| 594 | #endif /* defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) */ | 592 | #endif /* defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) */ |
| 595 | 593 | ||
| @@ -639,18 +637,24 @@ static inline int sched_info_on(void) | |||
| 639 | #endif | 637 | #endif |
| 640 | } | 638 | } |
| 641 | 639 | ||
| 642 | enum idle_type | 640 | enum cpu_idle_type { |
| 643 | { | 641 | CPU_IDLE, |
| 644 | SCHED_IDLE, | 642 | CPU_NOT_IDLE, |
| 645 | NOT_IDLE, | 643 | CPU_NEWLY_IDLE, |
| 646 | NEWLY_IDLE, | 644 | CPU_MAX_IDLE_TYPES |
| 647 | MAX_IDLE_TYPES | ||
| 648 | }; | 645 | }; |
| 649 | 646 | ||
| 650 | /* | 647 | /* |
| 651 | * sched-domains (multiprocessor balancing) declarations: | 648 | * sched-domains (multiprocessor balancing) declarations: |
| 652 | */ | 649 | */ |
| 653 | #define SCHED_LOAD_SCALE 128UL /* increase resolution of load */ | 650 | |
| 651 | /* | ||
| 652 | * Increase resolution of nice-level calculations: | ||
| 653 | */ | ||
| 654 | #define SCHED_LOAD_SHIFT 10 | ||
| 655 | #define SCHED_LOAD_SCALE (1L << SCHED_LOAD_SHIFT) | ||
| 656 | |||
| 657 | #define SCHED_LOAD_SCALE_FUZZ (SCHED_LOAD_SCALE >> 5) | ||
| 654 | 658 | ||
| 655 | #ifdef CONFIG_SMP | 659 | #ifdef CONFIG_SMP |
| 656 | #define SD_LOAD_BALANCE 1 /* Do load balancing on this domain. */ | 660 | #define SD_LOAD_BALANCE 1 /* Do load balancing on this domain. */ |
| @@ -719,14 +723,14 @@ struct sched_domain { | |||
| 719 | 723 | ||
| 720 | #ifdef CONFIG_SCHEDSTATS | 724 | #ifdef CONFIG_SCHEDSTATS |
| 721 | /* load_balance() stats */ | 725 | /* load_balance() stats */ |
| 722 | unsigned long lb_cnt[MAX_IDLE_TYPES]; | 726 | unsigned long lb_cnt[CPU_MAX_IDLE_TYPES]; |
| 723 | unsigned long lb_failed[MAX_IDLE_TYPES]; | 727 | unsigned long lb_failed[CPU_MAX_IDLE_TYPES]; |
| 724 | unsigned long lb_balanced[MAX_IDLE_TYPES]; | 728 | unsigned long lb_balanced[CPU_MAX_IDLE_TYPES]; |
| 725 | unsigned long lb_imbalance[MAX_IDLE_TYPES]; | 729 | unsigned long lb_imbalance[CPU_MAX_IDLE_TYPES]; |
| 726 | unsigned long lb_gained[MAX_IDLE_TYPES]; | 730 | unsigned long lb_gained[CPU_MAX_IDLE_TYPES]; |
| 727 | unsigned long lb_hot_gained[MAX_IDLE_TYPES]; | 731 | unsigned long lb_hot_gained[CPU_MAX_IDLE_TYPES]; |
| 728 | unsigned long lb_nobusyg[MAX_IDLE_TYPES]; | 732 | unsigned long lb_nobusyg[CPU_MAX_IDLE_TYPES]; |
| 729 | unsigned long lb_nobusyq[MAX_IDLE_TYPES]; | 733 | unsigned long lb_nobusyq[CPU_MAX_IDLE_TYPES]; |
| 730 | 734 | ||
| 731 | /* Active load balancing */ | 735 | /* Active load balancing */ |
| 732 | unsigned long alb_cnt; | 736 | unsigned long alb_cnt; |
| @@ -753,12 +757,6 @@ struct sched_domain { | |||
| 753 | extern int partition_sched_domains(cpumask_t *partition1, | 757 | extern int partition_sched_domains(cpumask_t *partition1, |
| 754 | cpumask_t *partition2); | 758 | cpumask_t *partition2); |
| 755 | 759 | ||
| 756 | /* | ||
| 757 | * Maximum cache size the migration-costs auto-tuning code will | ||
| 758 | * search from: | ||
| 759 | */ | ||
| 760 | extern unsigned int max_cache_size; | ||
| 761 | |||
| 762 | #endif /* CONFIG_SMP */ | 760 | #endif /* CONFIG_SMP */ |
| 763 | 761 | ||
| 764 | 762 | ||
| @@ -809,14 +807,86 @@ struct mempolicy; | |||
| 809 | struct pipe_inode_info; | 807 | struct pipe_inode_info; |
| 810 | struct uts_namespace; | 808 | struct uts_namespace; |
| 811 | 809 | ||
| 812 | enum sleep_type { | 810 | struct rq; |
| 813 | SLEEP_NORMAL, | 811 | struct sched_domain; |
| 814 | SLEEP_NONINTERACTIVE, | 812 | |
| 815 | SLEEP_INTERACTIVE, | 813 | struct sched_class { |
| 816 | SLEEP_INTERRUPTED, | 814 | struct sched_class *next; |
| 815 | |||
| 816 | void (*enqueue_task) (struct rq *rq, struct task_struct *p, | ||
| 817 | int wakeup, u64 now); | ||
| 818 | void (*dequeue_task) (struct rq *rq, struct task_struct *p, | ||
| 819 | int sleep, u64 now); | ||
| 820 | void (*yield_task) (struct rq *rq, struct task_struct *p); | ||
| 821 | |||
| 822 | void (*check_preempt_curr) (struct rq *rq, struct task_struct *p); | ||
| 823 | |||
| 824 | struct task_struct * (*pick_next_task) (struct rq *rq, u64 now); | ||
| 825 | void (*put_prev_task) (struct rq *rq, struct task_struct *p, u64 now); | ||
| 826 | |||
| 827 | int (*load_balance) (struct rq *this_rq, int this_cpu, | ||
| 828 | struct rq *busiest, | ||
| 829 | unsigned long max_nr_move, unsigned long max_load_move, | ||
| 830 | struct sched_domain *sd, enum cpu_idle_type idle, | ||
| 831 | int *all_pinned, unsigned long *total_load_moved); | ||
| 832 | |||
| 833 | void (*set_curr_task) (struct rq *rq); | ||
| 834 | void (*task_tick) (struct rq *rq, struct task_struct *p); | ||
| 835 | void (*task_new) (struct rq *rq, struct task_struct *p); | ||
| 817 | }; | 836 | }; |
| 818 | 837 | ||
| 819 | struct prio_array; | 838 | struct load_weight { |
| 839 | unsigned long weight, inv_weight; | ||
| 840 | }; | ||
| 841 | |||
| 842 | /* | ||
| 843 | * CFS stats for a schedulable entity (task, task-group etc) | ||
| 844 | * | ||
| 845 | * Current field usage histogram: | ||
| 846 | * | ||
| 847 | * 4 se->block_start | ||
| 848 | * 4 se->run_node | ||
| 849 | * 4 se->sleep_start | ||
| 850 | * 4 se->sleep_start_fair | ||
| 851 | * 6 se->load.weight | ||
| 852 | * 7 se->delta_fair | ||
| 853 | * 15 se->wait_runtime | ||
| 854 | */ | ||
| 855 | struct sched_entity { | ||
| 856 | long wait_runtime; | ||
| 857 | unsigned long delta_fair_run; | ||
| 858 | unsigned long delta_fair_sleep; | ||
| 859 | unsigned long delta_exec; | ||
| 860 | s64 fair_key; | ||
| 861 | struct load_weight load; /* for load-balancing */ | ||
| 862 | struct rb_node run_node; | ||
| 863 | unsigned int on_rq; | ||
| 864 | |||
| 865 | u64 wait_start_fair; | ||
| 866 | u64 wait_start; | ||
| 867 | u64 exec_start; | ||
| 868 | u64 sleep_start; | ||
| 869 | u64 sleep_start_fair; | ||
| 870 | u64 block_start; | ||
| 871 | u64 sleep_max; | ||
| 872 | u64 block_max; | ||
| 873 | u64 exec_max; | ||
| 874 | u64 wait_max; | ||
| 875 | u64 last_ran; | ||
| 876 | |||
| 877 | u64 sum_exec_runtime; | ||
| 878 | s64 sum_wait_runtime; | ||
| 879 | s64 sum_sleep_runtime; | ||
| 880 | unsigned long wait_runtime_overruns; | ||
| 881 | unsigned long wait_runtime_underruns; | ||
| 882 | #ifdef CONFIG_FAIR_GROUP_SCHED | ||
| 883 | struct sched_entity *parent; | ||
| 884 | /* rq on which this entity is (to be) queued: */ | ||
| 885 | struct cfs_rq *cfs_rq; | ||
| 886 | /* rq "owned" by this entity/group: */ | ||
| 887 | struct cfs_rq *my_q; | ||
| 888 | #endif | ||
| 889 | }; | ||
| 820 | 890 | ||
| 821 | struct task_struct { | 891 | struct task_struct { |
| 822 | volatile long state; /* -1 unrunnable, 0 runnable, >0 stopped */ | 892 | volatile long state; /* -1 unrunnable, 0 runnable, >0 stopped */ |
| @@ -832,23 +902,20 @@ struct task_struct { | |||
| 832 | int oncpu; | 902 | int oncpu; |
| 833 | #endif | 903 | #endif |
| 834 | #endif | 904 | #endif |
| 835 | int load_weight; /* for niceness load balancing purposes */ | 905 | |
| 836 | int prio, static_prio, normal_prio; | 906 | int prio, static_prio, normal_prio; |
| 837 | struct list_head run_list; | 907 | struct list_head run_list; |
| 838 | struct prio_array *array; | 908 | struct sched_class *sched_class; |
| 909 | struct sched_entity se; | ||
| 839 | 910 | ||
| 840 | unsigned short ioprio; | 911 | unsigned short ioprio; |
| 841 | #ifdef CONFIG_BLK_DEV_IO_TRACE | 912 | #ifdef CONFIG_BLK_DEV_IO_TRACE |
| 842 | unsigned int btrace_seq; | 913 | unsigned int btrace_seq; |
| 843 | #endif | 914 | #endif |
| 844 | unsigned long sleep_avg; | ||
| 845 | unsigned long long timestamp, last_ran; | ||
| 846 | unsigned long long sched_time; /* sched_clock time spent running */ | ||
| 847 | enum sleep_type sleep_type; | ||
| 848 | 915 | ||
| 849 | unsigned int policy; | 916 | unsigned int policy; |
| 850 | cpumask_t cpus_allowed; | 917 | cpumask_t cpus_allowed; |
| 851 | unsigned int time_slice, first_time_slice; | 918 | unsigned int time_slice; |
| 852 | 919 | ||
| 853 | #if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) | 920 | #if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) |
| 854 | struct sched_info sched_info; | 921 | struct sched_info sched_info; |
| @@ -1078,6 +1145,37 @@ struct task_struct { | |||
| 1078 | #endif | 1145 | #endif |
| 1079 | }; | 1146 | }; |
| 1080 | 1147 | ||
| 1148 | /* | ||
| 1149 | * Priority of a process goes from 0..MAX_PRIO-1, valid RT | ||
| 1150 | * priority is 0..MAX_RT_PRIO-1, and SCHED_NORMAL/SCHED_BATCH | ||
| 1151 | * tasks are in the range MAX_RT_PRIO..MAX_PRIO-1. Priority | ||
| 1152 | * values are inverted: lower p->prio value means higher priority. | ||
| 1153 | * | ||
| 1154 | * The MAX_USER_RT_PRIO value allows the actual maximum | ||
| 1155 | * RT priority to be separate from the value exported to | ||
| 1156 | * user-space. This allows kernel threads to set their | ||
| 1157 | * priority to a value higher than any user task. Note: | ||
| 1158 | * MAX_RT_PRIO must not be smaller than MAX_USER_RT_PRIO. | ||
| 1159 | */ | ||
| 1160 | |||
| 1161 | #define MAX_USER_RT_PRIO 100 | ||
| 1162 | #define MAX_RT_PRIO MAX_USER_RT_PRIO | ||
| 1163 | |||
| 1164 | #define MAX_PRIO (MAX_RT_PRIO + 40) | ||
| 1165 | #define DEFAULT_PRIO (MAX_RT_PRIO + 20) | ||
| 1166 | |||
| 1167 | static inline int rt_prio(int prio) | ||
| 1168 | { | ||
| 1169 | if (unlikely(prio < MAX_RT_PRIO)) | ||
| 1170 | return 1; | ||
| 1171 | return 0; | ||
| 1172 | } | ||
| 1173 | |||
| 1174 | static inline int rt_task(struct task_struct *p) | ||
| 1175 | { | ||
| 1176 | return rt_prio(p->prio); | ||
| 1177 | } | ||
| 1178 | |||
| 1081 | static inline pid_t process_group(struct task_struct *tsk) | 1179 | static inline pid_t process_group(struct task_struct *tsk) |
| 1082 | { | 1180 | { |
| 1083 | return tsk->signal->pgrp; | 1181 | return tsk->signal->pgrp; |
| @@ -1223,7 +1321,7 @@ static inline int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask) | |||
| 1223 | 1321 | ||
| 1224 | extern unsigned long long sched_clock(void); | 1322 | extern unsigned long long sched_clock(void); |
| 1225 | extern unsigned long long | 1323 | extern unsigned long long |
| 1226 | current_sched_time(const struct task_struct *current_task); | 1324 | task_sched_runtime(struct task_struct *task); |
| 1227 | 1325 | ||
| 1228 | /* sched_exec is called by processes performing an exec */ | 1326 | /* sched_exec is called by processes performing an exec */ |
| 1229 | #ifdef CONFIG_SMP | 1327 | #ifdef CONFIG_SMP |
| @@ -1232,6 +1330,8 @@ extern void sched_exec(void); | |||
| 1232 | #define sched_exec() {} | 1330 | #define sched_exec() {} |
| 1233 | #endif | 1331 | #endif |
| 1234 | 1332 | ||
| 1333 | extern void sched_clock_unstable_event(void); | ||
| 1334 | |||
| 1235 | #ifdef CONFIG_HOTPLUG_CPU | 1335 | #ifdef CONFIG_HOTPLUG_CPU |
| 1236 | extern void idle_task_exit(void); | 1336 | extern void idle_task_exit(void); |
| 1237 | #else | 1337 | #else |
| @@ -1240,6 +1340,14 @@ static inline void idle_task_exit(void) {} | |||
| 1240 | 1340 | ||
| 1241 | extern void sched_idle_next(void); | 1341 | extern void sched_idle_next(void); |
| 1242 | 1342 | ||
| 1343 | extern unsigned int sysctl_sched_granularity; | ||
| 1344 | extern unsigned int sysctl_sched_wakeup_granularity; | ||
| 1345 | extern unsigned int sysctl_sched_batch_wakeup_granularity; | ||
| 1346 | extern unsigned int sysctl_sched_stat_granularity; | ||
| 1347 | extern unsigned int sysctl_sched_runtime_limit; | ||
| 1348 | extern unsigned int sysctl_sched_child_runs_first; | ||
| 1349 | extern unsigned int sysctl_sched_features; | ||
| 1350 | |||
| 1243 | #ifdef CONFIG_RT_MUTEXES | 1351 | #ifdef CONFIG_RT_MUTEXES |
| 1244 | extern int rt_mutex_getprio(struct task_struct *p); | 1352 | extern int rt_mutex_getprio(struct task_struct *p); |
| 1245 | extern void rt_mutex_setprio(struct task_struct *p, int prio); | 1353 | extern void rt_mutex_setprio(struct task_struct *p, int prio); |
| @@ -1317,8 +1425,8 @@ extern void FASTCALL(wake_up_new_task(struct task_struct * tsk, | |||
| 1317 | #else | 1425 | #else |
| 1318 | static inline void kick_process(struct task_struct *tsk) { } | 1426 | static inline void kick_process(struct task_struct *tsk) { } |
| 1319 | #endif | 1427 | #endif |
| 1320 | extern void FASTCALL(sched_fork(struct task_struct * p, int clone_flags)); | 1428 | extern void sched_fork(struct task_struct *p, int clone_flags); |
| 1321 | extern void FASTCALL(sched_exit(struct task_struct * p)); | 1429 | extern void sched_dead(struct task_struct *p); |
| 1322 | 1430 | ||
| 1323 | extern int in_group_p(gid_t); | 1431 | extern int in_group_p(gid_t); |
| 1324 | extern int in_egroup_p(gid_t); | 1432 | extern int in_egroup_p(gid_t); |
| @@ -1406,7 +1514,7 @@ extern struct mm_struct * mm_alloc(void); | |||
| 1406 | extern void FASTCALL(__mmdrop(struct mm_struct *)); | 1514 | extern void FASTCALL(__mmdrop(struct mm_struct *)); |
| 1407 | static inline void mmdrop(struct mm_struct * mm) | 1515 | static inline void mmdrop(struct mm_struct * mm) |
| 1408 | { | 1516 | { |
| 1409 | if (atomic_dec_and_test(&mm->mm_count)) | 1517 | if (unlikely(atomic_dec_and_test(&mm->mm_count))) |
| 1410 | __mmdrop(mm); | 1518 | __mmdrop(mm); |
| 1411 | } | 1519 | } |
| 1412 | 1520 | ||
| @@ -1638,10 +1746,7 @@ static inline unsigned int task_cpu(const struct task_struct *p) | |||
| 1638 | return task_thread_info(p)->cpu; | 1746 | return task_thread_info(p)->cpu; |
| 1639 | } | 1747 | } |
| 1640 | 1748 | ||
| 1641 | static inline void set_task_cpu(struct task_struct *p, unsigned int cpu) | 1749 | extern void set_task_cpu(struct task_struct *p, unsigned int cpu); |
| 1642 | { | ||
| 1643 | task_thread_info(p)->cpu = cpu; | ||
| 1644 | } | ||
| 1645 | 1750 | ||
| 1646 | #else | 1751 | #else |
| 1647 | 1752 | ||
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h index 3e3cccbb1cac..83783ab0f552 100644 --- a/include/linux/seq_file.h +++ b/include/linux/seq_file.h | |||
| @@ -50,5 +50,16 @@ int seq_release_private(struct inode *, struct file *); | |||
| 50 | 50 | ||
| 51 | #define SEQ_START_TOKEN ((void *)1) | 51 | #define SEQ_START_TOKEN ((void *)1) |
| 52 | 52 | ||
| 53 | /* | ||
| 54 | * Helpers for iteration over list_head-s in seq_files | ||
| 55 | */ | ||
| 56 | |||
| 57 | extern struct list_head *seq_list_start(struct list_head *head, | ||
| 58 | loff_t pos); | ||
| 59 | extern struct list_head *seq_list_start_head(struct list_head *head, | ||
| 60 | loff_t pos); | ||
| 61 | extern struct list_head *seq_list_next(void *v, struct list_head *head, | ||
| 62 | loff_t *ppos); | ||
| 63 | |||
| 53 | #endif | 64 | #endif |
| 54 | #endif | 65 | #endif |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index e7367c74e1bb..6f0b2f7d0010 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
| @@ -1579,6 +1579,10 @@ static inline ktime_t net_timedelta(ktime_t t) | |||
| 1579 | return ktime_sub(ktime_get_real(), t); | 1579 | return ktime_sub(ktime_get_real(), t); |
| 1580 | } | 1580 | } |
| 1581 | 1581 | ||
| 1582 | static inline ktime_t net_invalid_timestamp(void) | ||
| 1583 | { | ||
| 1584 | return ktime_set(0, 0); | ||
| 1585 | } | ||
| 1582 | 1586 | ||
| 1583 | extern __sum16 __skb_checksum_complete_head(struct sk_buff *skb, int len); | 1587 | extern __sum16 __skb_checksum_complete_head(struct sk_buff *skb, int len); |
| 1584 | extern __sum16 __skb_checksum_complete(struct sk_buff *skb); | 1588 | extern __sum16 __skb_checksum_complete(struct sk_buff *skb); |
diff --git a/include/linux/slab.h b/include/linux/slab.h index a015236cc572..cebcd3833c76 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
| @@ -82,8 +82,8 @@ static inline void *kmem_cache_alloc_node(struct kmem_cache *cachep, | |||
| 82 | * to do various tricks to work around compiler limitations in order to | 82 | * to do various tricks to work around compiler limitations in order to |
| 83 | * ensure proper constant folding. | 83 | * ensure proper constant folding. |
| 84 | */ | 84 | */ |
| 85 | #define KMALLOC_SHIFT_HIGH ((MAX_ORDER + PAGE_SHIFT) <= 25 ? \ | 85 | #define KMALLOC_SHIFT_HIGH ((MAX_ORDER + PAGE_SHIFT - 1) <= 25 ? \ |
| 86 | (MAX_ORDER + PAGE_SHIFT) : 25) | 86 | (MAX_ORDER + PAGE_SHIFT - 1) : 25) |
| 87 | 87 | ||
| 88 | #define KMALLOC_MAX_SIZE (1UL << KMALLOC_SHIFT_HIGH) | 88 | #define KMALLOC_MAX_SIZE (1UL << KMALLOC_SHIFT_HIGH) |
| 89 | #define KMALLOC_MAX_ORDER (KMALLOC_SHIFT_HIGH - PAGE_SHIFT) | 89 | #define KMALLOC_MAX_ORDER (KMALLOC_SHIFT_HIGH - PAGE_SHIFT) |
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h index a0ad37463d62..6207a3d8da71 100644 --- a/include/linux/slub_def.h +++ b/include/linux/slub_def.h | |||
| @@ -28,7 +28,7 @@ struct kmem_cache { | |||
| 28 | int size; /* The size of an object including meta data */ | 28 | int size; /* The size of an object including meta data */ |
| 29 | int objsize; /* The size of an object without meta data */ | 29 | int objsize; /* The size of an object without meta data */ |
| 30 | int offset; /* Free pointer offset. */ | 30 | int offset; /* Free pointer offset. */ |
| 31 | unsigned int order; | 31 | int order; |
| 32 | 32 | ||
| 33 | /* | 33 | /* |
| 34 | * Avoid an extra cache line for UP, SMP and for the node local to | 34 | * Avoid an extra cache line for UP, SMP and for the node local to |
| @@ -56,7 +56,13 @@ struct kmem_cache { | |||
| 56 | /* | 56 | /* |
| 57 | * Kmalloc subsystem. | 57 | * Kmalloc subsystem. |
| 58 | */ | 58 | */ |
| 59 | #define KMALLOC_SHIFT_LOW 3 | 59 | #if defined(ARCH_KMALLOC_MINALIGN) && ARCH_KMALLOC_MINALIGN > 8 |
| 60 | #define KMALLOC_MIN_SIZE ARCH_KMALLOC_MINALIGN | ||
| 61 | #else | ||
| 62 | #define KMALLOC_MIN_SIZE 8 | ||
| 63 | #endif | ||
| 64 | |||
| 65 | #define KMALLOC_SHIFT_LOW ilog2(KMALLOC_MIN_SIZE) | ||
| 60 | 66 | ||
| 61 | /* | 67 | /* |
| 62 | * We keep the general caches in an array of slab caches that are used for | 68 | * We keep the general caches in an array of slab caches that are used for |
| @@ -76,6 +82,9 @@ static inline int kmalloc_index(size_t size) | |||
| 76 | if (size > KMALLOC_MAX_SIZE) | 82 | if (size > KMALLOC_MAX_SIZE) |
| 77 | return -1; | 83 | return -1; |
| 78 | 84 | ||
| 85 | if (size <= KMALLOC_MIN_SIZE) | ||
| 86 | return KMALLOC_SHIFT_LOW; | ||
| 87 | |||
| 79 | if (size > 64 && size <= 96) | 88 | if (size > 64 && size <= 96) |
| 80 | return 1; | 89 | return 1; |
| 81 | if (size > 128 && size <= 192) | 90 | if (size > 128 && size <= 192) |
diff --git a/include/linux/sm501-regs.h b/include/linux/sm501-regs.h index cc9be4a11861..014e73b31fc0 100644 --- a/include/linux/sm501-regs.h +++ b/include/linux/sm501-regs.h | |||
| @@ -64,6 +64,11 @@ | |||
| 64 | #define SM501_DEBUG_CONTROL (0x000034) | 64 | #define SM501_DEBUG_CONTROL (0x000034) |
| 65 | 65 | ||
| 66 | /* power management */ | 66 | /* power management */ |
| 67 | #define SM501_POWERMODE_P2X_SRC (1<<29) | ||
| 68 | #define SM501_POWERMODE_V2X_SRC (1<<20) | ||
| 69 | #define SM501_POWERMODE_M_SRC (1<<12) | ||
| 70 | #define SM501_POWERMODE_M1_SRC (1<<4) | ||
| 71 | |||
| 67 | #define SM501_CURRENT_GATE (0x000038) | 72 | #define SM501_CURRENT_GATE (0x000038) |
| 68 | #define SM501_CURRENT_CLOCK (0x00003C) | 73 | #define SM501_CURRENT_CLOCK (0x00003C) |
| 69 | #define SM501_POWER_MODE_0_GATE (0x000040) | 74 | #define SM501_POWER_MODE_0_GATE (0x000040) |
| @@ -104,6 +109,9 @@ | |||
| 104 | #define SM501_DEVICEID (0x000060) | 109 | #define SM501_DEVICEID (0x000060) |
| 105 | /* 0x050100A0 */ | 110 | /* 0x050100A0 */ |
| 106 | 111 | ||
| 112 | #define SM501_DEVICEID_SM501 (0x05010000) | ||
| 113 | #define SM501_DEVICEID_IDMASK (0xffff0000) | ||
| 114 | |||
| 107 | #define SM501_PLLCLOCK_COUNT (0x000064) | 115 | #define SM501_PLLCLOCK_COUNT (0x000064) |
| 108 | #define SM501_MISC_TIMING (0x000068) | 116 | #define SM501_MISC_TIMING (0x000068) |
| 109 | #define SM501_CURRENT_SDRAM_CLOCK (0x00006C) | 117 | #define SM501_CURRENT_SDRAM_CLOCK (0x00006C) |
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index b6bedc3ee95c..1be5ea059477 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h | |||
| @@ -341,9 +341,14 @@ extern struct spi_master *spi_busnum_to_master(u16 busnum); | |||
| 341 | * chip transactions together. | 341 | * chip transactions together. |
| 342 | * | 342 | * |
| 343 | * (ii) When the transfer is the last one in the message, the chip may | 343 | * (ii) When the transfer is the last one in the message, the chip may |
| 344 | * stay selected until the next transfer. This is purely a performance | 344 | * stay selected until the next transfer. On multi-device SPI busses |
| 345 | * hint; the controller driver may need to select a different device | 345 | * with nothing blocking messages going to other devices, this is just |
| 346 | * for the next message. | 346 | * a performance hint; starting a message to another device deselects |
| 347 | * this one. But in other cases, this can be used to ensure correctness. | ||
| 348 | * Some devices need protocol transactions to be built from a series of | ||
| 349 | * spi_message submissions, where the content of one message is determined | ||
| 350 | * by the results of previous messages and where the whole transaction | ||
| 351 | * ends when the chipselect goes intactive. | ||
| 347 | * | 352 | * |
| 348 | * The code that submits an spi_message (and its spi_transfers) | 353 | * The code that submits an spi_message (and its spi_transfers) |
| 349 | * to the lower layers is responsible for managing its memory. | 354 | * to the lower layers is responsible for managing its memory. |
| @@ -480,14 +485,15 @@ static inline void spi_message_free(struct spi_message *m) | |||
| 480 | /** | 485 | /** |
| 481 | * spi_setup - setup SPI mode and clock rate | 486 | * spi_setup - setup SPI mode and clock rate |
| 482 | * @spi: the device whose settings are being modified | 487 | * @spi: the device whose settings are being modified |
| 483 | * Context: can sleep | 488 | * Context: can sleep, and no requests are queued to the device |
| 484 | * | 489 | * |
| 485 | * SPI protocol drivers may need to update the transfer mode if the | 490 | * SPI protocol drivers may need to update the transfer mode if the |
| 486 | * device doesn't work with the mode 0 default. They may likewise need | 491 | * device doesn't work with its default. They may likewise need |
| 487 | * to update clock rates or word sizes from initial values. This function | 492 | * to update clock rates or word sizes from initial values. This function |
| 488 | * changes those settings, and must be called from a context that can sleep. | 493 | * changes those settings, and must be called from a context that can sleep. |
| 489 | * The changes take effect the next time the device is selected and data | 494 | * Except for SPI_CS_HIGH, which takes effect immediately, the changes take |
| 490 | * is transferred to or from it. | 495 | * effect the next time the device is selected and data is transferred to |
| 496 | * or from it. When this function returns, the spi device is deselected. | ||
| 491 | * | 497 | * |
| 492 | * Note that this call will fail if the protocol driver specifies an option | 498 | * Note that this call will fail if the protocol driver specifies an option |
| 493 | * that the underlying controller or its driver does not support. For | 499 | * that the underlying controller or its driver does not support. For |
diff --git a/include/linux/splice.h b/include/linux/splice.h new file mode 100644 index 000000000000..33e447f98a54 --- /dev/null +++ b/include/linux/splice.h | |||
| @@ -0,0 +1,73 @@ | |||
| 1 | /* | ||
| 2 | * Function declerations and data structures related to the splice | ||
| 3 | * implementation. | ||
| 4 | * | ||
| 5 | * Copyright (C) 2007 Jens Axboe <jens.axboe@oracle.com> | ||
| 6 | * | ||
| 7 | */ | ||
| 8 | #ifndef SPLICE_H | ||
| 9 | #define SPLICE_H | ||
| 10 | |||
| 11 | #include <linux/pipe_fs_i.h> | ||
| 12 | |||
| 13 | /* | ||
| 14 | * splice is tied to pipes as a transport (at least for now), so we'll just | ||
| 15 | * add the splice flags here. | ||
| 16 | */ | ||
| 17 | #define SPLICE_F_MOVE (0x01) /* move pages instead of copying */ | ||
| 18 | #define SPLICE_F_NONBLOCK (0x02) /* don't block on the pipe splicing (but */ | ||
| 19 | /* we may still block on the fd we splice */ | ||
| 20 | /* from/to, of course */ | ||
| 21 | #define SPLICE_F_MORE (0x04) /* expect more data */ | ||
| 22 | #define SPLICE_F_GIFT (0x08) /* pages passed in are a gift */ | ||
| 23 | |||
| 24 | /* | ||
| 25 | * Passed to the actors | ||
| 26 | */ | ||
| 27 | struct splice_desc { | ||
| 28 | unsigned int len, total_len; /* current and remaining length */ | ||
| 29 | unsigned int flags; /* splice flags */ | ||
| 30 | /* | ||
| 31 | * actor() private data | ||
| 32 | */ | ||
| 33 | union { | ||
| 34 | void __user *userptr; /* memory to write to */ | ||
| 35 | struct file *file; /* file to read/write */ | ||
| 36 | void *data; /* cookie */ | ||
| 37 | } u; | ||
| 38 | loff_t pos; /* file position */ | ||
| 39 | }; | ||
| 40 | |||
| 41 | struct partial_page { | ||
| 42 | unsigned int offset; | ||
| 43 | unsigned int len; | ||
| 44 | unsigned long private; | ||
| 45 | }; | ||
| 46 | |||
| 47 | /* | ||
| 48 | * Passed to splice_to_pipe | ||
| 49 | */ | ||
| 50 | struct splice_pipe_desc { | ||
| 51 | struct page **pages; /* page map */ | ||
| 52 | struct partial_page *partial; /* pages[] may not be contig */ | ||
| 53 | int nr_pages; /* number of pages in map */ | ||
| 54 | unsigned int flags; /* splice flags */ | ||
| 55 | const struct pipe_buf_operations *ops;/* ops associated with output pipe */ | ||
| 56 | }; | ||
| 57 | |||
| 58 | typedef int (splice_actor)(struct pipe_inode_info *, struct pipe_buffer *, | ||
| 59 | struct splice_desc *); | ||
| 60 | typedef int (splice_direct_actor)(struct pipe_inode_info *, | ||
| 61 | struct splice_desc *); | ||
| 62 | |||
| 63 | extern ssize_t splice_from_pipe(struct pipe_inode_info *, struct file *, | ||
| 64 | loff_t *, size_t, unsigned int, | ||
| 65 | splice_actor *); | ||
| 66 | extern ssize_t __splice_from_pipe(struct pipe_inode_info *, | ||
| 67 | struct splice_desc *, splice_actor *); | ||
| 68 | extern ssize_t splice_to_pipe(struct pipe_inode_info *, | ||
| 69 | struct splice_pipe_desc *); | ||
| 70 | extern ssize_t splice_direct_to_actor(struct file *, struct splice_desc *, | ||
| 71 | splice_direct_actor *); | ||
| 72 | |||
| 73 | #endif | ||
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 4a7ae8ab6eb8..129d50f2225c 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
| @@ -253,7 +253,7 @@ struct svc_rqst { | |||
| 253 | * determine what device number | 253 | * determine what device number |
| 254 | * to report (real or virtual) | 254 | * to report (real or virtual) |
| 255 | */ | 255 | */ |
| 256 | int rq_sendfile_ok; /* turned off in gss privacy | 256 | int rq_splice_ok; /* turned off in gss privacy |
| 257 | * to prevent encrypting page | 257 | * to prevent encrypting page |
| 258 | * cache pages */ | 258 | * cache pages */ |
| 259 | wait_queue_head_t rq_wait; /* synchronization */ | 259 | wait_queue_head_t rq_wait; /* synchronization */ |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index b02070eac422..83d0ec11235e 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
| @@ -598,6 +598,8 @@ asmlinkage long sys_tee(int fdin, int fdout, size_t len, unsigned int flags); | |||
| 598 | 598 | ||
| 599 | asmlinkage long sys_sync_file_range(int fd, loff_t offset, loff_t nbytes, | 599 | asmlinkage long sys_sync_file_range(int fd, loff_t offset, loff_t nbytes, |
| 600 | unsigned int flags); | 600 | unsigned int flags); |
| 601 | asmlinkage long sys_sync_file_range2(int fd, unsigned int flags, | ||
| 602 | loff_t offset, loff_t nbytes); | ||
| 601 | asmlinkage long sys_get_robust_list(int pid, | 603 | asmlinkage long sys_get_robust_list(int pid, |
| 602 | struct robust_list_head __user * __user *head_ptr, | 604 | struct robust_list_head __user * __user *head_ptr, |
| 603 | size_t __user *len_ptr); | 605 | size_t __user *len_ptr); |
diff --git a/include/linux/topology.h b/include/linux/topology.h index a9d1f049cc15..da6c39b2d051 100644 --- a/include/linux/topology.h +++ b/include/linux/topology.h | |||
| @@ -98,7 +98,7 @@ | |||
| 98 | .cache_nice_tries = 0, \ | 98 | .cache_nice_tries = 0, \ |
| 99 | .busy_idx = 0, \ | 99 | .busy_idx = 0, \ |
| 100 | .idle_idx = 0, \ | 100 | .idle_idx = 0, \ |
| 101 | .newidle_idx = 1, \ | 101 | .newidle_idx = 0, \ |
| 102 | .wake_idx = 0, \ | 102 | .wake_idx = 0, \ |
| 103 | .forkexec_idx = 0, \ | 103 | .forkexec_idx = 0, \ |
| 104 | .flags = SD_LOAD_BALANCE \ | 104 | .flags = SD_LOAD_BALANCE \ |
| @@ -128,14 +128,15 @@ | |||
| 128 | .imbalance_pct = 125, \ | 128 | .imbalance_pct = 125, \ |
| 129 | .cache_nice_tries = 1, \ | 129 | .cache_nice_tries = 1, \ |
| 130 | .busy_idx = 2, \ | 130 | .busy_idx = 2, \ |
| 131 | .idle_idx = 1, \ | 131 | .idle_idx = 0, \ |
| 132 | .newidle_idx = 2, \ | 132 | .newidle_idx = 0, \ |
| 133 | .wake_idx = 1, \ | 133 | .wake_idx = 1, \ |
| 134 | .forkexec_idx = 1, \ | 134 | .forkexec_idx = 1, \ |
| 135 | .flags = SD_LOAD_BALANCE \ | 135 | .flags = SD_LOAD_BALANCE \ |
| 136 | | SD_BALANCE_NEWIDLE \ | 136 | | SD_BALANCE_NEWIDLE \ |
| 137 | | SD_BALANCE_EXEC \ | 137 | | SD_BALANCE_EXEC \ |
| 138 | | SD_WAKE_AFFINE \ | 138 | | SD_WAKE_AFFINE \ |
| 139 | | SD_WAKE_IDLE \ | ||
| 139 | | SD_SHARE_PKG_RESOURCES\ | 140 | | SD_SHARE_PKG_RESOURCES\ |
| 140 | | BALANCE_FOR_MC_POWER, \ | 141 | | BALANCE_FOR_MC_POWER, \ |
| 141 | .last_balance = jiffies, \ | 142 | .last_balance = jiffies, \ |
| @@ -158,14 +159,15 @@ | |||
| 158 | .imbalance_pct = 125, \ | 159 | .imbalance_pct = 125, \ |
| 159 | .cache_nice_tries = 1, \ | 160 | .cache_nice_tries = 1, \ |
| 160 | .busy_idx = 2, \ | 161 | .busy_idx = 2, \ |
| 161 | .idle_idx = 1, \ | 162 | .idle_idx = 0, \ |
| 162 | .newidle_idx = 2, \ | 163 | .newidle_idx = 0, \ |
| 163 | .wake_idx = 1, \ | 164 | .wake_idx = 1, \ |
| 164 | .forkexec_idx = 1, \ | 165 | .forkexec_idx = 1, \ |
| 165 | .flags = SD_LOAD_BALANCE \ | 166 | .flags = SD_LOAD_BALANCE \ |
| 166 | | SD_BALANCE_NEWIDLE \ | 167 | | SD_BALANCE_NEWIDLE \ |
| 167 | | SD_BALANCE_EXEC \ | 168 | | SD_BALANCE_EXEC \ |
| 168 | | SD_WAKE_AFFINE \ | 169 | | SD_WAKE_AFFINE \ |
| 170 | | SD_WAKE_IDLE \ | ||
| 169 | | BALANCE_FOR_PKG_POWER,\ | 171 | | BALANCE_FOR_PKG_POWER,\ |
| 170 | .last_balance = jiffies, \ | 172 | .last_balance = jiffies, \ |
| 171 | .balance_interval = 1, \ | 173 | .balance_interval = 1, \ |
diff --git a/include/linux/usb.h b/include/linux/usb.h index 94bd38a6d947..56aa2ee21f1b 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
| @@ -729,6 +729,22 @@ static inline int usb_endpoint_is_isoc_out(const struct usb_endpoint_descriptor | |||
| 729 | .bcdDevice_lo = (lo), .bcdDevice_hi = (hi) | 729 | .bcdDevice_lo = (lo), .bcdDevice_hi = (hi) |
| 730 | 730 | ||
| 731 | /** | 731 | /** |
| 732 | * USB_DEVICE_INTERFACE_PROTOCOL - macro used to describe a usb | ||
| 733 | * device with a specific interface protocol | ||
| 734 | * @vend: the 16 bit USB Vendor ID | ||
| 735 | * @prod: the 16 bit USB Product ID | ||
| 736 | * @pr: bInterfaceProtocol value | ||
| 737 | * | ||
| 738 | * This macro is used to create a struct usb_device_id that matches a | ||
| 739 | * specific interface protocol of devices. | ||
| 740 | */ | ||
| 741 | #define USB_DEVICE_INTERFACE_PROTOCOL(vend,prod,pr) \ | ||
| 742 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_PROTOCOL, \ | ||
| 743 | .idVendor = (vend), \ | ||
| 744 | .idProduct = (prod), \ | ||
| 745 | .bInterfaceProtocol = (pr) | ||
| 746 | |||
| 747 | /** | ||
| 732 | * USB_DEVICE_INFO - macro used to describe a class of usb devices | 748 | * USB_DEVICE_INFO - macro used to describe a class of usb devices |
| 733 | * @cl: bDeviceClass value | 749 | * @cl: bDeviceClass value |
| 734 | * @sc: bDeviceSubClass value | 750 | * @sc: bDeviceSubClass value |
diff --git a/include/linux/wait.h b/include/linux/wait.h index e820d00e1383..0e686280450b 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h | |||
| @@ -366,15 +366,15 @@ static inline void remove_wait_queue_locked(wait_queue_head_t *q, | |||
| 366 | 366 | ||
| 367 | /* | 367 | /* |
| 368 | * These are the old interfaces to sleep waiting for an event. | 368 | * These are the old interfaces to sleep waiting for an event. |
| 369 | * They are racy. DO NOT use them, use the wait_event* interfaces above. | 369 | * They are racy. DO NOT use them, use the wait_event* interfaces above. |
| 370 | * We plan to remove these interfaces during 2.7. | 370 | * We plan to remove these interfaces. |
| 371 | */ | 371 | */ |
| 372 | extern void FASTCALL(sleep_on(wait_queue_head_t *q)); | 372 | extern void sleep_on(wait_queue_head_t *q); |
| 373 | extern long FASTCALL(sleep_on_timeout(wait_queue_head_t *q, | 373 | extern long sleep_on_timeout(wait_queue_head_t *q, |
| 374 | signed long timeout)); | 374 | signed long timeout); |
| 375 | extern void FASTCALL(interruptible_sleep_on(wait_queue_head_t *q)); | 375 | extern void interruptible_sleep_on(wait_queue_head_t *q); |
| 376 | extern long FASTCALL(interruptible_sleep_on_timeout(wait_queue_head_t *q, | 376 | extern long interruptible_sleep_on_timeout(wait_queue_head_t *q, |
| 377 | signed long timeout)); | 377 | signed long timeout); |
| 378 | 378 | ||
| 379 | /* | 379 | /* |
| 380 | * Waitqueues which are removed from the waitqueue_head at wakeup time | 380 | * Waitqueues which are removed from the waitqueue_head at wakeup time |
