diff options
| author | Ingo Molnar <mingo@elte.hu> | 2009-01-10 21:03:30 -0500 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2009-01-10 21:03:30 -0500 |
| commit | f45ac22ae2b8fc5b4c32d9b8d17ea419a8701d89 (patch) | |
| tree | 8e05bccd7b85fc3dd2fbd33ec3286de27e152819 /include/linux | |
| parent | 79f3b3cb7a2586b319a43a7f29924c6c555e4357 (diff) | |
| parent | c59765042f53a79a7a65585042ff463b69cb248c (diff) | |
Merge commit 'v2.6.29-rc1' into x86/urgent
Diffstat (limited to 'include/linux')
149 files changed, 3562 insertions, 1746 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 39da666067b9..12e9a2957caf 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
| @@ -179,7 +179,6 @@ unifdef-y += auto_fs.h | |||
| 179 | unifdef-y += auxvec.h | 179 | unifdef-y += auxvec.h |
| 180 | unifdef-y += binfmts.h | 180 | unifdef-y += binfmts.h |
| 181 | unifdef-y += blktrace_api.h | 181 | unifdef-y += blktrace_api.h |
| 182 | unifdef-y += byteorder.h | ||
| 183 | unifdef-y += capability.h | 182 | unifdef-y += capability.h |
| 184 | unifdef-y += capi.h | 183 | unifdef-y += capi.h |
| 185 | unifdef-y += cciss_ioctl.h | 184 | unifdef-y += cciss_ioctl.h |
| @@ -372,3 +371,5 @@ unifdef-y += xattr.h | |||
| 372 | unifdef-y += xfrm.h | 371 | unifdef-y += xfrm.h |
| 373 | 372 | ||
| 374 | objhdr-y += version.h | 373 | objhdr-y += version.h |
| 374 | header-y += wimax.h | ||
| 375 | header-y += wimax/ | ||
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index fba8051fb297..6fce2fc2d124 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
| @@ -131,22 +131,6 @@ extern int acpi_get_override_irq(int bus_irq, int *trigger, int *polarity); | |||
| 131 | */ | 131 | */ |
| 132 | void acpi_unregister_gsi (u32 gsi); | 132 | void acpi_unregister_gsi (u32 gsi); |
| 133 | 133 | ||
| 134 | struct acpi_prt_entry { | ||
| 135 | struct list_head node; | ||
| 136 | struct acpi_pci_id id; | ||
| 137 | u8 pin; | ||
| 138 | struct { | ||
| 139 | acpi_handle handle; | ||
| 140 | u32 index; | ||
| 141 | } link; | ||
| 142 | u32 irq; | ||
| 143 | }; | ||
| 144 | |||
| 145 | struct acpi_prt_list { | ||
| 146 | int count; | ||
| 147 | struct list_head entries; | ||
| 148 | }; | ||
| 149 | |||
| 150 | struct pci_dev; | 134 | struct pci_dev; |
| 151 | 135 | ||
| 152 | int acpi_pci_irq_enable (struct pci_dev *dev); | 136 | int acpi_pci_irq_enable (struct pci_dev *dev); |
| @@ -270,6 +254,7 @@ int acpi_check_mem_region(resource_size_t start, resource_size_t n, | |||
| 270 | #ifdef CONFIG_PM_SLEEP | 254 | #ifdef CONFIG_PM_SLEEP |
| 271 | void __init acpi_no_s4_hw_signature(void); | 255 | void __init acpi_no_s4_hw_signature(void); |
| 272 | void __init acpi_old_suspend_ordering(void); | 256 | void __init acpi_old_suspend_ordering(void); |
| 257 | void __init acpi_s4_no_nvs(void); | ||
| 273 | #endif /* CONFIG_PM_SLEEP */ | 258 | #endif /* CONFIG_PM_SLEEP */ |
| 274 | #else /* CONFIG_ACPI */ | 259 | #else /* CONFIG_ACPI */ |
| 275 | 260 | ||
diff --git a/include/linux/async.h b/include/linux/async.h new file mode 100644 index 000000000000..c4ecacd0b327 --- /dev/null +++ b/include/linux/async.h | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | /* | ||
| 2 | * async.h: Asynchronous function calls for boot performance | ||
| 3 | * | ||
| 4 | * (C) Copyright 2009 Intel Corporation | ||
| 5 | * Author: Arjan van de Ven <arjan@linux.intel.com> | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or | ||
| 8 | * modify it under the terms of the GNU General Public License | ||
| 9 | * as published by the Free Software Foundation; version 2 | ||
| 10 | * of the License. | ||
| 11 | */ | ||
| 12 | |||
| 13 | #include <linux/types.h> | ||
| 14 | #include <linux/list.h> | ||
| 15 | |||
| 16 | typedef u64 async_cookie_t; | ||
| 17 | typedef void (async_func_ptr) (void *data, async_cookie_t cookie); | ||
| 18 | |||
| 19 | extern async_cookie_t async_schedule(async_func_ptr *ptr, void *data); | ||
| 20 | extern async_cookie_t async_schedule_special(async_func_ptr *ptr, void *data, struct list_head *list); | ||
| 21 | extern void async_synchronize_full(void); | ||
| 22 | extern void async_synchronize_full_special(struct list_head *list); | ||
| 23 | extern void async_synchronize_cookie(async_cookie_t cookie); | ||
| 24 | extern void async_synchronize_cookie_special(async_cookie_t cookie, struct list_head *list); | ||
| 25 | |||
diff --git a/include/linux/async_tx.h b/include/linux/async_tx.h index 0f50d4cc4360..45f6297821bd 100644 --- a/include/linux/async_tx.h +++ b/include/linux/async_tx.h | |||
| @@ -59,9 +59,7 @@ enum async_tx_flags { | |||
| 59 | }; | 59 | }; |
| 60 | 60 | ||
| 61 | #ifdef CONFIG_DMA_ENGINE | 61 | #ifdef CONFIG_DMA_ENGINE |
| 62 | void async_tx_issue_pending_all(void); | 62 | #define async_tx_issue_pending_all dma_issue_pending_all |
| 63 | enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx); | ||
| 64 | void async_tx_run_dependencies(struct dma_async_tx_descriptor *tx); | ||
| 65 | #ifdef CONFIG_ARCH_HAS_ASYNC_TX_FIND_CHANNEL | 63 | #ifdef CONFIG_ARCH_HAS_ASYNC_TX_FIND_CHANNEL |
| 66 | #include <asm/async_tx.h> | 64 | #include <asm/async_tx.h> |
| 67 | #else | 65 | #else |
| @@ -77,19 +75,6 @@ static inline void async_tx_issue_pending_all(void) | |||
| 77 | do { } while (0); | 75 | do { } while (0); |
| 78 | } | 76 | } |
| 79 | 77 | ||
| 80 | static inline enum dma_status | ||
| 81 | dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx) | ||
| 82 | { | ||
| 83 | return DMA_SUCCESS; | ||
| 84 | } | ||
| 85 | |||
| 86 | static inline void | ||
| 87 | async_tx_run_dependencies(struct dma_async_tx_descriptor *tx, | ||
| 88 | struct dma_chan *host_chan) | ||
| 89 | { | ||
| 90 | do { } while (0); | ||
| 91 | } | ||
| 92 | |||
| 93 | static inline struct dma_chan * | 78 | static inline struct dma_chan * |
| 94 | async_tx_find_channel(struct dma_async_tx_descriptor *depend_tx, | 79 | async_tx_find_channel(struct dma_async_tx_descriptor *depend_tx, |
| 95 | enum dma_transaction_type tx_type, struct page **dst, int dst_count, | 80 | enum dma_transaction_type tx_type, struct page **dst, int dst_count, |
diff --git a/include/linux/atmel-mci.h b/include/linux/atmel-mci.h new file mode 100644 index 000000000000..2f1f95737acb --- /dev/null +++ b/include/linux/atmel-mci.h | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | #ifndef __LINUX_ATMEL_MCI_H | ||
| 2 | #define __LINUX_ATMEL_MCI_H | ||
| 3 | |||
| 4 | #define ATMEL_MCI_MAX_NR_SLOTS 2 | ||
| 5 | |||
| 6 | #include <linux/dw_dmac.h> | ||
| 7 | |||
| 8 | /** | ||
| 9 | * struct mci_slot_pdata - board-specific per-slot configuration | ||
| 10 | * @bus_width: Number of data lines wired up the slot | ||
| 11 | * @detect_pin: GPIO pin wired to the card detect switch | ||
| 12 | * @wp_pin: GPIO pin wired to the write protect sensor | ||
| 13 | * | ||
| 14 | * If a given slot is not present on the board, @bus_width should be | ||
| 15 | * set to 0. The other fields are ignored in this case. | ||
| 16 | * | ||
| 17 | * Any pins that aren't available should be set to a negative value. | ||
| 18 | * | ||
| 19 | * Note that support for multiple slots is experimental -- some cards | ||
| 20 | * might get upset if we don't get the clock management exactly right. | ||
| 21 | * But in most cases, it should work just fine. | ||
| 22 | */ | ||
| 23 | struct mci_slot_pdata { | ||
| 24 | unsigned int bus_width; | ||
| 25 | int detect_pin; | ||
| 26 | int wp_pin; | ||
| 27 | }; | ||
| 28 | |||
| 29 | /** | ||
| 30 | * struct mci_platform_data - board-specific MMC/SDcard configuration | ||
| 31 | * @dma_slave: DMA slave interface to use in data transfers. | ||
| 32 | * @slot: Per-slot configuration data. | ||
| 33 | */ | ||
| 34 | struct mci_platform_data { | ||
| 35 | struct dw_dma_slave dma_slave; | ||
| 36 | struct mci_slot_pdata slot[ATMEL_MCI_MAX_NR_SLOTS]; | ||
| 37 | }; | ||
| 38 | |||
| 39 | #endif /* __LINUX_ATMEL_MCI_H */ | ||
diff --git a/include/linux/auto_dev-ioctl.h b/include/linux/auto_dev-ioctl.h index f4d05ccd731f..91a773993a5c 100644 --- a/include/linux/auto_dev-ioctl.h +++ b/include/linux/auto_dev-ioctl.h | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | #ifndef _LINUX_AUTO_DEV_IOCTL_H | 10 | #ifndef _LINUX_AUTO_DEV_IOCTL_H |
| 11 | #define _LINUX_AUTO_DEV_IOCTL_H | 11 | #define _LINUX_AUTO_DEV_IOCTL_H |
| 12 | 12 | ||
| 13 | #include <linux/string.h> | ||
| 13 | #include <linux/types.h> | 14 | #include <linux/types.h> |
| 14 | 15 | ||
| 15 | #define AUTOFS_DEVICE_NAME "autofs" | 16 | #define AUTOFS_DEVICE_NAME "autofs" |
| @@ -25,6 +26,60 @@ | |||
| 25 | * An ioctl interface for autofs mount point control. | 26 | * An ioctl interface for autofs mount point control. |
| 26 | */ | 27 | */ |
| 27 | 28 | ||
| 29 | struct args_protover { | ||
| 30 | __u32 version; | ||
| 31 | }; | ||
| 32 | |||
| 33 | struct args_protosubver { | ||
| 34 | __u32 sub_version; | ||
| 35 | }; | ||
| 36 | |||
| 37 | struct args_openmount { | ||
| 38 | __u32 devid; | ||
| 39 | }; | ||
| 40 | |||
| 41 | struct args_ready { | ||
| 42 | __u32 token; | ||
| 43 | }; | ||
| 44 | |||
| 45 | struct args_fail { | ||
| 46 | __u32 token; | ||
| 47 | __s32 status; | ||
| 48 | }; | ||
| 49 | |||
| 50 | struct args_setpipefd { | ||
| 51 | __s32 pipefd; | ||
| 52 | }; | ||
| 53 | |||
| 54 | struct args_timeout { | ||
| 55 | __u64 timeout; | ||
| 56 | }; | ||
| 57 | |||
| 58 | struct args_requester { | ||
| 59 | __u32 uid; | ||
| 60 | __u32 gid; | ||
| 61 | }; | ||
| 62 | |||
| 63 | struct args_expire { | ||
| 64 | __u32 how; | ||
| 65 | }; | ||
| 66 | |||
| 67 | struct args_askumount { | ||
| 68 | __u32 may_umount; | ||
| 69 | }; | ||
| 70 | |||
| 71 | struct args_ismountpoint { | ||
| 72 | union { | ||
| 73 | struct args_in { | ||
| 74 | __u32 type; | ||
| 75 | } in; | ||
| 76 | struct args_out { | ||
| 77 | __u32 devid; | ||
| 78 | __u32 magic; | ||
| 79 | } out; | ||
| 80 | }; | ||
| 81 | }; | ||
| 82 | |||
| 28 | /* | 83 | /* |
| 29 | * All the ioctls use this structure. | 84 | * All the ioctls use this structure. |
| 30 | * When sending a path size must account for the total length | 85 | * When sending a path size must account for the total length |
| @@ -39,20 +94,32 @@ struct autofs_dev_ioctl { | |||
| 39 | * including this struct */ | 94 | * including this struct */ |
| 40 | __s32 ioctlfd; /* automount command fd */ | 95 | __s32 ioctlfd; /* automount command fd */ |
| 41 | 96 | ||
| 42 | __u32 arg1; /* Command parameters */ | 97 | /* Command parameters */ |
| 43 | __u32 arg2; | 98 | |
| 99 | union { | ||
| 100 | struct args_protover protover; | ||
| 101 | struct args_protosubver protosubver; | ||
| 102 | struct args_openmount openmount; | ||
| 103 | struct args_ready ready; | ||
| 104 | struct args_fail fail; | ||
| 105 | struct args_setpipefd setpipefd; | ||
| 106 | struct args_timeout timeout; | ||
| 107 | struct args_requester requester; | ||
| 108 | struct args_expire expire; | ||
| 109 | struct args_askumount askumount; | ||
| 110 | struct args_ismountpoint ismountpoint; | ||
| 111 | }; | ||
| 44 | 112 | ||
| 45 | char path[0]; | 113 | char path[0]; |
| 46 | }; | 114 | }; |
| 47 | 115 | ||
| 48 | static inline void init_autofs_dev_ioctl(struct autofs_dev_ioctl *in) | 116 | static inline void init_autofs_dev_ioctl(struct autofs_dev_ioctl *in) |
| 49 | { | 117 | { |
| 118 | memset(in, 0, sizeof(struct autofs_dev_ioctl)); | ||
| 50 | in->ver_major = AUTOFS_DEV_IOCTL_VERSION_MAJOR; | 119 | in->ver_major = AUTOFS_DEV_IOCTL_VERSION_MAJOR; |
| 51 | in->ver_minor = AUTOFS_DEV_IOCTL_VERSION_MINOR; | 120 | in->ver_minor = AUTOFS_DEV_IOCTL_VERSION_MINOR; |
| 52 | in->size = sizeof(struct autofs_dev_ioctl); | 121 | in->size = sizeof(struct autofs_dev_ioctl); |
| 53 | in->ioctlfd = -1; | 122 | in->ioctlfd = -1; |
| 54 | in->arg1 = 0; | ||
| 55 | in->arg2 = 0; | ||
| 56 | return; | 123 | return; |
| 57 | } | 124 | } |
| 58 | 125 | ||
diff --git a/include/linux/auto_fs4.h b/include/linux/auto_fs4.h index 2253716d4b92..55fa478bd639 100644 --- a/include/linux/auto_fs4.h +++ b/include/linux/auto_fs4.h | |||
| @@ -29,10 +29,64 @@ | |||
| 29 | #define AUTOFS_EXP_IMMEDIATE 1 | 29 | #define AUTOFS_EXP_IMMEDIATE 1 |
| 30 | #define AUTOFS_EXP_LEAVES 2 | 30 | #define AUTOFS_EXP_LEAVES 2 |
| 31 | 31 | ||
| 32 | #define AUTOFS_TYPE_ANY 0x0000 | 32 | #define AUTOFS_TYPE_ANY 0U |
| 33 | #define AUTOFS_TYPE_INDIRECT 0x0001 | 33 | #define AUTOFS_TYPE_INDIRECT 1U |
| 34 | #define AUTOFS_TYPE_DIRECT 0x0002 | 34 | #define AUTOFS_TYPE_DIRECT 2U |
| 35 | #define AUTOFS_TYPE_OFFSET 0x0004 | 35 | #define AUTOFS_TYPE_OFFSET 4U |
| 36 | |||
| 37 | static inline void set_autofs_type_indirect(unsigned int *type) | ||
| 38 | { | ||
| 39 | *type = AUTOFS_TYPE_INDIRECT; | ||
| 40 | return; | ||
| 41 | } | ||
| 42 | |||
| 43 | static inline unsigned int autofs_type_indirect(unsigned int type) | ||
| 44 | { | ||
| 45 | return (type == AUTOFS_TYPE_INDIRECT); | ||
| 46 | } | ||
| 47 | |||
| 48 | static inline void set_autofs_type_direct(unsigned int *type) | ||
| 49 | { | ||
| 50 | *type = AUTOFS_TYPE_DIRECT; | ||
| 51 | return; | ||
| 52 | } | ||
| 53 | |||
| 54 | static inline unsigned int autofs_type_direct(unsigned int type) | ||
| 55 | { | ||
| 56 | return (type == AUTOFS_TYPE_DIRECT); | ||
| 57 | } | ||
| 58 | |||
| 59 | static inline void set_autofs_type_offset(unsigned int *type) | ||
| 60 | { | ||
| 61 | *type = AUTOFS_TYPE_OFFSET; | ||
| 62 | return; | ||
| 63 | } | ||
| 64 | |||
| 65 | static inline unsigned int autofs_type_offset(unsigned int type) | ||
| 66 | { | ||
| 67 | return (type == AUTOFS_TYPE_OFFSET); | ||
| 68 | } | ||
| 69 | |||
| 70 | static inline unsigned int autofs_type_trigger(unsigned int type) | ||
| 71 | { | ||
| 72 | return (type == AUTOFS_TYPE_DIRECT || type == AUTOFS_TYPE_OFFSET); | ||
| 73 | } | ||
| 74 | |||
| 75 | /* | ||
| 76 | * This isn't really a type as we use it to say "no type set" to | ||
| 77 | * indicate we want to search for "any" mount in the | ||
| 78 | * autofs_dev_ioctl_ismountpoint() device ioctl function. | ||
| 79 | */ | ||
| 80 | static inline void set_autofs_type_any(unsigned int *type) | ||
| 81 | { | ||
| 82 | *type = AUTOFS_TYPE_ANY; | ||
| 83 | return; | ||
| 84 | } | ||
| 85 | |||
| 86 | static inline unsigned int autofs_type_any(unsigned int type) | ||
| 87 | { | ||
| 88 | return (type == AUTOFS_TYPE_ANY); | ||
| 89 | } | ||
| 36 | 90 | ||
| 37 | /* Daemon notification packet types */ | 91 | /* Daemon notification packet types */ |
| 38 | enum autofs_notify { | 92 | enum autofs_notify { |
diff --git a/include/linux/auxvec.h b/include/linux/auxvec.h index d7afa9dd6635..f3b5d4e3a2ac 100644 --- a/include/linux/auxvec.h +++ b/include/linux/auxvec.h | |||
| @@ -23,16 +23,16 @@ | |||
| 23 | #define AT_PLATFORM 15 /* string identifying CPU for optimizations */ | 23 | #define AT_PLATFORM 15 /* string identifying CPU for optimizations */ |
| 24 | #define AT_HWCAP 16 /* arch dependent hints at CPU capabilities */ | 24 | #define AT_HWCAP 16 /* arch dependent hints at CPU capabilities */ |
| 25 | #define AT_CLKTCK 17 /* frequency at which times() increments */ | 25 | #define AT_CLKTCK 17 /* frequency at which times() increments */ |
| 26 | 26 | /* AT_* values 18 through 22 are reserved */ | |
| 27 | #define AT_SECURE 23 /* secure mode boolean */ | 27 | #define AT_SECURE 23 /* secure mode boolean */ |
| 28 | |||
| 29 | #define AT_BASE_PLATFORM 24 /* string identifying real platform, may | 28 | #define AT_BASE_PLATFORM 24 /* string identifying real platform, may |
| 30 | * differ from AT_PLATFORM. */ | 29 | * differ from AT_PLATFORM. */ |
| 30 | #define AT_RANDOM 25 /* address of 16 random bytes */ | ||
| 31 | 31 | ||
| 32 | #define AT_EXECFN 31 /* filename of program */ | 32 | #define AT_EXECFN 31 /* filename of program */ |
| 33 | 33 | ||
| 34 | #ifdef __KERNEL__ | 34 | #ifdef __KERNEL__ |
| 35 | #define AT_VECTOR_SIZE_BASE 18 /* NEW_AUX_ENT entries in auxiliary table */ | 35 | #define AT_VECTOR_SIZE_BASE 19 /* NEW_AUX_ENT entries in auxiliary table */ |
| 36 | /* number of "#define AT_.*" above, minus {AT_NULL, AT_IGNORE, AT_NOTELF} */ | 36 | /* number of "#define AT_.*" above, minus {AT_NULL, AT_IGNORE, AT_NOTELF} */ |
| 37 | #endif | 37 | #endif |
| 38 | 38 | ||
diff --git a/include/linux/backlight.h b/include/linux/backlight.h index 1ee9488ca2e4..79ca2da81c87 100644 --- a/include/linux/backlight.h +++ b/include/linux/backlight.h | |||
| @@ -31,6 +31,10 @@ struct backlight_device; | |||
| 31 | struct fb_info; | 31 | struct fb_info; |
| 32 | 32 | ||
| 33 | struct backlight_ops { | 33 | struct backlight_ops { |
| 34 | unsigned int options; | ||
| 35 | |||
| 36 | #define BL_CORE_SUSPENDRESUME (1 << 0) | ||
| 37 | |||
| 34 | /* Notify the backlight driver some property has changed */ | 38 | /* Notify the backlight driver some property has changed */ |
| 35 | int (*update_status)(struct backlight_device *); | 39 | int (*update_status)(struct backlight_device *); |
| 36 | /* Return the current backlight brightness (accounting for power, | 40 | /* Return the current backlight brightness (accounting for power, |
| @@ -51,7 +55,19 @@ struct backlight_properties { | |||
| 51 | modes; 4: full off), see FB_BLANK_XXX */ | 55 | modes; 4: full off), see FB_BLANK_XXX */ |
| 52 | int power; | 56 | int power; |
| 53 | /* FB Blanking active? (values as for power) */ | 57 | /* FB Blanking active? (values as for power) */ |
| 58 | /* Due to be removed, please use (state & BL_CORE_FBBLANK) */ | ||
| 54 | int fb_blank; | 59 | int fb_blank; |
| 60 | /* Flags used to signal drivers of state changes */ | ||
| 61 | /* Upper 4 bits are reserved for driver internal use */ | ||
| 62 | unsigned int state; | ||
| 63 | |||
| 64 | #define BL_CORE_SUSPENDED (1 << 0) /* backlight is suspended */ | ||
| 65 | #define BL_CORE_FBBLANK (1 << 1) /* backlight is under an fb blank event */ | ||
| 66 | #define BL_CORE_DRIVER4 (1 << 28) /* reserved for driver specific use */ | ||
| 67 | #define BL_CORE_DRIVER3 (1 << 29) /* reserved for driver specific use */ | ||
| 68 | #define BL_CORE_DRIVER2 (1 << 30) /* reserved for driver specific use */ | ||
| 69 | #define BL_CORE_DRIVER1 (1 << 31) /* reserved for driver specific use */ | ||
| 70 | |||
| 55 | }; | 71 | }; |
| 56 | 72 | ||
| 57 | struct backlight_device { | 73 | struct backlight_device { |
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h index 6cbfbe297180..77b4a9e46004 100644 --- a/include/linux/binfmts.h +++ b/include/linux/binfmts.h | |||
| @@ -18,6 +18,7 @@ struct pt_regs; | |||
| 18 | #define BINPRM_BUF_SIZE 128 | 18 | #define BINPRM_BUF_SIZE 128 |
| 19 | 19 | ||
| 20 | #ifdef __KERNEL__ | 20 | #ifdef __KERNEL__ |
| 21 | #include <linux/list.h> | ||
| 21 | 22 | ||
| 22 | #define CORENAME_MAX_SIZE 128 | 23 | #define CORENAME_MAX_SIZE 128 |
| 23 | 24 | ||
| @@ -106,7 +107,7 @@ extern int setup_arg_pages(struct linux_binprm * bprm, | |||
| 106 | extern int bprm_mm_init(struct linux_binprm *bprm); | 107 | extern int bprm_mm_init(struct linux_binprm *bprm); |
| 107 | extern int copy_strings_kernel(int argc,char ** argv,struct linux_binprm *bprm); | 108 | extern int copy_strings_kernel(int argc,char ** argv,struct linux_binprm *bprm); |
| 108 | extern void install_exec_creds(struct linux_binprm *bprm); | 109 | extern void install_exec_creds(struct linux_binprm *bprm); |
| 109 | extern int do_coredump(long signr, int exit_code, struct pt_regs * regs); | 110 | extern void do_coredump(long signr, int exit_code, struct pt_regs *regs); |
| 110 | extern int set_binfmt(struct linux_binfmt *new); | 111 | extern int set_binfmt(struct linux_binfmt *new); |
| 111 | extern void free_bprm(struct linux_binprm *); | 112 | extern void free_bprm(struct linux_binprm *); |
| 112 | 113 | ||
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 7035cec583b6..044467ef7b11 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
| @@ -690,6 +690,8 @@ struct rq_map_data { | |||
| 690 | struct page **pages; | 690 | struct page **pages; |
| 691 | int page_order; | 691 | int page_order; |
| 692 | int nr_entries; | 692 | int nr_entries; |
| 693 | unsigned long offset; | ||
| 694 | int null_mapped; | ||
| 693 | }; | 695 | }; |
| 694 | 696 | ||
| 695 | struct req_iterator { | 697 | struct req_iterator { |
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 8605f8a74df9..bd7ac793be19 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h | |||
| @@ -171,7 +171,7 @@ void __wait_on_buffer(struct buffer_head *); | |||
| 171 | wait_queue_head_t *bh_waitq_head(struct buffer_head *bh); | 171 | wait_queue_head_t *bh_waitq_head(struct buffer_head *bh); |
| 172 | int fsync_bdev(struct block_device *); | 172 | int fsync_bdev(struct block_device *); |
| 173 | struct super_block *freeze_bdev(struct block_device *); | 173 | struct super_block *freeze_bdev(struct block_device *); |
| 174 | void thaw_bdev(struct block_device *, struct super_block *); | 174 | int thaw_bdev(struct block_device *, struct super_block *); |
| 175 | int fsync_super(struct super_block *); | 175 | int fsync_super(struct super_block *); |
| 176 | int fsync_no_super(struct block_device *); | 176 | int fsync_no_super(struct block_device *); |
| 177 | struct buffer_head *__find_get_block(struct block_device *bdev, sector_t block, | 177 | struct buffer_head *__find_get_block(struct block_device *bdev, sector_t block, |
| @@ -346,6 +346,15 @@ static inline int remove_inode_buffers(struct inode *inode) { return 1; } | |||
| 346 | static inline int sync_mapping_buffers(struct address_space *mapping) { return 0; } | 346 | static inline int sync_mapping_buffers(struct address_space *mapping) { return 0; } |
| 347 | static inline void invalidate_bdev(struct block_device *bdev) {} | 347 | static inline void invalidate_bdev(struct block_device *bdev) {} |
| 348 | 348 | ||
| 349 | static inline struct super_block *freeze_bdev(struct block_device *sb) | ||
| 350 | { | ||
| 351 | return NULL; | ||
| 352 | } | ||
| 353 | |||
| 354 | static inline int thaw_bdev(struct block_device *bdev, struct super_block *sb) | ||
| 355 | { | ||
| 356 | return 0; | ||
| 357 | } | ||
| 349 | 358 | ||
| 350 | #endif /* CONFIG_BLOCK */ | 359 | #endif /* CONFIG_BLOCK */ |
| 351 | #endif /* _LINUX_BUFFER_HEAD_H */ | 360 | #endif /* _LINUX_BUFFER_HEAD_H */ |
diff --git a/include/linux/byteorder.h b/include/linux/byteorder.h deleted file mode 100644 index 29f002d73d98..000000000000 --- a/include/linux/byteorder.h +++ /dev/null | |||
| @@ -1,372 +0,0 @@ | |||
| 1 | #ifndef _LINUX_BYTEORDER_H | ||
| 2 | #define _LINUX_BYTEORDER_H | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | #include <linux/swab.h> | ||
| 6 | |||
| 7 | #if defined(__LITTLE_ENDIAN) && defined(__BIG_ENDIAN) | ||
| 8 | # error Fix asm/byteorder.h to define one endianness | ||
| 9 | #endif | ||
| 10 | |||
| 11 | #if !defined(__LITTLE_ENDIAN) && !defined(__BIG_ENDIAN) | ||
| 12 | # error Fix asm/byteorder.h to define arch endianness | ||
| 13 | #endif | ||
| 14 | |||
| 15 | #ifdef __LITTLE_ENDIAN | ||
| 16 | # undef __LITTLE_ENDIAN | ||
| 17 | # define __LITTLE_ENDIAN 1234 | ||
| 18 | #endif | ||
| 19 | |||
| 20 | #ifdef __BIG_ENDIAN | ||
| 21 | # undef __BIG_ENDIAN | ||
| 22 | # define __BIG_ENDIAN 4321 | ||
| 23 | #endif | ||
| 24 | |||
| 25 | #if defined(__LITTLE_ENDIAN) && !defined(__LITTLE_ENDIAN_BITFIELD) | ||
| 26 | # define __LITTLE_ENDIAN_BITFIELD | ||
| 27 | #endif | ||
| 28 | |||
| 29 | #if defined(__BIG_ENDIAN) && !defined(__BIG_ENDIAN_BITFIELD) | ||
| 30 | # define __BIG_ENDIAN_BITFIELD | ||
| 31 | #endif | ||
| 32 | |||
| 33 | #ifdef __LITTLE_ENDIAN | ||
| 34 | # define __le16_to_cpu(x) ((__force __u16)(__le16)(x)) | ||
| 35 | # define __le32_to_cpu(x) ((__force __u32)(__le32)(x)) | ||
| 36 | # define __le64_to_cpu(x) ((__force __u64)(__le64)(x)) | ||
| 37 | # define __cpu_to_le16(x) ((__force __le16)(__u16)(x)) | ||
| 38 | # define __cpu_to_le32(x) ((__force __le32)(__u32)(x)) | ||
| 39 | # define __cpu_to_le64(x) ((__force __le64)(__u64)(x)) | ||
| 40 | |||
| 41 | # define __be16_to_cpu(x) __swab16((__force __u16)(__be16)(x)) | ||
| 42 | # define __be32_to_cpu(x) __swab32((__force __u32)(__be32)(x)) | ||
| 43 | # define __be64_to_cpu(x) __swab64((__force __u64)(__be64)(x)) | ||
| 44 | # define __cpu_to_be16(x) ((__force __be16)__swab16(x)) | ||
| 45 | # define __cpu_to_be32(x) ((__force __be32)__swab32(x)) | ||
| 46 | # define __cpu_to_be64(x) ((__force __be64)__swab64(x)) | ||
| 47 | #endif | ||
| 48 | |||
| 49 | #ifdef __BIG_ENDIAN | ||
| 50 | # define __be16_to_cpu(x) ((__force __u16)(__be16)(x)) | ||
| 51 | # define __be32_to_cpu(x) ((__force __u32)(__be32)(x)) | ||
| 52 | # define __be64_to_cpu(x) ((__force __u64)(__be64)(x)) | ||
| 53 | # define __cpu_to_be16(x) ((__force __be16)(__u16)(x)) | ||
| 54 | # define __cpu_to_be32(x) ((__force __be32)(__u32)(x)) | ||
| 55 | # define __cpu_to_be64(x) ((__force __be64)(__u64)(x)) | ||
| 56 | |||
| 57 | # define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x)) | ||
| 58 | # define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x)) | ||
| 59 | # define __le64_to_cpu(x) __swab64((__force __u64)(__le64)(x)) | ||
| 60 | # define __cpu_to_le16(x) ((__force __le16)__swab16(x)) | ||
| 61 | # define __cpu_to_le32(x) ((__force __le32)__swab32(x)) | ||
| 62 | # define __cpu_to_le64(x) ((__force __le64)__swab64(x)) | ||
| 63 | #endif | ||
| 64 | |||
| 65 | /* | ||
| 66 | * These helpers could be phased out over time as the base version | ||
| 67 | * handles constant folding. | ||
| 68 | */ | ||
| 69 | #define __constant_htonl(x) __cpu_to_be32(x) | ||
| 70 | #define __constant_ntohl(x) __be32_to_cpu(x) | ||
| 71 | #define __constant_htons(x) __cpu_to_be16(x) | ||
| 72 | #define __constant_ntohs(x) __be16_to_cpu(x) | ||
| 73 | |||
| 74 | #define __constant_le16_to_cpu(x) __le16_to_cpu(x) | ||
| 75 | #define __constant_le32_to_cpu(x) __le32_to_cpu(x) | ||
| 76 | #define __constant_le64_to_cpu(x) __le64_to_cpu(x) | ||
| 77 | #define __constant_be16_to_cpu(x) __be16_to_cpu(x) | ||
| 78 | #define __constant_be32_to_cpu(x) __be32_to_cpu(x) | ||
| 79 | #define __constant_be64_to_cpu(x) __be64_to_cpu(x) | ||
| 80 | |||
| 81 | #define __constant_cpu_to_le16(x) __cpu_to_le16(x) | ||
| 82 | #define __constant_cpu_to_le32(x) __cpu_to_le32(x) | ||
| 83 | #define __constant_cpu_to_le64(x) __cpu_to_le64(x) | ||
| 84 | #define __constant_cpu_to_be16(x) __cpu_to_be16(x) | ||
| 85 | #define __constant_cpu_to_be32(x) __cpu_to_be32(x) | ||
| 86 | #define __constant_cpu_to_be64(x) __cpu_to_be64(x) | ||
| 87 | |||
| 88 | static inline void __le16_to_cpus(__u16 *p) | ||
| 89 | { | ||
| 90 | #ifdef __BIG_ENDIAN | ||
| 91 | __swab16s(p); | ||
| 92 | #endif | ||
| 93 | } | ||
| 94 | |||
| 95 | static inline void __cpu_to_le16s(__u16 *p) | ||
| 96 | { | ||
| 97 | #ifdef __BIG_ENDIAN | ||
| 98 | __swab16s(p); | ||
| 99 | #endif | ||
| 100 | } | ||
| 101 | |||
| 102 | static inline void __le32_to_cpus(__u32 *p) | ||
| 103 | { | ||
| 104 | #ifdef __BIG_ENDIAN | ||
| 105 | __swab32s(p); | ||
| 106 | #endif | ||
| 107 | } | ||
| 108 | |||
| 109 | static inline void __cpu_to_le32s(__u32 *p) | ||
| 110 | { | ||
| 111 | #ifdef __BIG_ENDIAN | ||
| 112 | __swab32s(p); | ||
| 113 | #endif | ||
| 114 | } | ||
| 115 | |||
| 116 | static inline void __le64_to_cpus(__u64 *p) | ||
| 117 | { | ||
| 118 | #ifdef __BIG_ENDIAN | ||
| 119 | __swab64s(p); | ||
| 120 | #endif | ||
| 121 | } | ||
| 122 | |||
| 123 | static inline void __cpu_to_le64s(__u64 *p) | ||
| 124 | { | ||
| 125 | #ifdef __BIG_ENDIAN | ||
| 126 | __swab64s(p); | ||
| 127 | #endif | ||
| 128 | } | ||
| 129 | |||
| 130 | static inline void __be16_to_cpus(__u16 *p) | ||
| 131 | { | ||
| 132 | #ifdef __LITTLE_ENDIAN | ||
| 133 | __swab16s(p); | ||
| 134 | #endif | ||
| 135 | } | ||
| 136 | |||
| 137 | static inline void __cpu_to_be16s(__u16 *p) | ||
| 138 | { | ||
| 139 | #ifdef __LITTLE_ENDIAN | ||
| 140 | __swab16s(p); | ||
| 141 | #endif | ||
| 142 | } | ||
| 143 | |||
| 144 | static inline void __be32_to_cpus(__u32 *p) | ||
| 145 | { | ||
| 146 | #ifdef __LITTLE_ENDIAN | ||
| 147 | __swab32s(p); | ||
| 148 | #endif | ||
| 149 | } | ||
| 150 | |||
| 151 | static inline void __cpu_to_be32s(__u32 *p) | ||
| 152 | { | ||
| 153 | #ifdef __LITTLE_ENDIAN | ||
| 154 | __swab32s(p); | ||
| 155 | #endif | ||
| 156 | } | ||
| 157 | |||
| 158 | static inline void __be64_to_cpus(__u64 *p) | ||
| 159 | { | ||
| 160 | #ifdef __LITTLE_ENDIAN | ||
| 161 | __swab64s(p); | ||
| 162 | #endif | ||
| 163 | } | ||
| 164 | |||
| 165 | static inline void __cpu_to_be64s(__u64 *p) | ||
| 166 | { | ||
| 167 | #ifdef __LITTLE_ENDIAN | ||
| 168 | __swab64s(p); | ||
| 169 | #endif | ||
| 170 | } | ||
| 171 | |||
| 172 | static inline __u16 __le16_to_cpup(const __le16 *p) | ||
| 173 | { | ||
| 174 | #ifdef __LITTLE_ENDIAN | ||
| 175 | return (__force __u16)*p; | ||
| 176 | #else | ||
| 177 | return __swab16p((__force __u16 *)p); | ||
| 178 | #endif | ||
| 179 | } | ||
| 180 | |||
| 181 | static inline __u32 __le32_to_cpup(const __le32 *p) | ||
| 182 | { | ||
| 183 | #ifdef __LITTLE_ENDIAN | ||
| 184 | return (__force __u32)*p; | ||
| 185 | #else | ||
| 186 | return __swab32p((__force __u32 *)p); | ||
| 187 | #endif | ||
| 188 | } | ||
| 189 | |||
| 190 | static inline __u64 __le64_to_cpup(const __le64 *p) | ||
| 191 | { | ||
| 192 | #ifdef __LITTLE_ENDIAN | ||
| 193 | return (__force __u64)*p; | ||
| 194 | #else | ||
| 195 | return __swab64p((__force __u64 *)p); | ||
| 196 | #endif | ||
| 197 | } | ||
| 198 | |||
| 199 | static inline __le16 __cpu_to_le16p(const __u16 *p) | ||
| 200 | { | ||
| 201 | #ifdef __LITTLE_ENDIAN | ||
| 202 | return (__force __le16)*p; | ||
| 203 | #else | ||
| 204 | return (__force __le16)__swab16p(p); | ||
| 205 | #endif | ||
| 206 | } | ||
| 207 | |||
| 208 | static inline __le32 __cpu_to_le32p(const __u32 *p) | ||
| 209 | { | ||
| 210 | #ifdef __LITTLE_ENDIAN | ||
| 211 | return (__force __le32)*p; | ||
| 212 | #else | ||
| 213 | return (__force __le32)__swab32p(p); | ||
| 214 | #endif | ||
| 215 | } | ||
| 216 | |||
| 217 | static inline __le64 __cpu_to_le64p(const __u64 *p) | ||
| 218 | { | ||
| 219 | #ifdef __LITTLE_ENDIAN | ||
| 220 | return (__force __le64)*p; | ||
| 221 | #else | ||
| 222 | return (__force __le64)__swab64p(p); | ||
| 223 | #endif | ||
| 224 | } | ||
| 225 | |||
| 226 | static inline __u16 __be16_to_cpup(const __be16 *p) | ||
| 227 | { | ||
| 228 | #ifdef __BIG_ENDIAN | ||
| 229 | return (__force __u16)*p; | ||
| 230 | #else | ||
| 231 | return __swab16p((__force __u16 *)p); | ||
| 232 | #endif | ||
| 233 | } | ||
| 234 | |||
| 235 | static inline __u32 __be32_to_cpup(const __be32 *p) | ||
| 236 | { | ||
| 237 | #ifdef __BIG_ENDIAN | ||
| 238 | return (__force __u32)*p; | ||
| 239 | #else | ||
| 240 | return __swab32p((__force __u32 *)p); | ||
| 241 | #endif | ||
| 242 | } | ||
| 243 | |||
| 244 | static inline __u64 __be64_to_cpup(const __be64 *p) | ||
| 245 | { | ||
| 246 | #ifdef __BIG_ENDIAN | ||
| 247 | return (__force __u64)*p; | ||
| 248 | #else | ||
| 249 | return __swab64p((__force __u64 *)p); | ||
| 250 | #endif | ||
| 251 | } | ||
| 252 | |||
| 253 | static inline __be16 __cpu_to_be16p(const __u16 *p) | ||
| 254 | { | ||
| 255 | #ifdef __BIG_ENDIAN | ||
| 256 | return (__force __be16)*p; | ||
| 257 | #else | ||
| 258 | return (__force __be16)__swab16p(p); | ||
| 259 | #endif | ||
| 260 | } | ||
| 261 | |||
| 262 | static inline __be32 __cpu_to_be32p(const __u32 *p) | ||
| 263 | { | ||
| 264 | #ifdef __BIG_ENDIAN | ||
| 265 | return (__force __be32)*p; | ||
| 266 | #else | ||
| 267 | return (__force __be32)__swab32p(p); | ||
| 268 | #endif | ||
| 269 | } | ||
| 270 | |||
| 271 | static inline __be64 __cpu_to_be64p(const __u64 *p) | ||
| 272 | { | ||
| 273 | #ifdef __BIG_ENDIAN | ||
| 274 | return (__force __be64)*p; | ||
| 275 | #else | ||
| 276 | return (__force __be64)__swab64p(p); | ||
| 277 | #endif | ||
| 278 | } | ||
| 279 | |||
| 280 | #ifdef __KERNEL__ | ||
| 281 | |||
| 282 | # define le16_to_cpu __le16_to_cpu | ||
| 283 | # define le32_to_cpu __le32_to_cpu | ||
| 284 | # define le64_to_cpu __le64_to_cpu | ||
| 285 | # define be16_to_cpu __be16_to_cpu | ||
| 286 | # define be32_to_cpu __be32_to_cpu | ||
| 287 | # define be64_to_cpu __be64_to_cpu | ||
| 288 | # define cpu_to_le16 __cpu_to_le16 | ||
| 289 | # define cpu_to_le32 __cpu_to_le32 | ||
| 290 | # define cpu_to_le64 __cpu_to_le64 | ||
| 291 | # define cpu_to_be16 __cpu_to_be16 | ||
| 292 | # define cpu_to_be32 __cpu_to_be32 | ||
| 293 | # define cpu_to_be64 __cpu_to_be64 | ||
| 294 | |||
| 295 | # define le16_to_cpup __le16_to_cpup | ||
| 296 | # define le32_to_cpup __le32_to_cpup | ||
| 297 | # define le64_to_cpup __le64_to_cpup | ||
| 298 | # define be16_to_cpup __be16_to_cpup | ||
| 299 | # define be32_to_cpup __be32_to_cpup | ||
| 300 | # define be64_to_cpup __be64_to_cpup | ||
| 301 | # define cpu_to_le16p __cpu_to_le16p | ||
| 302 | # define cpu_to_le32p __cpu_to_le32p | ||
| 303 | # define cpu_to_le64p __cpu_to_le64p | ||
| 304 | # define cpu_to_be16p __cpu_to_be16p | ||
| 305 | # define cpu_to_be32p __cpu_to_be32p | ||
| 306 | # define cpu_to_be64p __cpu_to_be64p | ||
| 307 | |||
| 308 | # define le16_to_cpus __le16_to_cpus | ||
| 309 | # define le32_to_cpus __le32_to_cpus | ||
| 310 | # define le64_to_cpus __le64_to_cpus | ||
| 311 | # define be16_to_cpus __be16_to_cpus | ||
| 312 | # define be32_to_cpus __be32_to_cpus | ||
| 313 | # define be64_to_cpus __be64_to_cpus | ||
| 314 | # define cpu_to_le16s __cpu_to_le16s | ||
| 315 | # define cpu_to_le32s __cpu_to_le32s | ||
| 316 | # define cpu_to_le64s __cpu_to_le64s | ||
| 317 | # define cpu_to_be16s __cpu_to_be16s | ||
| 318 | # define cpu_to_be32s __cpu_to_be32s | ||
| 319 | # define cpu_to_be64s __cpu_to_be64s | ||
| 320 | |||
| 321 | /* | ||
| 322 | * They have to be macros in order to do the constant folding | ||
| 323 | * correctly - if the argument passed into a inline function | ||
| 324 | * it is no longer constant according to gcc.. | ||
| 325 | */ | ||
| 326 | # undef ntohl | ||
| 327 | # undef ntohs | ||
| 328 | # undef htonl | ||
| 329 | # undef htons | ||
| 330 | |||
| 331 | # define ___htonl(x) __cpu_to_be32(x) | ||
| 332 | # define ___htons(x) __cpu_to_be16(x) | ||
| 333 | # define ___ntohl(x) __be32_to_cpu(x) | ||
| 334 | # define ___ntohs(x) __be16_to_cpu(x) | ||
| 335 | |||
| 336 | # define htonl(x) ___htonl(x) | ||
| 337 | # define ntohl(x) ___ntohl(x) | ||
| 338 | # define htons(x) ___htons(x) | ||
| 339 | # define ntohs(x) ___ntohs(x) | ||
| 340 | |||
| 341 | static inline void le16_add_cpu(__le16 *var, u16 val) | ||
| 342 | { | ||
| 343 | *var = cpu_to_le16(le16_to_cpup(var) + val); | ||
| 344 | } | ||
| 345 | |||
| 346 | static inline void le32_add_cpu(__le32 *var, u32 val) | ||
| 347 | { | ||
| 348 | *var = cpu_to_le32(le32_to_cpup(var) + val); | ||
| 349 | } | ||
| 350 | |||
| 351 | static inline void le64_add_cpu(__le64 *var, u64 val) | ||
| 352 | { | ||
| 353 | *var = cpu_to_le64(le64_to_cpup(var) + val); | ||
| 354 | } | ||
| 355 | |||
| 356 | static inline void be16_add_cpu(__be16 *var, u16 val) | ||
| 357 | { | ||
| 358 | *var = cpu_to_be16(be16_to_cpup(var) + val); | ||
| 359 | } | ||
| 360 | |||
| 361 | static inline void be32_add_cpu(__be32 *var, u32 val) | ||
| 362 | { | ||
| 363 | *var = cpu_to_be32(be32_to_cpup(var) + val); | ||
| 364 | } | ||
| 365 | |||
| 366 | static inline void be64_add_cpu(__be64 *var, u64 val) | ||
| 367 | { | ||
| 368 | *var = cpu_to_be64(be64_to_cpup(var) + val); | ||
| 369 | } | ||
| 370 | |||
| 371 | #endif /* __KERNEL__ */ | ||
| 372 | #endif /* _LINUX_BYTEORDER_H */ | ||
diff --git a/include/linux/byteorder/Kbuild b/include/linux/byteorder/Kbuild index fbaa7f9cee32..38437225b092 100644 --- a/include/linux/byteorder/Kbuild +++ b/include/linux/byteorder/Kbuild | |||
| @@ -1,4 +1,2 @@ | |||
| 1 | unifdef-y += big_endian.h | 1 | unifdef-y += big_endian.h |
| 2 | unifdef-y += little_endian.h | 2 | unifdef-y += little_endian.h |
| 3 | unifdef-y += swab.h | ||
| 4 | unifdef-y += swabb.h | ||
diff --git a/include/linux/byteorder/big_endian.h b/include/linux/byteorder/big_endian.h index 1cba3f3efe5f..3c80fd7e8b56 100644 --- a/include/linux/byteorder/big_endian.h +++ b/include/linux/byteorder/big_endian.h | |||
| @@ -9,8 +9,7 @@ | |||
| 9 | #endif | 9 | #endif |
| 10 | 10 | ||
| 11 | #include <linux/types.h> | 11 | #include <linux/types.h> |
| 12 | #include <linux/byteorder/swab.h> | 12 | #include <linux/swab.h> |
| 13 | #include <linux/byteorder/swabb.h> | ||
| 14 | 13 | ||
| 15 | #define __constant_htonl(x) ((__force __be32)(__u32)(x)) | 14 | #define __constant_htonl(x) ((__force __be32)(__u32)(x)) |
| 16 | #define __constant_ntohl(x) ((__force __u32)(__be32)(x)) | 15 | #define __constant_ntohl(x) ((__force __u32)(__be32)(x)) |
diff --git a/include/linux/byteorder/little_endian.h b/include/linux/byteorder/little_endian.h index cedc1b5a289c..83195fb82962 100644 --- a/include/linux/byteorder/little_endian.h +++ b/include/linux/byteorder/little_endian.h | |||
| @@ -9,8 +9,7 @@ | |||
| 9 | #endif | 9 | #endif |
| 10 | 10 | ||
| 11 | #include <linux/types.h> | 11 | #include <linux/types.h> |
| 12 | #include <linux/byteorder/swab.h> | 12 | #include <linux/swab.h> |
| 13 | #include <linux/byteorder/swabb.h> | ||
| 14 | 13 | ||
| 15 | #define __constant_htonl(x) ((__force __be32)___constant_swab32((x))) | 14 | #define __constant_htonl(x) ((__force __be32)___constant_swab32((x))) |
| 16 | #define __constant_ntohl(x) ___constant_swab32((__force __be32)(x)) | 15 | #define __constant_ntohl(x) ___constant_swab32((__force __be32)(x)) |
diff --git a/include/linux/byteorder/swab.h b/include/linux/byteorder/swab.h deleted file mode 100644 index 142134ff1645..000000000000 --- a/include/linux/byteorder/swab.h +++ /dev/null | |||
| @@ -1,222 +0,0 @@ | |||
| 1 | #ifndef _LINUX_BYTEORDER_SWAB_H | ||
| 2 | #define _LINUX_BYTEORDER_SWAB_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * linux/byteorder/swab.h | ||
| 6 | * Byte-swapping, independently from CPU endianness | ||
| 7 | * swabXX[ps]?(foo) | ||
| 8 | * | ||
| 9 | * Francois-Rene Rideau <fare@tunes.org> 19971205 | ||
| 10 | * separated swab functions from cpu_to_XX, | ||
| 11 | * to clean up support for bizarre-endian architectures. | ||
| 12 | * | ||
| 13 | * Trent Piepho <xyzzy@speakeasy.org> 2007114 | ||
| 14 | * make constant-folding work, provide C versions that | ||
| 15 | * gcc can optimize better, explain different versions | ||
| 16 | * | ||
| 17 | * See asm-i386/byteorder.h and suches for examples of how to provide | ||
| 18 | * architecture-dependent optimized versions | ||
| 19 | * | ||
| 20 | */ | ||
| 21 | |||
| 22 | #include <linux/compiler.h> | ||
| 23 | |||
| 24 | /* Functions/macros defined, there are a lot: | ||
| 25 | * | ||
| 26 | * ___swabXX | ||
| 27 | * Generic C versions of the swab functions. | ||
| 28 | * | ||
| 29 | * ___constant_swabXX | ||
| 30 | * C versions that gcc can fold into a compile-time constant when | ||
| 31 | * the argument is a compile-time constant. | ||
| 32 | * | ||
| 33 | * __arch__swabXX[sp]? | ||
| 34 | * Architecture optimized versions of all the swab functions | ||
| 35 | * (including the s and p versions). These can be defined in | ||
| 36 | * asm-arch/byteorder.h. Any which are not, are defined here. | ||
| 37 | * __arch__swabXXs() is defined in terms of __arch__swabXXp(), which | ||
| 38 | * is defined in terms of __arch__swabXX(), which is in turn defined | ||
| 39 | * in terms of ___swabXX(x). | ||
| 40 | * These must be macros. They may be unsafe for arguments with | ||
| 41 | * side-effects. | ||
| 42 | * | ||
| 43 | * __fswabXX | ||
| 44 | * Inline function versions of the __arch__ macros. These _are_ safe | ||
| 45 | * if the arguments have side-effects. Note there are no s and p | ||
| 46 | * versions of these. | ||
| 47 | * | ||
| 48 | * __swabXX[sb] | ||
| 49 | * There are the ones you should actually use. The __swabXX versions | ||
| 50 | * will be a constant given a constant argument and use the arch | ||
| 51 | * specific code (if any) for non-constant arguments. The s and p | ||
| 52 | * versions always use the arch specific code (constant folding | ||
| 53 | * doesn't apply). They are safe to use with arguments with | ||
| 54 | * side-effects. | ||
| 55 | * | ||
| 56 | * swabXX[sb] | ||
| 57 | * Nicknames for __swabXX[sb] to use in the kernel. | ||
| 58 | */ | ||
| 59 | |||
| 60 | /* casts are necessary for constants, because we never know how for sure | ||
| 61 | * how U/UL/ULL map to __u16, __u32, __u64. At least not in a portable way. | ||
| 62 | */ | ||
| 63 | |||
| 64 | static __inline__ __attribute_const__ __u16 ___swab16(__u16 x) | ||
| 65 | { | ||
| 66 | return x<<8 | x>>8; | ||
| 67 | } | ||
| 68 | static __inline__ __attribute_const__ __u32 ___swab32(__u32 x) | ||
| 69 | { | ||
| 70 | return x<<24 | x>>24 | | ||
| 71 | (x & (__u32)0x0000ff00UL)<<8 | | ||
| 72 | (x & (__u32)0x00ff0000UL)>>8; | ||
| 73 | } | ||
| 74 | static __inline__ __attribute_const__ __u64 ___swab64(__u64 x) | ||
| 75 | { | ||
| 76 | return x<<56 | x>>56 | | ||
| 77 | (x & (__u64)0x000000000000ff00ULL)<<40 | | ||
| 78 | (x & (__u64)0x0000000000ff0000ULL)<<24 | | ||
| 79 | (x & (__u64)0x00000000ff000000ULL)<< 8 | | ||
| 80 | (x & (__u64)0x000000ff00000000ULL)>> 8 | | ||
| 81 | (x & (__u64)0x0000ff0000000000ULL)>>24 | | ||
| 82 | (x & (__u64)0x00ff000000000000ULL)>>40; | ||
| 83 | } | ||
| 84 | |||
| 85 | #define ___constant_swab16(x) \ | ||
| 86 | ((__u16)( \ | ||
| 87 | (((__u16)(x) & (__u16)0x00ffU) << 8) | \ | ||
| 88 | (((__u16)(x) & (__u16)0xff00U) >> 8) )) | ||
| 89 | #define ___constant_swab32(x) \ | ||
| 90 | ((__u32)( \ | ||
| 91 | (((__u32)(x) & (__u32)0x000000ffUL) << 24) | \ | ||
| 92 | (((__u32)(x) & (__u32)0x0000ff00UL) << 8) | \ | ||
| 93 | (((__u32)(x) & (__u32)0x00ff0000UL) >> 8) | \ | ||
| 94 | (((__u32)(x) & (__u32)0xff000000UL) >> 24) )) | ||
| 95 | #define ___constant_swab64(x) \ | ||
| 96 | ((__u64)( \ | ||
| 97 | (__u64)(((__u64)(x) & (__u64)0x00000000000000ffULL) << 56) | \ | ||
| 98 | (__u64)(((__u64)(x) & (__u64)0x000000000000ff00ULL) << 40) | \ | ||
| 99 | (__u64)(((__u64)(x) & (__u64)0x0000000000ff0000ULL) << 24) | \ | ||
| 100 | (__u64)(((__u64)(x) & (__u64)0x00000000ff000000ULL) << 8) | \ | ||
| 101 | (__u64)(((__u64)(x) & (__u64)0x000000ff00000000ULL) >> 8) | \ | ||
| 102 | (__u64)(((__u64)(x) & (__u64)0x0000ff0000000000ULL) >> 24) | \ | ||
| 103 | (__u64)(((__u64)(x) & (__u64)0x00ff000000000000ULL) >> 40) | \ | ||
| 104 | (__u64)(((__u64)(x) & (__u64)0xff00000000000000ULL) >> 56) )) | ||
| 105 | |||
| 106 | /* | ||
| 107 | * provide defaults when no architecture-specific optimization is detected | ||
| 108 | */ | ||
| 109 | #ifndef __arch__swab16 | ||
| 110 | # define __arch__swab16(x) ___swab16(x) | ||
| 111 | #endif | ||
| 112 | #ifndef __arch__swab32 | ||
| 113 | # define __arch__swab32(x) ___swab32(x) | ||
| 114 | #endif | ||
| 115 | #ifndef __arch__swab64 | ||
| 116 | # define __arch__swab64(x) ___swab64(x) | ||
| 117 | #endif | ||
| 118 | |||
| 119 | #ifndef __arch__swab16p | ||
| 120 | # define __arch__swab16p(x) __arch__swab16(*(x)) | ||
| 121 | #endif | ||
| 122 | #ifndef __arch__swab32p | ||
| 123 | # define __arch__swab32p(x) __arch__swab32(*(x)) | ||
| 124 | #endif | ||
| 125 | #ifndef __arch__swab64p | ||
| 126 | # define __arch__swab64p(x) __arch__swab64(*(x)) | ||
| 127 | #endif | ||
| 128 | |||
| 129 | #ifndef __arch__swab16s | ||
| 130 | # define __arch__swab16s(x) ((void)(*(x) = __arch__swab16p(x))) | ||
| 131 | #endif | ||
| 132 | #ifndef __arch__swab32s | ||
| 133 | # define __arch__swab32s(x) ((void)(*(x) = __arch__swab32p(x))) | ||
| 134 | #endif | ||
| 135 | #ifndef __arch__swab64s | ||
| 136 | # define __arch__swab64s(x) ((void)(*(x) = __arch__swab64p(x))) | ||
| 137 | #endif | ||
| 138 | |||
| 139 | |||
| 140 | /* | ||
| 141 | * Allow constant folding | ||
| 142 | */ | ||
| 143 | #if defined(__GNUC__) && defined(__OPTIMIZE__) | ||
| 144 | # define __swab16(x) \ | ||
| 145 | (__builtin_constant_p((__u16)(x)) ? \ | ||
| 146 | ___constant_swab16((x)) : \ | ||
| 147 | __fswab16((x))) | ||
| 148 | # define __swab32(x) \ | ||
| 149 | (__builtin_constant_p((__u32)(x)) ? \ | ||
| 150 | ___constant_swab32((x)) : \ | ||
| 151 | __fswab32((x))) | ||
| 152 | # define __swab64(x) \ | ||
| 153 | (__builtin_constant_p((__u64)(x)) ? \ | ||
| 154 | ___constant_swab64((x)) : \ | ||
| 155 | __fswab64((x))) | ||
| 156 | #else | ||
| 157 | # define __swab16(x) __fswab16(x) | ||
| 158 | # define __swab32(x) __fswab32(x) | ||
| 159 | # define __swab64(x) __fswab64(x) | ||
| 160 | #endif /* OPTIMIZE */ | ||
| 161 | |||
| 162 | |||
| 163 | static __inline__ __attribute_const__ __u16 __fswab16(__u16 x) | ||
| 164 | { | ||
| 165 | return __arch__swab16(x); | ||
| 166 | } | ||
| 167 | static __inline__ __u16 __swab16p(const __u16 *x) | ||
| 168 | { | ||
| 169 | return __arch__swab16p(x); | ||
| 170 | } | ||
| 171 | static __inline__ void __swab16s(__u16 *addr) | ||
| 172 | { | ||
| 173 | __arch__swab16s(addr); | ||
| 174 | } | ||
| 175 | |||
| 176 | static __inline__ __attribute_const__ __u32 __fswab32(__u32 x) | ||
| 177 | { | ||
| 178 | return __arch__swab32(x); | ||
| 179 | } | ||
| 180 | static __inline__ __u32 __swab32p(const __u32 *x) | ||
| 181 | { | ||
| 182 | return __arch__swab32p(x); | ||
| 183 | } | ||
| 184 | static __inline__ void __swab32s(__u32 *addr) | ||
| 185 | { | ||
| 186 | __arch__swab32s(addr); | ||
| 187 | } | ||
| 188 | |||
| 189 | #ifdef __BYTEORDER_HAS_U64__ | ||
| 190 | static __inline__ __attribute_const__ __u64 __fswab64(__u64 x) | ||
| 191 | { | ||
| 192 | # ifdef __SWAB_64_THRU_32__ | ||
| 193 | __u32 h = x >> 32; | ||
| 194 | __u32 l = x & ((1ULL<<32)-1); | ||
| 195 | return (((__u64)__swab32(l)) << 32) | ((__u64)(__swab32(h))); | ||
| 196 | # else | ||
| 197 | return __arch__swab64(x); | ||
| 198 | # endif | ||
| 199 | } | ||
| 200 | static __inline__ __u64 __swab64p(const __u64 *x) | ||
| 201 | { | ||
| 202 | return __arch__swab64p(x); | ||
| 203 | } | ||
| 204 | static __inline__ void __swab64s(__u64 *addr) | ||
| 205 | { | ||
| 206 | __arch__swab64s(addr); | ||
| 207 | } | ||
| 208 | #endif /* __BYTEORDER_HAS_U64__ */ | ||
| 209 | |||
| 210 | #if defined(__KERNEL__) | ||
| 211 | #define swab16 __swab16 | ||
| 212 | #define swab32 __swab32 | ||
| 213 | #define swab64 __swab64 | ||
| 214 | #define swab16p __swab16p | ||
| 215 | #define swab32p __swab32p | ||
| 216 | #define swab64p __swab64p | ||
| 217 | #define swab16s __swab16s | ||
| 218 | #define swab32s __swab32s | ||
| 219 | #define swab64s __swab64s | ||
| 220 | #endif | ||
| 221 | |||
| 222 | #endif /* _LINUX_BYTEORDER_SWAB_H */ | ||
diff --git a/include/linux/byteorder/swabb.h b/include/linux/byteorder/swabb.h deleted file mode 100644 index 8c780c7d779e..000000000000 --- a/include/linux/byteorder/swabb.h +++ /dev/null | |||
| @@ -1,135 +0,0 @@ | |||
| 1 | #ifndef _LINUX_BYTEORDER_SWABB_H | ||
| 2 | #define _LINUX_BYTEORDER_SWABB_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * linux/byteorder/swabb.h | ||
| 6 | * SWAp Bytes Bizarrely | ||
| 7 | * swaHHXX[ps]?(foo) | ||
| 8 | * | ||
| 9 | * Support for obNUXIous pdp-endian and other bizarre architectures. | ||
| 10 | * Will Linux ever run on such ancient beasts? if not, this file | ||
| 11 | * will be but a programming pearl. Still, it's a reminder that we | ||
| 12 | * shouldn't be making too many assumptions when trying to be portable. | ||
| 13 | * | ||
| 14 | */ | ||
| 15 | |||
| 16 | /* | ||
| 17 | * Meaning of the names I chose (vaxlinux people feel free to correct them): | ||
| 18 | * swahw32 swap 16-bit half-words in a 32-bit word | ||
| 19 | * swahb32 swap 8-bit halves of each 16-bit half-word in a 32-bit word | ||
| 20 | * | ||
| 21 | * No 64-bit support yet. I don't know NUXI conventions for long longs. | ||
| 22 | * I guarantee it will be a mess when it's there, though :-> | ||
| 23 | * It will be even worse if there are conflicting 64-bit conventions. | ||
| 24 | * Hopefully, no one ever used 64-bit objects on NUXI machines. | ||
| 25 | * | ||
| 26 | */ | ||
| 27 | |||
| 28 | #include <linux/types.h> | ||
| 29 | |||
| 30 | #define ___swahw32(x) \ | ||
| 31 | ({ \ | ||
| 32 | __u32 __x = (x); \ | ||
| 33 | ((__u32)( \ | ||
| 34 | (((__u32)(__x) & (__u32)0x0000ffffUL) << 16) | \ | ||
| 35 | (((__u32)(__x) & (__u32)0xffff0000UL) >> 16) )); \ | ||
| 36 | }) | ||
| 37 | #define ___swahb32(x) \ | ||
| 38 | ({ \ | ||
| 39 | __u32 __x = (x); \ | ||
| 40 | ((__u32)( \ | ||
| 41 | (((__u32)(__x) & (__u32)0x00ff00ffUL) << 8) | \ | ||
| 42 | (((__u32)(__x) & (__u32)0xff00ff00UL) >> 8) )); \ | ||
| 43 | }) | ||
| 44 | |||
| 45 | #define ___constant_swahw32(x) \ | ||
| 46 | ((__u32)( \ | ||
| 47 | (((__u32)(x) & (__u32)0x0000ffffUL) << 16) | \ | ||
| 48 | (((__u32)(x) & (__u32)0xffff0000UL) >> 16) )) | ||
| 49 | #define ___constant_swahb32(x) \ | ||
| 50 | ((__u32)( \ | ||
| 51 | (((__u32)(x) & (__u32)0x00ff00ffUL) << 8) | \ | ||
| 52 | (((__u32)(x) & (__u32)0xff00ff00UL) >> 8) )) | ||
| 53 | |||
| 54 | /* | ||
| 55 | * provide defaults when no architecture-specific optimization is detected | ||
| 56 | */ | ||
| 57 | #ifndef __arch__swahw32 | ||
| 58 | # define __arch__swahw32(x) ___swahw32(x) | ||
| 59 | #endif | ||
| 60 | #ifndef __arch__swahb32 | ||
| 61 | # define __arch__swahb32(x) ___swahb32(x) | ||
| 62 | #endif | ||
| 63 | |||
| 64 | #ifndef __arch__swahw32p | ||
| 65 | # define __arch__swahw32p(x) __swahw32(*(x)) | ||
| 66 | #endif | ||
| 67 | #ifndef __arch__swahb32p | ||
| 68 | # define __arch__swahb32p(x) __swahb32(*(x)) | ||
| 69 | #endif | ||
| 70 | |||
| 71 | #ifndef __arch__swahw32s | ||
| 72 | # define __arch__swahw32s(x) do { *(x) = __swahw32p((x)); } while (0) | ||
| 73 | #endif | ||
| 74 | #ifndef __arch__swahb32s | ||
| 75 | # define __arch__swahb32s(x) do { *(x) = __swahb32p((x)); } while (0) | ||
| 76 | #endif | ||
| 77 | |||
| 78 | |||
| 79 | /* | ||
| 80 | * Allow constant folding | ||
| 81 | */ | ||
| 82 | #define __swahw32(x) \ | ||
| 83 | (__builtin_constant_p((__u32)(x)) ? \ | ||
| 84 | ___swahw32((x)) : \ | ||
| 85 | __fswahw32((x))) | ||
| 86 | #define __swahb32(x) \ | ||
| 87 | (__builtin_constant_p((__u32)(x)) ? \ | ||
| 88 | ___swahb32((x)) : \ | ||
| 89 | __fswahb32((x))) | ||
| 90 | |||
| 91 | |||
| 92 | static inline __u32 __fswahw32(__u32 x) | ||
| 93 | { | ||
| 94 | return __arch__swahw32(x); | ||
| 95 | } | ||
| 96 | |||
| 97 | static inline __u32 __swahw32p(__u32 *x) | ||
| 98 | { | ||
| 99 | return __arch__swahw32p(x); | ||
| 100 | } | ||
| 101 | |||
| 102 | static inline void __swahw32s(__u32 *addr) | ||
| 103 | { | ||
| 104 | __arch__swahw32s(addr); | ||
| 105 | } | ||
| 106 | |||
| 107 | static inline __u32 __fswahb32(__u32 x) | ||
| 108 | { | ||
| 109 | return __arch__swahb32(x); | ||
| 110 | } | ||
| 111 | |||
| 112 | static inline __u32 __swahb32p(__u32 *x) | ||
| 113 | { | ||
| 114 | return __arch__swahb32p(x); | ||
| 115 | } | ||
| 116 | |||
| 117 | static inline void __swahb32s(__u32 *addr) | ||
| 118 | { | ||
| 119 | __arch__swahb32s(addr); | ||
| 120 | } | ||
| 121 | |||
| 122 | #ifdef __BYTEORDER_HAS_U64__ | ||
| 123 | /* | ||
| 124 | * Not supported yet | ||
| 125 | */ | ||
| 126 | #endif /* __BYTEORDER_HAS_U64__ */ | ||
| 127 | |||
| 128 | #define swahw32 __swahw32 | ||
| 129 | #define swahb32 __swahb32 | ||
| 130 | #define swahw32p __swahw32p | ||
| 131 | #define swahb32p __swahb32p | ||
| 132 | #define swahw32s __swahw32s | ||
| 133 | #define swahb32s __swahb32s | ||
| 134 | |||
| 135 | #endif /* _LINUX_BYTEORDER_SWABB_H */ | ||
diff --git a/include/linux/can/core.h b/include/linux/can/core.h index f50785ad4781..25085cbadcfc 100644 --- a/include/linux/can/core.h +++ b/include/linux/can/core.h | |||
| @@ -19,7 +19,7 @@ | |||
| 19 | #include <linux/skbuff.h> | 19 | #include <linux/skbuff.h> |
| 20 | #include <linux/netdevice.h> | 20 | #include <linux/netdevice.h> |
| 21 | 21 | ||
| 22 | #define CAN_VERSION "20081130" | 22 | #define CAN_VERSION "20090105" |
| 23 | 23 | ||
| 24 | /* increment this number each time you change some user-space interface */ | 24 | /* increment this number each time you change some user-space interface */ |
| 25 | #define CAN_ABI_VERSION "8" | 25 | #define CAN_ABI_VERSION "8" |
diff --git a/include/linux/capability.h b/include/linux/capability.h index e22f48c2a46f..02bdb768d43b 100644 --- a/include/linux/capability.h +++ b/include/linux/capability.h | |||
| @@ -529,8 +529,21 @@ extern const kernel_cap_t __cap_init_eff_set; | |||
| 529 | * | 529 | * |
| 530 | * Note that this does not set PF_SUPERPRIV on the task. | 530 | * Note that this does not set PF_SUPERPRIV on the task. |
| 531 | */ | 531 | */ |
| 532 | #define has_capability(t, cap) (security_capable((t), (cap)) == 0) | 532 | #define has_capability(t, cap) (security_real_capable((t), (cap)) == 0) |
| 533 | #define has_capability_noaudit(t, cap) (security_capable_noaudit((t), (cap)) == 0) | 533 | |
| 534 | /** | ||
| 535 | * has_capability_noaudit - Determine if a task has a superior capability available (unaudited) | ||
| 536 | * @t: The task in question | ||
| 537 | * @cap: The capability to be tested for | ||
| 538 | * | ||
| 539 | * Return true if the specified task has the given superior capability | ||
| 540 | * currently in effect, false if not, but don't write an audit message for the | ||
| 541 | * check. | ||
| 542 | * | ||
| 543 | * Note that this does not set PF_SUPERPRIV on the task. | ||
| 544 | */ | ||
| 545 | #define has_capability_noaudit(t, cap) \ | ||
| 546 | (security_real_capable_noaudit((t), (cap)) == 0) | ||
| 534 | 547 | ||
| 535 | extern int capable(int cap); | 548 | extern int capable(int cap); |
| 536 | 549 | ||
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 1164963c3a85..e267e62827bb 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
| @@ -52,9 +52,9 @@ struct cgroup_subsys_state { | |||
| 52 | * hierarchy structure */ | 52 | * hierarchy structure */ |
| 53 | struct cgroup *cgroup; | 53 | struct cgroup *cgroup; |
| 54 | 54 | ||
| 55 | /* State maintained by the cgroup system to allow | 55 | /* State maintained by the cgroup system to allow subsystems |
| 56 | * subsystems to be "busy". Should be accessed via css_get() | 56 | * to be "busy". Should be accessed via css_get(), |
| 57 | * and css_put() */ | 57 | * css_tryget() and and css_put(). */ |
| 58 | 58 | ||
| 59 | atomic_t refcnt; | 59 | atomic_t refcnt; |
| 60 | 60 | ||
| @@ -64,11 +64,14 @@ struct cgroup_subsys_state { | |||
| 64 | /* bits in struct cgroup_subsys_state flags field */ | 64 | /* bits in struct cgroup_subsys_state flags field */ |
| 65 | enum { | 65 | enum { |
| 66 | CSS_ROOT, /* This CSS is the root of the subsystem */ | 66 | CSS_ROOT, /* This CSS is the root of the subsystem */ |
| 67 | CSS_REMOVED, /* This CSS is dead */ | ||
| 67 | }; | 68 | }; |
| 68 | 69 | ||
| 69 | /* | 70 | /* |
| 70 | * Call css_get() to hold a reference on the cgroup; | 71 | * Call css_get() to hold a reference on the css; it can be used |
| 71 | * | 72 | * for a reference obtained via: |
| 73 | * - an existing ref-counted reference to the css | ||
| 74 | * - task->cgroups for a locked task | ||
| 72 | */ | 75 | */ |
| 73 | 76 | ||
| 74 | static inline void css_get(struct cgroup_subsys_state *css) | 77 | static inline void css_get(struct cgroup_subsys_state *css) |
| @@ -77,9 +80,32 @@ static inline void css_get(struct cgroup_subsys_state *css) | |||
| 77 | if (!test_bit(CSS_ROOT, &css->flags)) | 80 | if (!test_bit(CSS_ROOT, &css->flags)) |
| 78 | atomic_inc(&css->refcnt); | 81 | atomic_inc(&css->refcnt); |
| 79 | } | 82 | } |
| 83 | |||
| 84 | static inline bool css_is_removed(struct cgroup_subsys_state *css) | ||
| 85 | { | ||
| 86 | return test_bit(CSS_REMOVED, &css->flags); | ||
| 87 | } | ||
| 88 | |||
| 89 | /* | ||
| 90 | * Call css_tryget() to take a reference on a css if your existing | ||
| 91 | * (known-valid) reference isn't already ref-counted. Returns false if | ||
| 92 | * the css has been destroyed. | ||
| 93 | */ | ||
| 94 | |||
| 95 | static inline bool css_tryget(struct cgroup_subsys_state *css) | ||
| 96 | { | ||
| 97 | if (test_bit(CSS_ROOT, &css->flags)) | ||
| 98 | return true; | ||
| 99 | while (!atomic_inc_not_zero(&css->refcnt)) { | ||
| 100 | if (test_bit(CSS_REMOVED, &css->flags)) | ||
| 101 | return false; | ||
| 102 | } | ||
| 103 | return true; | ||
| 104 | } | ||
| 105 | |||
| 80 | /* | 106 | /* |
| 81 | * css_put() should be called to release a reference taken by | 107 | * css_put() should be called to release a reference taken by |
| 82 | * css_get() | 108 | * css_get() or css_tryget() |
| 83 | */ | 109 | */ |
| 84 | 110 | ||
| 85 | extern void __css_put(struct cgroup_subsys_state *css); | 111 | extern void __css_put(struct cgroup_subsys_state *css); |
| @@ -116,7 +142,7 @@ struct cgroup { | |||
| 116 | struct list_head children; /* my children */ | 142 | struct list_head children; /* my children */ |
| 117 | 143 | ||
| 118 | struct cgroup *parent; /* my parent */ | 144 | struct cgroup *parent; /* my parent */ |
| 119 | struct dentry *dentry; /* cgroup fs entry */ | 145 | struct dentry *dentry; /* cgroup fs entry, RCU protected */ |
| 120 | 146 | ||
| 121 | /* Private pointers for each registered subsystem */ | 147 | /* Private pointers for each registered subsystem */ |
| 122 | struct cgroup_subsys_state *subsys[CGROUP_SUBSYS_COUNT]; | 148 | struct cgroup_subsys_state *subsys[CGROUP_SUBSYS_COUNT]; |
| @@ -145,6 +171,9 @@ struct cgroup { | |||
| 145 | int pids_use_count; | 171 | int pids_use_count; |
| 146 | /* Length of the current tasks_pids array */ | 172 | /* Length of the current tasks_pids array */ |
| 147 | int pids_length; | 173 | int pids_length; |
| 174 | |||
| 175 | /* For RCU-protected deletion */ | ||
| 176 | struct rcu_head rcu_head; | ||
| 148 | }; | 177 | }; |
| 149 | 178 | ||
| 150 | /* A css_set is a structure holding pointers to a set of | 179 | /* A css_set is a structure holding pointers to a set of |
| @@ -329,13 +358,7 @@ struct cgroup_subsys { | |||
| 329 | struct cgroup *cgrp); | 358 | struct cgroup *cgrp); |
| 330 | void (*post_clone)(struct cgroup_subsys *ss, struct cgroup *cgrp); | 359 | void (*post_clone)(struct cgroup_subsys *ss, struct cgroup *cgrp); |
| 331 | void (*bind)(struct cgroup_subsys *ss, struct cgroup *root); | 360 | void (*bind)(struct cgroup_subsys *ss, struct cgroup *root); |
| 332 | /* | 361 | |
| 333 | * This routine is called with the task_lock of mm->owner held | ||
| 334 | */ | ||
| 335 | void (*mm_owner_changed)(struct cgroup_subsys *ss, | ||
| 336 | struct cgroup *old, | ||
| 337 | struct cgroup *new, | ||
| 338 | struct task_struct *p); | ||
| 339 | int subsys_id; | 362 | int subsys_id; |
| 340 | int active; | 363 | int active; |
| 341 | int disabled; | 364 | int disabled; |
| @@ -343,9 +366,23 @@ struct cgroup_subsys { | |||
| 343 | #define MAX_CGROUP_TYPE_NAMELEN 32 | 366 | #define MAX_CGROUP_TYPE_NAMELEN 32 |
| 344 | const char *name; | 367 | const char *name; |
| 345 | 368 | ||
| 346 | /* Protected by RCU */ | 369 | /* |
| 347 | struct cgroupfs_root *root; | 370 | * Protects sibling/children links of cgroups in this |
| 371 | * hierarchy, plus protects which hierarchy (or none) the | ||
| 372 | * subsystem is a part of (i.e. root/sibling). To avoid | ||
| 373 | * potential deadlocks, the following operations should not be | ||
| 374 | * undertaken while holding any hierarchy_mutex: | ||
| 375 | * | ||
| 376 | * - allocating memory | ||
| 377 | * - initiating hotplug events | ||
| 378 | */ | ||
| 379 | struct mutex hierarchy_mutex; | ||
| 348 | 380 | ||
| 381 | /* | ||
| 382 | * Link to parent, and list entry in parent's children. | ||
| 383 | * Protected by this->hierarchy_mutex and cgroup_lock() | ||
| 384 | */ | ||
| 385 | struct cgroupfs_root *root; | ||
| 349 | struct list_head sibling; | 386 | struct list_head sibling; |
| 350 | }; | 387 | }; |
| 351 | 388 | ||
| @@ -400,9 +437,6 @@ void cgroup_iter_end(struct cgroup *cgrp, struct cgroup_iter *it); | |||
| 400 | int cgroup_scan_tasks(struct cgroup_scanner *scan); | 437 | int cgroup_scan_tasks(struct cgroup_scanner *scan); |
| 401 | int cgroup_attach_task(struct cgroup *, struct task_struct *); | 438 | int cgroup_attach_task(struct cgroup *, struct task_struct *); |
| 402 | 439 | ||
| 403 | void cgroup_mm_owner_callbacks(struct task_struct *old, | ||
| 404 | struct task_struct *new); | ||
| 405 | |||
| 406 | #else /* !CONFIG_CGROUPS */ | 440 | #else /* !CONFIG_CGROUPS */ |
| 407 | 441 | ||
| 408 | static inline int cgroup_init_early(void) { return 0; } | 442 | static inline int cgroup_init_early(void) { return 0; } |
| @@ -420,9 +454,6 @@ static inline int cgroupstats_build(struct cgroupstats *stats, | |||
| 420 | return -EINVAL; | 454 | return -EINVAL; |
| 421 | } | 455 | } |
| 422 | 456 | ||
| 423 | static inline void cgroup_mm_owner_callbacks(struct task_struct *old, | ||
| 424 | struct task_struct *new) {} | ||
| 425 | |||
| 426 | #endif /* !CONFIG_CGROUPS */ | 457 | #endif /* !CONFIG_CGROUPS */ |
| 427 | 458 | ||
| 428 | #endif /* _LINUX_CGROUP_H */ | 459 | #endif /* _LINUX_CGROUP_H */ |
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index af40f8eb86f0..1514d534deeb 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h | |||
| @@ -11,9 +11,19 @@ | |||
| 11 | /* The "volatile" is due to gcc bugs */ | 11 | /* The "volatile" is due to gcc bugs */ |
| 12 | #define barrier() __asm__ __volatile__("": : :"memory") | 12 | #define barrier() __asm__ __volatile__("": : :"memory") |
| 13 | 13 | ||
| 14 | /* This macro obfuscates arithmetic on a variable address so that gcc | ||
| 15 | shouldn't recognize the original var, and make assumptions about it */ | ||
| 16 | /* | 14 | /* |
| 15 | * This macro obfuscates arithmetic on a variable address so that gcc | ||
| 16 | * shouldn't recognize the original var, and make assumptions about it. | ||
| 17 | * | ||
| 18 | * This is needed because the C standard makes it undefined to do | ||
| 19 | * pointer arithmetic on "objects" outside their boundaries and the | ||
| 20 | * gcc optimizers assume this is the case. In particular they | ||
| 21 | * assume such arithmetic does not wrap. | ||
| 22 | * | ||
| 23 | * A miscompilation has been observed because of this on PPC. | ||
| 24 | * To work around it we hide the relationship of the pointer and the object | ||
| 25 | * using this macro. | ||
| 26 | * | ||
| 17 | * Versions of the ppc64 compiler before 4.1 had a bug where use of | 27 | * Versions of the ppc64 compiler before 4.1 had a bug where use of |
| 18 | * RELOC_HIDE could trash r30. The bug can be worked around by changing | 28 | * RELOC_HIDE could trash r30. The bug can be worked around by changing |
| 19 | * the inline assembly constraint from =g to =r, in this particular | 29 | * the inline assembly constraint from =g to =r, in this particular |
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 484b3abf61bb..384b38d3e8e2 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
| @@ -80,8 +80,8 @@ struct cpufreq_real_policy { | |||
| 80 | }; | 80 | }; |
| 81 | 81 | ||
| 82 | struct cpufreq_policy { | 82 | struct cpufreq_policy { |
| 83 | cpumask_t cpus; /* CPUs requiring sw coordination */ | 83 | cpumask_var_t cpus; /* CPUs requiring sw coordination */ |
| 84 | cpumask_t related_cpus; /* CPUs with any coordination */ | 84 | cpumask_var_t related_cpus; /* CPUs with any coordination */ |
| 85 | unsigned int shared_type; /* ANY or ALL affected CPUs | 85 | unsigned int shared_type; /* ANY or ALL affected CPUs |
| 86 | should set cpufreq */ | 86 | should set cpufreq */ |
| 87 | unsigned int cpu; /* cpu nr of registered CPU */ | 87 | unsigned int cpu; /* cpu nr of registered CPU */ |
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h index 8e540d32c9fe..90c6074a36ca 100644 --- a/include/linux/cpuset.h +++ b/include/linux/cpuset.h | |||
| @@ -20,8 +20,9 @@ extern int number_of_cpusets; /* How many cpusets are defined in system? */ | |||
| 20 | extern int cpuset_init_early(void); | 20 | extern int cpuset_init_early(void); |
| 21 | extern int cpuset_init(void); | 21 | extern int cpuset_init(void); |
| 22 | extern void cpuset_init_smp(void); | 22 | extern void cpuset_init_smp(void); |
| 23 | extern void cpuset_cpus_allowed(struct task_struct *p, cpumask_t *mask); | 23 | extern void cpuset_cpus_allowed(struct task_struct *p, struct cpumask *mask); |
| 24 | extern void cpuset_cpus_allowed_locked(struct task_struct *p, cpumask_t *mask); | 24 | extern void cpuset_cpus_allowed_locked(struct task_struct *p, |
| 25 | struct cpumask *mask); | ||
| 25 | extern nodemask_t cpuset_mems_allowed(struct task_struct *p); | 26 | extern nodemask_t cpuset_mems_allowed(struct task_struct *p); |
| 26 | #define cpuset_current_mems_allowed (current->mems_allowed) | 27 | #define cpuset_current_mems_allowed (current->mems_allowed) |
| 27 | void cpuset_init_current_mems_allowed(void); | 28 | void cpuset_init_current_mems_allowed(void); |
| @@ -78,18 +79,21 @@ extern int current_cpuset_is_being_rebound(void); | |||
| 78 | 79 | ||
| 79 | extern void rebuild_sched_domains(void); | 80 | extern void rebuild_sched_domains(void); |
| 80 | 81 | ||
| 82 | extern void cpuset_print_task_mems_allowed(struct task_struct *p); | ||
| 83 | |||
| 81 | #else /* !CONFIG_CPUSETS */ | 84 | #else /* !CONFIG_CPUSETS */ |
| 82 | 85 | ||
| 83 | static inline int cpuset_init_early(void) { return 0; } | 86 | static inline int cpuset_init_early(void) { return 0; } |
| 84 | static inline int cpuset_init(void) { return 0; } | 87 | static inline int cpuset_init(void) { return 0; } |
| 85 | static inline void cpuset_init_smp(void) {} | 88 | static inline void cpuset_init_smp(void) {} |
| 86 | 89 | ||
| 87 | static inline void cpuset_cpus_allowed(struct task_struct *p, cpumask_t *mask) | 90 | static inline void cpuset_cpus_allowed(struct task_struct *p, |
| 91 | struct cpumask *mask) | ||
| 88 | { | 92 | { |
| 89 | *mask = cpu_possible_map; | 93 | *mask = cpu_possible_map; |
| 90 | } | 94 | } |
| 91 | static inline void cpuset_cpus_allowed_locked(struct task_struct *p, | 95 | static inline void cpuset_cpus_allowed_locked(struct task_struct *p, |
| 92 | cpumask_t *mask) | 96 | struct cpumask *mask) |
| 93 | { | 97 | { |
| 94 | *mask = cpu_possible_map; | 98 | *mask = cpu_possible_map; |
| 95 | } | 99 | } |
| @@ -159,6 +163,10 @@ static inline void rebuild_sched_domains(void) | |||
| 159 | partition_sched_domains(1, NULL, NULL); | 163 | partition_sched_domains(1, NULL, NULL); |
| 160 | } | 164 | } |
| 161 | 165 | ||
| 166 | static inline void cpuset_print_task_mems_allowed(struct task_struct *p) | ||
| 167 | { | ||
| 168 | } | ||
| 169 | |||
| 162 | #endif /* !CONFIG_CPUSETS */ | 170 | #endif /* !CONFIG_CPUSETS */ |
| 163 | 171 | ||
| 164 | #endif /* _LINUX_CPUSET_H */ | 172 | #endif /* _LINUX_CPUSET_H */ |
diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h index e1a6c046cea3..23936b16426b 100644 --- a/include/linux/debugfs.h +++ b/include/linux/debugfs.h | |||
| @@ -63,6 +63,8 @@ struct dentry *debugfs_create_x16(const char *name, mode_t mode, | |||
| 63 | struct dentry *parent, u16 *value); | 63 | struct dentry *parent, u16 *value); |
| 64 | struct dentry *debugfs_create_x32(const char *name, mode_t mode, | 64 | struct dentry *debugfs_create_x32(const char *name, mode_t mode, |
| 65 | struct dentry *parent, u32 *value); | 65 | struct dentry *parent, u32 *value); |
| 66 | struct dentry *debugfs_create_size_t(const char *name, mode_t mode, | ||
| 67 | struct dentry *parent, size_t *value); | ||
| 66 | struct dentry *debugfs_create_bool(const char *name, mode_t mode, | 68 | struct dentry *debugfs_create_bool(const char *name, mode_t mode, |
| 67 | struct dentry *parent, u32 *value); | 69 | struct dentry *parent, u32 *value); |
| 68 | 70 | ||
diff --git a/include/linux/device.h b/include/linux/device.h index 1a3686d15f98..45e5b1921fbb 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
| @@ -65,7 +65,7 @@ struct bus_type { | |||
| 65 | int (*resume_early)(struct device *dev); | 65 | int (*resume_early)(struct device *dev); |
| 66 | int (*resume)(struct device *dev); | 66 | int (*resume)(struct device *dev); |
| 67 | 67 | ||
| 68 | struct pm_ext_ops *pm; | 68 | struct dev_pm_ops *pm; |
| 69 | 69 | ||
| 70 | struct bus_type_private *p; | 70 | struct bus_type_private *p; |
| 71 | }; | 71 | }; |
| @@ -133,7 +133,7 @@ struct device_driver { | |||
| 133 | int (*resume) (struct device *dev); | 133 | int (*resume) (struct device *dev); |
| 134 | struct attribute_group **groups; | 134 | struct attribute_group **groups; |
| 135 | 135 | ||
| 136 | struct pm_ops *pm; | 136 | struct dev_pm_ops *pm; |
| 137 | 137 | ||
| 138 | struct driver_private *p; | 138 | struct driver_private *p; |
| 139 | }; | 139 | }; |
| @@ -198,7 +198,7 @@ struct class { | |||
| 198 | int (*suspend)(struct device *dev, pm_message_t state); | 198 | int (*suspend)(struct device *dev, pm_message_t state); |
| 199 | int (*resume)(struct device *dev); | 199 | int (*resume)(struct device *dev); |
| 200 | 200 | ||
| 201 | struct pm_ops *pm; | 201 | struct dev_pm_ops *pm; |
| 202 | struct class_private *p; | 202 | struct class_private *p; |
| 203 | }; | 203 | }; |
| 204 | 204 | ||
| @@ -291,7 +291,7 @@ struct device_type { | |||
| 291 | int (*suspend)(struct device *dev, pm_message_t state); | 291 | int (*suspend)(struct device *dev, pm_message_t state); |
| 292 | int (*resume)(struct device *dev); | 292 | int (*resume)(struct device *dev); |
| 293 | 293 | ||
| 294 | struct pm_ops *pm; | 294 | struct dev_pm_ops *pm; |
| 295 | }; | 295 | }; |
| 296 | 296 | ||
| 297 | /* interface for exporting device attributes */ | 297 | /* interface for exporting device attributes */ |
| @@ -373,9 +373,9 @@ struct device { | |||
| 373 | 373 | ||
| 374 | struct kobject kobj; | 374 | struct kobject kobj; |
| 375 | char bus_id[BUS_ID_SIZE]; /* position on parent bus */ | 375 | char bus_id[BUS_ID_SIZE]; /* position on parent bus */ |
| 376 | unsigned uevent_suppress:1; | ||
| 376 | const char *init_name; /* initial name of the device */ | 377 | const char *init_name; /* initial name of the device */ |
| 377 | struct device_type *type; | 378 | struct device_type *type; |
| 378 | unsigned uevent_suppress:1; | ||
| 379 | 379 | ||
| 380 | struct semaphore sem; /* semaphore to synchronize calls to | 380 | struct semaphore sem; /* semaphore to synchronize calls to |
| 381 | * its driver. | 381 | * its driver. |
| @@ -408,12 +408,13 @@ struct device { | |||
| 408 | /* arch specific additions */ | 408 | /* arch specific additions */ |
| 409 | struct dev_archdata archdata; | 409 | struct dev_archdata archdata; |
| 410 | 410 | ||
| 411 | dev_t devt; /* dev_t, creates the sysfs "dev" */ | ||
| 412 | |||
| 411 | spinlock_t devres_lock; | 413 | spinlock_t devres_lock; |
| 412 | struct list_head devres_head; | 414 | struct list_head devres_head; |
| 413 | 415 | ||
| 414 | struct klist_node knode_class; | 416 | struct klist_node knode_class; |
| 415 | struct class *class; | 417 | struct class *class; |
| 416 | dev_t devt; /* dev_t, creates the sysfs "dev" */ | ||
| 417 | struct attribute_group **groups; /* optional groups */ | 418 | struct attribute_group **groups; /* optional groups */ |
| 418 | 419 | ||
| 419 | void (*release)(struct device *dev); | 420 | void (*release)(struct device *dev); |
| @@ -483,6 +484,17 @@ extern int device_rename(struct device *dev, char *new_name); | |||
| 483 | extern int device_move(struct device *dev, struct device *new_parent); | 484 | extern int device_move(struct device *dev, struct device *new_parent); |
| 484 | 485 | ||
| 485 | /* | 486 | /* |
| 487 | * Root device objects for grouping under /sys/devices | ||
| 488 | */ | ||
| 489 | extern struct device *__root_device_register(const char *name, | ||
| 490 | struct module *owner); | ||
| 491 | static inline struct device *root_device_register(const char *name) | ||
| 492 | { | ||
| 493 | return __root_device_register(name, THIS_MODULE); | ||
| 494 | } | ||
| 495 | extern void root_device_unregister(struct device *root); | ||
| 496 | |||
| 497 | /* | ||
| 486 | * Manual binding of a device to driver. See drivers/base/bus.c | 498 | * Manual binding of a device to driver. See drivers/base/bus.c |
| 487 | * for information on use. | 499 | * for information on use. |
| 488 | */ | 500 | */ |
| @@ -553,13 +565,13 @@ extern const char *dev_driver_string(const struct device *dev); | |||
| 553 | #define dev_info(dev, format, arg...) \ | 565 | #define dev_info(dev, format, arg...) \ |
| 554 | dev_printk(KERN_INFO , dev , format , ## arg) | 566 | dev_printk(KERN_INFO , dev , format , ## arg) |
| 555 | 567 | ||
| 556 | #if defined(CONFIG_DYNAMIC_PRINTK_DEBUG) | 568 | #if defined(DEBUG) |
| 569 | #define dev_dbg(dev, format, arg...) \ | ||
| 570 | dev_printk(KERN_DEBUG , dev , format , ## arg) | ||
| 571 | #elif defined(CONFIG_DYNAMIC_PRINTK_DEBUG) | ||
| 557 | #define dev_dbg(dev, format, ...) do { \ | 572 | #define dev_dbg(dev, format, ...) do { \ |
| 558 | dynamic_dev_dbg(dev, format, ##__VA_ARGS__); \ | 573 | dynamic_dev_dbg(dev, format, ##__VA_ARGS__); \ |
| 559 | } while (0) | 574 | } while (0) |
| 560 | #elif defined(DEBUG) | ||
| 561 | #define dev_dbg(dev, format, arg...) \ | ||
| 562 | dev_printk(KERN_DEBUG , dev , format , ## arg) | ||
| 563 | #else | 575 | #else |
| 564 | #define dev_dbg(dev, format, arg...) \ | 576 | #define dev_dbg(dev, format, arg...) \ |
| 565 | ({ if (0) dev_printk(KERN_DEBUG, dev, format, ##arg); 0; }) | 577 | ({ if (0) dev_printk(KERN_DEBUG, dev, format, ##arg); 0; }) |
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index adb0b084eb5a..64dea2ab326c 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h | |||
| @@ -29,32 +29,6 @@ | |||
| 29 | #include <linux/dma-mapping.h> | 29 | #include <linux/dma-mapping.h> |
| 30 | 30 | ||
| 31 | /** | 31 | /** |
| 32 | * enum dma_state - resource PNP/power management state | ||
| 33 | * @DMA_RESOURCE_SUSPEND: DMA device going into low power state | ||
| 34 | * @DMA_RESOURCE_RESUME: DMA device returning to full power | ||
| 35 | * @DMA_RESOURCE_AVAILABLE: DMA device available to the system | ||
| 36 | * @DMA_RESOURCE_REMOVED: DMA device removed from the system | ||
| 37 | */ | ||
| 38 | enum dma_state { | ||
| 39 | DMA_RESOURCE_SUSPEND, | ||
| 40 | DMA_RESOURCE_RESUME, | ||
| 41 | DMA_RESOURCE_AVAILABLE, | ||
| 42 | DMA_RESOURCE_REMOVED, | ||
| 43 | }; | ||
| 44 | |||
| 45 | /** | ||
| 46 | * enum dma_state_client - state of the channel in the client | ||
| 47 | * @DMA_ACK: client would like to use, or was using this channel | ||
| 48 | * @DMA_DUP: client has already seen this channel, or is not using this channel | ||
| 49 | * @DMA_NAK: client does not want to see any more channels | ||
| 50 | */ | ||
| 51 | enum dma_state_client { | ||
| 52 | DMA_ACK, | ||
| 53 | DMA_DUP, | ||
| 54 | DMA_NAK, | ||
| 55 | }; | ||
| 56 | |||
| 57 | /** | ||
| 58 | * typedef dma_cookie_t - an opaque DMA cookie | 32 | * typedef dma_cookie_t - an opaque DMA cookie |
| 59 | * | 33 | * |
| 60 | * if dma_cookie_t is >0 it's a DMA request cookie, <0 it's an error code | 34 | * if dma_cookie_t is >0 it's a DMA request cookie, <0 it's an error code |
| @@ -89,23 +63,13 @@ enum dma_transaction_type { | |||
| 89 | DMA_MEMSET, | 63 | DMA_MEMSET, |
| 90 | DMA_MEMCPY_CRC32C, | 64 | DMA_MEMCPY_CRC32C, |
| 91 | DMA_INTERRUPT, | 65 | DMA_INTERRUPT, |
| 66 | DMA_PRIVATE, | ||
| 92 | DMA_SLAVE, | 67 | DMA_SLAVE, |
| 93 | }; | 68 | }; |
| 94 | 69 | ||
| 95 | /* last transaction type for creation of the capabilities mask */ | 70 | /* last transaction type for creation of the capabilities mask */ |
| 96 | #define DMA_TX_TYPE_END (DMA_SLAVE + 1) | 71 | #define DMA_TX_TYPE_END (DMA_SLAVE + 1) |
| 97 | 72 | ||
| 98 | /** | ||
| 99 | * enum dma_slave_width - DMA slave register access width. | ||
| 100 | * @DMA_SLAVE_WIDTH_8BIT: Do 8-bit slave register accesses | ||
| 101 | * @DMA_SLAVE_WIDTH_16BIT: Do 16-bit slave register accesses | ||
| 102 | * @DMA_SLAVE_WIDTH_32BIT: Do 32-bit slave register accesses | ||
| 103 | */ | ||
| 104 | enum dma_slave_width { | ||
| 105 | DMA_SLAVE_WIDTH_8BIT, | ||
| 106 | DMA_SLAVE_WIDTH_16BIT, | ||
| 107 | DMA_SLAVE_WIDTH_32BIT, | ||
| 108 | }; | ||
| 109 | 73 | ||
| 110 | /** | 74 | /** |
| 111 | * enum dma_ctrl_flags - DMA flags to augment operation preparation, | 75 | * enum dma_ctrl_flags - DMA flags to augment operation preparation, |
| @@ -132,32 +96,6 @@ enum dma_ctrl_flags { | |||
| 132 | typedef struct { DECLARE_BITMAP(bits, DMA_TX_TYPE_END); } dma_cap_mask_t; | 96 | typedef struct { DECLARE_BITMAP(bits, DMA_TX_TYPE_END); } dma_cap_mask_t; |
| 133 | 97 | ||
| 134 | /** | 98 | /** |
| 135 | * struct dma_slave - Information about a DMA slave | ||
| 136 | * @dev: device acting as DMA slave | ||
| 137 | * @dma_dev: required DMA master device. If non-NULL, the client can not be | ||
| 138 | * bound to other masters than this. | ||
| 139 | * @tx_reg: physical address of data register used for | ||
| 140 | * memory-to-peripheral transfers | ||
| 141 | * @rx_reg: physical address of data register used for | ||
| 142 | * peripheral-to-memory transfers | ||
| 143 | * @reg_width: peripheral register width | ||
| 144 | * | ||
| 145 | * If dma_dev is non-NULL, the client can not be bound to other DMA | ||
| 146 | * masters than the one corresponding to this device. The DMA master | ||
| 147 | * driver may use this to determine if there is controller-specific | ||
| 148 | * data wrapped around this struct. Drivers of platform code that sets | ||
| 149 | * the dma_dev field must therefore make sure to use an appropriate | ||
| 150 | * controller-specific dma slave structure wrapping this struct. | ||
| 151 | */ | ||
| 152 | struct dma_slave { | ||
| 153 | struct device *dev; | ||
| 154 | struct device *dma_dev; | ||
| 155 | dma_addr_t tx_reg; | ||
| 156 | dma_addr_t rx_reg; | ||
| 157 | enum dma_slave_width reg_width; | ||
| 158 | }; | ||
| 159 | |||
| 160 | /** | ||
| 161 | * struct dma_chan_percpu - the per-CPU part of struct dma_chan | 99 | * struct dma_chan_percpu - the per-CPU part of struct dma_chan |
| 162 | * @refcount: local_t used for open-coded "bigref" counting | 100 | * @refcount: local_t used for open-coded "bigref" counting |
| 163 | * @memcpy_count: transaction counter | 101 | * @memcpy_count: transaction counter |
| @@ -165,7 +103,6 @@ struct dma_slave { | |||
| 165 | */ | 103 | */ |
| 166 | 104 | ||
| 167 | struct dma_chan_percpu { | 105 | struct dma_chan_percpu { |
| 168 | local_t refcount; | ||
| 169 | /* stats */ | 106 | /* stats */ |
| 170 | unsigned long memcpy_count; | 107 | unsigned long memcpy_count; |
| 171 | unsigned long bytes_transferred; | 108 | unsigned long bytes_transferred; |
| @@ -176,13 +113,14 @@ struct dma_chan_percpu { | |||
| 176 | * @device: ptr to the dma device who supplies this channel, always !%NULL | 113 | * @device: ptr to the dma device who supplies this channel, always !%NULL |
| 177 | * @cookie: last cookie value returned to client | 114 | * @cookie: last cookie value returned to client |
| 178 | * @chan_id: channel ID for sysfs | 115 | * @chan_id: channel ID for sysfs |
| 179 | * @class_dev: class device for sysfs | 116 | * @dev: class device for sysfs |
| 180 | * @refcount: kref, used in "bigref" slow-mode | 117 | * @refcount: kref, used in "bigref" slow-mode |
| 181 | * @slow_ref: indicates that the DMA channel is free | 118 | * @slow_ref: indicates that the DMA channel is free |
| 182 | * @rcu: the DMA channel's RCU head | 119 | * @rcu: the DMA channel's RCU head |
| 183 | * @device_node: used to add this to the device chan list | 120 | * @device_node: used to add this to the device chan list |
| 184 | * @local: per-cpu pointer to a struct dma_chan_percpu | 121 | * @local: per-cpu pointer to a struct dma_chan_percpu |
| 185 | * @client-count: how many clients are using this channel | 122 | * @client-count: how many clients are using this channel |
| 123 | * @table_count: number of appearances in the mem-to-mem allocation table | ||
| 186 | */ | 124 | */ |
| 187 | struct dma_chan { | 125 | struct dma_chan { |
| 188 | struct dma_device *device; | 126 | struct dma_device *device; |
| @@ -190,73 +128,47 @@ struct dma_chan { | |||
| 190 | 128 | ||
| 191 | /* sysfs */ | 129 | /* sysfs */ |
| 192 | int chan_id; | 130 | int chan_id; |
| 193 | struct device dev; | 131 | struct dma_chan_dev *dev; |
| 194 | |||
| 195 | struct kref refcount; | ||
| 196 | int slow_ref; | ||
| 197 | struct rcu_head rcu; | ||
| 198 | 132 | ||
| 199 | struct list_head device_node; | 133 | struct list_head device_node; |
| 200 | struct dma_chan_percpu *local; | 134 | struct dma_chan_percpu *local; |
| 201 | int client_count; | 135 | int client_count; |
| 136 | int table_count; | ||
| 202 | }; | 137 | }; |
| 203 | 138 | ||
| 204 | #define to_dma_chan(p) container_of(p, struct dma_chan, dev) | 139 | /** |
| 205 | 140 | * struct dma_chan_dev - relate sysfs device node to backing channel device | |
| 206 | void dma_chan_cleanup(struct kref *kref); | 141 | * @chan - driver channel device |
| 207 | 142 | * @device - sysfs device | |
| 208 | static inline void dma_chan_get(struct dma_chan *chan) | 143 | * @dev_id - parent dma_device dev_id |
| 209 | { | 144 | * @idr_ref - reference count to gate release of dma_device dev_id |
| 210 | if (unlikely(chan->slow_ref)) | 145 | */ |
| 211 | kref_get(&chan->refcount); | 146 | struct dma_chan_dev { |
| 212 | else { | 147 | struct dma_chan *chan; |
| 213 | local_inc(&(per_cpu_ptr(chan->local, get_cpu())->refcount)); | 148 | struct device device; |
| 214 | put_cpu(); | 149 | int dev_id; |
| 215 | } | 150 | atomic_t *idr_ref; |
| 216 | } | 151 | }; |
| 217 | 152 | ||
| 218 | static inline void dma_chan_put(struct dma_chan *chan) | 153 | static inline const char *dma_chan_name(struct dma_chan *chan) |
| 219 | { | 154 | { |
| 220 | if (unlikely(chan->slow_ref)) | 155 | return dev_name(&chan->dev->device); |
| 221 | kref_put(&chan->refcount, dma_chan_cleanup); | ||
| 222 | else { | ||
| 223 | local_dec(&(per_cpu_ptr(chan->local, get_cpu())->refcount)); | ||
| 224 | put_cpu(); | ||
| 225 | } | ||
| 226 | } | 156 | } |
| 227 | 157 | ||
| 228 | /* | 158 | void dma_chan_cleanup(struct kref *kref); |
| 229 | * typedef dma_event_callback - function pointer to a DMA event callback | ||
| 230 | * For each channel added to the system this routine is called for each client. | ||
| 231 | * If the client would like to use the channel it returns '1' to signal (ack) | ||
| 232 | * the dmaengine core to take out a reference on the channel and its | ||
| 233 | * corresponding device. A client must not 'ack' an available channel more | ||
| 234 | * than once. When a channel is removed all clients are notified. If a client | ||
| 235 | * is using the channel it must 'ack' the removal. A client must not 'ack' a | ||
| 236 | * removed channel more than once. | ||
| 237 | * @client - 'this' pointer for the client context | ||
| 238 | * @chan - channel to be acted upon | ||
| 239 | * @state - available or removed | ||
| 240 | */ | ||
| 241 | struct dma_client; | ||
| 242 | typedef enum dma_state_client (*dma_event_callback) (struct dma_client *client, | ||
| 243 | struct dma_chan *chan, enum dma_state state); | ||
| 244 | 159 | ||
| 245 | /** | 160 | /** |
| 246 | * struct dma_client - info on the entity making use of DMA services | 161 | * typedef dma_filter_fn - callback filter for dma_request_channel |
| 247 | * @event_callback: func ptr to call when something happens | 162 | * @chan: channel to be reviewed |
| 248 | * @cap_mask: only return channels that satisfy the requested capabilities | 163 | * @filter_param: opaque parameter passed through dma_request_channel |
| 249 | * a value of zero corresponds to any capability | 164 | * |
| 250 | * @slave: data for preparing slave transfer. Must be non-NULL iff the | 165 | * When this optional parameter is specified in a call to dma_request_channel a |
| 251 | * DMA_SLAVE capability is requested. | 166 | * suitable channel is passed to this routine for further dispositioning before |
| 252 | * @global_node: list_head for global dma_client_list | 167 | * being returned. Where 'suitable' indicates a non-busy channel that |
| 168 | * satisfies the given capability mask. It returns 'true' to indicate that the | ||
| 169 | * channel is suitable. | ||
| 253 | */ | 170 | */ |
| 254 | struct dma_client { | 171 | typedef bool (*dma_filter_fn)(struct dma_chan *chan, void *filter_param); |
| 255 | dma_event_callback event_callback; | ||
| 256 | dma_cap_mask_t cap_mask; | ||
| 257 | struct dma_slave *slave; | ||
| 258 | struct list_head global_node; | ||
| 259 | }; | ||
| 260 | 172 | ||
| 261 | typedef void (*dma_async_tx_callback)(void *dma_async_param); | 173 | typedef void (*dma_async_tx_callback)(void *dma_async_param); |
| 262 | /** | 174 | /** |
| @@ -323,14 +235,10 @@ struct dma_device { | |||
| 323 | dma_cap_mask_t cap_mask; | 235 | dma_cap_mask_t cap_mask; |
| 324 | int max_xor; | 236 | int max_xor; |
| 325 | 237 | ||
| 326 | struct kref refcount; | ||
| 327 | struct completion done; | ||
| 328 | |||
| 329 | int dev_id; | 238 | int dev_id; |
| 330 | struct device *dev; | 239 | struct device *dev; |
| 331 | 240 | ||
| 332 | int (*device_alloc_chan_resources)(struct dma_chan *chan, | 241 | int (*device_alloc_chan_resources)(struct dma_chan *chan); |
| 333 | struct dma_client *client); | ||
| 334 | void (*device_free_chan_resources)(struct dma_chan *chan); | 242 | void (*device_free_chan_resources)(struct dma_chan *chan); |
| 335 | 243 | ||
| 336 | struct dma_async_tx_descriptor *(*device_prep_dma_memcpy)( | 244 | struct dma_async_tx_descriptor *(*device_prep_dma_memcpy)( |
| @@ -362,9 +270,8 @@ struct dma_device { | |||
| 362 | 270 | ||
| 363 | /* --- public DMA engine API --- */ | 271 | /* --- public DMA engine API --- */ |
| 364 | 272 | ||
| 365 | void dma_async_client_register(struct dma_client *client); | 273 | void dmaengine_get(void); |
| 366 | void dma_async_client_unregister(struct dma_client *client); | 274 | void dmaengine_put(void); |
| 367 | void dma_async_client_chan_request(struct dma_client *client); | ||
| 368 | dma_cookie_t dma_async_memcpy_buf_to_buf(struct dma_chan *chan, | 275 | dma_cookie_t dma_async_memcpy_buf_to_buf(struct dma_chan *chan, |
| 369 | void *dest, void *src, size_t len); | 276 | void *dest, void *src, size_t len); |
| 370 | dma_cookie_t dma_async_memcpy_buf_to_pg(struct dma_chan *chan, | 277 | dma_cookie_t dma_async_memcpy_buf_to_pg(struct dma_chan *chan, |
| @@ -406,6 +313,12 @@ __dma_cap_set(enum dma_transaction_type tx_type, dma_cap_mask_t *dstp) | |||
| 406 | set_bit(tx_type, dstp->bits); | 313 | set_bit(tx_type, dstp->bits); |
| 407 | } | 314 | } |
| 408 | 315 | ||
| 316 | #define dma_cap_zero(mask) __dma_cap_zero(&(mask)) | ||
| 317 | static inline void __dma_cap_zero(dma_cap_mask_t *dstp) | ||
| 318 | { | ||
| 319 | bitmap_zero(dstp->bits, DMA_TX_TYPE_END); | ||
| 320 | } | ||
| 321 | |||
| 409 | #define dma_has_cap(tx, mask) __dma_has_cap((tx), &(mask)) | 322 | #define dma_has_cap(tx, mask) __dma_has_cap((tx), &(mask)) |
| 410 | static inline int | 323 | static inline int |
| 411 | __dma_has_cap(enum dma_transaction_type tx_type, dma_cap_mask_t *srcp) | 324 | __dma_has_cap(enum dma_transaction_type tx_type, dma_cap_mask_t *srcp) |
| @@ -475,11 +388,25 @@ static inline enum dma_status dma_async_is_complete(dma_cookie_t cookie, | |||
| 475 | } | 388 | } |
| 476 | 389 | ||
| 477 | enum dma_status dma_sync_wait(struct dma_chan *chan, dma_cookie_t cookie); | 390 | enum dma_status dma_sync_wait(struct dma_chan *chan, dma_cookie_t cookie); |
| 391 | #ifdef CONFIG_DMA_ENGINE | ||
| 392 | enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx); | ||
| 393 | #else | ||
| 394 | static inline enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx) | ||
| 395 | { | ||
| 396 | return DMA_SUCCESS; | ||
| 397 | } | ||
| 398 | #endif | ||
| 478 | 399 | ||
| 479 | /* --- DMA device --- */ | 400 | /* --- DMA device --- */ |
| 480 | 401 | ||
| 481 | int dma_async_device_register(struct dma_device *device); | 402 | int dma_async_device_register(struct dma_device *device); |
| 482 | void dma_async_device_unregister(struct dma_device *device); | 403 | void dma_async_device_unregister(struct dma_device *device); |
| 404 | void dma_run_dependencies(struct dma_async_tx_descriptor *tx); | ||
| 405 | struct dma_chan *dma_find_channel(enum dma_transaction_type tx_type); | ||
| 406 | void dma_issue_pending_all(void); | ||
| 407 | #define dma_request_channel(mask, x, y) __dma_request_channel(&(mask), x, y) | ||
| 408 | struct dma_chan *__dma_request_channel(dma_cap_mask_t *mask, dma_filter_fn fn, void *fn_param); | ||
| 409 | void dma_release_channel(struct dma_chan *chan); | ||
| 483 | 410 | ||
| 484 | /* --- Helper iov-locking functions --- */ | 411 | /* --- Helper iov-locking functions --- */ |
| 485 | 412 | ||
diff --git a/include/linux/dw_dmac.h b/include/linux/dw_dmac.h index 04d217b442bf..d797dde247f7 100644 --- a/include/linux/dw_dmac.h +++ b/include/linux/dw_dmac.h | |||
| @@ -22,14 +22,34 @@ struct dw_dma_platform_data { | |||
| 22 | }; | 22 | }; |
| 23 | 23 | ||
| 24 | /** | 24 | /** |
| 25 | * enum dw_dma_slave_width - DMA slave register access width. | ||
| 26 | * @DMA_SLAVE_WIDTH_8BIT: Do 8-bit slave register accesses | ||
| 27 | * @DMA_SLAVE_WIDTH_16BIT: Do 16-bit slave register accesses | ||
| 28 | * @DMA_SLAVE_WIDTH_32BIT: Do 32-bit slave register accesses | ||
| 29 | */ | ||
| 30 | enum dw_dma_slave_width { | ||
| 31 | DW_DMA_SLAVE_WIDTH_8BIT, | ||
| 32 | DW_DMA_SLAVE_WIDTH_16BIT, | ||
| 33 | DW_DMA_SLAVE_WIDTH_32BIT, | ||
| 34 | }; | ||
| 35 | |||
| 36 | /** | ||
| 25 | * struct dw_dma_slave - Controller-specific information about a slave | 37 | * struct dw_dma_slave - Controller-specific information about a slave |
| 26 | * @slave: Generic information about the slave | 38 | * |
| 27 | * @ctl_lo: Platform-specific initializer for the CTL_LO register | 39 | * @dma_dev: required DMA master device |
| 40 | * @tx_reg: physical address of data register used for | ||
| 41 | * memory-to-peripheral transfers | ||
| 42 | * @rx_reg: physical address of data register used for | ||
| 43 | * peripheral-to-memory transfers | ||
| 44 | * @reg_width: peripheral register width | ||
| 28 | * @cfg_hi: Platform-specific initializer for the CFG_HI register | 45 | * @cfg_hi: Platform-specific initializer for the CFG_HI register |
| 29 | * @cfg_lo: Platform-specific initializer for the CFG_LO register | 46 | * @cfg_lo: Platform-specific initializer for the CFG_LO register |
| 30 | */ | 47 | */ |
| 31 | struct dw_dma_slave { | 48 | struct dw_dma_slave { |
| 32 | struct dma_slave slave; | 49 | struct device *dma_dev; |
| 50 | dma_addr_t tx_reg; | ||
| 51 | dma_addr_t rx_reg; | ||
| 52 | enum dw_dma_slave_width reg_width; | ||
| 33 | u32 cfg_hi; | 53 | u32 cfg_hi; |
| 34 | u32 cfg_lo; | 54 | u32 cfg_lo; |
| 35 | }; | 55 | }; |
| @@ -54,9 +74,4 @@ struct dw_dma_slave { | |||
| 54 | #define DWC_CFGL_HS_DST_POL (1 << 18) /* dst handshake active low */ | 74 | #define DWC_CFGL_HS_DST_POL (1 << 18) /* dst handshake active low */ |
| 55 | #define DWC_CFGL_HS_SRC_POL (1 << 19) /* src handshake active low */ | 75 | #define DWC_CFGL_HS_SRC_POL (1 << 19) /* src handshake active low */ |
| 56 | 76 | ||
| 57 | static inline struct dw_dma_slave *to_dw_dma_slave(struct dma_slave *slave) | ||
| 58 | { | ||
| 59 | return container_of(slave, struct dw_dma_slave, slave); | ||
| 60 | } | ||
| 61 | |||
| 62 | #endif /* DW_DMAC_H */ | 77 | #endif /* DW_DMAC_H */ |
diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h index 78c775a83f7c..121720d74e15 100644 --- a/include/linux/ext2_fs.h +++ b/include/linux/ext2_fs.h | |||
| @@ -194,6 +194,30 @@ struct ext2_group_desc | |||
| 194 | #define EXT2_FL_USER_VISIBLE FS_FL_USER_VISIBLE /* User visible flags */ | 194 | #define EXT2_FL_USER_VISIBLE FS_FL_USER_VISIBLE /* User visible flags */ |
| 195 | #define EXT2_FL_USER_MODIFIABLE FS_FL_USER_MODIFIABLE /* User modifiable flags */ | 195 | #define EXT2_FL_USER_MODIFIABLE FS_FL_USER_MODIFIABLE /* User modifiable flags */ |
| 196 | 196 | ||
| 197 | /* Flags that should be inherited by new inodes from their parent. */ | ||
| 198 | #define EXT2_FL_INHERITED (EXT2_SECRM_FL | EXT2_UNRM_FL | EXT2_COMPR_FL |\ | ||
| 199 | EXT2_SYNC_FL | EXT2_IMMUTABLE_FL | EXT2_APPEND_FL |\ | ||
| 200 | EXT2_NODUMP_FL | EXT2_NOATIME_FL | EXT2_COMPRBLK_FL|\ | ||
| 201 | EXT2_NOCOMP_FL | EXT2_JOURNAL_DATA_FL |\ | ||
| 202 | EXT2_NOTAIL_FL | EXT2_DIRSYNC_FL) | ||
| 203 | |||
| 204 | /* Flags that are appropriate for regular files (all but dir-specific ones). */ | ||
| 205 | #define EXT2_REG_FLMASK (~(EXT2_DIRSYNC_FL | EXT2_TOPDIR_FL)) | ||
| 206 | |||
| 207 | /* Flags that are appropriate for non-directories/regular files. */ | ||
| 208 | #define EXT2_OTHER_FLMASK (EXT2_NODUMP_FL | EXT2_NOATIME_FL) | ||
| 209 | |||
| 210 | /* Mask out flags that are inappropriate for the given type of inode. */ | ||
| 211 | static inline __u32 ext2_mask_flags(umode_t mode, __u32 flags) | ||
| 212 | { | ||
| 213 | if (S_ISDIR(mode)) | ||
| 214 | return flags; | ||
| 215 | else if (S_ISREG(mode)) | ||
| 216 | return flags & EXT2_REG_FLMASK; | ||
| 217 | else | ||
| 218 | return flags & EXT2_OTHER_FLMASK; | ||
| 219 | } | ||
| 220 | |||
| 197 | /* | 221 | /* |
| 198 | * ioctl commands | 222 | * ioctl commands |
| 199 | */ | 223 | */ |
diff --git a/include/linux/ext2_fs_sb.h b/include/linux/ext2_fs_sb.h index dc541f3653d1..1cdb66367c98 100644 --- a/include/linux/ext2_fs_sb.h +++ b/include/linux/ext2_fs_sb.h | |||
| @@ -101,7 +101,7 @@ struct ext2_sb_info { | |||
| 101 | struct percpu_counter s_freeblocks_counter; | 101 | struct percpu_counter s_freeblocks_counter; |
| 102 | struct percpu_counter s_freeinodes_counter; | 102 | struct percpu_counter s_freeinodes_counter; |
| 103 | struct percpu_counter s_dirs_counter; | 103 | struct percpu_counter s_dirs_counter; |
| 104 | struct blockgroup_lock s_blockgroup_lock; | 104 | struct blockgroup_lock *s_blockgroup_lock; |
| 105 | /* root of the per fs reservation window tree */ | 105 | /* root of the per fs reservation window tree */ |
| 106 | spinlock_t s_rsv_window_lock; | 106 | spinlock_t s_rsv_window_lock; |
| 107 | struct rb_root s_rsv_window_root; | 107 | struct rb_root s_rsv_window_root; |
| @@ -111,7 +111,7 @@ struct ext2_sb_info { | |||
| 111 | static inline spinlock_t * | 111 | static inline spinlock_t * |
| 112 | sb_bgl_lock(struct ext2_sb_info *sbi, unsigned int block_group) | 112 | sb_bgl_lock(struct ext2_sb_info *sbi, unsigned int block_group) |
| 113 | { | 113 | { |
| 114 | return bgl_lock_ptr(&sbi->s_blockgroup_lock, block_group); | 114 | return bgl_lock_ptr(sbi->s_blockgroup_lock, block_group); |
| 115 | } | 115 | } |
| 116 | 116 | ||
| 117 | #endif /* _LINUX_EXT2_FS_SB */ | 117 | #endif /* _LINUX_EXT2_FS_SB */ |
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h index d14f02918483..dd495b8c3091 100644 --- a/include/linux/ext3_fs.h +++ b/include/linux/ext3_fs.h | |||
| @@ -178,6 +178,30 @@ struct ext3_group_desc | |||
| 178 | #define EXT3_FL_USER_VISIBLE 0x0003DFFF /* User visible flags */ | 178 | #define EXT3_FL_USER_VISIBLE 0x0003DFFF /* User visible flags */ |
| 179 | #define EXT3_FL_USER_MODIFIABLE 0x000380FF /* User modifiable flags */ | 179 | #define EXT3_FL_USER_MODIFIABLE 0x000380FF /* User modifiable flags */ |
| 180 | 180 | ||
| 181 | /* Flags that should be inherited by new inodes from their parent. */ | ||
| 182 | #define EXT3_FL_INHERITED (EXT3_SECRM_FL | EXT3_UNRM_FL | EXT3_COMPR_FL |\ | ||
| 183 | EXT3_SYNC_FL | EXT3_IMMUTABLE_FL | EXT3_APPEND_FL |\ | ||
| 184 | EXT3_NODUMP_FL | EXT3_NOATIME_FL | EXT3_COMPRBLK_FL|\ | ||
| 185 | EXT3_NOCOMPR_FL | EXT3_JOURNAL_DATA_FL |\ | ||
| 186 | EXT3_NOTAIL_FL | EXT3_DIRSYNC_FL) | ||
| 187 | |||
| 188 | /* Flags that are appropriate for regular files (all but dir-specific ones). */ | ||
| 189 | #define EXT3_REG_FLMASK (~(EXT3_DIRSYNC_FL | EXT3_TOPDIR_FL)) | ||
| 190 | |||
| 191 | /* Flags that are appropriate for non-directories/regular files. */ | ||
| 192 | #define EXT3_OTHER_FLMASK (EXT3_NODUMP_FL | EXT3_NOATIME_FL) | ||
| 193 | |||
| 194 | /* Mask out flags that are inappropriate for the given type of inode. */ | ||
| 195 | static inline __u32 ext3_mask_flags(umode_t mode, __u32 flags) | ||
| 196 | { | ||
| 197 | if (S_ISDIR(mode)) | ||
| 198 | return flags; | ||
| 199 | else if (S_ISREG(mode)) | ||
| 200 | return flags & EXT3_REG_FLMASK; | ||
| 201 | else | ||
| 202 | return flags & EXT3_OTHER_FLMASK; | ||
| 203 | } | ||
| 204 | |||
| 181 | /* | 205 | /* |
| 182 | * Inode dynamic state flags | 206 | * Inode dynamic state flags |
| 183 | */ | 207 | */ |
| @@ -354,6 +378,13 @@ struct ext3_inode { | |||
| 354 | #define EXT3_ORPHAN_FS 0x0004 /* Orphans being recovered */ | 378 | #define EXT3_ORPHAN_FS 0x0004 /* Orphans being recovered */ |
| 355 | 379 | ||
| 356 | /* | 380 | /* |
| 381 | * Misc. filesystem flags | ||
| 382 | */ | ||
| 383 | #define EXT2_FLAGS_SIGNED_HASH 0x0001 /* Signed dirhash in use */ | ||
| 384 | #define EXT2_FLAGS_UNSIGNED_HASH 0x0002 /* Unsigned dirhash in use */ | ||
| 385 | #define EXT2_FLAGS_TEST_FILESYS 0x0004 /* to test development code */ | ||
| 386 | |||
| 387 | /* | ||
| 357 | * Mount flags | 388 | * Mount flags |
| 358 | */ | 389 | */ |
| 359 | #define EXT3_MOUNT_CHECK 0x00001 /* Do mount-time checks */ | 390 | #define EXT3_MOUNT_CHECK 0x00001 /* Do mount-time checks */ |
| @@ -489,7 +520,23 @@ struct ext3_super_block { | |||
| 489 | __u16 s_reserved_word_pad; | 520 | __u16 s_reserved_word_pad; |
| 490 | __le32 s_default_mount_opts; | 521 | __le32 s_default_mount_opts; |
| 491 | __le32 s_first_meta_bg; /* First metablock block group */ | 522 | __le32 s_first_meta_bg; /* First metablock block group */ |
| 492 | __u32 s_reserved[190]; /* Padding to the end of the block */ | 523 | __le32 s_mkfs_time; /* When the filesystem was created */ |
| 524 | __le32 s_jnl_blocks[17]; /* Backup of the journal inode */ | ||
| 525 | /* 64bit support valid if EXT4_FEATURE_COMPAT_64BIT */ | ||
| 526 | /*150*/ __le32 s_blocks_count_hi; /* Blocks count */ | ||
| 527 | __le32 s_r_blocks_count_hi; /* Reserved blocks count */ | ||
| 528 | __le32 s_free_blocks_count_hi; /* Free blocks count */ | ||
| 529 | __le16 s_min_extra_isize; /* All inodes have at least # bytes */ | ||
| 530 | __le16 s_want_extra_isize; /* New inodes should reserve # bytes */ | ||
| 531 | __le32 s_flags; /* Miscellaneous flags */ | ||
| 532 | __le16 s_raid_stride; /* RAID stride */ | ||
| 533 | __le16 s_mmp_interval; /* # seconds to wait in MMP checking */ | ||
| 534 | __le64 s_mmp_block; /* Block for multi-mount protection */ | ||
| 535 | __le32 s_raid_stripe_width; /* blocks on all data disks (N*stride)*/ | ||
| 536 | __u8 s_log_groups_per_flex; /* FLEX_BG group size */ | ||
| 537 | __u8 s_reserved_char_pad2; | ||
| 538 | __le16 s_reserved_pad; | ||
| 539 | __u32 s_reserved[162]; /* Padding to the end of the block */ | ||
| 493 | }; | 540 | }; |
| 494 | 541 | ||
| 495 | #ifdef __KERNEL__ | 542 | #ifdef __KERNEL__ |
| @@ -694,6 +741,9 @@ static inline __le16 ext3_rec_len_to_disk(unsigned len) | |||
| 694 | #define DX_HASH_LEGACY 0 | 741 | #define DX_HASH_LEGACY 0 |
| 695 | #define DX_HASH_HALF_MD4 1 | 742 | #define DX_HASH_HALF_MD4 1 |
| 696 | #define DX_HASH_TEA 2 | 743 | #define DX_HASH_TEA 2 |
| 744 | #define DX_HASH_LEGACY_UNSIGNED 3 | ||
| 745 | #define DX_HASH_HALF_MD4_UNSIGNED 4 | ||
| 746 | #define DX_HASH_TEA_UNSIGNED 5 | ||
| 697 | 747 | ||
| 698 | #ifdef __KERNEL__ | 748 | #ifdef __KERNEL__ |
| 699 | 749 | ||
diff --git a/include/linux/ext3_fs_sb.h b/include/linux/ext3_fs_sb.h index e024e38248ff..f07f34de2f0e 100644 --- a/include/linux/ext3_fs_sb.h +++ b/include/linux/ext3_fs_sb.h | |||
| @@ -57,10 +57,11 @@ struct ext3_sb_info { | |||
| 57 | u32 s_next_generation; | 57 | u32 s_next_generation; |
| 58 | u32 s_hash_seed[4]; | 58 | u32 s_hash_seed[4]; |
| 59 | int s_def_hash_version; | 59 | int s_def_hash_version; |
| 60 | int s_hash_unsigned; /* 3 if hash should be signed, 0 if not */ | ||
| 60 | struct percpu_counter s_freeblocks_counter; | 61 | struct percpu_counter s_freeblocks_counter; |
| 61 | struct percpu_counter s_freeinodes_counter; | 62 | struct percpu_counter s_freeinodes_counter; |
| 62 | struct percpu_counter s_dirs_counter; | 63 | struct percpu_counter s_dirs_counter; |
| 63 | struct blockgroup_lock s_blockgroup_lock; | 64 | struct blockgroup_lock *s_blockgroup_lock; |
| 64 | 65 | ||
| 65 | /* root of the per fs reservation window tree */ | 66 | /* root of the per fs reservation window tree */ |
| 66 | spinlock_t s_rsv_window_lock; | 67 | spinlock_t s_rsv_window_lock; |
| @@ -86,7 +87,7 @@ struct ext3_sb_info { | |||
| 86 | static inline spinlock_t * | 87 | static inline spinlock_t * |
| 87 | sb_bgl_lock(struct ext3_sb_info *sbi, unsigned int block_group) | 88 | sb_bgl_lock(struct ext3_sb_info *sbi, unsigned int block_group) |
| 88 | { | 89 | { |
| 89 | return bgl_lock_ptr(&sbi->s_blockgroup_lock, block_group); | 90 | return bgl_lock_ptr(sbi->s_blockgroup_lock, block_group); |
| 90 | } | 91 | } |
| 91 | 92 | ||
| 92 | #endif /* _LINUX_EXT3_FS_SB */ | 93 | #endif /* _LINUX_EXT3_FS_SB */ |
diff --git a/include/linux/fs.h b/include/linux/fs.h index fb59673c60b1..6022f44043f2 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -234,6 +234,8 @@ struct inodes_stat_t { | |||
| 234 | #define BMAP_IOCTL 1 /* obsolete - kept for compatibility */ | 234 | #define BMAP_IOCTL 1 /* obsolete - kept for compatibility */ |
| 235 | #define FIBMAP _IO(0x00,1) /* bmap access */ | 235 | #define FIBMAP _IO(0x00,1) /* bmap access */ |
| 236 | #define FIGETBSZ _IO(0x00,2) /* get the block size used for bmap */ | 236 | #define FIGETBSZ _IO(0x00,2) /* get the block size used for bmap */ |
| 237 | #define FIFREEZE _IOWR('X', 119, int) /* Freeze */ | ||
| 238 | #define FITHAW _IOWR('X', 120, int) /* Thaw */ | ||
| 237 | 239 | ||
| 238 | #define FS_IOC_GETFLAGS _IOR('f', 1, long) | 240 | #define FS_IOC_GETFLAGS _IOR('f', 1, long) |
| 239 | #define FS_IOC_SETFLAGS _IOW('f', 2, long) | 241 | #define FS_IOC_SETFLAGS _IOW('f', 2, long) |
| @@ -565,6 +567,7 @@ struct address_space { | |||
| 565 | struct block_device { | 567 | struct block_device { |
| 566 | dev_t bd_dev; /* not a kdev_t - it's a search key */ | 568 | dev_t bd_dev; /* not a kdev_t - it's a search key */ |
| 567 | struct inode * bd_inode; /* will die */ | 569 | struct inode * bd_inode; /* will die */ |
| 570 | struct super_block * bd_super; | ||
| 568 | int bd_openers; | 571 | int bd_openers; |
| 569 | struct mutex bd_mutex; /* open/close mutex */ | 572 | struct mutex bd_mutex; /* open/close mutex */ |
| 570 | struct semaphore bd_mount_sem; | 573 | struct semaphore bd_mount_sem; |
| @@ -590,6 +593,11 @@ struct block_device { | |||
| 590 | * care to not mess up bd_private for that case. | 593 | * care to not mess up bd_private for that case. |
| 591 | */ | 594 | */ |
| 592 | unsigned long bd_private; | 595 | unsigned long bd_private; |
| 596 | |||
| 597 | /* The counter of freeze processes */ | ||
| 598 | int bd_fsfreeze_count; | ||
| 599 | /* Mutex for freeze */ | ||
| 600 | struct mutex bd_fsfreeze_mutex; | ||
| 593 | }; | 601 | }; |
| 594 | 602 | ||
| 595 | /* | 603 | /* |
| @@ -1133,7 +1141,6 @@ struct super_block { | |||
| 1133 | struct rw_semaphore s_umount; | 1141 | struct rw_semaphore s_umount; |
| 1134 | struct mutex s_lock; | 1142 | struct mutex s_lock; |
| 1135 | int s_count; | 1143 | int s_count; |
| 1136 | int s_syncing; | ||
| 1137 | int s_need_sync_fs; | 1144 | int s_need_sync_fs; |
| 1138 | atomic_t s_active; | 1145 | atomic_t s_active; |
| 1139 | #ifdef CONFIG_SECURITY | 1146 | #ifdef CONFIG_SECURITY |
| @@ -1185,6 +1192,11 @@ struct super_block { | |||
| 1185 | * generic_show_options() | 1192 | * generic_show_options() |
| 1186 | */ | 1193 | */ |
| 1187 | char *s_options; | 1194 | char *s_options; |
| 1195 | |||
| 1196 | /* | ||
| 1197 | * storage for asynchronous operations | ||
| 1198 | */ | ||
| 1199 | struct list_head s_async_list; | ||
| 1188 | }; | 1200 | }; |
| 1189 | 1201 | ||
| 1190 | extern struct timespec current_fs_time(struct super_block *sb); | 1202 | extern struct timespec current_fs_time(struct super_block *sb); |
| @@ -1372,8 +1384,8 @@ struct super_operations { | |||
| 1372 | void (*put_super) (struct super_block *); | 1384 | void (*put_super) (struct super_block *); |
| 1373 | void (*write_super) (struct super_block *); | 1385 | void (*write_super) (struct super_block *); |
| 1374 | int (*sync_fs)(struct super_block *sb, int wait); | 1386 | int (*sync_fs)(struct super_block *sb, int wait); |
| 1375 | void (*write_super_lockfs) (struct super_block *); | 1387 | int (*freeze_fs) (struct super_block *); |
| 1376 | void (*unlockfs) (struct super_block *); | 1388 | int (*unfreeze_fs) (struct super_block *); |
| 1377 | int (*statfs) (struct dentry *, struct kstatfs *); | 1389 | int (*statfs) (struct dentry *, struct kstatfs *); |
| 1378 | int (*remount_fs) (struct super_block *, int *, char *); | 1390 | int (*remount_fs) (struct super_block *, int *, char *); |
| 1379 | void (*clear_inode) (struct inode *); | 1391 | void (*clear_inode) (struct inode *); |
| @@ -1385,6 +1397,7 @@ struct super_operations { | |||
| 1385 | ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t); | 1397 | ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t); |
| 1386 | ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t); | 1398 | ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t); |
| 1387 | #endif | 1399 | #endif |
| 1400 | int (*bdev_try_to_free_page)(struct super_block*, struct page*, gfp_t); | ||
| 1388 | }; | 1401 | }; |
| 1389 | 1402 | ||
| 1390 | /* | 1403 | /* |
diff --git a/include/linux/fuse.h b/include/linux/fuse.h index 350fe9767bbc..162e5defe683 100644 --- a/include/linux/fuse.h +++ b/include/linux/fuse.h | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* | 1 | /* |
| 2 | FUSE: Filesystem in Userspace | 2 | FUSE: Filesystem in Userspace |
| 3 | Copyright (C) 2001-2006 Miklos Szeredi <miklos@szeredi.hu> | 3 | Copyright (C) 2001-2008 Miklos Szeredi <miklos@szeredi.hu> |
| 4 | 4 | ||
| 5 | This program can be distributed under the terms of the GNU GPL. | 5 | This program can be distributed under the terms of the GNU GPL. |
| 6 | See the file COPYING. | 6 | See the file COPYING. |
| @@ -20,29 +20,27 @@ | |||
| 20 | * | 20 | * |
| 21 | * 7.10 | 21 | * 7.10 |
| 22 | * - add nonseekable open flag | 22 | * - add nonseekable open flag |
| 23 | * | ||
| 24 | * 7.11 | ||
| 25 | * - add IOCTL message | ||
| 26 | * - add unsolicited notification support | ||
| 27 | * - add POLL message and NOTIFY_POLL notification | ||
| 23 | */ | 28 | */ |
| 24 | 29 | ||
| 25 | #ifndef _LINUX_FUSE_H | 30 | #ifndef _LINUX_FUSE_H |
| 26 | #define _LINUX_FUSE_H | 31 | #define _LINUX_FUSE_H |
| 27 | 32 | ||
| 28 | #include <asm/types.h> | 33 | #include <linux/types.h> |
| 29 | #include <linux/major.h> | ||
| 30 | 34 | ||
| 31 | /** Version number of this interface */ | 35 | /** Version number of this interface */ |
| 32 | #define FUSE_KERNEL_VERSION 7 | 36 | #define FUSE_KERNEL_VERSION 7 |
| 33 | 37 | ||
| 34 | /** Minor version number of this interface */ | 38 | /** Minor version number of this interface */ |
| 35 | #define FUSE_KERNEL_MINOR_VERSION 10 | 39 | #define FUSE_KERNEL_MINOR_VERSION 11 |
| 36 | 40 | ||
| 37 | /** The node ID of the root inode */ | 41 | /** The node ID of the root inode */ |
| 38 | #define FUSE_ROOT_ID 1 | 42 | #define FUSE_ROOT_ID 1 |
| 39 | 43 | ||
| 40 | /** The major number of the fuse character device */ | ||
| 41 | #define FUSE_MAJOR MISC_MAJOR | ||
| 42 | |||
| 43 | /** The minor number of the fuse character device */ | ||
| 44 | #define FUSE_MINOR 229 | ||
| 45 | |||
| 46 | /* Make sure all structures are padded to 64bit boundary, so 32bit | 44 | /* Make sure all structures are padded to 64bit boundary, so 32bit |
| 47 | userspace works under 64bit kernels */ | 45 | userspace works under 64bit kernels */ |
| 48 | 46 | ||
| @@ -151,6 +149,28 @@ struct fuse_file_lock { | |||
| 151 | */ | 149 | */ |
| 152 | #define FUSE_READ_LOCKOWNER (1 << 1) | 150 | #define FUSE_READ_LOCKOWNER (1 << 1) |
| 153 | 151 | ||
| 152 | /** | ||
| 153 | * Ioctl flags | ||
| 154 | * | ||
| 155 | * FUSE_IOCTL_COMPAT: 32bit compat ioctl on 64bit machine | ||
| 156 | * FUSE_IOCTL_UNRESTRICTED: not restricted to well-formed ioctls, retry allowed | ||
| 157 | * FUSE_IOCTL_RETRY: retry with new iovecs | ||
| 158 | * | ||
| 159 | * FUSE_IOCTL_MAX_IOV: maximum of in_iovecs + out_iovecs | ||
| 160 | */ | ||
| 161 | #define FUSE_IOCTL_COMPAT (1 << 0) | ||
| 162 | #define FUSE_IOCTL_UNRESTRICTED (1 << 1) | ||
| 163 | #define FUSE_IOCTL_RETRY (1 << 2) | ||
| 164 | |||
| 165 | #define FUSE_IOCTL_MAX_IOV 256 | ||
| 166 | |||
| 167 | /** | ||
| 168 | * Poll flags | ||
| 169 | * | ||
| 170 | * FUSE_POLL_SCHEDULE_NOTIFY: request poll notify | ||
| 171 | */ | ||
| 172 | #define FUSE_POLL_SCHEDULE_NOTIFY (1 << 0) | ||
| 173 | |||
| 154 | enum fuse_opcode { | 174 | enum fuse_opcode { |
| 155 | FUSE_LOOKUP = 1, | 175 | FUSE_LOOKUP = 1, |
| 156 | FUSE_FORGET = 2, /* no reply */ | 176 | FUSE_FORGET = 2, /* no reply */ |
| @@ -188,6 +208,13 @@ enum fuse_opcode { | |||
| 188 | FUSE_INTERRUPT = 36, | 208 | FUSE_INTERRUPT = 36, |
| 189 | FUSE_BMAP = 37, | 209 | FUSE_BMAP = 37, |
| 190 | FUSE_DESTROY = 38, | 210 | FUSE_DESTROY = 38, |
| 211 | FUSE_IOCTL = 39, | ||
| 212 | FUSE_POLL = 40, | ||
| 213 | }; | ||
| 214 | |||
| 215 | enum fuse_notify_code { | ||
| 216 | FUSE_NOTIFY_POLL = 1, | ||
| 217 | FUSE_NOTIFY_CODE_MAX, | ||
| 191 | }; | 218 | }; |
| 192 | 219 | ||
| 193 | /* The read buffer is required to be at least 8k, but may be much larger */ | 220 | /* The read buffer is required to be at least 8k, but may be much larger */ |
| @@ -388,6 +415,38 @@ struct fuse_bmap_out { | |||
| 388 | __u64 block; | 415 | __u64 block; |
| 389 | }; | 416 | }; |
| 390 | 417 | ||
| 418 | struct fuse_ioctl_in { | ||
| 419 | __u64 fh; | ||
| 420 | __u32 flags; | ||
| 421 | __u32 cmd; | ||
| 422 | __u64 arg; | ||
| 423 | __u32 in_size; | ||
| 424 | __u32 out_size; | ||
| 425 | }; | ||
| 426 | |||
| 427 | struct fuse_ioctl_out { | ||
| 428 | __s32 result; | ||
| 429 | __u32 flags; | ||
| 430 | __u32 in_iovs; | ||
| 431 | __u32 out_iovs; | ||
| 432 | }; | ||
| 433 | |||
| 434 | struct fuse_poll_in { | ||
| 435 | __u64 fh; | ||
| 436 | __u64 kh; | ||
| 437 | __u32 flags; | ||
| 438 | __u32 padding; | ||
| 439 | }; | ||
| 440 | |||
| 441 | struct fuse_poll_out { | ||
| 442 | __u32 revents; | ||
| 443 | __u32 padding; | ||
| 444 | }; | ||
| 445 | |||
| 446 | struct fuse_notify_poll_wakeup_out { | ||
| 447 | __u64 kh; | ||
| 448 | }; | ||
| 449 | |||
| 391 | struct fuse_in_header { | 450 | struct fuse_in_header { |
| 392 | __u32 len; | 451 | __u32 len; |
| 393 | __u32 opcode; | 452 | __u32 opcode; |
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index e8003afeffba..dd20cd78faa8 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
| @@ -69,12 +69,6 @@ struct vm_area_struct; | |||
| 69 | #define GFP_HIGHUSER_MOVABLE (__GFP_WAIT | __GFP_IO | __GFP_FS | \ | 69 | #define GFP_HIGHUSER_MOVABLE (__GFP_WAIT | __GFP_IO | __GFP_FS | \ |
| 70 | __GFP_HARDWALL | __GFP_HIGHMEM | \ | 70 | __GFP_HARDWALL | __GFP_HIGHMEM | \ |
| 71 | __GFP_MOVABLE) | 71 | __GFP_MOVABLE) |
| 72 | #define GFP_NOFS_PAGECACHE (__GFP_WAIT | __GFP_IO | __GFP_MOVABLE) | ||
| 73 | #define GFP_USER_PAGECACHE (__GFP_WAIT | __GFP_IO | __GFP_FS | \ | ||
| 74 | __GFP_HARDWALL | __GFP_MOVABLE) | ||
| 75 | #define GFP_HIGHUSER_PAGECACHE (__GFP_WAIT | __GFP_IO | __GFP_FS | \ | ||
| 76 | __GFP_HARDWALL | __GFP_HIGHMEM | \ | ||
| 77 | __GFP_MOVABLE) | ||
| 78 | 72 | ||
| 79 | #ifdef CONFIG_NUMA | 73 | #ifdef CONFIG_NUMA |
| 80 | #define GFP_THISNODE (__GFP_THISNODE | __GFP_NOWARN | __GFP_NORETRY) | 74 | #define GFP_THISNODE (__GFP_THISNODE | __GFP_NOWARN | __GFP_NORETRY) |
diff --git a/include/linux/gpio_keys.h b/include/linux/gpio_keys.h index ec6ecd74781d..1289fa7623ca 100644 --- a/include/linux/gpio_keys.h +++ b/include/linux/gpio_keys.h | |||
| @@ -15,6 +15,7 @@ struct gpio_keys_button { | |||
| 15 | struct gpio_keys_platform_data { | 15 | struct gpio_keys_platform_data { |
| 16 | struct gpio_keys_button *buttons; | 16 | struct gpio_keys_button *buttons; |
| 17 | int nbuttons; | 17 | int nbuttons; |
| 18 | unsigned int rep:1; /* enable input subsystem auto repeat */ | ||
| 18 | }; | 19 | }; |
| 19 | 20 | ||
| 20 | #endif | 21 | #endif |
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index e1c8afc002c0..f1d2fba19ea0 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
| @@ -233,6 +233,10 @@ static inline unsigned long huge_page_size(struct hstate *h) | |||
| 233 | return (unsigned long)PAGE_SIZE << h->order; | 233 | return (unsigned long)PAGE_SIZE << h->order; |
| 234 | } | 234 | } |
| 235 | 235 | ||
| 236 | extern unsigned long vma_kernel_pagesize(struct vm_area_struct *vma); | ||
| 237 | |||
| 238 | extern unsigned long vma_mmu_pagesize(struct vm_area_struct *vma); | ||
| 239 | |||
| 236 | static inline unsigned long huge_page_mask(struct hstate *h) | 240 | static inline unsigned long huge_page_mask(struct hstate *h) |
| 237 | { | 241 | { |
| 238 | return h->mask; | 242 | return h->mask; |
| @@ -273,6 +277,8 @@ struct hstate {}; | |||
| 273 | #define hstate_inode(i) NULL | 277 | #define hstate_inode(i) NULL |
| 274 | #define huge_page_size(h) PAGE_SIZE | 278 | #define huge_page_size(h) PAGE_SIZE |
| 275 | #define huge_page_mask(h) PAGE_MASK | 279 | #define huge_page_mask(h) PAGE_MASK |
| 280 | #define vma_kernel_pagesize(v) PAGE_SIZE | ||
| 281 | #define vma_mmu_pagesize(v) PAGE_SIZE | ||
| 276 | #define huge_page_order(h) 0 | 282 | #define huge_page_order(h) 0 |
| 277 | #define huge_page_shift(h) PAGE_SHIFT | 283 | #define huge_page_shift(h) PAGE_SHIFT |
| 278 | static inline unsigned int pages_per_huge_page(struct hstate *h) | 284 | static inline unsigned int pages_per_huge_page(struct hstate *h) |
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 33a5992d4936..20873d402467 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
| @@ -393,11 +393,7 @@ static inline void i2c_set_adapdata(struct i2c_adapter *dev, void *data) | |||
| 393 | #define I2C_CLASS_TV_ANALOG (1<<1) /* bttv + friends */ | 393 | #define I2C_CLASS_TV_ANALOG (1<<1) /* bttv + friends */ |
| 394 | #define I2C_CLASS_TV_DIGITAL (1<<2) /* dvb cards */ | 394 | #define I2C_CLASS_TV_DIGITAL (1<<2) /* dvb cards */ |
| 395 | #define I2C_CLASS_DDC (1<<3) /* DDC bus on graphics adapters */ | 395 | #define I2C_CLASS_DDC (1<<3) /* DDC bus on graphics adapters */ |
| 396 | #define I2C_CLASS_CAM_ANALOG (1<<4) /* camera with analog CCD */ | ||
| 397 | #define I2C_CLASS_CAM_DIGITAL (1<<5) /* most webcams */ | ||
| 398 | #define I2C_CLASS_SOUND (1<<6) /* sound devices */ | ||
| 399 | #define I2C_CLASS_SPD (1<<7) /* SPD EEPROMs and similar */ | 396 | #define I2C_CLASS_SPD (1<<7) /* SPD EEPROMs and similar */ |
| 400 | #define I2C_CLASS_ALL (UINT_MAX) /* all of the above */ | ||
| 401 | 397 | ||
| 402 | /* i2c_client_address_data is the struct for holding default client | 398 | /* i2c_client_address_data is the struct for holding default client |
| 403 | * addresses for a driver and for the parameters supplied on the | 399 | * addresses for a driver and for the parameters supplied on the |
diff --git a/include/linux/i2c/tsc2007.h b/include/linux/i2c/tsc2007.h new file mode 100644 index 000000000000..c6361fbb7bf9 --- /dev/null +++ b/include/linux/i2c/tsc2007.h | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | #ifndef __LINUX_I2C_TSC2007_H | ||
| 2 | #define __LINUX_I2C_TSC2007_H | ||
| 3 | |||
| 4 | /* linux/i2c/tsc2007.h */ | ||
| 5 | |||
| 6 | struct tsc2007_platform_data { | ||
| 7 | u16 model; /* 2007. */ | ||
| 8 | u16 x_plate_ohms; | ||
| 9 | |||
| 10 | int (*get_pendown_state)(void); | ||
| 11 | void (*clear_penirq)(void); /* If needed, clear 2nd level | ||
| 12 | interrupt source */ | ||
| 13 | int (*init_platform_hw)(void); | ||
| 14 | void (*exit_platform_hw)(void); | ||
| 15 | }; | ||
| 16 | |||
| 17 | #endif | ||
diff --git a/include/linux/i2c/twl4030.h b/include/linux/i2c/twl4030.h index a8f84c01f82e..8137f660a5cc 100644 --- a/include/linux/i2c/twl4030.h +++ b/include/linux/i2c/twl4030.h | |||
| @@ -234,6 +234,9 @@ struct twl4030_gpio_platform_data { | |||
| 234 | /* gpio-n should control VMMC(n+1) if BIT(n) in mmc_cd is set */ | 234 | /* gpio-n should control VMMC(n+1) if BIT(n) in mmc_cd is set */ |
| 235 | u8 mmc_cd; | 235 | u8 mmc_cd; |
| 236 | 236 | ||
| 237 | /* if BIT(N) is set, or VMMC(n+1) is linked, debounce GPIO-N */ | ||
| 238 | u32 debounce; | ||
| 239 | |||
| 237 | /* For gpio-N, bit (1 << N) in "pullups" is set if that pullup | 240 | /* For gpio-N, bit (1 << N) in "pullups" is set if that pullup |
| 238 | * should be enabled. Else, if that bit is set in "pulldowns", | 241 | * should be enabled. Else, if that bit is set in "pulldowns", |
| 239 | * that pulldown is enabled. Don't waste power by letting any | 242 | * that pulldown is enabled. Don't waste power by letting any |
| @@ -307,12 +310,6 @@ int twl4030_sih_setup(int module); | |||
| 307 | #define TWL4030_VAUX3_DEV_GRP 0x1F | 310 | #define TWL4030_VAUX3_DEV_GRP 0x1F |
| 308 | #define TWL4030_VAUX3_DEDICATED 0x22 | 311 | #define TWL4030_VAUX3_DEDICATED 0x22 |
| 309 | 312 | ||
| 310 | /* | ||
| 311 | * Exported TWL4030 GPIO APIs | ||
| 312 | * | ||
| 313 | * WARNING -- use standard GPIO and IRQ calls instead; these will vanish. | ||
| 314 | */ | ||
| 315 | int twl4030_set_gpio_debounce(int gpio, int enable); | ||
| 316 | 313 | ||
| 317 | #if defined(CONFIG_TWL4030_BCI_BATTERY) || \ | 314 | #if defined(CONFIG_TWL4030_BCI_BATTERY) || \ |
| 318 | defined(CONFIG_TWL4030_BCI_BATTERY_MODULE) | 315 | defined(CONFIG_TWL4030_BCI_BATTERY_MODULE) |
diff --git a/include/linux/ide.h b/include/linux/ide.h index db5ef8ae1ab9..3644f6323384 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
| @@ -32,18 +32,14 @@ | |||
| 32 | # define SUPPORT_VLB_SYNC 1 | 32 | # define SUPPORT_VLB_SYNC 1 |
| 33 | #endif | 33 | #endif |
| 34 | 34 | ||
| 35 | typedef unsigned char byte; /* used everywhere */ | ||
| 36 | |||
| 37 | /* | 35 | /* |
| 38 | * Probably not wise to fiddle with these | 36 | * Probably not wise to fiddle with these |
| 39 | */ | 37 | */ |
| 38 | #define IDE_DEFAULT_MAX_FAILURES 1 | ||
| 40 | #define ERROR_MAX 8 /* Max read/write errors per sector */ | 39 | #define ERROR_MAX 8 /* Max read/write errors per sector */ |
| 41 | #define ERROR_RESET 3 /* Reset controller every 4th retry */ | 40 | #define ERROR_RESET 3 /* Reset controller every 4th retry */ |
| 42 | #define ERROR_RECAL 1 /* Recalibrate every 2nd retry */ | 41 | #define ERROR_RECAL 1 /* Recalibrate every 2nd retry */ |
| 43 | 42 | ||
| 44 | #define HWIF(drive) ((ide_hwif_t *)((drive)->hwif)) | ||
| 45 | #define HWGROUP(drive) ((ide_hwgroup_t *)(HWIF(drive)->hwgroup)) | ||
| 46 | |||
| 47 | /* | 43 | /* |
| 48 | * Definitions for accessing IDE controller registers | 44 | * Definitions for accessing IDE controller registers |
| 49 | */ | 45 | */ |
| @@ -185,9 +181,6 @@ typedef struct hw_regs_s { | |||
| 185 | unsigned long config; | 181 | unsigned long config; |
| 186 | } hw_regs_t; | 182 | } hw_regs_t; |
| 187 | 183 | ||
| 188 | void ide_init_port_data(struct hwif_s *, unsigned int); | ||
| 189 | void ide_init_port_hw(struct hwif_s *, hw_regs_t *); | ||
| 190 | |||
| 191 | static inline void ide_std_init_ports(hw_regs_t *hw, | 184 | static inline void ide_std_init_ports(hw_regs_t *hw, |
| 192 | unsigned long io_addr, | 185 | unsigned long io_addr, |
| 193 | unsigned long ctl_addr) | 186 | unsigned long ctl_addr) |
| @@ -433,18 +426,14 @@ struct ide_atapi_pc { | |||
| 433 | struct idetape_bh *bh; | 426 | struct idetape_bh *bh; |
| 434 | char *b_data; | 427 | char *b_data; |
| 435 | 428 | ||
| 436 | /* idescsi only for now */ | ||
| 437 | struct scatterlist *sg; | 429 | struct scatterlist *sg; |
| 438 | unsigned int sg_cnt; | 430 | unsigned int sg_cnt; |
| 439 | 431 | ||
| 440 | struct scsi_cmnd *scsi_cmd; | ||
| 441 | void (*done) (struct scsi_cmnd *); | ||
| 442 | |||
| 443 | unsigned long timeout; | 432 | unsigned long timeout; |
| 444 | }; | 433 | }; |
| 445 | 434 | ||
| 446 | struct ide_devset; | 435 | struct ide_devset; |
| 447 | struct ide_driver_s; | 436 | struct ide_driver; |
| 448 | 437 | ||
| 449 | #ifdef CONFIG_BLK_DEV_IDEACPI | 438 | #ifdef CONFIG_BLK_DEV_IDEACPI |
| 450 | struct ide_acpi_drive_link; | 439 | struct ide_acpi_drive_link; |
| @@ -588,7 +577,6 @@ struct ide_drive_s { | |||
| 588 | struct request_queue *queue; /* request queue */ | 577 | struct request_queue *queue; /* request queue */ |
| 589 | 578 | ||
| 590 | struct request *rq; /* current request */ | 579 | struct request *rq; /* current request */ |
| 591 | struct ide_drive_s *next; /* circular list of hwgroup drives */ | ||
| 592 | void *driver_data; /* extra driver data */ | 580 | void *driver_data; /* extra driver data */ |
| 593 | u16 *id; /* identification info */ | 581 | u16 *id; /* identification info */ |
| 594 | #ifdef CONFIG_IDE_PROC_FS | 582 | #ifdef CONFIG_IDE_PROC_FS |
| @@ -662,6 +650,8 @@ struct ide_drive_s { | |||
| 662 | int (*pc_io_buffers)(struct ide_drive_s *, struct ide_atapi_pc *, | 650 | int (*pc_io_buffers)(struct ide_drive_s *, struct ide_atapi_pc *, |
| 663 | unsigned int, int); | 651 | unsigned int, int); |
| 664 | 652 | ||
| 653 | ide_startstop_t (*irq_handler)(struct ide_drive_s *); | ||
| 654 | |||
| 665 | unsigned long atapi_flags; | 655 | unsigned long atapi_flags; |
| 666 | 656 | ||
| 667 | struct ide_atapi_pc request_sense_pc; | 657 | struct ide_atapi_pc request_sense_pc; |
| @@ -684,7 +674,6 @@ struct ide_tp_ops { | |||
| 684 | void (*exec_command)(struct hwif_s *, u8); | 674 | void (*exec_command)(struct hwif_s *, u8); |
| 685 | u8 (*read_status)(struct hwif_s *); | 675 | u8 (*read_status)(struct hwif_s *); |
| 686 | u8 (*read_altstatus)(struct hwif_s *); | 676 | u8 (*read_altstatus)(struct hwif_s *); |
| 687 | u8 (*read_sff_dma_status)(struct hwif_s *); | ||
| 688 | 677 | ||
| 689 | void (*set_irq)(struct hwif_s *, int); | 678 | void (*set_irq)(struct hwif_s *, int); |
| 690 | 679 | ||
| @@ -745,14 +734,17 @@ struct ide_dma_ops { | |||
| 745 | int (*dma_test_irq)(struct ide_drive_s *); | 734 | int (*dma_test_irq)(struct ide_drive_s *); |
| 746 | void (*dma_lost_irq)(struct ide_drive_s *); | 735 | void (*dma_lost_irq)(struct ide_drive_s *); |
| 747 | void (*dma_timeout)(struct ide_drive_s *); | 736 | void (*dma_timeout)(struct ide_drive_s *); |
| 737 | /* | ||
| 738 | * The following method is optional and only required to be | ||
| 739 | * implemented for the SFF-8038i compatible controllers. | ||
| 740 | */ | ||
| 741 | u8 (*dma_sff_read_status)(struct hwif_s *); | ||
| 748 | }; | 742 | }; |
| 749 | 743 | ||
| 750 | struct ide_host; | 744 | struct ide_host; |
| 751 | 745 | ||
| 752 | typedef struct hwif_s { | 746 | typedef struct hwif_s { |
| 753 | struct hwif_s *next; /* for linked-list in ide_hwgroup_t */ | ||
| 754 | struct hwif_s *mate; /* other hwif from same PCI chip */ | 747 | struct hwif_s *mate; /* other hwif from same PCI chip */ |
| 755 | struct hwgroup_s *hwgroup; /* actually (ide_hwgroup_t *) */ | ||
| 756 | struct proc_dir_entry *proc; /* /proc/ide/ directory entry */ | 748 | struct proc_dir_entry *proc; /* /proc/ide/ directory entry */ |
| 757 | 749 | ||
| 758 | struct ide_host *host; | 750 | struct ide_host *host; |
| @@ -763,7 +755,7 @@ typedef struct hwif_s { | |||
| 763 | 755 | ||
| 764 | unsigned long sata_scr[SATA_NR_PORTS]; | 756 | unsigned long sata_scr[SATA_NR_PORTS]; |
| 765 | 757 | ||
| 766 | ide_drive_t drives[MAX_DRIVES]; /* drive info */ | 758 | ide_drive_t *devices[MAX_DRIVES + 1]; |
| 767 | 759 | ||
| 768 | u8 major; /* our major number */ | 760 | u8 major; /* our major number */ |
| 769 | u8 index; /* 0 for ide0; 1 for ide1; ... */ | 761 | u8 index; /* 0 for ide0; 1 for ide1; ... */ |
| @@ -829,7 +821,7 @@ typedef struct hwif_s { | |||
| 829 | unsigned extra_ports; /* number of extra dma ports */ | 821 | unsigned extra_ports; /* number of extra dma ports */ |
| 830 | 822 | ||
| 831 | unsigned present : 1; /* this interface exists */ | 823 | unsigned present : 1; /* this interface exists */ |
| 832 | unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */ | 824 | unsigned busy : 1; /* serializes devices on a port */ |
| 833 | 825 | ||
| 834 | struct device gendev; | 826 | struct device gendev; |
| 835 | struct device *portdev; | 827 | struct device *portdev; |
| @@ -841,19 +833,49 @@ typedef struct hwif_s { | |||
| 841 | #ifdef CONFIG_BLK_DEV_IDEACPI | 833 | #ifdef CONFIG_BLK_DEV_IDEACPI |
| 842 | struct ide_acpi_hwif_link *acpidata; | 834 | struct ide_acpi_hwif_link *acpidata; |
| 843 | #endif | 835 | #endif |
| 836 | |||
| 837 | /* IRQ handler, if active */ | ||
| 838 | ide_startstop_t (*handler)(ide_drive_t *); | ||
| 839 | |||
| 840 | /* BOOL: polling active & poll_timeout field valid */ | ||
| 841 | unsigned int polling : 1; | ||
| 842 | |||
| 843 | /* current drive */ | ||
| 844 | ide_drive_t *cur_dev; | ||
| 845 | |||
| 846 | /* current request */ | ||
| 847 | struct request *rq; | ||
| 848 | |||
| 849 | /* failsafe timer */ | ||
| 850 | struct timer_list timer; | ||
| 851 | /* timeout value during long polls */ | ||
| 852 | unsigned long poll_timeout; | ||
| 853 | /* queried upon timeouts */ | ||
| 854 | int (*expiry)(ide_drive_t *); | ||
| 855 | |||
| 856 | int req_gen; | ||
| 857 | int req_gen_timer; | ||
| 858 | |||
| 859 | spinlock_t lock; | ||
| 844 | } ____cacheline_internodealigned_in_smp ide_hwif_t; | 860 | } ____cacheline_internodealigned_in_smp ide_hwif_t; |
| 845 | 861 | ||
| 846 | #define MAX_HOST_PORTS 4 | 862 | #define MAX_HOST_PORTS 4 |
| 847 | 863 | ||
| 848 | struct ide_host { | 864 | struct ide_host { |
| 849 | ide_hwif_t *ports[MAX_HOST_PORTS]; | 865 | ide_hwif_t *ports[MAX_HOST_PORTS + 1]; |
| 850 | unsigned int n_ports; | 866 | unsigned int n_ports; |
| 851 | struct device *dev[2]; | 867 | struct device *dev[2]; |
| 852 | unsigned int (*init_chipset)(struct pci_dev *); | 868 | unsigned int (*init_chipset)(struct pci_dev *); |
| 853 | unsigned long host_flags; | 869 | unsigned long host_flags; |
| 854 | void *host_priv; | 870 | void *host_priv; |
| 871 | ide_hwif_t *cur_port; /* for hosts requiring serialization */ | ||
| 872 | |||
| 873 | /* used for hosts requiring serialization */ | ||
| 874 | volatile long host_busy; | ||
| 855 | }; | 875 | }; |
| 856 | 876 | ||
| 877 | #define IDE_HOST_BUSY 0 | ||
| 878 | |||
| 857 | /* | 879 | /* |
| 858 | * internal ide interrupt handler type | 880 | * internal ide interrupt handler type |
| 859 | */ | 881 | */ |
| @@ -863,38 +885,6 @@ typedef int (ide_expiry_t)(ide_drive_t *); | |||
| 863 | /* used by ide-cd, ide-floppy, etc. */ | 885 | /* used by ide-cd, ide-floppy, etc. */ |
| 864 | typedef void (xfer_func_t)(ide_drive_t *, struct request *rq, void *, unsigned); | 886 | typedef void (xfer_func_t)(ide_drive_t *, struct request *rq, void *, unsigned); |
| 865 | 887 | ||
| 866 | typedef struct hwgroup_s { | ||
| 867 | /* irq handler, if active */ | ||
| 868 | ide_startstop_t (*handler)(ide_drive_t *); | ||
| 869 | |||
| 870 | /* BOOL: protects all fields below */ | ||
| 871 | volatile int busy; | ||
| 872 | /* BOOL: polling active & poll_timeout field valid */ | ||
| 873 | unsigned int polling : 1; | ||
| 874 | |||
| 875 | /* current drive */ | ||
| 876 | ide_drive_t *drive; | ||
| 877 | /* ptr to current hwif in linked-list */ | ||
| 878 | ide_hwif_t *hwif; | ||
| 879 | |||
| 880 | /* current request */ | ||
| 881 | struct request *rq; | ||
| 882 | |||
| 883 | /* failsafe timer */ | ||
| 884 | struct timer_list timer; | ||
| 885 | /* timeout value during long polls */ | ||
| 886 | unsigned long poll_timeout; | ||
| 887 | /* queried upon timeouts */ | ||
| 888 | int (*expiry)(ide_drive_t *); | ||
| 889 | |||
| 890 | int req_gen; | ||
| 891 | int req_gen_timer; | ||
| 892 | |||
| 893 | spinlock_t lock; | ||
| 894 | } ide_hwgroup_t; | ||
| 895 | |||
| 896 | typedef struct ide_driver_s ide_driver_t; | ||
| 897 | |||
| 898 | extern struct mutex ide_setting_mtx; | 888 | extern struct mutex ide_setting_mtx; |
| 899 | 889 | ||
| 900 | /* | 890 | /* |
| @@ -1020,8 +1010,8 @@ void ide_proc_register_port(ide_hwif_t *); | |||
| 1020 | void ide_proc_port_register_devices(ide_hwif_t *); | 1010 | void ide_proc_port_register_devices(ide_hwif_t *); |
| 1021 | void ide_proc_unregister_device(ide_drive_t *); | 1011 | void ide_proc_unregister_device(ide_drive_t *); |
| 1022 | void ide_proc_unregister_port(ide_hwif_t *); | 1012 | void ide_proc_unregister_port(ide_hwif_t *); |
| 1023 | void ide_proc_register_driver(ide_drive_t *, ide_driver_t *); | 1013 | void ide_proc_register_driver(ide_drive_t *, struct ide_driver *); |
| 1024 | void ide_proc_unregister_driver(ide_drive_t *, ide_driver_t *); | 1014 | void ide_proc_unregister_driver(ide_drive_t *, struct ide_driver *); |
| 1025 | 1015 | ||
| 1026 | read_proc_t proc_ide_read_capacity; | 1016 | read_proc_t proc_ide_read_capacity; |
| 1027 | read_proc_t proc_ide_read_geometry; | 1017 | read_proc_t proc_ide_read_geometry; |
| @@ -1048,8 +1038,10 @@ static inline void ide_proc_register_port(ide_hwif_t *hwif) { ; } | |||
| 1048 | static inline void ide_proc_port_register_devices(ide_hwif_t *hwif) { ; } | 1038 | static inline void ide_proc_port_register_devices(ide_hwif_t *hwif) { ; } |
| 1049 | static inline void ide_proc_unregister_device(ide_drive_t *drive) { ; } | 1039 | static inline void ide_proc_unregister_device(ide_drive_t *drive) { ; } |
| 1050 | static inline void ide_proc_unregister_port(ide_hwif_t *hwif) { ; } | 1040 | static inline void ide_proc_unregister_port(ide_hwif_t *hwif) { ; } |
| 1051 | static inline void ide_proc_register_driver(ide_drive_t *drive, ide_driver_t *driver) { ; } | 1041 | static inline void ide_proc_register_driver(ide_drive_t *drive, |
| 1052 | static inline void ide_proc_unregister_driver(ide_drive_t *drive, ide_driver_t *driver) { ; } | 1042 | struct ide_driver *driver) { ; } |
| 1043 | static inline void ide_proc_unregister_driver(ide_drive_t *drive, | ||
| 1044 | struct ide_driver *driver) { ; } | ||
| 1053 | #define PROC_IDE_READ_RETURN(page,start,off,count,eof,len) return 0; | 1045 | #define PROC_IDE_READ_RETURN(page,start,off,count,eof,len) return 0; |
| 1054 | #endif | 1046 | #endif |
| 1055 | 1047 | ||
| @@ -1118,11 +1110,10 @@ void ide_check_pm_state(ide_drive_t *, struct request *); | |||
| 1118 | * The gendriver.owner field should be set to the module owner of this driver. | 1110 | * The gendriver.owner field should be set to the module owner of this driver. |
| 1119 | * The gendriver.name field should be set to the name of this driver | 1111 | * The gendriver.name field should be set to the name of this driver |
| 1120 | */ | 1112 | */ |
| 1121 | struct ide_driver_s { | 1113 | struct ide_driver { |
| 1122 | const char *version; | 1114 | const char *version; |
| 1123 | ide_startstop_t (*do_request)(ide_drive_t *, struct request *, sector_t); | 1115 | ide_startstop_t (*do_request)(ide_drive_t *, struct request *, sector_t); |
| 1124 | int (*end_request)(ide_drive_t *, int, int); | 1116 | int (*end_request)(ide_drive_t *, int, int); |
| 1125 | ide_startstop_t (*error)(ide_drive_t *, struct request *rq, u8, u8); | ||
| 1126 | struct device_driver gen_driver; | 1117 | struct device_driver gen_driver; |
| 1127 | int (*probe)(ide_drive_t *); | 1118 | int (*probe)(ide_drive_t *); |
| 1128 | void (*remove)(ide_drive_t *); | 1119 | void (*remove)(ide_drive_t *); |
| @@ -1134,7 +1125,7 @@ struct ide_driver_s { | |||
| 1134 | #endif | 1125 | #endif |
| 1135 | }; | 1126 | }; |
| 1136 | 1127 | ||
| 1137 | #define to_ide_driver(drv) container_of(drv, ide_driver_t, gen_driver) | 1128 | #define to_ide_driver(drv) container_of(drv, struct ide_driver, gen_driver) |
| 1138 | 1129 | ||
| 1139 | int ide_device_get(ide_drive_t *); | 1130 | int ide_device_get(ide_drive_t *); |
| 1140 | void ide_device_put(ide_drive_t *); | 1131 | void ide_device_put(ide_drive_t *); |
| @@ -1166,9 +1157,7 @@ void ide_execute_pkt_cmd(ide_drive_t *); | |||
| 1166 | 1157 | ||
| 1167 | void ide_pad_transfer(ide_drive_t *, int, int); | 1158 | void ide_pad_transfer(ide_drive_t *, int, int); |
| 1168 | 1159 | ||
| 1169 | ide_startstop_t __ide_error(ide_drive_t *, struct request *, u8, u8); | 1160 | ide_startstop_t ide_error(ide_drive_t *, const char *, u8); |
| 1170 | |||
| 1171 | ide_startstop_t ide_error (ide_drive_t *drive, const char *msg, byte stat); | ||
| 1172 | 1161 | ||
| 1173 | void ide_fix_driveid(u16 *); | 1162 | void ide_fix_driveid(u16 *); |
| 1174 | 1163 | ||
| @@ -1192,7 +1181,6 @@ void ide_tf_dump(const char *, struct ide_taskfile *); | |||
| 1192 | void ide_exec_command(ide_hwif_t *, u8); | 1181 | void ide_exec_command(ide_hwif_t *, u8); |
| 1193 | u8 ide_read_status(ide_hwif_t *); | 1182 | u8 ide_read_status(ide_hwif_t *); |
| 1194 | u8 ide_read_altstatus(ide_hwif_t *); | 1183 | u8 ide_read_altstatus(ide_hwif_t *); |
| 1195 | u8 ide_read_sff_dma_status(ide_hwif_t *); | ||
| 1196 | 1184 | ||
| 1197 | void ide_set_irq(ide_hwif_t *, int); | 1185 | void ide_set_irq(ide_hwif_t *, int); |
| 1198 | 1186 | ||
| @@ -1272,26 +1260,6 @@ extern void ide_stall_queue(ide_drive_t *drive, unsigned long timeout); | |||
| 1272 | 1260 | ||
| 1273 | extern void ide_timer_expiry(unsigned long); | 1261 | extern void ide_timer_expiry(unsigned long); |
| 1274 | extern irqreturn_t ide_intr(int irq, void *dev_id); | 1262 | extern irqreturn_t ide_intr(int irq, void *dev_id); |
| 1275 | |||
| 1276 | static inline int ide_lock_hwgroup(ide_hwgroup_t *hwgroup) | ||
| 1277 | { | ||
| 1278 | if (hwgroup->busy) | ||
| 1279 | return 1; | ||
| 1280 | |||
| 1281 | hwgroup->busy = 1; | ||
| 1282 | /* for atari only */ | ||
| 1283 | ide_get_lock(ide_intr, hwgroup); | ||
| 1284 | |||
| 1285 | return 0; | ||
| 1286 | } | ||
| 1287 | |||
| 1288 | static inline void ide_unlock_hwgroup(ide_hwgroup_t *hwgroup) | ||
| 1289 | { | ||
| 1290 | /* for atari only */ | ||
| 1291 | ide_release_lock(); | ||
| 1292 | hwgroup->busy = 0; | ||
| 1293 | } | ||
| 1294 | |||
| 1295 | extern void do_ide_request(struct request_queue *); | 1263 | extern void do_ide_request(struct request_queue *); |
| 1296 | 1264 | ||
| 1297 | void ide_init_disk(struct gendisk *, ide_drive_t *); | 1265 | void ide_init_disk(struct gendisk *, ide_drive_t *); |
| @@ -1327,11 +1295,11 @@ static inline int ide_hwif_setup_dma(ide_hwif_t *hwif, | |||
| 1327 | } | 1295 | } |
| 1328 | #endif | 1296 | #endif |
| 1329 | 1297 | ||
| 1330 | typedef struct ide_pci_enablebit_s { | 1298 | struct ide_pci_enablebit { |
| 1331 | u8 reg; /* byte pci reg holding the enable-bit */ | 1299 | u8 reg; /* byte pci reg holding the enable-bit */ |
| 1332 | u8 mask; /* mask to isolate the enable-bit */ | 1300 | u8 mask; /* mask to isolate the enable-bit */ |
| 1333 | u8 val; /* value of masked reg when "enabled" */ | 1301 | u8 val; /* value of masked reg when "enabled" */ |
| 1334 | } ide_pci_enablebit_t; | 1302 | }; |
| 1335 | 1303 | ||
| 1336 | enum { | 1304 | enum { |
| 1337 | /* Uses ISA control ports not PCI ones. */ | 1305 | /* Uses ISA control ports not PCI ones. */ |
| @@ -1420,7 +1388,8 @@ struct ide_port_info { | |||
| 1420 | const struct ide_port_ops *port_ops; | 1388 | const struct ide_port_ops *port_ops; |
| 1421 | const struct ide_dma_ops *dma_ops; | 1389 | const struct ide_dma_ops *dma_ops; |
| 1422 | 1390 | ||
| 1423 | ide_pci_enablebit_t enablebits[2]; | 1391 | struct ide_pci_enablebit enablebits[2]; |
| 1392 | |||
| 1424 | hwif_chipset_t chipset; | 1393 | hwif_chipset_t chipset; |
| 1425 | 1394 | ||
| 1426 | u16 max_sectors; /* if < than the default one */ | 1395 | u16 max_sectors; /* if < than the default one */ |
| @@ -1492,6 +1461,7 @@ void ide_dma_exec_cmd(ide_drive_t *, u8); | |||
| 1492 | extern void ide_dma_start(ide_drive_t *); | 1461 | extern void ide_dma_start(ide_drive_t *); |
| 1493 | int ide_dma_end(ide_drive_t *); | 1462 | int ide_dma_end(ide_drive_t *); |
| 1494 | int ide_dma_test_irq(ide_drive_t *); | 1463 | int ide_dma_test_irq(ide_drive_t *); |
| 1464 | u8 ide_dma_sff_read_status(ide_hwif_t *); | ||
| 1495 | extern const struct ide_dma_ops sff_dma_ops; | 1465 | extern const struct ide_dma_ops sff_dma_ops; |
| 1496 | #else | 1466 | #else |
| 1497 | static inline int config_drive_for_dma(ide_drive_t *drive) { return 0; } | 1467 | static inline int config_drive_for_dma(ide_drive_t *drive) { return 0; } |
| @@ -1529,9 +1499,6 @@ static inline void ide_acpi_port_init_devices(ide_hwif_t *hwif) { ; } | |||
| 1529 | static inline void ide_acpi_set_state(ide_hwif_t *hwif, int on) {} | 1499 | static inline void ide_acpi_set_state(ide_hwif_t *hwif, int on) {} |
| 1530 | #endif | 1500 | #endif |
| 1531 | 1501 | ||
| 1532 | void ide_remove_port_from_hwgroup(ide_hwif_t *); | ||
| 1533 | void ide_unregister(ide_hwif_t *); | ||
| 1534 | |||
| 1535 | void ide_register_region(struct gendisk *); | 1502 | void ide_register_region(struct gendisk *); |
| 1536 | void ide_unregister_region(struct gendisk *); | 1503 | void ide_unregister_region(struct gendisk *); |
| 1537 | 1504 | ||
| @@ -1616,23 +1583,6 @@ static inline void ide_set_max_pio(ide_drive_t *drive) | |||
| 1616 | ide_set_pio(drive, 255); | 1583 | ide_set_pio(drive, 255); |
| 1617 | } | 1584 | } |
| 1618 | 1585 | ||
| 1619 | extern spinlock_t ide_lock; | ||
| 1620 | extern struct mutex ide_cfg_mtx; | ||
| 1621 | /* | ||
| 1622 | * Structure locking: | ||
| 1623 | * | ||
| 1624 | * ide_cfg_mtx and hwgroup->lock together protect changes to | ||
| 1625 | * ide_hwif_t->next | ||
| 1626 | * ide_drive_t->next | ||
| 1627 | * | ||
| 1628 | * ide_hwgroup_t->busy: hwgroup->lock | ||
| 1629 | * ide_hwgroup_t->hwif: hwgroup->lock | ||
| 1630 | * ide_hwif_t->{hwgroup,mate}: constant, no locking | ||
| 1631 | * ide_drive_t->hwif: constant, no locking | ||
| 1632 | */ | ||
| 1633 | |||
| 1634 | #define local_irq_set(flags) do { local_save_flags((flags)); local_irq_enable_in_hardirq(); } while (0) | ||
| 1635 | |||
| 1636 | char *ide_media_string(ide_drive_t *); | 1586 | char *ide_media_string(ide_drive_t *); |
| 1637 | 1587 | ||
| 1638 | extern struct device_attribute ide_dev_attrs[]; | 1588 | extern struct device_attribute ide_dev_attrs[]; |
| @@ -1651,8 +1601,15 @@ static inline int hwif_to_node(ide_hwif_t *hwif) | |||
| 1651 | 1601 | ||
| 1652 | static inline ide_drive_t *ide_get_pair_dev(ide_drive_t *drive) | 1602 | static inline ide_drive_t *ide_get_pair_dev(ide_drive_t *drive) |
| 1653 | { | 1603 | { |
| 1654 | ide_drive_t *peer = &drive->hwif->drives[(drive->dn ^ 1) & 1]; | 1604 | ide_drive_t *peer = drive->hwif->devices[(drive->dn ^ 1) & 1]; |
| 1655 | 1605 | ||
| 1656 | return (peer->dev_flags & IDE_DFLAG_PRESENT) ? peer : NULL; | 1606 | return (peer->dev_flags & IDE_DFLAG_PRESENT) ? peer : NULL; |
| 1657 | } | 1607 | } |
| 1608 | |||
| 1609 | #define ide_port_for_each_dev(i, dev, port) \ | ||
| 1610 | for ((i) = 0; ((dev) = (port)->devices[i]) || (i) < MAX_DRIVES; (i)++) | ||
| 1611 | |||
| 1612 | #define ide_host_for_each_port(i, port, host) \ | ||
| 1613 | for ((i) = 0; ((port) = (host)->ports[i]) || (i) < MAX_HOST_PORTS; (i)++) | ||
| 1614 | |||
| 1658 | #endif /* _IDE_H */ | 1615 | #endif /* _IDE_H */ |
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index a5cb0c3f6dcf..f8ff918c208f 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h | |||
| @@ -115,6 +115,11 @@ extern u16 vlan_dev_vlan_id(const struct net_device *dev); | |||
| 115 | extern int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp, | 115 | extern int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp, |
| 116 | u16 vlan_tci, int polling); | 116 | u16 vlan_tci, int polling); |
| 117 | extern int vlan_hwaccel_do_receive(struct sk_buff *skb); | 117 | extern int vlan_hwaccel_do_receive(struct sk_buff *skb); |
| 118 | extern int vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp, | ||
| 119 | unsigned int vlan_tci, struct sk_buff *skb); | ||
| 120 | extern int vlan_gro_frags(struct napi_struct *napi, struct vlan_group *grp, | ||
| 121 | unsigned int vlan_tci, | ||
| 122 | struct napi_gro_fraginfo *info); | ||
| 118 | 123 | ||
| 119 | #else | 124 | #else |
| 120 | static inline struct net_device *vlan_dev_real_dev(const struct net_device *dev) | 125 | static inline struct net_device *vlan_dev_real_dev(const struct net_device *dev) |
| @@ -140,6 +145,20 @@ static inline int vlan_hwaccel_do_receive(struct sk_buff *skb) | |||
| 140 | { | 145 | { |
| 141 | return 0; | 146 | return 0; |
| 142 | } | 147 | } |
| 148 | |||
| 149 | static inline int vlan_gro_receive(struct napi_struct *napi, | ||
| 150 | struct vlan_group *grp, | ||
| 151 | unsigned int vlan_tci, struct sk_buff *skb) | ||
| 152 | { | ||
| 153 | return NET_RX_DROP; | ||
| 154 | } | ||
| 155 | |||
| 156 | static inline int vlan_gro_frags(struct napi_struct *napi, | ||
| 157 | struct vlan_group *grp, unsigned int vlan_tci, | ||
| 158 | struct napi_gro_fraginfo *info) | ||
| 159 | { | ||
| 160 | return NET_RX_DROP; | ||
| 161 | } | ||
| 143 | #endif | 162 | #endif |
| 144 | 163 | ||
| 145 | /** | 164 | /** |
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 0702c4d7bdf0..9127f6b51a39 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
| @@ -14,7 +14,6 @@ | |||
| 14 | #include <linux/irqflags.h> | 14 | #include <linux/irqflags.h> |
| 15 | #include <linux/smp.h> | 15 | #include <linux/smp.h> |
| 16 | #include <linux/percpu.h> | 16 | #include <linux/percpu.h> |
| 17 | #include <linux/irqnr.h> | ||
| 18 | 17 | ||
| 19 | #include <asm/atomic.h> | 18 | #include <asm/atomic.h> |
| 20 | #include <asm/ptrace.h> | 19 | #include <asm/ptrace.h> |
| @@ -253,7 +252,8 @@ enum | |||
| 253 | BLOCK_SOFTIRQ, | 252 | BLOCK_SOFTIRQ, |
| 254 | TASKLET_SOFTIRQ, | 253 | TASKLET_SOFTIRQ, |
| 255 | SCHED_SOFTIRQ, | 254 | SCHED_SOFTIRQ, |
| 256 | RCU_SOFTIRQ, /* Preferable RCU should always be the last softirq */ | 255 | HRTIMER_SOFTIRQ, |
| 256 | RCU_SOFTIRQ, /* Preferable RCU should always be the last softirq */ | ||
| 257 | 257 | ||
| 258 | NR_SOFTIRQS | 258 | NR_SOFTIRQS |
| 259 | }; | 259 | }; |
diff --git a/include/linux/ioport.h b/include/linux/ioport.h index 041e95aac2bf..f6bb2ca8e3ba 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h | |||
| @@ -49,6 +49,7 @@ struct resource_list { | |||
| 49 | #define IORESOURCE_SIZEALIGN 0x00020000 /* size indicates alignment */ | 49 | #define IORESOURCE_SIZEALIGN 0x00020000 /* size indicates alignment */ |
| 50 | #define IORESOURCE_STARTALIGN 0x00040000 /* start field is alignment */ | 50 | #define IORESOURCE_STARTALIGN 0x00040000 /* start field is alignment */ |
| 51 | 51 | ||
| 52 | #define IORESOURCE_EXCLUSIVE 0x08000000 /* Userland may not map this resource */ | ||
| 52 | #define IORESOURCE_DISABLED 0x10000000 | 53 | #define IORESOURCE_DISABLED 0x10000000 |
| 53 | #define IORESOURCE_UNSET 0x20000000 | 54 | #define IORESOURCE_UNSET 0x20000000 |
| 54 | #define IORESOURCE_AUTO 0x40000000 | 55 | #define IORESOURCE_AUTO 0x40000000 |
| @@ -133,13 +134,16 @@ static inline unsigned long resource_type(struct resource *res) | |||
| 133 | } | 134 | } |
| 134 | 135 | ||
| 135 | /* Convenience shorthand with allocation */ | 136 | /* Convenience shorthand with allocation */ |
| 136 | #define request_region(start,n,name) __request_region(&ioport_resource, (start), (n), (name)) | 137 | #define request_region(start,n,name) __request_region(&ioport_resource, (start), (n), (name), 0) |
| 137 | #define request_mem_region(start,n,name) __request_region(&iomem_resource, (start), (n), (name)) | 138 | #define __request_mem_region(start,n,name, excl) __request_region(&iomem_resource, (start), (n), (name), excl) |
| 139 | #define request_mem_region(start,n,name) __request_region(&iomem_resource, (start), (n), (name), 0) | ||
| 140 | #define request_mem_region_exclusive(start,n,name) \ | ||
| 141 | __request_region(&iomem_resource, (start), (n), (name), IORESOURCE_EXCLUSIVE) | ||
| 138 | #define rename_region(region, newname) do { (region)->name = (newname); } while (0) | 142 | #define rename_region(region, newname) do { (region)->name = (newname); } while (0) |
| 139 | 143 | ||
| 140 | extern struct resource * __request_region(struct resource *, | 144 | extern struct resource * __request_region(struct resource *, |
| 141 | resource_size_t start, | 145 | resource_size_t start, |
| 142 | resource_size_t n, const char *name); | 146 | resource_size_t n, const char *name, int relaxed); |
| 143 | 147 | ||
| 144 | /* Compatibility cruft */ | 148 | /* Compatibility cruft */ |
| 145 | #define release_region(start,n) __release_region(&ioport_resource, (start), (n)) | 149 | #define release_region(start,n) __release_region(&ioport_resource, (start), (n)) |
| @@ -175,6 +179,7 @@ extern struct resource * __devm_request_region(struct device *dev, | |||
| 175 | extern void __devm_release_region(struct device *dev, struct resource *parent, | 179 | extern void __devm_release_region(struct device *dev, struct resource *parent, |
| 176 | resource_size_t start, resource_size_t n); | 180 | resource_size_t start, resource_size_t n); |
| 177 | extern int iomem_map_sanity_check(resource_size_t addr, unsigned long size); | 181 | extern int iomem_map_sanity_check(resource_size_t addr, unsigned long size); |
| 182 | extern int iomem_is_exclusive(u64 addr); | ||
| 178 | 183 | ||
| 179 | #endif /* __ASSEMBLY__ */ | 184 | #endif /* __ASSEMBLY__ */ |
| 180 | #endif /* _LINUX_IOPORT_H */ | 185 | #endif /* _LINUX_IOPORT_H */ |
diff --git a/include/linux/ioprio.h b/include/linux/ioprio.h index f98a656b17e5..76dad4808847 100644 --- a/include/linux/ioprio.h +++ b/include/linux/ioprio.h | |||
| @@ -86,4 +86,6 @@ static inline int task_nice_ioclass(struct task_struct *task) | |||
| 86 | */ | 86 | */ |
| 87 | extern int ioprio_best(unsigned short aprio, unsigned short bprio); | 87 | extern int ioprio_best(unsigned short aprio, unsigned short bprio); |
| 88 | 88 | ||
| 89 | extern int set_task_ioprio(struct task_struct *task, int ioprio); | ||
| 90 | |||
| 89 | #endif | 91 | #endif |
diff --git a/include/linux/irqnr.h b/include/linux/irqnr.h index 5504a5c97836..86af92e9e84c 100644 --- a/include/linux/irqnr.h +++ b/include/linux/irqnr.h | |||
| @@ -8,7 +8,12 @@ | |||
| 8 | 8 | ||
| 9 | #ifndef CONFIG_GENERIC_HARDIRQS | 9 | #ifndef CONFIG_GENERIC_HARDIRQS |
| 10 | #include <asm/irq.h> | 10 | #include <asm/irq.h> |
| 11 | # define nr_irqs NR_IRQS | 11 | |
| 12 | /* | ||
| 13 | * Wrappers for non-genirq architectures: | ||
| 14 | */ | ||
| 15 | #define nr_irqs NR_IRQS | ||
| 16 | #define irq_to_desc(irq) (&irq_desc[irq]) | ||
| 12 | 17 | ||
| 13 | # define for_each_irq_desc(irq, desc) \ | 18 | # define for_each_irq_desc(irq, desc) \ |
| 14 | for (irq = 0; irq < nr_irqs; irq++) | 19 | for (irq = 0; irq < nr_irqs; irq++) |
diff --git a/include/linux/jbd.h b/include/linux/jbd.h index 346e2b80be7d..6384b19efe64 100644 --- a/include/linux/jbd.h +++ b/include/linux/jbd.h | |||
| @@ -543,6 +543,11 @@ struct transaction_s | |||
| 543 | unsigned long t_expires; | 543 | unsigned long t_expires; |
| 544 | 544 | ||
| 545 | /* | 545 | /* |
| 546 | * When this transaction started, in nanoseconds [no locking] | ||
| 547 | */ | ||
| 548 | ktime_t t_start_time; | ||
| 549 | |||
| 550 | /* | ||
| 546 | * How many handles used this transaction? [t_handle_lock] | 551 | * How many handles used this transaction? [t_handle_lock] |
| 547 | */ | 552 | */ |
| 548 | int t_handle_count; | 553 | int t_handle_count; |
| @@ -798,9 +803,19 @@ struct journal_s | |||
| 798 | struct buffer_head **j_wbuf; | 803 | struct buffer_head **j_wbuf; |
| 799 | int j_wbufsize; | 804 | int j_wbufsize; |
| 800 | 805 | ||
| 806 | /* | ||
| 807 | * this is the pid of the last person to run a synchronous operation | ||
| 808 | * through the journal. | ||
| 809 | */ | ||
| 801 | pid_t j_last_sync_writer; | 810 | pid_t j_last_sync_writer; |
| 802 | 811 | ||
| 803 | /* | 812 | /* |
| 813 | * the average amount of time in nanoseconds it takes to commit a | ||
| 814 | * transaction to the disk. [j_state_lock] | ||
| 815 | */ | ||
| 816 | u64 j_average_commit_time; | ||
| 817 | |||
| 818 | /* | ||
| 804 | * An opaque pointer to fs-private information. ext3 puts its | 819 | * An opaque pointer to fs-private information. ext3 puts its |
| 805 | * superblock pointer here | 820 | * superblock pointer here |
| 806 | */ | 821 | */ |
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index 34456476e761..b45109c61fba 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h | |||
| @@ -638,6 +638,11 @@ struct transaction_s | |||
| 638 | unsigned long t_expires; | 638 | unsigned long t_expires; |
| 639 | 639 | ||
| 640 | /* | 640 | /* |
| 641 | * When this transaction started, in nanoseconds [no locking] | ||
| 642 | */ | ||
| 643 | ktime_t t_start_time; | ||
| 644 | |||
| 645 | /* | ||
| 641 | * How many handles used this transaction? [t_handle_lock] | 646 | * How many handles used this transaction? [t_handle_lock] |
| 642 | */ | 647 | */ |
| 643 | int t_handle_count; | 648 | int t_handle_count; |
| @@ -682,6 +687,8 @@ jbd2_time_diff(unsigned long start, unsigned long end) | |||
| 682 | return end + (MAX_JIFFY_OFFSET - start); | 687 | return end + (MAX_JIFFY_OFFSET - start); |
| 683 | } | 688 | } |
| 684 | 689 | ||
| 690 | #define JBD2_NR_BATCH 64 | ||
| 691 | |||
| 685 | /** | 692 | /** |
| 686 | * struct journal_s - The journal_s type is the concrete type associated with | 693 | * struct journal_s - The journal_s type is the concrete type associated with |
| 687 | * journal_t. | 694 | * journal_t. |
| @@ -826,6 +833,14 @@ struct journal_s | |||
| 826 | struct mutex j_checkpoint_mutex; | 833 | struct mutex j_checkpoint_mutex; |
| 827 | 834 | ||
| 828 | /* | 835 | /* |
| 836 | * List of buffer heads used by the checkpoint routine. This | ||
| 837 | * was moved from jbd2_log_do_checkpoint() to reduce stack | ||
| 838 | * usage. Access to this array is controlled by the | ||
| 839 | * j_checkpoint_mutex. [j_checkpoint_mutex] | ||
| 840 | */ | ||
| 841 | struct buffer_head *j_chkpt_bhs[JBD2_NR_BATCH]; | ||
| 842 | |||
| 843 | /* | ||
| 829 | * Journal head: identifies the first unused block in the journal. | 844 | * Journal head: identifies the first unused block in the journal. |
| 830 | * [j_state_lock] | 845 | * [j_state_lock] |
| 831 | */ | 846 | */ |
| @@ -939,8 +954,26 @@ struct journal_s | |||
| 939 | struct buffer_head **j_wbuf; | 954 | struct buffer_head **j_wbuf; |
| 940 | int j_wbufsize; | 955 | int j_wbufsize; |
| 941 | 956 | ||
| 957 | /* | ||
| 958 | * this is the pid of hte last person to run a synchronous operation | ||
| 959 | * through the journal | ||
| 960 | */ | ||
| 942 | pid_t j_last_sync_writer; | 961 | pid_t j_last_sync_writer; |
| 943 | 962 | ||
| 963 | /* | ||
| 964 | * the average amount of time in nanoseconds it takes to commit a | ||
| 965 | * transaction to disk. [j_state_lock] | ||
| 966 | */ | ||
| 967 | u64 j_average_commit_time; | ||
| 968 | |||
| 969 | /* | ||
| 970 | * minimum and maximum times that we should wait for | ||
| 971 | * additional filesystem operations to get batched into a | ||
| 972 | * synchronous handle in microseconds | ||
| 973 | */ | ||
| 974 | u32 j_min_batch_time; | ||
| 975 | u32 j_max_batch_time; | ||
| 976 | |||
| 944 | /* This function is called when a transaction is closed */ | 977 | /* This function is called when a transaction is closed */ |
| 945 | void (*j_commit_callback)(journal_t *, | 978 | void (*j_commit_callback)(journal_t *, |
| 946 | transaction_t *); | 979 | transaction_t *); |
| @@ -1102,7 +1135,6 @@ extern int jbd2_journal_set_features | |||
| 1102 | (journal_t *, unsigned long, unsigned long, unsigned long); | 1135 | (journal_t *, unsigned long, unsigned long, unsigned long); |
| 1103 | extern void jbd2_journal_clear_features | 1136 | extern void jbd2_journal_clear_features |
| 1104 | (journal_t *, unsigned long, unsigned long, unsigned long); | 1137 | (journal_t *, unsigned long, unsigned long, unsigned long); |
| 1105 | extern int jbd2_journal_create (journal_t *); | ||
| 1106 | extern int jbd2_journal_load (journal_t *journal); | 1138 | extern int jbd2_journal_load (journal_t *journal); |
| 1107 | extern int jbd2_journal_destroy (journal_t *); | 1139 | extern int jbd2_journal_destroy (journal_t *); |
| 1108 | extern int jbd2_journal_recover (journal_t *journal); | 1140 | extern int jbd2_journal_recover (journal_t *journal); |
| @@ -1177,8 +1209,8 @@ int jbd2_log_wait_commit(journal_t *journal, tid_t tid); | |||
| 1177 | int jbd2_log_do_checkpoint(journal_t *journal); | 1209 | int jbd2_log_do_checkpoint(journal_t *journal); |
| 1178 | 1210 | ||
| 1179 | void __jbd2_log_wait_for_space(journal_t *journal); | 1211 | void __jbd2_log_wait_for_space(journal_t *journal); |
| 1180 | extern void __jbd2_journal_drop_transaction(journal_t *, transaction_t *); | 1212 | extern void __jbd2_journal_drop_transaction(journal_t *, transaction_t *); |
| 1181 | extern int jbd2_cleanup_journal_tail(journal_t *); | 1213 | extern int jbd2_cleanup_journal_tail(journal_t *); |
| 1182 | 1214 | ||
| 1183 | /* Debugging code only: */ | 1215 | /* Debugging code only: */ |
| 1184 | 1216 | ||
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index ca9ff6411dfa..343df9ef2412 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
| @@ -48,6 +48,12 @@ extern const char linux_proc_banner[]; | |||
| 48 | #define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f)) | 48 | #define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f)) |
| 49 | #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) | 49 | #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) |
| 50 | #define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) | 50 | #define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) |
| 51 | #define DIV_ROUND_CLOSEST(x, divisor)( \ | ||
| 52 | { \ | ||
| 53 | typeof(divisor) __divisor = divisor; \ | ||
| 54 | (((x) + ((__divisor) / 2)) / (__divisor)); \ | ||
| 55 | } \ | ||
| 56 | ) | ||
| 51 | 57 | ||
| 52 | #define _RET_IP_ (unsigned long)__builtin_return_address(0) | 58 | #define _RET_IP_ (unsigned long)__builtin_return_address(0) |
| 53 | #define _THIS_IP_ ({ __label__ __here; __here: (unsigned long)&&__here; }) | 59 | #define _THIS_IP_ ({ __label__ __here; __here: (unsigned long)&&__here; }) |
| @@ -349,13 +355,13 @@ static inline char *pack_hex_byte(char *buf, u8 byte) | |||
| 349 | printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) | 355 | printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) |
| 350 | 356 | ||
| 351 | /* If you are writing a driver, please use dev_dbg instead */ | 357 | /* If you are writing a driver, please use dev_dbg instead */ |
| 352 | #if defined(CONFIG_DYNAMIC_PRINTK_DEBUG) | 358 | #if defined(DEBUG) |
| 359 | #define pr_debug(fmt, ...) \ | ||
| 360 | printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | ||
| 361 | #elif defined(CONFIG_DYNAMIC_PRINTK_DEBUG) | ||
| 353 | #define pr_debug(fmt, ...) do { \ | 362 | #define pr_debug(fmt, ...) do { \ |
| 354 | dynamic_pr_debug(pr_fmt(fmt), ##__VA_ARGS__); \ | 363 | dynamic_pr_debug(pr_fmt(fmt), ##__VA_ARGS__); \ |
| 355 | } while (0) | 364 | } while (0) |
| 356 | #elif defined(DEBUG) | ||
| 357 | #define pr_debug(fmt, ...) \ | ||
| 358 | printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | ||
| 359 | #else | 365 | #else |
| 360 | #define pr_debug(fmt, ...) \ | 366 | #define pr_debug(fmt, ...) \ |
| 361 | ({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; }) | 367 | ({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; }) |
| @@ -470,6 +476,12 @@ static inline char *pack_hex_byte(char *buf, u8 byte) | |||
| 470 | __val = __val < __min ? __min: __val; \ | 476 | __val = __val < __min ? __min: __val; \ |
| 471 | __val > __max ? __max: __val; }) | 477 | __val > __max ? __max: __val; }) |
| 472 | 478 | ||
| 479 | |||
| 480 | /* | ||
| 481 | * swap - swap value of @a and @b | ||
| 482 | */ | ||
| 483 | #define swap(a, b) ({ typeof(a) __tmp = (a); (a) = (b); (b) = __tmp; }) | ||
| 484 | |||
| 473 | /** | 485 | /** |
| 474 | * container_of - cast a member of a structure out to the containing structure | 486 | * container_of - cast a member of a structure out to the containing structure |
| 475 | * @ptr: the pointer to the member. | 487 | * @ptr: the pointer to the member. |
diff --git a/include/linux/klist.h b/include/linux/klist.h index 8ea98db223e5..d5a27af9dba5 100644 --- a/include/linux/klist.h +++ b/include/linux/klist.h | |||
| @@ -13,7 +13,6 @@ | |||
| 13 | #define _LINUX_KLIST_H | 13 | #define _LINUX_KLIST_H |
| 14 | 14 | ||
| 15 | #include <linux/spinlock.h> | 15 | #include <linux/spinlock.h> |
| 16 | #include <linux/completion.h> | ||
| 17 | #include <linux/kref.h> | 16 | #include <linux/kref.h> |
| 18 | #include <linux/list.h> | 17 | #include <linux/list.h> |
| 19 | 18 | ||
| @@ -41,7 +40,6 @@ struct klist_node { | |||
| 41 | void *n_klist; /* never access directly */ | 40 | void *n_klist; /* never access directly */ |
| 42 | struct list_head n_node; | 41 | struct list_head n_node; |
| 43 | struct kref n_ref; | 42 | struct kref n_ref; |
| 44 | struct completion n_removed; | ||
| 45 | }; | 43 | }; |
| 46 | 44 | ||
| 47 | extern void klist_add_tail(struct klist_node *n, struct klist *k); | 45 | extern void klist_add_tail(struct klist_node *n, struct klist *k); |
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h index 497b1d1f7a05..d6ea19e314bb 100644 --- a/include/linux/kprobes.h +++ b/include/linux/kprobes.h | |||
| @@ -69,9 +69,6 @@ struct kprobe { | |||
| 69 | /* list of kprobes for multi-handler support */ | 69 | /* list of kprobes for multi-handler support */ |
| 70 | struct list_head list; | 70 | struct list_head list; |
| 71 | 71 | ||
| 72 | /* Indicates that the corresponding module has been ref counted */ | ||
| 73 | unsigned int mod_refcounted; | ||
| 74 | |||
| 75 | /*count the number of times this probe was temporarily disarmed */ | 72 | /*count the number of times this probe was temporarily disarmed */ |
| 76 | unsigned long nmissed; | 73 | unsigned long nmissed; |
| 77 | 74 | ||
| @@ -103,8 +100,19 @@ struct kprobe { | |||
| 103 | 100 | ||
| 104 | /* copy of the original instruction */ | 101 | /* copy of the original instruction */ |
| 105 | struct arch_specific_insn ainsn; | 102 | struct arch_specific_insn ainsn; |
| 103 | |||
| 104 | /* Indicates various status flags. Protected by kprobe_mutex. */ | ||
| 105 | u32 flags; | ||
| 106 | }; | 106 | }; |
| 107 | 107 | ||
| 108 | /* Kprobe status flags */ | ||
| 109 | #define KPROBE_FLAG_GONE 1 /* breakpoint has already gone */ | ||
| 110 | |||
| 111 | static inline int kprobe_gone(struct kprobe *p) | ||
| 112 | { | ||
| 113 | return p->flags & KPROBE_FLAG_GONE; | ||
| 114 | } | ||
| 115 | |||
| 108 | /* | 116 | /* |
| 109 | * Special probe type that uses setjmp-longjmp type tricks to resume | 117 | * Special probe type that uses setjmp-longjmp type tricks to resume |
| 110 | * execution at a specified entry with a matching prototype corresponding | 118 | * execution at a specified entry with a matching prototype corresponding |
| @@ -201,7 +209,6 @@ static inline int init_test_probes(void) | |||
| 201 | } | 209 | } |
| 202 | #endif /* CONFIG_KPROBES_SANITY_TEST */ | 210 | #endif /* CONFIG_KPROBES_SANITY_TEST */ |
| 203 | 211 | ||
| 204 | extern struct mutex kprobe_mutex; | ||
| 205 | extern int arch_prepare_kprobe(struct kprobe *p); | 212 | extern int arch_prepare_kprobe(struct kprobe *p); |
| 206 | extern void arch_arm_kprobe(struct kprobe *p); | 213 | extern void arch_arm_kprobe(struct kprobe *p); |
| 207 | extern void arch_disarm_kprobe(struct kprobe *p); | 214 | extern void arch_disarm_kprobe(struct kprobe *p); |
diff --git a/include/linux/leds-pca9532.h b/include/linux/leds-pca9532.h index 81b4207deb95..96eea90f01a8 100644 --- a/include/linux/leds-pca9532.h +++ b/include/linux/leds-pca9532.h | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | #define __LINUX_PCA9532_H | 15 | #define __LINUX_PCA9532_H |
| 16 | 16 | ||
| 17 | #include <linux/leds.h> | 17 | #include <linux/leds.h> |
| 18 | #include <linux/workqueue.h> | ||
| 18 | 19 | ||
| 19 | enum pca9532_state { | 20 | enum pca9532_state { |
| 20 | PCA9532_OFF = 0x0, | 21 | PCA9532_OFF = 0x0, |
| @@ -31,6 +32,7 @@ struct pca9532_led { | |||
| 31 | struct i2c_client *client; | 32 | struct i2c_client *client; |
| 32 | char *name; | 33 | char *name; |
| 33 | struct led_classdev ldev; | 34 | struct led_classdev ldev; |
| 35 | struct work_struct work; | ||
| 34 | enum pca9532_type type; | 36 | enum pca9532_type type; |
| 35 | enum pca9532_state state; | 37 | enum pca9532_state state; |
| 36 | }; | 38 | }; |
diff --git a/include/linux/leds.h b/include/linux/leds.h index d3a73f5a48c3..24489da701e3 100644 --- a/include/linux/leds.h +++ b/include/linux/leds.h | |||
| @@ -32,7 +32,10 @@ struct led_classdev { | |||
| 32 | int brightness; | 32 | int brightness; |
| 33 | int flags; | 33 | int flags; |
| 34 | 34 | ||
| 35 | /* Lower 16 bits reflect status */ | ||
| 35 | #define LED_SUSPENDED (1 << 0) | 36 | #define LED_SUSPENDED (1 << 0) |
| 37 | /* Upper 16 bits reflect control information */ | ||
| 38 | #define LED_CORE_SUSPENDRESUME (1 << 16) | ||
| 36 | 39 | ||
| 37 | /* Set LED brightness level */ | 40 | /* Set LED brightness level */ |
| 38 | /* Must not sleep, use a workqueue if needed */ | 41 | /* Must not sleep, use a workqueue if needed */ |
| @@ -62,7 +65,7 @@ struct led_classdev { | |||
| 62 | 65 | ||
| 63 | extern int led_classdev_register(struct device *parent, | 66 | extern int led_classdev_register(struct device *parent, |
| 64 | struct led_classdev *led_cdev); | 67 | struct led_classdev *led_cdev); |
| 65 | extern void led_classdev_unregister(struct led_classdev *lcd); | 68 | extern void led_classdev_unregister(struct led_classdev *led_cdev); |
| 66 | extern void led_classdev_suspend(struct led_classdev *led_cdev); | 69 | extern void led_classdev_suspend(struct led_classdev *led_cdev); |
| 67 | extern void led_classdev_resume(struct led_classdev *led_cdev); | 70 | extern void led_classdev_resume(struct led_classdev *led_cdev); |
| 68 | 71 | ||
diff --git a/include/linux/libata.h b/include/linux/libata.h index 3449de597eff..b6b8a7f3ec66 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
| @@ -239,6 +239,7 @@ enum { | |||
| 239 | /* host set flags */ | 239 | /* host set flags */ |
| 240 | ATA_HOST_SIMPLEX = (1 << 0), /* Host is simplex, one DMA channel per host only */ | 240 | ATA_HOST_SIMPLEX = (1 << 0), /* Host is simplex, one DMA channel per host only */ |
| 241 | ATA_HOST_STARTED = (1 << 1), /* Host started */ | 241 | ATA_HOST_STARTED = (1 << 1), /* Host started */ |
| 242 | ATA_HOST_PARALLEL_SCAN = (1 << 2), /* Ports on this host can be scanned in parallel */ | ||
| 242 | 243 | ||
| 243 | /* bits 24:31 of host->flags are reserved for LLD specific flags */ | 244 | /* bits 24:31 of host->flags are reserved for LLD specific flags */ |
| 244 | 245 | ||
| @@ -1518,6 +1519,7 @@ extern void sata_pmp_error_handler(struct ata_port *ap); | |||
| 1518 | 1519 | ||
| 1519 | extern const struct ata_port_operations ata_sff_port_ops; | 1520 | extern const struct ata_port_operations ata_sff_port_ops; |
| 1520 | extern const struct ata_port_operations ata_bmdma_port_ops; | 1521 | extern const struct ata_port_operations ata_bmdma_port_ops; |
| 1522 | extern const struct ata_port_operations ata_bmdma32_port_ops; | ||
| 1521 | 1523 | ||
| 1522 | /* PIO only, sg_tablesize and dma_boundary limits can be removed */ | 1524 | /* PIO only, sg_tablesize and dma_boundary limits can be removed */ |
| 1523 | #define ATA_PIO_SHT(drv_name) \ | 1525 | #define ATA_PIO_SHT(drv_name) \ |
| @@ -1545,6 +1547,8 @@ extern void ata_sff_exec_command(struct ata_port *ap, | |||
| 1545 | const struct ata_taskfile *tf); | 1547 | const struct ata_taskfile *tf); |
| 1546 | extern unsigned int ata_sff_data_xfer(struct ata_device *dev, | 1548 | extern unsigned int ata_sff_data_xfer(struct ata_device *dev, |
| 1547 | unsigned char *buf, unsigned int buflen, int rw); | 1549 | unsigned char *buf, unsigned int buflen, int rw); |
| 1550 | extern unsigned int ata_sff_data_xfer32(struct ata_device *dev, | ||
| 1551 | unsigned char *buf, unsigned int buflen, int rw); | ||
| 1548 | extern unsigned int ata_sff_data_xfer_noirq(struct ata_device *dev, | 1552 | extern unsigned int ata_sff_data_xfer_noirq(struct ata_device *dev, |
| 1549 | unsigned char *buf, unsigned int buflen, int rw); | 1553 | unsigned char *buf, unsigned int buflen, int rw); |
| 1550 | extern u8 ata_sff_irq_on(struct ata_port *ap); | 1554 | extern u8 ata_sff_irq_on(struct ata_port *ap); |
diff --git a/include/linux/libps2.h b/include/linux/libps2.h index afc413369101..b94534b7e266 100644 --- a/include/linux/libps2.h +++ b/include/linux/libps2.h | |||
| @@ -18,11 +18,13 @@ | |||
| 18 | #define PS2_RET_ID 0x00 | 18 | #define PS2_RET_ID 0x00 |
| 19 | #define PS2_RET_ACK 0xfa | 19 | #define PS2_RET_ACK 0xfa |
| 20 | #define PS2_RET_NAK 0xfe | 20 | #define PS2_RET_NAK 0xfe |
| 21 | #define PS2_RET_ERR 0xfc | ||
| 21 | 22 | ||
| 22 | #define PS2_FLAG_ACK 1 /* Waiting for ACK/NAK */ | 23 | #define PS2_FLAG_ACK 1 /* Waiting for ACK/NAK */ |
| 23 | #define PS2_FLAG_CMD 2 /* Waiting for command to finish */ | 24 | #define PS2_FLAG_CMD 2 /* Waiting for command to finish */ |
| 24 | #define PS2_FLAG_CMD1 4 /* Waiting for the first byte of command response */ | 25 | #define PS2_FLAG_CMD1 4 /* Waiting for the first byte of command response */ |
| 25 | #define PS2_FLAG_WAITID 8 /* Command execiting is GET ID */ | 26 | #define PS2_FLAG_WAITID 8 /* Command execiting is GET ID */ |
| 27 | #define PS2_FLAG_NAK 16 /* Last transmission was NAKed */ | ||
| 26 | 28 | ||
| 27 | struct ps2dev { | 29 | struct ps2dev { |
| 28 | struct serio *serio; | 30 | struct serio *serio; |
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h index 23da3fa69efa..aa6fe7026de7 100644 --- a/include/linux/lockd/lockd.h +++ b/include/linux/lockd/lockd.h | |||
| @@ -43,8 +43,8 @@ struct nlm_host { | |||
| 43 | struct sockaddr_storage h_addr; /* peer address */ | 43 | struct sockaddr_storage h_addr; /* peer address */ |
| 44 | size_t h_addrlen; | 44 | size_t h_addrlen; |
| 45 | struct sockaddr_storage h_srcaddr; /* our address (optional) */ | 45 | struct sockaddr_storage h_srcaddr; /* our address (optional) */ |
| 46 | struct rpc_clnt * h_rpcclnt; /* RPC client to talk to peer */ | 46 | struct rpc_clnt *h_rpcclnt; /* RPC client to talk to peer */ |
| 47 | char * h_name; /* remote hostname */ | 47 | char *h_name; /* remote hostname */ |
| 48 | u32 h_version; /* interface version */ | 48 | u32 h_version; /* interface version */ |
| 49 | unsigned short h_proto; /* transport proto */ | 49 | unsigned short h_proto; /* transport proto */ |
| 50 | unsigned short h_reclaiming : 1, | 50 | unsigned short h_reclaiming : 1, |
| @@ -64,21 +64,29 @@ struct nlm_host { | |||
| 64 | spinlock_t h_lock; | 64 | spinlock_t h_lock; |
| 65 | struct list_head h_granted; /* Locks in GRANTED state */ | 65 | struct list_head h_granted; /* Locks in GRANTED state */ |
| 66 | struct list_head h_reclaim; /* Locks in RECLAIM state */ | 66 | struct list_head h_reclaim; /* Locks in RECLAIM state */ |
| 67 | struct nsm_handle * h_nsmhandle; /* NSM status handle */ | 67 | struct nsm_handle *h_nsmhandle; /* NSM status handle */ |
| 68 | 68 | char *h_addrbuf; /* address eyecatcher */ | |
| 69 | char h_addrbuf[48], /* address eyecatchers */ | ||
| 70 | h_srcaddrbuf[48]; | ||
| 71 | }; | 69 | }; |
| 72 | 70 | ||
| 71 | /* | ||
| 72 | * The largest string sm_addrbuf should hold is a full-size IPv6 address | ||
| 73 | * (no "::" anywhere) with a scope ID. The buffer size is computed to | ||
| 74 | * hold eight groups of colon-separated four-hex-digit numbers, a | ||
| 75 | * percent sign, a scope id (at most 32 bits, in decimal), and NUL. | ||
| 76 | */ | ||
| 77 | #define NSM_ADDRBUF ((8 * 4 + 7) + (1 + 10) + 1) | ||
| 78 | |||
| 73 | struct nsm_handle { | 79 | struct nsm_handle { |
| 74 | struct list_head sm_link; | 80 | struct list_head sm_link; |
| 75 | atomic_t sm_count; | 81 | atomic_t sm_count; |
| 76 | char * sm_name; | 82 | char *sm_mon_name; |
| 83 | char *sm_name; | ||
| 77 | struct sockaddr_storage sm_addr; | 84 | struct sockaddr_storage sm_addr; |
| 78 | size_t sm_addrlen; | 85 | size_t sm_addrlen; |
| 79 | unsigned int sm_monitored : 1, | 86 | unsigned int sm_monitored : 1, |
| 80 | sm_sticky : 1; /* don't unmonitor */ | 87 | sm_sticky : 1; /* don't unmonitor */ |
| 81 | char sm_addrbuf[48]; /* address eyecatcher */ | 88 | struct nsm_private sm_priv; |
| 89 | char sm_addrbuf[NSM_ADDRBUF]; | ||
| 82 | }; | 90 | }; |
| 83 | 91 | ||
| 84 | /* | 92 | /* |
| @@ -104,16 +112,6 @@ static inline struct sockaddr *nlm_srcaddr(const struct nlm_host *host) | |||
| 104 | return (struct sockaddr *)&host->h_srcaddr; | 112 | return (struct sockaddr *)&host->h_srcaddr; |
| 105 | } | 113 | } |
| 106 | 114 | ||
| 107 | static inline struct sockaddr_in *nsm_addr_in(const struct nsm_handle *handle) | ||
| 108 | { | ||
| 109 | return (struct sockaddr_in *)&handle->sm_addr; | ||
| 110 | } | ||
| 111 | |||
| 112 | static inline struct sockaddr *nsm_addr(const struct nsm_handle *handle) | ||
| 113 | { | ||
| 114 | return (struct sockaddr *)&handle->sm_addr; | ||
| 115 | } | ||
| 116 | |||
| 117 | /* | 115 | /* |
| 118 | * Map an fl_owner_t into a unique 32-bit "pid" | 116 | * Map an fl_owner_t into a unique 32-bit "pid" |
| 119 | */ | 117 | */ |
| @@ -197,6 +195,7 @@ extern struct svc_procedure nlmsvc_procedures4[]; | |||
| 197 | extern int nlmsvc_grace_period; | 195 | extern int nlmsvc_grace_period; |
| 198 | extern unsigned long nlmsvc_timeout; | 196 | extern unsigned long nlmsvc_timeout; |
| 199 | extern int nsm_use_hostnames; | 197 | extern int nsm_use_hostnames; |
| 198 | extern int nsm_local_state; | ||
| 200 | 199 | ||
| 201 | /* | 200 | /* |
| 202 | * Lockd client functions | 201 | * Lockd client functions |
| @@ -231,10 +230,20 @@ void nlm_rebind_host(struct nlm_host *); | |||
| 231 | struct nlm_host * nlm_get_host(struct nlm_host *); | 230 | struct nlm_host * nlm_get_host(struct nlm_host *); |
| 232 | void nlm_release_host(struct nlm_host *); | 231 | void nlm_release_host(struct nlm_host *); |
| 233 | void nlm_shutdown_hosts(void); | 232 | void nlm_shutdown_hosts(void); |
| 234 | extern void nlm_host_rebooted(const struct sockaddr_in *, const char *, | 233 | void nlm_host_rebooted(const struct nlm_reboot *); |
| 235 | unsigned int, u32); | ||
| 236 | void nsm_release(struct nsm_handle *); | ||
| 237 | 234 | ||
| 235 | /* | ||
| 236 | * Host monitoring | ||
| 237 | */ | ||
| 238 | int nsm_monitor(const struct nlm_host *host); | ||
| 239 | void nsm_unmonitor(const struct nlm_host *host); | ||
| 240 | |||
| 241 | struct nsm_handle *nsm_get_handle(const struct sockaddr *sap, | ||
| 242 | const size_t salen, | ||
| 243 | const char *hostname, | ||
| 244 | const size_t hostname_len); | ||
| 245 | struct nsm_handle *nsm_reboot_lookup(const struct nlm_reboot *info); | ||
| 246 | void nsm_release(struct nsm_handle *nsm); | ||
| 238 | 247 | ||
| 239 | /* | 248 | /* |
| 240 | * This is used in garbage collection and resource reclaim | 249 | * This is used in garbage collection and resource reclaim |
| @@ -282,16 +291,25 @@ static inline struct inode *nlmsvc_file_inode(struct nlm_file *file) | |||
| 282 | static inline int __nlm_privileged_request4(const struct sockaddr *sap) | 291 | static inline int __nlm_privileged_request4(const struct sockaddr *sap) |
| 283 | { | 292 | { |
| 284 | const struct sockaddr_in *sin = (struct sockaddr_in *)sap; | 293 | const struct sockaddr_in *sin = (struct sockaddr_in *)sap; |
| 285 | return (sin->sin_addr.s_addr == htonl(INADDR_LOOPBACK)) && | 294 | |
| 286 | (ntohs(sin->sin_port) < 1024); | 295 | if (ntohs(sin->sin_port) > 1023) |
| 296 | return 0; | ||
| 297 | |||
| 298 | return ipv4_is_loopback(sin->sin_addr.s_addr); | ||
| 287 | } | 299 | } |
| 288 | 300 | ||
| 289 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 301 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) |
| 290 | static inline int __nlm_privileged_request6(const struct sockaddr *sap) | 302 | static inline int __nlm_privileged_request6(const struct sockaddr *sap) |
| 291 | { | 303 | { |
| 292 | const struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sap; | 304 | const struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sap; |
| 293 | return (ipv6_addr_type(&sin6->sin6_addr) & IPV6_ADDR_LOOPBACK) && | 305 | |
| 294 | (ntohs(sin6->sin6_port) < 1024); | 306 | if (ntohs(sin6->sin6_port) > 1023) |
| 307 | return 0; | ||
| 308 | |||
| 309 | if (ipv6_addr_type(&sin6->sin6_addr) & IPV6_ADDR_MAPPED) | ||
| 310 | return ipv4_is_loopback(sin6->sin6_addr.s6_addr32[3]); | ||
| 311 | |||
| 312 | return ipv6_addr_type(&sin6->sin6_addr) & IPV6_ADDR_LOOPBACK; | ||
| 295 | } | 313 | } |
| 296 | #else /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */ | 314 | #else /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */ |
| 297 | static inline int __nlm_privileged_request6(const struct sockaddr *sap) | 315 | static inline int __nlm_privileged_request6(const struct sockaddr *sap) |
diff --git a/include/linux/lockd/sm_inter.h b/include/linux/lockd/sm_inter.h deleted file mode 100644 index 5a5448bdb17d..000000000000 --- a/include/linux/lockd/sm_inter.h +++ /dev/null | |||
| @@ -1,48 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * linux/include/linux/lockd/sm_inter.h | ||
| 3 | * | ||
| 4 | * Declarations for the kernel statd client. | ||
| 5 | * | ||
| 6 | * Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de> | ||
| 7 | */ | ||
| 8 | |||
| 9 | #ifndef LINUX_LOCKD_SM_INTER_H | ||
| 10 | #define LINUX_LOCKD_SM_INTER_H | ||
| 11 | |||
| 12 | #define SM_PROGRAM 100024 | ||
| 13 | #define SM_VERSION 1 | ||
| 14 | #define SM_STAT 1 | ||
| 15 | #define SM_MON 2 | ||
| 16 | #define SM_UNMON 3 | ||
| 17 | #define SM_UNMON_ALL 4 | ||
| 18 | #define SM_SIMU_CRASH 5 | ||
| 19 | #define SM_NOTIFY 6 | ||
| 20 | |||
| 21 | #define SM_MAXSTRLEN 1024 | ||
| 22 | #define SM_PRIV_SIZE 16 | ||
| 23 | |||
| 24 | /* | ||
| 25 | * Arguments for all calls to statd | ||
| 26 | */ | ||
| 27 | struct nsm_args { | ||
| 28 | __be32 addr; /* remote address */ | ||
| 29 | u32 prog; /* RPC callback info */ | ||
| 30 | u32 vers; | ||
| 31 | u32 proc; | ||
| 32 | |||
| 33 | char * mon_name; | ||
| 34 | }; | ||
| 35 | |||
| 36 | /* | ||
| 37 | * Result returned by statd | ||
| 38 | */ | ||
| 39 | struct nsm_res { | ||
| 40 | u32 status; | ||
| 41 | u32 state; | ||
| 42 | }; | ||
| 43 | |||
| 44 | int nsm_monitor(struct nlm_host *); | ||
| 45 | int nsm_unmonitor(struct nlm_host *); | ||
| 46 | extern int nsm_local_state; | ||
| 47 | |||
| 48 | #endif /* LINUX_LOCKD_SM_INTER_H */ | ||
diff --git a/include/linux/lockd/xdr.h b/include/linux/lockd/xdr.h index d6b3a802c046..7dc5b6cb44cd 100644 --- a/include/linux/lockd/xdr.h +++ b/include/linux/lockd/xdr.h | |||
| @@ -13,6 +13,13 @@ | |||
| 13 | #include <linux/nfs.h> | 13 | #include <linux/nfs.h> |
| 14 | #include <linux/sunrpc/xdr.h> | 14 | #include <linux/sunrpc/xdr.h> |
| 15 | 15 | ||
| 16 | #define SM_MAXSTRLEN 1024 | ||
| 17 | #define SM_PRIV_SIZE 16 | ||
| 18 | |||
| 19 | struct nsm_private { | ||
| 20 | unsigned char data[SM_PRIV_SIZE]; | ||
| 21 | }; | ||
| 22 | |||
| 16 | struct svc_rqst; | 23 | struct svc_rqst; |
| 17 | 24 | ||
| 18 | #define NLM_MAXCOOKIELEN 32 | 25 | #define NLM_MAXCOOKIELEN 32 |
| @@ -77,10 +84,10 @@ struct nlm_res { | |||
| 77 | * statd callback when client has rebooted | 84 | * statd callback when client has rebooted |
| 78 | */ | 85 | */ |
| 79 | struct nlm_reboot { | 86 | struct nlm_reboot { |
| 80 | char * mon; | 87 | char *mon; |
| 81 | unsigned int len; | 88 | unsigned int len; |
| 82 | u32 state; | 89 | u32 state; |
| 83 | __be32 addr; | 90 | struct nsm_private priv; |
| 84 | }; | 91 | }; |
| 85 | 92 | ||
| 86 | /* | 93 | /* |
diff --git a/include/linux/mISDNhw.h b/include/linux/mISDNhw.h index e794dfb87504..97ffdc1d3442 100644 --- a/include/linux/mISDNhw.h +++ b/include/linux/mISDNhw.h | |||
| @@ -57,20 +57,21 @@ | |||
| 57 | #define FLG_L2DATA 14 /* channel use L2 DATA primitivs */ | 57 | #define FLG_L2DATA 14 /* channel use L2 DATA primitivs */ |
| 58 | #define FLG_ORIGIN 15 /* channel is on origin site */ | 58 | #define FLG_ORIGIN 15 /* channel is on origin site */ |
| 59 | /* channel specific stuff */ | 59 | /* channel specific stuff */ |
| 60 | #define FLG_FILLEMPTY 16 /* fill fifo on first frame (empty) */ | ||
| 60 | /* arcofi specific */ | 61 | /* arcofi specific */ |
| 61 | #define FLG_ARCOFI_TIMER 16 | 62 | #define FLG_ARCOFI_TIMER 17 |
| 62 | #define FLG_ARCOFI_ERROR 17 | 63 | #define FLG_ARCOFI_ERROR 18 |
| 63 | /* isar specific */ | 64 | /* isar specific */ |
| 64 | #define FLG_INITIALIZED 16 | 65 | #define FLG_INITIALIZED 17 |
| 65 | #define FLG_DLEETX 17 | 66 | #define FLG_DLEETX 18 |
| 66 | #define FLG_LASTDLE 18 | 67 | #define FLG_LASTDLE 19 |
| 67 | #define FLG_FIRST 19 | 68 | #define FLG_FIRST 20 |
| 68 | #define FLG_LASTDATA 20 | 69 | #define FLG_LASTDATA 21 |
| 69 | #define FLG_NMD_DATA 21 | 70 | #define FLG_NMD_DATA 22 |
| 70 | #define FLG_FTI_RUN 22 | 71 | #define FLG_FTI_RUN 23 |
| 71 | #define FLG_LL_OK 23 | 72 | #define FLG_LL_OK 24 |
| 72 | #define FLG_LL_CONN 24 | 73 | #define FLG_LL_CONN 25 |
| 73 | #define FLG_DTMFSEND 25 | 74 | #define FLG_DTMFSEND 26 |
| 74 | 75 | ||
| 75 | /* workq events */ | 76 | /* workq events */ |
| 76 | #define FLG_RECVQUEUE 30 | 77 | #define FLG_RECVQUEUE 30 |
| @@ -183,6 +184,7 @@ extern void queue_ch_frame(struct mISDNchannel *, u_int, | |||
| 183 | extern int dchannel_senddata(struct dchannel *, struct sk_buff *); | 184 | extern int dchannel_senddata(struct dchannel *, struct sk_buff *); |
| 184 | extern int bchannel_senddata(struct bchannel *, struct sk_buff *); | 185 | extern int bchannel_senddata(struct bchannel *, struct sk_buff *); |
| 185 | extern void recv_Dchannel(struct dchannel *); | 186 | extern void recv_Dchannel(struct dchannel *); |
| 187 | extern void recv_Echannel(struct dchannel *, struct dchannel *); | ||
| 186 | extern void recv_Bchannel(struct bchannel *); | 188 | extern void recv_Bchannel(struct bchannel *); |
| 187 | extern void recv_Dchannel_skb(struct dchannel *, struct sk_buff *); | 189 | extern void recv_Dchannel_skb(struct dchannel *, struct sk_buff *); |
| 188 | extern void recv_Bchannel_skb(struct bchannel *, struct sk_buff *); | 190 | extern void recv_Bchannel_skb(struct bchannel *, struct sk_buff *); |
diff --git a/include/linux/mISDNif.h b/include/linux/mISDNif.h index 8f2d60da04e7..557477ac3d5b 100644 --- a/include/linux/mISDNif.h +++ b/include/linux/mISDNif.h | |||
| @@ -36,8 +36,8 @@ | |||
| 36 | * - should be incremented on every checkin | 36 | * - should be incremented on every checkin |
| 37 | */ | 37 | */ |
| 38 | #define MISDN_MAJOR_VERSION 1 | 38 | #define MISDN_MAJOR_VERSION 1 |
| 39 | #define MISDN_MINOR_VERSION 0 | 39 | #define MISDN_MINOR_VERSION 1 |
| 40 | #define MISDN_RELEASE 19 | 40 | #define MISDN_RELEASE 20 |
| 41 | 41 | ||
| 42 | /* primitives for information exchange | 42 | /* primitives for information exchange |
| 43 | * generell format | 43 | * generell format |
| @@ -80,6 +80,7 @@ | |||
| 80 | #define PH_DEACTIVATE_IND 0x0202 | 80 | #define PH_DEACTIVATE_IND 0x0202 |
| 81 | #define PH_DEACTIVATE_CNF 0x4202 | 81 | #define PH_DEACTIVATE_CNF 0x4202 |
| 82 | #define PH_DATA_IND 0x2002 | 82 | #define PH_DATA_IND 0x2002 |
| 83 | #define PH_DATA_E_IND 0x3002 | ||
| 83 | #define MPH_ACTIVATE_IND 0x0502 | 84 | #define MPH_ACTIVATE_IND 0x0502 |
| 84 | #define MPH_DEACTIVATE_IND 0x0602 | 85 | #define MPH_DEACTIVATE_IND 0x0602 |
| 85 | #define MPH_INFORMATION_IND 0x0702 | 86 | #define MPH_INFORMATION_IND 0x0702 |
| @@ -199,6 +200,18 @@ | |||
| 199 | #define ISDN_P_NT_S0 0x02 | 200 | #define ISDN_P_NT_S0 0x02 |
| 200 | #define ISDN_P_TE_E1 0x03 | 201 | #define ISDN_P_TE_E1 0x03 |
| 201 | #define ISDN_P_NT_E1 0x04 | 202 | #define ISDN_P_NT_E1 0x04 |
| 203 | #define ISDN_P_TE_UP0 0x05 | ||
| 204 | #define ISDN_P_NT_UP0 0x06 | ||
| 205 | |||
| 206 | #define IS_ISDN_P_TE(p) ((p == ISDN_P_TE_S0) || (p == ISDN_P_TE_E1) || \ | ||
| 207 | (p == ISDN_P_TE_UP0) || (p == ISDN_P_LAPD_TE)) | ||
| 208 | #define IS_ISDN_P_NT(p) ((p == ISDN_P_NT_S0) || (p == ISDN_P_NT_E1) || \ | ||
| 209 | (p == ISDN_P_NT_UP0) || (p == ISDN_P_LAPD_NT)) | ||
| 210 | #define IS_ISDN_P_S0(p) ((p == ISDN_P_TE_S0) || (p == ISDN_P_NT_S0)) | ||
| 211 | #define IS_ISDN_P_E1(p) ((p == ISDN_P_TE_E1) || (p == ISDN_P_NT_E1)) | ||
| 212 | #define IS_ISDN_P_UP0(p) ((p == ISDN_P_TE_UP0) || (p == ISDN_P_NT_UP0)) | ||
| 213 | |||
| 214 | |||
| 202 | #define ISDN_P_LAPD_TE 0x10 | 215 | #define ISDN_P_LAPD_TE 0x10 |
| 203 | #define ISDN_P_LAPD_NT 0x11 | 216 | #define ISDN_P_LAPD_NT 0x11 |
| 204 | 217 | ||
| @@ -255,16 +268,6 @@ struct sockaddr_mISDN { | |||
| 255 | unsigned char tei; | 268 | unsigned char tei; |
| 256 | }; | 269 | }; |
| 257 | 270 | ||
| 258 | /* timer device ioctl */ | ||
| 259 | #define IMADDTIMER _IOR('I', 64, int) | ||
| 260 | #define IMDELTIMER _IOR('I', 65, int) | ||
| 261 | /* socket ioctls */ | ||
| 262 | #define IMGETVERSION _IOR('I', 66, int) | ||
| 263 | #define IMGETCOUNT _IOR('I', 67, int) | ||
| 264 | #define IMGETDEVINFO _IOR('I', 68, int) | ||
| 265 | #define IMCTRLREQ _IOR('I', 69, int) | ||
| 266 | #define IMCLEAR_L2 _IOR('I', 70, int) | ||
| 267 | |||
| 268 | struct mISDNversion { | 271 | struct mISDNversion { |
| 269 | unsigned char major; | 272 | unsigned char major; |
| 270 | unsigned char minor; | 273 | unsigned char minor; |
| @@ -281,6 +284,40 @@ struct mISDN_devinfo { | |||
| 281 | char name[MISDN_MAX_IDLEN]; | 284 | char name[MISDN_MAX_IDLEN]; |
| 282 | }; | 285 | }; |
| 283 | 286 | ||
| 287 | struct mISDN_devrename { | ||
| 288 | u_int id; | ||
| 289 | char name[MISDN_MAX_IDLEN]; /* new name */ | ||
| 290 | }; | ||
| 291 | |||
| 292 | /* MPH_INFORMATION_REQ payload */ | ||
| 293 | struct ph_info_ch { | ||
| 294 | __u32 protocol; | ||
| 295 | __u64 Flags; | ||
| 296 | }; | ||
| 297 | |||
| 298 | struct ph_info_dch { | ||
| 299 | struct ph_info_ch ch; | ||
| 300 | __u16 state; | ||
| 301 | __u16 num_bch; | ||
| 302 | }; | ||
| 303 | |||
| 304 | struct ph_info { | ||
| 305 | struct ph_info_dch dch; | ||
| 306 | struct ph_info_ch bch[]; | ||
| 307 | }; | ||
| 308 | |||
| 309 | /* timer device ioctl */ | ||
| 310 | #define IMADDTIMER _IOR('I', 64, int) | ||
| 311 | #define IMDELTIMER _IOR('I', 65, int) | ||
| 312 | |||
| 313 | /* socket ioctls */ | ||
| 314 | #define IMGETVERSION _IOR('I', 66, int) | ||
| 315 | #define IMGETCOUNT _IOR('I', 67, int) | ||
| 316 | #define IMGETDEVINFO _IOR('I', 68, int) | ||
| 317 | #define IMCTRLREQ _IOR('I', 69, int) | ||
| 318 | #define IMCLEAR_L2 _IOR('I', 70, int) | ||
| 319 | #define IMSETDEVNAME _IOR('I', 71, struct mISDN_devrename) | ||
| 320 | |||
| 284 | static inline int | 321 | static inline int |
| 285 | test_channelmap(u_int nr, u_char *map) | 322 | test_channelmap(u_int nr, u_char *map) |
| 286 | { | 323 | { |
| @@ -312,6 +349,8 @@ clear_channelmap(u_int nr, u_char *map) | |||
| 312 | #define MISDN_CTRL_SETPEER 0x0040 | 349 | #define MISDN_CTRL_SETPEER 0x0040 |
| 313 | #define MISDN_CTRL_UNSETPEER 0x0080 | 350 | #define MISDN_CTRL_UNSETPEER 0x0080 |
| 314 | #define MISDN_CTRL_RX_OFF 0x0100 | 351 | #define MISDN_CTRL_RX_OFF 0x0100 |
| 352 | #define MISDN_CTRL_FILL_EMPTY 0x0200 | ||
| 353 | #define MISDN_CTRL_GETPEER 0x0400 | ||
| 315 | #define MISDN_CTRL_HW_FEATURES_OP 0x2000 | 354 | #define MISDN_CTRL_HW_FEATURES_OP 0x2000 |
| 316 | #define MISDN_CTRL_HW_FEATURES 0x2001 | 355 | #define MISDN_CTRL_HW_FEATURES 0x2001 |
| 317 | #define MISDN_CTRL_HFC_OP 0x4000 | 356 | #define MISDN_CTRL_HFC_OP 0x4000 |
| @@ -362,6 +401,7 @@ struct mISDN_ctrl_req { | |||
| 362 | #define DEBUG_L2_TEI 0x00100000 | 401 | #define DEBUG_L2_TEI 0x00100000 |
| 363 | #define DEBUG_L2_TEIFSM 0x00200000 | 402 | #define DEBUG_L2_TEIFSM 0x00200000 |
| 364 | #define DEBUG_TIMER 0x01000000 | 403 | #define DEBUG_TIMER 0x01000000 |
| 404 | #define DEBUG_CLOCK 0x02000000 | ||
| 365 | 405 | ||
| 366 | #define mISDN_HEAD_P(s) ((struct mISDNhead *)&s->cb[0]) | 406 | #define mISDN_HEAD_P(s) ((struct mISDNhead *)&s->cb[0]) |
| 367 | #define mISDN_HEAD_PRIM(s) (((struct mISDNhead *)&s->cb[0])->prim) | 407 | #define mISDN_HEAD_PRIM(s) (((struct mISDNhead *)&s->cb[0])->prim) |
| @@ -375,6 +415,7 @@ struct mISDN_ctrl_req { | |||
| 375 | struct mISDNchannel; | 415 | struct mISDNchannel; |
| 376 | struct mISDNdevice; | 416 | struct mISDNdevice; |
| 377 | struct mISDNstack; | 417 | struct mISDNstack; |
| 418 | struct mISDNclock; | ||
| 378 | 419 | ||
| 379 | struct channel_req { | 420 | struct channel_req { |
| 380 | u_int protocol; | 421 | u_int protocol; |
| @@ -423,7 +464,6 @@ struct mISDN_sock { | |||
| 423 | struct mISDNdevice { | 464 | struct mISDNdevice { |
| 424 | struct mISDNchannel D; | 465 | struct mISDNchannel D; |
| 425 | u_int id; | 466 | u_int id; |
| 426 | char name[MISDN_MAX_IDLEN]; | ||
| 427 | u_int Dprotocols; | 467 | u_int Dprotocols; |
| 428 | u_int Bprotocols; | 468 | u_int Bprotocols; |
| 429 | u_int nrbchan; | 469 | u_int nrbchan; |
| @@ -452,6 +492,16 @@ struct mISDNstack { | |||
| 452 | #endif | 492 | #endif |
| 453 | }; | 493 | }; |
| 454 | 494 | ||
| 495 | typedef int (clockctl_func_t)(void *, int); | ||
| 496 | |||
| 497 | struct mISDNclock { | ||
| 498 | struct list_head list; | ||
| 499 | char name[64]; | ||
| 500 | int pri; | ||
| 501 | clockctl_func_t *ctl; | ||
| 502 | void *priv; | ||
| 503 | }; | ||
| 504 | |||
| 455 | /* global alloc/queue functions */ | 505 | /* global alloc/queue functions */ |
| 456 | 506 | ||
| 457 | static inline struct sk_buff * | 507 | static inline struct sk_buff * |
| @@ -498,12 +548,23 @@ _queue_data(struct mISDNchannel *ch, u_int prim, | |||
| 498 | 548 | ||
| 499 | /* global register/unregister functions */ | 549 | /* global register/unregister functions */ |
| 500 | 550 | ||
| 501 | extern int mISDN_register_device(struct mISDNdevice *, char *name); | 551 | extern int mISDN_register_device(struct mISDNdevice *, |
| 552 | struct device *parent, char *name); | ||
| 502 | extern void mISDN_unregister_device(struct mISDNdevice *); | 553 | extern void mISDN_unregister_device(struct mISDNdevice *); |
| 503 | extern int mISDN_register_Bprotocol(struct Bprotocol *); | 554 | extern int mISDN_register_Bprotocol(struct Bprotocol *); |
| 504 | extern void mISDN_unregister_Bprotocol(struct Bprotocol *); | 555 | extern void mISDN_unregister_Bprotocol(struct Bprotocol *); |
| 556 | extern struct mISDNclock *mISDN_register_clock(char *, int, clockctl_func_t *, | ||
| 557 | void *); | ||
| 558 | extern void mISDN_unregister_clock(struct mISDNclock *); | ||
| 559 | |||
| 560 | static inline struct mISDNdevice *dev_to_mISDN(struct device *dev) | ||
| 561 | { | ||
| 562 | return dev_get_drvdata(dev); | ||
| 563 | } | ||
| 505 | 564 | ||
| 506 | extern void set_channel_address(struct mISDNchannel *, u_int, u_int); | 565 | extern void set_channel_address(struct mISDNchannel *, u_int, u_int); |
| 566 | extern void mISDN_clock_update(struct mISDNclock *, int, struct timeval *); | ||
| 567 | extern unsigned short mISDN_clock_get(void); | ||
| 507 | 568 | ||
| 508 | #endif /* __KERNEL__ */ | 569 | #endif /* __KERNEL__ */ |
| 509 | #endif /* mISDNIF_H */ | 570 | #endif /* mISDNIF_H */ |
diff --git a/include/linux/magic.h b/include/linux/magic.h index f7f3fdddbef0..439f6f3cb0c4 100644 --- a/include/linux/magic.h +++ b/include/linux/magic.h | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | #define EFS_SUPER_MAGIC 0x414A53 | 13 | #define EFS_SUPER_MAGIC 0x414A53 |
| 14 | #define EXT2_SUPER_MAGIC 0xEF53 | 14 | #define EXT2_SUPER_MAGIC 0xEF53 |
| 15 | #define EXT3_SUPER_MAGIC 0xEF53 | 15 | #define EXT3_SUPER_MAGIC 0xEF53 |
| 16 | #define XENFS_SUPER_MAGIC 0xabba1974 | ||
| 16 | #define EXT4_SUPER_MAGIC 0xEF53 | 17 | #define EXT4_SUPER_MAGIC 0xEF53 |
| 17 | #define HPFS_SUPER_MAGIC 0xf995e849 | 18 | #define HPFS_SUPER_MAGIC 0xf995e849 |
| 18 | #define ISOFS_SUPER_MAGIC 0x9660 | 19 | #define ISOFS_SUPER_MAGIC 0x9660 |
diff --git a/include/linux/map_to_7segment.h b/include/linux/map_to_7segment.h index 7df8432c4402..12d62a54d470 100644 --- a/include/linux/map_to_7segment.h +++ b/include/linux/map_to_7segment.h | |||
| @@ -75,7 +75,7 @@ struct seg7_conversion_map { | |||
| 75 | unsigned char table[128]; | 75 | unsigned char table[128]; |
| 76 | }; | 76 | }; |
| 77 | 77 | ||
| 78 | static inline int map_to_seg7(struct seg7_conversion_map *map, int c) | 78 | static __inline__ int map_to_seg7(struct seg7_conversion_map *map, int c) |
| 79 | { | 79 | { |
| 80 | return c >= 0 && c < sizeof(map->table) ? map->table[c] : -EINVAL; | 80 | return c >= 0 && c < sizeof(map->table) ? map->table[c] : -EINVAL; |
| 81 | } | 81 | } |
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 1fbe14d39521..326f45c86530 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
| @@ -19,22 +19,45 @@ | |||
| 19 | 19 | ||
| 20 | #ifndef _LINUX_MEMCONTROL_H | 20 | #ifndef _LINUX_MEMCONTROL_H |
| 21 | #define _LINUX_MEMCONTROL_H | 21 | #define _LINUX_MEMCONTROL_H |
| 22 | 22 | #include <linux/cgroup.h> | |
| 23 | struct mem_cgroup; | 23 | struct mem_cgroup; |
| 24 | struct page_cgroup; | 24 | struct page_cgroup; |
| 25 | struct page; | 25 | struct page; |
| 26 | struct mm_struct; | 26 | struct mm_struct; |
| 27 | 27 | ||
| 28 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR | 28 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR |
| 29 | /* | ||
| 30 | * All "charge" functions with gfp_mask should use GFP_KERNEL or | ||
| 31 | * (gfp_mask & GFP_RECLAIM_MASK). In current implementatin, memcg doesn't | ||
| 32 | * alloc memory but reclaims memory from all available zones. So, "where I want | ||
| 33 | * memory from" bits of gfp_mask has no meaning. So any bits of that field is | ||
| 34 | * available but adding a rule is better. charge functions' gfp_mask should | ||
| 35 | * be set to GFP_KERNEL or gfp_mask & GFP_RECLAIM_MASK for avoiding ambiguous | ||
| 36 | * codes. | ||
| 37 | * (Of course, if memcg does memory allocation in future, GFP_KERNEL is sane.) | ||
| 38 | */ | ||
| 29 | 39 | ||
| 30 | extern int mem_cgroup_charge(struct page *page, struct mm_struct *mm, | 40 | extern int mem_cgroup_newpage_charge(struct page *page, struct mm_struct *mm, |
| 31 | gfp_t gfp_mask); | 41 | gfp_t gfp_mask); |
| 42 | /* for swap handling */ | ||
| 43 | extern int mem_cgroup_try_charge_swapin(struct mm_struct *mm, | ||
| 44 | struct page *page, gfp_t mask, struct mem_cgroup **ptr); | ||
| 45 | extern void mem_cgroup_commit_charge_swapin(struct page *page, | ||
| 46 | struct mem_cgroup *ptr); | ||
| 47 | extern void mem_cgroup_cancel_charge_swapin(struct mem_cgroup *ptr); | ||
| 48 | |||
| 32 | extern int mem_cgroup_cache_charge(struct page *page, struct mm_struct *mm, | 49 | extern int mem_cgroup_cache_charge(struct page *page, struct mm_struct *mm, |
| 33 | gfp_t gfp_mask); | 50 | gfp_t gfp_mask); |
| 34 | extern void mem_cgroup_move_lists(struct page *page, enum lru_list lru); | 51 | extern void mem_cgroup_add_lru_list(struct page *page, enum lru_list lru); |
| 52 | extern void mem_cgroup_del_lru_list(struct page *page, enum lru_list lru); | ||
| 53 | extern void mem_cgroup_rotate_lru_list(struct page *page, enum lru_list lru); | ||
| 54 | extern void mem_cgroup_del_lru(struct page *page); | ||
| 55 | extern void mem_cgroup_move_lists(struct page *page, | ||
| 56 | enum lru_list from, enum lru_list to); | ||
| 35 | extern void mem_cgroup_uncharge_page(struct page *page); | 57 | extern void mem_cgroup_uncharge_page(struct page *page); |
| 36 | extern void mem_cgroup_uncharge_cache_page(struct page *page); | 58 | extern void mem_cgroup_uncharge_cache_page(struct page *page); |
| 37 | extern int mem_cgroup_shrink_usage(struct mm_struct *mm, gfp_t gfp_mask); | 59 | extern int mem_cgroup_shrink_usage(struct page *page, |
| 60 | struct mm_struct *mm, gfp_t gfp_mask); | ||
| 38 | 61 | ||
| 39 | extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan, | 62 | extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan, |
| 40 | struct list_head *dst, | 63 | struct list_head *dst, |
| @@ -47,12 +70,20 @@ int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem); | |||
| 47 | 70 | ||
| 48 | extern struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p); | 71 | extern struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p); |
| 49 | 72 | ||
| 50 | #define mm_match_cgroup(mm, cgroup) \ | 73 | static inline |
| 51 | ((cgroup) == mem_cgroup_from_task((mm)->owner)) | 74 | int mm_match_cgroup(const struct mm_struct *mm, const struct mem_cgroup *cgroup) |
| 75 | { | ||
| 76 | struct mem_cgroup *mem; | ||
| 77 | rcu_read_lock(); | ||
| 78 | mem = mem_cgroup_from_task((mm)->owner); | ||
| 79 | rcu_read_unlock(); | ||
| 80 | return cgroup == mem; | ||
| 81 | } | ||
| 52 | 82 | ||
| 53 | extern int | 83 | extern int |
| 54 | mem_cgroup_prepare_migration(struct page *page, struct page *newpage); | 84 | mem_cgroup_prepare_migration(struct page *page, struct mem_cgroup **ptr); |
| 55 | extern void mem_cgroup_end_migration(struct page *page); | 85 | extern void mem_cgroup_end_migration(struct mem_cgroup *mem, |
| 86 | struct page *oldpage, struct page *newpage); | ||
| 56 | 87 | ||
| 57 | /* | 88 | /* |
| 58 | * For memory reclaim. | 89 | * For memory reclaim. |
| @@ -65,13 +96,32 @@ extern void mem_cgroup_note_reclaim_priority(struct mem_cgroup *mem, | |||
| 65 | int priority); | 96 | int priority); |
| 66 | extern void mem_cgroup_record_reclaim_priority(struct mem_cgroup *mem, | 97 | extern void mem_cgroup_record_reclaim_priority(struct mem_cgroup *mem, |
| 67 | int priority); | 98 | int priority); |
| 99 | int mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg); | ||
| 100 | unsigned long mem_cgroup_zone_nr_pages(struct mem_cgroup *memcg, | ||
| 101 | struct zone *zone, | ||
| 102 | enum lru_list lru); | ||
| 103 | struct zone_reclaim_stat *mem_cgroup_get_reclaim_stat(struct mem_cgroup *memcg, | ||
| 104 | struct zone *zone); | ||
| 105 | struct zone_reclaim_stat* | ||
| 106 | mem_cgroup_get_reclaim_stat_from_page(struct page *page); | ||
| 68 | 107 | ||
| 69 | extern long mem_cgroup_calc_reclaim(struct mem_cgroup *mem, struct zone *zone, | 108 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP |
| 70 | int priority, enum lru_list lru); | 109 | extern int do_swap_account; |
| 110 | #endif | ||
| 71 | 111 | ||
| 112 | static inline bool mem_cgroup_disabled(void) | ||
| 113 | { | ||
| 114 | if (mem_cgroup_subsys.disabled) | ||
| 115 | return true; | ||
| 116 | return false; | ||
| 117 | } | ||
| 118 | |||
| 119 | extern bool mem_cgroup_oom_called(struct task_struct *task); | ||
| 72 | 120 | ||
| 73 | #else /* CONFIG_CGROUP_MEM_RES_CTLR */ | 121 | #else /* CONFIG_CGROUP_MEM_RES_CTLR */ |
| 74 | static inline int mem_cgroup_charge(struct page *page, | 122 | struct mem_cgroup; |
| 123 | |||
| 124 | static inline int mem_cgroup_newpage_charge(struct page *page, | ||
| 75 | struct mm_struct *mm, gfp_t gfp_mask) | 125 | struct mm_struct *mm, gfp_t gfp_mask) |
| 76 | { | 126 | { |
| 77 | return 0; | 127 | return 0; |
| @@ -83,6 +133,21 @@ static inline int mem_cgroup_cache_charge(struct page *page, | |||
| 83 | return 0; | 133 | return 0; |
| 84 | } | 134 | } |
| 85 | 135 | ||
| 136 | static inline int mem_cgroup_try_charge_swapin(struct mm_struct *mm, | ||
| 137 | struct page *page, gfp_t gfp_mask, struct mem_cgroup **ptr) | ||
| 138 | { | ||
| 139 | return 0; | ||
| 140 | } | ||
| 141 | |||
| 142 | static inline void mem_cgroup_commit_charge_swapin(struct page *page, | ||
| 143 | struct mem_cgroup *ptr) | ||
| 144 | { | ||
| 145 | } | ||
| 146 | |||
| 147 | static inline void mem_cgroup_cancel_charge_swapin(struct mem_cgroup *ptr) | ||
| 148 | { | ||
| 149 | } | ||
| 150 | |||
| 86 | static inline void mem_cgroup_uncharge_page(struct page *page) | 151 | static inline void mem_cgroup_uncharge_page(struct page *page) |
| 87 | { | 152 | { |
| 88 | } | 153 | } |
| @@ -91,12 +156,33 @@ static inline void mem_cgroup_uncharge_cache_page(struct page *page) | |||
| 91 | { | 156 | { |
| 92 | } | 157 | } |
| 93 | 158 | ||
| 94 | static inline int mem_cgroup_shrink_usage(struct mm_struct *mm, gfp_t gfp_mask) | 159 | static inline int mem_cgroup_shrink_usage(struct page *page, |
| 160 | struct mm_struct *mm, gfp_t gfp_mask) | ||
| 95 | { | 161 | { |
| 96 | return 0; | 162 | return 0; |
| 97 | } | 163 | } |
| 98 | 164 | ||
| 99 | static inline void mem_cgroup_move_lists(struct page *page, bool active) | 165 | static inline void mem_cgroup_add_lru_list(struct page *page, int lru) |
| 166 | { | ||
| 167 | } | ||
| 168 | |||
| 169 | static inline void mem_cgroup_del_lru_list(struct page *page, int lru) | ||
| 170 | { | ||
| 171 | return ; | ||
| 172 | } | ||
| 173 | |||
| 174 | static inline void mem_cgroup_rotate_lru_list(struct page *page, int lru) | ||
| 175 | { | ||
| 176 | return ; | ||
| 177 | } | ||
| 178 | |||
| 179 | static inline void mem_cgroup_del_lru(struct page *page) | ||
| 180 | { | ||
| 181 | return ; | ||
| 182 | } | ||
| 183 | |||
| 184 | static inline void | ||
| 185 | mem_cgroup_move_lists(struct page *page, enum lru_list from, enum lru_list to) | ||
| 100 | { | 186 | { |
| 101 | } | 187 | } |
| 102 | 188 | ||
| @@ -112,12 +198,14 @@ static inline int task_in_mem_cgroup(struct task_struct *task, | |||
| 112 | } | 198 | } |
| 113 | 199 | ||
| 114 | static inline int | 200 | static inline int |
| 115 | mem_cgroup_prepare_migration(struct page *page, struct page *newpage) | 201 | mem_cgroup_prepare_migration(struct page *page, struct mem_cgroup **ptr) |
| 116 | { | 202 | { |
| 117 | return 0; | 203 | return 0; |
| 118 | } | 204 | } |
| 119 | 205 | ||
| 120 | static inline void mem_cgroup_end_migration(struct page *page) | 206 | static inline void mem_cgroup_end_migration(struct mem_cgroup *mem, |
| 207 | struct page *oldpage, | ||
| 208 | struct page *newpage) | ||
| 121 | { | 209 | { |
| 122 | } | 210 | } |
| 123 | 211 | ||
| @@ -146,12 +234,42 @@ static inline void mem_cgroup_record_reclaim_priority(struct mem_cgroup *mem, | |||
| 146 | { | 234 | { |
| 147 | } | 235 | } |
| 148 | 236 | ||
| 149 | static inline long mem_cgroup_calc_reclaim(struct mem_cgroup *mem, | 237 | static inline bool mem_cgroup_disabled(void) |
| 150 | struct zone *zone, int priority, | 238 | { |
| 151 | enum lru_list lru) | 239 | return true; |
| 240 | } | ||
| 241 | |||
| 242 | static inline bool mem_cgroup_oom_called(struct task_struct *task) | ||
| 243 | { | ||
| 244 | return false; | ||
| 245 | } | ||
| 246 | |||
| 247 | static inline int | ||
| 248 | mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg) | ||
| 249 | { | ||
| 250 | return 1; | ||
| 251 | } | ||
| 252 | |||
| 253 | static inline unsigned long | ||
| 254 | mem_cgroup_zone_nr_pages(struct mem_cgroup *memcg, struct zone *zone, | ||
| 255 | enum lru_list lru) | ||
| 152 | { | 256 | { |
| 153 | return 0; | 257 | return 0; |
| 154 | } | 258 | } |
| 259 | |||
| 260 | |||
| 261 | static inline struct zone_reclaim_stat* | ||
| 262 | mem_cgroup_get_reclaim_stat(struct mem_cgroup *memcg, struct zone *zone) | ||
| 263 | { | ||
| 264 | return NULL; | ||
| 265 | } | ||
| 266 | |||
| 267 | static inline struct zone_reclaim_stat* | ||
| 268 | mem_cgroup_get_reclaim_stat_from_page(struct page *page) | ||
| 269 | { | ||
| 270 | return NULL; | ||
| 271 | } | ||
| 272 | |||
| 155 | #endif /* CONFIG_CGROUP_MEM_CONT */ | 273 | #endif /* CONFIG_CGROUP_MEM_CONT */ |
| 156 | 274 | ||
| 157 | #endif /* _LINUX_MEMCONTROL_H */ | 275 | #endif /* _LINUX_MEMCONTROL_H */ |
diff --git a/include/linux/memory.h b/include/linux/memory.h index 36c82c9e6ea7..3fdc10806d31 100644 --- a/include/linux/memory.h +++ b/include/linux/memory.h | |||
| @@ -79,14 +79,14 @@ static inline int memory_notify(unsigned long val, void *v) | |||
| 79 | #else | 79 | #else |
| 80 | extern int register_memory_notifier(struct notifier_block *nb); | 80 | extern int register_memory_notifier(struct notifier_block *nb); |
| 81 | extern void unregister_memory_notifier(struct notifier_block *nb); | 81 | extern void unregister_memory_notifier(struct notifier_block *nb); |
| 82 | extern int register_new_memory(struct mem_section *); | 82 | extern int register_new_memory(int, struct mem_section *); |
| 83 | extern int unregister_memory_section(struct mem_section *); | 83 | extern int unregister_memory_section(struct mem_section *); |
| 84 | extern int memory_dev_init(void); | 84 | extern int memory_dev_init(void); |
| 85 | extern int remove_memory_block(unsigned long, struct mem_section *, int); | 85 | extern int remove_memory_block(unsigned long, struct mem_section *, int); |
| 86 | extern int memory_notify(unsigned long val, void *v); | 86 | extern int memory_notify(unsigned long val, void *v); |
| 87 | extern struct memory_block *find_memory_block(struct mem_section *); | ||
| 87 | #define CONFIG_MEM_BLOCK_SIZE (PAGES_PER_SECTION<<PAGE_SHIFT) | 88 | #define CONFIG_MEM_BLOCK_SIZE (PAGES_PER_SECTION<<PAGE_SHIFT) |
| 88 | 89 | enum mem_add_context { BOOT, HOTPLUG }; | |
| 89 | |||
| 90 | #endif /* CONFIG_MEMORY_HOTPLUG_SPARSE */ | 90 | #endif /* CONFIG_MEMORY_HOTPLUG_SPARSE */ |
| 91 | 91 | ||
| 92 | #ifdef CONFIG_MEMORY_HOTPLUG | 92 | #ifdef CONFIG_MEMORY_HOTPLUG |
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h index 763ba81fc0f0..d95f72e79b82 100644 --- a/include/linux/memory_hotplug.h +++ b/include/linux/memory_hotplug.h | |||
| @@ -72,7 +72,7 @@ extern void __offline_isolated_pages(unsigned long, unsigned long); | |||
| 72 | extern int offline_pages(unsigned long, unsigned long, unsigned long); | 72 | extern int offline_pages(unsigned long, unsigned long, unsigned long); |
| 73 | 73 | ||
| 74 | /* reasonably generic interface to expand the physical pages in a zone */ | 74 | /* reasonably generic interface to expand the physical pages in a zone */ |
| 75 | extern int __add_pages(struct zone *zone, unsigned long start_pfn, | 75 | extern int __add_pages(int nid, struct zone *zone, unsigned long start_pfn, |
| 76 | unsigned long nr_pages); | 76 | unsigned long nr_pages); |
| 77 | extern int __remove_pages(struct zone *zone, unsigned long start_pfn, | 77 | extern int __remove_pages(struct zone *zone, unsigned long start_pfn, |
| 78 | unsigned long nr_pages); | 78 | unsigned long nr_pages); |
diff --git a/include/linux/memstick.h b/include/linux/memstick.h index d0c37e682234..690c35a9d4cc 100644 --- a/include/linux/memstick.h +++ b/include/linux/memstick.h | |||
| @@ -100,8 +100,8 @@ struct mspro_param_register { | |||
| 100 | #define MEMSTICK_SYS_PAR8 0x40 | 100 | #define MEMSTICK_SYS_PAR8 0x40 |
| 101 | #define MEMSTICK_SYS_SERIAL 0x80 | 101 | #define MEMSTICK_SYS_SERIAL 0x80 |
| 102 | 102 | ||
| 103 | unsigned short data_count; | 103 | __be16 data_count; |
| 104 | unsigned int data_address; | 104 | __be32 data_address; |
| 105 | unsigned char tpc_param; | 105 | unsigned char tpc_param; |
| 106 | } __attribute__((packed)); | 106 | } __attribute__((packed)); |
| 107 | 107 | ||
diff --git a/include/linux/mfd/wm8350/pmic.h b/include/linux/mfd/wm8350/pmic.h index 96acbfc8aa12..be3264e286e0 100644 --- a/include/linux/mfd/wm8350/pmic.h +++ b/include/linux/mfd/wm8350/pmic.h | |||
| @@ -13,6 +13,10 @@ | |||
| 13 | #ifndef __LINUX_MFD_WM8350_PMIC_H | 13 | #ifndef __LINUX_MFD_WM8350_PMIC_H |
| 14 | #define __LINUX_MFD_WM8350_PMIC_H | 14 | #define __LINUX_MFD_WM8350_PMIC_H |
| 15 | 15 | ||
| 16 | #include <linux/platform_device.h> | ||
| 17 | #include <linux/leds.h> | ||
| 18 | #include <linux/regulator/machine.h> | ||
| 19 | |||
| 16 | /* | 20 | /* |
| 17 | * Register values. | 21 | * Register values. |
| 18 | */ | 22 | */ |
| @@ -700,6 +704,33 @@ struct wm8350; | |||
| 700 | struct platform_device; | 704 | struct platform_device; |
| 701 | struct regulator_init_data; | 705 | struct regulator_init_data; |
| 702 | 706 | ||
| 707 | /* | ||
| 708 | * WM8350 LED platform data | ||
| 709 | */ | ||
| 710 | struct wm8350_led_platform_data { | ||
| 711 | const char *name; | ||
| 712 | const char *default_trigger; | ||
| 713 | int max_uA; | ||
| 714 | }; | ||
| 715 | |||
| 716 | struct wm8350_led { | ||
| 717 | struct platform_device *pdev; | ||
| 718 | struct mutex mutex; | ||
| 719 | struct work_struct work; | ||
| 720 | spinlock_t value_lock; | ||
| 721 | enum led_brightness value; | ||
| 722 | struct led_classdev cdev; | ||
| 723 | int max_uA_index; | ||
| 724 | int enabled; | ||
| 725 | |||
| 726 | struct regulator *isink; | ||
| 727 | struct regulator_consumer_supply isink_consumer; | ||
| 728 | struct regulator_init_data isink_init; | ||
| 729 | struct regulator *dcdc; | ||
| 730 | struct regulator_consumer_supply dcdc_consumer; | ||
| 731 | struct regulator_init_data dcdc_init; | ||
| 732 | }; | ||
| 733 | |||
| 703 | struct wm8350_pmic { | 734 | struct wm8350_pmic { |
| 704 | /* Number of regulators of each type on this device */ | 735 | /* Number of regulators of each type on this device */ |
| 705 | int max_dcdc; | 736 | int max_dcdc; |
| @@ -717,10 +748,15 @@ struct wm8350_pmic { | |||
| 717 | 748 | ||
| 718 | /* regulator devices */ | 749 | /* regulator devices */ |
| 719 | struct platform_device *pdev[NUM_WM8350_REGULATORS]; | 750 | struct platform_device *pdev[NUM_WM8350_REGULATORS]; |
| 751 | |||
| 752 | /* LED devices */ | ||
| 753 | struct wm8350_led led[2]; | ||
| 720 | }; | 754 | }; |
| 721 | 755 | ||
| 722 | int wm8350_register_regulator(struct wm8350 *wm8350, int reg, | 756 | int wm8350_register_regulator(struct wm8350 *wm8350, int reg, |
| 723 | struct regulator_init_data *initdata); | 757 | struct regulator_init_data *initdata); |
| 758 | int wm8350_register_led(struct wm8350 *wm8350, int lednum, int dcdc, int isink, | ||
| 759 | struct wm8350_led_platform_data *pdata); | ||
| 724 | 760 | ||
| 725 | /* | 761 | /* |
| 726 | * Additional DCDC control not supported via regulator API | 762 | * Additional DCDC control not supported via regulator API |
diff --git a/include/linux/migrate.h b/include/linux/migrate.h index 3f34005068d4..527602cdea1c 100644 --- a/include/linux/migrate.h +++ b/include/linux/migrate.h | |||
| @@ -7,6 +7,8 @@ | |||
| 7 | typedef struct page *new_page_t(struct page *, unsigned long private, int **); | 7 | typedef struct page *new_page_t(struct page *, unsigned long private, int **); |
| 8 | 8 | ||
| 9 | #ifdef CONFIG_MIGRATION | 9 | #ifdef CONFIG_MIGRATION |
| 10 | #define PAGE_MIGRATION 1 | ||
| 11 | |||
| 10 | extern int putback_lru_pages(struct list_head *l); | 12 | extern int putback_lru_pages(struct list_head *l); |
| 11 | extern int migrate_page(struct address_space *, | 13 | extern int migrate_page(struct address_space *, |
| 12 | struct page *, struct page *); | 14 | struct page *, struct page *); |
| @@ -20,6 +22,8 @@ extern int migrate_vmas(struct mm_struct *mm, | |||
| 20 | const nodemask_t *from, const nodemask_t *to, | 22 | const nodemask_t *from, const nodemask_t *to, |
| 21 | unsigned long flags); | 23 | unsigned long flags); |
| 22 | #else | 24 | #else |
| 25 | #define PAGE_MIGRATION 0 | ||
| 26 | |||
| 23 | static inline int putback_lru_pages(struct list_head *l) { return 0; } | 27 | static inline int putback_lru_pages(struct list_head *l) { return 0; } |
| 24 | static inline int migrate_pages(struct list_head *l, new_page_t x, | 28 | static inline int migrate_pages(struct list_head *l, new_page_t x, |
| 25 | unsigned long private) { return -ENOSYS; } | 29 | unsigned long private) { return -ENOSYS; } |
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h index 26433ec520b3..a820f816a49e 100644 --- a/include/linux/miscdevice.h +++ b/include/linux/miscdevice.h | |||
| @@ -3,33 +3,33 @@ | |||
| 3 | #include <linux/module.h> | 3 | #include <linux/module.h> |
| 4 | #include <linux/major.h> | 4 | #include <linux/major.h> |
| 5 | 5 | ||
| 6 | #define PSMOUSE_MINOR 1 | 6 | #define PSMOUSE_MINOR 1 |
| 7 | #define MS_BUSMOUSE_MINOR 2 | 7 | #define MS_BUSMOUSE_MINOR 2 |
| 8 | #define ATIXL_BUSMOUSE_MINOR 3 | 8 | #define ATIXL_BUSMOUSE_MINOR 3 |
| 9 | /*#define AMIGAMOUSE_MINOR 4 FIXME OBSOLETE */ | 9 | /*#define AMIGAMOUSE_MINOR 4 FIXME OBSOLETE */ |
| 10 | #define ATARIMOUSE_MINOR 5 | 10 | #define ATARIMOUSE_MINOR 5 |
| 11 | #define SUN_MOUSE_MINOR 6 | 11 | #define SUN_MOUSE_MINOR 6 |
| 12 | #define APOLLO_MOUSE_MINOR 7 | 12 | #define APOLLO_MOUSE_MINOR 7 |
| 13 | #define PC110PAD_MINOR 9 | 13 | #define PC110PAD_MINOR 9 |
| 14 | /*#define ADB_MOUSE_MINOR 10 FIXME OBSOLETE */ | 14 | /*#define ADB_MOUSE_MINOR 10 FIXME OBSOLETE */ |
| 15 | #define WATCHDOG_MINOR 130 /* Watchdog timer */ | 15 | #define WATCHDOG_MINOR 130 /* Watchdog timer */ |
| 16 | #define TEMP_MINOR 131 /* Temperature Sensor */ | 16 | #define TEMP_MINOR 131 /* Temperature Sensor */ |
| 17 | #define RTC_MINOR 135 | 17 | #define RTC_MINOR 135 |
| 18 | #define EFI_RTC_MINOR 136 /* EFI Time services */ | 18 | #define EFI_RTC_MINOR 136 /* EFI Time services */ |
| 19 | #define SUN_OPENPROM_MINOR 139 | 19 | #define SUN_OPENPROM_MINOR 139 |
| 20 | #define DMAPI_MINOR 140 /* DMAPI */ | 20 | #define DMAPI_MINOR 140 /* DMAPI */ |
| 21 | #define NVRAM_MINOR 144 | 21 | #define NVRAM_MINOR 144 |
| 22 | #define SGI_MMTIMER 153 | 22 | #define SGI_MMTIMER 153 |
| 23 | #define STORE_QUEUE_MINOR 155 | 23 | #define STORE_QUEUE_MINOR 155 |
| 24 | #define I2O_MINOR 166 | 24 | #define I2O_MINOR 166 |
| 25 | #define MICROCODE_MINOR 184 | 25 | #define MICROCODE_MINOR 184 |
| 26 | #define MWAVE_MINOR 219 /* ACP/Mwave Modem */ | 26 | #define TUN_MINOR 200 |
| 27 | #define MPT_MINOR 220 | 27 | #define MWAVE_MINOR 219 /* ACP/Mwave Modem */ |
| 28 | #define MISC_DYNAMIC_MINOR 255 | 28 | #define MPT_MINOR 220 |
| 29 | 29 | #define HPET_MINOR 228 | |
| 30 | #define TUN_MINOR 200 | 30 | #define FUSE_MINOR 229 |
| 31 | #define HPET_MINOR 228 | 31 | #define KVM_MINOR 232 |
| 32 | #define KVM_MINOR 232 | 32 | #define MISC_DYNAMIC_MINOR 255 |
| 33 | 33 | ||
| 34 | struct device; | 34 | struct device; |
| 35 | 35 | ||
diff --git a/include/linux/mm.h b/include/linux/mm.h index aaa8b843be28..b91a73fd1bcc 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
| @@ -56,19 +56,9 @@ extern unsigned long mmap_min_addr; | |||
| 56 | 56 | ||
| 57 | extern struct kmem_cache *vm_area_cachep; | 57 | extern struct kmem_cache *vm_area_cachep; |
| 58 | 58 | ||
| 59 | /* | ||
| 60 | * This struct defines the per-mm list of VMAs for uClinux. If CONFIG_MMU is | ||
| 61 | * disabled, then there's a single shared list of VMAs maintained by the | ||
| 62 | * system, and mm's subscribe to these individually | ||
| 63 | */ | ||
| 64 | struct vm_list_struct { | ||
| 65 | struct vm_list_struct *next; | ||
| 66 | struct vm_area_struct *vma; | ||
| 67 | }; | ||
| 68 | |||
| 69 | #ifndef CONFIG_MMU | 59 | #ifndef CONFIG_MMU |
| 70 | extern struct rb_root nommu_vma_tree; | 60 | extern struct rb_root nommu_region_tree; |
| 71 | extern struct rw_semaphore nommu_vma_sem; | 61 | extern struct rw_semaphore nommu_region_sem; |
| 72 | 62 | ||
| 73 | extern unsigned int kobjsize(const void *objp); | 63 | extern unsigned int kobjsize(const void *objp); |
| 74 | #endif | 64 | #endif |
| @@ -717,6 +707,11 @@ static inline int page_mapped(struct page *page) | |||
| 717 | 707 | ||
| 718 | #define VM_FAULT_ERROR (VM_FAULT_OOM | VM_FAULT_SIGBUS) | 708 | #define VM_FAULT_ERROR (VM_FAULT_OOM | VM_FAULT_SIGBUS) |
| 719 | 709 | ||
| 710 | /* | ||
| 711 | * Can be called by the pagefault handler when it gets a VM_FAULT_OOM. | ||
| 712 | */ | ||
| 713 | extern void pagefault_out_of_memory(void); | ||
| 714 | |||
| 720 | #define offset_in_page(p) ((unsigned long)(p) & ~PAGE_MASK) | 715 | #define offset_in_page(p) ((unsigned long)(p) & ~PAGE_MASK) |
| 721 | 716 | ||
| 722 | extern void show_free_areas(void); | 717 | extern void show_free_areas(void); |
| @@ -1056,6 +1051,7 @@ extern void memmap_init_zone(unsigned long, int, unsigned long, | |||
| 1056 | unsigned long, enum memmap_context); | 1051 | unsigned long, enum memmap_context); |
| 1057 | extern void setup_per_zone_pages_min(void); | 1052 | extern void setup_per_zone_pages_min(void); |
| 1058 | extern void mem_init(void); | 1053 | extern void mem_init(void); |
| 1054 | extern void __init mmap_init(void); | ||
| 1059 | extern void show_mem(void); | 1055 | extern void show_mem(void); |
| 1060 | extern void si_meminfo(struct sysinfo * val); | 1056 | extern void si_meminfo(struct sysinfo * val); |
| 1061 | extern void si_meminfo_node(struct sysinfo *val, int nid); | 1057 | extern void si_meminfo_node(struct sysinfo *val, int nid); |
| @@ -1067,6 +1063,9 @@ extern void setup_per_cpu_pageset(void); | |||
| 1067 | static inline void setup_per_cpu_pageset(void) {} | 1063 | static inline void setup_per_cpu_pageset(void) {} |
| 1068 | #endif | 1064 | #endif |
| 1069 | 1065 | ||
| 1066 | /* nommu.c */ | ||
| 1067 | extern atomic_t mmap_pages_allocated; | ||
| 1068 | |||
| 1070 | /* prio_tree.c */ | 1069 | /* prio_tree.c */ |
| 1071 | void vma_prio_tree_add(struct vm_area_struct *, struct vm_area_struct *old); | 1070 | void vma_prio_tree_add(struct vm_area_struct *, struct vm_area_struct *old); |
| 1072 | void vma_prio_tree_insert(struct vm_area_struct *, struct prio_tree_root *); | 1071 | void vma_prio_tree_insert(struct vm_area_struct *, struct prio_tree_root *); |
diff --git a/include/linux/mm_inline.h b/include/linux/mm_inline.h index c948350c378e..7fbb97267556 100644 --- a/include/linux/mm_inline.h +++ b/include/linux/mm_inline.h | |||
| @@ -28,6 +28,7 @@ add_page_to_lru_list(struct zone *zone, struct page *page, enum lru_list l) | |||
| 28 | { | 28 | { |
| 29 | list_add(&page->lru, &zone->lru[l].list); | 29 | list_add(&page->lru, &zone->lru[l].list); |
| 30 | __inc_zone_state(zone, NR_LRU_BASE + l); | 30 | __inc_zone_state(zone, NR_LRU_BASE + l); |
| 31 | mem_cgroup_add_lru_list(page, l); | ||
| 31 | } | 32 | } |
| 32 | 33 | ||
| 33 | static inline void | 34 | static inline void |
| @@ -35,6 +36,7 @@ del_page_from_lru_list(struct zone *zone, struct page *page, enum lru_list l) | |||
| 35 | { | 36 | { |
| 36 | list_del(&page->lru); | 37 | list_del(&page->lru); |
| 37 | __dec_zone_state(zone, NR_LRU_BASE + l); | 38 | __dec_zone_state(zone, NR_LRU_BASE + l); |
| 39 | mem_cgroup_del_lru_list(page, l); | ||
| 38 | } | 40 | } |
| 39 | 41 | ||
| 40 | static inline void | 42 | static inline void |
| @@ -54,6 +56,7 @@ del_page_from_lru(struct zone *zone, struct page *page) | |||
| 54 | l += page_is_file_cache(page); | 56 | l += page_is_file_cache(page); |
| 55 | } | 57 | } |
| 56 | __dec_zone_state(zone, NR_LRU_BASE + l); | 58 | __dec_zone_state(zone, NR_LRU_BASE + l); |
| 59 | mem_cgroup_del_lru_list(page, l); | ||
| 57 | } | 60 | } |
| 58 | 61 | ||
| 59 | /** | 62 | /** |
| @@ -78,23 +81,4 @@ static inline enum lru_list page_lru(struct page *page) | |||
| 78 | return lru; | 81 | return lru; |
| 79 | } | 82 | } |
| 80 | 83 | ||
| 81 | /** | ||
| 82 | * inactive_anon_is_low - check if anonymous pages need to be deactivated | ||
| 83 | * @zone: zone to check | ||
| 84 | * | ||
| 85 | * Returns true if the zone does not have enough inactive anon pages, | ||
| 86 | * meaning some active anon pages need to be deactivated. | ||
| 87 | */ | ||
| 88 | static inline int inactive_anon_is_low(struct zone *zone) | ||
| 89 | { | ||
| 90 | unsigned long active, inactive; | ||
| 91 | |||
| 92 | active = zone_page_state(zone, NR_ACTIVE_ANON); | ||
| 93 | inactive = zone_page_state(zone, NR_INACTIVE_ANON); | ||
| 94 | |||
| 95 | if (inactive * zone->inactive_ratio < active) | ||
| 96 | return 1; | ||
| 97 | |||
| 98 | return 0; | ||
| 99 | } | ||
| 100 | #endif | 84 | #endif |
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 9cfc9b627fdd..92915e81443f 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
| @@ -97,6 +97,23 @@ struct page { | |||
| 97 | }; | 97 | }; |
| 98 | 98 | ||
| 99 | /* | 99 | /* |
| 100 | * A region containing a mapping of a non-memory backed file under NOMMU | ||
| 101 | * conditions. These are held in a global tree and are pinned by the VMAs that | ||
| 102 | * map parts of them. | ||
| 103 | */ | ||
| 104 | struct vm_region { | ||
| 105 | struct rb_node vm_rb; /* link in global region tree */ | ||
| 106 | unsigned long vm_flags; /* VMA vm_flags */ | ||
| 107 | unsigned long vm_start; /* start address of region */ | ||
| 108 | unsigned long vm_end; /* region initialised to here */ | ||
| 109 | unsigned long vm_top; /* region allocated to here */ | ||
| 110 | unsigned long vm_pgoff; /* the offset in vm_file corresponding to vm_start */ | ||
| 111 | struct file *vm_file; /* the backing file or NULL */ | ||
| 112 | |||
| 113 | atomic_t vm_usage; /* region usage count */ | ||
| 114 | }; | ||
| 115 | |||
| 116 | /* | ||
| 100 | * This struct defines a memory VMM memory area. There is one of these | 117 | * This struct defines a memory VMM memory area. There is one of these |
| 101 | * per VM-area/task. A VM area is any part of the process virtual memory | 118 | * per VM-area/task. A VM area is any part of the process virtual memory |
| 102 | * space that has a special rule for the page-fault handlers (ie a shared | 119 | * space that has a special rule for the page-fault handlers (ie a shared |
| @@ -152,7 +169,7 @@ struct vm_area_struct { | |||
| 152 | unsigned long vm_truncate_count;/* truncate_count or restart_addr */ | 169 | unsigned long vm_truncate_count;/* truncate_count or restart_addr */ |
| 153 | 170 | ||
| 154 | #ifndef CONFIG_MMU | 171 | #ifndef CONFIG_MMU |
| 155 | atomic_t vm_usage; /* refcount (VMAs shared if !MMU) */ | 172 | struct vm_region *vm_region; /* NOMMU mapping region */ |
| 156 | #endif | 173 | #endif |
| 157 | #ifdef CONFIG_NUMA | 174 | #ifdef CONFIG_NUMA |
| 158 | struct mempolicy *vm_policy; /* NUMA policy for the VMA */ | 175 | struct mempolicy *vm_policy; /* NUMA policy for the VMA */ |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 35a7b5e19465..09c14e213b63 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
| @@ -263,6 +263,19 @@ enum zone_type { | |||
| 263 | #error ZONES_SHIFT -- too many zones configured adjust calculation | 263 | #error ZONES_SHIFT -- too many zones configured adjust calculation |
| 264 | #endif | 264 | #endif |
| 265 | 265 | ||
| 266 | struct zone_reclaim_stat { | ||
| 267 | /* | ||
| 268 | * The pageout code in vmscan.c keeps track of how many of the | ||
| 269 | * mem/swap backed and file backed pages are refeferenced. | ||
| 270 | * The higher the rotated/scanned ratio, the more valuable | ||
| 271 | * that cache is. | ||
| 272 | * | ||
| 273 | * The anon LRU stats live in [0], file LRU stats in [1] | ||
| 274 | */ | ||
| 275 | unsigned long recent_rotated[2]; | ||
| 276 | unsigned long recent_scanned[2]; | ||
| 277 | }; | ||
| 278 | |||
| 266 | struct zone { | 279 | struct zone { |
| 267 | /* Fields commonly accessed by the page allocator */ | 280 | /* Fields commonly accessed by the page allocator */ |
| 268 | unsigned long pages_min, pages_low, pages_high; | 281 | unsigned long pages_min, pages_low, pages_high; |
| @@ -315,16 +328,7 @@ struct zone { | |||
| 315 | unsigned long nr_scan; | 328 | unsigned long nr_scan; |
| 316 | } lru[NR_LRU_LISTS]; | 329 | } lru[NR_LRU_LISTS]; |
| 317 | 330 | ||
| 318 | /* | 331 | struct zone_reclaim_stat reclaim_stat; |
| 319 | * The pageout code in vmscan.c keeps track of how many of the | ||
| 320 | * mem/swap backed and file backed pages are refeferenced. | ||
| 321 | * The higher the rotated/scanned ratio, the more valuable | ||
| 322 | * that cache is. | ||
| 323 | * | ||
| 324 | * The anon LRU stats live in [0], file LRU stats in [1] | ||
| 325 | */ | ||
| 326 | unsigned long recent_rotated[2]; | ||
| 327 | unsigned long recent_scanned[2]; | ||
| 328 | 332 | ||
| 329 | unsigned long pages_scanned; /* since last reclaim */ | 333 | unsigned long pages_scanned; /* since last reclaim */ |
| 330 | unsigned long flags; /* zone flags, see below */ | 334 | unsigned long flags; /* zone flags, see below */ |
diff --git a/include/linux/module.h b/include/linux/module.h index 3bfed013350b..4f7ea12463d3 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
| @@ -294,9 +294,6 @@ struct module | |||
| 294 | /* The size of the executable code in each section. */ | 294 | /* The size of the executable code in each section. */ |
| 295 | unsigned int init_text_size, core_text_size; | 295 | unsigned int init_text_size, core_text_size; |
| 296 | 296 | ||
| 297 | /* The handle returned from unwind_add_table. */ | ||
| 298 | void *unwind_info; | ||
| 299 | |||
| 300 | /* Arch-specific module values */ | 297 | /* Arch-specific module values */ |
| 301 | struct mod_arch_specific arch; | 298 | struct mod_arch_specific arch; |
| 302 | 299 | ||
| @@ -368,6 +365,18 @@ struct module *module_text_address(unsigned long addr); | |||
| 368 | struct module *__module_text_address(unsigned long addr); | 365 | struct module *__module_text_address(unsigned long addr); |
| 369 | int is_module_address(unsigned long addr); | 366 | int is_module_address(unsigned long addr); |
| 370 | 367 | ||
| 368 | static inline int within_module_core(unsigned long addr, struct module *mod) | ||
| 369 | { | ||
| 370 | return (unsigned long)mod->module_core <= addr && | ||
| 371 | addr < (unsigned long)mod->module_core + mod->core_size; | ||
| 372 | } | ||
| 373 | |||
| 374 | static inline int within_module_init(unsigned long addr, struct module *mod) | ||
| 375 | { | ||
| 376 | return (unsigned long)mod->module_init <= addr && | ||
| 377 | addr < (unsigned long)mod->module_init + mod->init_size; | ||
| 378 | } | ||
| 379 | |||
| 371 | /* Returns 0 and fills in value, defined and namebuf, or -ERANGE if | 380 | /* Returns 0 and fills in value, defined and namebuf, or -ERANGE if |
| 372 | symnum out of range. */ | 381 | symnum out of range. */ |
| 373 | int module_get_kallsym(unsigned int symnum, unsigned long *value, char *type, | 382 | int module_get_kallsym(unsigned int symnum, unsigned long *value, char *type, |
diff --git a/include/linux/mtd/cfi.h b/include/linux/mtd/cfi.h index 00e2b575021f..88d3d8fbf9f2 100644 --- a/include/linux/mtd/cfi.h +++ b/include/linux/mtd/cfi.h | |||
| @@ -520,6 +520,7 @@ struct cfi_fixup { | |||
| 520 | 520 | ||
| 521 | #define CFI_MFR_AMD 0x0001 | 521 | #define CFI_MFR_AMD 0x0001 |
| 522 | #define CFI_MFR_ATMEL 0x001F | 522 | #define CFI_MFR_ATMEL 0x001F |
| 523 | #define CFI_MFR_SAMSUNG 0x00EC | ||
| 523 | #define CFI_MFR_ST 0x0020 /* STMicroelectronics */ | 524 | #define CFI_MFR_ST 0x0020 /* STMicroelectronics */ |
| 524 | 525 | ||
| 525 | void cfi_fixup(struct mtd_info *mtd, struct cfi_fixup* fixups); | 526 | void cfi_fixup(struct mtd_info *mtd, struct cfi_fixup* fixups); |
diff --git a/include/linux/mtd/concat.h b/include/linux/mtd/concat.h index c02f3d264ecf..e80c674daeb3 100644 --- a/include/linux/mtd/concat.h +++ b/include/linux/mtd/concat.h | |||
| @@ -13,7 +13,7 @@ | |||
| 13 | struct mtd_info *mtd_concat_create( | 13 | struct mtd_info *mtd_concat_create( |
| 14 | struct mtd_info *subdev[], /* subdevices to concatenate */ | 14 | struct mtd_info *subdev[], /* subdevices to concatenate */ |
| 15 | int num_devs, /* number of subdevices */ | 15 | int num_devs, /* number of subdevices */ |
| 16 | char *name); /* name for the new device */ | 16 | const char *name); /* name for the new device */ |
| 17 | 17 | ||
| 18 | void mtd_concat_destroy(struct mtd_info *mtd); | 18 | void mtd_concat_destroy(struct mtd_info *mtd); |
| 19 | 19 | ||
diff --git a/include/linux/mtd/ftl.h b/include/linux/mtd/ftl.h index 0be442f881dd..0555f7a0b9ed 100644 --- a/include/linux/mtd/ftl.h +++ b/include/linux/mtd/ftl.h | |||
| @@ -32,25 +32,25 @@ | |||
| 32 | #define _LINUX_FTL_H | 32 | #define _LINUX_FTL_H |
| 33 | 33 | ||
| 34 | typedef struct erase_unit_header_t { | 34 | typedef struct erase_unit_header_t { |
| 35 | u_int8_t LinkTargetTuple[5]; | 35 | uint8_t LinkTargetTuple[5]; |
| 36 | u_int8_t DataOrgTuple[10]; | 36 | uint8_t DataOrgTuple[10]; |
| 37 | u_int8_t NumTransferUnits; | 37 | uint8_t NumTransferUnits; |
| 38 | u_int32_t EraseCount; | 38 | uint32_t EraseCount; |
| 39 | u_int16_t LogicalEUN; | 39 | uint16_t LogicalEUN; |
| 40 | u_int8_t BlockSize; | 40 | uint8_t BlockSize; |
| 41 | u_int8_t EraseUnitSize; | 41 | uint8_t EraseUnitSize; |
| 42 | u_int16_t FirstPhysicalEUN; | 42 | uint16_t FirstPhysicalEUN; |
| 43 | u_int16_t NumEraseUnits; | 43 | uint16_t NumEraseUnits; |
| 44 | u_int32_t FormattedSize; | 44 | uint32_t FormattedSize; |
| 45 | u_int32_t FirstVMAddress; | 45 | uint32_t FirstVMAddress; |
| 46 | u_int16_t NumVMPages; | 46 | uint16_t NumVMPages; |
| 47 | u_int8_t Flags; | 47 | uint8_t Flags; |
| 48 | u_int8_t Code; | 48 | uint8_t Code; |
| 49 | u_int32_t SerialNumber; | 49 | uint32_t SerialNumber; |
| 50 | u_int32_t AltEUHOffset; | 50 | uint32_t AltEUHOffset; |
| 51 | u_int32_t BAMOffset; | 51 | uint32_t BAMOffset; |
| 52 | u_int8_t Reserved[12]; | 52 | uint8_t Reserved[12]; |
| 53 | u_int8_t EndTuple[2]; | 53 | uint8_t EndTuple[2]; |
| 54 | } erase_unit_header_t; | 54 | } erase_unit_header_t; |
| 55 | 55 | ||
| 56 | /* Flags in erase_unit_header_t */ | 56 | /* Flags in erase_unit_header_t */ |
diff --git a/include/linux/mtd/map.h b/include/linux/mtd/map.h index aa30244492c6..b981b8772217 100644 --- a/include/linux/mtd/map.h +++ b/include/linux/mtd/map.h | |||
| @@ -223,6 +223,7 @@ struct map_info { | |||
| 223 | must leave it enabled. */ | 223 | must leave it enabled. */ |
| 224 | void (*set_vpp)(struct map_info *, int); | 224 | void (*set_vpp)(struct map_info *, int); |
| 225 | 225 | ||
| 226 | unsigned long pfow_base; | ||
| 226 | unsigned long map_priv_1; | 227 | unsigned long map_priv_1; |
| 227 | unsigned long map_priv_2; | 228 | unsigned long map_priv_2; |
| 228 | void *fldrv_priv; | 229 | void *fldrv_priv; |
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index eae26bb6430a..3aa5d77c2cdb 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h | |||
| @@ -15,6 +15,8 @@ | |||
| 15 | #include <linux/mtd/compatmac.h> | 15 | #include <linux/mtd/compatmac.h> |
| 16 | #include <mtd/mtd-abi.h> | 16 | #include <mtd/mtd-abi.h> |
| 17 | 17 | ||
| 18 | #include <asm/div64.h> | ||
| 19 | |||
| 18 | #define MTD_CHAR_MAJOR 90 | 20 | #define MTD_CHAR_MAJOR 90 |
| 19 | #define MTD_BLOCK_MAJOR 31 | 21 | #define MTD_BLOCK_MAJOR 31 |
| 20 | #define MAX_MTD_DEVICES 32 | 22 | #define MAX_MTD_DEVICES 32 |
| @@ -25,20 +27,20 @@ | |||
| 25 | #define MTD_ERASE_DONE 0x08 | 27 | #define MTD_ERASE_DONE 0x08 |
| 26 | #define MTD_ERASE_FAILED 0x10 | 28 | #define MTD_ERASE_FAILED 0x10 |
| 27 | 29 | ||
| 28 | #define MTD_FAIL_ADDR_UNKNOWN 0xffffffff | 30 | #define MTD_FAIL_ADDR_UNKNOWN -1LL |
| 29 | 31 | ||
| 30 | /* If the erase fails, fail_addr might indicate exactly which block failed. If | 32 | /* If the erase fails, fail_addr might indicate exactly which block failed. If |
| 31 | fail_addr = MTD_FAIL_ADDR_UNKNOWN, the failure was not at the device level or was not | 33 | fail_addr = MTD_FAIL_ADDR_UNKNOWN, the failure was not at the device level or was not |
| 32 | specific to any particular block. */ | 34 | specific to any particular block. */ |
| 33 | struct erase_info { | 35 | struct erase_info { |
| 34 | struct mtd_info *mtd; | 36 | struct mtd_info *mtd; |
| 35 | u_int32_t addr; | 37 | uint64_t addr; |
| 36 | u_int32_t len; | 38 | uint64_t len; |
| 37 | u_int32_t fail_addr; | 39 | uint64_t fail_addr; |
| 38 | u_long time; | 40 | u_long time; |
| 39 | u_long retries; | 41 | u_long retries; |
| 40 | u_int dev; | 42 | unsigned dev; |
| 41 | u_int cell; | 43 | unsigned cell; |
| 42 | void (*callback) (struct erase_info *self); | 44 | void (*callback) (struct erase_info *self); |
| 43 | u_long priv; | 45 | u_long priv; |
| 44 | u_char state; | 46 | u_char state; |
| @@ -46,9 +48,9 @@ struct erase_info { | |||
| 46 | }; | 48 | }; |
| 47 | 49 | ||
| 48 | struct mtd_erase_region_info { | 50 | struct mtd_erase_region_info { |
| 49 | u_int32_t offset; /* At which this region starts, from the beginning of the MTD */ | 51 | uint64_t offset; /* At which this region starts, from the beginning of the MTD */ |
| 50 | u_int32_t erasesize; /* For this region */ | 52 | uint32_t erasesize; /* For this region */ |
| 51 | u_int32_t numblocks; /* Number of blocks of erasesize in this region */ | 53 | uint32_t numblocks; /* Number of blocks of erasesize in this region */ |
| 52 | unsigned long *lockmap; /* If keeping bitmap of locks */ | 54 | unsigned long *lockmap; /* If keeping bitmap of locks */ |
| 53 | }; | 55 | }; |
| 54 | 56 | ||
| @@ -83,7 +85,7 @@ typedef enum { | |||
| 83 | * @datbuf: data buffer - if NULL only oob data are read/written | 85 | * @datbuf: data buffer - if NULL only oob data are read/written |
| 84 | * @oobbuf: oob data buffer | 86 | * @oobbuf: oob data buffer |
| 85 | * | 87 | * |
| 86 | * Note, it is allowed to read more then one OOB area at one go, but not write. | 88 | * Note, it is allowed to read more than one OOB area at one go, but not write. |
| 87 | * The interface assumes that the OOB write requests program only one page's | 89 | * The interface assumes that the OOB write requests program only one page's |
| 88 | * OOB area. | 90 | * OOB area. |
| 89 | */ | 91 | */ |
| @@ -100,14 +102,14 @@ struct mtd_oob_ops { | |||
| 100 | 102 | ||
| 101 | struct mtd_info { | 103 | struct mtd_info { |
| 102 | u_char type; | 104 | u_char type; |
| 103 | u_int32_t flags; | 105 | uint32_t flags; |
| 104 | u_int32_t size; // Total size of the MTD | 106 | uint64_t size; // Total size of the MTD |
| 105 | 107 | ||
| 106 | /* "Major" erase size for the device. Naïve users may take this | 108 | /* "Major" erase size for the device. Naïve users may take this |
| 107 | * to be the only erase size available, or may use the more detailed | 109 | * to be the only erase size available, or may use the more detailed |
| 108 | * information below if they desire | 110 | * information below if they desire |
| 109 | */ | 111 | */ |
| 110 | u_int32_t erasesize; | 112 | uint32_t erasesize; |
| 111 | /* Minimal writable flash unit size. In case of NOR flash it is 1 (even | 113 | /* Minimal writable flash unit size. In case of NOR flash it is 1 (even |
| 112 | * though individual bits can be cleared), in case of NAND flash it is | 114 | * though individual bits can be cleared), in case of NAND flash it is |
| 113 | * one NAND page (or half, or one-fourths of it), in case of ECC-ed NOR | 115 | * one NAND page (or half, or one-fourths of it), in case of ECC-ed NOR |
| @@ -115,10 +117,20 @@ struct mtd_info { | |||
| 115 | * Any driver registering a struct mtd_info must ensure a writesize of | 117 | * Any driver registering a struct mtd_info must ensure a writesize of |
| 116 | * 1 or larger. | 118 | * 1 or larger. |
| 117 | */ | 119 | */ |
| 118 | u_int32_t writesize; | 120 | uint32_t writesize; |
| 121 | |||
| 122 | uint32_t oobsize; // Amount of OOB data per block (e.g. 16) | ||
| 123 | uint32_t oobavail; // Available OOB bytes per block | ||
| 119 | 124 | ||
| 120 | u_int32_t oobsize; // Amount of OOB data per block (e.g. 16) | 125 | /* |
| 121 | u_int32_t oobavail; // Available OOB bytes per block | 126 | * If erasesize is a power of 2 then the shift is stored in |
| 127 | * erasesize_shift otherwise erasesize_shift is zero. Ditto writesize. | ||
| 128 | */ | ||
| 129 | unsigned int erasesize_shift; | ||
| 130 | unsigned int writesize_shift; | ||
| 131 | /* Masks based on erasesize_shift and writesize_shift */ | ||
| 132 | unsigned int erasesize_mask; | ||
| 133 | unsigned int writesize_mask; | ||
| 122 | 134 | ||
| 123 | // Kernel-only stuff starts here. | 135 | // Kernel-only stuff starts here. |
| 124 | const char *name; | 136 | const char *name; |
| @@ -190,8 +202,8 @@ struct mtd_info { | |||
| 190 | void (*sync) (struct mtd_info *mtd); | 202 | void (*sync) (struct mtd_info *mtd); |
| 191 | 203 | ||
| 192 | /* Chip-supported device locking */ | 204 | /* Chip-supported device locking */ |
| 193 | int (*lock) (struct mtd_info *mtd, loff_t ofs, size_t len); | 205 | int (*lock) (struct mtd_info *mtd, loff_t ofs, uint64_t len); |
| 194 | int (*unlock) (struct mtd_info *mtd, loff_t ofs, size_t len); | 206 | int (*unlock) (struct mtd_info *mtd, loff_t ofs, uint64_t len); |
| 195 | 207 | ||
| 196 | /* Power Management functions */ | 208 | /* Power Management functions */ |
| 197 | int (*suspend) (struct mtd_info *mtd); | 209 | int (*suspend) (struct mtd_info *mtd); |
| @@ -221,6 +233,35 @@ struct mtd_info { | |||
| 221 | void (*put_device) (struct mtd_info *mtd); | 233 | void (*put_device) (struct mtd_info *mtd); |
| 222 | }; | 234 | }; |
| 223 | 235 | ||
| 236 | static inline uint32_t mtd_div_by_eb(uint64_t sz, struct mtd_info *mtd) | ||
| 237 | { | ||
| 238 | if (mtd->erasesize_shift) | ||
| 239 | return sz >> mtd->erasesize_shift; | ||
| 240 | do_div(sz, mtd->erasesize); | ||
| 241 | return sz; | ||
| 242 | } | ||
| 243 | |||
| 244 | static inline uint32_t mtd_mod_by_eb(uint64_t sz, struct mtd_info *mtd) | ||
| 245 | { | ||
| 246 | if (mtd->erasesize_shift) | ||
| 247 | return sz & mtd->erasesize_mask; | ||
| 248 | return do_div(sz, mtd->erasesize); | ||
| 249 | } | ||
| 250 | |||
| 251 | static inline uint32_t mtd_div_by_ws(uint64_t sz, struct mtd_info *mtd) | ||
| 252 | { | ||
| 253 | if (mtd->writesize_shift) | ||
| 254 | return sz >> mtd->writesize_shift; | ||
| 255 | do_div(sz, mtd->writesize); | ||
| 256 | return sz; | ||
| 257 | } | ||
| 258 | |||
| 259 | static inline uint32_t mtd_mod_by_ws(uint64_t sz, struct mtd_info *mtd) | ||
| 260 | { | ||
| 261 | if (mtd->writesize_shift) | ||
| 262 | return sz & mtd->writesize_mask; | ||
| 263 | return do_div(sz, mtd->writesize); | ||
| 264 | } | ||
| 224 | 265 | ||
| 225 | /* Kernel-side ioctl definitions */ | 266 | /* Kernel-side ioctl definitions */ |
| 226 | 267 | ||
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index 733d3f3b4eb8..db5b63da2a7e 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h | |||
| @@ -335,17 +335,12 @@ struct nand_buffers { | |||
| 335 | * @erase_cmd: [INTERN] erase command write function, selectable due to AND support | 335 | * @erase_cmd: [INTERN] erase command write function, selectable due to AND support |
| 336 | * @scan_bbt: [REPLACEABLE] function to scan bad block table | 336 | * @scan_bbt: [REPLACEABLE] function to scan bad block table |
| 337 | * @chip_delay: [BOARDSPECIFIC] chip dependent delay for transfering data from array to read regs (tR) | 337 | * @chip_delay: [BOARDSPECIFIC] chip dependent delay for transfering data from array to read regs (tR) |
| 338 | * @wq: [INTERN] wait queue to sleep on if a NAND operation is in progress | ||
| 339 | * @state: [INTERN] the current state of the NAND device | 338 | * @state: [INTERN] the current state of the NAND device |
| 340 | * @oob_poi: poison value buffer | 339 | * @oob_poi: poison value buffer |
| 341 | * @page_shift: [INTERN] number of address bits in a page (column address bits) | 340 | * @page_shift: [INTERN] number of address bits in a page (column address bits) |
| 342 | * @phys_erase_shift: [INTERN] number of address bits in a physical eraseblock | 341 | * @phys_erase_shift: [INTERN] number of address bits in a physical eraseblock |
| 343 | * @bbt_erase_shift: [INTERN] number of address bits in a bbt entry | 342 | * @bbt_erase_shift: [INTERN] number of address bits in a bbt entry |
| 344 | * @chip_shift: [INTERN] number of address bits in one chip | 343 | * @chip_shift: [INTERN] number of address bits in one chip |
| 345 | * @datbuf: [INTERN] internal buffer for one page + oob | ||
| 346 | * @oobbuf: [INTERN] oob buffer for one eraseblock | ||
| 347 | * @oobdirty: [INTERN] indicates that oob_buf must be reinitialized | ||
| 348 | * @data_poi: [INTERN] pointer to a data buffer | ||
| 349 | * @options: [BOARDSPECIFIC] various chip options. They can partly be set to inform nand_scan about | 344 | * @options: [BOARDSPECIFIC] various chip options. They can partly be set to inform nand_scan about |
| 350 | * special functionality. See the defines for further explanation | 345 | * special functionality. See the defines for further explanation |
| 351 | * @badblockpos: [INTERN] position of the bad block marker in the oob area | 346 | * @badblockpos: [INTERN] position of the bad block marker in the oob area |
| @@ -399,7 +394,7 @@ struct nand_chip { | |||
| 399 | int bbt_erase_shift; | 394 | int bbt_erase_shift; |
| 400 | int chip_shift; | 395 | int chip_shift; |
| 401 | int numchips; | 396 | int numchips; |
| 402 | unsigned long chipsize; | 397 | uint64_t chipsize; |
| 403 | int pagemask; | 398 | int pagemask; |
| 404 | int pagebuf; | 399 | int pagebuf; |
| 405 | int subpagesize; | 400 | int subpagesize; |
diff --git a/include/linux/mtd/partitions.h b/include/linux/mtd/partitions.h index c92b4d439609..a45dd831b3f8 100644 --- a/include/linux/mtd/partitions.h +++ b/include/linux/mtd/partitions.h | |||
| @@ -36,9 +36,9 @@ | |||
| 36 | 36 | ||
| 37 | struct mtd_partition { | 37 | struct mtd_partition { |
| 38 | char *name; /* identifier string */ | 38 | char *name; /* identifier string */ |
| 39 | u_int32_t size; /* partition size */ | 39 | uint64_t size; /* partition size */ |
| 40 | u_int32_t offset; /* offset within the master MTD space */ | 40 | uint64_t offset; /* offset within the master MTD space */ |
| 41 | u_int32_t mask_flags; /* master MTD flags to mask out for this partition */ | 41 | uint32_t mask_flags; /* master MTD flags to mask out for this partition */ |
| 42 | struct nand_ecclayout *ecclayout; /* out of band layout for this partition (NAND only)*/ | 42 | struct nand_ecclayout *ecclayout; /* out of band layout for this partition (NAND only)*/ |
| 43 | struct mtd_info **mtdp; /* pointer to store the MTD object */ | 43 | struct mtd_info **mtdp; /* pointer to store the MTD object */ |
| 44 | }; | 44 | }; |
diff --git a/include/linux/mtd/pfow.h b/include/linux/mtd/pfow.h new file mode 100644 index 000000000000..b730d4f84655 --- /dev/null +++ b/include/linux/mtd/pfow.h | |||
| @@ -0,0 +1,159 @@ | |||
| 1 | /* Primary function overlay window definitions | ||
| 2 | * and service functions used by LPDDR chips | ||
| 3 | */ | ||
| 4 | #ifndef __LINUX_MTD_PFOW_H | ||
| 5 | #define __LINUX_MTD_PFOW_H | ||
| 6 | |||
| 7 | #include <linux/mtd/qinfo.h> | ||
| 8 | |||
| 9 | /* PFOW registers addressing */ | ||
| 10 | /* Address of symbol "P" */ | ||
| 11 | #define PFOW_QUERY_STRING_P 0x0000 | ||
| 12 | /* Address of symbol "F" */ | ||
| 13 | #define PFOW_QUERY_STRING_F 0x0002 | ||
| 14 | /* Address of symbol "O" */ | ||
| 15 | #define PFOW_QUERY_STRING_O 0x0004 | ||
| 16 | /* Address of symbol "W" */ | ||
| 17 | #define PFOW_QUERY_STRING_W 0x0006 | ||
| 18 | /* Identification info for LPDDR chip */ | ||
| 19 | #define PFOW_MANUFACTURER_ID 0x0020 | ||
| 20 | #define PFOW_DEVICE_ID 0x0022 | ||
| 21 | /* Address in PFOW where prog buffer can can be found */ | ||
| 22 | #define PFOW_PROGRAM_BUFFER_OFFSET 0x0040 | ||
| 23 | /* Size of program buffer in words */ | ||
| 24 | #define PFOW_PROGRAM_BUFFER_SIZE 0x0042 | ||
| 25 | /* Address command code register */ | ||
| 26 | #define PFOW_COMMAND_CODE 0x0080 | ||
| 27 | /* command data register */ | ||
| 28 | #define PFOW_COMMAND_DATA 0x0084 | ||
| 29 | /* command address register lower address bits */ | ||
| 30 | #define PFOW_COMMAND_ADDRESS_L 0x0088 | ||
| 31 | /* command address register upper address bits */ | ||
| 32 | #define PFOW_COMMAND_ADDRESS_H 0x008a | ||
| 33 | /* number of bytes to be proggrammed lower address bits */ | ||
| 34 | #define PFOW_DATA_COUNT_L 0x0090 | ||
| 35 | /* number of bytes to be proggrammed higher address bits */ | ||
| 36 | #define PFOW_DATA_COUNT_H 0x0092 | ||
| 37 | /* command execution register, the only possible value is 0x01 */ | ||
| 38 | #define PFOW_COMMAND_EXECUTE 0x00c0 | ||
| 39 | /* 0x01 should be written at this address to clear buffer */ | ||
| 40 | #define PFOW_CLEAR_PROGRAM_BUFFER 0x00c4 | ||
| 41 | /* device program/erase suspend register */ | ||
| 42 | #define PFOW_PROGRAM_ERASE_SUSPEND 0x00c8 | ||
| 43 | /* device status register */ | ||
| 44 | #define PFOW_DSR 0x00cc | ||
| 45 | |||
| 46 | /* LPDDR memory device command codes */ | ||
| 47 | /* They are possible values of PFOW command code register */ | ||
| 48 | #define LPDDR_WORD_PROGRAM 0x0041 | ||
| 49 | #define LPDDR_BUFF_PROGRAM 0x00E9 | ||
| 50 | #define LPDDR_BLOCK_ERASE 0x0020 | ||
| 51 | #define LPDDR_LOCK_BLOCK 0x0061 | ||
| 52 | #define LPDDR_UNLOCK_BLOCK 0x0062 | ||
| 53 | #define LPDDR_READ_BLOCK_LOCK_STATUS 0x0065 | ||
| 54 | #define LPDDR_INFO_QUERY 0x0098 | ||
| 55 | #define LPDDR_READ_OTP 0x0097 | ||
| 56 | #define LPDDR_PROG_OTP 0x00C0 | ||
| 57 | #define LPDDR_RESUME 0x00D0 | ||
| 58 | |||
| 59 | /* Defines possible value of PFOW command execution register */ | ||
| 60 | #define LPDDR_START_EXECUTION 0x0001 | ||
| 61 | |||
| 62 | /* Defines possible value of PFOW program/erase suspend register */ | ||
| 63 | #define LPDDR_SUSPEND 0x0001 | ||
| 64 | |||
| 65 | /* Possible values of PFOW device status register */ | ||
| 66 | /* access R - read; RC read & clearable */ | ||
| 67 | #define DSR_DPS (1<<1) /* RC; device protect status | ||
| 68 | * 0 - not protected 1 - locked */ | ||
| 69 | #define DSR_PSS (1<<2) /* R; program suspend status; | ||
| 70 | * 0-prog in progress/completed, | ||
| 71 | * 1- prog suspended */ | ||
| 72 | #define DSR_VPPS (1<<3) /* RC; 0-Vpp OK, * 1-Vpp low */ | ||
| 73 | #define DSR_PROGRAM_STATUS (1<<4) /* RC; 0-successful, 1-error */ | ||
| 74 | #define DSR_ERASE_STATUS (1<<5) /* RC; erase or blank check status; | ||
| 75 | * 0-success erase/blank check, | ||
| 76 | * 1 blank check error */ | ||
| 77 | #define DSR_ESS (1<<6) /* R; erase suspend status; | ||
| 78 | * 0-erase in progress/complete, | ||
| 79 | * 1 erase suspended */ | ||
| 80 | #define DSR_READY_STATUS (1<<7) /* R; Device status | ||
| 81 | * 0-busy, | ||
| 82 | * 1-ready */ | ||
| 83 | #define DSR_RPS (0x3<<8) /* RC; region program status | ||
| 84 | * 00 - Success, | ||
| 85 | * 01-re-program attempt in region with | ||
| 86 | * object mode data, | ||
| 87 | * 10-object mode program w attempt in | ||
| 88 | * region with control mode data | ||
| 89 | * 11-attempt to program invalid half | ||
| 90 | * with 0x41 command */ | ||
| 91 | #define DSR_AOS (1<<12) /* RC; 1- AO related failure */ | ||
| 92 | #define DSR_AVAILABLE (1<<15) /* R; Device availbility | ||
| 93 | * 1 - Device available | ||
| 94 | * 0 - not available */ | ||
| 95 | |||
| 96 | /* The superset of all possible error bits in DSR */ | ||
| 97 | #define DSR_ERR 0x133A | ||
| 98 | |||
| 99 | static inline void send_pfow_command(struct map_info *map, | ||
| 100 | unsigned long cmd_code, unsigned long adr, | ||
| 101 | unsigned long len, map_word *datum) | ||
| 102 | { | ||
| 103 | int bits_per_chip = map_bankwidth(map) * 8; | ||
| 104 | int chipnum; | ||
| 105 | struct lpddr_private *lpddr = map->fldrv_priv; | ||
| 106 | chipnum = adr >> lpddr->chipshift; | ||
| 107 | |||
| 108 | map_write(map, CMD(cmd_code), map->pfow_base + PFOW_COMMAND_CODE); | ||
| 109 | map_write(map, CMD(adr & ((1<<bits_per_chip) - 1)), | ||
| 110 | map->pfow_base + PFOW_COMMAND_ADDRESS_L); | ||
| 111 | map_write(map, CMD(adr>>bits_per_chip), | ||
| 112 | map->pfow_base + PFOW_COMMAND_ADDRESS_H); | ||
| 113 | if (len) { | ||
| 114 | map_write(map, CMD(len & ((1<<bits_per_chip) - 1)), | ||
| 115 | map->pfow_base + PFOW_DATA_COUNT_L); | ||
| 116 | map_write(map, CMD(len>>bits_per_chip), | ||
| 117 | map->pfow_base + PFOW_DATA_COUNT_H); | ||
| 118 | } | ||
| 119 | if (datum) | ||
| 120 | map_write(map, *datum, map->pfow_base + PFOW_COMMAND_DATA); | ||
| 121 | |||
| 122 | /* Command execution start */ | ||
| 123 | map_write(map, CMD(LPDDR_START_EXECUTION), | ||
| 124 | map->pfow_base + PFOW_COMMAND_EXECUTE); | ||
| 125 | } | ||
| 126 | |||
| 127 | static inline void print_drs_error(unsigned dsr) | ||
| 128 | { | ||
| 129 | int prog_status = (dsr & DSR_RPS) >> 8; | ||
| 130 | |||
| 131 | if (!(dsr & DSR_AVAILABLE)) | ||
| 132 | printk(KERN_NOTICE"DSR.15: (0) Device not Available\n"); | ||
| 133 | if (prog_status & 0x03) | ||
| 134 | printk(KERN_NOTICE"DSR.9,8: (11) Attempt to program invalid " | ||
| 135 | "half with 41h command\n"); | ||
| 136 | else if (prog_status & 0x02) | ||
| 137 | printk(KERN_NOTICE"DSR.9,8: (10) Object Mode Program attempt " | ||
| 138 | "in region with Control Mode data\n"); | ||
| 139 | else if (prog_status & 0x01) | ||
| 140 | printk(KERN_NOTICE"DSR.9,8: (01) Program attempt in region " | ||
| 141 | "with Object Mode data\n"); | ||
| 142 | if (!(dsr & DSR_READY_STATUS)) | ||
| 143 | printk(KERN_NOTICE"DSR.7: (0) Device is Busy\n"); | ||
| 144 | if (dsr & DSR_ESS) | ||
| 145 | printk(KERN_NOTICE"DSR.6: (1) Erase Suspended\n"); | ||
| 146 | if (dsr & DSR_ERASE_STATUS) | ||
| 147 | printk(KERN_NOTICE"DSR.5: (1) Erase/Blank check error\n"); | ||
| 148 | if (dsr & DSR_PROGRAM_STATUS) | ||
| 149 | printk(KERN_NOTICE"DSR.4: (1) Program Error\n"); | ||
| 150 | if (dsr & DSR_VPPS) | ||
| 151 | printk(KERN_NOTICE"DSR.3: (1) Vpp low detect, operation " | ||
| 152 | "aborted\n"); | ||
| 153 | if (dsr & DSR_PSS) | ||
| 154 | printk(KERN_NOTICE"DSR.2: (1) Program suspended\n"); | ||
| 155 | if (dsr & DSR_DPS) | ||
| 156 | printk(KERN_NOTICE"DSR.1: (1) Aborted Erase/Program attempt " | ||
| 157 | "on locked block\n"); | ||
| 158 | } | ||
| 159 | #endif /* __LINUX_MTD_PFOW_H */ | ||
diff --git a/include/linux/mtd/physmap.h b/include/linux/mtd/physmap.h index c8e63a5ee72e..76f7cabf07d3 100644 --- a/include/linux/mtd/physmap.h +++ b/include/linux/mtd/physmap.h | |||
| @@ -24,6 +24,7 @@ struct physmap_flash_data { | |||
| 24 | unsigned int width; | 24 | unsigned int width; |
| 25 | void (*set_vpp)(struct map_info *, int); | 25 | void (*set_vpp)(struct map_info *, int); |
| 26 | unsigned int nr_parts; | 26 | unsigned int nr_parts; |
| 27 | unsigned int pfow_base; | ||
| 27 | struct mtd_partition *parts; | 28 | struct mtd_partition *parts; |
| 28 | }; | 29 | }; |
| 29 | 30 | ||
diff --git a/include/linux/mtd/qinfo.h b/include/linux/mtd/qinfo.h new file mode 100644 index 000000000000..7b3d487d8b3f --- /dev/null +++ b/include/linux/mtd/qinfo.h | |||
| @@ -0,0 +1,91 @@ | |||
| 1 | #ifndef __LINUX_MTD_QINFO_H | ||
| 2 | #define __LINUX_MTD_QINFO_H | ||
| 3 | |||
| 4 | #include <linux/mtd/map.h> | ||
| 5 | #include <linux/wait.h> | ||
| 6 | #include <linux/spinlock.h> | ||
| 7 | #include <linux/delay.h> | ||
| 8 | #include <linux/mtd/mtd.h> | ||
| 9 | #include <linux/mtd/flashchip.h> | ||
| 10 | #include <linux/mtd/partitions.h> | ||
| 11 | |||
| 12 | /* lpddr_private describes lpddr flash chip in memory map | ||
| 13 | * @ManufactId - Chip Manufacture ID | ||
| 14 | * @DevId - Chip Device ID | ||
| 15 | * @qinfo - pointer to qinfo records describing the chip | ||
| 16 | * @numchips - number of chips including virual RWW partitions | ||
| 17 | * @chipshift - Chip/partiton size 2^chipshift | ||
| 18 | * @chips - per-chip data structure | ||
| 19 | */ | ||
| 20 | struct lpddr_private { | ||
| 21 | uint16_t ManufactId; | ||
| 22 | uint16_t DevId; | ||
| 23 | struct qinfo_chip *qinfo; | ||
| 24 | int numchips; | ||
| 25 | unsigned long chipshift; | ||
| 26 | struct flchip chips[0]; | ||
| 27 | }; | ||
| 28 | |||
| 29 | /* qinfo_query_info structure contains request information for | ||
| 30 | * each qinfo record | ||
| 31 | * @major - major number of qinfo record | ||
| 32 | * @major - minor number of qinfo record | ||
| 33 | * @id_str - descriptive string to access the record | ||
| 34 | * @desc - detailed description for the qinfo record | ||
| 35 | */ | ||
| 36 | struct qinfo_query_info { | ||
| 37 | uint8_t major; | ||
| 38 | uint8_t minor; | ||
| 39 | char *id_str; | ||
| 40 | char *desc; | ||
| 41 | }; | ||
| 42 | |||
| 43 | /* | ||
| 44 | * qinfo_chip structure contains necessary qinfo records data | ||
| 45 | * @DevSizeShift - Device size 2^n bytes | ||
| 46 | * @BufSizeShift - Program buffer size 2^n bytes | ||
| 47 | * @TotalBlocksNum - Total number of blocks | ||
| 48 | * @UniformBlockSizeShift - Uniform block size 2^UniformBlockSizeShift bytes | ||
| 49 | * @HWPartsNum - Number of hardware partitions | ||
| 50 | * @SuspEraseSupp - Suspend erase supported | ||
| 51 | * @SingleWordProgTime - Single word program 2^SingleWordProgTime u-sec | ||
| 52 | * @ProgBufferTime - Program buffer write 2^ProgBufferTime u-sec | ||
| 53 | * @BlockEraseTime - Block erase 2^BlockEraseTime m-sec | ||
| 54 | */ | ||
| 55 | struct qinfo_chip { | ||
| 56 | /* General device info */ | ||
| 57 | uint16_t DevSizeShift; | ||
| 58 | uint16_t BufSizeShift; | ||
| 59 | /* Erase block information */ | ||
| 60 | uint16_t TotalBlocksNum; | ||
| 61 | uint16_t UniformBlockSizeShift; | ||
| 62 | /* Partition information */ | ||
| 63 | uint16_t HWPartsNum; | ||
| 64 | /* Optional features */ | ||
| 65 | uint16_t SuspEraseSupp; | ||
| 66 | /* Operation typical time */ | ||
| 67 | uint16_t SingleWordProgTime; | ||
| 68 | uint16_t ProgBufferTime; | ||
| 69 | uint16_t BlockEraseTime; | ||
| 70 | }; | ||
| 71 | |||
| 72 | /* defines for fixup usage */ | ||
| 73 | #define LPDDR_MFR_ANY 0xffff | ||
| 74 | #define LPDDR_ID_ANY 0xffff | ||
| 75 | #define NUMONYX_MFGR_ID 0x0089 | ||
| 76 | #define R18_DEVICE_ID_1G 0x893c | ||
| 77 | |||
| 78 | static inline map_word lpddr_build_cmd(u_long cmd, struct map_info *map) | ||
| 79 | { | ||
| 80 | map_word val = { {0} }; | ||
| 81 | val.x[0] = cmd; | ||
| 82 | return val; | ||
| 83 | } | ||
| 84 | |||
| 85 | #define CMD(x) lpddr_build_cmd(x, map) | ||
| 86 | #define CMDVAL(cmd) cmd.x[0] | ||
| 87 | |||
| 88 | struct mtd_info *lpddr_cmdset(struct map_info *); | ||
| 89 | |||
| 90 | #endif | ||
| 91 | |||
diff --git a/include/linux/mtd/sharpsl.h b/include/linux/mtd/sharpsl.h new file mode 100644 index 000000000000..25f4d2a845c1 --- /dev/null +++ b/include/linux/mtd/sharpsl.h | |||
| @@ -0,0 +1,20 @@ | |||
| 1 | /* | ||
| 2 | * SharpSL NAND support | ||
| 3 | * | ||
| 4 | * Copyright (C) 2008 Dmitry Baryshkov | ||
| 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 | #include <linux/mtd/nand.h> | ||
| 12 | #include <linux/mtd/nand_ecc.h> | ||
| 13 | #include <linux/mtd/partitions.h> | ||
| 14 | |||
| 15 | struct sharpsl_nand_platform_data { | ||
| 16 | struct nand_bbt_descr *badblock_pattern; | ||
| 17 | struct nand_ecclayout *ecc_layout; | ||
| 18 | struct mtd_partition *partitions; | ||
| 19 | unsigned int nr_partitions; | ||
| 20 | }; | ||
diff --git a/include/linux/ncp_fs.h b/include/linux/ncp_fs.h index 9f2d76347f19..f69e66d151cc 100644 --- a/include/linux/ncp_fs.h +++ b/include/linux/ncp_fs.h | |||
| @@ -87,7 +87,7 @@ struct ncp_objectname_ioctl | |||
| 87 | #define NCP_AUTH_NDS 0x32 | 87 | #define NCP_AUTH_NDS 0x32 |
| 88 | int auth_type; | 88 | int auth_type; |
| 89 | size_t object_name_len; | 89 | size_t object_name_len; |
| 90 | void __user * object_name; /* an userspace data, in most cases user name */ | 90 | void __user * object_name; /* a userspace data, in most cases user name */ |
| 91 | }; | 91 | }; |
| 92 | 92 | ||
| 93 | struct ncp_privatedata_ioctl | 93 | struct ncp_privatedata_ioctl |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index c28bbba3c23d..f24556813375 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
| @@ -1125,9 +1125,6 @@ struct softnet_data | |||
| 1125 | struct sk_buff *completion_queue; | 1125 | struct sk_buff *completion_queue; |
| 1126 | 1126 | ||
| 1127 | struct napi_struct backlog; | 1127 | struct napi_struct backlog; |
| 1128 | #ifdef CONFIG_NET_DMA | ||
| 1129 | struct dma_chan *net_dma; | ||
| 1130 | #endif | ||
| 1131 | }; | 1128 | }; |
| 1132 | 1129 | ||
| 1133 | DECLARE_PER_CPU(struct softnet_data,softnet_data); | 1130 | DECLARE_PER_CPU(struct softnet_data,softnet_data); |
| @@ -1373,8 +1370,14 @@ extern int netif_rx_ni(struct sk_buff *skb); | |||
| 1373 | #define HAVE_NETIF_RECEIVE_SKB 1 | 1370 | #define HAVE_NETIF_RECEIVE_SKB 1 |
| 1374 | extern int netif_receive_skb(struct sk_buff *skb); | 1371 | extern int netif_receive_skb(struct sk_buff *skb); |
| 1375 | extern void napi_gro_flush(struct napi_struct *napi); | 1372 | extern void napi_gro_flush(struct napi_struct *napi); |
| 1373 | extern int dev_gro_receive(struct napi_struct *napi, | ||
| 1374 | struct sk_buff *skb); | ||
| 1376 | extern int napi_gro_receive(struct napi_struct *napi, | 1375 | extern int napi_gro_receive(struct napi_struct *napi, |
| 1377 | struct sk_buff *skb); | 1376 | struct sk_buff *skb); |
| 1377 | extern void napi_reuse_skb(struct napi_struct *napi, | ||
| 1378 | struct sk_buff *skb); | ||
| 1379 | extern struct sk_buff * napi_fraginfo_skb(struct napi_struct *napi, | ||
| 1380 | struct napi_gro_fraginfo *info); | ||
| 1378 | extern int napi_gro_frags(struct napi_struct *napi, | 1381 | extern int napi_gro_frags(struct napi_struct *napi, |
| 1379 | struct napi_gro_fraginfo *info); | 1382 | struct napi_gro_fraginfo *info); |
| 1380 | extern void netif_nit_deliver(struct sk_buff *skb); | 1383 | extern void netif_nit_deliver(struct sk_buff *skb); |
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index ea0366769484..b912311a56b1 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h | |||
| @@ -88,6 +88,8 @@ | |||
| 88 | #define NFS4_ACE_GENERIC_EXECUTE 0x001200A0 | 88 | #define NFS4_ACE_GENERIC_EXECUTE 0x001200A0 |
| 89 | #define NFS4_ACE_MASK_ALL 0x001F01FF | 89 | #define NFS4_ACE_MASK_ALL 0x001F01FF |
| 90 | 90 | ||
| 91 | #define NFS4_MAX_UINT64 (~(u64)0) | ||
| 92 | |||
| 91 | enum nfs4_acl_whotype { | 93 | enum nfs4_acl_whotype { |
| 92 | NFS4_ACL_WHO_NAMED = 0, | 94 | NFS4_ACL_WHO_NAMED = 0, |
| 93 | NFS4_ACL_WHO_OWNER, | 95 | NFS4_ACL_WHO_OWNER, |
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h index 21269405ffe2..e19f45991b2e 100644 --- a/include/linux/nfsd/nfsd.h +++ b/include/linux/nfsd/nfsd.h | |||
| @@ -23,7 +23,6 @@ | |||
| 23 | /* | 23 | /* |
| 24 | * nfsd version | 24 | * nfsd version |
| 25 | */ | 25 | */ |
| 26 | #define NFSD_VERSION "0.5" | ||
| 27 | #define NFSD_SUPPORTED_MINOR_VERSION 0 | 26 | #define NFSD_SUPPORTED_MINOR_VERSION 0 |
| 28 | 27 | ||
| 29 | /* | 28 | /* |
diff --git a/include/linux/nfsd/nfsfh.h b/include/linux/nfsd/nfsfh.h index d1941cb965e9..b2e093870bc6 100644 --- a/include/linux/nfsd/nfsfh.h +++ b/include/linux/nfsd/nfsfh.h | |||
| @@ -68,6 +68,10 @@ struct nfs_fhbase_old { | |||
| 68 | * 1 - 4 byte user specified identifier | 68 | * 1 - 4 byte user specified identifier |
| 69 | * 2 - 4 byte major, 4 byte minor, 4 byte inode number - DEPRECATED | 69 | * 2 - 4 byte major, 4 byte minor, 4 byte inode number - DEPRECATED |
| 70 | * 3 - 4 byte device id, encoded for user-space, 4 byte inode number | 70 | * 3 - 4 byte device id, encoded for user-space, 4 byte inode number |
| 71 | * 4 - 4 byte inode number and 4 byte uuid | ||
| 72 | * 5 - 8 byte uuid | ||
| 73 | * 6 - 16 byte uuid | ||
| 74 | * 7 - 8 byte inode number and 16 byte uuid | ||
| 71 | * | 75 | * |
| 72 | * The fileid_type identified how the file within the filesystem is encoded. | 76 | * The fileid_type identified how the file within the filesystem is encoded. |
| 73 | * This is (will be) passed to, and set by, the underlying filesystem if it supports | 77 | * This is (will be) passed to, and set by, the underlying filesystem if it supports |
diff --git a/include/linux/node.h b/include/linux/node.h index bc001bc225c3..681a697b9a86 100644 --- a/include/linux/node.h +++ b/include/linux/node.h | |||
| @@ -26,6 +26,7 @@ struct node { | |||
| 26 | struct sys_device sysdev; | 26 | struct sys_device sysdev; |
| 27 | }; | 27 | }; |
| 28 | 28 | ||
| 29 | struct memory_block; | ||
| 29 | extern struct node node_devices[]; | 30 | extern struct node node_devices[]; |
| 30 | 31 | ||
| 31 | extern int register_node(struct node *, int, struct node *); | 32 | extern int register_node(struct node *, int, struct node *); |
| @@ -35,6 +36,9 @@ extern int register_one_node(int nid); | |||
| 35 | extern void unregister_one_node(int nid); | 36 | extern void unregister_one_node(int nid); |
| 36 | extern int register_cpu_under_node(unsigned int cpu, unsigned int nid); | 37 | extern int register_cpu_under_node(unsigned int cpu, unsigned int nid); |
| 37 | extern int unregister_cpu_under_node(unsigned int cpu, unsigned int nid); | 38 | extern int unregister_cpu_under_node(unsigned int cpu, unsigned int nid); |
| 39 | extern int register_mem_sect_under_node(struct memory_block *mem_blk, | ||
| 40 | int nid); | ||
| 41 | extern int unregister_mem_sect_under_nodes(struct memory_block *mem_blk); | ||
| 38 | #else | 42 | #else |
| 39 | static inline int register_one_node(int nid) | 43 | static inline int register_one_node(int nid) |
| 40 | { | 44 | { |
| @@ -52,6 +56,15 @@ static inline int unregister_cpu_under_node(unsigned int cpu, unsigned int nid) | |||
| 52 | { | 56 | { |
| 53 | return 0; | 57 | return 0; |
| 54 | } | 58 | } |
| 59 | static inline int register_mem_sect_under_node(struct memory_block *mem_blk, | ||
| 60 | int nid) | ||
| 61 | { | ||
| 62 | return 0; | ||
| 63 | } | ||
| 64 | static inline int unregister_mem_sect_under_nodes(struct memory_block *mem_blk) | ||
| 65 | { | ||
| 66 | return 0; | ||
| 67 | } | ||
| 55 | #endif | 68 | #endif |
| 56 | 69 | ||
| 57 | #define to_node(sys_device) container_of(sys_device, struct node, sysdev) | 70 | #define to_node(sys_device) container_of(sys_device, struct node, sysdev) |
diff --git a/include/linux/nwpserial.h b/include/linux/nwpserial.h new file mode 100644 index 000000000000..9acb21572eaf --- /dev/null +++ b/include/linux/nwpserial.h | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | /* | ||
| 2 | * Serial Port driver for a NWP uart device | ||
| 3 | * | ||
| 4 | * Copyright (C) 2008 IBM Corp., Benjamin Krill <ben@codiert.org> | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or | ||
| 7 | * modify it under the terms of the GNU General Public License | ||
| 8 | * as published by the Free Software Foundation; either version | ||
| 9 | * 2 of the License, or (at your option) any later version. | ||
| 10 | * | ||
| 11 | */ | ||
| 12 | #ifndef _NWPSERIAL_H | ||
| 13 | #define _NWPSERIAL_H | ||
| 14 | |||
| 15 | int nwpserial_register_port(struct uart_port *port); | ||
| 16 | void nwpserial_unregister_port(int line); | ||
| 17 | |||
| 18 | #endif /* _NWPSERIAL_H */ | ||
diff --git a/include/linux/oprofile.h b/include/linux/oprofile.h index 1ce9fe572e51..1d9518bc4c58 100644 --- a/include/linux/oprofile.h +++ b/include/linux/oprofile.h | |||
| @@ -164,4 +164,22 @@ void oprofile_put_buff(unsigned long *buf, unsigned int start, | |||
| 164 | unsigned long oprofile_get_cpu_buffer_size(void); | 164 | unsigned long oprofile_get_cpu_buffer_size(void); |
| 165 | void oprofile_cpu_buffer_inc_smpl_lost(void); | 165 | void oprofile_cpu_buffer_inc_smpl_lost(void); |
| 166 | 166 | ||
| 167 | /* cpu buffer functions */ | ||
| 168 | |||
| 169 | struct op_sample; | ||
| 170 | |||
| 171 | struct op_entry { | ||
| 172 | struct ring_buffer_event *event; | ||
| 173 | struct op_sample *sample; | ||
| 174 | unsigned long irq_flags; | ||
| 175 | unsigned long size; | ||
| 176 | unsigned long *data; | ||
| 177 | }; | ||
| 178 | |||
| 179 | void oprofile_write_reserve(struct op_entry *entry, | ||
| 180 | struct pt_regs * const regs, | ||
| 181 | unsigned long pc, int code, int size); | ||
| 182 | int oprofile_add_data(struct op_entry *entry, unsigned long val); | ||
| 183 | int oprofile_write_commit(struct op_entry *entry); | ||
| 184 | |||
| 167 | #endif /* OPROFILE_H */ | 185 | #endif /* OPROFILE_H */ |
diff --git a/include/linux/oxu210hp.h b/include/linux/oxu210hp.h new file mode 100644 index 000000000000..0bf96eae5389 --- /dev/null +++ b/include/linux/oxu210hp.h | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | /* platform data for the OXU210HP HCD */ | ||
| 2 | |||
| 3 | struct oxu210hp_platform_data { | ||
| 4 | unsigned int bus16:1; | ||
| 5 | unsigned int use_hcd_otg:1; | ||
| 6 | unsigned int use_hcd_sph:1; | ||
| 7 | }; | ||
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index b12f93a3c345..219a523ecdb0 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
| @@ -228,6 +228,7 @@ PAGEFLAG_FALSE(HighMem) | |||
| 228 | PAGEFLAG(SwapCache, swapcache) | 228 | PAGEFLAG(SwapCache, swapcache) |
| 229 | #else | 229 | #else |
| 230 | PAGEFLAG_FALSE(SwapCache) | 230 | PAGEFLAG_FALSE(SwapCache) |
| 231 | SETPAGEFLAG_NOOP(SwapCache) CLEARPAGEFLAG_NOOP(SwapCache) | ||
| 231 | #endif | 232 | #endif |
| 232 | 233 | ||
| 233 | #ifdef CONFIG_UNEVICTABLE_LRU | 234 | #ifdef CONFIG_UNEVICTABLE_LRU |
| @@ -372,31 +373,22 @@ static inline void __ClearPageTail(struct page *page) | |||
| 372 | #define __PG_MLOCKED 0 | 373 | #define __PG_MLOCKED 0 |
| 373 | #endif | 374 | #endif |
| 374 | 375 | ||
| 375 | #define PAGE_FLAGS (1 << PG_lru | 1 << PG_private | 1 << PG_locked | \ | ||
| 376 | 1 << PG_buddy | 1 << PG_writeback | \ | ||
| 377 | 1 << PG_slab | 1 << PG_swapcache | 1 << PG_active | \ | ||
| 378 | __PG_UNEVICTABLE | __PG_MLOCKED) | ||
| 379 | |||
| 380 | /* | ||
| 381 | * Flags checked in bad_page(). Pages on the free list should not have | ||
| 382 | * these flags set. It they are, there is a problem. | ||
| 383 | */ | ||
| 384 | #define PAGE_FLAGS_CLEAR_WHEN_BAD (PAGE_FLAGS | \ | ||
| 385 | 1 << PG_reclaim | 1 << PG_dirty | 1 << PG_swapbacked) | ||
| 386 | |||
| 387 | /* | 376 | /* |
| 388 | * Flags checked when a page is freed. Pages being freed should not have | 377 | * Flags checked when a page is freed. Pages being freed should not have |
| 389 | * these flags set. It they are, there is a problem. | 378 | * these flags set. It they are, there is a problem. |
| 390 | */ | 379 | */ |
| 391 | #define PAGE_FLAGS_CHECK_AT_FREE (PAGE_FLAGS | 1 << PG_reserved) | 380 | #define PAGE_FLAGS_CHECK_AT_FREE \ |
| 381 | (1 << PG_lru | 1 << PG_private | 1 << PG_locked | \ | ||
| 382 | 1 << PG_buddy | 1 << PG_writeback | 1 << PG_reserved | \ | ||
| 383 | 1 << PG_slab | 1 << PG_swapcache | 1 << PG_active | \ | ||
| 384 | __PG_UNEVICTABLE | __PG_MLOCKED) | ||
| 392 | 385 | ||
| 393 | /* | 386 | /* |
| 394 | * Flags checked when a page is prepped for return by the page allocator. | 387 | * Flags checked when a page is prepped for return by the page allocator. |
| 395 | * Pages being prepped should not have these flags set. It they are, there | 388 | * Pages being prepped should not have any flags set. It they are set, |
| 396 | * is a problem. | 389 | * there has been a kernel bug or struct page corruption. |
| 397 | */ | 390 | */ |
| 398 | #define PAGE_FLAGS_CHECK_AT_PREP (PAGE_FLAGS | \ | 391 | #define PAGE_FLAGS_CHECK_AT_PREP ((1 << NR_PAGEFLAGS) - 1) |
| 399 | 1 << PG_reserved | 1 << PG_dirty | 1 << PG_swapbacked) | ||
| 400 | 392 | ||
| 401 | #endif /* !__GENERATING_BOUNDS_H */ | 393 | #endif /* !__GENERATING_BOUNDS_H */ |
| 402 | #endif /* PAGE_FLAGS_H */ | 394 | #endif /* PAGE_FLAGS_H */ |
diff --git a/include/linux/page_cgroup.h b/include/linux/page_cgroup.h index 1e6d34bfa094..602cc1fdee90 100644 --- a/include/linux/page_cgroup.h +++ b/include/linux/page_cgroup.h | |||
| @@ -26,10 +26,6 @@ enum { | |||
| 26 | PCG_LOCK, /* page cgroup is locked */ | 26 | PCG_LOCK, /* page cgroup is locked */ |
| 27 | PCG_CACHE, /* charged as cache */ | 27 | PCG_CACHE, /* charged as cache */ |
| 28 | PCG_USED, /* this object is in use. */ | 28 | PCG_USED, /* this object is in use. */ |
| 29 | /* flags for LRU placement */ | ||
| 30 | PCG_ACTIVE, /* page is active in this cgroup */ | ||
| 31 | PCG_FILE, /* page is file system backed */ | ||
| 32 | PCG_UNEVICTABLE, /* page is unevictableable */ | ||
| 33 | }; | 29 | }; |
| 34 | 30 | ||
| 35 | #define TESTPCGFLAG(uname, lname) \ | 31 | #define TESTPCGFLAG(uname, lname) \ |
| @@ -50,19 +46,6 @@ TESTPCGFLAG(Cache, CACHE) | |||
| 50 | TESTPCGFLAG(Used, USED) | 46 | TESTPCGFLAG(Used, USED) |
| 51 | CLEARPCGFLAG(Used, USED) | 47 | CLEARPCGFLAG(Used, USED) |
| 52 | 48 | ||
| 53 | /* LRU management flags (from global-lru definition) */ | ||
| 54 | TESTPCGFLAG(File, FILE) | ||
| 55 | SETPCGFLAG(File, FILE) | ||
| 56 | CLEARPCGFLAG(File, FILE) | ||
| 57 | |||
| 58 | TESTPCGFLAG(Active, ACTIVE) | ||
| 59 | SETPCGFLAG(Active, ACTIVE) | ||
| 60 | CLEARPCGFLAG(Active, ACTIVE) | ||
| 61 | |||
| 62 | TESTPCGFLAG(Unevictable, UNEVICTABLE) | ||
| 63 | SETPCGFLAG(Unevictable, UNEVICTABLE) | ||
| 64 | CLEARPCGFLAG(Unevictable, UNEVICTABLE) | ||
| 65 | |||
| 66 | static inline int page_cgroup_nid(struct page_cgroup *pc) | 49 | static inline int page_cgroup_nid(struct page_cgroup *pc) |
| 67 | { | 50 | { |
| 68 | return page_to_nid(pc->page); | 51 | return page_to_nid(pc->page); |
| @@ -105,4 +88,39 @@ static inline void page_cgroup_init(void) | |||
| 105 | } | 88 | } |
| 106 | 89 | ||
| 107 | #endif | 90 | #endif |
| 91 | |||
| 92 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP | ||
| 93 | #include <linux/swap.h> | ||
| 94 | extern struct mem_cgroup * | ||
| 95 | swap_cgroup_record(swp_entry_t ent, struct mem_cgroup *mem); | ||
| 96 | extern struct mem_cgroup *lookup_swap_cgroup(swp_entry_t ent); | ||
| 97 | extern int swap_cgroup_swapon(int type, unsigned long max_pages); | ||
| 98 | extern void swap_cgroup_swapoff(int type); | ||
| 99 | #else | ||
| 100 | #include <linux/swap.h> | ||
| 101 | |||
| 102 | static inline | ||
| 103 | struct mem_cgroup *swap_cgroup_record(swp_entry_t ent, struct mem_cgroup *mem) | ||
| 104 | { | ||
| 105 | return NULL; | ||
| 106 | } | ||
| 107 | |||
| 108 | static inline | ||
| 109 | struct mem_cgroup *lookup_swap_cgroup(swp_entry_t ent) | ||
| 110 | { | ||
| 111 | return NULL; | ||
| 112 | } | ||
| 113 | |||
| 114 | static inline int | ||
| 115 | swap_cgroup_swapon(int type, unsigned long max_pages) | ||
| 116 | { | ||
| 117 | return 0; | ||
| 118 | } | ||
| 119 | |||
| 120 | static inline void swap_cgroup_swapoff(int type) | ||
| 121 | { | ||
| 122 | return; | ||
| 123 | } | ||
| 124 | |||
| 125 | #endif | ||
| 108 | #endif | 126 | #endif |
diff --git a/include/linux/pagevec.h b/include/linux/pagevec.h index e90a2cb02915..7b2886fa7fdc 100644 --- a/include/linux/pagevec.h +++ b/include/linux/pagevec.h | |||
| @@ -21,7 +21,6 @@ struct pagevec { | |||
| 21 | }; | 21 | }; |
| 22 | 22 | ||
| 23 | void __pagevec_release(struct pagevec *pvec); | 23 | void __pagevec_release(struct pagevec *pvec); |
| 24 | void __pagevec_release_nonlru(struct pagevec *pvec); | ||
| 25 | void __pagevec_free(struct pagevec *pvec); | 24 | void __pagevec_free(struct pagevec *pvec); |
| 26 | void ____pagevec_lru_add(struct pagevec *pvec, enum lru_list lru); | 25 | void ____pagevec_lru_add(struct pagevec *pvec, enum lru_list lru); |
| 27 | void pagevec_strip(struct pagevec *pvec); | 26 | void pagevec_strip(struct pagevec *pvec); |
| @@ -69,12 +68,6 @@ static inline void pagevec_release(struct pagevec *pvec) | |||
| 69 | __pagevec_release(pvec); | 68 | __pagevec_release(pvec); |
| 70 | } | 69 | } |
| 71 | 70 | ||
| 72 | static inline void pagevec_release_nonlru(struct pagevec *pvec) | ||
| 73 | { | ||
| 74 | if (pagevec_count(pvec)) | ||
| 75 | __pagevec_release_nonlru(pvec); | ||
| 76 | } | ||
| 77 | |||
| 78 | static inline void pagevec_free(struct pagevec *pvec) | 71 | static inline void pagevec_free(struct pagevec *pvec) |
| 79 | { | 72 | { |
| 80 | if (pagevec_count(pvec)) | 73 | if (pagevec_count(pvec)) |
diff --git a/include/linux/pci-acpi.h b/include/linux/pci-acpi.h index 8837928fbf33..042c166f65d5 100644 --- a/include/linux/pci-acpi.h +++ b/include/linux/pci-acpi.h | |||
| @@ -8,6 +8,8 @@ | |||
| 8 | #ifndef _PCI_ACPI_H_ | 8 | #ifndef _PCI_ACPI_H_ |
| 9 | #define _PCI_ACPI_H_ | 9 | #define _PCI_ACPI_H_ |
| 10 | 10 | ||
| 11 | #include <linux/acpi.h> | ||
| 12 | |||
| 11 | #define OSC_QUERY_TYPE 0 | 13 | #define OSC_QUERY_TYPE 0 |
| 12 | #define OSC_SUPPORT_TYPE 1 | 14 | #define OSC_SUPPORT_TYPE 1 |
| 13 | #define OSC_CONTROL_TYPE 2 | 15 | #define OSC_CONTROL_TYPE 2 |
| @@ -48,15 +50,7 @@ | |||
| 48 | 50 | ||
| 49 | #ifdef CONFIG_ACPI | 51 | #ifdef CONFIG_ACPI |
| 50 | extern acpi_status pci_osc_control_set(acpi_handle handle, u32 flags); | 52 | extern acpi_status pci_osc_control_set(acpi_handle handle, u32 flags); |
| 51 | extern acpi_status __pci_osc_support_set(u32 flags, const char *hid); | 53 | int pci_acpi_osc_support(acpi_handle handle, u32 flags); |
| 52 | static inline acpi_status pci_osc_support_set(u32 flags) | ||
| 53 | { | ||
| 54 | return __pci_osc_support_set(flags, PCI_ROOT_HID_STRING); | ||
| 55 | } | ||
| 56 | static inline acpi_status pcie_osc_support_set(u32 flags) | ||
| 57 | { | ||
| 58 | return __pci_osc_support_set(flags, PCI_EXPRESS_ROOT_HID_STRING); | ||
| 59 | } | ||
| 60 | static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev) | 54 | static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev) |
| 61 | { | 55 | { |
| 62 | /* Find root host bridge */ | 56 | /* Find root host bridge */ |
| @@ -66,6 +60,15 @@ static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev) | |||
| 66 | return acpi_get_pci_rootbridge_handle(pci_domain_nr(pdev->bus), | 60 | return acpi_get_pci_rootbridge_handle(pci_domain_nr(pdev->bus), |
| 67 | pdev->bus->number); | 61 | pdev->bus->number); |
| 68 | } | 62 | } |
| 63 | |||
| 64 | static inline acpi_handle acpi_pci_get_bridge_handle(struct pci_bus *pbus) | ||
| 65 | { | ||
| 66 | int seg = pci_domain_nr(pbus), busnr = pbus->number; | ||
| 67 | struct pci_dev *bridge = pbus->self; | ||
| 68 | if (bridge) | ||
| 69 | return DEVICE_ACPI_HANDLE(&(bridge->dev)); | ||
| 70 | return acpi_get_pci_rootbridge_handle(seg, busnr); | ||
| 71 | } | ||
| 69 | #else | 72 | #else |
| 70 | #if !defined(AE_ERROR) | 73 | #if !defined(AE_ERROR) |
| 71 | typedef u32 acpi_status; | 74 | typedef u32 acpi_status; |
| @@ -73,8 +76,6 @@ typedef u32 acpi_status; | |||
| 73 | #endif | 76 | #endif |
| 74 | static inline acpi_status pci_osc_control_set(acpi_handle handle, u32 flags) | 77 | static inline acpi_status pci_osc_control_set(acpi_handle handle, u32 flags) |
| 75 | {return AE_ERROR;} | 78 | {return AE_ERROR;} |
| 76 | static inline acpi_status pci_osc_support_set(u32 flags) {return AE_ERROR;} | ||
| 77 | static inline acpi_status pcie_osc_support_set(u32 flags) {return AE_ERROR;} | ||
| 78 | static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev) | 79 | static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev) |
| 79 | { return NULL; } | 80 | { return NULL; } |
| 80 | #endif | 81 | #endif |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 03b0b8c3c81b..80f8b8b65fde 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
| @@ -82,7 +82,30 @@ enum pci_mmap_state { | |||
| 82 | #define PCI_DMA_FROMDEVICE 2 | 82 | #define PCI_DMA_FROMDEVICE 2 |
| 83 | #define PCI_DMA_NONE 3 | 83 | #define PCI_DMA_NONE 3 |
| 84 | 84 | ||
| 85 | #define DEVICE_COUNT_RESOURCE 12 | 85 | /* |
| 86 | * For PCI devices, the region numbers are assigned this way: | ||
| 87 | */ | ||
| 88 | enum { | ||
| 89 | /* #0-5: standard PCI resources */ | ||
| 90 | PCI_STD_RESOURCES, | ||
| 91 | PCI_STD_RESOURCE_END = 5, | ||
| 92 | |||
| 93 | /* #6: expansion ROM resource */ | ||
| 94 | PCI_ROM_RESOURCE, | ||
| 95 | |||
| 96 | /* resources assigned to buses behind the bridge */ | ||
| 97 | #define PCI_BRIDGE_RESOURCE_NUM 4 | ||
| 98 | |||
| 99 | PCI_BRIDGE_RESOURCES, | ||
| 100 | PCI_BRIDGE_RESOURCE_END = PCI_BRIDGE_RESOURCES + | ||
| 101 | PCI_BRIDGE_RESOURCE_NUM - 1, | ||
| 102 | |||
| 103 | /* total resources associated with a PCI device */ | ||
| 104 | PCI_NUM_RESOURCES, | ||
| 105 | |||
| 106 | /* preserve this for compatibility */ | ||
| 107 | DEVICE_COUNT_RESOURCE | ||
| 108 | }; | ||
| 86 | 109 | ||
| 87 | typedef int __bitwise pci_power_t; | 110 | typedef int __bitwise pci_power_t; |
| 88 | 111 | ||
| @@ -274,18 +297,6 @@ static inline void pci_add_saved_cap(struct pci_dev *pci_dev, | |||
| 274 | hlist_add_head(&new_cap->next, &pci_dev->saved_cap_space); | 297 | hlist_add_head(&new_cap->next, &pci_dev->saved_cap_space); |
| 275 | } | 298 | } |
| 276 | 299 | ||
| 277 | /* | ||
| 278 | * For PCI devices, the region numbers are assigned this way: | ||
| 279 | * | ||
| 280 | * 0-5 standard PCI regions | ||
| 281 | * 6 expansion ROM | ||
| 282 | * 7-10 bridges: address space assigned to buses behind the bridge | ||
| 283 | */ | ||
| 284 | |||
| 285 | #define PCI_ROM_RESOURCE 6 | ||
| 286 | #define PCI_BRIDGE_RESOURCES 7 | ||
| 287 | #define PCI_NUM_RESOURCES 11 | ||
| 288 | |||
| 289 | #ifndef PCI_BUS_NUM_RESOURCES | 300 | #ifndef PCI_BUS_NUM_RESOURCES |
| 290 | #define PCI_BUS_NUM_RESOURCES 16 | 301 | #define PCI_BUS_NUM_RESOURCES 16 |
| 291 | #endif | 302 | #endif |
| @@ -325,6 +336,15 @@ struct pci_bus { | |||
| 325 | #define pci_bus_b(n) list_entry(n, struct pci_bus, node) | 336 | #define pci_bus_b(n) list_entry(n, struct pci_bus, node) |
| 326 | #define to_pci_bus(n) container_of(n, struct pci_bus, dev) | 337 | #define to_pci_bus(n) container_of(n, struct pci_bus, dev) |
| 327 | 338 | ||
| 339 | #ifdef CONFIG_PCI_MSI | ||
| 340 | static inline bool pci_dev_msi_enabled(struct pci_dev *pci_dev) | ||
| 341 | { | ||
| 342 | return pci_dev->msi_enabled || pci_dev->msix_enabled; | ||
| 343 | } | ||
| 344 | #else | ||
| 345 | static inline bool pci_dev_msi_enabled(struct pci_dev *pci_dev) { return false; } | ||
| 346 | #endif | ||
| 347 | |||
| 328 | /* | 348 | /* |
| 329 | * Error values that may be returned by PCI functions. | 349 | * Error values that may be returned by PCI functions. |
| 330 | */ | 350 | */ |
| @@ -421,7 +441,6 @@ struct pci_driver { | |||
| 421 | int (*resume_early) (struct pci_dev *dev); | 441 | int (*resume_early) (struct pci_dev *dev); |
| 422 | int (*resume) (struct pci_dev *dev); /* Device woken up */ | 442 | int (*resume) (struct pci_dev *dev); /* Device woken up */ |
| 423 | void (*shutdown) (struct pci_dev *dev); | 443 | void (*shutdown) (struct pci_dev *dev); |
| 424 | struct pm_ext_ops *pm; | ||
| 425 | struct pci_error_handlers *err_handler; | 444 | struct pci_error_handlers *err_handler; |
| 426 | struct device_driver driver; | 445 | struct device_driver driver; |
| 427 | struct pci_dynids dynids; | 446 | struct pci_dynids dynids; |
| @@ -533,7 +552,9 @@ int __must_check pci_bus_add_device(struct pci_dev *dev); | |||
| 533 | void pci_read_bridge_bases(struct pci_bus *child); | 552 | void pci_read_bridge_bases(struct pci_bus *child); |
| 534 | struct resource *pci_find_parent_resource(const struct pci_dev *dev, | 553 | struct resource *pci_find_parent_resource(const struct pci_dev *dev, |
| 535 | struct resource *res); | 554 | struct resource *res); |
| 555 | u8 pci_swizzle_interrupt_pin(struct pci_dev *dev, u8 pin); | ||
| 536 | int pci_get_interrupt_pin(struct pci_dev *dev, struct pci_dev **bridge); | 556 | int pci_get_interrupt_pin(struct pci_dev *dev, struct pci_dev **bridge); |
| 557 | u8 pci_common_swizzle(struct pci_dev *dev, u8 *pinp); | ||
| 537 | extern struct pci_dev *pci_dev_get(struct pci_dev *dev); | 558 | extern struct pci_dev *pci_dev_get(struct pci_dev *dev); |
| 538 | extern void pci_dev_put(struct pci_dev *dev); | 559 | extern void pci_dev_put(struct pci_dev *dev); |
| 539 | extern void pci_remove_bus(struct pci_bus *b); | 560 | extern void pci_remove_bus(struct pci_bus *b); |
| @@ -630,6 +651,7 @@ static inline int pci_is_managed(struct pci_dev *pdev) | |||
| 630 | 651 | ||
| 631 | void pci_disable_device(struct pci_dev *dev); | 652 | void pci_disable_device(struct pci_dev *dev); |
| 632 | void pci_set_master(struct pci_dev *dev); | 653 | void pci_set_master(struct pci_dev *dev); |
| 654 | void pci_clear_master(struct pci_dev *dev); | ||
| 633 | int pci_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state state); | 655 | int pci_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state state); |
| 634 | #define HAVE_PCI_SET_MWI | 656 | #define HAVE_PCI_SET_MWI |
| 635 | int __must_check pci_set_mwi(struct pci_dev *dev); | 657 | int __must_check pci_set_mwi(struct pci_dev *dev); |
| @@ -648,7 +670,7 @@ int pcie_get_readrq(struct pci_dev *dev); | |||
| 648 | int pcie_set_readrq(struct pci_dev *dev, int rq); | 670 | int pcie_set_readrq(struct pci_dev *dev, int rq); |
| 649 | int pci_reset_function(struct pci_dev *dev); | 671 | int pci_reset_function(struct pci_dev *dev); |
| 650 | int pci_execute_reset_function(struct pci_dev *dev); | 672 | int pci_execute_reset_function(struct pci_dev *dev); |
| 651 | void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno); | 673 | void pci_update_resource(struct pci_dev *dev, int resno); |
| 652 | int __must_check pci_assign_resource(struct pci_dev *dev, int i); | 674 | int __must_check pci_assign_resource(struct pci_dev *dev, int i); |
| 653 | int pci_select_bars(struct pci_dev *dev, unsigned long flags); | 675 | int pci_select_bars(struct pci_dev *dev, unsigned long flags); |
| 654 | 676 | ||
| @@ -675,6 +697,11 @@ int pci_back_from_sleep(struct pci_dev *dev); | |||
| 675 | /* Functions for PCI Hotplug drivers to use */ | 697 | /* Functions for PCI Hotplug drivers to use */ |
| 676 | int pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap); | 698 | int pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap); |
| 677 | 699 | ||
| 700 | /* Vital product data routines */ | ||
| 701 | ssize_t pci_read_vpd(struct pci_dev *dev, loff_t pos, size_t count, void *buf); | ||
| 702 | ssize_t pci_write_vpd(struct pci_dev *dev, loff_t pos, size_t count, const void *buf); | ||
| 703 | int pci_vpd_truncate(struct pci_dev *dev, size_t size); | ||
| 704 | |||
| 678 | /* Helper functions for low-level code (drivers/pci/setup-[bus,res].c) */ | 705 | /* Helper functions for low-level code (drivers/pci/setup-[bus,res].c) */ |
| 679 | void pci_bus_assign_resources(struct pci_bus *bus); | 706 | void pci_bus_assign_resources(struct pci_bus *bus); |
| 680 | void pci_bus_size_bridges(struct pci_bus *bus); | 707 | void pci_bus_size_bridges(struct pci_bus *bus); |
| @@ -687,10 +714,13 @@ void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *), | |||
| 687 | int (*)(struct pci_dev *, u8, u8)); | 714 | int (*)(struct pci_dev *, u8, u8)); |
| 688 | #define HAVE_PCI_REQ_REGIONS 2 | 715 | #define HAVE_PCI_REQ_REGIONS 2 |
| 689 | int __must_check pci_request_regions(struct pci_dev *, const char *); | 716 | int __must_check pci_request_regions(struct pci_dev *, const char *); |
| 717 | int __must_check pci_request_regions_exclusive(struct pci_dev *, const char *); | ||
| 690 | void pci_release_regions(struct pci_dev *); | 718 | void pci_release_regions(struct pci_dev *); |
| 691 | int __must_check pci_request_region(struct pci_dev *, int, const char *); | 719 | int __must_check pci_request_region(struct pci_dev *, int, const char *); |
| 720 | int __must_check pci_request_region_exclusive(struct pci_dev *, int, const char *); | ||
| 692 | void pci_release_region(struct pci_dev *, int); | 721 | void pci_release_region(struct pci_dev *, int); |
| 693 | int pci_request_selected_regions(struct pci_dev *, int, const char *); | 722 | int pci_request_selected_regions(struct pci_dev *, int, const char *); |
| 723 | int pci_request_selected_regions_exclusive(struct pci_dev *, int, const char *); | ||
| 694 | void pci_release_selected_regions(struct pci_dev *, int); | 724 | void pci_release_selected_regions(struct pci_dev *, int); |
| 695 | 725 | ||
| 696 | /* drivers/pci/bus.c */ | 726 | /* drivers/pci/bus.c */ |
| @@ -780,6 +810,10 @@ static inline void msi_remove_pci_irq_vectors(struct pci_dev *dev) | |||
| 780 | 810 | ||
| 781 | static inline void pci_restore_msi_state(struct pci_dev *dev) | 811 | static inline void pci_restore_msi_state(struct pci_dev *dev) |
| 782 | { } | 812 | { } |
| 813 | static inline int pci_msi_enabled(void) | ||
| 814 | { | ||
| 815 | return 0; | ||
| 816 | } | ||
| 783 | #else | 817 | #else |
| 784 | extern int pci_enable_msi(struct pci_dev *dev); | 818 | extern int pci_enable_msi(struct pci_dev *dev); |
| 785 | extern void pci_msi_shutdown(struct pci_dev *dev); | 819 | extern void pci_msi_shutdown(struct pci_dev *dev); |
| @@ -790,6 +824,16 @@ extern void pci_msix_shutdown(struct pci_dev *dev); | |||
| 790 | extern void pci_disable_msix(struct pci_dev *dev); | 824 | extern void pci_disable_msix(struct pci_dev *dev); |
| 791 | extern void msi_remove_pci_irq_vectors(struct pci_dev *dev); | 825 | extern void msi_remove_pci_irq_vectors(struct pci_dev *dev); |
| 792 | extern void pci_restore_msi_state(struct pci_dev *dev); | 826 | extern void pci_restore_msi_state(struct pci_dev *dev); |
| 827 | extern int pci_msi_enabled(void); | ||
| 828 | #endif | ||
| 829 | |||
| 830 | #ifndef CONFIG_PCIEASPM | ||
| 831 | static inline int pcie_aspm_enabled(void) | ||
| 832 | { | ||
| 833 | return 0; | ||
| 834 | } | ||
| 835 | #else | ||
| 836 | extern int pcie_aspm_enabled(void); | ||
| 793 | #endif | 837 | #endif |
| 794 | 838 | ||
| 795 | #ifdef CONFIG_HT_IRQ | 839 | #ifdef CONFIG_HT_IRQ |
| @@ -1141,20 +1185,9 @@ static inline void pci_mmcfg_early_init(void) { } | |||
| 1141 | static inline void pci_mmcfg_late_init(void) { } | 1185 | static inline void pci_mmcfg_late_init(void) { } |
| 1142 | #endif | 1186 | #endif |
| 1143 | 1187 | ||
| 1144 | #ifdef CONFIG_HAS_IOMEM | 1188 | int pci_ext_cfg_avail(struct pci_dev *dev); |
| 1145 | static inline void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar) | 1189 | |
| 1146 | { | 1190 | void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar); |
| 1147 | /* | ||
| 1148 | * Make sure the BAR is actually a memory resource, not an IO resource | ||
| 1149 | */ | ||
| 1150 | if (!(pci_resource_flags(pdev, bar) & IORESOURCE_MEM)) { | ||
| 1151 | WARN_ON(1); | ||
| 1152 | return NULL; | ||
| 1153 | } | ||
| 1154 | return ioremap_nocache(pci_resource_start(pdev, bar), | ||
| 1155 | pci_resource_len(pdev, bar)); | ||
| 1156 | } | ||
| 1157 | #endif | ||
| 1158 | 1191 | ||
| 1159 | #endif /* __KERNEL__ */ | 1192 | #endif /* __KERNEL__ */ |
| 1160 | #endif /* LINUX_PCI_H */ | 1193 | #endif /* LINUX_PCI_H */ |
diff --git a/include/linux/pci_hotplug.h b/include/linux/pci_hotplug.h index a00bd1a0f156..20998746518e 100644 --- a/include/linux/pci_hotplug.h +++ b/include/linux/pci_hotplug.h | |||
| @@ -223,11 +223,12 @@ struct hotplug_params { | |||
| 223 | #ifdef CONFIG_ACPI | 223 | #ifdef CONFIG_ACPI |
| 224 | #include <acpi/acpi.h> | 224 | #include <acpi/acpi.h> |
| 225 | #include <acpi/acpi_bus.h> | 225 | #include <acpi/acpi_bus.h> |
| 226 | #include <acpi/actypes.h> | ||
| 227 | extern acpi_status acpi_get_hp_params_from_firmware(struct pci_bus *bus, | 226 | extern acpi_status acpi_get_hp_params_from_firmware(struct pci_bus *bus, |
| 228 | struct hotplug_params *hpp); | 227 | struct hotplug_params *hpp); |
| 229 | int acpi_get_hp_hw_control_from_firmware(struct pci_dev *dev, u32 flags); | 228 | int acpi_get_hp_hw_control_from_firmware(struct pci_dev *dev, u32 flags); |
| 230 | int acpi_root_bridge(acpi_handle handle); | 229 | int acpi_root_bridge(acpi_handle handle); |
| 230 | int acpi_pci_check_ejectable(struct pci_bus *pbus, acpi_handle handle); | ||
| 231 | int acpi_pci_detect_ejectable(struct pci_bus *pbus); | ||
| 231 | #endif | 232 | #endif |
| 232 | #endif | 233 | #endif |
| 233 | 234 | ||
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 218c73b1e6d4..d543365518ab 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
| @@ -1658,6 +1658,7 @@ | |||
| 1658 | #define PCI_VENDOR_ID_ROCKWELL 0x127A | 1658 | #define PCI_VENDOR_ID_ROCKWELL 0x127A |
| 1659 | 1659 | ||
| 1660 | #define PCI_VENDOR_ID_ITE 0x1283 | 1660 | #define PCI_VENDOR_ID_ITE 0x1283 |
| 1661 | #define PCI_DEVICE_ID_ITE_8172 0x8172 | ||
| 1661 | #define PCI_DEVICE_ID_ITE_8211 0x8211 | 1662 | #define PCI_DEVICE_ID_ITE_8211 0x8211 |
| 1662 | #define PCI_DEVICE_ID_ITE_8212 0x8212 | 1663 | #define PCI_DEVICE_ID_ITE_8212 0x8212 |
| 1663 | #define PCI_DEVICE_ID_ITE_8213 0x8213 | 1664 | #define PCI_DEVICE_ID_ITE_8213 0x8213 |
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h index e5effd47ed74..027815b4635e 100644 --- a/include/linux/pci_regs.h +++ b/include/linux/pci_regs.h | |||
| @@ -210,6 +210,7 @@ | |||
| 210 | #define PCI_CAP_ID_AGP3 0x0E /* AGP Target PCI-PCI bridge */ | 210 | #define PCI_CAP_ID_AGP3 0x0E /* AGP Target PCI-PCI bridge */ |
| 211 | #define PCI_CAP_ID_EXP 0x10 /* PCI Express */ | 211 | #define PCI_CAP_ID_EXP 0x10 /* PCI Express */ |
| 212 | #define PCI_CAP_ID_MSIX 0x11 /* MSI-X */ | 212 | #define PCI_CAP_ID_MSIX 0x11 /* MSI-X */ |
| 213 | #define PCI_CAP_ID_AF 0x13 /* PCI Advanced Features */ | ||
| 213 | #define PCI_CAP_LIST_NEXT 1 /* Next capability in the list */ | 214 | #define PCI_CAP_LIST_NEXT 1 /* Next capability in the list */ |
| 214 | #define PCI_CAP_FLAGS 2 /* Capability defined flags (16 bits) */ | 215 | #define PCI_CAP_FLAGS 2 /* Capability defined flags (16 bits) */ |
| 215 | #define PCI_CAP_SIZEOF 4 | 216 | #define PCI_CAP_SIZEOF 4 |
| @@ -316,6 +317,17 @@ | |||
| 316 | #define PCI_CHSWP_EXT 0x40 /* ENUM# status - extraction */ | 317 | #define PCI_CHSWP_EXT 0x40 /* ENUM# status - extraction */ |
| 317 | #define PCI_CHSWP_INS 0x80 /* ENUM# status - insertion */ | 318 | #define PCI_CHSWP_INS 0x80 /* ENUM# status - insertion */ |
| 318 | 319 | ||
| 320 | /* PCI Advanced Feature registers */ | ||
| 321 | |||
| 322 | #define PCI_AF_LENGTH 2 | ||
| 323 | #define PCI_AF_CAP 3 | ||
| 324 | #define PCI_AF_CAP_TP 0x01 | ||
| 325 | #define PCI_AF_CAP_FLR 0x02 | ||
| 326 | #define PCI_AF_CTRL 4 | ||
| 327 | #define PCI_AF_CTRL_FLR 0x01 | ||
| 328 | #define PCI_AF_STATUS 5 | ||
| 329 | #define PCI_AF_STATUS_TP 0x01 | ||
| 330 | |||
| 319 | /* PCI-X registers */ | 331 | /* PCI-X registers */ |
| 320 | 332 | ||
| 321 | #define PCI_X_CMD 2 /* Modes & Features */ | 333 | #define PCI_X_CMD 2 /* Modes & Features */ |
| @@ -399,20 +411,70 @@ | |||
| 399 | #define PCI_EXP_DEVSTA_AUXPD 0x10 /* AUX Power Detected */ | 411 | #define PCI_EXP_DEVSTA_AUXPD 0x10 /* AUX Power Detected */ |
| 400 | #define PCI_EXP_DEVSTA_TRPND 0x20 /* Transactions Pending */ | 412 | #define PCI_EXP_DEVSTA_TRPND 0x20 /* Transactions Pending */ |
| 401 | #define PCI_EXP_LNKCAP 12 /* Link Capabilities */ | 413 | #define PCI_EXP_LNKCAP 12 /* Link Capabilities */ |
| 402 | #define PCI_EXP_LNKCAP_ASPMS 0xc00 /* ASPM Support */ | 414 | #define PCI_EXP_LNKCAP_SLS 0x0000000f /* Supported Link Speeds */ |
| 403 | #define PCI_EXP_LNKCAP_L0SEL 0x7000 /* L0s Exit Latency */ | 415 | #define PCI_EXP_LNKCAP_MLW 0x000003f0 /* Maximum Link Width */ |
| 404 | #define PCI_EXP_LNKCAP_L1EL 0x38000 /* L1 Exit Latency */ | 416 | #define PCI_EXP_LNKCAP_ASPMS 0x00000c00 /* ASPM Support */ |
| 405 | #define PCI_EXP_LNKCAP_CLKPM 0x40000 /* L1 Clock Power Management */ | 417 | #define PCI_EXP_LNKCAP_L0SEL 0x00007000 /* L0s Exit Latency */ |
| 418 | #define PCI_EXP_LNKCAP_L1EL 0x00038000 /* L1 Exit Latency */ | ||
| 419 | #define PCI_EXP_LNKCAP_CLKPM 0x00040000 /* L1 Clock Power Management */ | ||
| 420 | #define PCI_EXP_LNKCAP_SDERC 0x00080000 /* Suprise Down Error Reporting Capable */ | ||
| 421 | #define PCI_EXP_LNKCAP_DLLLARC 0x00100000 /* Data Link Layer Link Active Reporting Capable */ | ||
| 422 | #define PCI_EXP_LNKCAP_LBNC 0x00200000 /* Link Bandwidth Notification Capability */ | ||
| 423 | #define PCI_EXP_LNKCAP_PN 0xff000000 /* Port Number */ | ||
| 406 | #define PCI_EXP_LNKCTL 16 /* Link Control */ | 424 | #define PCI_EXP_LNKCTL 16 /* Link Control */ |
| 407 | #define PCI_EXP_LNKCTL_RL 0x20 /* Retrain Link */ | 425 | #define PCI_EXP_LNKCTL_ASPMC 0x0003 /* ASPM Control */ |
| 408 | #define PCI_EXP_LNKCTL_CCC 0x40 /* Common Clock COnfiguration */ | 426 | #define PCI_EXP_LNKCTL_RCB 0x0008 /* Read Completion Boundary */ |
| 427 | #define PCI_EXP_LNKCTL_LD 0x0010 /* Link Disable */ | ||
| 428 | #define PCI_EXP_LNKCTL_RL 0x0020 /* Retrain Link */ | ||
| 429 | #define PCI_EXP_LNKCTL_CCC 0x0040 /* Common Clock Configuration */ | ||
| 430 | #define PCI_EXP_LNKCTL_ES 0x0080 /* Extended Synch */ | ||
| 409 | #define PCI_EXP_LNKCTL_CLKREQ_EN 0x100 /* Enable clkreq */ | 431 | #define PCI_EXP_LNKCTL_CLKREQ_EN 0x100 /* Enable clkreq */ |
| 432 | #define PCI_EXP_LNKCTL_HAWD 0x0200 /* Hardware Autonomous Width Disable */ | ||
| 433 | #define PCI_EXP_LNKCTL_LBMIE 0x0400 /* Link Bandwidth Management Interrupt Enable */ | ||
| 434 | #define PCI_EXP_LNKCTL_LABIE 0x0800 /* Lnk Autonomous Bandwidth Interrupt Enable */ | ||
| 410 | #define PCI_EXP_LNKSTA 18 /* Link Status */ | 435 | #define PCI_EXP_LNKSTA 18 /* Link Status */ |
| 411 | #define PCI_EXP_LNKSTA_LT 0x800 /* Link Training */ | 436 | #define PCI_EXP_LNKSTA_CLS 0x000f /* Current Link Speed */ |
| 437 | #define PCI_EXP_LNKSTA_NLW 0x03f0 /* Nogotiated Link Width */ | ||
| 438 | #define PCI_EXP_LNKSTA_LT 0x0800 /* Link Training */ | ||
| 412 | #define PCI_EXP_LNKSTA_SLC 0x1000 /* Slot Clock Configuration */ | 439 | #define PCI_EXP_LNKSTA_SLC 0x1000 /* Slot Clock Configuration */ |
| 440 | #define PCI_EXP_LNKSTA_DLLLA 0x2000 /* Data Link Layer Link Active */ | ||
| 441 | #define PCI_EXP_LNKSTA_LBMS 0x4000 /* Link Bandwidth Management Status */ | ||
| 442 | #define PCI_EXP_LNKSTA_LABS 0x8000 /* Link Autonomous Bandwidth Status */ | ||
| 413 | #define PCI_EXP_SLTCAP 20 /* Slot Capabilities */ | 443 | #define PCI_EXP_SLTCAP 20 /* Slot Capabilities */ |
| 444 | #define PCI_EXP_SLTCAP_ABP 0x00000001 /* Attention Button Present */ | ||
| 445 | #define PCI_EXP_SLTCAP_PCP 0x00000002 /* Power Controller Present */ | ||
| 446 | #define PCI_EXP_SLTCAP_MRLSP 0x00000004 /* MRL Sensor Present */ | ||
| 447 | #define PCI_EXP_SLTCAP_AIP 0x00000008 /* Attention Indicator Present */ | ||
| 448 | #define PCI_EXP_SLTCAP_PIP 0x00000010 /* Power Indicator Present */ | ||
| 449 | #define PCI_EXP_SLTCAP_HPS 0x00000020 /* Hot-Plug Surprise */ | ||
| 450 | #define PCI_EXP_SLTCAP_HPC 0x00000040 /* Hot-Plug Capable */ | ||
| 451 | #define PCI_EXP_SLTCAP_SPLV 0x00007f80 /* Slot Power Limit Value */ | ||
| 452 | #define PCI_EXP_SLTCAP_SPLS 0x00018000 /* Slot Power Limit Scale */ | ||
| 453 | #define PCI_EXP_SLTCAP_EIP 0x00020000 /* Electromechanical Interlock Present */ | ||
| 454 | #define PCI_EXP_SLTCAP_NCCS 0x00040000 /* No Command Completed Support */ | ||
| 455 | #define PCI_EXP_SLTCAP_PSN 0xfff80000 /* Physical Slot Number */ | ||
| 414 | #define PCI_EXP_SLTCTL 24 /* Slot Control */ | 456 | #define PCI_EXP_SLTCTL 24 /* Slot Control */ |
| 457 | #define PCI_EXP_SLTCTL_ABPE 0x0001 /* Attention Button Pressed Enable */ | ||
| 458 | #define PCI_EXP_SLTCTL_PFDE 0x0002 /* Power Fault Detected Enable */ | ||
| 459 | #define PCI_EXP_SLTCTL_MRLSCE 0x0004 /* MRL Sensor Changed Enable */ | ||
| 460 | #define PCI_EXP_SLTCTL_PDCE 0x0008 /* Presence Detect Changed Enable */ | ||
| 461 | #define PCI_EXP_SLTCTL_CCIE 0x0010 /* Command Completed Interrupt Enable */ | ||
| 462 | #define PCI_EXP_SLTCTL_HPIE 0x0020 /* Hot-Plug Interrupt Enable */ | ||
| 463 | #define PCI_EXP_SLTCTL_AIC 0x00c0 /* Attention Indicator Control */ | ||
| 464 | #define PCI_EXP_SLTCTL_PIC 0x0300 /* Power Indicator Control */ | ||
| 465 | #define PCI_EXP_SLTCTL_PCC 0x0400 /* Power Controller Control */ | ||
| 466 | #define PCI_EXP_SLTCTL_EIC 0x0800 /* Electromechanical Interlock Control */ | ||
| 467 | #define PCI_EXP_SLTCTL_DLLSCE 0x1000 /* Data Link Layer State Changed Enable */ | ||
| 415 | #define PCI_EXP_SLTSTA 26 /* Slot Status */ | 468 | #define PCI_EXP_SLTSTA 26 /* Slot Status */ |
| 469 | #define PCI_EXP_SLTSTA_ABP 0x0001 /* Attention Button Pressed */ | ||
| 470 | #define PCI_EXP_SLTSTA_PFD 0x0002 /* Power Fault Detected */ | ||
| 471 | #define PCI_EXP_SLTSTA_MRLSC 0x0004 /* MRL Sensor Changed */ | ||
| 472 | #define PCI_EXP_SLTSTA_PDC 0x0008 /* Presence Detect Changed */ | ||
| 473 | #define PCI_EXP_SLTSTA_CC 0x0010 /* Command Completed */ | ||
| 474 | #define PCI_EXP_SLTSTA_MRLSS 0x0020 /* MRL Sensor State */ | ||
| 475 | #define PCI_EXP_SLTSTA_PDS 0x0040 /* Presence Detect State */ | ||
| 476 | #define PCI_EXP_SLTSTA_EIS 0x0080 /* Electromechanical Interlock Status */ | ||
| 477 | #define PCI_EXP_SLTSTA_DLLSC 0x0100 /* Data Link Layer State Changed */ | ||
| 416 | #define PCI_EXP_RTCTL 28 /* Root Control */ | 478 | #define PCI_EXP_RTCTL 28 /* Root Control */ |
| 417 | #define PCI_EXP_RTCTL_SECEE 0x01 /* System Error on Correctable Error */ | 479 | #define PCI_EXP_RTCTL_SECEE 0x01 /* System Error on Correctable Error */ |
| 418 | #define PCI_EXP_RTCTL_SENFEE 0x02 /* System Error on Non-Fatal Error */ | 480 | #define PCI_EXP_RTCTL_SENFEE 0x02 /* System Error on Non-Fatal Error */ |
diff --git a/include/linux/percpu_counter.h b/include/linux/percpu_counter.h index 9007ccdfc112..a7684a513994 100644 --- a/include/linux/percpu_counter.h +++ b/include/linux/percpu_counter.h | |||
| @@ -24,14 +24,18 @@ struct percpu_counter { | |||
| 24 | s32 *counters; | 24 | s32 *counters; |
| 25 | }; | 25 | }; |
| 26 | 26 | ||
| 27 | #if NR_CPUS >= 16 | 27 | extern int percpu_counter_batch; |
| 28 | #define FBC_BATCH (NR_CPUS*2) | 28 | |
| 29 | #else | 29 | int __percpu_counter_init(struct percpu_counter *fbc, s64 amount, |
| 30 | #define FBC_BATCH (NR_CPUS*4) | 30 | struct lock_class_key *key); |
| 31 | #endif | 31 | |
| 32 | #define percpu_counter_init(fbc, value) \ | ||
| 33 | ({ \ | ||
| 34 | static struct lock_class_key __key; \ | ||
| 35 | \ | ||
| 36 | __percpu_counter_init(fbc, value, &__key); \ | ||
| 37 | }) | ||
| 32 | 38 | ||
| 33 | int percpu_counter_init(struct percpu_counter *fbc, s64 amount); | ||
| 34 | int percpu_counter_init_irq(struct percpu_counter *fbc, s64 amount); | ||
| 35 | void percpu_counter_destroy(struct percpu_counter *fbc); | 39 | void percpu_counter_destroy(struct percpu_counter *fbc); |
| 36 | void percpu_counter_set(struct percpu_counter *fbc, s64 amount); | 40 | void percpu_counter_set(struct percpu_counter *fbc, s64 amount); |
| 37 | void __percpu_counter_add(struct percpu_counter *fbc, s64 amount, s32 batch); | 41 | void __percpu_counter_add(struct percpu_counter *fbc, s64 amount, s32 batch); |
| @@ -39,7 +43,7 @@ s64 __percpu_counter_sum(struct percpu_counter *fbc); | |||
| 39 | 43 | ||
| 40 | static inline void percpu_counter_add(struct percpu_counter *fbc, s64 amount) | 44 | static inline void percpu_counter_add(struct percpu_counter *fbc, s64 amount) |
| 41 | { | 45 | { |
| 42 | __percpu_counter_add(fbc, amount, FBC_BATCH); | 46 | __percpu_counter_add(fbc, amount, percpu_counter_batch); |
| 43 | } | 47 | } |
| 44 | 48 | ||
| 45 | static inline s64 percpu_counter_sum_positive(struct percpu_counter *fbc) | 49 | static inline s64 percpu_counter_sum_positive(struct percpu_counter *fbc) |
| @@ -85,8 +89,6 @@ static inline int percpu_counter_init(struct percpu_counter *fbc, s64 amount) | |||
| 85 | return 0; | 89 | return 0; |
| 86 | } | 90 | } |
| 87 | 91 | ||
| 88 | #define percpu_counter_init_irq percpu_counter_init | ||
| 89 | |||
| 90 | static inline void percpu_counter_destroy(struct percpu_counter *fbc) | 92 | static inline void percpu_counter_destroy(struct percpu_counter *fbc) |
| 91 | { | 93 | { |
| 92 | } | 94 | } |
diff --git a/include/linux/pid.h b/include/linux/pid.h index bb206c56d1f0..49f1c2f66e95 100644 --- a/include/linux/pid.h +++ b/include/linux/pid.h | |||
| @@ -123,6 +123,24 @@ extern struct pid *alloc_pid(struct pid_namespace *ns); | |||
| 123 | extern void free_pid(struct pid *pid); | 123 | extern void free_pid(struct pid *pid); |
| 124 | 124 | ||
| 125 | /* | 125 | /* |
| 126 | * ns_of_pid() returns the pid namespace in which the specified pid was | ||
| 127 | * allocated. | ||
| 128 | * | ||
| 129 | * NOTE: | ||
| 130 | * ns_of_pid() is expected to be called for a process (task) that has | ||
| 131 | * an attached 'struct pid' (see attach_pid(), detach_pid()) i.e @pid | ||
| 132 | * is expected to be non-NULL. If @pid is NULL, caller should handle | ||
| 133 | * the resulting NULL pid-ns. | ||
| 134 | */ | ||
| 135 | static inline struct pid_namespace *ns_of_pid(struct pid *pid) | ||
| 136 | { | ||
| 137 | struct pid_namespace *ns = NULL; | ||
| 138 | if (pid) | ||
| 139 | ns = pid->numbers[pid->level].ns; | ||
| 140 | return ns; | ||
| 141 | } | ||
| 142 | |||
| 143 | /* | ||
| 126 | * the helpers to get the pid's id seen from different namespaces | 144 | * the helpers to get the pid's id seen from different namespaces |
| 127 | * | 145 | * |
| 128 | * pid_nr() : global id, i.e. the id seen from the init namespace; | 146 | * pid_nr() : global id, i.e. the id seen from the init namespace; |
diff --git a/include/linux/pid_namespace.h b/include/linux/pid_namespace.h index d82fe825d62f..38d10326246a 100644 --- a/include/linux/pid_namespace.h +++ b/include/linux/pid_namespace.h | |||
| @@ -79,11 +79,7 @@ static inline void zap_pid_ns_processes(struct pid_namespace *ns) | |||
| 79 | } | 79 | } |
| 80 | #endif /* CONFIG_PID_NS */ | 80 | #endif /* CONFIG_PID_NS */ |
| 81 | 81 | ||
| 82 | static inline struct pid_namespace *task_active_pid_ns(struct task_struct *tsk) | 82 | extern struct pid_namespace *task_active_pid_ns(struct task_struct *tsk); |
| 83 | { | ||
| 84 | return tsk->nsproxy->pid_ns; | ||
| 85 | } | ||
| 86 | |||
| 87 | void pidhash_init(void); | 83 | void pidhash_init(void); |
| 88 | void pidmap_init(void); | 84 | void pidmap_init(void); |
| 89 | 85 | ||
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index 4b8cc6a32479..9a342699c607 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h | |||
| @@ -55,7 +55,6 @@ struct platform_driver { | |||
| 55 | int (*suspend_late)(struct platform_device *, pm_message_t state); | 55 | int (*suspend_late)(struct platform_device *, pm_message_t state); |
| 56 | int (*resume_early)(struct platform_device *); | 56 | int (*resume_early)(struct platform_device *); |
| 57 | int (*resume)(struct platform_device *); | 57 | int (*resume)(struct platform_device *); |
| 58 | struct pm_ext_ops *pm; | ||
| 59 | struct device_driver driver; | 58 | struct device_driver driver; |
| 60 | }; | 59 | }; |
| 61 | 60 | ||
diff --git a/include/linux/pm.h b/include/linux/pm.h index 42de4003c4ee..de2e0a8f6728 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
| @@ -41,7 +41,7 @@ typedef struct pm_message { | |||
| 41 | } pm_message_t; | 41 | } pm_message_t; |
| 42 | 42 | ||
| 43 | /** | 43 | /** |
| 44 | * struct pm_ops - device PM callbacks | 44 | * struct dev_pm_ops - device PM callbacks |
| 45 | * | 45 | * |
| 46 | * Several driver power state transitions are externally visible, affecting | 46 | * Several driver power state transitions are externally visible, affecting |
| 47 | * the state of pending I/O queues and (for drivers that touch hardware) | 47 | * the state of pending I/O queues and (for drivers that touch hardware) |
| @@ -126,46 +126,6 @@ typedef struct pm_message { | |||
| 126 | * On most platforms, there are no restrictions on availability of | 126 | * On most platforms, there are no restrictions on availability of |
| 127 | * resources like clocks during @restore(). | 127 | * resources like clocks during @restore(). |
| 128 | * | 128 | * |
| 129 | * All of the above callbacks, except for @complete(), return error codes. | ||
| 130 | * However, the error codes returned by the resume operations, @resume(), | ||
| 131 | * @thaw(), and @restore(), do not cause the PM core to abort the resume | ||
| 132 | * transition during which they are returned. The error codes returned in | ||
| 133 | * that cases are only printed by the PM core to the system logs for debugging | ||
| 134 | * purposes. Still, it is recommended that drivers only return error codes | ||
| 135 | * from their resume methods in case of an unrecoverable failure (i.e. when the | ||
| 136 | * device being handled refuses to resume and becomes unusable) to allow us to | ||
| 137 | * modify the PM core in the future, so that it can avoid attempting to handle | ||
| 138 | * devices that failed to resume and their children. | ||
| 139 | * | ||
| 140 | * It is allowed to unregister devices while the above callbacks are being | ||
| 141 | * executed. However, it is not allowed to unregister a device from within any | ||
| 142 | * of its own callbacks. | ||
| 143 | */ | ||
| 144 | |||
| 145 | struct pm_ops { | ||
| 146 | int (*prepare)(struct device *dev); | ||
| 147 | void (*complete)(struct device *dev); | ||
| 148 | int (*suspend)(struct device *dev); | ||
| 149 | int (*resume)(struct device *dev); | ||
| 150 | int (*freeze)(struct device *dev); | ||
| 151 | int (*thaw)(struct device *dev); | ||
| 152 | int (*poweroff)(struct device *dev); | ||
| 153 | int (*restore)(struct device *dev); | ||
| 154 | }; | ||
| 155 | |||
| 156 | /** | ||
| 157 | * struct pm_ext_ops - extended device PM callbacks | ||
| 158 | * | ||
| 159 | * Some devices require certain operations related to suspend and hibernation | ||
| 160 | * to be carried out with interrupts disabled. Thus, 'struct pm_ext_ops' below | ||
| 161 | * is defined, adding callbacks to be executed with interrupts disabled to | ||
| 162 | * 'struct pm_ops'. | ||
| 163 | * | ||
| 164 | * The following callbacks included in 'struct pm_ext_ops' are executed with | ||
| 165 | * the nonboot CPUs switched off and with interrupts disabled on the only | ||
| 166 | * functional CPU. They also are executed with the PM core list of devices | ||
| 167 | * locked, so they must NOT unregister any devices. | ||
| 168 | * | ||
| 169 | * @suspend_noirq: Complete the operations of ->suspend() by carrying out any | 129 | * @suspend_noirq: Complete the operations of ->suspend() by carrying out any |
| 170 | * actions required for suspending the device that need interrupts to be | 130 | * actions required for suspending the device that need interrupts to be |
| 171 | * disabled | 131 | * disabled |
| @@ -190,18 +150,32 @@ struct pm_ops { | |||
| 190 | * actions required for restoring the operations of the device that need | 150 | * actions required for restoring the operations of the device that need |
| 191 | * interrupts to be disabled | 151 | * interrupts to be disabled |
| 192 | * | 152 | * |
| 193 | * All of the above callbacks return error codes, but the error codes returned | 153 | * All of the above callbacks, except for @complete(), return error codes. |
| 194 | * by the resume operations, @resume_noirq(), @thaw_noirq(), and | 154 | * However, the error codes returned by the resume operations, @resume(), |
| 195 | * @restore_noirq(), do not cause the PM core to abort the resume transition | 155 | * @thaw(), @restore(), @resume_noirq(), @thaw_noirq(), and @restore_noirq() do |
| 196 | * during which they are returned. The error codes returned in that cases are | 156 | * not cause the PM core to abort the resume transition during which they are |
| 197 | * only printed by the PM core to the system logs for debugging purposes. | 157 | * returned. The error codes returned in that cases are only printed by the PM |
| 198 | * Still, as stated above, it is recommended that drivers only return error | 158 | * core to the system logs for debugging purposes. Still, it is recommended |
| 199 | * codes from their resume methods if the device being handled fails to resume | 159 | * that drivers only return error codes from their resume methods in case of an |
| 200 | * and is not usable any more. | 160 | * unrecoverable failure (i.e. when the device being handled refuses to resume |
| 161 | * and becomes unusable) to allow us to modify the PM core in the future, so | ||
| 162 | * that it can avoid attempting to handle devices that failed to resume and | ||
| 163 | * their children. | ||
| 164 | * | ||
| 165 | * It is allowed to unregister devices while the above callbacks are being | ||
| 166 | * executed. However, it is not allowed to unregister a device from within any | ||
| 167 | * of its own callbacks. | ||
| 201 | */ | 168 | */ |
| 202 | 169 | ||
| 203 | struct pm_ext_ops { | 170 | struct dev_pm_ops { |
| 204 | struct pm_ops base; | 171 | int (*prepare)(struct device *dev); |
| 172 | void (*complete)(struct device *dev); | ||
| 173 | int (*suspend)(struct device *dev); | ||
| 174 | int (*resume)(struct device *dev); | ||
| 175 | int (*freeze)(struct device *dev); | ||
| 176 | int (*thaw)(struct device *dev); | ||
| 177 | int (*poweroff)(struct device *dev); | ||
| 178 | int (*restore)(struct device *dev); | ||
| 205 | int (*suspend_noirq)(struct device *dev); | 179 | int (*suspend_noirq)(struct device *dev); |
| 206 | int (*resume_noirq)(struct device *dev); | 180 | int (*resume_noirq)(struct device *dev); |
| 207 | int (*freeze_noirq)(struct device *dev); | 181 | int (*freeze_noirq)(struct device *dev); |
| @@ -278,7 +252,7 @@ struct pm_ext_ops { | |||
| 278 | #define PM_EVENT_SLEEP (PM_EVENT_SUSPEND | PM_EVENT_HIBERNATE) | 252 | #define PM_EVENT_SLEEP (PM_EVENT_SUSPEND | PM_EVENT_HIBERNATE) |
| 279 | #define PM_EVENT_USER_SUSPEND (PM_EVENT_USER | PM_EVENT_SUSPEND) | 253 | #define PM_EVENT_USER_SUSPEND (PM_EVENT_USER | PM_EVENT_SUSPEND) |
| 280 | #define PM_EVENT_USER_RESUME (PM_EVENT_USER | PM_EVENT_RESUME) | 254 | #define PM_EVENT_USER_RESUME (PM_EVENT_USER | PM_EVENT_RESUME) |
| 281 | #define PM_EVENT_REMOTE_WAKEUP (PM_EVENT_REMOTE | PM_EVENT_RESUME) | 255 | #define PM_EVENT_REMOTE_RESUME (PM_EVENT_REMOTE | PM_EVENT_RESUME) |
| 282 | #define PM_EVENT_AUTO_SUSPEND (PM_EVENT_AUTO | PM_EVENT_SUSPEND) | 256 | #define PM_EVENT_AUTO_SUSPEND (PM_EVENT_AUTO | PM_EVENT_SUSPEND) |
| 283 | #define PM_EVENT_AUTO_RESUME (PM_EVENT_AUTO | PM_EVENT_RESUME) | 257 | #define PM_EVENT_AUTO_RESUME (PM_EVENT_AUTO | PM_EVENT_RESUME) |
| 284 | 258 | ||
| @@ -291,15 +265,15 @@ struct pm_ext_ops { | |||
| 291 | #define PMSG_THAW ((struct pm_message){ .event = PM_EVENT_THAW, }) | 265 | #define PMSG_THAW ((struct pm_message){ .event = PM_EVENT_THAW, }) |
| 292 | #define PMSG_RESTORE ((struct pm_message){ .event = PM_EVENT_RESTORE, }) | 266 | #define PMSG_RESTORE ((struct pm_message){ .event = PM_EVENT_RESTORE, }) |
| 293 | #define PMSG_RECOVER ((struct pm_message){ .event = PM_EVENT_RECOVER, }) | 267 | #define PMSG_RECOVER ((struct pm_message){ .event = PM_EVENT_RECOVER, }) |
| 294 | #define PMSG_USER_SUSPEND ((struct pm_messge) \ | 268 | #define PMSG_USER_SUSPEND ((struct pm_message) \ |
| 295 | { .event = PM_EVENT_USER_SUSPEND, }) | 269 | { .event = PM_EVENT_USER_SUSPEND, }) |
| 296 | #define PMSG_USER_RESUME ((struct pm_messge) \ | 270 | #define PMSG_USER_RESUME ((struct pm_message) \ |
| 297 | { .event = PM_EVENT_USER_RESUME, }) | 271 | { .event = PM_EVENT_USER_RESUME, }) |
| 298 | #define PMSG_REMOTE_RESUME ((struct pm_messge) \ | 272 | #define PMSG_REMOTE_RESUME ((struct pm_message) \ |
| 299 | { .event = PM_EVENT_REMOTE_RESUME, }) | 273 | { .event = PM_EVENT_REMOTE_RESUME, }) |
| 300 | #define PMSG_AUTO_SUSPEND ((struct pm_messge) \ | 274 | #define PMSG_AUTO_SUSPEND ((struct pm_message) \ |
| 301 | { .event = PM_EVENT_AUTO_SUSPEND, }) | 275 | { .event = PM_EVENT_AUTO_SUSPEND, }) |
| 302 | #define PMSG_AUTO_RESUME ((struct pm_messge) \ | 276 | #define PMSG_AUTO_RESUME ((struct pm_message) \ |
| 303 | { .event = PM_EVENT_AUTO_RESUME, }) | 277 | { .event = PM_EVENT_AUTO_RESUME, }) |
| 304 | 278 | ||
| 305 | /** | 279 | /** |
diff --git a/include/linux/poll.h b/include/linux/poll.h index badd98ab06f6..8c24ef8d9976 100644 --- a/include/linux/poll.h +++ b/include/linux/poll.h | |||
| @@ -46,9 +46,9 @@ static inline void init_poll_funcptr(poll_table *pt, poll_queue_proc qproc) | |||
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | struct poll_table_entry { | 48 | struct poll_table_entry { |
| 49 | struct file * filp; | 49 | struct file *filp; |
| 50 | wait_queue_t wait; | 50 | wait_queue_t wait; |
| 51 | wait_queue_head_t * wait_address; | 51 | wait_queue_head_t *wait_address; |
| 52 | }; | 52 | }; |
| 53 | 53 | ||
| 54 | /* | 54 | /* |
| @@ -56,7 +56,9 @@ struct poll_table_entry { | |||
| 56 | */ | 56 | */ |
| 57 | struct poll_wqueues { | 57 | struct poll_wqueues { |
| 58 | poll_table pt; | 58 | poll_table pt; |
| 59 | struct poll_table_page * table; | 59 | struct poll_table_page *table; |
| 60 | struct task_struct *polling_task; | ||
| 61 | int triggered; | ||
| 60 | int error; | 62 | int error; |
| 61 | int inline_index; | 63 | int inline_index; |
| 62 | struct poll_table_entry inline_entries[N_INLINE_POLL_ENTRIES]; | 64 | struct poll_table_entry inline_entries[N_INLINE_POLL_ENTRIES]; |
| @@ -64,6 +66,13 @@ struct poll_wqueues { | |||
| 64 | 66 | ||
| 65 | extern void poll_initwait(struct poll_wqueues *pwq); | 67 | extern void poll_initwait(struct poll_wqueues *pwq); |
| 66 | extern void poll_freewait(struct poll_wqueues *pwq); | 68 | extern void poll_freewait(struct poll_wqueues *pwq); |
| 69 | extern int poll_schedule_timeout(struct poll_wqueues *pwq, int state, | ||
| 70 | ktime_t *expires, unsigned long slack); | ||
| 71 | |||
| 72 | static inline int poll_schedule(struct poll_wqueues *pwq, int state) | ||
| 73 | { | ||
| 74 | return poll_schedule_timeout(pwq, state, NULL, 0); | ||
| 75 | } | ||
| 67 | 76 | ||
| 68 | /* | 77 | /* |
| 69 | * Scaleable version of the fd_set. | 78 | * Scaleable version of the fd_set. |
diff --git a/include/linux/qnx4_fs.h b/include/linux/qnx4_fs.h index 34a196ee7941..787d19ea9f46 100644 --- a/include/linux/qnx4_fs.h +++ b/include/linux/qnx4_fs.h | |||
| @@ -2,14 +2,12 @@ | |||
| 2 | * Name : qnx4_fs.h | 2 | * Name : qnx4_fs.h |
| 3 | * Author : Richard Frowijn | 3 | * Author : Richard Frowijn |
| 4 | * Function : qnx4 global filesystem definitions | 4 | * Function : qnx4 global filesystem definitions |
| 5 | * Version : 1.0.2 | ||
| 6 | * Last modified : 2000-01-31 | ||
| 7 | * | ||
| 8 | * History : 23-03-1998 created | 5 | * History : 23-03-1998 created |
| 9 | */ | 6 | */ |
| 10 | #ifndef _LINUX_QNX4_FS_H | 7 | #ifndef _LINUX_QNX4_FS_H |
| 11 | #define _LINUX_QNX4_FS_H | 8 | #define _LINUX_QNX4_FS_H |
| 12 | 9 | ||
| 10 | #include <linux/types.h> | ||
| 13 | #include <linux/qnxtypes.h> | 11 | #include <linux/qnxtypes.h> |
| 14 | #include <linux/magic.h> | 12 | #include <linux/magic.h> |
| 15 | 13 | ||
diff --git a/include/linux/qnxtypes.h b/include/linux/qnxtypes.h index a3eb1137857b..bebbe5cc4fb8 100644 --- a/include/linux/qnxtypes.h +++ b/include/linux/qnxtypes.h | |||
| @@ -2,9 +2,6 @@ | |||
| 2 | * Name : qnxtypes.h | 2 | * Name : qnxtypes.h |
| 3 | * Author : Richard Frowijn | 3 | * Author : Richard Frowijn |
| 4 | * Function : standard qnx types | 4 | * Function : standard qnx types |
| 5 | * Version : 1.0.2 | ||
| 6 | * Last modified : 2000-01-06 | ||
| 7 | * | ||
| 8 | * History : 22-03-1998 created | 5 | * History : 22-03-1998 created |
| 9 | * | 6 | * |
| 10 | */ | 7 | */ |
| @@ -12,6 +9,8 @@ | |||
| 12 | #ifndef _QNX4TYPES_H | 9 | #ifndef _QNX4TYPES_H |
| 13 | #define _QNX4TYPES_H | 10 | #define _QNX4TYPES_H |
| 14 | 11 | ||
| 12 | #include <linux/types.h> | ||
| 13 | |||
| 15 | typedef __le16 qnx4_nxtnt_t; | 14 | typedef __le16 qnx4_nxtnt_t; |
| 16 | typedef __u8 qnx4_ftype_t; | 15 | typedef __u8 qnx4_ftype_t; |
| 17 | 16 | ||
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h index 8fc909ef6787..9743e4dbc918 100644 --- a/include/linux/raid/md_k.h +++ b/include/linux/raid/md_k.h | |||
| @@ -137,6 +137,9 @@ struct mddev_s | |||
| 137 | struct gendisk *gendisk; | 137 | struct gendisk *gendisk; |
| 138 | 138 | ||
| 139 | struct kobject kobj; | 139 | struct kobject kobj; |
| 140 | int hold_active; | ||
| 141 | #define UNTIL_IOCTL 1 | ||
| 142 | #define UNTIL_STOP 2 | ||
| 140 | 143 | ||
| 141 | /* Superblock information */ | 144 | /* Superblock information */ |
| 142 | int major_version, | 145 | int major_version, |
| @@ -215,6 +218,9 @@ struct mddev_s | |||
| 215 | #define MD_RECOVERY_FROZEN 9 | 218 | #define MD_RECOVERY_FROZEN 9 |
| 216 | 219 | ||
| 217 | unsigned long recovery; | 220 | unsigned long recovery; |
| 221 | int recovery_disabled; /* if we detect that recovery | ||
| 222 | * will always fail, set this | ||
| 223 | * so we don't loop trying */ | ||
| 218 | 224 | ||
| 219 | int in_sync; /* know to not need resync */ | 225 | int in_sync; /* know to not need resync */ |
| 220 | struct mutex reconfig_mutex; | 226 | struct mutex reconfig_mutex; |
| @@ -244,6 +250,9 @@ struct mddev_s | |||
| 244 | struct sysfs_dirent *sysfs_state; /* handle for 'array_state' | 250 | struct sysfs_dirent *sysfs_state; /* handle for 'array_state' |
| 245 | * file in sysfs. | 251 | * file in sysfs. |
| 246 | */ | 252 | */ |
| 253 | struct sysfs_dirent *sysfs_action; /* handle for 'sync_action' */ | ||
| 254 | |||
| 255 | struct work_struct del_work; /* used for delayed sysfs removal */ | ||
| 247 | 256 | ||
| 248 | spinlock_t write_lock; | 257 | spinlock_t write_lock; |
| 249 | wait_queue_head_t sb_wait; /* for waiting on superblock updates */ | 258 | wait_queue_head_t sb_wait; /* for waiting on superblock updates */ |
| @@ -334,17 +343,14 @@ static inline char * mdname (mddev_t * mddev) | |||
| 334 | * iterates through some rdev ringlist. It's safe to remove the | 343 | * iterates through some rdev ringlist. It's safe to remove the |
| 335 | * current 'rdev'. Dont touch 'tmp' though. | 344 | * current 'rdev'. Dont touch 'tmp' though. |
| 336 | */ | 345 | */ |
| 337 | #define rdev_for_each_list(rdev, tmp, list) \ | 346 | #define rdev_for_each_list(rdev, tmp, head) \ |
| 338 | \ | 347 | list_for_each_entry_safe(rdev, tmp, head, same_set) |
| 339 | for ((tmp) = (list).next; \ | 348 | |
| 340 | (rdev) = (list_entry((tmp), mdk_rdev_t, same_set)), \ | ||
| 341 | (tmp) = (tmp)->next, (tmp)->prev != &(list) \ | ||
| 342 | ; ) | ||
| 343 | /* | 349 | /* |
| 344 | * iterates through the 'same array disks' ringlist | 350 | * iterates through the 'same array disks' ringlist |
| 345 | */ | 351 | */ |
| 346 | #define rdev_for_each(rdev, tmp, mddev) \ | 352 | #define rdev_for_each(rdev, tmp, mddev) \ |
| 347 | rdev_for_each_list(rdev, tmp, (mddev)->disks) | 353 | list_for_each_entry_safe(rdev, tmp, &((mddev)->disks), same_set) |
| 348 | 354 | ||
| 349 | #define rdev_for_each_rcu(rdev, mddev) \ | 355 | #define rdev_for_each_rcu(rdev, mddev) \ |
| 350 | list_for_each_entry_rcu(rdev, &((mddev)->disks), same_set) | 356 | list_for_each_entry_rcu(rdev, &((mddev)->disks), same_set) |
diff --git a/include/linux/raid/md_p.h b/include/linux/raid/md_p.h index 8b4de4a41ff1..9491026afe66 100644 --- a/include/linux/raid/md_p.h +++ b/include/linux/raid/md_p.h | |||
| @@ -194,6 +194,8 @@ static inline __u64 md_event(mdp_super_t *sb) { | |||
| 194 | return (ev<<32)| sb->events_lo; | 194 | return (ev<<32)| sb->events_lo; |
| 195 | } | 195 | } |
| 196 | 196 | ||
| 197 | #define MD_SUPERBLOCK_1_TIME_SEC_MASK ((1ULL<<40) - 1) | ||
| 198 | |||
| 197 | /* | 199 | /* |
| 198 | * The version-1 superblock : | 200 | * The version-1 superblock : |
| 199 | * All numeric fields are little-endian. | 201 | * All numeric fields are little-endian. |
diff --git a/include/linux/raid/raid0.h b/include/linux/raid/raid0.h index 1b2dda035f8e..fd42aa87c391 100644 --- a/include/linux/raid/raid0.h +++ b/include/linux/raid/raid0.h | |||
| @@ -5,9 +5,9 @@ | |||
| 5 | 5 | ||
| 6 | struct strip_zone | 6 | struct strip_zone |
| 7 | { | 7 | { |
| 8 | sector_t zone_offset; /* Zone offset in md_dev */ | 8 | sector_t zone_start; /* Zone offset in md_dev (in sectors) */ |
| 9 | sector_t dev_offset; /* Zone offset in real dev */ | 9 | sector_t dev_start; /* Zone offset in real dev (in sectors) */ |
| 10 | sector_t size; /* Zone size */ | 10 | sector_t sectors; /* Zone size in sectors */ |
| 11 | int nb_dev; /* # of devices attached to the zone */ | 11 | int nb_dev; /* # of devices attached to the zone */ |
| 12 | mdk_rdev_t **dev; /* Devices attached to the zone */ | 12 | mdk_rdev_t **dev; /* Devices attached to the zone */ |
| 13 | }; | 13 | }; |
| @@ -19,8 +19,8 @@ struct raid0_private_data | |||
| 19 | mdk_rdev_t **devlist; /* lists of rdevs, pointed to by strip_zone->dev */ | 19 | mdk_rdev_t **devlist; /* lists of rdevs, pointed to by strip_zone->dev */ |
| 20 | int nr_strip_zones; | 20 | int nr_strip_zones; |
| 21 | 21 | ||
| 22 | sector_t hash_spacing; | 22 | sector_t spacing; |
| 23 | int preshift; /* shift this before divide by hash_spacing */ | 23 | int sector_shift; /* shift this before divide by spacing */ |
| 24 | }; | 24 | }; |
| 25 | 25 | ||
| 26 | typedef struct raid0_private_data raid0_conf_t; | 26 | typedef struct raid0_private_data raid0_conf_t; |
diff --git a/include/linux/rbtree.h b/include/linux/rbtree.h index 344bc3495ddb..9c295411d01f 100644 --- a/include/linux/rbtree.h +++ b/include/linux/rbtree.h | |||
| @@ -140,10 +140,10 @@ extern void rb_insert_color(struct rb_node *, struct rb_root *); | |||
| 140 | extern void rb_erase(struct rb_node *, struct rb_root *); | 140 | extern void rb_erase(struct rb_node *, struct rb_root *); |
| 141 | 141 | ||
| 142 | /* Find logical next and previous nodes in a tree */ | 142 | /* Find logical next and previous nodes in a tree */ |
| 143 | extern struct rb_node *rb_next(struct rb_node *); | 143 | extern struct rb_node *rb_next(const struct rb_node *); |
| 144 | extern struct rb_node *rb_prev(struct rb_node *); | 144 | extern struct rb_node *rb_prev(const struct rb_node *); |
| 145 | extern struct rb_node *rb_first(struct rb_root *); | 145 | extern struct rb_node *rb_first(const struct rb_root *); |
| 146 | extern struct rb_node *rb_last(struct rb_root *); | 146 | extern struct rb_node *rb_last(const struct rb_root *); |
| 147 | 147 | ||
| 148 | /* Fast replacement of a single node without remove/rebalance/add/rebalance */ | 148 | /* Fast replacement of a single node without remove/rebalance/add/rebalance */ |
| 149 | extern void rb_replace_node(struct rb_node *victim, struct rb_node *new, | 149 | extern void rb_replace_node(struct rb_node *victim, struct rb_node *new, |
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 1168fbcea8d4..921340a7b71c 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
| @@ -204,18 +204,6 @@ struct rcu_synchronize { | |||
| 204 | 204 | ||
| 205 | extern void wakeme_after_rcu(struct rcu_head *head); | 205 | extern void wakeme_after_rcu(struct rcu_head *head); |
| 206 | 206 | ||
| 207 | #define synchronize_rcu_xxx(name, func) \ | ||
| 208 | void name(void) \ | ||
| 209 | { \ | ||
| 210 | struct rcu_synchronize rcu; \ | ||
| 211 | \ | ||
| 212 | init_completion(&rcu.completion); \ | ||
| 213 | /* Will wake me after RCU finished. */ \ | ||
| 214 | func(&rcu.head, wakeme_after_rcu); \ | ||
| 215 | /* Wait for it. */ \ | ||
| 216 | wait_for_completion(&rcu.completion); \ | ||
| 217 | } | ||
| 218 | |||
| 219 | /** | 207 | /** |
| 220 | * synchronize_sched - block until all CPUs have exited any non-preemptive | 208 | * synchronize_sched - block until all CPUs have exited any non-preemptive |
| 221 | * kernel code sequences. | 209 | * kernel code sequences. |
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h index afdc4558bb94..801bf77ff4e2 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h | |||
| @@ -104,10 +104,10 @@ struct regulator; | |||
| 104 | /** | 104 | /** |
| 105 | * struct regulator_bulk_data - Data used for bulk regulator operations. | 105 | * struct regulator_bulk_data - Data used for bulk regulator operations. |
| 106 | * | 106 | * |
| 107 | * @supply The name of the supply. Initialised by the user before | 107 | * @supply: The name of the supply. Initialised by the user before |
| 108 | * using the bulk regulator APIs. | 108 | * using the bulk regulator APIs. |
| 109 | * @consumer The regulator consumer for the supply. This will be managed | 109 | * @consumer: The regulator consumer for the supply. This will be managed |
| 110 | * by the bulk API. | 110 | * by the bulk API. |
| 111 | * | 111 | * |
| 112 | * The regulator APIs provide a series of regulator_bulk_() API calls as | 112 | * The regulator APIs provide a series of regulator_bulk_() API calls as |
| 113 | * a convenience to consumers which require multiple supplies. This | 113 | * a convenience to consumers which require multiple supplies. This |
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h index e37d80561985..2dae05705f13 100644 --- a/include/linux/regulator/driver.h +++ b/include/linux/regulator/driver.h | |||
| @@ -24,7 +24,33 @@ struct regulator_init_data; | |||
| 24 | /** | 24 | /** |
| 25 | * struct regulator_ops - regulator operations. | 25 | * struct regulator_ops - regulator operations. |
| 26 | * | 26 | * |
| 27 | * This struct describes regulator operations. | 27 | * This struct describes regulator operations which can be implemented by |
| 28 | * regulator chip drivers. | ||
| 29 | * | ||
| 30 | * @enable: Enable the regulator. | ||
| 31 | * @disable: Disable the regulator. | ||
| 32 | * @is_enabled: Return 1 if the regulator is enabled, 0 otherwise. | ||
| 33 | * | ||
| 34 | * @set_voltage: Set the voltage for the regulator within the range specified. | ||
| 35 | * The driver should select the voltage closest to min_uV. | ||
| 36 | * @get_voltage: Return the currently configured voltage for the regulator. | ||
| 37 | * | ||
| 38 | * @set_current_limit: Configure a limit for a current-limited regulator. | ||
| 39 | * @get_current_limit: Get the limit for a current-limited regulator. | ||
| 40 | * | ||
| 41 | * @set_mode: Set the operating mode for the regulator. | ||
| 42 | * @get_mode: Get the current operating mode for the regulator. | ||
| 43 | * @get_optimum_mode: Get the most efficient operating mode for the regulator | ||
| 44 | * when running with the specified parameters. | ||
| 45 | * | ||
| 46 | * @set_suspend_voltage: Set the voltage for the regulator when the system | ||
| 47 | * is suspended. | ||
| 48 | * @set_suspend_enable: Mark the regulator as enabled when the system is | ||
| 49 | * suspended. | ||
| 50 | * @set_suspend_disable: Mark the regulator as disabled when the system is | ||
| 51 | * suspended. | ||
| 52 | * @set_suspend_mode: Set the operating mode for the regulator when the | ||
| 53 | * system is suspended. | ||
| 28 | */ | 54 | */ |
| 29 | struct regulator_ops { | 55 | struct regulator_ops { |
| 30 | 56 | ||
| @@ -75,6 +101,15 @@ enum regulator_type { | |||
| 75 | /** | 101 | /** |
| 76 | * struct regulator_desc - Regulator descriptor | 102 | * struct regulator_desc - Regulator descriptor |
| 77 | * | 103 | * |
| 104 | * Each regulator registered with the core is described with a structure of | ||
| 105 | * this type. | ||
| 106 | * | ||
| 107 | * @name: Identifying name for the regulator. | ||
| 108 | * @id: Numerical identifier for the regulator. | ||
| 109 | * @ops: Regulator operations table. | ||
| 110 | * @irq: Interrupt number for the regulator. | ||
| 111 | * @type: Indicates if the regulator is a voltage or current regulator. | ||
| 112 | * @owner: Module providing the regulator, used for refcounting. | ||
| 78 | */ | 113 | */ |
| 79 | struct regulator_desc { | 114 | struct regulator_desc { |
| 80 | const char *name; | 115 | const char *name; |
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h index c6d69331a81e..3794773b23d2 100644 --- a/include/linux/regulator/machine.h +++ b/include/linux/regulator/machine.h | |||
| @@ -44,6 +44,10 @@ struct regulator; | |||
| 44 | * struct regulator_state - regulator state during low power syatem states | 44 | * struct regulator_state - regulator state during low power syatem states |
| 45 | * | 45 | * |
| 46 | * This describes a regulators state during a system wide low power state. | 46 | * This describes a regulators state during a system wide low power state. |
| 47 | * | ||
| 48 | * @uV: Operating voltage during suspend. | ||
| 49 | * @mode: Operating mode during suspend. | ||
| 50 | * @enabled: Enabled during suspend. | ||
| 47 | */ | 51 | */ |
| 48 | struct regulator_state { | 52 | struct regulator_state { |
| 49 | int uV; /* suspend voltage */ | 53 | int uV; /* suspend voltage */ |
| @@ -55,6 +59,30 @@ struct regulator_state { | |||
| 55 | * struct regulation_constraints - regulator operating constraints. | 59 | * struct regulation_constraints - regulator operating constraints. |
| 56 | * | 60 | * |
| 57 | * This struct describes regulator and board/machine specific constraints. | 61 | * This struct describes regulator and board/machine specific constraints. |
| 62 | * | ||
| 63 | * @name: Descriptive name for the constraints, used for display purposes. | ||
| 64 | * | ||
| 65 | * @min_uV: Smallest voltage consumers may set. | ||
| 66 | * @max_uV: Largest voltage consumers may set. | ||
| 67 | * | ||
| 68 | * @min_uA: Smallest consumers consumers may set. | ||
| 69 | * @max_uA: Largest current consumers may set. | ||
| 70 | * | ||
| 71 | * @valid_modes_mask: Mask of modes which may be configured by consumers. | ||
| 72 | * @valid_ops_mask: Operations which may be performed by consumers. | ||
| 73 | * | ||
| 74 | * @always_on: Set if the regulator should never be disabled. | ||
| 75 | * @boot_on: Set if the regulator is enabled when the system is initially | ||
| 76 | * started. | ||
| 77 | * @apply_uV: Apply the voltage constraint when initialising. | ||
| 78 | * | ||
| 79 | * @input_uV: Input voltage for regulator when supplied by another regulator. | ||
| 80 | * | ||
| 81 | * @state_disk: State for regulator when system is suspended in disk mode. | ||
| 82 | * @state_mem: State for regulator when system is suspended in mem mode. | ||
| 83 | * @state_standby: State for regulator when system is suspended in standby | ||
| 84 | * mode. | ||
| 85 | * @initial_state: Suspend state to set by default. | ||
| 58 | */ | 86 | */ |
| 59 | struct regulation_constraints { | 87 | struct regulation_constraints { |
| 60 | 88 | ||
| @@ -93,6 +121,9 @@ struct regulation_constraints { | |||
| 93 | * struct regulator_consumer_supply - supply -> device mapping | 121 | * struct regulator_consumer_supply - supply -> device mapping |
| 94 | * | 122 | * |
| 95 | * This maps a supply name to a device. | 123 | * This maps a supply name to a device. |
| 124 | * | ||
| 125 | * @dev: Device structure for the consumer. | ||
| 126 | * @supply: Name for the supply. | ||
| 96 | */ | 127 | */ |
| 97 | struct regulator_consumer_supply { | 128 | struct regulator_consumer_supply { |
| 98 | struct device *dev; /* consumer */ | 129 | struct device *dev; /* consumer */ |
| @@ -103,6 +134,16 @@ struct regulator_consumer_supply { | |||
| 103 | * struct regulator_init_data - regulator platform initialisation data. | 134 | * struct regulator_init_data - regulator platform initialisation data. |
| 104 | * | 135 | * |
| 105 | * Initialisation constraints, our supply and consumers supplies. | 136 | * Initialisation constraints, our supply and consumers supplies. |
| 137 | * | ||
| 138 | * @supply_regulator_dev: Parent regulator (if any). | ||
| 139 | * | ||
| 140 | * @constraints: Constraints. These must be specified for the regulator to | ||
| 141 | * be usable. | ||
| 142 | * @num_consumer_supplies: Number of consumer device supplies. | ||
| 143 | * @consumer_supplies: Consumer device supply configuration. | ||
| 144 | * | ||
| 145 | * @regulator_init: Callback invoked when the regulator has been registered. | ||
| 146 | * @driver_data: Data passed to regulator_init. | ||
| 106 | */ | 147 | */ |
| 107 | struct regulator_init_data { | 148 | struct regulator_init_data { |
| 108 | struct device *supply_regulator_dev; /* or NULL for LINE */ | 149 | struct device *supply_regulator_dev; /* or NULL for LINE */ |
diff --git a/include/linux/res_counter.h b/include/linux/res_counter.h index 271c1c2c9f6f..dede0a2cfc45 100644 --- a/include/linux/res_counter.h +++ b/include/linux/res_counter.h | |||
| @@ -43,6 +43,10 @@ struct res_counter { | |||
| 43 | * the routines below consider this to be IRQ-safe | 43 | * the routines below consider this to be IRQ-safe |
| 44 | */ | 44 | */ |
| 45 | spinlock_t lock; | 45 | spinlock_t lock; |
| 46 | /* | ||
| 47 | * Parent counter, used for hierarchial resource accounting | ||
| 48 | */ | ||
| 49 | struct res_counter *parent; | ||
| 46 | }; | 50 | }; |
| 47 | 51 | ||
| 48 | /** | 52 | /** |
| @@ -87,7 +91,7 @@ enum { | |||
| 87 | * helpers for accounting | 91 | * helpers for accounting |
| 88 | */ | 92 | */ |
| 89 | 93 | ||
| 90 | void res_counter_init(struct res_counter *counter); | 94 | void res_counter_init(struct res_counter *counter, struct res_counter *parent); |
| 91 | 95 | ||
| 92 | /* | 96 | /* |
| 93 | * charge - try to consume more resource. | 97 | * charge - try to consume more resource. |
| @@ -103,7 +107,7 @@ void res_counter_init(struct res_counter *counter); | |||
| 103 | int __must_check res_counter_charge_locked(struct res_counter *counter, | 107 | int __must_check res_counter_charge_locked(struct res_counter *counter, |
| 104 | unsigned long val); | 108 | unsigned long val); |
| 105 | int __must_check res_counter_charge(struct res_counter *counter, | 109 | int __must_check res_counter_charge(struct res_counter *counter, |
| 106 | unsigned long val); | 110 | unsigned long val, struct res_counter **limit_fail_at); |
| 107 | 111 | ||
| 108 | /* | 112 | /* |
| 109 | * uncharge - tell that some portion of the resource is released | 113 | * uncharge - tell that some portion of the resource is released |
diff --git a/include/linux/rio_drv.h b/include/linux/rio_drv.h index 32c0547ffafc..c93a58a40033 100644 --- a/include/linux/rio_drv.h +++ b/include/linux/rio_drv.h | |||
| @@ -391,7 +391,6 @@ static inline int rio_add_inb_buffer(struct rio_mport *mport, int mbox, | |||
| 391 | * rio_get_inb_message - Get A RIO message from an inbound mailbox queue | 391 | * rio_get_inb_message - Get A RIO message from an inbound mailbox queue |
| 392 | * @mport: Master port containing the inbound mailbox | 392 | * @mport: Master port containing the inbound mailbox |
| 393 | * @mbox: The inbound mailbox number | 393 | * @mbox: The inbound mailbox number |
| 394 | * @buffer: Pointer to the message buffer | ||
| 395 | * | 394 | * |
| 396 | * Get a RIO message from an inbound mailbox queue. Returns 0 on success. | 395 | * Get a RIO message from an inbound mailbox queue. Returns 0 on success. |
| 397 | */ | 396 | */ |
diff --git a/include/linux/rmap.h b/include/linux/rmap.h index 89f0564b10c8..b35bc0e19cd9 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h | |||
| @@ -63,16 +63,13 @@ void anon_vma_unlink(struct vm_area_struct *); | |||
| 63 | void anon_vma_link(struct vm_area_struct *); | 63 | void anon_vma_link(struct vm_area_struct *); |
| 64 | void __anon_vma_link(struct vm_area_struct *); | 64 | void __anon_vma_link(struct vm_area_struct *); |
| 65 | 65 | ||
| 66 | extern struct anon_vma *page_lock_anon_vma(struct page *page); | ||
| 67 | extern void page_unlock_anon_vma(struct anon_vma *anon_vma); | ||
| 68 | |||
| 69 | /* | 66 | /* |
| 70 | * rmap interfaces called when adding or removing pte of page | 67 | * rmap interfaces called when adding or removing pte of page |
| 71 | */ | 68 | */ |
| 72 | void page_add_anon_rmap(struct page *, struct vm_area_struct *, unsigned long); | 69 | void page_add_anon_rmap(struct page *, struct vm_area_struct *, unsigned long); |
| 73 | void page_add_new_anon_rmap(struct page *, struct vm_area_struct *, unsigned long); | 70 | void page_add_new_anon_rmap(struct page *, struct vm_area_struct *, unsigned long); |
| 74 | void page_add_file_rmap(struct page *); | 71 | void page_add_file_rmap(struct page *); |
| 75 | void page_remove_rmap(struct page *, struct vm_area_struct *); | 72 | void page_remove_rmap(struct page *); |
| 76 | 73 | ||
| 77 | #ifdef CONFIG_DEBUG_VM | 74 | #ifdef CONFIG_DEBUG_VM |
| 78 | void page_dup_rmap(struct page *page, struct vm_area_struct *vma, unsigned long address); | 75 | void page_dup_rmap(struct page *page, struct vm_area_struct *vma, unsigned long address); |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 38a3f4b15394..4cae9b81a1f8 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -386,6 +386,9 @@ extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long); | |||
| 386 | (mm)->hiwater_vm = (mm)->total_vm; \ | 386 | (mm)->hiwater_vm = (mm)->total_vm; \ |
| 387 | } while (0) | 387 | } while (0) |
| 388 | 388 | ||
| 389 | #define get_mm_hiwater_rss(mm) max((mm)->hiwater_rss, get_mm_rss(mm)) | ||
| 390 | #define get_mm_hiwater_vm(mm) max((mm)->hiwater_vm, (mm)->total_vm) | ||
| 391 | |||
| 389 | extern void set_dumpable(struct mm_struct *mm, int value); | 392 | extern void set_dumpable(struct mm_struct *mm, int value); |
| 390 | extern int get_dumpable(struct mm_struct *mm); | 393 | extern int get_dumpable(struct mm_struct *mm); |
| 391 | 394 | ||
| @@ -912,7 +915,6 @@ static inline struct cpumask *sched_domain_span(struct sched_domain *sd) | |||
| 912 | 915 | ||
| 913 | extern void partition_sched_domains(int ndoms_new, struct cpumask *doms_new, | 916 | extern void partition_sched_domains(int ndoms_new, struct cpumask *doms_new, |
| 914 | struct sched_domain_attr *dattr_new); | 917 | struct sched_domain_attr *dattr_new); |
| 915 | extern int arch_reinit_sched_domains(void); | ||
| 916 | 918 | ||
| 917 | /* Test a flag in parent sched domain */ | 919 | /* Test a flag in parent sched domain */ |
| 918 | static inline int test_sd_parent(struct sched_domain *sd, int flag) | 920 | static inline int test_sd_parent(struct sched_domain *sd, int flag) |
| @@ -1704,16 +1706,16 @@ extern void wake_up_idle_cpu(int cpu); | |||
| 1704 | static inline void wake_up_idle_cpu(int cpu) { } | 1706 | static inline void wake_up_idle_cpu(int cpu) { } |
| 1705 | #endif | 1707 | #endif |
| 1706 | 1708 | ||
| 1707 | #ifdef CONFIG_SCHED_DEBUG | ||
| 1708 | extern unsigned int sysctl_sched_latency; | 1709 | extern unsigned int sysctl_sched_latency; |
| 1709 | extern unsigned int sysctl_sched_min_granularity; | 1710 | extern unsigned int sysctl_sched_min_granularity; |
| 1710 | extern unsigned int sysctl_sched_wakeup_granularity; | 1711 | extern unsigned int sysctl_sched_wakeup_granularity; |
| 1712 | extern unsigned int sysctl_sched_shares_ratelimit; | ||
| 1713 | extern unsigned int sysctl_sched_shares_thresh; | ||
| 1714 | #ifdef CONFIG_SCHED_DEBUG | ||
| 1711 | extern unsigned int sysctl_sched_child_runs_first; | 1715 | extern unsigned int sysctl_sched_child_runs_first; |
| 1712 | extern unsigned int sysctl_sched_features; | 1716 | extern unsigned int sysctl_sched_features; |
| 1713 | extern unsigned int sysctl_sched_migration_cost; | 1717 | extern unsigned int sysctl_sched_migration_cost; |
| 1714 | extern unsigned int sysctl_sched_nr_migrate; | 1718 | extern unsigned int sysctl_sched_nr_migrate; |
| 1715 | extern unsigned int sysctl_sched_shares_ratelimit; | ||
| 1716 | extern unsigned int sysctl_sched_shares_thresh; | ||
| 1717 | 1719 | ||
| 1718 | int sched_nr_latency_handler(struct ctl_table *table, int write, | 1720 | int sched_nr_latency_handler(struct ctl_table *table, int write, |
| 1719 | struct file *file, void __user *buffer, size_t *length, | 1721 | struct file *file, void __user *buffer, size_t *length, |
diff --git a/include/linux/security.h b/include/linux/security.h index b92b5e453f64..1f2ab6353c00 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
| @@ -48,7 +48,8 @@ struct audit_krule; | |||
| 48 | * These functions are in security/capability.c and are used | 48 | * These functions are in security/capability.c and are used |
| 49 | * as the default capabilities functions | 49 | * as the default capabilities functions |
| 50 | */ | 50 | */ |
| 51 | extern int cap_capable(struct task_struct *tsk, int cap, int audit); | 51 | extern int cap_capable(struct task_struct *tsk, const struct cred *cred, |
| 52 | int cap, int audit); | ||
| 52 | extern int cap_settime(struct timespec *ts, struct timezone *tz); | 53 | extern int cap_settime(struct timespec *ts, struct timezone *tz); |
| 53 | extern int cap_ptrace_may_access(struct task_struct *child, unsigned int mode); | 54 | extern int cap_ptrace_may_access(struct task_struct *child, unsigned int mode); |
| 54 | extern int cap_ptrace_traceme(struct task_struct *parent); | 55 | extern int cap_ptrace_traceme(struct task_struct *parent); |
| @@ -1251,9 +1252,12 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
| 1251 | * @permitted contains the permitted capability set. | 1252 | * @permitted contains the permitted capability set. |
| 1252 | * Return 0 and update @new if permission is granted. | 1253 | * Return 0 and update @new if permission is granted. |
| 1253 | * @capable: | 1254 | * @capable: |
| 1254 | * Check whether the @tsk process has the @cap capability. | 1255 | * Check whether the @tsk process has the @cap capability in the indicated |
| 1256 | * credentials. | ||
| 1255 | * @tsk contains the task_struct for the process. | 1257 | * @tsk contains the task_struct for the process. |
| 1258 | * @cred contains the credentials to use. | ||
| 1256 | * @cap contains the capability <include/linux/capability.h>. | 1259 | * @cap contains the capability <include/linux/capability.h>. |
| 1260 | * @audit: Whether to write an audit message or not | ||
| 1257 | * Return 0 if the capability is granted for @tsk. | 1261 | * Return 0 if the capability is granted for @tsk. |
| 1258 | * @acct: | 1262 | * @acct: |
| 1259 | * Check permission before enabling or disabling process accounting. If | 1263 | * Check permission before enabling or disabling process accounting. If |
| @@ -1346,7 +1350,8 @@ struct security_operations { | |||
| 1346 | const kernel_cap_t *effective, | 1350 | const kernel_cap_t *effective, |
| 1347 | const kernel_cap_t *inheritable, | 1351 | const kernel_cap_t *inheritable, |
| 1348 | const kernel_cap_t *permitted); | 1352 | const kernel_cap_t *permitted); |
| 1349 | int (*capable) (struct task_struct *tsk, int cap, int audit); | 1353 | int (*capable) (struct task_struct *tsk, const struct cred *cred, |
| 1354 | int cap, int audit); | ||
| 1350 | int (*acct) (struct file *file); | 1355 | int (*acct) (struct file *file); |
| 1351 | int (*sysctl) (struct ctl_table *table, int op); | 1356 | int (*sysctl) (struct ctl_table *table, int op); |
| 1352 | int (*quotactl) (int cmds, int type, int id, struct super_block *sb); | 1357 | int (*quotactl) (int cmds, int type, int id, struct super_block *sb); |
| @@ -1628,8 +1633,9 @@ int security_capset(struct cred *new, const struct cred *old, | |||
| 1628 | const kernel_cap_t *effective, | 1633 | const kernel_cap_t *effective, |
| 1629 | const kernel_cap_t *inheritable, | 1634 | const kernel_cap_t *inheritable, |
| 1630 | const kernel_cap_t *permitted); | 1635 | const kernel_cap_t *permitted); |
| 1631 | int security_capable(struct task_struct *tsk, int cap); | 1636 | int security_capable(int cap); |
| 1632 | int security_capable_noaudit(struct task_struct *tsk, int cap); | 1637 | int security_real_capable(struct task_struct *tsk, int cap); |
| 1638 | int security_real_capable_noaudit(struct task_struct *tsk, int cap); | ||
| 1633 | int security_acct(struct file *file); | 1639 | int security_acct(struct file *file); |
| 1634 | int security_sysctl(struct ctl_table *table, int op); | 1640 | int security_sysctl(struct ctl_table *table, int op); |
| 1635 | int security_quotactl(int cmds, int type, int id, struct super_block *sb); | 1641 | int security_quotactl(int cmds, int type, int id, struct super_block *sb); |
| @@ -1826,14 +1832,31 @@ static inline int security_capset(struct cred *new, | |||
| 1826 | return cap_capset(new, old, effective, inheritable, permitted); | 1832 | return cap_capset(new, old, effective, inheritable, permitted); |
| 1827 | } | 1833 | } |
| 1828 | 1834 | ||
| 1829 | static inline int security_capable(struct task_struct *tsk, int cap) | 1835 | static inline int security_capable(int cap) |
| 1830 | { | 1836 | { |
| 1831 | return cap_capable(tsk, cap, SECURITY_CAP_AUDIT); | 1837 | return cap_capable(current, current_cred(), cap, SECURITY_CAP_AUDIT); |
| 1832 | } | 1838 | } |
| 1833 | 1839 | ||
| 1834 | static inline int security_capable_noaudit(struct task_struct *tsk, int cap) | 1840 | static inline int security_real_capable(struct task_struct *tsk, int cap) |
| 1835 | { | 1841 | { |
| 1836 | return cap_capable(tsk, cap, SECURITY_CAP_NOAUDIT); | 1842 | int ret; |
| 1843 | |||
| 1844 | rcu_read_lock(); | ||
| 1845 | ret = cap_capable(tsk, __task_cred(tsk), cap, SECURITY_CAP_AUDIT); | ||
| 1846 | rcu_read_unlock(); | ||
| 1847 | return ret; | ||
| 1848 | } | ||
| 1849 | |||
| 1850 | static inline | ||
| 1851 | int security_real_capable_noaudit(struct task_struct *tsk, int cap) | ||
| 1852 | { | ||
| 1853 | int ret; | ||
| 1854 | |||
| 1855 | rcu_read_lock(); | ||
| 1856 | ret = cap_capable(tsk, __task_cred(tsk), cap, | ||
| 1857 | SECURITY_CAP_NOAUDIT); | ||
| 1858 | rcu_read_unlock(); | ||
| 1859 | return ret; | ||
| 1837 | } | 1860 | } |
| 1838 | 1861 | ||
| 1839 | static inline int security_acct(struct file *file) | 1862 | static inline int security_acct(struct file *file) |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index b4199841f1fc..90bbbf0b1161 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
| @@ -161,6 +161,9 @@ | |||
| 161 | 161 | ||
| 162 | #define PORT_S3C6400 84 | 162 | #define PORT_S3C6400 84 |
| 163 | 163 | ||
| 164 | /* NWPSERIAL */ | ||
| 165 | #define PORT_NWPSERIAL 85 | ||
| 166 | |||
| 164 | #ifdef __KERNEL__ | 167 | #ifdef __KERNEL__ |
| 165 | 168 | ||
| 166 | #include <linux/compiler.h> | 169 | #include <linux/compiler.h> |
diff --git a/include/linux/serio.h b/include/linux/serio.h index 25641d9e0ea8..1bcb357a01a1 100644 --- a/include/linux/serio.h +++ b/include/linux/serio.h | |||
| @@ -213,5 +213,6 @@ static inline void serio_unpin_driver(struct serio *serio) | |||
| 213 | #define SERIO_ZHENHUA 0x36 | 213 | #define SERIO_ZHENHUA 0x36 |
| 214 | #define SERIO_INEXIO 0x37 | 214 | #define SERIO_INEXIO 0x37 |
| 215 | #define SERIO_TOUCHIT213 0x37 | 215 | #define SERIO_TOUCHIT213 0x37 |
| 216 | #define SERIO_W8001 0x39 | ||
| 216 | 217 | ||
| 217 | #endif | 218 | #endif |
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index 82229317753d..68bb1c501d0d 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h | |||
| @@ -327,9 +327,9 @@ extern struct spi_master *spi_busnum_to_master(u16 busnum); | |||
| 327 | * @tx_dma: DMA address of tx_buf, if @spi_message.is_dma_mapped | 327 | * @tx_dma: DMA address of tx_buf, if @spi_message.is_dma_mapped |
| 328 | * @rx_dma: DMA address of rx_buf, if @spi_message.is_dma_mapped | 328 | * @rx_dma: DMA address of rx_buf, if @spi_message.is_dma_mapped |
| 329 | * @len: size of rx and tx buffers (in bytes) | 329 | * @len: size of rx and tx buffers (in bytes) |
| 330 | * @speed_hz: Select a speed other then the device default for this | 330 | * @speed_hz: Select a speed other than the device default for this |
| 331 | * transfer. If 0 the default (from @spi_device) is used. | 331 | * transfer. If 0 the default (from @spi_device) is used. |
| 332 | * @bits_per_word: select a bits_per_word other then the device default | 332 | * @bits_per_word: select a bits_per_word other than the device default |
| 333 | * for this transfer. If 0 the default (from @spi_device) is used. | 333 | * for this transfer. If 0 the default (from @spi_device) is used. |
| 334 | * @cs_change: affects chipselect after this transfer completes | 334 | * @cs_change: affects chipselect after this transfer completes |
| 335 | * @delay_usecs: microseconds to delay after this transfer before | 335 | * @delay_usecs: microseconds to delay after this transfer before |
diff --git a/include/linux/spi/spi_gpio.h b/include/linux/spi/spi_gpio.h new file mode 100644 index 000000000000..0f01a0f1f40c --- /dev/null +++ b/include/linux/spi/spi_gpio.h | |||
| @@ -0,0 +1,60 @@ | |||
| 1 | #ifndef __LINUX_SPI_GPIO_H | ||
| 2 | #define __LINUX_SPI_GPIO_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * For each bitbanged SPI bus, set up a platform_device node with: | ||
| 6 | * - name "spi_gpio" | ||
| 7 | * - id the same as the SPI bus number it implements | ||
| 8 | * - dev.platform data pointing to a struct spi_gpio_platform_data | ||
| 9 | * | ||
| 10 | * Or, see the driver code for information about speedups that are | ||
| 11 | * possible on platforms that support inlined access for GPIOs (no | ||
| 12 | * spi_gpio_platform_data is used). | ||
| 13 | * | ||
| 14 | * Use spi_board_info with these busses in the usual way, being sure | ||
| 15 | * that the controller_data being the GPIO used for each device's | ||
| 16 | * chipselect: | ||
| 17 | * | ||
| 18 | * static struct spi_board_info ... [] = { | ||
| 19 | * ... | ||
| 20 | * // this slave uses GPIO 42 for its chipselect | ||
| 21 | * .controller_data = (void *) 42, | ||
| 22 | * ... | ||
| 23 | * // this one uses GPIO 86 for its chipselect | ||
| 24 | * .controller_data = (void *) 86, | ||
| 25 | * ... | ||
| 26 | * }; | ||
| 27 | * | ||
| 28 | * If the bitbanged bus is later switched to a "native" controller, | ||
| 29 | * that platform_device and controller_data should be removed. | ||
| 30 | */ | ||
| 31 | |||
| 32 | /** | ||
| 33 | * struct spi_gpio_platform_data - parameter for bitbanged SPI master | ||
| 34 | * @sck: number of the GPIO used for clock output | ||
| 35 | * @mosi: number of the GPIO used for Master Output, Slave In (MOSI) data | ||
| 36 | * @miso: number of the GPIO used for Master Input, Slave Output (MISO) data | ||
| 37 | * @num_chipselect: how many slaves to allow | ||
| 38 | * | ||
| 39 | * All GPIO signals used with the SPI bus managed through this driver | ||
| 40 | * (chipselects, MOSI, MISO, SCK) must be configured as GPIOs, instead | ||
| 41 | * of some alternate function. | ||
| 42 | * | ||
| 43 | * It can be convenient to use this driver with pins that have alternate | ||
| 44 | * functions associated with a "native" SPI controller if a driver for that | ||
| 45 | * controller is not available, or is missing important functionality. | ||
| 46 | * | ||
| 47 | * On platforms which can do so, configure MISO with a weak pullup unless | ||
| 48 | * there's an external pullup on that signal. That saves power by avoiding | ||
| 49 | * floating signals. (A weak pulldown would save power too, but many | ||
| 50 | * drivers expect to see all-ones data as the no slave "response".) | ||
| 51 | */ | ||
| 52 | struct spi_gpio_platform_data { | ||
| 53 | unsigned sck; | ||
| 54 | unsigned mosi; | ||
| 55 | unsigned miso; | ||
| 56 | |||
| 57 | u16 num_chipselect; | ||
| 58 | }; | ||
| 59 | |||
| 60 | #endif /* __LINUX_SPI_GPIO_H */ | ||
diff --git a/include/linux/spi/tdo24m.h b/include/linux/spi/tdo24m.h new file mode 100644 index 000000000000..7572d4e1fe76 --- /dev/null +++ b/include/linux/spi/tdo24m.h | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | #ifndef __TDO24M_H__ | ||
| 2 | #define __TDO24M_H__ | ||
| 3 | |||
| 4 | enum tdo24m_model { | ||
| 5 | TDO24M, | ||
| 6 | TDO35S, | ||
| 7 | }; | ||
| 8 | |||
| 9 | struct tdo24m_platform_data { | ||
| 10 | enum tdo24m_model model; | ||
| 11 | }; | ||
| 12 | |||
| 13 | #endif /* __TDO24M_H__ */ | ||
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 3afe7fb403b2..3435d24bfe55 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
| @@ -58,10 +58,13 @@ struct svc_serv { | |||
| 58 | struct svc_stat * sv_stats; /* RPC statistics */ | 58 | struct svc_stat * sv_stats; /* RPC statistics */ |
| 59 | spinlock_t sv_lock; | 59 | spinlock_t sv_lock; |
| 60 | unsigned int sv_nrthreads; /* # of server threads */ | 60 | unsigned int sv_nrthreads; /* # of server threads */ |
| 61 | unsigned int sv_maxconn; /* max connections allowed or | ||
| 62 | * '0' causing max to be based | ||
| 63 | * on number of threads. */ | ||
| 64 | |||
| 61 | unsigned int sv_max_payload; /* datagram payload size */ | 65 | unsigned int sv_max_payload; /* datagram payload size */ |
| 62 | unsigned int sv_max_mesg; /* max_payload + 1 page for overheads */ | 66 | unsigned int sv_max_mesg; /* max_payload + 1 page for overheads */ |
| 63 | unsigned int sv_xdrsize; /* XDR buffer size */ | 67 | unsigned int sv_xdrsize; /* XDR buffer size */ |
| 64 | |||
| 65 | struct list_head sv_permsocks; /* all permanent sockets */ | 68 | struct list_head sv_permsocks; /* all permanent sockets */ |
| 66 | struct list_head sv_tempsocks; /* all temporary sockets */ | 69 | struct list_head sv_tempsocks; /* all temporary sockets */ |
| 67 | int sv_tmpcnt; /* count of temporary sockets */ | 70 | int sv_tmpcnt; /* count of temporary sockets */ |
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index 2ce8207686e2..2b409c44db83 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h | |||
| @@ -232,6 +232,11 @@ extern unsigned long get_safe_page(gfp_t gfp_mask); | |||
| 232 | 232 | ||
| 233 | extern void hibernation_set_ops(struct platform_hibernation_ops *ops); | 233 | extern void hibernation_set_ops(struct platform_hibernation_ops *ops); |
| 234 | extern int hibernate(void); | 234 | extern int hibernate(void); |
| 235 | extern int hibernate_nvs_register(unsigned long start, unsigned long size); | ||
| 236 | extern int hibernate_nvs_alloc(void); | ||
| 237 | extern void hibernate_nvs_free(void); | ||
| 238 | extern void hibernate_nvs_save(void); | ||
| 239 | extern void hibernate_nvs_restore(void); | ||
| 235 | #else /* CONFIG_HIBERNATION */ | 240 | #else /* CONFIG_HIBERNATION */ |
| 236 | static inline int swsusp_page_is_forbidden(struct page *p) { return 0; } | 241 | static inline int swsusp_page_is_forbidden(struct page *p) { return 0; } |
| 237 | static inline void swsusp_set_page_free(struct page *p) {} | 242 | static inline void swsusp_set_page_free(struct page *p) {} |
| @@ -239,6 +244,14 @@ static inline void swsusp_unset_page_free(struct page *p) {} | |||
| 239 | 244 | ||
| 240 | static inline void hibernation_set_ops(struct platform_hibernation_ops *ops) {} | 245 | static inline void hibernation_set_ops(struct platform_hibernation_ops *ops) {} |
| 241 | static inline int hibernate(void) { return -ENOSYS; } | 246 | static inline int hibernate(void) { return -ENOSYS; } |
| 247 | static inline int hibernate_nvs_register(unsigned long a, unsigned long b) | ||
| 248 | { | ||
| 249 | return 0; | ||
| 250 | } | ||
| 251 | static inline int hibernate_nvs_alloc(void) { return 0; } | ||
| 252 | static inline void hibernate_nvs_free(void) {} | ||
| 253 | static inline void hibernate_nvs_save(void) {} | ||
| 254 | static inline void hibernate_nvs_restore(void) {} | ||
| 242 | #endif /* CONFIG_HIBERNATION */ | 255 | #endif /* CONFIG_HIBERNATION */ |
| 243 | 256 | ||
| 244 | #ifdef CONFIG_PM_SLEEP | 257 | #ifdef CONFIG_PM_SLEEP |
diff --git a/include/linux/swab.h b/include/linux/swab.h index bbed279f3b32..be5284d4a053 100644 --- a/include/linux/swab.h +++ b/include/linux/swab.h | |||
| @@ -9,17 +9,17 @@ | |||
| 9 | * casts are necessary for constants, because we never know how for sure | 9 | * casts are necessary for constants, because we never know how for sure |
| 10 | * how U/UL/ULL map to __u16, __u32, __u64. At least not in a portable way. | 10 | * how U/UL/ULL map to __u16, __u32, __u64. At least not in a portable way. |
| 11 | */ | 11 | */ |
| 12 | #define __const_swab16(x) ((__u16)( \ | 12 | #define ___constant_swab16(x) ((__u16)( \ |
| 13 | (((__u16)(x) & (__u16)0x00ffU) << 8) | \ | 13 | (((__u16)(x) & (__u16)0x00ffU) << 8) | \ |
| 14 | (((__u16)(x) & (__u16)0xff00U) >> 8))) | 14 | (((__u16)(x) & (__u16)0xff00U) >> 8))) |
| 15 | 15 | ||
| 16 | #define __const_swab32(x) ((__u32)( \ | 16 | #define ___constant_swab32(x) ((__u32)( \ |
| 17 | (((__u32)(x) & (__u32)0x000000ffUL) << 24) | \ | 17 | (((__u32)(x) & (__u32)0x000000ffUL) << 24) | \ |
| 18 | (((__u32)(x) & (__u32)0x0000ff00UL) << 8) | \ | 18 | (((__u32)(x) & (__u32)0x0000ff00UL) << 8) | \ |
| 19 | (((__u32)(x) & (__u32)0x00ff0000UL) >> 8) | \ | 19 | (((__u32)(x) & (__u32)0x00ff0000UL) >> 8) | \ |
| 20 | (((__u32)(x) & (__u32)0xff000000UL) >> 24))) | 20 | (((__u32)(x) & (__u32)0xff000000UL) >> 24))) |
| 21 | 21 | ||
| 22 | #define __const_swab64(x) ((__u64)( \ | 22 | #define ___constant_swab64(x) ((__u64)( \ |
| 23 | (((__u64)(x) & (__u64)0x00000000000000ffULL) << 56) | \ | 23 | (((__u64)(x) & (__u64)0x00000000000000ffULL) << 56) | \ |
| 24 | (((__u64)(x) & (__u64)0x000000000000ff00ULL) << 40) | \ | 24 | (((__u64)(x) & (__u64)0x000000000000ff00ULL) << 40) | \ |
| 25 | (((__u64)(x) & (__u64)0x0000000000ff0000ULL) << 24) | \ | 25 | (((__u64)(x) & (__u64)0x0000000000ff0000ULL) << 24) | \ |
| @@ -29,11 +29,11 @@ | |||
| 29 | (((__u64)(x) & (__u64)0x00ff000000000000ULL) >> 40) | \ | 29 | (((__u64)(x) & (__u64)0x00ff000000000000ULL) >> 40) | \ |
| 30 | (((__u64)(x) & (__u64)0xff00000000000000ULL) >> 56))) | 30 | (((__u64)(x) & (__u64)0xff00000000000000ULL) >> 56))) |
| 31 | 31 | ||
| 32 | #define __const_swahw32(x) ((__u32)( \ | 32 | #define ___constant_swahw32(x) ((__u32)( \ |
| 33 | (((__u32)(x) & (__u32)0x0000ffffUL) << 16) | \ | 33 | (((__u32)(x) & (__u32)0x0000ffffUL) << 16) | \ |
| 34 | (((__u32)(x) & (__u32)0xffff0000UL) >> 16))) | 34 | (((__u32)(x) & (__u32)0xffff0000UL) >> 16))) |
| 35 | 35 | ||
| 36 | #define __const_swahb32(x) ((__u32)( \ | 36 | #define ___constant_swahb32(x) ((__u32)( \ |
| 37 | (((__u32)(x) & (__u32)0x00ff00ffUL) << 8) | \ | 37 | (((__u32)(x) & (__u32)0x00ff00ffUL) << 8) | \ |
| 38 | (((__u32)(x) & (__u32)0xff00ff00UL) >> 8))) | 38 | (((__u32)(x) & (__u32)0xff00ff00UL) >> 8))) |
| 39 | 39 | ||
| @@ -43,52 +43,52 @@ | |||
| 43 | * ___swab16, ___swab32, ___swab64, ___swahw32, ___swahb32 | 43 | * ___swab16, ___swab32, ___swab64, ___swahw32, ___swahb32 |
| 44 | */ | 44 | */ |
| 45 | 45 | ||
| 46 | static inline __attribute_const__ __u16 ___swab16(__u16 val) | 46 | static inline __attribute_const__ __u16 __fswab16(__u16 val) |
| 47 | { | 47 | { |
| 48 | #ifdef __arch_swab16 | 48 | #ifdef __arch_swab16 |
| 49 | return __arch_swab16(val); | 49 | return __arch_swab16(val); |
| 50 | #else | 50 | #else |
| 51 | return __const_swab16(val); | 51 | return ___constant_swab16(val); |
| 52 | #endif | 52 | #endif |
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | static inline __attribute_const__ __u32 ___swab32(__u32 val) | 55 | static inline __attribute_const__ __u32 __fswab32(__u32 val) |
| 56 | { | 56 | { |
| 57 | #ifdef __arch_swab32 | 57 | #ifdef __arch_swab32 |
| 58 | return __arch_swab32(val); | 58 | return __arch_swab32(val); |
| 59 | #else | 59 | #else |
| 60 | return __const_swab32(val); | 60 | return ___constant_swab32(val); |
| 61 | #endif | 61 | #endif |
| 62 | } | 62 | } |
| 63 | 63 | ||
| 64 | static inline __attribute_const__ __u64 ___swab64(__u64 val) | 64 | static inline __attribute_const__ __u64 __fswab64(__u64 val) |
| 65 | { | 65 | { |
| 66 | #ifdef __arch_swab64 | 66 | #ifdef __arch_swab64 |
| 67 | return __arch_swab64(val); | 67 | return __arch_swab64(val); |
| 68 | #elif defined(__SWAB_64_THRU_32__) | 68 | #elif defined(__SWAB_64_THRU_32__) |
| 69 | __u32 h = val >> 32; | 69 | __u32 h = val >> 32; |
| 70 | __u32 l = val & ((1ULL << 32) - 1); | 70 | __u32 l = val & ((1ULL << 32) - 1); |
| 71 | return (((__u64)___swab32(l)) << 32) | ((__u64)(___swab32(h))); | 71 | return (((__u64)__fswab32(l)) << 32) | ((__u64)(__fswab32(h))); |
| 72 | #else | 72 | #else |
| 73 | return __const_swab64(val); | 73 | return ___constant_swab64(val); |
| 74 | #endif | 74 | #endif |
| 75 | } | 75 | } |
| 76 | 76 | ||
| 77 | static inline __attribute_const__ __u32 ___swahw32(__u32 val) | 77 | static inline __attribute_const__ __u32 __fswahw32(__u32 val) |
| 78 | { | 78 | { |
| 79 | #ifdef __arch_swahw32 | 79 | #ifdef __arch_swahw32 |
| 80 | return __arch_swahw32(val); | 80 | return __arch_swahw32(val); |
| 81 | #else | 81 | #else |
| 82 | return __const_swahw32(val); | 82 | return ___constant_swahw32(val); |
| 83 | #endif | 83 | #endif |
| 84 | } | 84 | } |
| 85 | 85 | ||
| 86 | static inline __attribute_const__ __u32 ___swahb32(__u32 val) | 86 | static inline __attribute_const__ __u32 __fswahb32(__u32 val) |
| 87 | { | 87 | { |
| 88 | #ifdef __arch_swahb32 | 88 | #ifdef __arch_swahb32 |
| 89 | return __arch_swahb32(val); | 89 | return __arch_swahb32(val); |
| 90 | #else | 90 | #else |
| 91 | return __const_swahb32(val); | 91 | return ___constant_swahb32(val); |
| 92 | #endif | 92 | #endif |
| 93 | } | 93 | } |
| 94 | 94 | ||
| @@ -98,8 +98,8 @@ static inline __attribute_const__ __u32 ___swahb32(__u32 val) | |||
| 98 | */ | 98 | */ |
| 99 | #define __swab16(x) \ | 99 | #define __swab16(x) \ |
| 100 | (__builtin_constant_p((__u16)(x)) ? \ | 100 | (__builtin_constant_p((__u16)(x)) ? \ |
| 101 | __const_swab16((x)) : \ | 101 | ___constant_swab16(x) : \ |
| 102 | ___swab16((x))) | 102 | __fswab16(x)) |
| 103 | 103 | ||
| 104 | /** | 104 | /** |
| 105 | * __swab32 - return a byteswapped 32-bit value | 105 | * __swab32 - return a byteswapped 32-bit value |
| @@ -107,8 +107,8 @@ static inline __attribute_const__ __u32 ___swahb32(__u32 val) | |||
| 107 | */ | 107 | */ |
| 108 | #define __swab32(x) \ | 108 | #define __swab32(x) \ |
| 109 | (__builtin_constant_p((__u32)(x)) ? \ | 109 | (__builtin_constant_p((__u32)(x)) ? \ |
| 110 | __const_swab32((x)) : \ | 110 | ___constant_swab32(x) : \ |
| 111 | ___swab32((x))) | 111 | __fswab32(x)) |
| 112 | 112 | ||
| 113 | /** | 113 | /** |
| 114 | * __swab64 - return a byteswapped 64-bit value | 114 | * __swab64 - return a byteswapped 64-bit value |
| @@ -116,8 +116,8 @@ static inline __attribute_const__ __u32 ___swahb32(__u32 val) | |||
| 116 | */ | 116 | */ |
| 117 | #define __swab64(x) \ | 117 | #define __swab64(x) \ |
| 118 | (__builtin_constant_p((__u64)(x)) ? \ | 118 | (__builtin_constant_p((__u64)(x)) ? \ |
| 119 | __const_swab64((x)) : \ | 119 | ___constant_swab64(x) : \ |
| 120 | ___swab64((x))) | 120 | __fswab64(x)) |
| 121 | 121 | ||
| 122 | /** | 122 | /** |
| 123 | * __swahw32 - return a word-swapped 32-bit value | 123 | * __swahw32 - return a word-swapped 32-bit value |
| @@ -127,8 +127,8 @@ static inline __attribute_const__ __u32 ___swahb32(__u32 val) | |||
| 127 | */ | 127 | */ |
| 128 | #define __swahw32(x) \ | 128 | #define __swahw32(x) \ |
| 129 | (__builtin_constant_p((__u32)(x)) ? \ | 129 | (__builtin_constant_p((__u32)(x)) ? \ |
| 130 | __const_swahw32((x)) : \ | 130 | ___constant_swahw32(x) : \ |
| 131 | ___swahw32((x))) | 131 | __fswahw32(x)) |
| 132 | 132 | ||
| 133 | /** | 133 | /** |
| 134 | * __swahb32 - return a high and low byte-swapped 32-bit value | 134 | * __swahb32 - return a high and low byte-swapped 32-bit value |
| @@ -138,8 +138,8 @@ static inline __attribute_const__ __u32 ___swahb32(__u32 val) | |||
| 138 | */ | 138 | */ |
| 139 | #define __swahb32(x) \ | 139 | #define __swahb32(x) \ |
| 140 | (__builtin_constant_p((__u32)(x)) ? \ | 140 | (__builtin_constant_p((__u32)(x)) ? \ |
| 141 | __const_swahb32((x)) : \ | 141 | ___constant_swahb32(x) : \ |
| 142 | ___swahb32((x))) | 142 | __fswahb32(x)) |
| 143 | 143 | ||
| 144 | /** | 144 | /** |
| 145 | * __swab16p - return a byteswapped 16-bit value from a pointer | 145 | * __swab16p - return a byteswapped 16-bit value from a pointer |
diff --git a/include/linux/swap.h b/include/linux/swap.h index a3af95b2cb6d..d30215578877 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
| @@ -120,7 +120,9 @@ struct swap_extent { | |||
| 120 | enum { | 120 | enum { |
| 121 | SWP_USED = (1 << 0), /* is slot in swap_info[] used? */ | 121 | SWP_USED = (1 << 0), /* is slot in swap_info[] used? */ |
| 122 | SWP_WRITEOK = (1 << 1), /* ok to write to this swap? */ | 122 | SWP_WRITEOK = (1 << 1), /* ok to write to this swap? */ |
| 123 | SWP_ACTIVE = (SWP_USED | SWP_WRITEOK), | 123 | SWP_DISCARDABLE = (1 << 2), /* blkdev supports discard */ |
| 124 | SWP_DISCARDING = (1 << 3), /* now discarding a free cluster */ | ||
| 125 | SWP_SOLIDSTATE = (1 << 4), /* blkdev seeks are cheap */ | ||
| 124 | /* add others here before... */ | 126 | /* add others here before... */ |
| 125 | SWP_SCANNING = (1 << 8), /* refcount in scan_swap_map */ | 127 | SWP_SCANNING = (1 << 8), /* refcount in scan_swap_map */ |
| 126 | }; | 128 | }; |
| @@ -134,22 +136,24 @@ enum { | |||
| 134 | * The in-memory structure used to track swap areas. | 136 | * The in-memory structure used to track swap areas. |
| 135 | */ | 137 | */ |
| 136 | struct swap_info_struct { | 138 | struct swap_info_struct { |
| 137 | unsigned int flags; | 139 | unsigned long flags; |
| 138 | int prio; /* swap priority */ | 140 | int prio; /* swap priority */ |
| 141 | int next; /* next entry on swap list */ | ||
| 139 | struct file *swap_file; | 142 | struct file *swap_file; |
| 140 | struct block_device *bdev; | 143 | struct block_device *bdev; |
| 141 | struct list_head extent_list; | 144 | struct list_head extent_list; |
| 142 | struct swap_extent *curr_swap_extent; | 145 | struct swap_extent *curr_swap_extent; |
| 143 | unsigned old_block_size; | 146 | unsigned short *swap_map; |
| 144 | unsigned short * swap_map; | ||
| 145 | unsigned int lowest_bit; | 147 | unsigned int lowest_bit; |
| 146 | unsigned int highest_bit; | 148 | unsigned int highest_bit; |
| 149 | unsigned int lowest_alloc; /* while preparing discard cluster */ | ||
| 150 | unsigned int highest_alloc; /* while preparing discard cluster */ | ||
| 147 | unsigned int cluster_next; | 151 | unsigned int cluster_next; |
| 148 | unsigned int cluster_nr; | 152 | unsigned int cluster_nr; |
| 149 | unsigned int pages; | 153 | unsigned int pages; |
| 150 | unsigned int max; | 154 | unsigned int max; |
| 151 | unsigned int inuse_pages; | 155 | unsigned int inuse_pages; |
| 152 | int next; /* next entry on swap list */ | 156 | unsigned int old_block_size; |
| 153 | }; | 157 | }; |
| 154 | 158 | ||
| 155 | struct swap_list_t { | 159 | struct swap_list_t { |
| @@ -163,7 +167,6 @@ struct swap_list_t { | |||
| 163 | /* linux/mm/page_alloc.c */ | 167 | /* linux/mm/page_alloc.c */ |
| 164 | extern unsigned long totalram_pages; | 168 | extern unsigned long totalram_pages; |
| 165 | extern unsigned long totalreserve_pages; | 169 | extern unsigned long totalreserve_pages; |
| 166 | extern long nr_swap_pages; | ||
| 167 | extern unsigned int nr_free_buffer_pages(void); | 170 | extern unsigned int nr_free_buffer_pages(void); |
| 168 | extern unsigned int nr_free_pagecache_pages(void); | 171 | extern unsigned int nr_free_pagecache_pages(void); |
| 169 | 172 | ||
| @@ -174,8 +177,6 @@ extern unsigned int nr_free_pagecache_pages(void); | |||
| 174 | /* linux/mm/swap.c */ | 177 | /* linux/mm/swap.c */ |
| 175 | extern void __lru_cache_add(struct page *, enum lru_list lru); | 178 | extern void __lru_cache_add(struct page *, enum lru_list lru); |
| 176 | extern void lru_cache_add_lru(struct page *, enum lru_list lru); | 179 | extern void lru_cache_add_lru(struct page *, enum lru_list lru); |
| 177 | extern void lru_cache_add_active_or_unevictable(struct page *, | ||
| 178 | struct vm_area_struct *); | ||
| 179 | extern void activate_page(struct page *); | 180 | extern void activate_page(struct page *); |
| 180 | extern void mark_page_accessed(struct page *); | 181 | extern void mark_page_accessed(struct page *); |
| 181 | extern void lru_add_drain(void); | 182 | extern void lru_add_drain(void); |
| @@ -213,7 +214,8 @@ static inline void lru_cache_add_active_file(struct page *page) | |||
| 213 | extern unsigned long try_to_free_pages(struct zonelist *zonelist, int order, | 214 | extern unsigned long try_to_free_pages(struct zonelist *zonelist, int order, |
| 214 | gfp_t gfp_mask); | 215 | gfp_t gfp_mask); |
| 215 | extern unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem, | 216 | extern unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem, |
| 216 | gfp_t gfp_mask); | 217 | gfp_t gfp_mask, bool noswap, |
| 218 | unsigned int swappiness); | ||
| 217 | extern int __isolate_lru_page(struct page *page, int mode, int file); | 219 | extern int __isolate_lru_page(struct page *page, int mode, int file); |
| 218 | extern unsigned long shrink_all_memory(unsigned long nr_pages); | 220 | extern unsigned long shrink_all_memory(unsigned long nr_pages); |
| 219 | extern int vm_swappiness; | 221 | extern int vm_swappiness; |
| @@ -280,7 +282,7 @@ extern void end_swap_bio_read(struct bio *bio, int err); | |||
| 280 | extern struct address_space swapper_space; | 282 | extern struct address_space swapper_space; |
| 281 | #define total_swapcache_pages swapper_space.nrpages | 283 | #define total_swapcache_pages swapper_space.nrpages |
| 282 | extern void show_swap_cache_info(void); | 284 | extern void show_swap_cache_info(void); |
| 283 | extern int add_to_swap(struct page *, gfp_t); | 285 | extern int add_to_swap(struct page *); |
| 284 | extern int add_to_swap_cache(struct page *, swp_entry_t, gfp_t); | 286 | extern int add_to_swap_cache(struct page *, swp_entry_t, gfp_t); |
| 285 | extern void __delete_from_swap_cache(struct page *); | 287 | extern void __delete_from_swap_cache(struct page *); |
| 286 | extern void delete_from_swap_cache(struct page *); | 288 | extern void delete_from_swap_cache(struct page *); |
| @@ -293,6 +295,7 @@ extern struct page *swapin_readahead(swp_entry_t, gfp_t, | |||
| 293 | struct vm_area_struct *vma, unsigned long addr); | 295 | struct vm_area_struct *vma, unsigned long addr); |
| 294 | 296 | ||
| 295 | /* linux/mm/swapfile.c */ | 297 | /* linux/mm/swapfile.c */ |
| 298 | extern long nr_swap_pages; | ||
| 296 | extern long total_swap_pages; | 299 | extern long total_swap_pages; |
| 297 | extern void si_swapinfo(struct sysinfo *); | 300 | extern void si_swapinfo(struct sysinfo *); |
| 298 | extern swp_entry_t get_swap_page(void); | 301 | extern swp_entry_t get_swap_page(void); |
| @@ -300,15 +303,14 @@ extern swp_entry_t get_swap_page_of_type(int); | |||
| 300 | extern int swap_duplicate(swp_entry_t); | 303 | extern int swap_duplicate(swp_entry_t); |
| 301 | extern int valid_swaphandles(swp_entry_t, unsigned long *); | 304 | extern int valid_swaphandles(swp_entry_t, unsigned long *); |
| 302 | extern void swap_free(swp_entry_t); | 305 | extern void swap_free(swp_entry_t); |
| 303 | extern void free_swap_and_cache(swp_entry_t); | 306 | extern int free_swap_and_cache(swp_entry_t); |
| 304 | extern int swap_type_of(dev_t, sector_t, struct block_device **); | 307 | extern int swap_type_of(dev_t, sector_t, struct block_device **); |
| 305 | extern unsigned int count_swap_pages(int, int); | 308 | extern unsigned int count_swap_pages(int, int); |
| 306 | extern sector_t map_swap_page(struct swap_info_struct *, pgoff_t); | 309 | extern sector_t map_swap_page(struct swap_info_struct *, pgoff_t); |
| 307 | extern sector_t swapdev_block(int, pgoff_t); | 310 | extern sector_t swapdev_block(int, pgoff_t); |
| 308 | extern struct swap_info_struct *get_swap_info_struct(unsigned); | 311 | extern struct swap_info_struct *get_swap_info_struct(unsigned); |
| 309 | extern int can_share_swap_page(struct page *); | 312 | extern int reuse_swap_page(struct page *); |
| 310 | extern int remove_exclusive_swap_page(struct page *); | 313 | extern int try_to_free_swap(struct page *); |
| 311 | extern int remove_exclusive_swap_page_ref(struct page *); | ||
| 312 | struct backing_dev_info; | 314 | struct backing_dev_info; |
| 313 | 315 | ||
| 314 | /* linux/mm/thrash.c */ | 316 | /* linux/mm/thrash.c */ |
| @@ -332,9 +334,26 @@ static inline void disable_swap_token(void) | |||
| 332 | put_swap_token(swap_token_mm); | 334 | put_swap_token(swap_token_mm); |
| 333 | } | 335 | } |
| 334 | 336 | ||
| 337 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR | ||
| 338 | extern void mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent); | ||
| 339 | #else | ||
| 340 | static inline void | ||
| 341 | mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent) | ||
| 342 | { | ||
| 343 | } | ||
| 344 | #endif | ||
| 345 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP | ||
| 346 | extern void mem_cgroup_uncharge_swap(swp_entry_t ent); | ||
| 347 | #else | ||
| 348 | static inline void mem_cgroup_uncharge_swap(swp_entry_t ent) | ||
| 349 | { | ||
| 350 | } | ||
| 351 | #endif | ||
| 352 | |||
| 335 | #else /* CONFIG_SWAP */ | 353 | #else /* CONFIG_SWAP */ |
| 336 | 354 | ||
| 337 | #define total_swap_pages 0 | 355 | #define nr_swap_pages 0L |
| 356 | #define total_swap_pages 0L | ||
| 338 | #define total_swapcache_pages 0UL | 357 | #define total_swapcache_pages 0UL |
| 339 | 358 | ||
| 340 | #define si_swapinfo(val) \ | 359 | #define si_swapinfo(val) \ |
| @@ -350,14 +369,8 @@ static inline void show_swap_cache_info(void) | |||
| 350 | { | 369 | { |
| 351 | } | 370 | } |
| 352 | 371 | ||
| 353 | static inline void free_swap_and_cache(swp_entry_t swp) | 372 | #define free_swap_and_cache(swp) is_migration_entry(swp) |
| 354 | { | 373 | #define swap_duplicate(swp) is_migration_entry(swp) |
| 355 | } | ||
| 356 | |||
| 357 | static inline int swap_duplicate(swp_entry_t swp) | ||
| 358 | { | ||
| 359 | return 0; | ||
| 360 | } | ||
| 361 | 374 | ||
| 362 | static inline void swap_free(swp_entry_t swp) | 375 | static inline void swap_free(swp_entry_t swp) |
| 363 | { | 376 | { |
| @@ -374,7 +387,10 @@ static inline struct page *lookup_swap_cache(swp_entry_t swp) | |||
| 374 | return NULL; | 387 | return NULL; |
| 375 | } | 388 | } |
| 376 | 389 | ||
| 377 | #define can_share_swap_page(p) (page_mapcount(p) == 1) | 390 | static inline int add_to_swap(struct page *page) |
| 391 | { | ||
| 392 | return 0; | ||
| 393 | } | ||
| 378 | 394 | ||
| 379 | static inline int add_to_swap_cache(struct page *page, swp_entry_t entry, | 395 | static inline int add_to_swap_cache(struct page *page, swp_entry_t entry, |
| 380 | gfp_t gfp_mask) | 396 | gfp_t gfp_mask) |
| @@ -390,14 +406,9 @@ static inline void delete_from_swap_cache(struct page *page) | |||
| 390 | { | 406 | { |
| 391 | } | 407 | } |
| 392 | 408 | ||
| 393 | #define swap_token_default_timeout 0 | 409 | #define reuse_swap_page(page) (page_mapcount(page) == 1) |
| 394 | 410 | ||
| 395 | static inline int remove_exclusive_swap_page(struct page *p) | 411 | static inline int try_to_free_swap(struct page *page) |
| 396 | { | ||
| 397 | return 0; | ||
| 398 | } | ||
| 399 | |||
| 400 | static inline int remove_exclusive_swap_page_ref(struct page *page) | ||
| 401 | { | 412 | { |
| 402 | return 0; | 413 | return 0; |
| 403 | } | 414 | } |
| @@ -415,6 +426,12 @@ static inline swp_entry_t get_swap_page(void) | |||
| 415 | #define has_swap_token(x) 0 | 426 | #define has_swap_token(x) 0 |
| 416 | #define disable_swap_token() do { } while(0) | 427 | #define disable_swap_token() do { } while(0) |
| 417 | 428 | ||
| 429 | static inline int mem_cgroup_cache_charge_swapin(struct page *page, | ||
| 430 | struct mm_struct *mm, gfp_t mask, bool locked) | ||
| 431 | { | ||
| 432 | return 0; | ||
| 433 | } | ||
| 434 | |||
| 418 | #endif /* CONFIG_SWAP */ | 435 | #endif /* CONFIG_SWAP */ |
| 419 | #endif /* __KERNEL__*/ | 436 | #endif /* __KERNEL__*/ |
| 420 | #endif /* _LINUX_SWAP_H */ | 437 | #endif /* _LINUX_SWAP_H */ |
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h index 325af1de0351..dedd3c0cfe30 100644 --- a/include/linux/swiotlb.h +++ b/include/linux/swiotlb.h | |||
| @@ -27,7 +27,8 @@ swiotlb_init(void); | |||
| 27 | extern void *swiotlb_alloc_boot(size_t bytes, unsigned long nslabs); | 27 | extern void *swiotlb_alloc_boot(size_t bytes, unsigned long nslabs); |
| 28 | extern void *swiotlb_alloc(unsigned order, unsigned long nslabs); | 28 | extern void *swiotlb_alloc(unsigned order, unsigned long nslabs); |
| 29 | 29 | ||
| 30 | extern dma_addr_t swiotlb_phys_to_bus(phys_addr_t address); | 30 | extern dma_addr_t swiotlb_phys_to_bus(struct device *hwdev, |
| 31 | phys_addr_t address); | ||
| 31 | extern phys_addr_t swiotlb_bus_to_phys(dma_addr_t address); | 32 | extern phys_addr_t swiotlb_bus_to_phys(dma_addr_t address); |
| 32 | 33 | ||
| 33 | extern int swiotlb_arch_range_needs_mapping(void *ptr, size_t size); | 34 | extern int swiotlb_arch_range_needs_mapping(void *ptr, size_t size); |
diff --git a/include/linux/time.h b/include/linux/time.h index ce321ac5c8f8..fbbd2a1c92ba 100644 --- a/include/linux/time.h +++ b/include/linux/time.h | |||
| @@ -105,6 +105,7 @@ extern unsigned long read_persistent_clock(void); | |||
| 105 | extern int update_persistent_clock(struct timespec now); | 105 | extern int update_persistent_clock(struct timespec now); |
| 106 | extern int no_sync_cmos_clock __read_mostly; | 106 | extern int no_sync_cmos_clock __read_mostly; |
| 107 | void timekeeping_init(void); | 107 | void timekeeping_init(void); |
| 108 | extern int timekeeping_suspended; | ||
| 108 | 109 | ||
| 109 | unsigned long get_seconds(void); | 110 | unsigned long get_seconds(void); |
| 110 | struct timespec current_kernel_time(void); | 111 | struct timespec current_kernel_time(void); |
diff --git a/include/linux/types.h b/include/linux/types.h index 121f349cb7ec..712ca53bc348 100644 --- a/include/linux/types.h +++ b/include/linux/types.h | |||
| @@ -176,10 +176,9 @@ typedef __u16 __bitwise __le16; | |||
| 176 | typedef __u16 __bitwise __be16; | 176 | typedef __u16 __bitwise __be16; |
| 177 | typedef __u32 __bitwise __le32; | 177 | typedef __u32 __bitwise __le32; |
| 178 | typedef __u32 __bitwise __be32; | 178 | typedef __u32 __bitwise __be32; |
| 179 | #if defined(__GNUC__) | ||
| 180 | typedef __u64 __bitwise __le64; | 179 | typedef __u64 __bitwise __le64; |
| 181 | typedef __u64 __bitwise __be64; | 180 | typedef __u64 __bitwise __be64; |
| 182 | #endif | 181 | |
| 183 | typedef __u16 __bitwise __sum16; | 182 | typedef __u16 __bitwise __sum16; |
| 184 | typedef __u32 __bitwise __wsum; | 183 | typedef __u32 __bitwise __wsum; |
| 185 | 184 | ||
| @@ -195,6 +194,16 @@ typedef u32 phys_addr_t; | |||
| 195 | 194 | ||
| 196 | typedef phys_addr_t resource_size_t; | 195 | typedef phys_addr_t resource_size_t; |
| 197 | 196 | ||
| 197 | typedef struct { | ||
| 198 | volatile int counter; | ||
| 199 | } atomic_t; | ||
| 200 | |||
| 201 | #ifdef CONFIG_64BIT | ||
| 202 | typedef struct { | ||
| 203 | volatile long counter; | ||
| 204 | } atomic64_t; | ||
| 205 | #endif | ||
| 206 | |||
| 198 | struct ustat { | 207 | struct ustat { |
| 199 | __kernel_daddr_t f_tfree; | 208 | __kernel_daddr_t f_tfree; |
| 200 | __kernel_ino_t f_tinode; | 209 | __kernel_ino_t f_tinode; |
diff --git a/include/linux/uio_driver.h b/include/linux/uio_driver.h index cdf338d94b7f..a0bb6bd2e5c1 100644 --- a/include/linux/uio_driver.h +++ b/include/linux/uio_driver.h | |||
| @@ -38,6 +38,24 @@ struct uio_mem { | |||
| 38 | 38 | ||
| 39 | #define MAX_UIO_MAPS 5 | 39 | #define MAX_UIO_MAPS 5 |
| 40 | 40 | ||
| 41 | struct uio_portio; | ||
| 42 | |||
| 43 | /** | ||
| 44 | * struct uio_port - description of a UIO port region | ||
| 45 | * @start: start of port region | ||
| 46 | * @size: size of port region | ||
| 47 | * @porttype: type of port (see UIO_PORT_* below) | ||
| 48 | * @portio: for use by the UIO core only. | ||
| 49 | */ | ||
| 50 | struct uio_port { | ||
| 51 | unsigned long start; | ||
| 52 | unsigned long size; | ||
| 53 | int porttype; | ||
| 54 | struct uio_portio *portio; | ||
| 55 | }; | ||
| 56 | |||
| 57 | #define MAX_UIO_PORT_REGIONS 5 | ||
| 58 | |||
| 41 | struct uio_device; | 59 | struct uio_device; |
| 42 | 60 | ||
| 43 | /** | 61 | /** |
| @@ -46,6 +64,7 @@ struct uio_device; | |||
| 46 | * @name: device name | 64 | * @name: device name |
| 47 | * @version: device driver version | 65 | * @version: device driver version |
| 48 | * @mem: list of mappable memory regions, size==0 for end of list | 66 | * @mem: list of mappable memory regions, size==0 for end of list |
| 67 | * @port: list of port regions, size==0 for end of list | ||
| 49 | * @irq: interrupt number or UIO_IRQ_CUSTOM | 68 | * @irq: interrupt number or UIO_IRQ_CUSTOM |
| 50 | * @irq_flags: flags for request_irq() | 69 | * @irq_flags: flags for request_irq() |
| 51 | * @priv: optional private data | 70 | * @priv: optional private data |
| @@ -57,9 +76,10 @@ struct uio_device; | |||
| 57 | */ | 76 | */ |
| 58 | struct uio_info { | 77 | struct uio_info { |
| 59 | struct uio_device *uio_dev; | 78 | struct uio_device *uio_dev; |
| 60 | char *name; | 79 | const char *name; |
| 61 | char *version; | 80 | const char *version; |
| 62 | struct uio_mem mem[MAX_UIO_MAPS]; | 81 | struct uio_mem mem[MAX_UIO_MAPS]; |
| 82 | struct uio_port port[MAX_UIO_PORT_REGIONS]; | ||
| 63 | long irq; | 83 | long irq; |
| 64 | unsigned long irq_flags; | 84 | unsigned long irq_flags; |
| 65 | void *priv; | 85 | void *priv; |
| @@ -92,4 +112,10 @@ extern void uio_event_notify(struct uio_info *info); | |||
| 92 | #define UIO_MEM_LOGICAL 2 | 112 | #define UIO_MEM_LOGICAL 2 |
| 93 | #define UIO_MEM_VIRTUAL 3 | 113 | #define UIO_MEM_VIRTUAL 3 |
| 94 | 114 | ||
| 115 | /* defines for uio_port->porttype */ | ||
| 116 | #define UIO_PORT_NONE 0 | ||
| 117 | #define UIO_PORT_X86 1 | ||
| 118 | #define UIO_PORT_GPIO 2 | ||
| 119 | #define UIO_PORT_OTHER 3 | ||
| 120 | |||
| 95 | #endif /* _LINUX_UIO_DRIVER_H_ */ | 121 | #endif /* _LINUX_UIO_DRIVER_H_ */ |
diff --git a/include/linux/unwind.h b/include/linux/unwind.h deleted file mode 100644 index 7760860fa170..000000000000 --- a/include/linux/unwind.h +++ /dev/null | |||
| @@ -1,68 +0,0 @@ | |||
| 1 | #ifndef _LINUX_UNWIND_H | ||
| 2 | #define _LINUX_UNWIND_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * Copyright (C) 2002-2006 Novell, Inc. | ||
| 6 | * Jan Beulich <jbeulich@novell.com> | ||
| 7 | * This code is released under version 2 of the GNU GPL. | ||
| 8 | * | ||
| 9 | * A simple API for unwinding kernel stacks. This is used for | ||
| 10 | * debugging and error reporting purposes. The kernel doesn't need | ||
| 11 | * full-blown stack unwinding with all the bells and whistles, so there | ||
| 12 | * is not much point in implementing the full Dwarf2 unwind API. | ||
| 13 | */ | ||
| 14 | |||
| 15 | struct module; | ||
| 16 | |||
| 17 | struct unwind_frame_info {}; | ||
| 18 | |||
| 19 | static inline void unwind_init(void) {} | ||
| 20 | static inline void unwind_setup(void) {} | ||
| 21 | |||
| 22 | #ifdef CONFIG_MODULES | ||
| 23 | |||
| 24 | static inline void *unwind_add_table(struct module *mod, | ||
| 25 | const void *table_start, | ||
| 26 | unsigned long table_size) | ||
| 27 | { | ||
| 28 | return NULL; | ||
| 29 | } | ||
| 30 | |||
| 31 | static inline void unwind_remove_table(void *handle, int init_only) | ||
| 32 | { | ||
| 33 | } | ||
| 34 | |||
| 35 | #endif | ||
| 36 | |||
| 37 | static inline int unwind_init_frame_info(struct unwind_frame_info *info, | ||
| 38 | struct task_struct *tsk, | ||
| 39 | const struct pt_regs *regs) | ||
| 40 | { | ||
| 41 | return -ENOSYS; | ||
| 42 | } | ||
| 43 | |||
| 44 | static inline int unwind_init_blocked(struct unwind_frame_info *info, | ||
| 45 | struct task_struct *tsk) | ||
| 46 | { | ||
| 47 | return -ENOSYS; | ||
| 48 | } | ||
| 49 | |||
| 50 | static inline int unwind_init_running(struct unwind_frame_info *info, | ||
| 51 | asmlinkage int (*cb)(struct unwind_frame_info *, | ||
| 52 | void *arg), | ||
| 53 | void *arg) | ||
| 54 | { | ||
| 55 | return -ENOSYS; | ||
| 56 | } | ||
| 57 | |||
| 58 | static inline int unwind(struct unwind_frame_info *info) | ||
| 59 | { | ||
| 60 | return -ENOSYS; | ||
| 61 | } | ||
| 62 | |||
| 63 | static inline int unwind_to_user(struct unwind_frame_info *info) | ||
| 64 | { | ||
| 65 | return -ENOSYS; | ||
| 66 | } | ||
| 67 | |||
| 68 | #endif /* _LINUX_UNWIND_H */ | ||
diff --git a/include/linux/usb.h b/include/linux/usb.h index f72aa51f7bcd..85ee9be9361e 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
| @@ -108,6 +108,7 @@ enum usb_interface_condition { | |||
| 108 | * (in probe()), bound to a driver, or unbinding (in disconnect()) | 108 | * (in probe()), bound to a driver, or unbinding (in disconnect()) |
| 109 | * @is_active: flag set when the interface is bound and not suspended. | 109 | * @is_active: flag set when the interface is bound and not suspended. |
| 110 | * @sysfs_files_created: sysfs attributes exist | 110 | * @sysfs_files_created: sysfs attributes exist |
| 111 | * @ep_devs_created: endpoint child pseudo-devices exist | ||
| 111 | * @unregistering: flag set when the interface is being unregistered | 112 | * @unregistering: flag set when the interface is being unregistered |
| 112 | * @needs_remote_wakeup: flag set when the driver requires remote-wakeup | 113 | * @needs_remote_wakeup: flag set when the driver requires remote-wakeup |
| 113 | * capability during autosuspend. | 114 | * capability during autosuspend. |
| @@ -120,6 +121,11 @@ enum usb_interface_condition { | |||
| 120 | * to the sysfs representation for that device. | 121 | * to the sysfs representation for that device. |
| 121 | * @pm_usage_cnt: PM usage counter for this interface; autosuspend is not | 122 | * @pm_usage_cnt: PM usage counter for this interface; autosuspend is not |
| 122 | * allowed unless the counter is 0. | 123 | * allowed unless the counter is 0. |
| 124 | * @reset_ws: Used for scheduling resets from atomic context. | ||
| 125 | * @reset_running: set to 1 if the interface is currently running a | ||
| 126 | * queued reset so that usb_cancel_queued_reset() doesn't try to | ||
| 127 | * remove from the workqueue when running inside the worker | ||
| 128 | * thread. See __usb_queue_reset_device(). | ||
| 123 | * | 129 | * |
| 124 | * USB device drivers attach to interfaces on a physical device. Each | 130 | * USB device drivers attach to interfaces on a physical device. Each |
| 125 | * interface encapsulates a single high level function, such as feeding | 131 | * interface encapsulates a single high level function, such as feeding |
| @@ -164,14 +170,17 @@ struct usb_interface { | |||
| 164 | enum usb_interface_condition condition; /* state of binding */ | 170 | enum usb_interface_condition condition; /* state of binding */ |
| 165 | unsigned is_active:1; /* the interface is not suspended */ | 171 | unsigned is_active:1; /* the interface is not suspended */ |
| 166 | unsigned sysfs_files_created:1; /* the sysfs attributes exist */ | 172 | unsigned sysfs_files_created:1; /* the sysfs attributes exist */ |
| 173 | unsigned ep_devs_created:1; /* endpoint "devices" exist */ | ||
| 167 | unsigned unregistering:1; /* unregistration is in progress */ | 174 | unsigned unregistering:1; /* unregistration is in progress */ |
| 168 | unsigned needs_remote_wakeup:1; /* driver requires remote wakeup */ | 175 | unsigned needs_remote_wakeup:1; /* driver requires remote wakeup */ |
| 169 | unsigned needs_altsetting0:1; /* switch to altsetting 0 is pending */ | 176 | unsigned needs_altsetting0:1; /* switch to altsetting 0 is pending */ |
| 170 | unsigned needs_binding:1; /* needs delayed unbind/rebind */ | 177 | unsigned needs_binding:1; /* needs delayed unbind/rebind */ |
| 178 | unsigned reset_running:1; | ||
| 171 | 179 | ||
| 172 | struct device dev; /* interface specific device info */ | 180 | struct device dev; /* interface specific device info */ |
| 173 | struct device *usb_dev; | 181 | struct device *usb_dev; |
| 174 | int pm_usage_cnt; /* usage counter for autosuspend */ | 182 | int pm_usage_cnt; /* usage counter for autosuspend */ |
| 183 | struct work_struct reset_ws; /* for resets in atomic context */ | ||
| 175 | }; | 184 | }; |
| 176 | #define to_usb_interface(d) container_of(d, struct usb_interface, dev) | 185 | #define to_usb_interface(d) container_of(d, struct usb_interface, dev) |
| 177 | #define interface_to_usbdev(intf) \ | 186 | #define interface_to_usbdev(intf) \ |
| @@ -329,7 +338,7 @@ struct usb_bus { | |||
| 329 | #endif | 338 | #endif |
| 330 | struct device *dev; /* device for this bus */ | 339 | struct device *dev; /* device for this bus */ |
| 331 | 340 | ||
| 332 | #if defined(CONFIG_USB_MON) | 341 | #if defined(CONFIG_USB_MON) || defined(CONFIG_USB_MON_MODULE) |
| 333 | struct mon_bus *mon_bus; /* non-null when associated */ | 342 | struct mon_bus *mon_bus; /* non-null when associated */ |
| 334 | int monitored; /* non-zero when monitored */ | 343 | int monitored; /* non-zero when monitored */ |
| 335 | #endif | 344 | #endif |
| @@ -398,6 +407,7 @@ struct usb_tt; | |||
| 398 | * @urbnum: number of URBs submitted for the whole device | 407 | * @urbnum: number of URBs submitted for the whole device |
| 399 | * @active_duration: total time device is not suspended | 408 | * @active_duration: total time device is not suspended |
| 400 | * @autosuspend: for delayed autosuspends | 409 | * @autosuspend: for delayed autosuspends |
| 410 | * @autoresume: for autoresumes requested while in_interrupt | ||
| 401 | * @pm_mutex: protects PM operations | 411 | * @pm_mutex: protects PM operations |
| 402 | * @last_busy: time of last use | 412 | * @last_busy: time of last use |
| 403 | * @autosuspend_delay: in jiffies | 413 | * @autosuspend_delay: in jiffies |
| @@ -476,6 +486,7 @@ struct usb_device { | |||
| 476 | 486 | ||
| 477 | #ifdef CONFIG_PM | 487 | #ifdef CONFIG_PM |
| 478 | struct delayed_work autosuspend; | 488 | struct delayed_work autosuspend; |
| 489 | struct work_struct autoresume; | ||
| 479 | struct mutex pm_mutex; | 490 | struct mutex pm_mutex; |
| 480 | 491 | ||
| 481 | unsigned long last_busy; | 492 | unsigned long last_busy; |
| @@ -505,6 +516,7 @@ extern int usb_lock_device_for_reset(struct usb_device *udev, | |||
| 505 | 516 | ||
| 506 | /* USB port reset for device reinitialization */ | 517 | /* USB port reset for device reinitialization */ |
| 507 | extern int usb_reset_device(struct usb_device *dev); | 518 | extern int usb_reset_device(struct usb_device *dev); |
| 519 | extern void usb_queue_reset_device(struct usb_interface *dev); | ||
| 508 | 520 | ||
| 509 | extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id); | 521 | extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id); |
| 510 | 522 | ||
| @@ -513,6 +525,8 @@ extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id); | |||
| 513 | extern int usb_autopm_set_interface(struct usb_interface *intf); | 525 | extern int usb_autopm_set_interface(struct usb_interface *intf); |
| 514 | extern int usb_autopm_get_interface(struct usb_interface *intf); | 526 | extern int usb_autopm_get_interface(struct usb_interface *intf); |
| 515 | extern void usb_autopm_put_interface(struct usb_interface *intf); | 527 | extern void usb_autopm_put_interface(struct usb_interface *intf); |
| 528 | extern int usb_autopm_get_interface_async(struct usb_interface *intf); | ||
| 529 | extern void usb_autopm_put_interface_async(struct usb_interface *intf); | ||
| 516 | 530 | ||
| 517 | static inline void usb_autopm_enable(struct usb_interface *intf) | 531 | static inline void usb_autopm_enable(struct usb_interface *intf) |
| 518 | { | 532 | { |
| @@ -539,8 +553,13 @@ static inline int usb_autopm_set_interface(struct usb_interface *intf) | |||
| 539 | static inline int usb_autopm_get_interface(struct usb_interface *intf) | 553 | static inline int usb_autopm_get_interface(struct usb_interface *intf) |
| 540 | { return 0; } | 554 | { return 0; } |
| 541 | 555 | ||
| 556 | static inline int usb_autopm_get_interface_async(struct usb_interface *intf) | ||
| 557 | { return 0; } | ||
| 558 | |||
| 542 | static inline void usb_autopm_put_interface(struct usb_interface *intf) | 559 | static inline void usb_autopm_put_interface(struct usb_interface *intf) |
| 543 | { } | 560 | { } |
| 561 | static inline void usb_autopm_put_interface_async(struct usb_interface *intf) | ||
| 562 | { } | ||
| 544 | static inline void usb_autopm_enable(struct usb_interface *intf) | 563 | static inline void usb_autopm_enable(struct usb_interface *intf) |
| 545 | { } | 564 | { } |
| 546 | static inline void usb_autopm_disable(struct usb_interface *intf) | 565 | static inline void usb_autopm_disable(struct usb_interface *intf) |
| @@ -1050,7 +1069,7 @@ struct usb_device_driver { | |||
| 1050 | void (*disconnect) (struct usb_device *udev); | 1069 | void (*disconnect) (struct usb_device *udev); |
| 1051 | 1070 | ||
| 1052 | int (*suspend) (struct usb_device *udev, pm_message_t message); | 1071 | int (*suspend) (struct usb_device *udev, pm_message_t message); |
| 1053 | int (*resume) (struct usb_device *udev); | 1072 | int (*resume) (struct usb_device *udev, pm_message_t message); |
| 1054 | struct usbdrv_wrap drvwrap; | 1073 | struct usbdrv_wrap drvwrap; |
| 1055 | unsigned int supports_autosuspend:1; | 1074 | unsigned int supports_autosuspend:1; |
| 1056 | }; | 1075 | }; |
| @@ -1321,7 +1340,7 @@ struct urb { | |||
| 1321 | struct kref kref; /* reference count of the URB */ | 1340 | struct kref kref; /* reference count of the URB */ |
| 1322 | void *hcpriv; /* private data for host controller */ | 1341 | void *hcpriv; /* private data for host controller */ |
| 1323 | atomic_t use_count; /* concurrent submissions counter */ | 1342 | atomic_t use_count; /* concurrent submissions counter */ |
| 1324 | u8 reject; /* submissions will fail */ | 1343 | atomic_t reject; /* submissions will fail */ |
| 1325 | int unlinked; /* unlink error code */ | 1344 | int unlinked; /* unlink error code */ |
| 1326 | 1345 | ||
| 1327 | /* public: documented fields in the urb that can be used by drivers */ | 1346 | /* public: documented fields in the urb that can be used by drivers */ |
| @@ -1466,6 +1485,7 @@ extern void usb_poison_urb(struct urb *urb); | |||
| 1466 | extern void usb_unpoison_urb(struct urb *urb); | 1485 | extern void usb_unpoison_urb(struct urb *urb); |
| 1467 | extern void usb_kill_anchored_urbs(struct usb_anchor *anchor); | 1486 | extern void usb_kill_anchored_urbs(struct usb_anchor *anchor); |
| 1468 | extern void usb_poison_anchored_urbs(struct usb_anchor *anchor); | 1487 | extern void usb_poison_anchored_urbs(struct usb_anchor *anchor); |
| 1488 | extern void usb_unpoison_anchored_urbs(struct usb_anchor *anchor); | ||
| 1469 | extern void usb_unlink_anchored_urbs(struct usb_anchor *anchor); | 1489 | extern void usb_unlink_anchored_urbs(struct usb_anchor *anchor); |
| 1470 | extern void usb_anchor_urb(struct urb *urb, struct usb_anchor *anchor); | 1490 | extern void usb_anchor_urb(struct urb *urb, struct usb_anchor *anchor); |
| 1471 | extern void usb_unanchor_urb(struct urb *urb); | 1491 | extern void usb_unanchor_urb(struct urb *urb); |
| @@ -1722,10 +1742,6 @@ extern void usb_unregister_notify(struct notifier_block *nb); | |||
| 1722 | 1742 | ||
| 1723 | #define err(format, arg...) printk(KERN_ERR KBUILD_MODNAME ": " \ | 1743 | #define err(format, arg...) printk(KERN_ERR KBUILD_MODNAME ": " \ |
| 1724 | format "\n" , ## arg) | 1744 | format "\n" , ## arg) |
| 1725 | #define info(format, arg...) printk(KERN_INFO KBUILD_MODNAME ": " \ | ||
| 1726 | format "\n" , ## arg) | ||
| 1727 | #define warn(format, arg...) printk(KERN_WARNING KBUILD_MODNAME ": " \ | ||
| 1728 | format "\n" , ## arg) | ||
| 1729 | 1745 | ||
| 1730 | #endif /* __KERNEL__ */ | 1746 | #endif /* __KERNEL__ */ |
| 1731 | 1747 | ||
diff --git a/include/linux/usb/association.h b/include/linux/usb/association.h index 07c5e3cf5898..0a4a18b3c1bb 100644 --- a/include/linux/usb/association.h +++ b/include/linux/usb/association.h | |||
| @@ -28,17 +28,17 @@ struct wusb_am_attr { | |||
| 28 | }; | 28 | }; |
| 29 | 29 | ||
| 30 | /* Different fields defined by the spec */ | 30 | /* Different fields defined by the spec */ |
| 31 | #define WUSB_AR_AssociationTypeId { .id = 0x0000, .len = 2 } | 31 | #define WUSB_AR_AssociationTypeId { .id = cpu_to_le16(0x0000), .len = cpu_to_le16(2) } |
| 32 | #define WUSB_AR_AssociationSubTypeId { .id = 0x0001, .len = 2 } | 32 | #define WUSB_AR_AssociationSubTypeId { .id = cpu_to_le16(0x0001), .len = cpu_to_le16(2) } |
| 33 | #define WUSB_AR_Length { .id = 0x0002, .len = 4 } | 33 | #define WUSB_AR_Length { .id = cpu_to_le16(0x0002), .len = cpu_to_le16(4) } |
| 34 | #define WUSB_AR_AssociationStatus { .id = 0x0004, .len = 4 } | 34 | #define WUSB_AR_AssociationStatus { .id = cpu_to_le16(0x0004), .len = cpu_to_le16(4) } |
| 35 | #define WUSB_AR_LangID { .id = 0x0008, .len = 2 } | 35 | #define WUSB_AR_LangID { .id = cpu_to_le16(0x0008), .len = cpu_to_le16(2) } |
| 36 | #define WUSB_AR_DeviceFriendlyName { .id = 0x000b, .len = 64 } /* max */ | 36 | #define WUSB_AR_DeviceFriendlyName { .id = cpu_to_le16(0x000b), .len = cpu_to_le16(64) } /* max */ |
| 37 | #define WUSB_AR_HostFriendlyName { .id = 0x000c, .len = 64 } /* max */ | 37 | #define WUSB_AR_HostFriendlyName { .id = cpu_to_le16(0x000c), .len = cpu_to_le16(64) } /* max */ |
| 38 | #define WUSB_AR_CHID { .id = 0x1000, .len = 16 } | 38 | #define WUSB_AR_CHID { .id = cpu_to_le16(0x1000), .len = cpu_to_le16(16) } |
| 39 | #define WUSB_AR_CDID { .id = 0x1001, .len = 16 } | 39 | #define WUSB_AR_CDID { .id = cpu_to_le16(0x1001), .len = cpu_to_le16(16) } |
| 40 | #define WUSB_AR_ConnectionContext { .id = 0x1002, .len = 48 } | 40 | #define WUSB_AR_ConnectionContext { .id = cpu_to_le16(0x1002), .len = cpu_to_le16(48) } |
| 41 | #define WUSB_AR_BandGroups { .id = 0x1004, .len = 2 } | 41 | #define WUSB_AR_BandGroups { .id = cpu_to_le16(0x1004), .len = cpu_to_le16(2) } |
| 42 | 42 | ||
| 43 | /* CBAF Control Requests (AMS1.0[T4-1] */ | 43 | /* CBAF Control Requests (AMS1.0[T4-1] */ |
| 44 | enum { | 44 | enum { |
diff --git a/include/linux/usb/gpio_vbus.h b/include/linux/usb/gpio_vbus.h new file mode 100644 index 000000000000..d9f03ccc2d60 --- /dev/null +++ b/include/linux/usb/gpio_vbus.h | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | /* | ||
| 2 | * A simple GPIO VBUS sensing driver for B peripheral only devices | ||
| 3 | * with internal transceivers. | ||
| 4 | * Optionally D+ pullup can be controlled by a second GPIO. | ||
| 5 | * | ||
| 6 | * Copyright (c) 2008 Philipp Zabel <philipp.zabel@gmail.com> | ||
| 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 | |||
| 14 | /** | ||
| 15 | * struct gpio_vbus_mach_info - configuration for gpio_vbus | ||
| 16 | * @gpio_vbus: VBUS sensing GPIO | ||
| 17 | * @gpio_pullup: optional D+ or D- pullup GPIO (else negative/invalid) | ||
| 18 | * @gpio_vbus_inverted: true if gpio_vbus is active low | ||
| 19 | * @gpio_pullup_inverted: true if gpio_pullup is active low | ||
| 20 | * | ||
| 21 | * The VBUS sensing GPIO should have a pulldown, which will normally be | ||
| 22 | * part of a resistor ladder turning a 4.0V-5.25V level on VBUS into a | ||
| 23 | * value the GPIO detects as active. Some systems will use comparators. | ||
| 24 | */ | ||
| 25 | struct gpio_vbus_mach_info { | ||
| 26 | int gpio_vbus; | ||
| 27 | int gpio_pullup; | ||
| 28 | bool gpio_vbus_inverted; | ||
| 29 | bool gpio_pullup_inverted; | ||
| 30 | }; | ||
diff --git a/include/linux/usb/musb.h b/include/linux/usb/musb.h index 630962c04ca4..d6aad0ea6033 100644 --- a/include/linux/usb/musb.h +++ b/include/linux/usb/musb.h | |||
| @@ -47,6 +47,11 @@ struct musb_hdrc_config { | |||
| 47 | u8 ram_bits; /* ram address size */ | 47 | u8 ram_bits; /* ram address size */ |
| 48 | 48 | ||
| 49 | struct musb_hdrc_eps_bits *eps_bits; | 49 | struct musb_hdrc_eps_bits *eps_bits; |
| 50 | #ifdef CONFIG_BLACKFIN | ||
| 51 | /* A GPIO controlling VRSEL in Blackfin */ | ||
| 52 | unsigned int gpio_vrsel; | ||
| 53 | #endif | ||
| 54 | |||
| 50 | }; | 55 | }; |
| 51 | 56 | ||
| 52 | struct musb_hdrc_platform_data { | 57 | struct musb_hdrc_platform_data { |
diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h index 1db25d152ad8..94df4fe6c6c0 100644 --- a/include/linux/usb/otg.h +++ b/include/linux/usb/otg.h | |||
| @@ -84,6 +84,7 @@ extern int otg_set_transceiver(struct otg_transceiver *); | |||
| 84 | 84 | ||
| 85 | /* for usb host and peripheral controller drivers */ | 85 | /* for usb host and peripheral controller drivers */ |
| 86 | extern struct otg_transceiver *otg_get_transceiver(void); | 86 | extern struct otg_transceiver *otg_get_transceiver(void); |
| 87 | extern void otg_put_transceiver(struct otg_transceiver *); | ||
| 87 | 88 | ||
| 88 | static inline int | 89 | static inline int |
| 89 | otg_start_hnp(struct otg_transceiver *otg) | 90 | otg_start_hnp(struct otg_transceiver *otg) |
diff --git a/include/linux/usb_usual.h b/include/linux/usb_usual.h index d9a3bbe38e6b..1eea1ab68dc4 100644 --- a/include/linux/usb_usual.h +++ b/include/linux/usb_usual.h | |||
| @@ -52,8 +52,11 @@ | |||
| 52 | US_FLAG(MAX_SECTORS_MIN,0x00002000) \ | 52 | US_FLAG(MAX_SECTORS_MIN,0x00002000) \ |
| 53 | /* Sets max_sectors to arch min */ \ | 53 | /* Sets max_sectors to arch min */ \ |
| 54 | US_FLAG(BULK_IGNORE_TAG,0x00004000) \ | 54 | US_FLAG(BULK_IGNORE_TAG,0x00004000) \ |
| 55 | /* Ignore tag mismatch in bulk operations */ | 55 | /* Ignore tag mismatch in bulk operations */ \ |
| 56 | 56 | US_FLAG(SANE_SENSE, 0x00008000) \ | |
| 57 | /* Sane Sense (> 18 bytes) */ \ | ||
| 58 | US_FLAG(CAPACITY_OK, 0x00010000) \ | ||
| 59 | /* READ CAPACITY response is correct */ | ||
| 57 | 60 | ||
| 58 | #define US_FLAG(name, value) US_FL_##name = value , | 61 | #define US_FLAG(name, value) US_FL_##name = value , |
| 59 | enum { US_DO_ALL_FLAGS }; | 62 | enum { US_DO_ALL_FLAGS }; |
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index 307b88577eaa..506e7620a986 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h | |||
| @@ -97,6 +97,10 @@ extern void unmap_kernel_range(unsigned long addr, unsigned long size); | |||
| 97 | extern struct vm_struct *alloc_vm_area(size_t size); | 97 | extern struct vm_struct *alloc_vm_area(size_t size); |
| 98 | extern void free_vm_area(struct vm_struct *area); | 98 | extern void free_vm_area(struct vm_struct *area); |
| 99 | 99 | ||
| 100 | /* for /dev/kmem */ | ||
| 101 | extern long vread(char *buf, char *addr, unsigned long count); | ||
| 102 | extern long vwrite(char *buf, char *addr, unsigned long count); | ||
| 103 | |||
| 100 | /* | 104 | /* |
| 101 | * Internals. Dont't use.. | 105 | * Internals. Dont't use.. |
| 102 | */ | 106 | */ |
diff --git a/include/linux/wimax.h b/include/linux/wimax.h new file mode 100644 index 000000000000..c89de7f4e5b9 --- /dev/null +++ b/include/linux/wimax.h | |||
| @@ -0,0 +1,234 @@ | |||
| 1 | /* | ||
| 2 | * Linux WiMax | ||
| 3 | * API for user space | ||
| 4 | * | ||
| 5 | * | ||
| 6 | * Copyright (C) 2007-2008 Intel Corporation. All rights reserved. | ||
| 7 | * | ||
| 8 | * Redistribution and use in source and binary forms, with or without | ||
| 9 | * modification, are permitted provided that the following conditions | ||
| 10 | * are met: | ||
| 11 | * | ||
| 12 | * * Redistributions of source code must retain the above copyright | ||
| 13 | * notice, this list of conditions and the following disclaimer. | ||
| 14 | * * Redistributions in binary form must reproduce the above copyright | ||
| 15 | * notice, this list of conditions and the following disclaimer in | ||
| 16 | * the documentation and/or other materials provided with the | ||
| 17 | * distribution. | ||
| 18 | * * Neither the name of Intel Corporation nor the names of its | ||
| 19 | * contributors may be used to endorse or promote products derived | ||
| 20 | * from this software without specific prior written permission. | ||
| 21 | * | ||
| 22 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
| 23 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
| 24 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
| 25 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
| 26 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| 27 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
| 28 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
| 29 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
| 30 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| 31 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
| 32 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 33 | * | ||
| 34 | * | ||
| 35 | * Intel Corporation <linux-wimax@intel.com> | ||
| 36 | * Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com> | ||
| 37 | * - Initial implementation | ||
| 38 | * | ||
| 39 | * | ||
| 40 | * This file declares the user/kernel protocol that is spoken over | ||
| 41 | * Generic Netlink, as well as any type declaration that is to be used | ||
| 42 | * by kernel and user space. | ||
| 43 | * | ||
| 44 | * It is intended for user space to clone it verbatim to use it as a | ||
| 45 | * primary reference for definitions. | ||
| 46 | * | ||
| 47 | * Stuff intended for kernel usage as well as full protocol and stack | ||
| 48 | * documentation is rooted in include/net/wimax.h. | ||
| 49 | */ | ||
| 50 | |||
| 51 | #ifndef __LINUX__WIMAX_H__ | ||
| 52 | #define __LINUX__WIMAX_H__ | ||
| 53 | |||
| 54 | #include <linux/types.h> | ||
| 55 | |||
| 56 | enum { | ||
| 57 | /** | ||
| 58 | * Version of the interface (unsigned decimal, MMm, max 25.5) | ||
| 59 | * M - Major: change if removing or modifying an existing call. | ||
| 60 | * m - minor: change when adding a new call | ||
| 61 | */ | ||
| 62 | WIMAX_GNL_VERSION = 00, | ||
| 63 | /* Generic NetLink attributes */ | ||
| 64 | WIMAX_GNL_ATTR_INVALID = 0x00, | ||
| 65 | WIMAX_GNL_ATTR_MAX = 10, | ||
| 66 | }; | ||
| 67 | |||
| 68 | |||
| 69 | /* | ||
| 70 | * Generic NetLink operations | ||
| 71 | * | ||
| 72 | * Most of these map to an API call; _OP_ stands for operation, _RP_ | ||
| 73 | * for reply and _RE_ for report (aka: signal). | ||
| 74 | */ | ||
| 75 | enum { | ||
| 76 | WIMAX_GNL_OP_MSG_FROM_USER, /* User to kernel message */ | ||
| 77 | WIMAX_GNL_OP_MSG_TO_USER, /* Kernel to user message */ | ||
| 78 | WIMAX_GNL_OP_RFKILL, /* Run wimax_rfkill() */ | ||
| 79 | WIMAX_GNL_OP_RESET, /* Run wimax_rfkill() */ | ||
| 80 | WIMAX_GNL_RE_STATE_CHANGE, /* Report: status change */ | ||
| 81 | }; | ||
| 82 | |||
| 83 | |||
| 84 | /* Message from user / to user */ | ||
| 85 | enum { | ||
| 86 | WIMAX_GNL_MSG_IFIDX = 1, | ||
| 87 | WIMAX_GNL_MSG_PIPE_NAME, | ||
| 88 | WIMAX_GNL_MSG_DATA, | ||
| 89 | }; | ||
| 90 | |||
| 91 | |||
| 92 | /* | ||
| 93 | * wimax_rfkill() | ||
| 94 | * | ||
| 95 | * The state of the radio (ON/OFF) is mapped to the rfkill subsystem's | ||
| 96 | * switch state (DISABLED/ENABLED). | ||
| 97 | */ | ||
| 98 | enum wimax_rf_state { | ||
| 99 | WIMAX_RF_OFF = 0, /* Radio is off, rfkill on/enabled */ | ||
| 100 | WIMAX_RF_ON = 1, /* Radio is on, rfkill off/disabled */ | ||
| 101 | WIMAX_RF_QUERY = 2, | ||
| 102 | }; | ||
| 103 | |||
| 104 | /* Attributes */ | ||
| 105 | enum { | ||
| 106 | WIMAX_GNL_RFKILL_IFIDX = 1, | ||
| 107 | WIMAX_GNL_RFKILL_STATE, | ||
| 108 | }; | ||
| 109 | |||
| 110 | |||
| 111 | /* Attributes for wimax_reset() */ | ||
| 112 | enum { | ||
| 113 | WIMAX_GNL_RESET_IFIDX = 1, | ||
| 114 | }; | ||
| 115 | |||
| 116 | |||
| 117 | /* | ||
| 118 | * Attributes for the Report State Change | ||
| 119 | * | ||
| 120 | * For now we just have the old and new states; new attributes might | ||
| 121 | * be added later on. | ||
| 122 | */ | ||
| 123 | enum { | ||
| 124 | WIMAX_GNL_STCH_IFIDX = 1, | ||
| 125 | WIMAX_GNL_STCH_STATE_OLD, | ||
| 126 | WIMAX_GNL_STCH_STATE_NEW, | ||
| 127 | }; | ||
| 128 | |||
| 129 | |||
| 130 | /** | ||
| 131 | * enum wimax_st - The different states of a WiMAX device | ||
| 132 | * @__WIMAX_ST_NULL: The device structure has been allocated and zeroed, | ||
| 133 | * but still wimax_dev_add() hasn't been called. There is no state. | ||
| 134 | * | ||
| 135 | * @WIMAX_ST_DOWN: The device has been registered with the WiMAX and | ||
| 136 | * networking stacks, but it is not initialized (normally that is | ||
| 137 | * done with 'ifconfig DEV up' [or equivalent], which can upload | ||
| 138 | * firmware and enable communications with the device). | ||
| 139 | * In this state, the device is powered down and using as less | ||
| 140 | * power as possible. | ||
| 141 | * This state is the default after a call to wimax_dev_add(). It | ||
| 142 | * is ok to have drivers move directly to %WIMAX_ST_UNINITIALIZED | ||
| 143 | * or %WIMAX_ST_RADIO_OFF in _probe() after the call to | ||
| 144 | * wimax_dev_add(). | ||
| 145 | * It is recommended that the driver leaves this state when | ||
| 146 | * calling 'ifconfig DEV up' and enters it back on 'ifconfig DEV | ||
| 147 | * down'. | ||
| 148 | * | ||
| 149 | * @__WIMAX_ST_QUIESCING: The device is being torn down, so no API | ||
| 150 | * operations are allowed to proceed except the ones needed to | ||
| 151 | * complete the device clean up process. | ||
| 152 | * | ||
| 153 | * @WIMAX_ST_UNINITIALIZED: [optional] Communication with the device | ||
| 154 | * is setup, but the device still requires some configuration | ||
| 155 | * before being operational. | ||
| 156 | * Some WiMAX API calls might work. | ||
| 157 | * | ||
| 158 | * @WIMAX_ST_RADIO_OFF: The device is fully up; radio is off (wether | ||
| 159 | * by hardware or software switches). | ||
| 160 | * It is recommended to always leave the device in this state | ||
| 161 | * after initialization. | ||
| 162 | * | ||
| 163 | * @WIMAX_ST_READY: The device is fully up and radio is on. | ||
| 164 | * | ||
| 165 | * @WIMAX_ST_SCANNING: [optional] The device has been instructed to | ||
| 166 | * scan. In this state, the device cannot be actively connected to | ||
| 167 | * a network. | ||
| 168 | * | ||
| 169 | * @WIMAX_ST_CONNECTING: The device is connecting to a network. This | ||
| 170 | * state exists because in some devices, the connect process can | ||
| 171 | * include a number of negotiations between user space, kernel | ||
| 172 | * space and the device. User space needs to know what the device | ||
| 173 | * is doing. If the connect sequence in a device is atomic and | ||
| 174 | * fast, the device can transition directly to CONNECTED | ||
| 175 | * | ||
| 176 | * @WIMAX_ST_CONNECTED: The device is connected to a network. | ||
| 177 | * | ||
| 178 | * @__WIMAX_ST_INVALID: This is an invalid state used to mark the | ||
| 179 | * maximum numeric value of states. | ||
| 180 | * | ||
| 181 | * Description: | ||
| 182 | * | ||
| 183 | * Transitions from one state to another one are atomic and can only | ||
| 184 | * be caused in kernel space with wimax_state_change(). To read the | ||
| 185 | * state, use wimax_state_get(). | ||
| 186 | * | ||
| 187 | * States starting with __ are internal and shall not be used or | ||
| 188 | * referred to by drivers or userspace. They look ugly, but that's the | ||
| 189 | * point -- if any use is made non-internal to the stack, it is easier | ||
| 190 | * to catch on review. | ||
| 191 | * | ||
| 192 | * All API operations [with well defined exceptions] will take the | ||
| 193 | * device mutex before starting and then check the state. If the state | ||
| 194 | * is %__WIMAX_ST_NULL, %WIMAX_ST_DOWN, %WIMAX_ST_UNINITIALIZED or | ||
| 195 | * %__WIMAX_ST_QUIESCING, it will drop the lock and quit with | ||
| 196 | * -%EINVAL, -%ENOMEDIUM, -%ENOTCONN or -%ESHUTDOWN. | ||
| 197 | * | ||
| 198 | * The order of the definitions is important, so we can do numerical | ||
| 199 | * comparisons (eg: < %WIMAX_ST_RADIO_OFF means the device is not ready | ||
| 200 | * to operate). | ||
| 201 | */ | ||
| 202 | /* | ||
| 203 | * The allowed state transitions are described in the table below | ||
| 204 | * (states in rows can go to states in columns where there is an X): | ||
| 205 | * | ||
| 206 | * UNINI RADIO READY SCAN CONNEC CONNEC | ||
| 207 | * NULL DOWN QUIESCING TIALIZED OFF NING TING TED | ||
| 208 | * NULL - x | ||
| 209 | * DOWN - x x x | ||
| 210 | * QUIESCING x - | ||
| 211 | * UNINITIALIZED x - x | ||
| 212 | * RADIO_OFF x - x | ||
| 213 | * READY x x - x x x | ||
| 214 | * SCANNING x x x - x x | ||
| 215 | * CONNECTING x x x x - x | ||
| 216 | * CONNECTED x x x - | ||
| 217 | * | ||
| 218 | * This table not available in kernel-doc because the formatting messes it up. | ||
| 219 | */ | ||
| 220 | enum wimax_st { | ||
| 221 | __WIMAX_ST_NULL = 0, | ||
| 222 | WIMAX_ST_DOWN, | ||
| 223 | __WIMAX_ST_QUIESCING, | ||
| 224 | WIMAX_ST_UNINITIALIZED, | ||
| 225 | WIMAX_ST_RADIO_OFF, | ||
| 226 | WIMAX_ST_READY, | ||
| 227 | WIMAX_ST_SCANNING, | ||
| 228 | WIMAX_ST_CONNECTING, | ||
| 229 | WIMAX_ST_CONNECTED, | ||
| 230 | __WIMAX_ST_INVALID /* Always keep last */ | ||
| 231 | }; | ||
| 232 | |||
| 233 | |||
| 234 | #endif /* #ifndef __LINUX__WIMAX_H__ */ | ||
diff --git a/include/linux/wimax/Kbuild b/include/linux/wimax/Kbuild new file mode 100644 index 000000000000..3cb4f269bb09 --- /dev/null +++ b/include/linux/wimax/Kbuild | |||
| @@ -0,0 +1 @@ | |||
| header-y += i2400m.h | |||
diff --git a/include/linux/wimax/debug.h b/include/linux/wimax/debug.h new file mode 100644 index 000000000000..ba0c49399a83 --- /dev/null +++ b/include/linux/wimax/debug.h | |||
| @@ -0,0 +1,453 @@ | |||
| 1 | /* | ||
| 2 | * Linux WiMAX | ||
| 3 | * Collection of tools to manage debug operations. | ||
| 4 | * | ||
| 5 | * | ||
| 6 | * Copyright (C) 2005-2007 Intel Corporation | ||
| 7 | * Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com> | ||
| 8 | * | ||
| 9 | * This program is free software; you can redistribute it and/or | ||
| 10 | * modify it under the terms of the GNU General Public License version | ||
| 11 | * 2 as published by the Free Software Foundation. | ||
| 12 | * | ||
| 13 | * This program is distributed in the hope that it will be useful, | ||
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 16 | * GNU General Public License for more details. | ||
| 17 | * | ||
| 18 | * You should have received a copy of the GNU General Public License | ||
| 19 | * along with this program; if not, write to the Free Software | ||
| 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||
| 21 | * 02110-1301, USA. | ||
| 22 | * | ||
| 23 | * | ||
| 24 | * Don't #include this file directly, read on! | ||
| 25 | * | ||
| 26 | * | ||
| 27 | * EXECUTING DEBUGGING ACTIONS OR NOT | ||
| 28 | * | ||
| 29 | * The main thing this framework provides is decission power to take a | ||
| 30 | * debug action (like printing a message) if the current debug level | ||
| 31 | * allows it. | ||
| 32 | * | ||
| 33 | * The decission power is at two levels: at compile-time (what does | ||
| 34 | * not make it is compiled out) and at run-time. The run-time | ||
| 35 | * selection is done per-submodule (as they are declared by the user | ||
| 36 | * of the framework). | ||
| 37 | * | ||
| 38 | * A call to d_test(L) (L being the target debug level) returns true | ||
| 39 | * if the action should be taken because the current debug levels | ||
| 40 | * allow it (both compile and run time). | ||
| 41 | * | ||
| 42 | * It follows that a call to d_test() that can be determined to be | ||
| 43 | * always false at compile time will get the code depending on it | ||
| 44 | * compiled out by optimization. | ||
| 45 | * | ||
| 46 | * | ||
| 47 | * DEBUG LEVELS | ||
| 48 | * | ||
| 49 | * It is up to the caller to define how much a debugging level is. | ||
| 50 | * | ||
| 51 | * Convention sets 0 as "no debug" (so an action marked as debug level 0 | ||
| 52 | * will always be taken). The increasing debug levels are used for | ||
| 53 | * increased verbosity. | ||
| 54 | * | ||
| 55 | * | ||
| 56 | * USAGE | ||
| 57 | * | ||
| 58 | * Group the code in modules and submodules inside each module [which | ||
| 59 | * in most cases maps to Linux modules and .c files that compose | ||
| 60 | * those]. | ||
| 61 | * | ||
| 62 | * | ||
| 63 | * For each module, there is: | ||
| 64 | * | ||
| 65 | * - a MODULENAME (single word, legal C identifier) | ||
| 66 | * | ||
| 67 | * - a debug-levels.h header file that declares the list of | ||
| 68 | * submodules and that is included by all .c files that use | ||
| 69 | * the debugging tools. The file name can be anything. | ||
| 70 | * | ||
| 71 | * - some (optional) .c code to manipulate the runtime debug levels | ||
| 72 | * through debugfs. | ||
| 73 | * | ||
| 74 | * The debug-levels.h file would look like: | ||
| 75 | * | ||
| 76 | * #ifndef __debug_levels__h__ | ||
| 77 | * #define __debug_levels__h__ | ||
| 78 | * | ||
| 79 | * #define D_MODULENAME modulename | ||
| 80 | * #define D_MASTER 10 | ||
| 81 | * | ||
| 82 | * #include <linux/wimax/debug.h> | ||
| 83 | * | ||
| 84 | * enum d_module { | ||
| 85 | * D_SUBMODULE_DECLARE(submodule_1), | ||
| 86 | * D_SUBMODULE_DECLARE(submodule_2), | ||
| 87 | * ... | ||
| 88 | * D_SUBMODULE_DECLARE(submodule_N) | ||
| 89 | * }; | ||
| 90 | * | ||
| 91 | * #endif | ||
| 92 | * | ||
| 93 | * D_MASTER is the maximum compile-time debug level; any debug actions | ||
| 94 | * above this will be out. D_MODULENAME is the module name (legal C | ||
| 95 | * identifier), which has to be unique for each module (to avoid | ||
| 96 | * namespace collisions during linkage). Note those #defines need to | ||
| 97 | * be done before #including debug.h | ||
| 98 | * | ||
| 99 | * We declare N different submodules whose debug level can be | ||
| 100 | * independently controlled during runtime. | ||
| 101 | * | ||
| 102 | * In a .c file of the module (and only in one of them), define the | ||
| 103 | * following code: | ||
| 104 | * | ||
| 105 | * struct d_level D_LEVEL[] = { | ||
| 106 | * D_SUBMODULE_DEFINE(submodule_1), | ||
| 107 | * D_SUBMODULE_DEFINE(submodule_2), | ||
| 108 | * ... | ||
| 109 | * D_SUBMODULE_DEFINE(submodule_N), | ||
| 110 | * }; | ||
| 111 | * size_t D_LEVEL_SIZE = ARRAY_SIZE(D_LEVEL); | ||
| 112 | * | ||
| 113 | * Externs for d_level_MODULENAME and d_level_size_MODULENAME are used | ||
| 114 | * and declared in this file using the D_LEVEL and D_LEVEL_SIZE macros | ||
| 115 | * #defined also in this file. | ||
| 116 | * | ||
| 117 | * To manipulate from user space the levels, create a debugfs dentry | ||
| 118 | * and then register each submodule with: | ||
| 119 | * | ||
| 120 | * result = d_level_register_debugfs("PREFIX_", submodule_X, parent); | ||
| 121 | * if (result < 0) | ||
| 122 | * goto error; | ||
| 123 | * | ||
| 124 | * Where PREFIX_ is a name of your chosing. This will create debugfs | ||
| 125 | * file with a single numeric value that can be use to tweak it. To | ||
| 126 | * remove the entires, just use debugfs_remove_recursive() on 'parent'. | ||
| 127 | * | ||
| 128 | * NOTE: remember that even if this will show attached to some | ||
| 129 | * particular instance of a device, the settings are *global*. | ||
| 130 | * | ||
| 131 | * | ||
| 132 | * On each submodule (for example, .c files), the debug infrastructure | ||
| 133 | * should be included like this: | ||
| 134 | * | ||
| 135 | * #define D_SUBMODULE submodule_x // matches one in debug-levels.h | ||
| 136 | * #include "debug-levels.h" | ||
| 137 | * | ||
| 138 | * after #including all your include files. | ||
| 139 | * | ||
| 140 | * | ||
| 141 | * Now you can use the d_*() macros below [d_test(), d_fnstart(), | ||
| 142 | * d_fnend(), d_printf(), d_dump()]. | ||
| 143 | * | ||
| 144 | * If their debug level is greater than D_MASTER, they will be | ||
| 145 | * compiled out. | ||
| 146 | * | ||
| 147 | * If their debug level is lower or equal than D_MASTER but greater | ||
| 148 | * than the current debug level of their submodule, they'll be | ||
| 149 | * ignored. | ||
| 150 | * | ||
| 151 | * Otherwise, the action will be performed. | ||
| 152 | */ | ||
| 153 | #ifndef __debug__h__ | ||
| 154 | #define __debug__h__ | ||
| 155 | |||
| 156 | #include <linux/types.h> | ||
| 157 | #include <linux/device.h> | ||
| 158 | |||
| 159 | |||
| 160 | /* Backend stuff */ | ||
| 161 | |||
| 162 | /* | ||
| 163 | * Debug backend: generate a message header from a 'struct device' | ||
| 164 | * | ||
| 165 | * @head: buffer where to place the header | ||
| 166 | * @head_size: length of @head | ||
| 167 | * @dev: pointer to device used to generate a header from. If NULL, | ||
| 168 | * an empty ("") header is generated. | ||
| 169 | */ | ||
| 170 | static inline | ||
| 171 | void __d_head(char *head, size_t head_size, | ||
| 172 | struct device *dev) | ||
| 173 | { | ||
| 174 | if (dev == NULL) | ||
| 175 | head[0] = 0; | ||
| 176 | else if ((unsigned long)dev < 4096) { | ||
| 177 | printk(KERN_ERR "E: Corrupt dev %p\n", dev); | ||
| 178 | WARN_ON(1); | ||
| 179 | } else | ||
| 180 | snprintf(head, head_size, "%s %s: ", | ||
| 181 | dev_driver_string(dev), dev->bus_id); | ||
| 182 | } | ||
| 183 | |||
| 184 | |||
| 185 | /* | ||
| 186 | * Debug backend: log some message if debugging is enabled | ||
| 187 | * | ||
| 188 | * @l: intended debug level | ||
| 189 | * @tag: tag to prefix the message with | ||
| 190 | * @dev: 'struct device' associated to this message | ||
| 191 | * @f: printf-like format and arguments | ||
| 192 | * | ||
| 193 | * Note this is optimized out if it doesn't pass the compile-time | ||
| 194 | * check; however, it is *always* compiled. This is useful to make | ||
| 195 | * sure the printf-like formats and variables are always checked and | ||
| 196 | * they don't get bit rot if you have all the debugging disabled. | ||
| 197 | */ | ||
| 198 | #define _d_printf(l, tag, dev, f, a...) \ | ||
| 199 | do { \ | ||
| 200 | char head[64]; \ | ||
| 201 | if (!d_test(l)) \ | ||
| 202 | break; \ | ||
| 203 | __d_head(head, sizeof(head), dev); \ | ||
| 204 | printk(KERN_ERR "%s%s%s: " f, head, __func__, tag, ##a); \ | ||
| 205 | } while (0) | ||
| 206 | |||
| 207 | |||
| 208 | /* | ||
| 209 | * CPP sintatic sugar to generate A_B like symbol names when one of | ||
| 210 | * the arguments is a a preprocessor #define. | ||
| 211 | */ | ||
| 212 | #define __D_PASTE__(varname, modulename) varname##_##modulename | ||
| 213 | #define __D_PASTE(varname, modulename) (__D_PASTE__(varname, modulename)) | ||
| 214 | #define _D_SUBMODULE_INDEX(_name) (D_SUBMODULE_DECLARE(_name)) | ||
| 215 | |||
| 216 | |||
| 217 | /* | ||
| 218 | * Store a submodule's runtime debug level and name | ||
| 219 | */ | ||
| 220 | struct d_level { | ||
| 221 | u8 level; | ||
| 222 | const char *name; | ||
| 223 | }; | ||
| 224 | |||
| 225 | |||
| 226 | /* | ||
| 227 | * List of available submodules and their debug levels | ||
| 228 | * | ||
| 229 | * We call them d_level_MODULENAME and d_level_size_MODULENAME; the | ||
| 230 | * macros D_LEVEL and D_LEVEL_SIZE contain the name already for | ||
| 231 | * convenience. | ||
| 232 | * | ||
| 233 | * This array and the size are defined on some .c file that is part of | ||
| 234 | * the current module. | ||
| 235 | */ | ||
| 236 | #define D_LEVEL __D_PASTE(d_level, D_MODULENAME) | ||
| 237 | #define D_LEVEL_SIZE __D_PASTE(d_level_size, D_MODULENAME) | ||
| 238 | |||
| 239 | extern struct d_level D_LEVEL[]; | ||
| 240 | extern size_t D_LEVEL_SIZE; | ||
| 241 | |||
| 242 | |||
| 243 | /* | ||
| 244 | * Frontend stuff | ||
| 245 | * | ||
| 246 | * | ||
| 247 | * Stuff you need to declare prior to using the actual "debug" actions | ||
| 248 | * (defined below). | ||
| 249 | */ | ||
| 250 | |||
| 251 | #ifndef D_MODULENAME | ||
| 252 | #error D_MODULENAME is not defined in your debug-levels.h file | ||
| 253 | /** | ||
| 254 | * D_MODULE - Name of the current module | ||
| 255 | * | ||
| 256 | * #define in your module's debug-levels.h, making sure it is | ||
| 257 | * unique. This has to be a legal C identifier. | ||
| 258 | */ | ||
| 259 | #define D_MODULENAME undefined_modulename | ||
| 260 | #endif | ||
| 261 | |||
| 262 | |||
| 263 | #ifndef D_MASTER | ||
| 264 | #warning D_MASTER not defined, but debug.h included! [see docs] | ||
| 265 | /** | ||
| 266 | * D_MASTER - Compile time maximum debug level | ||
| 267 | * | ||
| 268 | * #define in your debug-levels.h file to the maximum debug level the | ||
| 269 | * runtime code will be allowed to have. This allows you to provide a | ||
| 270 | * main knob. | ||
| 271 | * | ||
| 272 | * Anything above that level will be optimized out of the compile. | ||
| 273 | * | ||
| 274 | * Defaults to zero (no debug code compiled in). | ||
| 275 | * | ||
| 276 | * Maximum one definition per module (at the debug-levels.h file). | ||
| 277 | */ | ||
| 278 | #define D_MASTER 0 | ||
| 279 | #endif | ||
| 280 | |||
| 281 | #ifndef D_SUBMODULE | ||
| 282 | #error D_SUBMODULE not defined, but debug.h included! [see docs] | ||
| 283 | /** | ||
| 284 | * D_SUBMODULE - Name of the current submodule | ||
| 285 | * | ||
| 286 | * #define in your submodule .c file before #including debug-levels.h | ||
| 287 | * to the name of the current submodule as previously declared and | ||
| 288 | * defined with D_SUBMODULE_DECLARE() (in your module's | ||
| 289 | * debug-levels.h) and D_SUBMODULE_DEFINE(). | ||
| 290 | * | ||
| 291 | * This is used to provide runtime-control over the debug levels. | ||
| 292 | * | ||
| 293 | * Maximum one per .c file! Can be shared among different .c files | ||
| 294 | * (meaning they belong to the same submodule categorization). | ||
| 295 | */ | ||
| 296 | #define D_SUBMODULE undefined_module | ||
| 297 | #endif | ||
| 298 | |||
| 299 | |||
| 300 | /** | ||
| 301 | * D_SUBMODULE_DECLARE - Declare a submodule for runtime debug level control | ||
| 302 | * | ||
| 303 | * @_name: name of the submodule, restricted to the chars that make up a | ||
| 304 | * valid C identifier ([a-zA-Z0-9_]). | ||
| 305 | * | ||
| 306 | * Declare in the module's debug-levels.h header file as: | ||
| 307 | * | ||
| 308 | * enum d_module { | ||
| 309 | * D_SUBMODULE_DECLARE(submodule_1), | ||
| 310 | * D_SUBMODULE_DECLARE(submodule_2), | ||
| 311 | * D_SUBMODULE_DECLARE(submodule_3), | ||
| 312 | * }; | ||
| 313 | * | ||
| 314 | * Some corresponding .c file needs to have a matching | ||
| 315 | * D_SUBMODULE_DEFINE(). | ||
| 316 | */ | ||
| 317 | #define D_SUBMODULE_DECLARE(_name) __D_SUBMODULE_##_name | ||
| 318 | |||
| 319 | |||
| 320 | /** | ||
| 321 | * D_SUBMODULE_DEFINE - Define a submodule for runtime debug level control | ||
| 322 | * | ||
| 323 | * @_name: name of the submodule, restricted to the chars that make up a | ||
| 324 | * valid C identifier ([a-zA-Z0-9_]). | ||
| 325 | * | ||
| 326 | * Use once per module (in some .c file) as: | ||
| 327 | * | ||
| 328 | * static | ||
| 329 | * struct d_level d_level_SUBMODULENAME[] = { | ||
| 330 | * D_SUBMODULE_DEFINE(submodule_1), | ||
| 331 | * D_SUBMODULE_DEFINE(submodule_2), | ||
| 332 | * D_SUBMODULE_DEFINE(submodule_3), | ||
| 333 | * }; | ||
| 334 | * size_t d_level_size_SUBDMODULENAME = ARRAY_SIZE(d_level_SUBDMODULENAME); | ||
| 335 | * | ||
| 336 | * Matching D_SUBMODULE_DECLARE()s have to be present in a | ||
| 337 | * debug-levels.h header file. | ||
| 338 | */ | ||
| 339 | #define D_SUBMODULE_DEFINE(_name) \ | ||
| 340 | [__D_SUBMODULE_##_name] = { \ | ||
| 341 | .level = 0, \ | ||
| 342 | .name = #_name \ | ||
| 343 | } | ||
| 344 | |||
| 345 | |||
| 346 | |||
| 347 | /* The actual "debug" operations */ | ||
| 348 | |||
| 349 | |||
| 350 | /** | ||
| 351 | * d_test - Returns true if debugging should be enabled | ||
| 352 | * | ||
| 353 | * @l: intended debug level (unsigned) | ||
| 354 | * | ||
| 355 | * If the master debug switch is enabled and the current settings are | ||
| 356 | * higher or equal to the requested level, then debugging | ||
| 357 | * output/actions should be enabled. | ||
| 358 | * | ||
| 359 | * NOTE: | ||
| 360 | * | ||
| 361 | * This needs to be coded so that it can be evaluated in compile | ||
| 362 | * time; this is why the ugly BUG_ON() is placed in there, so the | ||
| 363 | * D_MASTER evaluation compiles all out if it is compile-time false. | ||
| 364 | */ | ||
| 365 | #define d_test(l) \ | ||
| 366 | ({ \ | ||
| 367 | unsigned __l = l; /* type enforcer */ \ | ||
| 368 | (D_MASTER) >= __l \ | ||
| 369 | && ({ \ | ||
| 370 | BUG_ON(_D_SUBMODULE_INDEX(D_SUBMODULE) >= D_LEVEL_SIZE);\ | ||
| 371 | D_LEVEL[_D_SUBMODULE_INDEX(D_SUBMODULE)].level >= __l; \ | ||
| 372 | }); \ | ||
| 373 | }) | ||
| 374 | |||
| 375 | |||
| 376 | /** | ||
| 377 | * d_fnstart - log message at function start if debugging enabled | ||
| 378 | * | ||
| 379 | * @l: intended debug level | ||
| 380 | * @_dev: 'struct device' pointer, NULL if none (for context) | ||
| 381 | * @f: printf-like format and arguments | ||
| 382 | */ | ||
| 383 | #define d_fnstart(l, _dev, f, a...) _d_printf(l, " FNSTART", _dev, f, ## a) | ||
| 384 | |||
| 385 | |||
| 386 | /** | ||
| 387 | * d_fnend - log message at function end if debugging enabled | ||
| 388 | * | ||
| 389 | * @l: intended debug level | ||
| 390 | * @_dev: 'struct device' pointer, NULL if none (for context) | ||
| 391 | * @f: printf-like format and arguments | ||
| 392 | */ | ||
| 393 | #define d_fnend(l, _dev, f, a...) _d_printf(l, " FNEND", _dev, f, ## a) | ||
| 394 | |||
| 395 | |||
| 396 | /** | ||
| 397 | * d_printf - log message if debugging enabled | ||
| 398 | * | ||
| 399 | * @l: intended debug level | ||
| 400 | * @_dev: 'struct device' pointer, NULL if none (for context) | ||
| 401 | * @f: printf-like format and arguments | ||
| 402 | */ | ||
| 403 | #define d_printf(l, _dev, f, a...) _d_printf(l, "", _dev, f, ## a) | ||
| 404 | |||
| 405 | |||
| 406 | /** | ||
| 407 | * d_dump - log buffer hex dump if debugging enabled | ||
| 408 | * | ||
| 409 | * @l: intended debug level | ||
| 410 | * @_dev: 'struct device' pointer, NULL if none (for context) | ||
| 411 | * @f: printf-like format and arguments | ||
| 412 | */ | ||
| 413 | #define d_dump(l, dev, ptr, size) \ | ||
| 414 | do { \ | ||
| 415 | char head[64]; \ | ||
| 416 | if (!d_test(l)) \ | ||
| 417 | break; \ | ||
| 418 | __d_head(head, sizeof(head), dev); \ | ||
| 419 | print_hex_dump(KERN_ERR, head, 0, 16, 1, \ | ||
| 420 | ((void *) ptr), (size), 0); \ | ||
| 421 | } while (0) | ||
| 422 | |||
| 423 | |||
| 424 | /** | ||
| 425 | * Export a submodule's debug level over debugfs as PREFIXSUBMODULE | ||
| 426 | * | ||
| 427 | * @prefix: string to prefix the name with | ||
| 428 | * @submodule: name of submodule (not a string, just the name) | ||
| 429 | * @dentry: debugfs parent dentry | ||
| 430 | * | ||
| 431 | * Returns: 0 if ok, < 0 errno on error. | ||
| 432 | * | ||
| 433 | * For removing, just use debugfs_remove_recursive() on the parent. | ||
| 434 | */ | ||
| 435 | #define d_level_register_debugfs(prefix, name, parent) \ | ||
| 436 | ({ \ | ||
| 437 | int rc; \ | ||
| 438 | struct dentry *fd; \ | ||
| 439 | struct dentry *verify_parent_type = parent; \ | ||
| 440 | fd = debugfs_create_u8( \ | ||
| 441 | prefix #name, 0600, verify_parent_type, \ | ||
| 442 | &(D_LEVEL[__D_SUBMODULE_ ## name].level)); \ | ||
| 443 | rc = PTR_ERR(fd); \ | ||
| 444 | if (IS_ERR(fd) && rc != -ENODEV) \ | ||
| 445 | printk(KERN_ERR "%s: Can't create debugfs entry %s: " \ | ||
| 446 | "%d\n", __func__, prefix #name, rc); \ | ||
| 447 | else \ | ||
| 448 | rc = 0; \ | ||
| 449 | rc; \ | ||
| 450 | }) | ||
| 451 | |||
| 452 | |||
| 453 | #endif /* #ifndef __debug__h__ */ | ||
diff --git a/include/linux/wimax/i2400m.h b/include/linux/wimax/i2400m.h new file mode 100644 index 000000000000..74198f5bb4dc --- /dev/null +++ b/include/linux/wimax/i2400m.h | |||
| @@ -0,0 +1,512 @@ | |||
| 1 | /* | ||
| 2 | * Intel Wireless WiMax Connection 2400m | ||
| 3 | * Host-Device protocol interface definitions | ||
| 4 | * | ||
| 5 | * | ||
| 6 | * Copyright (C) 2007-2008 Intel Corporation. All rights reserved. | ||
| 7 | * | ||
| 8 | * Redistribution and use in source and binary forms, with or without | ||
| 9 | * modification, are permitted provided that the following conditions | ||
| 10 | * are met: | ||
| 11 | * | ||
| 12 | * * Redistributions of source code must retain the above copyright | ||
| 13 | * notice, this list of conditions and the following disclaimer. | ||
| 14 | * * Redistributions in binary form must reproduce the above copyright | ||
| 15 | * notice, this list of conditions and the following disclaimer in | ||
| 16 | * the documentation and/or other materials provided with the | ||
| 17 | * distribution. | ||
| 18 | * * Neither the name of Intel Corporation nor the names of its | ||
| 19 | * contributors may be used to endorse or promote products derived | ||
| 20 | * from this software without specific prior written permission. | ||
| 21 | * | ||
| 22 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
| 23 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
| 24 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
| 25 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
| 26 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| 27 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
| 28 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
| 29 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
| 30 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| 31 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
| 32 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 33 | * | ||
| 34 | * | ||
| 35 | * Intel Corporation <linux-wimax@intel.com> | ||
| 36 | * Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com> | ||
| 37 | * - Initial implementation | ||
| 38 | * | ||
| 39 | * | ||
| 40 | * This header defines the data structures and constants used to | ||
| 41 | * communicate with the device. | ||
| 42 | * | ||
| 43 | * BOOTMODE/BOOTROM/FIRMWARE UPLOAD PROTOCOL | ||
| 44 | * | ||
| 45 | * The firmware upload protocol is quite simple and only requires a | ||
| 46 | * handful of commands. See drivers/net/wimax/i2400m/fw.c for more | ||
| 47 | * details. | ||
| 48 | * | ||
| 49 | * The BCF data structure is for the firmware file header. | ||
| 50 | * | ||
| 51 | * | ||
| 52 | * THE DATA / CONTROL PROTOCOL | ||
| 53 | * | ||
| 54 | * This is the normal protocol spoken with the device once the | ||
| 55 | * firmware is uploaded. It transports data payloads and control | ||
| 56 | * messages back and forth. | ||
| 57 | * | ||
| 58 | * It consists 'messages' that pack one or more payloads each. The | ||
| 59 | * format is described in detail in drivers/net/wimax/i2400m/rx.c and | ||
| 60 | * tx.c. | ||
| 61 | * | ||
| 62 | * | ||
| 63 | * THE L3L4 PROTOCOL | ||
| 64 | * | ||
| 65 | * The term L3L4 refers to Layer 3 (the device), Layer 4 (the | ||
| 66 | * driver/host software). | ||
| 67 | * | ||
| 68 | * This is the control protocol used by the host to control the i2400m | ||
| 69 | * device (scan, connect, disconnect...). This is sent to / received | ||
| 70 | * as control frames. These frames consist of a header and zero or | ||
| 71 | * more TLVs with information. We call each control frame a "message". | ||
| 72 | * | ||
| 73 | * Each message is composed of: | ||
| 74 | * | ||
| 75 | * HEADER | ||
| 76 | * [TLV0 + PAYLOAD0] | ||
| 77 | * [TLV1 + PAYLOAD1] | ||
| 78 | * [...] | ||
| 79 | * [TLVN + PAYLOADN] | ||
| 80 | * | ||
| 81 | * The HEADER is defined by 'struct i2400m_l3l4_hdr'. The payloads are | ||
| 82 | * defined by a TLV structure (Type Length Value) which is a 'header' | ||
| 83 | * (struct i2400m_tlv_hdr) and then the payload. | ||
| 84 | * | ||
| 85 | * All integers are represented as Little Endian. | ||
| 86 | * | ||
| 87 | * - REQUESTS AND EVENTS | ||
| 88 | * | ||
| 89 | * The requests can be clasified as follows: | ||
| 90 | * | ||
| 91 | * COMMAND: implies a request from the host to the device requesting | ||
| 92 | * an action being performed. The device will reply with a | ||
| 93 | * message (with the same type as the command), status and | ||
| 94 | * no (TLV) payload. Execution of a command might cause | ||
| 95 | * events (of different type) to be sent later on as | ||
| 96 | * device's state changes. | ||
| 97 | * | ||
| 98 | * GET/SET: similar to COMMAND, but will not cause other | ||
| 99 | * EVENTs. The reply, in the case of GET, will contain | ||
| 100 | * TLVs with the requested information. | ||
| 101 | * | ||
| 102 | * EVENT: asynchronous messages sent from the device, maybe as a | ||
| 103 | * consequence of previous COMMANDs but disassociated from | ||
| 104 | * them. | ||
| 105 | * | ||
| 106 | * Only one request might be pending at the same time (ie: don't | ||
| 107 | * parallelize nor post another GET request before the previous | ||
| 108 | * COMMAND has been acknowledged with it's corresponding reply by the | ||
| 109 | * device). | ||
| 110 | * | ||
| 111 | * The different requests and their formats are described below: | ||
| 112 | * | ||
| 113 | * I2400M_MT_* Message types | ||
| 114 | * I2400M_MS_* Message status (for replies, events) | ||
| 115 | * i2400m_tlv_* TLVs | ||
| 116 | * | ||
| 117 | * data types are named 'struct i2400m_msg_OPNAME', OPNAME matching the | ||
| 118 | * operation. | ||
| 119 | */ | ||
| 120 | |||
| 121 | #ifndef __LINUX__WIMAX__I2400M_H__ | ||
| 122 | #define __LINUX__WIMAX__I2400M_H__ | ||
| 123 | |||
| 124 | #include <linux/types.h> | ||
| 125 | |||
| 126 | |||
| 127 | /* | ||
| 128 | * Host Device Interface (HDI) common to all busses | ||
| 129 | */ | ||
| 130 | |||
| 131 | /* Boot-mode (firmware upload mode) commands */ | ||
| 132 | |||
| 133 | /* Header for the firmware file */ | ||
| 134 | struct i2400m_bcf_hdr { | ||
| 135 | __le32 module_type; | ||
| 136 | __le32 header_len; | ||
| 137 | __le32 header_version; | ||
| 138 | __le32 module_id; | ||
| 139 | __le32 module_vendor; | ||
| 140 | __le32 date; /* BCD YYYMMDD */ | ||
| 141 | __le32 size; | ||
| 142 | __le32 key_size; /* in dwords */ | ||
| 143 | __le32 modulus_size; /* in dwords */ | ||
| 144 | __le32 exponent_size; /* in dwords */ | ||
| 145 | __u8 reserved[88]; | ||
| 146 | } __attribute__ ((packed)); | ||
| 147 | |||
| 148 | /* Boot mode opcodes */ | ||
| 149 | enum i2400m_brh_opcode { | ||
| 150 | I2400M_BRH_READ = 1, | ||
| 151 | I2400M_BRH_WRITE = 2, | ||
| 152 | I2400M_BRH_JUMP = 3, | ||
| 153 | I2400M_BRH_SIGNED_JUMP = 8, | ||
| 154 | I2400M_BRH_HASH_PAYLOAD_ONLY = 9, | ||
| 155 | }; | ||
| 156 | |||
| 157 | /* Boot mode command masks and stuff */ | ||
| 158 | enum i2400m_brh { | ||
| 159 | I2400M_BRH_SIGNATURE = 0xcbbc0000, | ||
| 160 | I2400M_BRH_SIGNATURE_MASK = 0xffff0000, | ||
| 161 | I2400M_BRH_SIGNATURE_SHIFT = 16, | ||
| 162 | I2400M_BRH_OPCODE_MASK = 0x0000000f, | ||
| 163 | I2400M_BRH_RESPONSE_MASK = 0x000000f0, | ||
| 164 | I2400M_BRH_RESPONSE_SHIFT = 4, | ||
| 165 | I2400M_BRH_DIRECT_ACCESS = 0x00000400, | ||
| 166 | I2400M_BRH_RESPONSE_REQUIRED = 0x00000200, | ||
| 167 | I2400M_BRH_USE_CHECKSUM = 0x00000100, | ||
| 168 | }; | ||
| 169 | |||
| 170 | |||
| 171 | /* Constants for bcf->module_id */ | ||
| 172 | enum i2400m_bcf_mod_id { | ||
| 173 | /* Firmware file carries its own pokes -- pokes are a set of | ||
| 174 | * magical values that have to be written in certain memory | ||
| 175 | * addresses to get the device up and ready for firmware | ||
| 176 | * download when it is in non-signed boot mode. */ | ||
| 177 | I2400M_BCF_MOD_ID_POKES = 0x000000001, | ||
| 178 | }; | ||
| 179 | |||
| 180 | |||
| 181 | /** | ||
| 182 | * i2400m_bootrom_header - Header for a boot-mode command | ||
| 183 | * | ||
| 184 | * @cmd: the above command descriptor | ||
| 185 | * @target_addr: where on the device memory should the action be performed. | ||
| 186 | * @data_size: for read/write, amount of data to be read/written | ||
| 187 | * @block_checksum: checksum value (if applicable) | ||
| 188 | * @payload: the beginning of data attached to this header | ||
| 189 | */ | ||
| 190 | struct i2400m_bootrom_header { | ||
| 191 | __le32 command; /* Compose with enum i2400_brh */ | ||
| 192 | __le32 target_addr; | ||
| 193 | __le32 data_size; | ||
| 194 | __le32 block_checksum; | ||
| 195 | char payload[0]; | ||
| 196 | } __attribute__ ((packed)); | ||
| 197 | |||
| 198 | |||
| 199 | /* | ||
| 200 | * Data / control protocol | ||
| 201 | */ | ||
| 202 | |||
| 203 | /* Packet types for the host-device interface */ | ||
| 204 | enum i2400m_pt { | ||
| 205 | I2400M_PT_DATA = 0, | ||
| 206 | I2400M_PT_CTRL, | ||
| 207 | I2400M_PT_TRACE, /* For device debug */ | ||
| 208 | I2400M_PT_RESET_WARM, /* device reset */ | ||
| 209 | I2400M_PT_RESET_COLD, /* USB[transport] reset, like reconnect */ | ||
| 210 | I2400M_PT_ILLEGAL | ||
| 211 | }; | ||
| 212 | |||
| 213 | |||
| 214 | /* | ||
| 215 | * Payload for a data packet | ||
| 216 | * | ||
| 217 | * This is prefixed to each and every outgoing DATA type. | ||
| 218 | */ | ||
| 219 | struct i2400m_pl_data_hdr { | ||
| 220 | __le32 reserved; | ||
| 221 | } __attribute__((packed)); | ||
| 222 | |||
| 223 | |||
| 224 | /* Misc constants */ | ||
| 225 | enum { | ||
| 226 | I2400M_PL_PAD = 16, /* Payload data size alignment */ | ||
| 227 | I2400M_PL_SIZE_MAX = 0x3EFF, | ||
| 228 | I2400M_MAX_PLS_IN_MSG = 60, | ||
| 229 | /* protocol barkers: sync sequences; for notifications they | ||
| 230 | * are sent in groups of four. */ | ||
| 231 | I2400M_H2D_PREVIEW_BARKER = 0xcafe900d, | ||
| 232 | I2400M_COLD_RESET_BARKER = 0xc01dc01d, | ||
| 233 | I2400M_WARM_RESET_BARKER = 0x50f750f7, | ||
| 234 | I2400M_NBOOT_BARKER = 0xdeadbeef, | ||
| 235 | I2400M_SBOOT_BARKER = 0x0ff1c1a1, | ||
| 236 | I2400M_ACK_BARKER = 0xfeedbabe, | ||
| 237 | I2400M_D2H_MSG_BARKER = 0xbeefbabe, | ||
| 238 | }; | ||
| 239 | |||
| 240 | |||
| 241 | /* | ||
| 242 | * Hardware payload descriptor | ||
| 243 | * | ||
| 244 | * Bitfields encoded in a struct to enforce typing semantics. | ||
| 245 | * | ||
| 246 | * Look in rx.c and tx.c for a full description of the format. | ||
| 247 | */ | ||
| 248 | struct i2400m_pld { | ||
| 249 | __le32 val; | ||
| 250 | } __attribute__ ((packed)); | ||
| 251 | |||
| 252 | #define I2400M_PLD_SIZE_MASK 0x00003fff | ||
| 253 | #define I2400M_PLD_TYPE_SHIFT 16 | ||
| 254 | #define I2400M_PLD_TYPE_MASK 0x000f0000 | ||
| 255 | |||
| 256 | /* | ||
| 257 | * Header for a TX message or RX message | ||
| 258 | * | ||
| 259 | * @barker: preamble | ||
| 260 | * @size: used for management of the FIFO queue buffer; before | ||
| 261 | * sending, this is converted to be a real preamble. This | ||
| 262 | * indicates the real size of the TX message that starts at this | ||
| 263 | * point. If the highest bit is set, then this message is to be | ||
| 264 | * skipped. | ||
| 265 | * @sequence: sequence number of this message | ||
| 266 | * @offset: offset where the message itself starts -- see the comments | ||
| 267 | * in the file header about message header and payload descriptor | ||
| 268 | * alignment. | ||
| 269 | * @num_pls: number of payloads in this message | ||
| 270 | * @padding: amount of padding bytes at the end of the message to make | ||
| 271 | * it be of block-size aligned | ||
| 272 | * | ||
| 273 | * Look in rx.c and tx.c for a full description of the format. | ||
| 274 | */ | ||
| 275 | struct i2400m_msg_hdr { | ||
| 276 | union { | ||
| 277 | __le32 barker; | ||
| 278 | __u32 size; /* same size type as barker!! */ | ||
| 279 | }; | ||
| 280 | union { | ||
| 281 | __le32 sequence; | ||
| 282 | __u32 offset; /* same size type as barker!! */ | ||
| 283 | }; | ||
| 284 | __le16 num_pls; | ||
| 285 | __le16 rsv1; | ||
| 286 | __le16 padding; | ||
| 287 | __le16 rsv2; | ||
| 288 | struct i2400m_pld pld[0]; | ||
| 289 | } __attribute__ ((packed)); | ||
| 290 | |||
| 291 | |||
| 292 | |||
| 293 | /* | ||
| 294 | * L3/L4 control protocol | ||
| 295 | */ | ||
| 296 | |||
| 297 | enum { | ||
| 298 | /* Interface version */ | ||
| 299 | I2400M_L3L4_VERSION = 0x0100, | ||
| 300 | }; | ||
| 301 | |||
| 302 | /* Message types */ | ||
| 303 | enum i2400m_mt { | ||
| 304 | I2400M_MT_RESERVED = 0x0000, | ||
| 305 | I2400M_MT_INVALID = 0xffff, | ||
| 306 | I2400M_MT_REPORT_MASK = 0x8000, | ||
| 307 | |||
| 308 | I2400M_MT_GET_SCAN_RESULT = 0x4202, | ||
| 309 | I2400M_MT_SET_SCAN_PARAM = 0x4402, | ||
| 310 | I2400M_MT_CMD_RF_CONTROL = 0x4602, | ||
| 311 | I2400M_MT_CMD_SCAN = 0x4603, | ||
| 312 | I2400M_MT_CMD_CONNECT = 0x4604, | ||
| 313 | I2400M_MT_CMD_DISCONNECT = 0x4605, | ||
| 314 | I2400M_MT_CMD_EXIT_IDLE = 0x4606, | ||
| 315 | I2400M_MT_GET_LM_VERSION = 0x5201, | ||
| 316 | I2400M_MT_GET_DEVICE_INFO = 0x5202, | ||
| 317 | I2400M_MT_GET_LINK_STATUS = 0x5203, | ||
| 318 | I2400M_MT_GET_STATISTICS = 0x5204, | ||
| 319 | I2400M_MT_GET_STATE = 0x5205, | ||
| 320 | I2400M_MT_GET_MEDIA_STATUS = 0x5206, | ||
| 321 | I2400M_MT_SET_INIT_CONFIG = 0x5404, | ||
| 322 | I2400M_MT_CMD_INIT = 0x5601, | ||
| 323 | I2400M_MT_CMD_TERMINATE = 0x5602, | ||
| 324 | I2400M_MT_CMD_MODE_OF_OP = 0x5603, | ||
| 325 | I2400M_MT_CMD_RESET_DEVICE = 0x5604, | ||
| 326 | I2400M_MT_CMD_MONITOR_CONTROL = 0x5605, | ||
| 327 | I2400M_MT_CMD_ENTER_POWERSAVE = 0x5606, | ||
| 328 | I2400M_MT_GET_TLS_OPERATION_RESULT = 0x6201, | ||
| 329 | I2400M_MT_SET_EAP_SUCCESS = 0x6402, | ||
| 330 | I2400M_MT_SET_EAP_FAIL = 0x6403, | ||
| 331 | I2400M_MT_SET_EAP_KEY = 0x6404, | ||
| 332 | I2400M_MT_CMD_SEND_EAP_RESPONSE = 0x6602, | ||
| 333 | I2400M_MT_REPORT_SCAN_RESULT = 0xc002, | ||
| 334 | I2400M_MT_REPORT_STATE = 0xd002, | ||
| 335 | I2400M_MT_REPORT_POWERSAVE_READY = 0xd005, | ||
| 336 | I2400M_MT_REPORT_EAP_REQUEST = 0xe002, | ||
| 337 | I2400M_MT_REPORT_EAP_RESTART = 0xe003, | ||
| 338 | I2400M_MT_REPORT_ALT_ACCEPT = 0xe004, | ||
| 339 | I2400M_MT_REPORT_KEY_REQUEST = 0xe005, | ||
| 340 | }; | ||
| 341 | |||
| 342 | |||
| 343 | /* | ||
| 344 | * Message Ack Status codes | ||
| 345 | * | ||
| 346 | * When a message is replied-to, this status is reported. | ||
| 347 | */ | ||
| 348 | enum i2400m_ms { | ||
| 349 | I2400M_MS_DONE_OK = 0, | ||
| 350 | I2400M_MS_DONE_IN_PROGRESS = 1, | ||
| 351 | I2400M_MS_INVALID_OP = 2, | ||
| 352 | I2400M_MS_BAD_STATE = 3, | ||
| 353 | I2400M_MS_ILLEGAL_VALUE = 4, | ||
| 354 | I2400M_MS_MISSING_PARAMS = 5, | ||
| 355 | I2400M_MS_VERSION_ERROR = 6, | ||
| 356 | I2400M_MS_ACCESSIBILITY_ERROR = 7, | ||
| 357 | I2400M_MS_BUSY = 8, | ||
| 358 | I2400M_MS_CORRUPTED_TLV = 9, | ||
| 359 | I2400M_MS_UNINITIALIZED = 10, | ||
| 360 | I2400M_MS_UNKNOWN_ERROR = 11, | ||
| 361 | I2400M_MS_PRODUCTION_ERROR = 12, | ||
| 362 | I2400M_MS_NO_RF = 13, | ||
| 363 | I2400M_MS_NOT_READY_FOR_POWERSAVE = 14, | ||
| 364 | I2400M_MS_THERMAL_CRITICAL = 15, | ||
| 365 | I2400M_MS_MAX | ||
| 366 | }; | ||
| 367 | |||
| 368 | |||
| 369 | /** | ||
| 370 | * i2400m_tlv - enumeration of the different types of TLVs | ||
| 371 | * | ||
| 372 | * TLVs stand for type-length-value and are the header for a payload | ||
| 373 | * composed of almost anything. Each payload has a type assigned | ||
| 374 | * and a length. | ||
| 375 | */ | ||
| 376 | enum i2400m_tlv { | ||
| 377 | I2400M_TLV_L4_MESSAGE_VERSIONS = 129, | ||
| 378 | I2400M_TLV_SYSTEM_STATE = 141, | ||
| 379 | I2400M_TLV_MEDIA_STATUS = 161, | ||
| 380 | I2400M_TLV_RF_OPERATION = 162, | ||
| 381 | I2400M_TLV_RF_STATUS = 163, | ||
| 382 | I2400M_TLV_DEVICE_RESET_TYPE = 132, | ||
| 383 | I2400M_TLV_CONFIG_IDLE_PARAMETERS = 601, | ||
| 384 | }; | ||
| 385 | |||
| 386 | |||
| 387 | struct i2400m_tlv_hdr { | ||
| 388 | __le16 type; | ||
| 389 | __le16 length; /* payload's */ | ||
| 390 | __u8 pl[0]; | ||
| 391 | } __attribute__((packed)); | ||
| 392 | |||
| 393 | |||
| 394 | struct i2400m_l3l4_hdr { | ||
| 395 | __le16 type; | ||
| 396 | __le16 length; /* payload's */ | ||
| 397 | __le16 version; | ||
| 398 | __le16 resv1; | ||
| 399 | __le16 status; | ||
| 400 | __le16 resv2; | ||
| 401 | struct i2400m_tlv_hdr pl[0]; | ||
| 402 | } __attribute__((packed)); | ||
| 403 | |||
| 404 | |||
| 405 | /** | ||
| 406 | * i2400m_system_state - different states of the device | ||
| 407 | */ | ||
| 408 | enum i2400m_system_state { | ||
| 409 | I2400M_SS_UNINITIALIZED = 1, | ||
| 410 | I2400M_SS_INIT, | ||
| 411 | I2400M_SS_READY, | ||
| 412 | I2400M_SS_SCAN, | ||
| 413 | I2400M_SS_STANDBY, | ||
| 414 | I2400M_SS_CONNECTING, | ||
| 415 | I2400M_SS_WIMAX_CONNECTED, | ||
| 416 | I2400M_SS_DATA_PATH_CONNECTED, | ||
| 417 | I2400M_SS_IDLE, | ||
| 418 | I2400M_SS_DISCONNECTING, | ||
| 419 | I2400M_SS_OUT_OF_ZONE, | ||
| 420 | I2400M_SS_SLEEPACTIVE, | ||
| 421 | I2400M_SS_PRODUCTION, | ||
| 422 | I2400M_SS_CONFIG, | ||
| 423 | I2400M_SS_RF_OFF, | ||
| 424 | I2400M_SS_RF_SHUTDOWN, | ||
| 425 | I2400M_SS_DEVICE_DISCONNECT, | ||
| 426 | I2400M_SS_MAX, | ||
| 427 | }; | ||
| 428 | |||
| 429 | |||
| 430 | /** | ||
| 431 | * i2400m_tlv_system_state - report on the state of the system | ||
| 432 | * | ||
| 433 | * @state: see enum i2400m_system_state | ||
| 434 | */ | ||
| 435 | struct i2400m_tlv_system_state { | ||
| 436 | struct i2400m_tlv_hdr hdr; | ||
| 437 | __le32 state; | ||
| 438 | } __attribute__((packed)); | ||
| 439 | |||
| 440 | |||
| 441 | struct i2400m_tlv_l4_message_versions { | ||
| 442 | struct i2400m_tlv_hdr hdr; | ||
| 443 | __le16 major; | ||
| 444 | __le16 minor; | ||
| 445 | __le16 branch; | ||
| 446 | __le16 reserved; | ||
| 447 | } __attribute__((packed)); | ||
| 448 | |||
| 449 | |||
| 450 | struct i2400m_tlv_detailed_device_info { | ||
| 451 | struct i2400m_tlv_hdr hdr; | ||
| 452 | __u8 reserved1[400]; | ||
| 453 | __u8 mac_address[6]; | ||
| 454 | __u8 reserved2[2]; | ||
| 455 | } __attribute__((packed)); | ||
| 456 | |||
| 457 | |||
| 458 | enum i2400m_rf_switch_status { | ||
| 459 | I2400M_RF_SWITCH_ON = 1, | ||
| 460 | I2400M_RF_SWITCH_OFF = 2, | ||
| 461 | }; | ||
| 462 | |||
| 463 | struct i2400m_tlv_rf_switches_status { | ||
| 464 | struct i2400m_tlv_hdr hdr; | ||
| 465 | __u8 sw_rf_switch; /* 1 ON, 2 OFF */ | ||
| 466 | __u8 hw_rf_switch; /* 1 ON, 2 OFF */ | ||
| 467 | __u8 reserved[2]; | ||
| 468 | } __attribute__((packed)); | ||
| 469 | |||
| 470 | |||
| 471 | enum { | ||
| 472 | i2400m_rf_operation_on = 1, | ||
| 473 | i2400m_rf_operation_off = 2 | ||
| 474 | }; | ||
| 475 | |||
| 476 | struct i2400m_tlv_rf_operation { | ||
| 477 | struct i2400m_tlv_hdr hdr; | ||
| 478 | __le32 status; /* 1 ON, 2 OFF */ | ||
| 479 | } __attribute__((packed)); | ||
| 480 | |||
| 481 | |||
| 482 | enum i2400m_tlv_reset_type { | ||
| 483 | I2400M_RESET_TYPE_COLD = 1, | ||
| 484 | I2400M_RESET_TYPE_WARM | ||
| 485 | }; | ||
| 486 | |||
| 487 | struct i2400m_tlv_device_reset_type { | ||
| 488 | struct i2400m_tlv_hdr hdr; | ||
| 489 | __le32 reset_type; | ||
| 490 | } __attribute__((packed)); | ||
| 491 | |||
| 492 | |||
| 493 | struct i2400m_tlv_config_idle_parameters { | ||
| 494 | struct i2400m_tlv_hdr hdr; | ||
| 495 | __le32 idle_timeout; /* 100 to 300000 ms [5min], 100 increments | ||
| 496 | * 0 disabled */ | ||
| 497 | __le32 idle_paging_interval; /* frames */ | ||
| 498 | } __attribute__((packed)); | ||
| 499 | |||
| 500 | |||
| 501 | enum i2400m_media_status { | ||
| 502 | I2400M_MEDIA_STATUS_LINK_UP = 1, | ||
| 503 | I2400M_MEDIA_STATUS_LINK_DOWN, | ||
| 504 | I2400M_MEDIA_STATUS_LINK_RENEW, | ||
| 505 | }; | ||
| 506 | |||
| 507 | struct i2400m_tlv_media_status { | ||
| 508 | struct i2400m_tlv_hdr hdr; | ||
| 509 | __le32 media_status; | ||
| 510 | } __attribute__((packed)); | ||
| 511 | |||
| 512 | #endif /* #ifndef __LINUX__WIMAX__I2400M_H__ */ | ||
diff --git a/include/linux/writeback.h b/include/linux/writeback.h index e585657e9831..7300ecdc480c 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h | |||
| @@ -30,7 +30,6 @@ static inline int task_is_pdflush(struct task_struct *task) | |||
| 30 | enum writeback_sync_modes { | 30 | enum writeback_sync_modes { |
| 31 | WB_SYNC_NONE, /* Don't wait on anything */ | 31 | WB_SYNC_NONE, /* Don't wait on anything */ |
| 32 | WB_SYNC_ALL, /* Wait on every mapping */ | 32 | WB_SYNC_ALL, /* Wait on every mapping */ |
| 33 | WB_SYNC_HOLD, /* Hold the inode on sb_dirty for sys_sync() */ | ||
| 34 | }; | 33 | }; |
| 35 | 34 | ||
| 36 | /* | 35 | /* |
| @@ -107,7 +106,9 @@ void throttle_vm_writeout(gfp_t gfp_mask); | |||
| 107 | 106 | ||
| 108 | /* These are exported to sysctl. */ | 107 | /* These are exported to sysctl. */ |
| 109 | extern int dirty_background_ratio; | 108 | extern int dirty_background_ratio; |
| 109 | extern unsigned long dirty_background_bytes; | ||
| 110 | extern int vm_dirty_ratio; | 110 | extern int vm_dirty_ratio; |
| 111 | extern unsigned long vm_dirty_bytes; | ||
| 111 | extern int dirty_writeback_interval; | 112 | extern int dirty_writeback_interval; |
| 112 | extern int dirty_expire_interval; | 113 | extern int dirty_expire_interval; |
| 113 | extern int vm_highmem_is_dirtyable; | 114 | extern int vm_highmem_is_dirtyable; |
| @@ -116,17 +117,26 @@ extern int laptop_mode; | |||
| 116 | 117 | ||
| 117 | extern unsigned long determine_dirtyable_memory(void); | 118 | extern unsigned long determine_dirtyable_memory(void); |
| 118 | 119 | ||
| 120 | extern int dirty_background_ratio_handler(struct ctl_table *table, int write, | ||
| 121 | struct file *filp, void __user *buffer, size_t *lenp, | ||
| 122 | loff_t *ppos); | ||
| 123 | extern int dirty_background_bytes_handler(struct ctl_table *table, int write, | ||
| 124 | struct file *filp, void __user *buffer, size_t *lenp, | ||
| 125 | loff_t *ppos); | ||
| 119 | extern int dirty_ratio_handler(struct ctl_table *table, int write, | 126 | extern int dirty_ratio_handler(struct ctl_table *table, int write, |
| 120 | struct file *filp, void __user *buffer, size_t *lenp, | 127 | struct file *filp, void __user *buffer, size_t *lenp, |
| 121 | loff_t *ppos); | 128 | loff_t *ppos); |
| 129 | extern int dirty_bytes_handler(struct ctl_table *table, int write, | ||
| 130 | struct file *filp, void __user *buffer, size_t *lenp, | ||
| 131 | loff_t *ppos); | ||
| 122 | 132 | ||
| 123 | struct ctl_table; | 133 | struct ctl_table; |
| 124 | struct file; | 134 | struct file; |
| 125 | int dirty_writeback_centisecs_handler(struct ctl_table *, int, struct file *, | 135 | int dirty_writeback_centisecs_handler(struct ctl_table *, int, struct file *, |
| 126 | void __user *, size_t *, loff_t *); | 136 | void __user *, size_t *, loff_t *); |
| 127 | 137 | ||
| 128 | void get_dirty_limits(long *pbackground, long *pdirty, long *pbdi_dirty, | 138 | void get_dirty_limits(unsigned long *pbackground, unsigned long *pdirty, |
| 129 | struct backing_dev_info *bdi); | 139 | unsigned long *pbdi_dirty, struct backing_dev_info *bdi); |
| 130 | 140 | ||
| 131 | void page_writeback_init(void); | 141 | void page_writeback_init(void); |
| 132 | void balance_dirty_pages_ratelimited_nr(struct address_space *mapping, | 142 | void balance_dirty_pages_ratelimited_nr(struct address_space *mapping, |
