diff options
Diffstat (limited to 'include/linux')
389 files changed, 11311 insertions, 3718 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 334a3593cdfd..5a5385749e16 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
| @@ -126,6 +126,7 @@ header-y += nfs_mount.h | |||
| 126 | header-y += nl80211.h | 126 | header-y += nl80211.h |
| 127 | header-y += param.h | 127 | header-y += param.h |
| 128 | header-y += pci_regs.h | 128 | header-y += pci_regs.h |
| 129 | header-y += perf_event.h | ||
| 129 | header-y += pfkeyv2.h | 130 | header-y += pfkeyv2.h |
| 130 | header-y += pg.h | 131 | header-y += pg.h |
| 131 | header-y += phantom.h | 132 | header-y += phantom.h |
| @@ -268,6 +269,10 @@ ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm.h \ | |||
| 268 | $(srctree)/include/asm-$(SRCARCH)/kvm.h),) | 269 | $(srctree)/include/asm-$(SRCARCH)/kvm.h),) |
| 269 | unifdef-y += kvm.h | 270 | unifdef-y += kvm.h |
| 270 | endif | 271 | endif |
| 272 | ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm_para.h \ | ||
| 273 | $(srctree)/include/asm-$(SRCARCH)/kvm_para.h),) | ||
| 274 | unifdef-y += kvm_para.h | ||
| 275 | endif | ||
| 271 | unifdef-y += llc.h | 276 | unifdef-y += llc.h |
| 272 | unifdef-y += loop.h | 277 | unifdef-y += loop.h |
| 273 | unifdef-y += lp.h | 278 | unifdef-y += lp.h |
| @@ -325,6 +330,7 @@ unifdef-y += scc.h | |||
| 325 | unifdef-y += sched.h | 330 | unifdef-y += sched.h |
| 326 | unifdef-y += screen_info.h | 331 | unifdef-y += screen_info.h |
| 327 | unifdef-y += sdla.h | 332 | unifdef-y += sdla.h |
| 333 | unifdef-y += securebits.h | ||
| 328 | unifdef-y += selinux_netlink.h | 334 | unifdef-y += selinux_netlink.h |
| 329 | unifdef-y += sem.h | 335 | unifdef-y += sem.h |
| 330 | unifdef-y += serial_core.h | 336 | unifdef-y += serial_core.h |
| @@ -359,6 +365,7 @@ unifdef-y += utsname.h | |||
| 359 | unifdef-y += videodev2.h | 365 | unifdef-y += videodev2.h |
| 360 | unifdef-y += videodev.h | 366 | unifdef-y += videodev.h |
| 361 | unifdef-y += virtio_config.h | 367 | unifdef-y += virtio_config.h |
| 368 | unifdef-y += virtio_ids.h | ||
| 362 | unifdef-y += virtio_blk.h | 369 | unifdef-y += virtio_blk.h |
| 363 | unifdef-y += virtio_net.h | 370 | unifdef-y += virtio_net.h |
| 364 | unifdef-y += virtio_9p.h | 371 | unifdef-y += virtio_9p.h |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 34321cfffeab..dfcd920c3e54 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
| @@ -41,8 +41,6 @@ | |||
| 41 | #include <acpi/acpi_drivers.h> | 41 | #include <acpi/acpi_drivers.h> |
| 42 | #include <acpi/acpi_numa.h> | 42 | #include <acpi/acpi_numa.h> |
| 43 | #include <asm/acpi.h> | 43 | #include <asm/acpi.h> |
| 44 | #include <linux/dmi.h> | ||
| 45 | |||
| 46 | 44 | ||
| 47 | enum acpi_irq_model_id { | 45 | enum acpi_irq_model_id { |
| 48 | ACPI_IRQ_MODEL_PIC = 0, | 46 | ACPI_IRQ_MODEL_PIC = 0, |
| @@ -219,10 +217,8 @@ static inline int acpi_video_display_switch_support(void) | |||
| 219 | #endif /* defined(CONFIG_ACPI_VIDEO) || defined(CONFIG_ACPI_VIDEO_MODULE) */ | 217 | #endif /* defined(CONFIG_ACPI_VIDEO) || defined(CONFIG_ACPI_VIDEO_MODULE) */ |
| 220 | 218 | ||
| 221 | extern int acpi_blacklisted(void); | 219 | extern int acpi_blacklisted(void); |
| 222 | #ifdef CONFIG_DMI | ||
| 223 | extern void acpi_dmi_osi_linux(int enable, const struct dmi_system_id *d); | 220 | extern void acpi_dmi_osi_linux(int enable, const struct dmi_system_id *d); |
| 224 | extern int acpi_osi_setup(char *str); | 221 | extern int acpi_osi_setup(char *str); |
| 225 | #endif | ||
| 226 | 222 | ||
| 227 | #ifdef CONFIG_ACPI_NUMA | 223 | #ifdef CONFIG_ACPI_NUMA |
| 228 | int acpi_get_pxm(acpi_handle handle); | 224 | int acpi_get_pxm(acpi_handle handle); |
| @@ -292,7 +288,10 @@ void __init acpi_s4_no_nvs(void); | |||
| 292 | extern acpi_status acpi_pci_osc_control_set(acpi_handle handle, u32 flags); | 288 | extern acpi_status acpi_pci_osc_control_set(acpi_handle handle, u32 flags); |
| 293 | extern void acpi_early_init(void); | 289 | extern void acpi_early_init(void); |
| 294 | 290 | ||
| 295 | #else /* CONFIG_ACPI */ | 291 | #else /* !CONFIG_ACPI */ |
| 292 | |||
| 293 | #define acpi_disabled 1 | ||
| 294 | |||
| 296 | static inline void acpi_early_init(void) { } | 295 | static inline void acpi_early_init(void) { } |
| 297 | 296 | ||
| 298 | static inline int early_acpi_boot_init(void) | 297 | static inline int early_acpi_boot_init(void) |
| @@ -331,5 +330,11 @@ static inline int acpi_check_mem_region(resource_size_t start, | |||
| 331 | return 0; | 330 | return 0; |
| 332 | } | 331 | } |
| 333 | 332 | ||
| 333 | struct acpi_table_header; | ||
| 334 | static inline int acpi_table_parse(char *id, | ||
| 335 | int (*handler)(struct acpi_table_header *)) | ||
| 336 | { | ||
| 337 | return -1; | ||
| 338 | } | ||
| 334 | #endif /* !CONFIG_ACPI */ | 339 | #endif /* !CONFIG_ACPI */ |
| 335 | #endif /*_LINUX_ACPI_H*/ | 340 | #endif /*_LINUX_ACPI_H*/ |
diff --git a/include/linux/agp_backend.h b/include/linux/agp_backend.h index 76fa794fdac0..9101ed64f803 100644 --- a/include/linux/agp_backend.h +++ b/include/linux/agp_backend.h | |||
| @@ -53,7 +53,7 @@ struct agp_kern_info { | |||
| 53 | int current_memory; | 53 | int current_memory; |
| 54 | bool cant_use_aperture; | 54 | bool cant_use_aperture; |
| 55 | unsigned long page_mask; | 55 | unsigned long page_mask; |
| 56 | struct vm_operations_struct *vm_ops; | 56 | const struct vm_operations_struct *vm_ops; |
| 57 | }; | 57 | }; |
| 58 | 58 | ||
| 59 | /* | 59 | /* |
| @@ -79,9 +79,12 @@ struct agp_memory { | |||
| 79 | u32 physical; | 79 | u32 physical; |
| 80 | bool is_bound; | 80 | bool is_bound; |
| 81 | bool is_flushed; | 81 | bool is_flushed; |
| 82 | bool vmalloc_flag; | 82 | bool vmalloc_flag; |
| 83 | /* list of agp_memory mapped to the aperture */ | 83 | /* list of agp_memory mapped to the aperture */ |
| 84 | struct list_head mapped_list; | 84 | struct list_head mapped_list; |
| 85 | /* DMA-mapped addresses */ | ||
| 86 | struct scatterlist *sg_list; | ||
| 87 | int num_sg; | ||
| 85 | }; | 88 | }; |
| 86 | 89 | ||
| 87 | #define AGP_NORMAL_MEMORY 0 | 90 | #define AGP_NORMAL_MEMORY 0 |
diff --git a/include/linux/aio.h b/include/linux/aio.h index 47f7d932a01d..aea219d7d8d1 100644 --- a/include/linux/aio.h +++ b/include/linux/aio.h | |||
| @@ -225,8 +225,6 @@ static inline void exit_aio(struct mm_struct *mm) { } | |||
| 225 | 225 | ||
| 226 | #define io_wait_to_kiocb(wait) container_of(wait, struct kiocb, ki_wait) | 226 | #define io_wait_to_kiocb(wait) container_of(wait, struct kiocb, ki_wait) |
| 227 | 227 | ||
| 228 | #include <linux/aio_abi.h> | ||
| 229 | |||
| 230 | static inline struct kiocb *list_kiocb(struct list_head *h) | 228 | static inline struct kiocb *list_kiocb(struct list_head *h) |
| 231 | { | 229 | { |
| 232 | return list_entry(h, struct kiocb, ki_list); | 230 | return list_entry(h, struct kiocb, ki_list); |
diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h index 9b93cafa82a0..ab94335b4bb9 100644 --- a/include/linux/amba/bus.h +++ b/include/linux/amba/bus.h | |||
| @@ -36,6 +36,11 @@ struct amba_driver { | |||
| 36 | struct amba_id *id_table; | 36 | struct amba_id *id_table; |
| 37 | }; | 37 | }; |
| 38 | 38 | ||
| 39 | enum amba_vendor { | ||
| 40 | AMBA_VENDOR_ARM = 0x41, | ||
| 41 | AMBA_VENDOR_ST = 0x80, | ||
| 42 | }; | ||
| 43 | |||
| 39 | #define amba_get_drvdata(d) dev_get_drvdata(&d->dev) | 44 | #define amba_get_drvdata(d) dev_get_drvdata(&d->dev) |
| 40 | #define amba_set_drvdata(d,p) dev_set_drvdata(&d->dev, p) | 45 | #define amba_set_drvdata(d,p) dev_set_drvdata(&d->dev, p) |
| 41 | 46 | ||
diff --git a/include/linux/amba/mmci.h b/include/linux/amba/mmci.h new file mode 100644 index 000000000000..6b4241748dda --- /dev/null +++ b/include/linux/amba/mmci.h | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | /* | ||
| 2 | * include/linux/amba/mmci.h | ||
| 3 | */ | ||
| 4 | #ifndef AMBA_MMCI_H | ||
| 5 | #define AMBA_MMCI_H | ||
| 6 | |||
| 7 | #include <linux/mmc/host.h> | ||
| 8 | |||
| 9 | struct mmci_platform_data { | ||
| 10 | unsigned int ocr_mask; /* available voltages */ | ||
| 11 | u32 (*translate_vdd)(struct device *, unsigned int); | ||
| 12 | unsigned int (*status)(struct device *); | ||
| 13 | int gpio_wp; | ||
| 14 | int gpio_cd; | ||
| 15 | unsigned long capabilities; | ||
| 16 | }; | ||
| 17 | |||
| 18 | #endif | ||
diff --git a/include/linux/amba/pl022.h b/include/linux/amba/pl022.h index dcad0ffd1755..e4836c6b3dd7 100644 --- a/include/linux/amba/pl022.h +++ b/include/linux/amba/pl022.h | |||
| @@ -136,12 +136,12 @@ enum ssp_tx_level_trig { | |||
| 136 | 136 | ||
| 137 | /** | 137 | /** |
| 138 | * enum SPI Clock Phase - clock phase (Motorola SPI interface only) | 138 | * enum SPI Clock Phase - clock phase (Motorola SPI interface only) |
| 139 | * @SSP_CLK_RISING_EDGE: Receive data on rising edge | 139 | * @SSP_CLK_FIRST_EDGE: Receive data on first edge transition (actual direction depends on polarity) |
| 140 | * @SSP_CLK_FALLING_EDGE: Receive data on falling edge | 140 | * @SSP_CLK_SECOND_EDGE: Receive data on second edge transition (actual direction depends on polarity) |
| 141 | */ | 141 | */ |
| 142 | enum ssp_spi_clk_phase { | 142 | enum ssp_spi_clk_phase { |
| 143 | SSP_CLK_RISING_EDGE, | 143 | SSP_CLK_FIRST_EDGE, |
| 144 | SSP_CLK_FALLING_EDGE | 144 | SSP_CLK_SECOND_EDGE |
| 145 | }; | 145 | }; |
| 146 | 146 | ||
| 147 | /** | 147 | /** |
diff --git a/include/linux/amba/pl093.h b/include/linux/amba/pl093.h new file mode 100644 index 000000000000..2983e3671adb --- /dev/null +++ b/include/linux/amba/pl093.h | |||
| @@ -0,0 +1,80 @@ | |||
| 1 | /* linux/amba/pl093.h | ||
| 2 | * | ||
| 3 | * Copyright (c) 2008 Simtec Electronics | ||
| 4 | * http://armlinux.simtec.co.uk/ | ||
| 5 | * Ben Dooks <ben@simtec.co.uk> | ||
| 6 | * | ||
| 7 | * AMBA PL093 SSMC (synchronous static memory controller) | ||
| 8 | * See DDI0236.pdf (r0p4) for more details | ||
| 9 | * | ||
| 10 | * This program is free software; you can redistribute it and/or modify | ||
| 11 | * it under the terms of the GNU General Public License version 2 as | ||
| 12 | * published by the Free Software Foundation. | ||
| 13 | */ | ||
| 14 | |||
| 15 | #define SMB_BANK(x) ((x) * 0x20) /* each bank control set is 0x20 apart */ | ||
| 16 | |||
| 17 | /* Offsets for SMBxxxxRy registers */ | ||
| 18 | |||
| 19 | #define SMBIDCYR (0x00) | ||
| 20 | #define SMBWSTRDR (0x04) | ||
| 21 | #define SMBWSTWRR (0x08) | ||
| 22 | #define SMBWSTOENR (0x0C) | ||
| 23 | #define SMBWSTWENR (0x10) | ||
| 24 | #define SMBCR (0x14) | ||
| 25 | #define SMBSR (0x18) | ||
| 26 | #define SMBWSTBRDR (0x1C) | ||
| 27 | |||
| 28 | /* Masks for SMB registers */ | ||
| 29 | #define IDCY_MASK (0xf) | ||
| 30 | #define WSTRD_MASK (0xf) | ||
| 31 | #define WSTWR_MASK (0xf) | ||
| 32 | #define WSTOEN_MASK (0xf) | ||
| 33 | #define WSTWEN_MASK (0xf) | ||
| 34 | |||
| 35 | /* Notes from datasheet: | ||
| 36 | * WSTOEN <= WSTRD | ||
| 37 | * WSTWEN <= WSTWR | ||
| 38 | * | ||
| 39 | * WSTOEN is not used with nWAIT | ||
| 40 | */ | ||
| 41 | |||
| 42 | /* SMBCR bit definitions */ | ||
| 43 | #define SMBCR_BIWRITEEN (1 << 21) | ||
| 44 | #define SMBCR_ADDRVALIDWRITEEN (1 << 20) | ||
| 45 | #define SMBCR_SYNCWRITE (1 << 17) | ||
| 46 | #define SMBCR_BMWRITE (1 << 16) | ||
| 47 | #define SMBCR_WRAPREAD (1 << 14) | ||
| 48 | #define SMBCR_BIREADEN (1 << 13) | ||
| 49 | #define SMBCR_ADDRVALIDREADEN (1 << 12) | ||
| 50 | #define SMBCR_SYNCREAD (1 << 9) | ||
| 51 | #define SMBCR_BMREAD (1 << 8) | ||
| 52 | #define SMBCR_SMBLSPOL (1 << 6) | ||
| 53 | #define SMBCR_WP (1 << 3) | ||
| 54 | #define SMBCR_WAITEN (1 << 2) | ||
| 55 | #define SMBCR_WAITPOL (1 << 1) | ||
| 56 | #define SMBCR_RBLE (1 << 0) | ||
| 57 | |||
| 58 | #define SMBCR_BURSTLENWRITE_MASK (3 << 18) | ||
| 59 | #define SMBCR_BURSTLENWRITE_4 (0 << 18) | ||
| 60 | #define SMBCR_BURSTLENWRITE_8 (1 << 18) | ||
| 61 | #define SMBCR_BURSTLENWRITE_RESERVED (2 << 18) | ||
| 62 | #define SMBCR_BURSTLENWRITE_CONTINUOUS (3 << 18) | ||
| 63 | |||
| 64 | #define SMBCR_BURSTLENREAD_MASK (3 << 10) | ||
| 65 | #define SMBCR_BURSTLENREAD_4 (0 << 10) | ||
| 66 | #define SMBCR_BURSTLENREAD_8 (1 << 10) | ||
| 67 | #define SMBCR_BURSTLENREAD_16 (2 << 10) | ||
| 68 | #define SMBCR_BURSTLENREAD_CONTINUOUS (3 << 10) | ||
| 69 | |||
| 70 | #define SMBCR_MW_MASK (3 << 4) | ||
| 71 | #define SMBCR_MW_8BIT (0 << 4) | ||
| 72 | #define SMBCR_MW_16BIT (1 << 4) | ||
| 73 | #define SMBCR_MW_M32BIT (2 << 4) | ||
| 74 | |||
| 75 | /* SSMC status registers */ | ||
| 76 | #define SSMCCSR (0x200) | ||
| 77 | #define SSMCCR (0x204) | ||
| 78 | #define SSMCITCR (0x208) | ||
| 79 | #define SSMCITIP (0x20C) | ||
| 80 | #define SSMCITIOP (0x210) | ||
diff --git a/include/linux/anon_inodes.h b/include/linux/anon_inodes.h index e0a0cdc2da43..69a21e0ebd33 100644 --- a/include/linux/anon_inodes.h +++ b/include/linux/anon_inodes.h | |||
| @@ -8,6 +8,9 @@ | |||
| 8 | #ifndef _LINUX_ANON_INODES_H | 8 | #ifndef _LINUX_ANON_INODES_H |
| 9 | #define _LINUX_ANON_INODES_H | 9 | #define _LINUX_ANON_INODES_H |
| 10 | 10 | ||
| 11 | struct file *anon_inode_getfile(const char *name, | ||
| 12 | const struct file_operations *fops, | ||
| 13 | void *priv, int flags); | ||
| 11 | int anon_inode_getfd(const char *name, const struct file_operations *fops, | 14 | int anon_inode_getfd(const char *name, const struct file_operations *fops, |
| 12 | void *priv, int flags); | 15 | void *priv, int flags); |
| 13 | 16 | ||
diff --git a/include/linux/arcdevice.h b/include/linux/arcdevice.h index cd4bcb6989ce..7d650a0e3d8f 100644 --- a/include/linux/arcdevice.h +++ b/include/linux/arcdevice.h | |||
| @@ -337,7 +337,8 @@ struct net_device *alloc_arcdev(const char *name); | |||
| 337 | 337 | ||
| 338 | int arcnet_open(struct net_device *dev); | 338 | int arcnet_open(struct net_device *dev); |
| 339 | int arcnet_close(struct net_device *dev); | 339 | int arcnet_close(struct net_device *dev); |
| 340 | int arcnet_send_packet(struct sk_buff *skb, struct net_device *dev); | 340 | netdev_tx_t arcnet_send_packet(struct sk_buff *skb, |
| 341 | struct net_device *dev); | ||
| 341 | void arcnet_timeout(struct net_device *dev); | 342 | void arcnet_timeout(struct net_device *dev); |
| 342 | 343 | ||
| 343 | #endif /* __KERNEL__ */ | 344 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/async_tx.h b/include/linux/async_tx.h index 5fc2ef8d97fa..a1c486a88e88 100644 --- a/include/linux/async_tx.h +++ b/include/linux/async_tx.h | |||
| @@ -58,25 +58,60 @@ struct dma_chan_ref { | |||
| 58 | * array. | 58 | * array. |
| 59 | * @ASYNC_TX_ACK: immediately ack the descriptor, precludes setting up a | 59 | * @ASYNC_TX_ACK: immediately ack the descriptor, precludes setting up a |
| 60 | * dependency chain | 60 | * dependency chain |
| 61 | * @ASYNC_TX_DEP_ACK: ack the dependency descriptor. Useful for chaining. | 61 | * @ASYNC_TX_FENCE: specify that the next operation in the dependency |
| 62 | * chain uses this operation's result as an input | ||
| 62 | */ | 63 | */ |
| 63 | enum async_tx_flags { | 64 | enum async_tx_flags { |
| 64 | ASYNC_TX_XOR_ZERO_DST = (1 << 0), | 65 | ASYNC_TX_XOR_ZERO_DST = (1 << 0), |
| 65 | ASYNC_TX_XOR_DROP_DST = (1 << 1), | 66 | ASYNC_TX_XOR_DROP_DST = (1 << 1), |
| 66 | ASYNC_TX_ACK = (1 << 3), | 67 | ASYNC_TX_ACK = (1 << 2), |
| 67 | ASYNC_TX_DEP_ACK = (1 << 4), | 68 | ASYNC_TX_FENCE = (1 << 3), |
| 69 | }; | ||
| 70 | |||
| 71 | /** | ||
| 72 | * struct async_submit_ctl - async_tx submission/completion modifiers | ||
| 73 | * @flags: submission modifiers | ||
| 74 | * @depend_tx: parent dependency of the current operation being submitted | ||
| 75 | * @cb_fn: callback routine to run at operation completion | ||
| 76 | * @cb_param: parameter for the callback routine | ||
| 77 | * @scribble: caller provided space for dma/page address conversions | ||
| 78 | */ | ||
| 79 | struct async_submit_ctl { | ||
| 80 | enum async_tx_flags flags; | ||
| 81 | struct dma_async_tx_descriptor *depend_tx; | ||
| 82 | dma_async_tx_callback cb_fn; | ||
| 83 | void *cb_param; | ||
| 84 | void *scribble; | ||
| 68 | }; | 85 | }; |
| 69 | 86 | ||
| 70 | #ifdef CONFIG_DMA_ENGINE | 87 | #ifdef CONFIG_DMA_ENGINE |
| 71 | #define async_tx_issue_pending_all dma_issue_pending_all | 88 | #define async_tx_issue_pending_all dma_issue_pending_all |
| 89 | |||
| 90 | /** | ||
| 91 | * async_tx_issue_pending - send pending descriptor to the hardware channel | ||
| 92 | * @tx: descriptor handle to retrieve hardware context | ||
| 93 | * | ||
| 94 | * Note: any dependent operations will have already been issued by | ||
| 95 | * async_tx_channel_switch, or (in the case of no channel switch) will | ||
| 96 | * be already pending on this channel. | ||
| 97 | */ | ||
| 98 | static inline void async_tx_issue_pending(struct dma_async_tx_descriptor *tx) | ||
| 99 | { | ||
| 100 | if (likely(tx)) { | ||
| 101 | struct dma_chan *chan = tx->chan; | ||
| 102 | struct dma_device *dma = chan->device; | ||
| 103 | |||
| 104 | dma->device_issue_pending(chan); | ||
| 105 | } | ||
| 106 | } | ||
| 72 | #ifdef CONFIG_ARCH_HAS_ASYNC_TX_FIND_CHANNEL | 107 | #ifdef CONFIG_ARCH_HAS_ASYNC_TX_FIND_CHANNEL |
| 73 | #include <asm/async_tx.h> | 108 | #include <asm/async_tx.h> |
| 74 | #else | 109 | #else |
| 75 | #define async_tx_find_channel(dep, type, dst, dst_count, src, src_count, len) \ | 110 | #define async_tx_find_channel(dep, type, dst, dst_count, src, src_count, len) \ |
| 76 | __async_tx_find_channel(dep, type) | 111 | __async_tx_find_channel(dep, type) |
| 77 | struct dma_chan * | 112 | struct dma_chan * |
| 78 | __async_tx_find_channel(struct dma_async_tx_descriptor *depend_tx, | 113 | __async_tx_find_channel(struct async_submit_ctl *submit, |
| 79 | enum dma_transaction_type tx_type); | 114 | enum dma_transaction_type tx_type); |
| 80 | #endif /* CONFIG_ARCH_HAS_ASYNC_TX_FIND_CHANNEL */ | 115 | #endif /* CONFIG_ARCH_HAS_ASYNC_TX_FIND_CHANNEL */ |
| 81 | #else | 116 | #else |
| 82 | static inline void async_tx_issue_pending_all(void) | 117 | static inline void async_tx_issue_pending_all(void) |
| @@ -84,10 +119,16 @@ static inline void async_tx_issue_pending_all(void) | |||
| 84 | do { } while (0); | 119 | do { } while (0); |
| 85 | } | 120 | } |
| 86 | 121 | ||
| 122 | static inline void async_tx_issue_pending(struct dma_async_tx_descriptor *tx) | ||
| 123 | { | ||
| 124 | do { } while (0); | ||
| 125 | } | ||
| 126 | |||
| 87 | static inline struct dma_chan * | 127 | static inline struct dma_chan * |
| 88 | async_tx_find_channel(struct dma_async_tx_descriptor *depend_tx, | 128 | async_tx_find_channel(struct async_submit_ctl *submit, |
| 89 | enum dma_transaction_type tx_type, struct page **dst, int dst_count, | 129 | enum dma_transaction_type tx_type, struct page **dst, |
| 90 | struct page **src, int src_count, size_t len) | 130 | int dst_count, struct page **src, int src_count, |
| 131 | size_t len) | ||
| 91 | { | 132 | { |
| 92 | return NULL; | 133 | return NULL; |
| 93 | } | 134 | } |
| @@ -99,46 +140,70 @@ async_tx_find_channel(struct dma_async_tx_descriptor *depend_tx, | |||
| 99 | * @cb_fn_param: parameter to pass to the callback routine | 140 | * @cb_fn_param: parameter to pass to the callback routine |
| 100 | */ | 141 | */ |
| 101 | static inline void | 142 | static inline void |
| 102 | async_tx_sync_epilog(dma_async_tx_callback cb_fn, void *cb_fn_param) | 143 | async_tx_sync_epilog(struct async_submit_ctl *submit) |
| 103 | { | 144 | { |
| 104 | if (cb_fn) | 145 | if (submit->cb_fn) |
| 105 | cb_fn(cb_fn_param); | 146 | submit->cb_fn(submit->cb_param); |
| 106 | } | 147 | } |
| 107 | 148 | ||
| 108 | void | 149 | typedef union { |
| 109 | async_tx_submit(struct dma_chan *chan, struct dma_async_tx_descriptor *tx, | 150 | unsigned long addr; |
| 110 | enum async_tx_flags flags, struct dma_async_tx_descriptor *depend_tx, | 151 | struct page *page; |
| 111 | dma_async_tx_callback cb_fn, void *cb_fn_param); | 152 | dma_addr_t dma; |
| 153 | } addr_conv_t; | ||
| 154 | |||
| 155 | static inline void | ||
| 156 | init_async_submit(struct async_submit_ctl *args, enum async_tx_flags flags, | ||
| 157 | struct dma_async_tx_descriptor *tx, | ||
| 158 | dma_async_tx_callback cb_fn, void *cb_param, | ||
| 159 | addr_conv_t *scribble) | ||
| 160 | { | ||
| 161 | args->flags = flags; | ||
| 162 | args->depend_tx = tx; | ||
| 163 | args->cb_fn = cb_fn; | ||
| 164 | args->cb_param = cb_param; | ||
| 165 | args->scribble = scribble; | ||
| 166 | } | ||
| 167 | |||
| 168 | void async_tx_submit(struct dma_chan *chan, struct dma_async_tx_descriptor *tx, | ||
| 169 | struct async_submit_ctl *submit); | ||
| 112 | 170 | ||
| 113 | struct dma_async_tx_descriptor * | 171 | struct dma_async_tx_descriptor * |
| 114 | async_xor(struct page *dest, struct page **src_list, unsigned int offset, | 172 | async_xor(struct page *dest, struct page **src_list, unsigned int offset, |
| 115 | int src_cnt, size_t len, enum async_tx_flags flags, | 173 | int src_cnt, size_t len, struct async_submit_ctl *submit); |
| 116 | struct dma_async_tx_descriptor *depend_tx, | ||
| 117 | dma_async_tx_callback cb_fn, void *cb_fn_param); | ||
| 118 | 174 | ||
| 119 | struct dma_async_tx_descriptor * | 175 | struct dma_async_tx_descriptor * |
| 120 | async_xor_zero_sum(struct page *dest, struct page **src_list, | 176 | async_xor_val(struct page *dest, struct page **src_list, unsigned int offset, |
| 121 | unsigned int offset, int src_cnt, size_t len, | 177 | int src_cnt, size_t len, enum sum_check_flags *result, |
| 122 | u32 *result, enum async_tx_flags flags, | 178 | struct async_submit_ctl *submit); |
| 123 | struct dma_async_tx_descriptor *depend_tx, | ||
| 124 | dma_async_tx_callback cb_fn, void *cb_fn_param); | ||
| 125 | 179 | ||
| 126 | struct dma_async_tx_descriptor * | 180 | struct dma_async_tx_descriptor * |
| 127 | async_memcpy(struct page *dest, struct page *src, unsigned int dest_offset, | 181 | async_memcpy(struct page *dest, struct page *src, unsigned int dest_offset, |
| 128 | unsigned int src_offset, size_t len, enum async_tx_flags flags, | 182 | unsigned int src_offset, size_t len, |
| 129 | struct dma_async_tx_descriptor *depend_tx, | 183 | struct async_submit_ctl *submit); |
| 130 | dma_async_tx_callback cb_fn, void *cb_fn_param); | ||
| 131 | 184 | ||
| 132 | struct dma_async_tx_descriptor * | 185 | struct dma_async_tx_descriptor * |
| 133 | async_memset(struct page *dest, int val, unsigned int offset, | 186 | async_memset(struct page *dest, int val, unsigned int offset, |
| 134 | size_t len, enum async_tx_flags flags, | 187 | size_t len, struct async_submit_ctl *submit); |
| 135 | struct dma_async_tx_descriptor *depend_tx, | 188 | |
| 136 | dma_async_tx_callback cb_fn, void *cb_fn_param); | 189 | struct dma_async_tx_descriptor *async_trigger_callback(struct async_submit_ctl *submit); |
| 190 | |||
| 191 | struct dma_async_tx_descriptor * | ||
| 192 | async_gen_syndrome(struct page **blocks, unsigned int offset, int src_cnt, | ||
| 193 | size_t len, struct async_submit_ctl *submit); | ||
| 194 | |||
| 195 | struct dma_async_tx_descriptor * | ||
| 196 | async_syndrome_val(struct page **blocks, unsigned int offset, int src_cnt, | ||
| 197 | size_t len, enum sum_check_flags *pqres, struct page *spare, | ||
| 198 | struct async_submit_ctl *submit); | ||
| 199 | |||
| 200 | struct dma_async_tx_descriptor * | ||
| 201 | async_raid6_2data_recov(int src_num, size_t bytes, int faila, int failb, | ||
| 202 | struct page **ptrs, struct async_submit_ctl *submit); | ||
| 137 | 203 | ||
| 138 | struct dma_async_tx_descriptor * | 204 | struct dma_async_tx_descriptor * |
| 139 | async_trigger_callback(enum async_tx_flags flags, | 205 | async_raid6_datap_recov(int src_num, size_t bytes, int faila, |
| 140 | struct dma_async_tx_descriptor *depend_tx, | 206 | struct page **ptrs, struct async_submit_ctl *submit); |
| 141 | dma_async_tx_callback cb_fn, void *cb_fn_param); | ||
| 142 | 207 | ||
| 143 | void async_tx_quiesce(struct dma_async_tx_descriptor **tx); | 208 | void async_tx_quiesce(struct dma_async_tx_descriptor **tx); |
| 144 | #endif /* _ASYNC_TX_H_ */ | 209 | #endif /* _ASYNC_TX_H_ */ |
diff --git a/include/linux/ata.h b/include/linux/ata.h index 6299a259ed19..4fb357312b3b 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h | |||
| @@ -334,9 +334,12 @@ enum { | |||
| 334 | SETFEATURES_SATA_DISABLE = 0x90, /* Disable use of SATA feature */ | 334 | SETFEATURES_SATA_DISABLE = 0x90, /* Disable use of SATA feature */ |
| 335 | 335 | ||
| 336 | /* SETFEATURE Sector counts for SATA features */ | 336 | /* SETFEATURE Sector counts for SATA features */ |
| 337 | SATA_AN = 0x05, /* Asynchronous Notification */ | 337 | SATA_FPDMA_OFFSET = 0x01, /* FPDMA non-zero buffer offsets */ |
| 338 | SATA_DIPM = 0x03, /* Device Initiated Power Management */ | 338 | SATA_FPDMA_AA = 0x02, /* FPDMA Setup FIS Auto-Activate */ |
| 339 | SATA_FPDMA_AA = 0x02, /* DMA Setup FIS Auto-Activate */ | 339 | SATA_DIPM = 0x03, /* Device Initiated Power Management */ |
| 340 | SATA_FPDMA_IN_ORDER = 0x04, /* FPDMA in-order data delivery */ | ||
| 341 | SATA_AN = 0x05, /* Asynchronous Notification */ | ||
| 342 | SATA_SSP = 0x06, /* Software Settings Preservation */ | ||
| 340 | 343 | ||
| 341 | /* feature values for SET_MAX */ | 344 | /* feature values for SET_MAX */ |
| 342 | ATA_SET_MAX_ADDR = 0x00, | 345 | ATA_SET_MAX_ADDR = 0x00, |
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h index 086e5c362d3a..817b23705c91 100644 --- a/include/linux/atmdev.h +++ b/include/linux/atmdev.h | |||
| @@ -397,7 +397,7 @@ struct atmdev_ops { /* only send is required */ | |||
| 397 | int (*getsockopt)(struct atm_vcc *vcc,int level,int optname, | 397 | int (*getsockopt)(struct atm_vcc *vcc,int level,int optname, |
| 398 | void __user *optval,int optlen); | 398 | void __user *optval,int optlen); |
| 399 | int (*setsockopt)(struct atm_vcc *vcc,int level,int optname, | 399 | int (*setsockopt)(struct atm_vcc *vcc,int level,int optname, |
| 400 | void __user *optval,int optlen); | 400 | void __user *optval,unsigned int optlen); |
| 401 | int (*send)(struct atm_vcc *vcc,struct sk_buff *skb); | 401 | int (*send)(struct atm_vcc *vcc,struct sk_buff *skb); |
| 402 | int (*send_oam)(struct atm_vcc *vcc,void *cell,int flags); | 402 | int (*send_oam)(struct atm_vcc *vcc,void *cell,int flags); |
| 403 | void (*phy_put)(struct atm_dev *dev,unsigned char value, | 403 | void (*phy_put)(struct atm_dev *dev,unsigned char value, |
diff --git a/include/linux/attribute_container.h b/include/linux/attribute_container.h index 794ad74b1d61..c3ab81428c66 100644 --- a/include/linux/attribute_container.h +++ b/include/linux/attribute_container.h | |||
| @@ -17,7 +17,7 @@ struct attribute_container { | |||
| 17 | struct list_head node; | 17 | struct list_head node; |
| 18 | struct klist containers; | 18 | struct klist containers; |
| 19 | struct class *class; | 19 | struct class *class; |
| 20 | struct attribute_group *grp; | 20 | const struct attribute_group *grp; |
| 21 | struct device_attribute **attrs; | 21 | struct device_attribute **attrs; |
| 22 | int (*match)(struct attribute_container *, struct device *); | 22 | int (*match)(struct attribute_container *, struct device *); |
| 23 | #define ATTRIBUTE_CONTAINER_NO_CLASSDEVS 0x01 | 23 | #define ATTRIBUTE_CONTAINER_NO_CLASSDEVS 0x01 |
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h index f169bcb90b58..b449e738533a 100644 --- a/include/linux/backing-dev.h +++ b/include/linux/backing-dev.h | |||
| @@ -59,6 +59,7 @@ struct bdi_writeback { | |||
| 59 | 59 | ||
| 60 | struct backing_dev_info { | 60 | struct backing_dev_info { |
| 61 | struct list_head bdi_list; | 61 | struct list_head bdi_list; |
| 62 | struct rcu_head rcu_head; | ||
| 62 | unsigned long ra_pages; /* max readahead in PAGE_CACHE_SIZE units */ | 63 | unsigned long ra_pages; /* max readahead in PAGE_CACHE_SIZE units */ |
| 63 | unsigned long state; /* Always use atomic bitops on this */ | 64 | unsigned long state; /* Always use atomic bitops on this */ |
| 64 | unsigned int capabilities; /* Device capabilities */ | 65 | unsigned int capabilities; /* Device capabilities */ |
| @@ -100,7 +101,8 @@ int bdi_register(struct backing_dev_info *bdi, struct device *parent, | |||
| 100 | const char *fmt, ...); | 101 | const char *fmt, ...); |
| 101 | int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev); | 102 | int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev); |
| 102 | void bdi_unregister(struct backing_dev_info *bdi); | 103 | void bdi_unregister(struct backing_dev_info *bdi); |
| 103 | void bdi_start_writeback(struct writeback_control *wbc); | 104 | void bdi_start_writeback(struct backing_dev_info *bdi, struct super_block *sb, |
| 105 | long nr_pages); | ||
| 104 | int bdi_writeback_task(struct bdi_writeback *wb); | 106 | int bdi_writeback_task(struct bdi_writeback *wb); |
| 105 | int bdi_has_dirty_io(struct backing_dev_info *bdi); | 107 | int bdi_has_dirty_io(struct backing_dev_info *bdi); |
| 106 | 108 | ||
diff --git a/include/linux/backlight.h b/include/linux/backlight.h index 79ca2da81c87..0f5f57858a23 100644 --- a/include/linux/backlight.h +++ b/include/linux/backlight.h | |||
| @@ -27,6 +27,11 @@ | |||
| 27 | * Any other use of the locks below is probably wrong. | 27 | * Any other use of the locks below is probably wrong. |
| 28 | */ | 28 | */ |
| 29 | 29 | ||
| 30 | enum backlight_update_reason { | ||
| 31 | BACKLIGHT_UPDATE_HOTKEY, | ||
| 32 | BACKLIGHT_UPDATE_SYSFS, | ||
| 33 | }; | ||
| 34 | |||
| 30 | struct backlight_device; | 35 | struct backlight_device; |
| 31 | struct fb_info; | 36 | struct fb_info; |
| 32 | 37 | ||
| @@ -100,6 +105,8 @@ static inline void backlight_update_status(struct backlight_device *bd) | |||
| 100 | extern struct backlight_device *backlight_device_register(const char *name, | 105 | extern struct backlight_device *backlight_device_register(const char *name, |
| 101 | struct device *dev, void *devdata, struct backlight_ops *ops); | 106 | struct device *dev, void *devdata, struct backlight_ops *ops); |
| 102 | extern void backlight_device_unregister(struct backlight_device *bd); | 107 | extern void backlight_device_unregister(struct backlight_device *bd); |
| 108 | extern void backlight_force_update(struct backlight_device *bd, | ||
| 109 | enum backlight_update_reason reason); | ||
| 103 | 110 | ||
| 104 | #define to_backlight_device(obj) container_of(obj, struct backlight_device, dev) | 111 | #define to_backlight_device(obj) container_of(obj, struct backlight_device, dev) |
| 105 | 112 | ||
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h index 2046b5b8af48..aece486ac734 100644 --- a/include/linux/binfmts.h +++ b/include/linux/binfmts.h | |||
| @@ -120,7 +120,7 @@ extern int copy_strings_kernel(int argc,char ** argv,struct linux_binprm *bprm); | |||
| 120 | extern int prepare_bprm_creds(struct linux_binprm *bprm); | 120 | extern int prepare_bprm_creds(struct linux_binprm *bprm); |
| 121 | extern void install_exec_creds(struct linux_binprm *bprm); | 121 | extern void install_exec_creds(struct linux_binprm *bprm); |
| 122 | extern void do_coredump(long signr, int exit_code, struct pt_regs *regs); | 122 | extern void do_coredump(long signr, int exit_code, struct pt_regs *regs); |
| 123 | extern int set_binfmt(struct linux_binfmt *new); | 123 | extern void set_binfmt(struct linux_binfmt *new); |
| 124 | extern void free_bprm(struct linux_binprm *); | 124 | extern void free_bprm(struct linux_binprm *); |
| 125 | 125 | ||
| 126 | #endif /* __KERNEL__ */ | 126 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/bio.h b/include/linux/bio.h index 2892b710771c..5be93f18d842 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
| @@ -142,56 +142,51 @@ struct bio { | |||
| 142 | * | 142 | * |
| 143 | * bit 0 -- data direction | 143 | * bit 0 -- data direction |
| 144 | * If not set, bio is a read from device. If set, it's a write to device. | 144 | * If not set, bio is a read from device. If set, it's a write to device. |
| 145 | * bit 1 -- rw-ahead when set | 145 | * bit 1 -- fail fast device errors |
| 146 | * bit 2 -- barrier | 146 | * bit 2 -- fail fast transport errors |
| 147 | * bit 3 -- fail fast driver errors | ||
| 148 | * bit 4 -- rw-ahead when set | ||
| 149 | * bit 5 -- barrier | ||
| 147 | * Insert a serialization point in the IO queue, forcing previously | 150 | * Insert a serialization point in the IO queue, forcing previously |
| 148 | * submitted IO to be completed before this one is issued. | 151 | * submitted IO to be completed before this one is issued. |
| 149 | * bit 3 -- synchronous I/O hint. | 152 | * bit 6 -- synchronous I/O hint. |
| 150 | * bit 4 -- Unplug the device immediately after submitting this bio. | 153 | * bit 7 -- Unplug the device immediately after submitting this bio. |
| 151 | * bit 5 -- metadata request | 154 | * bit 8 -- metadata request |
| 152 | * Used for tracing to differentiate metadata and data IO. May also | 155 | * Used for tracing to differentiate metadata and data IO. May also |
| 153 | * get some preferential treatment in the IO scheduler | 156 | * get some preferential treatment in the IO scheduler |
| 154 | * bit 6 -- discard sectors | 157 | * bit 9 -- discard sectors |
| 155 | * Informs the lower level device that this range of sectors is no longer | 158 | * Informs the lower level device that this range of sectors is no longer |
| 156 | * used by the file system and may thus be freed by the device. Used | 159 | * used by the file system and may thus be freed by the device. Used |
| 157 | * for flash based storage. | 160 | * for flash based storage. |
| 158 | * bit 7 -- fail fast device errors | ||
| 159 | * bit 8 -- fail fast transport errors | ||
| 160 | * bit 9 -- fail fast driver errors | ||
| 161 | * Don't want driver retries for any fast fail whatever the reason. | 161 | * Don't want driver retries for any fast fail whatever the reason. |
| 162 | * bit 10 -- Tell the IO scheduler not to wait for more requests after this | 162 | * bit 10 -- Tell the IO scheduler not to wait for more requests after this |
| 163 | one has been submitted, even if it is a SYNC request. | 163 | one has been submitted, even if it is a SYNC request. |
| 164 | */ | 164 | */ |
| 165 | #define BIO_RW 0 /* Must match RW in req flags (blkdev.h) */ | 165 | enum bio_rw_flags { |
| 166 | #define BIO_RW_AHEAD 1 /* Must match FAILFAST in req flags */ | 166 | BIO_RW, |
| 167 | #define BIO_RW_BARRIER 2 | 167 | BIO_RW_FAILFAST_DEV, |
| 168 | #define BIO_RW_SYNCIO 3 | 168 | BIO_RW_FAILFAST_TRANSPORT, |
| 169 | #define BIO_RW_UNPLUG 4 | 169 | BIO_RW_FAILFAST_DRIVER, |
| 170 | #define BIO_RW_META 5 | 170 | /* above flags must match REQ_* */ |
| 171 | #define BIO_RW_DISCARD 6 | 171 | BIO_RW_AHEAD, |
| 172 | #define BIO_RW_FAILFAST_DEV 7 | 172 | BIO_RW_BARRIER, |
| 173 | #define BIO_RW_FAILFAST_TRANSPORT 8 | 173 | BIO_RW_SYNCIO, |
| 174 | #define BIO_RW_FAILFAST_DRIVER 9 | 174 | BIO_RW_UNPLUG, |
| 175 | #define BIO_RW_NOIDLE 10 | 175 | BIO_RW_META, |
| 176 | 176 | BIO_RW_DISCARD, | |
| 177 | #define bio_rw_flagged(bio, flag) ((bio)->bi_rw & (1 << (flag))) | 177 | BIO_RW_NOIDLE, |
| 178 | }; | ||
| 178 | 179 | ||
| 179 | /* | 180 | /* |
| 180 | * Old defines, these should eventually be replaced by direct usage of | 181 | * First four bits must match between bio->bi_rw and rq->cmd_flags, make |
| 181 | * bio_rw_flagged() | 182 | * that explicit here. |
| 182 | */ | 183 | */ |
| 183 | #define bio_barrier(bio) bio_rw_flagged(bio, BIO_RW_BARRIER) | 184 | #define BIO_RW_RQ_MASK 0xf |
| 184 | #define bio_sync(bio) bio_rw_flagged(bio, BIO_RW_SYNCIO) | 185 | |
| 185 | #define bio_unplug(bio) bio_rw_flagged(bio, BIO_RW_UNPLUG) | 186 | static inline bool bio_rw_flagged(struct bio *bio, enum bio_rw_flags flag) |
| 186 | #define bio_failfast_dev(bio) bio_rw_flagged(bio, BIO_RW_FAILFAST_DEV) | 187 | { |
| 187 | #define bio_failfast_transport(bio) \ | 188 | return (bio->bi_rw & (1 << flag)) != 0; |
| 188 | bio_rw_flagged(bio, BIO_RW_FAILFAST_TRANSPORT) | 189 | } |
| 189 | #define bio_failfast_driver(bio) \ | ||
| 190 | bio_rw_flagged(bio, BIO_RW_FAILFAST_DRIVER) | ||
| 191 | #define bio_rw_ahead(bio) bio_rw_flagged(bio, BIO_RW_AHEAD) | ||
| 192 | #define bio_rw_meta(bio) bio_rw_flagged(bio, BIO_RW_META) | ||
| 193 | #define bio_discard(bio) bio_rw_flagged(bio, BIO_RW_DISCARD) | ||
| 194 | #define bio_noidle(bio) bio_rw_flagged(bio, BIO_RW_NOIDLE) | ||
| 195 | 190 | ||
| 196 | /* | 191 | /* |
| 197 | * upper 16 bits of bi_rw define the io priority of this bio | 192 | * upper 16 bits of bi_rw define the io priority of this bio |
| @@ -216,7 +211,7 @@ struct bio { | |||
| 216 | #define bio_offset(bio) bio_iovec((bio))->bv_offset | 211 | #define bio_offset(bio) bio_iovec((bio))->bv_offset |
| 217 | #define bio_segments(bio) ((bio)->bi_vcnt - (bio)->bi_idx) | 212 | #define bio_segments(bio) ((bio)->bi_vcnt - (bio)->bi_idx) |
| 218 | #define bio_sectors(bio) ((bio)->bi_size >> 9) | 213 | #define bio_sectors(bio) ((bio)->bi_size >> 9) |
| 219 | #define bio_empty_barrier(bio) (bio_barrier(bio) && !bio_has_data(bio) && !bio_discard(bio)) | 214 | #define bio_empty_barrier(bio) (bio_rw_flagged(bio, BIO_RW_BARRIER) && !bio_has_data(bio) && !bio_rw_flagged(bio, BIO_RW_DISCARD)) |
| 220 | 215 | ||
| 221 | static inline unsigned int bio_cur_bytes(struct bio *bio) | 216 | static inline unsigned int bio_cur_bytes(struct bio *bio) |
| 222 | { | 217 | { |
diff --git a/include/linux/blk-iopoll.h b/include/linux/blk-iopoll.h new file mode 100644 index 000000000000..308734d3d4a2 --- /dev/null +++ b/include/linux/blk-iopoll.h | |||
| @@ -0,0 +1,48 @@ | |||
| 1 | #ifndef BLK_IOPOLL_H | ||
| 2 | #define BLK_IOPOLL_H | ||
| 3 | |||
| 4 | struct blk_iopoll; | ||
| 5 | typedef int (blk_iopoll_fn)(struct blk_iopoll *, int); | ||
| 6 | |||
| 7 | struct blk_iopoll { | ||
| 8 | struct list_head list; | ||
| 9 | unsigned long state; | ||
| 10 | unsigned long data; | ||
| 11 | int weight; | ||
| 12 | int max; | ||
| 13 | blk_iopoll_fn *poll; | ||
| 14 | }; | ||
| 15 | |||
| 16 | enum { | ||
| 17 | IOPOLL_F_SCHED = 0, | ||
| 18 | IOPOLL_F_DISABLE = 1, | ||
| 19 | }; | ||
| 20 | |||
| 21 | /* | ||
| 22 | * Returns 0 if we successfully set the IOPOLL_F_SCHED bit, indicating | ||
| 23 | * that we were the first to acquire this iop for scheduling. If this iop | ||
| 24 | * is currently disabled, return "failure". | ||
| 25 | */ | ||
| 26 | static inline int blk_iopoll_sched_prep(struct blk_iopoll *iop) | ||
| 27 | { | ||
| 28 | if (!test_bit(IOPOLL_F_DISABLE, &iop->state)) | ||
| 29 | return test_and_set_bit(IOPOLL_F_SCHED, &iop->state); | ||
| 30 | |||
| 31 | return 1; | ||
| 32 | } | ||
| 33 | |||
| 34 | static inline int blk_iopoll_disable_pending(struct blk_iopoll *iop) | ||
| 35 | { | ||
| 36 | return test_bit(IOPOLL_F_DISABLE, &iop->state); | ||
| 37 | } | ||
| 38 | |||
| 39 | extern void blk_iopoll_sched(struct blk_iopoll *); | ||
| 40 | extern void blk_iopoll_init(struct blk_iopoll *, int, blk_iopoll_fn *); | ||
| 41 | extern void blk_iopoll_complete(struct blk_iopoll *); | ||
| 42 | extern void __blk_iopoll_complete(struct blk_iopoll *); | ||
| 43 | extern void blk_iopoll_enable(struct blk_iopoll *); | ||
| 44 | extern void blk_iopoll_disable(struct blk_iopoll *); | ||
| 45 | |||
| 46 | extern int blk_iopoll_enabled; | ||
| 47 | |||
| 48 | #endif | ||
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 69103e053c92..221cecd86bd3 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
| @@ -82,17 +82,17 @@ enum rq_cmd_type_bits { | |||
| 82 | enum { | 82 | enum { |
| 83 | REQ_LB_OP_EJECT = 0x40, /* eject request */ | 83 | REQ_LB_OP_EJECT = 0x40, /* eject request */ |
| 84 | REQ_LB_OP_FLUSH = 0x41, /* flush request */ | 84 | REQ_LB_OP_FLUSH = 0x41, /* flush request */ |
| 85 | REQ_LB_OP_DISCARD = 0x42, /* discard sectors */ | ||
| 86 | }; | 85 | }; |
| 87 | 86 | ||
| 88 | /* | 87 | /* |
| 89 | * request type modified bits. first two bits match BIO_RW* bits, important | 88 | * request type modified bits. first four bits match BIO_RW* bits, important |
| 90 | */ | 89 | */ |
| 91 | enum rq_flag_bits { | 90 | enum rq_flag_bits { |
| 92 | __REQ_RW, /* not set, read. set, write */ | 91 | __REQ_RW, /* not set, read. set, write */ |
| 93 | __REQ_FAILFAST_DEV, /* no driver retries of device errors */ | 92 | __REQ_FAILFAST_DEV, /* no driver retries of device errors */ |
| 94 | __REQ_FAILFAST_TRANSPORT, /* no driver retries of transport errors */ | 93 | __REQ_FAILFAST_TRANSPORT, /* no driver retries of transport errors */ |
| 95 | __REQ_FAILFAST_DRIVER, /* no driver retries of driver errors */ | 94 | __REQ_FAILFAST_DRIVER, /* no driver retries of driver errors */ |
| 95 | /* above flags must match BIO_RW_* */ | ||
| 96 | __REQ_DISCARD, /* request to discard sectors */ | 96 | __REQ_DISCARD, /* request to discard sectors */ |
| 97 | __REQ_SORTED, /* elevator knows about this request */ | 97 | __REQ_SORTED, /* elevator knows about this request */ |
| 98 | __REQ_SOFTBARRIER, /* may not be passed by ioscheduler */ | 98 | __REQ_SOFTBARRIER, /* may not be passed by ioscheduler */ |
| @@ -114,6 +114,7 @@ enum rq_flag_bits { | |||
| 114 | __REQ_INTEGRITY, /* integrity metadata has been remapped */ | 114 | __REQ_INTEGRITY, /* integrity metadata has been remapped */ |
| 115 | __REQ_NOIDLE, /* Don't anticipate more IO after this one */ | 115 | __REQ_NOIDLE, /* Don't anticipate more IO after this one */ |
| 116 | __REQ_IO_STAT, /* account I/O stat */ | 116 | __REQ_IO_STAT, /* account I/O stat */ |
| 117 | __REQ_MIXED_MERGE, /* merge of different types, fail separately */ | ||
| 117 | __REQ_NR_BITS, /* stops here */ | 118 | __REQ_NR_BITS, /* stops here */ |
| 118 | }; | 119 | }; |
| 119 | 120 | ||
| @@ -142,6 +143,10 @@ enum rq_flag_bits { | |||
| 142 | #define REQ_INTEGRITY (1 << __REQ_INTEGRITY) | 143 | #define REQ_INTEGRITY (1 << __REQ_INTEGRITY) |
| 143 | #define REQ_NOIDLE (1 << __REQ_NOIDLE) | 144 | #define REQ_NOIDLE (1 << __REQ_NOIDLE) |
| 144 | #define REQ_IO_STAT (1 << __REQ_IO_STAT) | 145 | #define REQ_IO_STAT (1 << __REQ_IO_STAT) |
| 146 | #define REQ_MIXED_MERGE (1 << __REQ_MIXED_MERGE) | ||
| 147 | |||
| 148 | #define REQ_FAILFAST_MASK (REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | \ | ||
| 149 | REQ_FAILFAST_DRIVER) | ||
| 145 | 150 | ||
| 146 | #define BLK_MAX_CDB 16 | 151 | #define BLK_MAX_CDB 16 |
| 147 | 152 | ||
| @@ -255,7 +260,6 @@ typedef void (request_fn_proc) (struct request_queue *q); | |||
| 255 | typedef int (make_request_fn) (struct request_queue *q, struct bio *bio); | 260 | typedef int (make_request_fn) (struct request_queue *q, struct bio *bio); |
| 256 | typedef int (prep_rq_fn) (struct request_queue *, struct request *); | 261 | typedef int (prep_rq_fn) (struct request_queue *, struct request *); |
| 257 | typedef void (unplug_fn) (struct request_queue *); | 262 | typedef void (unplug_fn) (struct request_queue *); |
| 258 | typedef int (prepare_discard_fn) (struct request_queue *, struct request *); | ||
| 259 | 263 | ||
| 260 | struct bio_vec; | 264 | struct bio_vec; |
| 261 | struct bvec_merge_data { | 265 | struct bvec_merge_data { |
| @@ -307,6 +311,7 @@ struct queue_limits { | |||
| 307 | unsigned int alignment_offset; | 311 | unsigned int alignment_offset; |
| 308 | unsigned int io_min; | 312 | unsigned int io_min; |
| 309 | unsigned int io_opt; | 313 | unsigned int io_opt; |
| 314 | unsigned int max_discard_sectors; | ||
| 310 | 315 | ||
| 311 | unsigned short logical_block_size; | 316 | unsigned short logical_block_size; |
| 312 | unsigned short max_hw_segments; | 317 | unsigned short max_hw_segments; |
| @@ -334,7 +339,6 @@ struct request_queue | |||
| 334 | make_request_fn *make_request_fn; | 339 | make_request_fn *make_request_fn; |
| 335 | prep_rq_fn *prep_rq_fn; | 340 | prep_rq_fn *prep_rq_fn; |
| 336 | unplug_fn *unplug_fn; | 341 | unplug_fn *unplug_fn; |
| 337 | prepare_discard_fn *prepare_discard_fn; | ||
| 338 | merge_bvec_fn *merge_bvec_fn; | 342 | merge_bvec_fn *merge_bvec_fn; |
| 339 | prepare_flush_fn *prepare_flush_fn; | 343 | prepare_flush_fn *prepare_flush_fn; |
| 340 | softirq_done_fn *softirq_done_fn; | 344 | softirq_done_fn *softirq_done_fn; |
| @@ -453,10 +457,13 @@ struct request_queue | |||
| 453 | #define QUEUE_FLAG_NONROT 14 /* non-rotational device (SSD) */ | 457 | #define QUEUE_FLAG_NONROT 14 /* non-rotational device (SSD) */ |
| 454 | #define QUEUE_FLAG_VIRT QUEUE_FLAG_NONROT /* paravirt device */ | 458 | #define QUEUE_FLAG_VIRT QUEUE_FLAG_NONROT /* paravirt device */ |
| 455 | #define QUEUE_FLAG_IO_STAT 15 /* do IO stats */ | 459 | #define QUEUE_FLAG_IO_STAT 15 /* do IO stats */ |
| 460 | #define QUEUE_FLAG_CQ 16 /* hardware does queuing */ | ||
| 461 | #define QUEUE_FLAG_DISCARD 17 /* supports DISCARD */ | ||
| 456 | 462 | ||
| 457 | #define QUEUE_FLAG_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \ | 463 | #define QUEUE_FLAG_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \ |
| 458 | (1 << QUEUE_FLAG_CLUSTER) | \ | 464 | (1 << QUEUE_FLAG_CLUSTER) | \ |
| 459 | (1 << QUEUE_FLAG_STACKABLE)) | 465 | (1 << QUEUE_FLAG_STACKABLE) | \ |
| 466 | (1 << QUEUE_FLAG_SAME_COMP)) | ||
| 460 | 467 | ||
| 461 | static inline int queue_is_locked(struct request_queue *q) | 468 | static inline int queue_is_locked(struct request_queue *q) |
| 462 | { | 469 | { |
| @@ -575,6 +582,7 @@ enum { | |||
| 575 | 582 | ||
| 576 | #define blk_queue_plugged(q) test_bit(QUEUE_FLAG_PLUGGED, &(q)->queue_flags) | 583 | #define blk_queue_plugged(q) test_bit(QUEUE_FLAG_PLUGGED, &(q)->queue_flags) |
| 577 | #define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags) | 584 | #define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags) |
| 585 | #define blk_queue_queuing(q) test_bit(QUEUE_FLAG_CQ, &(q)->queue_flags) | ||
| 578 | #define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags) | 586 | #define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags) |
| 579 | #define blk_queue_nomerges(q) test_bit(QUEUE_FLAG_NOMERGES, &(q)->queue_flags) | 587 | #define blk_queue_nomerges(q) test_bit(QUEUE_FLAG_NOMERGES, &(q)->queue_flags) |
| 580 | #define blk_queue_nonrot(q) test_bit(QUEUE_FLAG_NONROT, &(q)->queue_flags) | 588 | #define blk_queue_nonrot(q) test_bit(QUEUE_FLAG_NONROT, &(q)->queue_flags) |
| @@ -582,6 +590,7 @@ enum { | |||
| 582 | #define blk_queue_flushing(q) ((q)->ordseq) | 590 | #define blk_queue_flushing(q) ((q)->ordseq) |
| 583 | #define blk_queue_stackable(q) \ | 591 | #define blk_queue_stackable(q) \ |
| 584 | test_bit(QUEUE_FLAG_STACKABLE, &(q)->queue_flags) | 592 | test_bit(QUEUE_FLAG_STACKABLE, &(q)->queue_flags) |
| 593 | #define blk_queue_discard(q) test_bit(QUEUE_FLAG_DISCARD, &(q)->queue_flags) | ||
| 585 | 594 | ||
| 586 | #define blk_fs_request(rq) ((rq)->cmd_type == REQ_TYPE_FS) | 595 | #define blk_fs_request(rq) ((rq)->cmd_type == REQ_TYPE_FS) |
| 587 | #define blk_pc_request(rq) ((rq)->cmd_type == REQ_TYPE_BLOCK_PC) | 596 | #define blk_pc_request(rq) ((rq)->cmd_type == REQ_TYPE_BLOCK_PC) |
| @@ -828,11 +837,13 @@ static inline void blk_run_address_space(struct address_space *mapping) | |||
| 828 | } | 837 | } |
| 829 | 838 | ||
| 830 | /* | 839 | /* |
| 831 | * blk_rq_pos() : the current sector | 840 | * blk_rq_pos() : the current sector |
| 832 | * blk_rq_bytes() : bytes left in the entire request | 841 | * blk_rq_bytes() : bytes left in the entire request |
| 833 | * blk_rq_cur_bytes() : bytes left in the current segment | 842 | * blk_rq_cur_bytes() : bytes left in the current segment |
| 834 | * blk_rq_sectors() : sectors left in the entire request | 843 | * blk_rq_err_bytes() : bytes left till the next error boundary |
| 835 | * blk_rq_cur_sectors() : sectors left in the current segment | 844 | * blk_rq_sectors() : sectors left in the entire request |
| 845 | * blk_rq_cur_sectors() : sectors left in the current segment | ||
| 846 | * blk_rq_err_sectors() : sectors left till the next error boundary | ||
| 836 | */ | 847 | */ |
| 837 | static inline sector_t blk_rq_pos(const struct request *rq) | 848 | static inline sector_t blk_rq_pos(const struct request *rq) |
| 838 | { | 849 | { |
| @@ -849,6 +860,8 @@ static inline int blk_rq_cur_bytes(const struct request *rq) | |||
| 849 | return rq->bio ? bio_cur_bytes(rq->bio) : 0; | 860 | return rq->bio ? bio_cur_bytes(rq->bio) : 0; |
| 850 | } | 861 | } |
| 851 | 862 | ||
| 863 | extern unsigned int blk_rq_err_bytes(const struct request *rq); | ||
| 864 | |||
| 852 | static inline unsigned int blk_rq_sectors(const struct request *rq) | 865 | static inline unsigned int blk_rq_sectors(const struct request *rq) |
| 853 | { | 866 | { |
| 854 | return blk_rq_bytes(rq) >> 9; | 867 | return blk_rq_bytes(rq) >> 9; |
| @@ -859,6 +872,11 @@ static inline unsigned int blk_rq_cur_sectors(const struct request *rq) | |||
| 859 | return blk_rq_cur_bytes(rq) >> 9; | 872 | return blk_rq_cur_bytes(rq) >> 9; |
| 860 | } | 873 | } |
| 861 | 874 | ||
| 875 | static inline unsigned int blk_rq_err_sectors(const struct request *rq) | ||
| 876 | { | ||
| 877 | return blk_rq_err_bytes(rq) >> 9; | ||
| 878 | } | ||
| 879 | |||
| 862 | /* | 880 | /* |
| 863 | * Request issue related functions. | 881 | * Request issue related functions. |
| 864 | */ | 882 | */ |
| @@ -885,10 +903,12 @@ extern bool blk_end_request(struct request *rq, int error, | |||
| 885 | unsigned int nr_bytes); | 903 | unsigned int nr_bytes); |
| 886 | extern void blk_end_request_all(struct request *rq, int error); | 904 | extern void blk_end_request_all(struct request *rq, int error); |
| 887 | extern bool blk_end_request_cur(struct request *rq, int error); | 905 | extern bool blk_end_request_cur(struct request *rq, int error); |
| 906 | extern bool blk_end_request_err(struct request *rq, int error); | ||
| 888 | extern bool __blk_end_request(struct request *rq, int error, | 907 | extern bool __blk_end_request(struct request *rq, int error, |
| 889 | unsigned int nr_bytes); | 908 | unsigned int nr_bytes); |
| 890 | extern void __blk_end_request_all(struct request *rq, int error); | 909 | extern void __blk_end_request_all(struct request *rq, int error); |
| 891 | extern bool __blk_end_request_cur(struct request *rq, int error); | 910 | extern bool __blk_end_request_cur(struct request *rq, int error); |
| 911 | extern bool __blk_end_request_err(struct request *rq, int error); | ||
| 892 | 912 | ||
| 893 | extern void blk_complete_request(struct request *); | 913 | extern void blk_complete_request(struct request *); |
| 894 | extern void __blk_complete_request(struct request *); | 914 | extern void __blk_complete_request(struct request *); |
| @@ -909,12 +929,15 @@ extern void blk_queue_max_hw_sectors(struct request_queue *, unsigned int); | |||
| 909 | extern void blk_queue_max_phys_segments(struct request_queue *, unsigned short); | 929 | extern void blk_queue_max_phys_segments(struct request_queue *, unsigned short); |
| 910 | extern void blk_queue_max_hw_segments(struct request_queue *, unsigned short); | 930 | extern void blk_queue_max_hw_segments(struct request_queue *, unsigned short); |
| 911 | extern void blk_queue_max_segment_size(struct request_queue *, unsigned int); | 931 | extern void blk_queue_max_segment_size(struct request_queue *, unsigned int); |
| 932 | extern void blk_queue_max_discard_sectors(struct request_queue *q, | ||
| 933 | unsigned int max_discard_sectors); | ||
| 912 | extern void blk_queue_logical_block_size(struct request_queue *, unsigned short); | 934 | extern void blk_queue_logical_block_size(struct request_queue *, unsigned short); |
| 913 | extern void blk_queue_physical_block_size(struct request_queue *, unsigned short); | 935 | extern void blk_queue_physical_block_size(struct request_queue *, unsigned short); |
| 914 | extern void blk_queue_alignment_offset(struct request_queue *q, | 936 | extern void blk_queue_alignment_offset(struct request_queue *q, |
| 915 | unsigned int alignment); | 937 | unsigned int alignment); |
| 916 | extern void blk_limits_io_min(struct queue_limits *limits, unsigned int min); | 938 | extern void blk_limits_io_min(struct queue_limits *limits, unsigned int min); |
| 917 | extern void blk_queue_io_min(struct request_queue *q, unsigned int min); | 939 | extern void blk_queue_io_min(struct request_queue *q, unsigned int min); |
| 940 | extern void blk_limits_io_opt(struct queue_limits *limits, unsigned int opt); | ||
| 918 | extern void blk_queue_io_opt(struct request_queue *q, unsigned int opt); | 941 | extern void blk_queue_io_opt(struct request_queue *q, unsigned int opt); |
| 919 | extern void blk_set_default_limits(struct queue_limits *lim); | 942 | extern void blk_set_default_limits(struct queue_limits *lim); |
| 920 | extern int blk_stack_limits(struct queue_limits *t, struct queue_limits *b, | 943 | extern int blk_stack_limits(struct queue_limits *t, struct queue_limits *b, |
| @@ -934,7 +957,6 @@ extern void blk_queue_merge_bvec(struct request_queue *, merge_bvec_fn *); | |||
| 934 | extern void blk_queue_dma_alignment(struct request_queue *, int); | 957 | extern void blk_queue_dma_alignment(struct request_queue *, int); |
| 935 | extern void blk_queue_update_dma_alignment(struct request_queue *, int); | 958 | extern void blk_queue_update_dma_alignment(struct request_queue *, int); |
| 936 | extern void blk_queue_softirq_done(struct request_queue *, softirq_done_fn *); | 959 | extern void blk_queue_softirq_done(struct request_queue *, softirq_done_fn *); |
| 937 | extern void blk_queue_set_discard(struct request_queue *, prepare_discard_fn *); | ||
| 938 | extern void blk_queue_rq_timed_out(struct request_queue *, rq_timed_out_fn *); | 960 | extern void blk_queue_rq_timed_out(struct request_queue *, rq_timed_out_fn *); |
| 939 | extern void blk_queue_rq_timeout(struct request_queue *, unsigned int); | 961 | extern void blk_queue_rq_timeout(struct request_queue *, unsigned int); |
| 940 | extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev); | 962 | extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev); |
| @@ -977,15 +999,18 @@ static inline struct request *blk_map_queue_find_tag(struct blk_queue_tag *bqt, | |||
| 977 | } | 999 | } |
| 978 | 1000 | ||
| 979 | extern int blkdev_issue_flush(struct block_device *, sector_t *); | 1001 | extern int blkdev_issue_flush(struct block_device *, sector_t *); |
| 980 | extern int blkdev_issue_discard(struct block_device *, | 1002 | #define DISCARD_FL_WAIT 0x01 /* wait for completion */ |
| 981 | sector_t sector, sector_t nr_sects, gfp_t); | 1003 | #define DISCARD_FL_BARRIER 0x02 /* issue DISCARD_BARRIER request */ |
| 1004 | extern int blkdev_issue_discard(struct block_device *, sector_t sector, | ||
| 1005 | sector_t nr_sects, gfp_t, int flags); | ||
| 982 | 1006 | ||
| 983 | static inline int sb_issue_discard(struct super_block *sb, | 1007 | static inline int sb_issue_discard(struct super_block *sb, |
| 984 | sector_t block, sector_t nr_blocks) | 1008 | sector_t block, sector_t nr_blocks) |
| 985 | { | 1009 | { |
| 986 | block <<= (sb->s_blocksize_bits - 9); | 1010 | block <<= (sb->s_blocksize_bits - 9); |
| 987 | nr_blocks <<= (sb->s_blocksize_bits - 9); | 1011 | nr_blocks <<= (sb->s_blocksize_bits - 9); |
| 988 | return blkdev_issue_discard(sb->s_bdev, block, nr_blocks, GFP_KERNEL); | 1012 | return blkdev_issue_discard(sb->s_bdev, block, nr_blocks, GFP_KERNEL, |
| 1013 | DISCARD_FL_BARRIER); | ||
| 989 | } | 1014 | } |
| 990 | 1015 | ||
| 991 | extern int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm); | 1016 | extern int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm); |
| @@ -1056,25 +1081,37 @@ static inline unsigned int queue_physical_block_size(struct request_queue *q) | |||
| 1056 | return q->limits.physical_block_size; | 1081 | return q->limits.physical_block_size; |
| 1057 | } | 1082 | } |
| 1058 | 1083 | ||
| 1084 | static inline int bdev_physical_block_size(struct block_device *bdev) | ||
| 1085 | { | ||
| 1086 | return queue_physical_block_size(bdev_get_queue(bdev)); | ||
| 1087 | } | ||
| 1088 | |||
| 1059 | static inline unsigned int queue_io_min(struct request_queue *q) | 1089 | static inline unsigned int queue_io_min(struct request_queue *q) |
| 1060 | { | 1090 | { |
| 1061 | return q->limits.io_min; | 1091 | return q->limits.io_min; |
| 1062 | } | 1092 | } |
| 1063 | 1093 | ||
| 1094 | static inline int bdev_io_min(struct block_device *bdev) | ||
| 1095 | { | ||
| 1096 | return queue_io_min(bdev_get_queue(bdev)); | ||
| 1097 | } | ||
| 1098 | |||
| 1064 | static inline unsigned int queue_io_opt(struct request_queue *q) | 1099 | static inline unsigned int queue_io_opt(struct request_queue *q) |
| 1065 | { | 1100 | { |
| 1066 | return q->limits.io_opt; | 1101 | return q->limits.io_opt; |
| 1067 | } | 1102 | } |
| 1068 | 1103 | ||
| 1104 | static inline int bdev_io_opt(struct block_device *bdev) | ||
| 1105 | { | ||
| 1106 | return queue_io_opt(bdev_get_queue(bdev)); | ||
| 1107 | } | ||
| 1108 | |||
| 1069 | static inline int queue_alignment_offset(struct request_queue *q) | 1109 | static inline int queue_alignment_offset(struct request_queue *q) |
| 1070 | { | 1110 | { |
| 1071 | if (q && q->limits.misaligned) | 1111 | if (q->limits.misaligned) |
| 1072 | return -1; | 1112 | return -1; |
| 1073 | 1113 | ||
| 1074 | if (q && q->limits.alignment_offset) | 1114 | return q->limits.alignment_offset; |
| 1075 | return q->limits.alignment_offset; | ||
| 1076 | |||
| 1077 | return 0; | ||
| 1078 | } | 1115 | } |
| 1079 | 1116 | ||
| 1080 | static inline int queue_sector_alignment_offset(struct request_queue *q, | 1117 | static inline int queue_sector_alignment_offset(struct request_queue *q, |
| @@ -1084,6 +1121,19 @@ static inline int queue_sector_alignment_offset(struct request_queue *q, | |||
| 1084 | & (q->limits.io_min - 1); | 1121 | & (q->limits.io_min - 1); |
| 1085 | } | 1122 | } |
| 1086 | 1123 | ||
| 1124 | static inline int bdev_alignment_offset(struct block_device *bdev) | ||
| 1125 | { | ||
| 1126 | struct request_queue *q = bdev_get_queue(bdev); | ||
| 1127 | |||
| 1128 | if (q->limits.misaligned) | ||
| 1129 | return -1; | ||
| 1130 | |||
| 1131 | if (bdev != bdev->bd_contains) | ||
| 1132 | return bdev->bd_part->alignment_offset; | ||
| 1133 | |||
| 1134 | return q->limits.alignment_offset; | ||
| 1135 | } | ||
| 1136 | |||
| 1087 | static inline int queue_dma_alignment(struct request_queue *q) | 1137 | static inline int queue_dma_alignment(struct request_queue *q) |
| 1088 | { | 1138 | { |
| 1089 | return q ? q->dma_alignment : 511; | 1139 | return q ? q->dma_alignment : 511; |
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h index 7e4350ece0f8..3b73b9992b26 100644 --- a/include/linux/blktrace_api.h +++ b/include/linux/blktrace_api.h | |||
| @@ -198,6 +198,7 @@ extern int blk_trace_setup(struct request_queue *q, char *name, dev_t dev, | |||
| 198 | char __user *arg); | 198 | char __user *arg); |
| 199 | extern int blk_trace_startstop(struct request_queue *q, int start); | 199 | extern int blk_trace_startstop(struct request_queue *q, int start); |
| 200 | extern int blk_trace_remove(struct request_queue *q); | 200 | extern int blk_trace_remove(struct request_queue *q); |
| 201 | extern void blk_trace_remove_sysfs(struct device *dev); | ||
| 201 | extern int blk_trace_init_sysfs(struct device *dev); | 202 | extern int blk_trace_init_sysfs(struct device *dev); |
| 202 | 203 | ||
| 203 | extern struct attribute_group blk_trace_attr_group; | 204 | extern struct attribute_group blk_trace_attr_group; |
| @@ -211,6 +212,7 @@ extern struct attribute_group blk_trace_attr_group; | |||
| 211 | # define blk_trace_startstop(q, start) (-ENOTTY) | 212 | # define blk_trace_startstop(q, start) (-ENOTTY) |
| 212 | # define blk_trace_remove(q) (-ENOTTY) | 213 | # define blk_trace_remove(q) (-ENOTTY) |
| 213 | # define blk_add_trace_msg(q, fmt, ...) do { } while (0) | 214 | # define blk_add_trace_msg(q, fmt, ...) do { } while (0) |
| 215 | # define blk_trace_remove_sysfs(dev) do { } while (0) | ||
| 214 | static inline int blk_trace_init_sysfs(struct device *dev) | 216 | static inline int blk_trace_init_sysfs(struct device *dev) |
| 215 | { | 217 | { |
| 216 | return 0; | 218 | return 0; |
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h index bc3ab7073695..b10ec49ee2dd 100644 --- a/include/linux/bootmem.h +++ b/include/linux/bootmem.h | |||
| @@ -53,6 +53,7 @@ extern void free_bootmem_node(pg_data_t *pgdat, | |||
| 53 | unsigned long addr, | 53 | unsigned long addr, |
| 54 | unsigned long size); | 54 | unsigned long size); |
| 55 | extern void free_bootmem(unsigned long addr, unsigned long size); | 55 | extern void free_bootmem(unsigned long addr, unsigned long size); |
| 56 | extern void free_bootmem_late(unsigned long addr, unsigned long size); | ||
| 56 | 57 | ||
| 57 | /* | 58 | /* |
| 58 | * Flags for reserve_bootmem (also if CONFIG_HAVE_ARCH_BOOTMEM_NODE, | 59 | * Flags for reserve_bootmem (also if CONFIG_HAVE_ARCH_BOOTMEM_NODE, |
| @@ -132,9 +133,6 @@ static inline void *alloc_remap(int nid, unsigned long size) | |||
| 132 | } | 133 | } |
| 133 | #endif /* CONFIG_HAVE_ARCH_ALLOC_REMAP */ | 134 | #endif /* CONFIG_HAVE_ARCH_ALLOC_REMAP */ |
| 134 | 135 | ||
| 135 | extern unsigned long __meminitdata nr_kernel_pages; | ||
| 136 | extern unsigned long __meminitdata nr_all_pages; | ||
| 137 | |||
| 138 | extern void *alloc_large_system_hash(const char *tablename, | 136 | extern void *alloc_large_system_hash(const char *tablename, |
| 139 | unsigned long bucketsize, | 137 | unsigned long bucketsize, |
| 140 | unsigned long numentries, | 138 | unsigned long numentries, |
| @@ -145,6 +143,8 @@ extern void *alloc_large_system_hash(const char *tablename, | |||
| 145 | unsigned long limit); | 143 | unsigned long limit); |
| 146 | 144 | ||
| 147 | #define HASH_EARLY 0x00000001 /* Allocating during early boot? */ | 145 | #define HASH_EARLY 0x00000001 /* Allocating during early boot? */ |
| 146 | #define HASH_SMALL 0x00000002 /* sub-page allocation allowed, min | ||
| 147 | * shift passed via *_hash_shift */ | ||
| 148 | 148 | ||
| 149 | /* Only NUMA needs hash distribution. 64bit NUMA architectures have | 149 | /* Only NUMA needs hash distribution. 64bit NUMA architectures have |
| 150 | * sufficient vmalloc space. | 150 | * sufficient vmalloc space. |
diff --git a/include/linux/can/dev.h b/include/linux/can/dev.h index 4a37a56f6cdd..5824b20b5fcb 100644 --- a/include/linux/can/dev.h +++ b/include/linux/can/dev.h | |||
| @@ -66,5 +66,6 @@ void can_bus_off(struct net_device *dev); | |||
| 66 | 66 | ||
| 67 | void can_put_echo_skb(struct sk_buff *skb, struct net_device *dev, int idx); | 67 | void can_put_echo_skb(struct sk_buff *skb, struct net_device *dev, int idx); |
| 68 | void can_get_echo_skb(struct net_device *dev, int idx); | 68 | void can_get_echo_skb(struct net_device *dev, int idx); |
| 69 | void can_free_echo_skb(struct net_device *dev, int idx); | ||
| 69 | 70 | ||
| 70 | #endif /* CAN_DEV_H */ | 71 | #endif /* CAN_DEV_H */ |
diff --git a/include/linux/capability.h b/include/linux/capability.h index c3021105edc0..39e5ff512fbe 100644 --- a/include/linux/capability.h +++ b/include/linux/capability.h | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | * | 7 | * |
| 8 | * See here for the libcap library ("POSIX draft" compliance): | 8 | * See here for the libcap library ("POSIX draft" compliance): |
| 9 | * | 9 | * |
| 10 | * ftp://linux.kernel.org/pub/linux/libs/security/linux-privs/kernel-2.6/ | 10 | * ftp://www.kernel.org/pub/linux/libs/security/linux-privs/kernel-2.6/ |
| 11 | */ | 11 | */ |
| 12 | 12 | ||
| 13 | #ifndef _LINUX_CAPABILITY_H | 13 | #ifndef _LINUX_CAPABILITY_H |
| @@ -92,9 +92,7 @@ struct vfs_cap_data { | |||
| 92 | #define _KERNEL_CAPABILITY_VERSION _LINUX_CAPABILITY_VERSION_3 | 92 | #define _KERNEL_CAPABILITY_VERSION _LINUX_CAPABILITY_VERSION_3 |
| 93 | #define _KERNEL_CAPABILITY_U32S _LINUX_CAPABILITY_U32S_3 | 93 | #define _KERNEL_CAPABILITY_U32S _LINUX_CAPABILITY_U32S_3 |
| 94 | 94 | ||
| 95 | #ifdef CONFIG_SECURITY_FILE_CAPABILITIES | ||
| 96 | extern int file_caps_enabled; | 95 | extern int file_caps_enabled; |
| 97 | #endif | ||
| 98 | 96 | ||
| 99 | typedef struct kernel_cap_struct { | 97 | typedef struct kernel_cap_struct { |
| 100 | __u32 cap[_KERNEL_CAPABILITY_U32S]; | 98 | __u32 cap[_KERNEL_CAPABILITY_U32S]; |
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 90bba9e62286..0008dee66514 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
| @@ -37,7 +37,7 @@ extern void cgroup_exit(struct task_struct *p, int run_callbacks); | |||
| 37 | extern int cgroupstats_build(struct cgroupstats *stats, | 37 | extern int cgroupstats_build(struct cgroupstats *stats, |
| 38 | struct dentry *dentry); | 38 | struct dentry *dentry); |
| 39 | 39 | ||
| 40 | extern struct file_operations proc_cgroup_operations; | 40 | extern const struct file_operations proc_cgroup_operations; |
| 41 | 41 | ||
| 42 | /* Define the enumeration of all cgroup subsystems */ | 42 | /* Define the enumeration of all cgroup subsystems */ |
| 43 | #define SUBSYS(_x) _x ## _subsys_id, | 43 | #define SUBSYS(_x) _x ## _subsys_id, |
| @@ -141,6 +141,38 @@ enum { | |||
| 141 | CGRP_WAIT_ON_RMDIR, | 141 | CGRP_WAIT_ON_RMDIR, |
| 142 | }; | 142 | }; |
| 143 | 143 | ||
| 144 | /* which pidlist file are we talking about? */ | ||
| 145 | enum cgroup_filetype { | ||
| 146 | CGROUP_FILE_PROCS, | ||
| 147 | CGROUP_FILE_TASKS, | ||
| 148 | }; | ||
| 149 | |||
| 150 | /* | ||
| 151 | * A pidlist is a list of pids that virtually represents the contents of one | ||
| 152 | * of the cgroup files ("procs" or "tasks"). We keep a list of such pidlists, | ||
| 153 | * a pair (one each for procs, tasks) for each pid namespace that's relevant | ||
| 154 | * to the cgroup. | ||
| 155 | */ | ||
| 156 | struct cgroup_pidlist { | ||
| 157 | /* | ||
| 158 | * used to find which pidlist is wanted. doesn't change as long as | ||
| 159 | * this particular list stays in the list. | ||
| 160 | */ | ||
| 161 | struct { enum cgroup_filetype type; struct pid_namespace *ns; } key; | ||
| 162 | /* array of xids */ | ||
| 163 | pid_t *list; | ||
| 164 | /* how many elements the above list has */ | ||
| 165 | int length; | ||
| 166 | /* how many files are using the current array */ | ||
| 167 | int use_count; | ||
| 168 | /* each of these stored in a list by its cgroup */ | ||
| 169 | struct list_head links; | ||
| 170 | /* pointer to the cgroup we belong to, for list removal purposes */ | ||
| 171 | struct cgroup *owner; | ||
| 172 | /* protects the other fields */ | ||
| 173 | struct rw_semaphore mutex; | ||
| 174 | }; | ||
| 175 | |||
| 144 | struct cgroup { | 176 | struct cgroup { |
| 145 | unsigned long flags; /* "unsigned long" so bitops work */ | 177 | unsigned long flags; /* "unsigned long" so bitops work */ |
| 146 | 178 | ||
| @@ -179,11 +211,12 @@ struct cgroup { | |||
| 179 | */ | 211 | */ |
| 180 | struct list_head release_list; | 212 | struct list_head release_list; |
| 181 | 213 | ||
| 182 | /* pids_mutex protects pids_list and cached pid arrays. */ | 214 | /* |
| 183 | struct rw_semaphore pids_mutex; | 215 | * list of pidlists, up to two for each namespace (one for procs, one |
| 184 | 216 | * for tasks); created on demand. | |
| 185 | /* Linked list of struct cgroup_pids */ | 217 | */ |
| 186 | struct list_head pids_list; | 218 | struct list_head pidlists; |
| 219 | struct mutex pidlist_mutex; | ||
| 187 | 220 | ||
| 188 | /* For RCU-protected deletion */ | 221 | /* For RCU-protected deletion */ |
| 189 | struct rcu_head rcu_head; | 222 | struct rcu_head rcu_head; |
| @@ -227,6 +260,9 @@ struct css_set { | |||
| 227 | * during subsystem registration (at boot time). | 260 | * during subsystem registration (at boot time). |
| 228 | */ | 261 | */ |
| 229 | struct cgroup_subsys_state *subsys[CGROUP_SUBSYS_COUNT]; | 262 | struct cgroup_subsys_state *subsys[CGROUP_SUBSYS_COUNT]; |
| 263 | |||
| 264 | /* For RCU-protected deletion */ | ||
| 265 | struct rcu_head rcu_head; | ||
| 230 | }; | 266 | }; |
| 231 | 267 | ||
| 232 | /* | 268 | /* |
| @@ -389,10 +425,11 @@ struct cgroup_subsys { | |||
| 389 | struct cgroup *cgrp); | 425 | struct cgroup *cgrp); |
| 390 | int (*pre_destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp); | 426 | int (*pre_destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp); |
| 391 | void (*destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp); | 427 | void (*destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp); |
| 392 | int (*can_attach)(struct cgroup_subsys *ss, | 428 | int (*can_attach)(struct cgroup_subsys *ss, struct cgroup *cgrp, |
| 393 | struct cgroup *cgrp, struct task_struct *tsk); | 429 | struct task_struct *tsk, bool threadgroup); |
| 394 | void (*attach)(struct cgroup_subsys *ss, struct cgroup *cgrp, | 430 | void (*attach)(struct cgroup_subsys *ss, struct cgroup *cgrp, |
| 395 | struct cgroup *old_cgrp, struct task_struct *tsk); | 431 | struct cgroup *old_cgrp, struct task_struct *tsk, |
| 432 | bool threadgroup); | ||
| 396 | void (*fork)(struct cgroup_subsys *ss, struct task_struct *task); | 433 | void (*fork)(struct cgroup_subsys *ss, struct task_struct *task); |
| 397 | void (*exit)(struct cgroup_subsys *ss, struct task_struct *task); | 434 | void (*exit)(struct cgroup_subsys *ss, struct task_struct *task); |
| 398 | int (*populate)(struct cgroup_subsys *ss, | 435 | int (*populate)(struct cgroup_subsys *ss, |
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h index 1219be4fb42e..83d2fbd81b93 100644 --- a/include/linux/clocksource.h +++ b/include/linux/clocksource.h | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | #include <linux/list.h> | 14 | #include <linux/list.h> |
| 15 | #include <linux/cache.h> | 15 | #include <linux/cache.h> |
| 16 | #include <linux/timer.h> | 16 | #include <linux/timer.h> |
| 17 | #include <linux/init.h> | ||
| 17 | #include <asm/div64.h> | 18 | #include <asm/div64.h> |
| 18 | #include <asm/io.h> | 19 | #include <asm/io.h> |
| 19 | 20 | ||
| @@ -148,14 +149,11 @@ extern u64 timecounter_cyc2time(struct timecounter *tc, | |||
| 148 | * @disable: optional function to disable the clocksource | 149 | * @disable: optional function to disable the clocksource |
| 149 | * @mask: bitmask for two's complement | 150 | * @mask: bitmask for two's complement |
| 150 | * subtraction of non 64 bit counters | 151 | * subtraction of non 64 bit counters |
| 151 | * @mult: cycle to nanosecond multiplier (adjusted by NTP) | 152 | * @mult: cycle to nanosecond multiplier |
| 152 | * @mult_orig: cycle to nanosecond multiplier (unadjusted by NTP) | ||
| 153 | * @shift: cycle to nanosecond divisor (power of two) | 153 | * @shift: cycle to nanosecond divisor (power of two) |
| 154 | * @flags: flags describing special properties | 154 | * @flags: flags describing special properties |
| 155 | * @vread: vsyscall based read | 155 | * @vread: vsyscall based read |
| 156 | * @resume: resume function for the clocksource, if necessary | 156 | * @resume: resume function for the clocksource, if necessary |
| 157 | * @cycle_interval: Used internally by timekeeping core, please ignore. | ||
| 158 | * @xtime_interval: Used internally by timekeeping core, please ignore. | ||
| 159 | */ | 157 | */ |
| 160 | struct clocksource { | 158 | struct clocksource { |
| 161 | /* | 159 | /* |
| @@ -169,7 +167,6 @@ struct clocksource { | |||
| 169 | void (*disable)(struct clocksource *cs); | 167 | void (*disable)(struct clocksource *cs); |
| 170 | cycle_t mask; | 168 | cycle_t mask; |
| 171 | u32 mult; | 169 | u32 mult; |
| 172 | u32 mult_orig; | ||
| 173 | u32 shift; | 170 | u32 shift; |
| 174 | unsigned long flags; | 171 | unsigned long flags; |
| 175 | cycle_t (*vread)(void); | 172 | cycle_t (*vread)(void); |
| @@ -181,19 +178,12 @@ struct clocksource { | |||
| 181 | #define CLKSRC_FSYS_MMIO_SET(mmio, addr) do { } while (0) | 178 | #define CLKSRC_FSYS_MMIO_SET(mmio, addr) do { } while (0) |
| 182 | #endif | 179 | #endif |
| 183 | 180 | ||
| 184 | /* timekeeping specific data, ignore */ | ||
| 185 | cycle_t cycle_interval; | ||
| 186 | u64 xtime_interval; | ||
| 187 | u32 raw_interval; | ||
| 188 | /* | 181 | /* |
| 189 | * Second part is written at each timer interrupt | 182 | * Second part is written at each timer interrupt |
| 190 | * Keep it in a different cache line to dirty no | 183 | * Keep it in a different cache line to dirty no |
| 191 | * more than one cache line. | 184 | * more than one cache line. |
| 192 | */ | 185 | */ |
| 193 | cycle_t cycle_last ____cacheline_aligned_in_smp; | 186 | cycle_t cycle_last ____cacheline_aligned_in_smp; |
| 194 | u64 xtime_nsec; | ||
| 195 | s64 error; | ||
| 196 | struct timespec raw_time; | ||
| 197 | 187 | ||
| 198 | #ifdef CONFIG_CLOCKSOURCE_WATCHDOG | 188 | #ifdef CONFIG_CLOCKSOURCE_WATCHDOG |
| 199 | /* Watchdog related data, used by the framework */ | 189 | /* Watchdog related data, used by the framework */ |
| @@ -202,8 +192,6 @@ struct clocksource { | |||
| 202 | #endif | 192 | #endif |
| 203 | }; | 193 | }; |
| 204 | 194 | ||
| 205 | extern struct clocksource *clock; /* current clocksource */ | ||
| 206 | |||
| 207 | /* | 195 | /* |
| 208 | * Clock source flags bits:: | 196 | * Clock source flags bits:: |
| 209 | */ | 197 | */ |
| @@ -212,6 +200,7 @@ extern struct clocksource *clock; /* current clocksource */ | |||
| 212 | 200 | ||
| 213 | #define CLOCK_SOURCE_WATCHDOG 0x10 | 201 | #define CLOCK_SOURCE_WATCHDOG 0x10 |
| 214 | #define CLOCK_SOURCE_VALID_FOR_HRES 0x20 | 202 | #define CLOCK_SOURCE_VALID_FOR_HRES 0x20 |
| 203 | #define CLOCK_SOURCE_UNSTABLE 0x40 | ||
| 215 | 204 | ||
| 216 | /* simplify initialization of mask field */ | 205 | /* simplify initialization of mask field */ |
| 217 | #define CLOCKSOURCE_MASK(bits) (cycle_t)((bits) < 64 ? ((1ULL<<(bits))-1) : -1) | 206 | #define CLOCKSOURCE_MASK(bits) (cycle_t)((bits) < 64 ? ((1ULL<<(bits))-1) : -1) |
| @@ -268,108 +257,15 @@ static inline u32 clocksource_hz2mult(u32 hz, u32 shift_constant) | |||
| 268 | } | 257 | } |
| 269 | 258 | ||
| 270 | /** | 259 | /** |
| 271 | * clocksource_read: - Access the clocksource's current cycle value | 260 | * clocksource_cyc2ns - converts clocksource cycles to nanoseconds |
| 272 | * @cs: pointer to clocksource being read | ||
| 273 | * | ||
| 274 | * Uses the clocksource to return the current cycle_t value | ||
| 275 | */ | ||
| 276 | static inline cycle_t clocksource_read(struct clocksource *cs) | ||
| 277 | { | ||
| 278 | return cs->read(cs); | ||
| 279 | } | ||
| 280 | |||
| 281 | /** | ||
| 282 | * clocksource_enable: - enable clocksource | ||
| 283 | * @cs: pointer to clocksource | ||
| 284 | * | ||
| 285 | * Enables the specified clocksource. The clocksource callback | ||
| 286 | * function should start up the hardware and setup mult and field | ||
| 287 | * members of struct clocksource to reflect hardware capabilities. | ||
| 288 | */ | ||
| 289 | static inline int clocksource_enable(struct clocksource *cs) | ||
| 290 | { | ||
| 291 | int ret = 0; | ||
| 292 | |||
| 293 | if (cs->enable) | ||
| 294 | ret = cs->enable(cs); | ||
| 295 | |||
| 296 | /* | ||
| 297 | * The frequency may have changed while the clocksource | ||
| 298 | * was disabled. If so the code in ->enable() must update | ||
| 299 | * the mult value to reflect the new frequency. Make sure | ||
| 300 | * mult_orig follows this change. | ||
| 301 | */ | ||
| 302 | cs->mult_orig = cs->mult; | ||
| 303 | |||
| 304 | return ret; | ||
| 305 | } | ||
| 306 | |||
| 307 | /** | ||
| 308 | * clocksource_disable: - disable clocksource | ||
| 309 | * @cs: pointer to clocksource | ||
| 310 | * | ||
| 311 | * Disables the specified clocksource. The clocksource callback | ||
| 312 | * function should power down the now unused hardware block to | ||
| 313 | * save power. | ||
| 314 | */ | ||
| 315 | static inline void clocksource_disable(struct clocksource *cs) | ||
| 316 | { | ||
| 317 | /* | ||
| 318 | * Save mult_orig in mult so clocksource_enable() can | ||
| 319 | * restore the value regardless if ->enable() updates | ||
| 320 | * the value of mult or not. | ||
| 321 | */ | ||
| 322 | cs->mult = cs->mult_orig; | ||
| 323 | |||
| 324 | if (cs->disable) | ||
| 325 | cs->disable(cs); | ||
| 326 | } | ||
| 327 | |||
| 328 | /** | ||
| 329 | * cyc2ns - converts clocksource cycles to nanoseconds | ||
| 330 | * @cs: Pointer to clocksource | ||
| 331 | * @cycles: Cycles | ||
| 332 | * | 261 | * |
| 333 | * Uses the clocksource and ntp ajdustment to convert cycle_ts to nanoseconds. | 262 | * Converts cycles to nanoseconds, using the given mult and shift. |
| 334 | * | 263 | * |
| 335 | * XXX - This could use some mult_lxl_ll() asm optimization | 264 | * XXX - This could use some mult_lxl_ll() asm optimization |
| 336 | */ | 265 | */ |
| 337 | static inline s64 cyc2ns(struct clocksource *cs, cycle_t cycles) | 266 | static inline s64 clocksource_cyc2ns(cycle_t cycles, u32 mult, u32 shift) |
| 338 | { | ||
| 339 | u64 ret = (u64)cycles; | ||
| 340 | ret = (ret * cs->mult) >> cs->shift; | ||
| 341 | return ret; | ||
| 342 | } | ||
| 343 | |||
| 344 | /** | ||
| 345 | * clocksource_calculate_interval - Calculates a clocksource interval struct | ||
| 346 | * | ||
| 347 | * @c: Pointer to clocksource. | ||
| 348 | * @length_nsec: Desired interval length in nanoseconds. | ||
| 349 | * | ||
| 350 | * Calculates a fixed cycle/nsec interval for a given clocksource/adjustment | ||
| 351 | * pair and interval request. | ||
| 352 | * | ||
| 353 | * Unless you're the timekeeping code, you should not be using this! | ||
| 354 | */ | ||
| 355 | static inline void clocksource_calculate_interval(struct clocksource *c, | ||
| 356 | unsigned long length_nsec) | ||
| 357 | { | 267 | { |
| 358 | u64 tmp; | 268 | return ((u64) cycles * mult) >> shift; |
| 359 | |||
| 360 | /* Do the ns -> cycle conversion first, using original mult */ | ||
| 361 | tmp = length_nsec; | ||
| 362 | tmp <<= c->shift; | ||
| 363 | tmp += c->mult_orig/2; | ||
| 364 | do_div(tmp, c->mult_orig); | ||
| 365 | |||
| 366 | c->cycle_interval = (cycle_t)tmp; | ||
| 367 | if (c->cycle_interval == 0) | ||
| 368 | c->cycle_interval = 1; | ||
| 369 | |||
| 370 | /* Go back from cycles -> shifted ns, this time use ntp adjused mult */ | ||
| 371 | c->xtime_interval = (u64)c->cycle_interval * c->mult; | ||
| 372 | c->raw_interval = ((u64)c->cycle_interval * c->mult_orig) >> c->shift; | ||
| 373 | } | 269 | } |
| 374 | 270 | ||
| 375 | 271 | ||
| @@ -380,6 +276,8 @@ extern void clocksource_touch_watchdog(void); | |||
| 380 | extern struct clocksource* clocksource_get_next(void); | 276 | extern struct clocksource* clocksource_get_next(void); |
| 381 | extern void clocksource_change_rating(struct clocksource *cs, int rating); | 277 | extern void clocksource_change_rating(struct clocksource *cs, int rating); |
| 382 | extern void clocksource_resume(void); | 278 | extern void clocksource_resume(void); |
| 279 | extern struct clocksource * __init __weak clocksource_default_clock(void); | ||
| 280 | extern void clocksource_mark_unstable(struct clocksource *cs); | ||
| 383 | 281 | ||
| 384 | #ifdef CONFIG_GENERIC_TIME_VSYSCALL | 282 | #ifdef CONFIG_GENERIC_TIME_VSYSCALL |
| 385 | extern void update_vsyscall(struct timespec *ts, struct clocksource *c); | 283 | extern void update_vsyscall(struct timespec *ts, struct clocksource *c); |
| @@ -394,4 +292,6 @@ static inline void update_vsyscall_tz(void) | |||
| 394 | } | 292 | } |
| 395 | #endif | 293 | #endif |
| 396 | 294 | ||
| 295 | extern void timekeeping_notify(struct clocksource *clock); | ||
| 296 | |||
| 397 | #endif /* _LINUX_CLOCKSOURCE_H */ | 297 | #endif /* _LINUX_CLOCKSOURCE_H */ |
diff --git a/include/linux/cn_proc.h b/include/linux/cn_proc.h index b8125b2eb665..47dac5ea8d3a 100644 --- a/include/linux/cn_proc.h +++ b/include/linux/cn_proc.h | |||
| @@ -52,6 +52,7 @@ struct proc_event { | |||
| 52 | PROC_EVENT_EXEC = 0x00000002, | 52 | PROC_EVENT_EXEC = 0x00000002, |
| 53 | PROC_EVENT_UID = 0x00000004, | 53 | PROC_EVENT_UID = 0x00000004, |
| 54 | PROC_EVENT_GID = 0x00000040, | 54 | PROC_EVENT_GID = 0x00000040, |
| 55 | PROC_EVENT_SID = 0x00000080, | ||
| 55 | /* "next" should be 0x00000400 */ | 56 | /* "next" should be 0x00000400 */ |
| 56 | /* "last" is the last process event: exit */ | 57 | /* "last" is the last process event: exit */ |
| 57 | PROC_EVENT_EXIT = 0x80000000 | 58 | PROC_EVENT_EXIT = 0x80000000 |
| @@ -89,6 +90,11 @@ struct proc_event { | |||
| 89 | } e; | 90 | } e; |
| 90 | } id; | 91 | } id; |
| 91 | 92 | ||
| 93 | struct sid_proc_event { | ||
| 94 | __kernel_pid_t process_pid; | ||
| 95 | __kernel_pid_t process_tgid; | ||
| 96 | } sid; | ||
| 97 | |||
| 92 | struct exit_proc_event { | 98 | struct exit_proc_event { |
| 93 | __kernel_pid_t process_pid; | 99 | __kernel_pid_t process_pid; |
| 94 | __kernel_pid_t process_tgid; | 100 | __kernel_pid_t process_tgid; |
| @@ -102,6 +108,7 @@ struct proc_event { | |||
| 102 | void proc_fork_connector(struct task_struct *task); | 108 | void proc_fork_connector(struct task_struct *task); |
| 103 | void proc_exec_connector(struct task_struct *task); | 109 | void proc_exec_connector(struct task_struct *task); |
| 104 | void proc_id_connector(struct task_struct *task, int which_id); | 110 | void proc_id_connector(struct task_struct *task, int which_id); |
| 111 | void proc_sid_connector(struct task_struct *task); | ||
| 105 | void proc_exit_connector(struct task_struct *task); | 112 | void proc_exit_connector(struct task_struct *task); |
| 106 | #else | 113 | #else |
| 107 | static inline void proc_fork_connector(struct task_struct *task) | 114 | static inline void proc_fork_connector(struct task_struct *task) |
| @@ -114,6 +121,9 @@ static inline void proc_id_connector(struct task_struct *task, | |||
| 114 | int which_id) | 121 | int which_id) |
| 115 | {} | 122 | {} |
| 116 | 123 | ||
| 124 | static inline void proc_sid_connector(struct task_struct *task) | ||
| 125 | {} | ||
| 126 | |||
| 117 | static inline void proc_exit_connector(struct task_struct *task) | 127 | static inline void proc_exit_connector(struct task_struct *task) |
| 118 | {} | 128 | {} |
| 119 | #endif /* CONFIG_PROC_EVENTS */ | 129 | #endif /* CONFIG_PROC_EVENTS */ |
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index a3ed7cb8ca34..73dcf804bc94 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h | |||
| @@ -79,6 +79,7 @@ | |||
| 79 | #define noinline __attribute__((noinline)) | 79 | #define noinline __attribute__((noinline)) |
| 80 | #define __attribute_const__ __attribute__((__const__)) | 80 | #define __attribute_const__ __attribute__((__const__)) |
| 81 | #define __maybe_unused __attribute__((unused)) | 81 | #define __maybe_unused __attribute__((unused)) |
| 82 | #define __always_unused __attribute__((unused)) | ||
| 82 | 83 | ||
| 83 | #define __gcc_header(x) #x | 84 | #define __gcc_header(x) #x |
| 84 | #define _gcc_header(x) __gcc_header(linux/compiler-gcc##x.h) | 85 | #define _gcc_header(x) __gcc_header(linux/compiler-gcc##x.h) |
diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h index 450fa597c94d..94dea3ffbfa1 100644 --- a/include/linux/compiler-gcc4.h +++ b/include/linux/compiler-gcc4.h | |||
| @@ -36,4 +36,26 @@ | |||
| 36 | the kernel context */ | 36 | the kernel context */ |
| 37 | #define __cold __attribute__((__cold__)) | 37 | #define __cold __attribute__((__cold__)) |
| 38 | 38 | ||
| 39 | |||
| 40 | #if __GNUC_MINOR__ >= 5 | ||
| 41 | /* | ||
| 42 | * Mark a position in code as unreachable. This can be used to | ||
| 43 | * suppress control flow warnings after asm blocks that transfer | ||
| 44 | * control elsewhere. | ||
| 45 | * | ||
| 46 | * Early snapshots of gcc 4.5 don't support this and we can't detect | ||
| 47 | * this in the preprocessor, but we can live with this because they're | ||
| 48 | * unreleased. Really, we need to have autoconf for the kernel. | ||
| 49 | */ | ||
| 50 | #define unreachable() __builtin_unreachable() | ||
| 51 | #endif | ||
| 52 | |||
| 53 | #endif | ||
| 54 | |||
| 55 | #if __GNUC_MINOR__ > 0 | ||
| 56 | #define __compiletime_object_size(obj) __builtin_object_size(obj, 0) | ||
| 57 | #endif | ||
| 58 | #if __GNUC_MINOR__ >= 4 | ||
| 59 | #define __compiletime_warning(message) __attribute__((warning(message))) | ||
| 60 | #define __compiletime_error(message) __attribute__((error(message))) | ||
| 39 | #endif | 61 | #endif |
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 04fb5135b4e1..5be3dab4a695 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h | |||
| @@ -144,6 +144,11 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); | |||
| 144 | # define barrier() __memory_barrier() | 144 | # define barrier() __memory_barrier() |
| 145 | #endif | 145 | #endif |
| 146 | 146 | ||
| 147 | /* Unreachable code */ | ||
| 148 | #ifndef unreachable | ||
| 149 | # define unreachable() do { } while (1) | ||
| 150 | #endif | ||
| 151 | |||
| 147 | #ifndef RELOC_HIDE | 152 | #ifndef RELOC_HIDE |
| 148 | # define RELOC_HIDE(ptr, off) \ | 153 | # define RELOC_HIDE(ptr, off) \ |
| 149 | ({ unsigned long __ptr; \ | 154 | ({ unsigned long __ptr; \ |
| @@ -213,6 +218,10 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); | |||
| 213 | # define __maybe_unused /* unimplemented */ | 218 | # define __maybe_unused /* unimplemented */ |
| 214 | #endif | 219 | #endif |
| 215 | 220 | ||
| 221 | #ifndef __always_unused | ||
| 222 | # define __always_unused /* unimplemented */ | ||
| 223 | #endif | ||
| 224 | |||
| 216 | #ifndef noinline | 225 | #ifndef noinline |
| 217 | #define noinline | 226 | #define noinline |
| 218 | #endif | 227 | #endif |
| @@ -266,6 +275,17 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); | |||
| 266 | # define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b)) | 275 | # define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b)) |
| 267 | #endif | 276 | #endif |
| 268 | 277 | ||
| 278 | /* Compile time object size, -1 for unknown */ | ||
| 279 | #ifndef __compiletime_object_size | ||
| 280 | # define __compiletime_object_size(obj) -1 | ||
| 281 | #endif | ||
| 282 | #ifndef __compiletime_warning | ||
| 283 | # define __compiletime_warning(message) | ||
| 284 | #endif | ||
| 285 | #ifndef __compiletime_error | ||
| 286 | # define __compiletime_error(message) | ||
| 287 | #endif | ||
| 288 | |||
| 269 | /* | 289 | /* |
| 270 | * Prevent the compiler from merging or refetching accesses. The compiler | 290 | * Prevent the compiler from merging or refetching accesses. The compiler |
| 271 | * is also forbidden from reordering successive instances of ACCESS_ONCE(), | 291 | * is also forbidden from reordering successive instances of ACCESS_ONCE(), |
diff --git a/include/linux/configfs.h b/include/linux/configfs.h index 7f627775c947..ddb7a97c78c2 100644 --- a/include/linux/configfs.h +++ b/include/linux/configfs.h | |||
| @@ -27,8 +27,8 @@ | |||
| 27 | * | 27 | * |
| 28 | * configfs Copyright (C) 2005 Oracle. All rights reserved. | 28 | * configfs Copyright (C) 2005 Oracle. All rights reserved. |
| 29 | * | 29 | * |
| 30 | * Please read Documentation/filesystems/configfs.txt before using the | 30 | * Please read Documentation/filesystems/configfs/configfs.txt before using |
| 31 | * configfs interface, ESPECIALLY the parts about reference counts and | 31 | * the configfs interface, ESPECIALLY the parts about reference counts and |
| 32 | * item destructors. | 32 | * item destructors. |
| 33 | */ | 33 | */ |
| 34 | 34 | ||
diff --git a/include/linux/connector.h b/include/linux/connector.h index b68d27850d51..3a14615fd35c 100644 --- a/include/linux/connector.h +++ b/include/linux/connector.h | |||
| @@ -132,11 +132,8 @@ struct cn_callback_id { | |||
| 132 | }; | 132 | }; |
| 133 | 133 | ||
| 134 | struct cn_callback_data { | 134 | struct cn_callback_data { |
| 135 | void (*destruct_data) (void *); | 135 | struct sk_buff *skb; |
| 136 | void *ddata; | 136 | void (*callback) (struct cn_msg *, struct netlink_skb_parms *); |
| 137 | |||
| 138 | void *callback_priv; | ||
| 139 | void (*callback) (void *); | ||
| 140 | 137 | ||
| 141 | void *free; | 138 | void *free; |
| 142 | }; | 139 | }; |
| @@ -167,11 +164,11 @@ struct cn_dev { | |||
| 167 | struct cn_queue_dev *cbdev; | 164 | struct cn_queue_dev *cbdev; |
| 168 | }; | 165 | }; |
| 169 | 166 | ||
| 170 | int cn_add_callback(struct cb_id *, char *, void (*callback) (void *)); | 167 | int cn_add_callback(struct cb_id *, char *, void (*callback) (struct cn_msg *, struct netlink_skb_parms *)); |
| 171 | void cn_del_callback(struct cb_id *); | 168 | void cn_del_callback(struct cb_id *); |
| 172 | int cn_netlink_send(struct cn_msg *, u32, gfp_t); | 169 | int cn_netlink_send(struct cn_msg *, u32, gfp_t); |
| 173 | 170 | ||
| 174 | int cn_queue_add_callback(struct cn_queue_dev *dev, char *name, struct cb_id *id, void (*callback)(void *)); | 171 | int cn_queue_add_callback(struct cn_queue_dev *dev, char *name, struct cb_id *id, void (*callback)(struct cn_msg *, struct netlink_skb_parms *)); |
| 175 | void cn_queue_del_callback(struct cn_queue_dev *dev, struct cb_id *id); | 172 | void cn_queue_del_callback(struct cn_queue_dev *dev, struct cb_id *id); |
| 176 | 173 | ||
| 177 | int queue_cn_work(struct cn_callback_entry *cbq, struct work_struct *work); | 174 | int queue_cn_work(struct cn_callback_entry *cbq, struct work_struct *work); |
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 161042746afc..79a2340d83cd 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
| @@ -65,6 +65,9 @@ static inline int cpufreq_unregister_notifier(struct notifier_block *nb, | |||
| 65 | 65 | ||
| 66 | struct cpufreq_governor; | 66 | struct cpufreq_governor; |
| 67 | 67 | ||
| 68 | /* /sys/devices/system/cpu/cpufreq: entry point for global variables */ | ||
| 69 | extern struct kobject *cpufreq_global_kobject; | ||
| 70 | |||
| 68 | #define CPUFREQ_ETERNAL (-1) | 71 | #define CPUFREQ_ETERNAL (-1) |
| 69 | struct cpufreq_cpuinfo { | 72 | struct cpufreq_cpuinfo { |
| 70 | unsigned int max_freq; | 73 | unsigned int max_freq; |
| @@ -274,6 +277,13 @@ struct freq_attr { | |||
| 274 | ssize_t (*store)(struct cpufreq_policy *, const char *, size_t count); | 277 | ssize_t (*store)(struct cpufreq_policy *, const char *, size_t count); |
| 275 | }; | 278 | }; |
| 276 | 279 | ||
| 280 | struct global_attr { | ||
| 281 | struct attribute attr; | ||
| 282 | ssize_t (*show)(struct kobject *kobj, | ||
| 283 | struct attribute *attr, char *buf); | ||
| 284 | ssize_t (*store)(struct kobject *a, struct attribute *b, | ||
| 285 | const char *c, size_t count); | ||
| 286 | }; | ||
| 277 | 287 | ||
| 278 | /********************************************************************* | 288 | /********************************************************************* |
| 279 | * CPUFREQ 2.6. INTERFACE * | 289 | * CPUFREQ 2.6. INTERFACE * |
| @@ -281,8 +291,15 @@ struct freq_attr { | |||
| 281 | int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu); | 291 | int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu); |
| 282 | int cpufreq_update_policy(unsigned int cpu); | 292 | int cpufreq_update_policy(unsigned int cpu); |
| 283 | 293 | ||
| 294 | #ifdef CONFIG_CPU_FREQ | ||
| 284 | /* query the current CPU frequency (in kHz). If zero, cpufreq couldn't detect it */ | 295 | /* query the current CPU frequency (in kHz). If zero, cpufreq couldn't detect it */ |
| 285 | unsigned int cpufreq_get(unsigned int cpu); | 296 | unsigned int cpufreq_get(unsigned int cpu); |
| 297 | #else | ||
| 298 | static inline unsigned int cpufreq_get(unsigned int cpu) | ||
| 299 | { | ||
| 300 | return 0; | ||
| 301 | } | ||
| 302 | #endif | ||
| 286 | 303 | ||
| 287 | /* query the last known CPU freq (in kHz). If zero, cpufreq couldn't detect it */ | 304 | /* query the last known CPU freq (in kHz). If zero, cpufreq couldn't detect it */ |
| 288 | #ifdef CONFIG_CPU_FREQ | 305 | #ifdef CONFIG_CPU_FREQ |
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index 796df12091b7..789cf5f920ce 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h | |||
| @@ -3,444 +3,37 @@ | |||
| 3 | 3 | ||
| 4 | /* | 4 | /* |
| 5 | * Cpumasks provide a bitmap suitable for representing the | 5 | * Cpumasks provide a bitmap suitable for representing the |
| 6 | * set of CPU's in a system, one bit position per CPU number. | 6 | * set of CPU's in a system, one bit position per CPU number. In general, |
| 7 | * | 7 | * only nr_cpu_ids (<= NR_CPUS) bits are valid. |
| 8 | * The new cpumask_ ops take a "struct cpumask *"; the old ones | ||
| 9 | * use cpumask_t. | ||
| 10 | * | ||
| 11 | * See detailed comments in the file linux/bitmap.h describing the | ||
| 12 | * data type on which these cpumasks are based. | ||
| 13 | * | ||
| 14 | * For details of cpumask_scnprintf() and cpumask_parse_user(), | ||
| 15 | * see bitmap_scnprintf() and bitmap_parse_user() in lib/bitmap.c. | ||
| 16 | * For details of cpulist_scnprintf() and cpulist_parse(), see | ||
| 17 | * bitmap_scnlistprintf() and bitmap_parselist(), also in bitmap.c. | ||
| 18 | * For details of cpu_remap(), see bitmap_bitremap in lib/bitmap.c | ||
| 19 | * For details of cpus_remap(), see bitmap_remap in lib/bitmap.c. | ||
| 20 | * For details of cpus_onto(), see bitmap_onto in lib/bitmap.c. | ||
| 21 | * For details of cpus_fold(), see bitmap_fold in lib/bitmap.c. | ||
| 22 | * | ||
| 23 | * . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . | ||
| 24 | * Note: The alternate operations with the suffix "_nr" are used | ||
| 25 | * to limit the range of the loop to nr_cpu_ids instead of | ||
| 26 | * NR_CPUS when NR_CPUS > 64 for performance reasons. | ||
| 27 | * If NR_CPUS is <= 64 then most assembler bitmask | ||
| 28 | * operators execute faster with a constant range, so | ||
| 29 | * the operator will continue to use NR_CPUS. | ||
| 30 | * | ||
| 31 | * Another consideration is that nr_cpu_ids is initialized | ||
| 32 | * to NR_CPUS and isn't lowered until the possible cpus are | ||
| 33 | * discovered (including any disabled cpus). So early uses | ||
| 34 | * will span the entire range of NR_CPUS. | ||
| 35 | * . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . | ||
| 36 | * | ||
| 37 | * The obsolescent cpumask operations are: | ||
| 38 | * | ||
| 39 | * void cpu_set(cpu, mask) turn on bit 'cpu' in mask | ||
| 40 | * void cpu_clear(cpu, mask) turn off bit 'cpu' in mask | ||
| 41 | * void cpus_setall(mask) set all bits | ||
| 42 | * void cpus_clear(mask) clear all bits | ||
| 43 | * int cpu_isset(cpu, mask) true iff bit 'cpu' set in mask | ||
| 44 | * int cpu_test_and_set(cpu, mask) test and set bit 'cpu' in mask | ||
| 45 | * | ||
| 46 | * int cpus_and(dst, src1, src2) dst = src1 & src2 [intersection] | ||
| 47 | * void cpus_or(dst, src1, src2) dst = src1 | src2 [union] | ||
| 48 | * void cpus_xor(dst, src1, src2) dst = src1 ^ src2 | ||
| 49 | * int cpus_andnot(dst, src1, src2) dst = src1 & ~src2 | ||
| 50 | * void cpus_complement(dst, src) dst = ~src | ||
| 51 | * | ||
| 52 | * int cpus_equal(mask1, mask2) Does mask1 == mask2? | ||
| 53 | * int cpus_intersects(mask1, mask2) Do mask1 and mask2 intersect? | ||
| 54 | * int cpus_subset(mask1, mask2) Is mask1 a subset of mask2? | ||
| 55 | * int cpus_empty(mask) Is mask empty (no bits sets)? | ||
| 56 | * int cpus_full(mask) Is mask full (all bits sets)? | ||
| 57 | * int cpus_weight(mask) Hamming weigh - number of set bits | ||
| 58 | * int cpus_weight_nr(mask) Same using nr_cpu_ids instead of NR_CPUS | ||
| 59 | * | ||
| 60 | * void cpus_shift_right(dst, src, n) Shift right | ||
| 61 | * void cpus_shift_left(dst, src, n) Shift left | ||
| 62 | * | ||
| 63 | * int first_cpu(mask) Number lowest set bit, or NR_CPUS | ||
| 64 | * int next_cpu(cpu, mask) Next cpu past 'cpu', or NR_CPUS | ||
| 65 | * int next_cpu_nr(cpu, mask) Next cpu past 'cpu', or nr_cpu_ids | ||
| 66 | * | ||
| 67 | * cpumask_t cpumask_of_cpu(cpu) Return cpumask with bit 'cpu' set | ||
| 68 | * (can be used as an lvalue) | ||
| 69 | * CPU_MASK_ALL Initializer - all bits set | ||
| 70 | * CPU_MASK_NONE Initializer - no bits set | ||
| 71 | * unsigned long *cpus_addr(mask) Array of unsigned long's in mask | ||
| 72 | * | ||
| 73 | * CPUMASK_ALLOC kmalloc's a structure that is a composite of many cpumask_t | ||
| 74 | * variables, and CPUMASK_PTR provides pointers to each field. | ||
| 75 | * | ||
| 76 | * The structure should be defined something like this: | ||
| 77 | * struct my_cpumasks { | ||
| 78 | * cpumask_t mask1; | ||
| 79 | * cpumask_t mask2; | ||
| 80 | * }; | ||
| 81 | * | ||
| 82 | * Usage is then: | ||
| 83 | * CPUMASK_ALLOC(my_cpumasks); | ||
| 84 | * CPUMASK_PTR(mask1, my_cpumasks); | ||
| 85 | * CPUMASK_PTR(mask2, my_cpumasks); | ||
| 86 | * | ||
| 87 | * --- DO NOT reference cpumask_t pointers until this check --- | ||
| 88 | * if (my_cpumasks == NULL) | ||
| 89 | * "kmalloc failed"... | ||
| 90 | * | ||
| 91 | * References are now pointers to the cpumask_t variables (*mask1, ...) | ||
| 92 | * | ||
| 93 | *if NR_CPUS > BITS_PER_LONG | ||
| 94 | * CPUMASK_ALLOC(m) Declares and allocates struct m *m = | ||
| 95 | * kmalloc(sizeof(*m), GFP_KERNEL) | ||
| 96 | * CPUMASK_FREE(m) Macro for kfree(m) | ||
| 97 | *else | ||
| 98 | * CPUMASK_ALLOC(m) Declares struct m _m, *m = &_m | ||
| 99 | * CPUMASK_FREE(m) Nop | ||
| 100 | *endif | ||
| 101 | * CPUMASK_PTR(v, m) Declares cpumask_t *v = &(m->v) | ||
| 102 | * ------------------------------------------------------------------------ | ||
| 103 | * | ||
| 104 | * int cpumask_scnprintf(buf, len, mask) Format cpumask for printing | ||
| 105 | * int cpumask_parse_user(ubuf, ulen, mask) Parse ascii string as cpumask | ||
| 106 | * int cpulist_scnprintf(buf, len, mask) Format cpumask as list for printing | ||
| 107 | * int cpulist_parse(buf, map) Parse ascii string as cpulist | ||
| 108 | * int cpu_remap(oldbit, old, new) newbit = map(old, new)(oldbit) | ||
| 109 | * void cpus_remap(dst, src, old, new) *dst = map(old, new)(src) | ||
| 110 | * void cpus_onto(dst, orig, relmap) *dst = orig relative to relmap | ||
| 111 | * void cpus_fold(dst, orig, sz) dst bits = orig bits mod sz | ||
| 112 | * | ||
| 113 | * for_each_cpu_mask(cpu, mask) for-loop cpu over mask using NR_CPUS | ||
| 114 | * for_each_cpu_mask_nr(cpu, mask) for-loop cpu over mask using nr_cpu_ids | ||
| 115 | * | ||
| 116 | * int num_online_cpus() Number of online CPUs | ||
| 117 | * int num_possible_cpus() Number of all possible CPUs | ||
| 118 | * int num_present_cpus() Number of present CPUs | ||
| 119 | * | ||
| 120 | * int cpu_online(cpu) Is some cpu online? | ||
| 121 | * int cpu_possible(cpu) Is some cpu possible? | ||
| 122 | * int cpu_present(cpu) Is some cpu present (can schedule)? | ||
| 123 | * | ||
| 124 | * int any_online_cpu(mask) First online cpu in mask | ||
| 125 | * | ||
| 126 | * for_each_possible_cpu(cpu) for-loop cpu over cpu_possible_map | ||
| 127 | * for_each_online_cpu(cpu) for-loop cpu over cpu_online_map | ||
| 128 | * for_each_present_cpu(cpu) for-loop cpu over cpu_present_map | ||
| 129 | * | ||
| 130 | * Subtlety: | ||
| 131 | * 1) The 'type-checked' form of cpu_isset() causes gcc (3.3.2, anyway) | ||
| 132 | * to generate slightly worse code. Note for example the additional | ||
| 133 | * 40 lines of assembly code compiling the "for each possible cpu" | ||
| 134 | * loops buried in the disk_stat_read() macros calls when compiling | ||
| 135 | * drivers/block/genhd.c (arch i386, CONFIG_SMP=y). So use a simple | ||
| 136 | * one-line #define for cpu_isset(), instead of wrapping an inline | ||
| 137 | * inside a macro, the way we do the other calls. | ||
| 138 | */ | 8 | */ |
| 139 | |||
| 140 | #include <linux/kernel.h> | 9 | #include <linux/kernel.h> |
| 141 | #include <linux/threads.h> | 10 | #include <linux/threads.h> |
| 142 | #include <linux/bitmap.h> | 11 | #include <linux/bitmap.h> |
| 143 | 12 | ||
| 144 | typedef struct cpumask { DECLARE_BITMAP(bits, NR_CPUS); } cpumask_t; | 13 | typedef struct cpumask { DECLARE_BITMAP(bits, NR_CPUS); } cpumask_t; |
| 145 | extern cpumask_t _unused_cpumask_arg_; | ||
| 146 | |||
| 147 | #ifndef CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS | ||
| 148 | #define cpu_set(cpu, dst) __cpu_set((cpu), &(dst)) | ||
| 149 | static inline void __cpu_set(int cpu, volatile cpumask_t *dstp) | ||
| 150 | { | ||
| 151 | set_bit(cpu, dstp->bits); | ||
| 152 | } | ||
| 153 | |||
| 154 | #define cpu_clear(cpu, dst) __cpu_clear((cpu), &(dst)) | ||
| 155 | static inline void __cpu_clear(int cpu, volatile cpumask_t *dstp) | ||
| 156 | { | ||
| 157 | clear_bit(cpu, dstp->bits); | ||
| 158 | } | ||
| 159 | |||
| 160 | #define cpus_setall(dst) __cpus_setall(&(dst), NR_CPUS) | ||
| 161 | static inline void __cpus_setall(cpumask_t *dstp, int nbits) | ||
| 162 | { | ||
| 163 | bitmap_fill(dstp->bits, nbits); | ||
| 164 | } | ||
| 165 | |||
| 166 | #define cpus_clear(dst) __cpus_clear(&(dst), NR_CPUS) | ||
| 167 | static inline void __cpus_clear(cpumask_t *dstp, int nbits) | ||
| 168 | { | ||
| 169 | bitmap_zero(dstp->bits, nbits); | ||
| 170 | } | ||
| 171 | |||
| 172 | /* No static inline type checking - see Subtlety (1) above. */ | ||
| 173 | #define cpu_isset(cpu, cpumask) test_bit((cpu), (cpumask).bits) | ||
| 174 | |||
| 175 | #define cpu_test_and_set(cpu, cpumask) __cpu_test_and_set((cpu), &(cpumask)) | ||
| 176 | static inline int __cpu_test_and_set(int cpu, cpumask_t *addr) | ||
| 177 | { | ||
| 178 | return test_and_set_bit(cpu, addr->bits); | ||
| 179 | } | ||
| 180 | |||
| 181 | #define cpus_and(dst, src1, src2) __cpus_and(&(dst), &(src1), &(src2), NR_CPUS) | ||
| 182 | static inline int __cpus_and(cpumask_t *dstp, const cpumask_t *src1p, | ||
| 183 | const cpumask_t *src2p, int nbits) | ||
| 184 | { | ||
| 185 | return bitmap_and(dstp->bits, src1p->bits, src2p->bits, nbits); | ||
| 186 | } | ||
| 187 | |||
| 188 | #define cpus_or(dst, src1, src2) __cpus_or(&(dst), &(src1), &(src2), NR_CPUS) | ||
| 189 | static inline void __cpus_or(cpumask_t *dstp, const cpumask_t *src1p, | ||
| 190 | const cpumask_t *src2p, int nbits) | ||
| 191 | { | ||
| 192 | bitmap_or(dstp->bits, src1p->bits, src2p->bits, nbits); | ||
| 193 | } | ||
| 194 | |||
| 195 | #define cpus_xor(dst, src1, src2) __cpus_xor(&(dst), &(src1), &(src2), NR_CPUS) | ||
| 196 | static inline void __cpus_xor(cpumask_t *dstp, const cpumask_t *src1p, | ||
| 197 | const cpumask_t *src2p, int nbits) | ||
| 198 | { | ||
| 199 | bitmap_xor(dstp->bits, src1p->bits, src2p->bits, nbits); | ||
| 200 | } | ||
| 201 | |||
| 202 | #define cpus_andnot(dst, src1, src2) \ | ||
| 203 | __cpus_andnot(&(dst), &(src1), &(src2), NR_CPUS) | ||
| 204 | static inline int __cpus_andnot(cpumask_t *dstp, const cpumask_t *src1p, | ||
| 205 | const cpumask_t *src2p, int nbits) | ||
| 206 | { | ||
| 207 | return bitmap_andnot(dstp->bits, src1p->bits, src2p->bits, nbits); | ||
| 208 | } | ||
| 209 | |||
| 210 | #define cpus_complement(dst, src) __cpus_complement(&(dst), &(src), NR_CPUS) | ||
| 211 | static inline void __cpus_complement(cpumask_t *dstp, | ||
| 212 | const cpumask_t *srcp, int nbits) | ||
| 213 | { | ||
| 214 | bitmap_complement(dstp->bits, srcp->bits, nbits); | ||
| 215 | } | ||
| 216 | |||
| 217 | #define cpus_equal(src1, src2) __cpus_equal(&(src1), &(src2), NR_CPUS) | ||
| 218 | static inline int __cpus_equal(const cpumask_t *src1p, | ||
| 219 | const cpumask_t *src2p, int nbits) | ||
| 220 | { | ||
| 221 | return bitmap_equal(src1p->bits, src2p->bits, nbits); | ||
| 222 | } | ||
| 223 | |||
| 224 | #define cpus_intersects(src1, src2) __cpus_intersects(&(src1), &(src2), NR_CPUS) | ||
| 225 | static inline int __cpus_intersects(const cpumask_t *src1p, | ||
| 226 | const cpumask_t *src2p, int nbits) | ||
| 227 | { | ||
| 228 | return bitmap_intersects(src1p->bits, src2p->bits, nbits); | ||
| 229 | } | ||
| 230 | |||
| 231 | #define cpus_subset(src1, src2) __cpus_subset(&(src1), &(src2), NR_CPUS) | ||
| 232 | static inline int __cpus_subset(const cpumask_t *src1p, | ||
| 233 | const cpumask_t *src2p, int nbits) | ||
| 234 | { | ||
| 235 | return bitmap_subset(src1p->bits, src2p->bits, nbits); | ||
| 236 | } | ||
| 237 | |||
| 238 | #define cpus_empty(src) __cpus_empty(&(src), NR_CPUS) | ||
| 239 | static inline int __cpus_empty(const cpumask_t *srcp, int nbits) | ||
| 240 | { | ||
| 241 | return bitmap_empty(srcp->bits, nbits); | ||
| 242 | } | ||
| 243 | |||
| 244 | #define cpus_full(cpumask) __cpus_full(&(cpumask), NR_CPUS) | ||
| 245 | static inline int __cpus_full(const cpumask_t *srcp, int nbits) | ||
| 246 | { | ||
| 247 | return bitmap_full(srcp->bits, nbits); | ||
| 248 | } | ||
| 249 | |||
| 250 | #define cpus_weight(cpumask) __cpus_weight(&(cpumask), NR_CPUS) | ||
| 251 | static inline int __cpus_weight(const cpumask_t *srcp, int nbits) | ||
| 252 | { | ||
| 253 | return bitmap_weight(srcp->bits, nbits); | ||
| 254 | } | ||
| 255 | |||
| 256 | #define cpus_shift_right(dst, src, n) \ | ||
| 257 | __cpus_shift_right(&(dst), &(src), (n), NR_CPUS) | ||
| 258 | static inline void __cpus_shift_right(cpumask_t *dstp, | ||
| 259 | const cpumask_t *srcp, int n, int nbits) | ||
| 260 | { | ||
| 261 | bitmap_shift_right(dstp->bits, srcp->bits, n, nbits); | ||
| 262 | } | ||
| 263 | |||
| 264 | #define cpus_shift_left(dst, src, n) \ | ||
| 265 | __cpus_shift_left(&(dst), &(src), (n), NR_CPUS) | ||
| 266 | static inline void __cpus_shift_left(cpumask_t *dstp, | ||
| 267 | const cpumask_t *srcp, int n, int nbits) | ||
| 268 | { | ||
| 269 | bitmap_shift_left(dstp->bits, srcp->bits, n, nbits); | ||
| 270 | } | ||
| 271 | #endif /* !CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS */ | ||
| 272 | 14 | ||
| 273 | /** | 15 | /** |
| 274 | * to_cpumask - convert an NR_CPUS bitmap to a struct cpumask * | 16 | * cpumask_bits - get the bits in a cpumask |
| 275 | * @bitmap: the bitmap | 17 | * @maskp: the struct cpumask * |
| 276 | * | ||
| 277 | * There are a few places where cpumask_var_t isn't appropriate and | ||
| 278 | * static cpumasks must be used (eg. very early boot), yet we don't | ||
| 279 | * expose the definition of 'struct cpumask'. | ||
| 280 | * | 18 | * |
| 281 | * This does the conversion, and can be used as a constant initializer. | 19 | * You should only assume nr_cpu_ids bits of this mask are valid. This is |
| 20 | * a macro so it's const-correct. | ||
| 282 | */ | 21 | */ |
| 283 | #define to_cpumask(bitmap) \ | 22 | #define cpumask_bits(maskp) ((maskp)->bits) |
| 284 | ((struct cpumask *)(1 ? (bitmap) \ | ||
| 285 | : (void *)sizeof(__check_is_bitmap(bitmap)))) | ||
| 286 | |||
| 287 | static inline int __check_is_bitmap(const unsigned long *bitmap) | ||
| 288 | { | ||
| 289 | return 1; | ||
| 290 | } | ||
| 291 | |||
| 292 | /* | ||
| 293 | * Special-case data structure for "single bit set only" constant CPU masks. | ||
| 294 | * | ||
| 295 | * We pre-generate all the 64 (or 32) possible bit positions, with enough | ||
| 296 | * padding to the left and the right, and return the constant pointer | ||
| 297 | * appropriately offset. | ||
| 298 | */ | ||
| 299 | extern const unsigned long | ||
| 300 | cpu_bit_bitmap[BITS_PER_LONG+1][BITS_TO_LONGS(NR_CPUS)]; | ||
| 301 | |||
| 302 | static inline const struct cpumask *get_cpu_mask(unsigned int cpu) | ||
| 303 | { | ||
| 304 | const unsigned long *p = cpu_bit_bitmap[1 + cpu % BITS_PER_LONG]; | ||
| 305 | p -= cpu / BITS_PER_LONG; | ||
| 306 | return to_cpumask(p); | ||
| 307 | } | ||
| 308 | |||
| 309 | #ifndef CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS | ||
| 310 | /* | ||
| 311 | * In cases where we take the address of the cpumask immediately, | ||
| 312 | * gcc optimizes it out (it's a constant) and there's no huge stack | ||
| 313 | * variable created: | ||
| 314 | */ | ||
| 315 | #define cpumask_of_cpu(cpu) (*get_cpu_mask(cpu)) | ||
| 316 | |||
| 317 | |||
| 318 | #define CPU_MASK_LAST_WORD BITMAP_LAST_WORD_MASK(NR_CPUS) | ||
| 319 | |||
| 320 | #if NR_CPUS <= BITS_PER_LONG | ||
| 321 | |||
| 322 | #define CPU_MASK_ALL \ | ||
| 323 | (cpumask_t) { { \ | ||
| 324 | [BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \ | ||
| 325 | } } | ||
| 326 | |||
| 327 | #define CPU_MASK_ALL_PTR (&CPU_MASK_ALL) | ||
| 328 | |||
| 329 | #else | ||
| 330 | |||
| 331 | #define CPU_MASK_ALL \ | ||
| 332 | (cpumask_t) { { \ | ||
| 333 | [0 ... BITS_TO_LONGS(NR_CPUS)-2] = ~0UL, \ | ||
| 334 | [BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \ | ||
| 335 | } } | ||
| 336 | |||
| 337 | /* cpu_mask_all is in init/main.c */ | ||
| 338 | extern cpumask_t cpu_mask_all; | ||
| 339 | #define CPU_MASK_ALL_PTR (&cpu_mask_all) | ||
| 340 | |||
| 341 | #endif | ||
| 342 | |||
| 343 | #define CPU_MASK_NONE \ | ||
| 344 | (cpumask_t) { { \ | ||
| 345 | [0 ... BITS_TO_LONGS(NR_CPUS)-1] = 0UL \ | ||
| 346 | } } | ||
| 347 | |||
| 348 | #define CPU_MASK_CPU0 \ | ||
| 349 | (cpumask_t) { { \ | ||
| 350 | [0] = 1UL \ | ||
| 351 | } } | ||
| 352 | |||
| 353 | #define cpus_addr(src) ((src).bits) | ||
| 354 | |||
| 355 | #if NR_CPUS > BITS_PER_LONG | ||
| 356 | #define CPUMASK_ALLOC(m) struct m *m = kmalloc(sizeof(*m), GFP_KERNEL) | ||
| 357 | #define CPUMASK_FREE(m) kfree(m) | ||
| 358 | #else | ||
| 359 | #define CPUMASK_ALLOC(m) struct m _m, *m = &_m | ||
| 360 | #define CPUMASK_FREE(m) | ||
| 361 | #endif | ||
| 362 | #define CPUMASK_PTR(v, m) cpumask_t *v = &(m->v) | ||
| 363 | |||
| 364 | #define cpu_remap(oldbit, old, new) \ | ||
| 365 | __cpu_remap((oldbit), &(old), &(new), NR_CPUS) | ||
| 366 | static inline int __cpu_remap(int oldbit, | ||
| 367 | const cpumask_t *oldp, const cpumask_t *newp, int nbits) | ||
| 368 | { | ||
| 369 | return bitmap_bitremap(oldbit, oldp->bits, newp->bits, nbits); | ||
| 370 | } | ||
| 371 | |||
| 372 | #define cpus_remap(dst, src, old, new) \ | ||
| 373 | __cpus_remap(&(dst), &(src), &(old), &(new), NR_CPUS) | ||
| 374 | static inline void __cpus_remap(cpumask_t *dstp, const cpumask_t *srcp, | ||
| 375 | const cpumask_t *oldp, const cpumask_t *newp, int nbits) | ||
| 376 | { | ||
| 377 | bitmap_remap(dstp->bits, srcp->bits, oldp->bits, newp->bits, nbits); | ||
| 378 | } | ||
| 379 | |||
| 380 | #define cpus_onto(dst, orig, relmap) \ | ||
| 381 | __cpus_onto(&(dst), &(orig), &(relmap), NR_CPUS) | ||
| 382 | static inline void __cpus_onto(cpumask_t *dstp, const cpumask_t *origp, | ||
| 383 | const cpumask_t *relmapp, int nbits) | ||
| 384 | { | ||
| 385 | bitmap_onto(dstp->bits, origp->bits, relmapp->bits, nbits); | ||
| 386 | } | ||
| 387 | |||
| 388 | #define cpus_fold(dst, orig, sz) \ | ||
| 389 | __cpus_fold(&(dst), &(orig), sz, NR_CPUS) | ||
| 390 | static inline void __cpus_fold(cpumask_t *dstp, const cpumask_t *origp, | ||
| 391 | int sz, int nbits) | ||
| 392 | { | ||
| 393 | bitmap_fold(dstp->bits, origp->bits, sz, nbits); | ||
| 394 | } | ||
| 395 | #endif /* !CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS */ | ||
| 396 | 23 | ||
| 397 | #if NR_CPUS == 1 | 24 | #if NR_CPUS == 1 |
| 398 | |||
| 399 | #define nr_cpu_ids 1 | 25 | #define nr_cpu_ids 1 |
| 400 | #ifndef CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS | 26 | #else |
| 401 | #define first_cpu(src) ({ (void)(src); 0; }) | ||
| 402 | #define next_cpu(n, src) ({ (void)(src); 1; }) | ||
| 403 | #define any_online_cpu(mask) 0 | ||
| 404 | #define for_each_cpu_mask(cpu, mask) \ | ||
| 405 | for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask) | ||
| 406 | #endif /* !CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS */ | ||
| 407 | #else /* NR_CPUS > 1 */ | ||
| 408 | |||
| 409 | extern int nr_cpu_ids; | 27 | extern int nr_cpu_ids; |
| 410 | #ifndef CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS | ||
| 411 | int __first_cpu(const cpumask_t *srcp); | ||
| 412 | int __next_cpu(int n, const cpumask_t *srcp); | ||
| 413 | int __any_online_cpu(const cpumask_t *mask); | ||
| 414 | |||
| 415 | #define first_cpu(src) __first_cpu(&(src)) | ||
| 416 | #define next_cpu(n, src) __next_cpu((n), &(src)) | ||
| 417 | #define any_online_cpu(mask) __any_online_cpu(&(mask)) | ||
| 418 | #define for_each_cpu_mask(cpu, mask) \ | ||
| 419 | for ((cpu) = -1; \ | ||
| 420 | (cpu) = next_cpu((cpu), (mask)), \ | ||
| 421 | (cpu) < NR_CPUS; ) | ||
| 422 | #endif /* !CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS */ | ||
| 423 | #endif | 28 | #endif |
| 424 | 29 | ||
| 425 | #ifndef CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS | 30 | #ifdef CONFIG_CPUMASK_OFFSTACK |
| 426 | #if NR_CPUS <= 64 | 31 | /* Assuming NR_CPUS is huge, a runtime limit is more efficient. Also, |
| 427 | 32 | * not all bits may be allocated. */ | |
| 428 | #define next_cpu_nr(n, src) next_cpu(n, src) | 33 | #define nr_cpumask_bits nr_cpu_ids |
| 429 | #define cpus_weight_nr(cpumask) cpus_weight(cpumask) | 34 | #else |
| 430 | #define for_each_cpu_mask_nr(cpu, mask) for_each_cpu_mask(cpu, mask) | 35 | #define nr_cpumask_bits NR_CPUS |
| 431 | 36 | #endif | |
| 432 | #else /* NR_CPUS > 64 */ | ||
| 433 | |||
| 434 | int __next_cpu_nr(int n, const cpumask_t *srcp); | ||
| 435 | #define next_cpu_nr(n, src) __next_cpu_nr((n), &(src)) | ||
| 436 | #define cpus_weight_nr(cpumask) __cpus_weight(&(cpumask), nr_cpu_ids) | ||
| 437 | #define for_each_cpu_mask_nr(cpu, mask) \ | ||
| 438 | for ((cpu) = -1; \ | ||
| 439 | (cpu) = next_cpu_nr((cpu), (mask)), \ | ||
| 440 | (cpu) < nr_cpu_ids; ) | ||
| 441 | |||
| 442 | #endif /* NR_CPUS > 64 */ | ||
| 443 | #endif /* !CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS */ | ||
| 444 | 37 | ||
| 445 | /* | 38 | /* |
| 446 | * The following particular system cpumasks and operations manage | 39 | * The following particular system cpumasks and operations manage |
| @@ -487,12 +80,6 @@ extern const struct cpumask *const cpu_online_mask; | |||
| 487 | extern const struct cpumask *const cpu_present_mask; | 80 | extern const struct cpumask *const cpu_present_mask; |
| 488 | extern const struct cpumask *const cpu_active_mask; | 81 | extern const struct cpumask *const cpu_active_mask; |
| 489 | 82 | ||
| 490 | /* These strip const, as traditionally they weren't const. */ | ||
| 491 | #define cpu_possible_map (*(cpumask_t *)cpu_possible_mask) | ||
| 492 | #define cpu_online_map (*(cpumask_t *)cpu_online_mask) | ||
| 493 | #define cpu_present_map (*(cpumask_t *)cpu_present_mask) | ||
| 494 | #define cpu_active_map (*(cpumask_t *)cpu_active_mask) | ||
| 495 | |||
| 496 | #if NR_CPUS > 1 | 83 | #if NR_CPUS > 1 |
| 497 | #define num_online_cpus() cpumask_weight(cpu_online_mask) | 84 | #define num_online_cpus() cpumask_weight(cpu_online_mask) |
| 498 | #define num_possible_cpus() cpumask_weight(cpu_possible_mask) | 85 | #define num_possible_cpus() cpumask_weight(cpu_possible_mask) |
| @@ -511,35 +98,6 @@ extern const struct cpumask *const cpu_active_mask; | |||
| 511 | #define cpu_active(cpu) ((cpu) == 0) | 98 | #define cpu_active(cpu) ((cpu) == 0) |
| 512 | #endif | 99 | #endif |
| 513 | 100 | ||
| 514 | #define cpu_is_offline(cpu) unlikely(!cpu_online(cpu)) | ||
| 515 | |||
| 516 | /* These are the new versions of the cpumask operators: passed by pointer. | ||
| 517 | * The older versions will be implemented in terms of these, then deleted. */ | ||
| 518 | #define cpumask_bits(maskp) ((maskp)->bits) | ||
| 519 | |||
| 520 | #if NR_CPUS <= BITS_PER_LONG | ||
| 521 | #define CPU_BITS_ALL \ | ||
| 522 | { \ | ||
| 523 | [BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \ | ||
| 524 | } | ||
| 525 | |||
| 526 | #else /* NR_CPUS > BITS_PER_LONG */ | ||
| 527 | |||
| 528 | #define CPU_BITS_ALL \ | ||
| 529 | { \ | ||
| 530 | [0 ... BITS_TO_LONGS(NR_CPUS)-2] = ~0UL, \ | ||
| 531 | [BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \ | ||
| 532 | } | ||
| 533 | #endif /* NR_CPUS > BITS_PER_LONG */ | ||
| 534 | |||
| 535 | #ifdef CONFIG_CPUMASK_OFFSTACK | ||
| 536 | /* Assuming NR_CPUS is huge, a runtime limit is more efficient. Also, | ||
| 537 | * not all bits may be allocated. */ | ||
| 538 | #define nr_cpumask_bits nr_cpu_ids | ||
| 539 | #else | ||
| 540 | #define nr_cpumask_bits NR_CPUS | ||
| 541 | #endif | ||
| 542 | |||
| 543 | /* verify cpu argument to cpumask_* operators */ | 101 | /* verify cpu argument to cpumask_* operators */ |
| 544 | static inline unsigned int cpumask_check(unsigned int cpu) | 102 | static inline unsigned int cpumask_check(unsigned int cpu) |
| 545 | { | 103 | { |
| @@ -715,6 +273,18 @@ static inline int cpumask_test_and_set_cpu(int cpu, struct cpumask *cpumask) | |||
| 715 | } | 273 | } |
| 716 | 274 | ||
| 717 | /** | 275 | /** |
| 276 | * cpumask_test_and_clear_cpu - atomically test and clear a cpu in a cpumask | ||
| 277 | * @cpu: cpu number (< nr_cpu_ids) | ||
| 278 | * @cpumask: the cpumask pointer | ||
| 279 | * | ||
| 280 | * test_and_clear_bit wrapper for cpumasks. | ||
| 281 | */ | ||
| 282 | static inline int cpumask_test_and_clear_cpu(int cpu, struct cpumask *cpumask) | ||
| 283 | { | ||
| 284 | return test_and_clear_bit(cpumask_check(cpu), cpumask_bits(cpumask)); | ||
| 285 | } | ||
| 286 | |||
| 287 | /** | ||
| 718 | * cpumask_setall - set all cpus (< nr_cpu_ids) in a cpumask | 288 | * cpumask_setall - set all cpus (< nr_cpu_ids) in a cpumask |
| 719 | * @dstp: the cpumask pointer | 289 | * @dstp: the cpumask pointer |
| 720 | */ | 290 | */ |
| @@ -1088,4 +658,241 @@ void set_cpu_active(unsigned int cpu, bool active); | |||
| 1088 | void init_cpu_present(const struct cpumask *src); | 658 | void init_cpu_present(const struct cpumask *src); |
| 1089 | void init_cpu_possible(const struct cpumask *src); | 659 | void init_cpu_possible(const struct cpumask *src); |
| 1090 | void init_cpu_online(const struct cpumask *src); | 660 | void init_cpu_online(const struct cpumask *src); |
| 661 | |||
| 662 | /** | ||
| 663 | * to_cpumask - convert an NR_CPUS bitmap to a struct cpumask * | ||
| 664 | * @bitmap: the bitmap | ||
| 665 | * | ||
| 666 | * There are a few places where cpumask_var_t isn't appropriate and | ||
| 667 | * static cpumasks must be used (eg. very early boot), yet we don't | ||
| 668 | * expose the definition of 'struct cpumask'. | ||
| 669 | * | ||
| 670 | * This does the conversion, and can be used as a constant initializer. | ||
| 671 | */ | ||
| 672 | #define to_cpumask(bitmap) \ | ||
| 673 | ((struct cpumask *)(1 ? (bitmap) \ | ||
| 674 | : (void *)sizeof(__check_is_bitmap(bitmap)))) | ||
| 675 | |||
| 676 | static inline int __check_is_bitmap(const unsigned long *bitmap) | ||
| 677 | { | ||
| 678 | return 1; | ||
| 679 | } | ||
| 680 | |||
| 681 | /* | ||
| 682 | * Special-case data structure for "single bit set only" constant CPU masks. | ||
| 683 | * | ||
| 684 | * We pre-generate all the 64 (or 32) possible bit positions, with enough | ||
| 685 | * padding to the left and the right, and return the constant pointer | ||
| 686 | * appropriately offset. | ||
| 687 | */ | ||
| 688 | extern const unsigned long | ||
| 689 | cpu_bit_bitmap[BITS_PER_LONG+1][BITS_TO_LONGS(NR_CPUS)]; | ||
| 690 | |||
| 691 | static inline const struct cpumask *get_cpu_mask(unsigned int cpu) | ||
| 692 | { | ||
| 693 | const unsigned long *p = cpu_bit_bitmap[1 + cpu % BITS_PER_LONG]; | ||
| 694 | p -= cpu / BITS_PER_LONG; | ||
| 695 | return to_cpumask(p); | ||
| 696 | } | ||
| 697 | |||
| 698 | #define cpu_is_offline(cpu) unlikely(!cpu_online(cpu)) | ||
| 699 | |||
| 700 | #if NR_CPUS <= BITS_PER_LONG | ||
| 701 | #define CPU_BITS_ALL \ | ||
| 702 | { \ | ||
| 703 | [BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \ | ||
| 704 | } | ||
| 705 | |||
| 706 | #else /* NR_CPUS > BITS_PER_LONG */ | ||
| 707 | |||
| 708 | #define CPU_BITS_ALL \ | ||
| 709 | { \ | ||
| 710 | [0 ... BITS_TO_LONGS(NR_CPUS)-2] = ~0UL, \ | ||
| 711 | [BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \ | ||
| 712 | } | ||
| 713 | #endif /* NR_CPUS > BITS_PER_LONG */ | ||
| 714 | |||
| 715 | /* | ||
| 716 | * | ||
| 717 | * From here down, all obsolete. Use cpumask_ variants! | ||
| 718 | * | ||
| 719 | */ | ||
| 720 | #ifndef CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS | ||
| 721 | /* These strip const, as traditionally they weren't const. */ | ||
| 722 | #define cpu_possible_map (*(cpumask_t *)cpu_possible_mask) | ||
| 723 | #define cpu_online_map (*(cpumask_t *)cpu_online_mask) | ||
| 724 | #define cpu_present_map (*(cpumask_t *)cpu_present_mask) | ||
| 725 | #define cpu_active_map (*(cpumask_t *)cpu_active_mask) | ||
| 726 | |||
| 727 | #define cpumask_of_cpu(cpu) (*get_cpu_mask(cpu)) | ||
| 728 | |||
| 729 | #define CPU_MASK_LAST_WORD BITMAP_LAST_WORD_MASK(NR_CPUS) | ||
| 730 | |||
| 731 | #if NR_CPUS <= BITS_PER_LONG | ||
| 732 | |||
| 733 | #define CPU_MASK_ALL \ | ||
| 734 | (cpumask_t) { { \ | ||
| 735 | [BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \ | ||
| 736 | } } | ||
| 737 | |||
| 738 | #else | ||
| 739 | |||
| 740 | #define CPU_MASK_ALL \ | ||
| 741 | (cpumask_t) { { \ | ||
| 742 | [0 ... BITS_TO_LONGS(NR_CPUS)-2] = ~0UL, \ | ||
| 743 | [BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \ | ||
| 744 | } } | ||
| 745 | |||
| 746 | #endif | ||
| 747 | |||
| 748 | #define CPU_MASK_NONE \ | ||
| 749 | (cpumask_t) { { \ | ||
| 750 | [0 ... BITS_TO_LONGS(NR_CPUS)-1] = 0UL \ | ||
| 751 | } } | ||
| 752 | |||
| 753 | #define CPU_MASK_CPU0 \ | ||
| 754 | (cpumask_t) { { \ | ||
| 755 | [0] = 1UL \ | ||
| 756 | } } | ||
| 757 | |||
| 758 | #if NR_CPUS == 1 | ||
| 759 | #define first_cpu(src) ({ (void)(src); 0; }) | ||
| 760 | #define next_cpu(n, src) ({ (void)(src); 1; }) | ||
| 761 | #define any_online_cpu(mask) 0 | ||
| 762 | #define for_each_cpu_mask(cpu, mask) \ | ||
| 763 | for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask) | ||
| 764 | #else /* NR_CPUS > 1 */ | ||
| 765 | int __first_cpu(const cpumask_t *srcp); | ||
| 766 | int __next_cpu(int n, const cpumask_t *srcp); | ||
| 767 | int __any_online_cpu(const cpumask_t *mask); | ||
| 768 | |||
| 769 | #define first_cpu(src) __first_cpu(&(src)) | ||
| 770 | #define next_cpu(n, src) __next_cpu((n), &(src)) | ||
| 771 | #define any_online_cpu(mask) __any_online_cpu(&(mask)) | ||
| 772 | #define for_each_cpu_mask(cpu, mask) \ | ||
| 773 | for ((cpu) = -1; \ | ||
| 774 | (cpu) = next_cpu((cpu), (mask)), \ | ||
| 775 | (cpu) < NR_CPUS; ) | ||
| 776 | #endif /* SMP */ | ||
| 777 | |||
| 778 | #if NR_CPUS <= 64 | ||
| 779 | |||
| 780 | #define for_each_cpu_mask_nr(cpu, mask) for_each_cpu_mask(cpu, mask) | ||
| 781 | |||
| 782 | #else /* NR_CPUS > 64 */ | ||
| 783 | |||
| 784 | int __next_cpu_nr(int n, const cpumask_t *srcp); | ||
| 785 | #define for_each_cpu_mask_nr(cpu, mask) \ | ||
| 786 | for ((cpu) = -1; \ | ||
| 787 | (cpu) = __next_cpu_nr((cpu), &(mask)), \ | ||
| 788 | (cpu) < nr_cpu_ids; ) | ||
| 789 | |||
| 790 | #endif /* NR_CPUS > 64 */ | ||
| 791 | |||
| 792 | #define cpus_addr(src) ((src).bits) | ||
| 793 | |||
| 794 | #define cpu_set(cpu, dst) __cpu_set((cpu), &(dst)) | ||
| 795 | static inline void __cpu_set(int cpu, volatile cpumask_t *dstp) | ||
| 796 | { | ||
| 797 | set_bit(cpu, dstp->bits); | ||
| 798 | } | ||
| 799 | |||
| 800 | #define cpu_clear(cpu, dst) __cpu_clear((cpu), &(dst)) | ||
| 801 | static inline void __cpu_clear(int cpu, volatile cpumask_t *dstp) | ||
| 802 | { | ||
| 803 | clear_bit(cpu, dstp->bits); | ||
| 804 | } | ||
| 805 | |||
| 806 | #define cpus_setall(dst) __cpus_setall(&(dst), NR_CPUS) | ||
| 807 | static inline void __cpus_setall(cpumask_t *dstp, int nbits) | ||
| 808 | { | ||
| 809 | bitmap_fill(dstp->bits, nbits); | ||
| 810 | } | ||
| 811 | |||
| 812 | #define cpus_clear(dst) __cpus_clear(&(dst), NR_CPUS) | ||
| 813 | static inline void __cpus_clear(cpumask_t *dstp, int nbits) | ||
| 814 | { | ||
| 815 | bitmap_zero(dstp->bits, nbits); | ||
| 816 | } | ||
| 817 | |||
| 818 | /* No static inline type checking - see Subtlety (1) above. */ | ||
| 819 | #define cpu_isset(cpu, cpumask) test_bit((cpu), (cpumask).bits) | ||
| 820 | |||
| 821 | #define cpu_test_and_set(cpu, cpumask) __cpu_test_and_set((cpu), &(cpumask)) | ||
| 822 | static inline int __cpu_test_and_set(int cpu, cpumask_t *addr) | ||
| 823 | { | ||
| 824 | return test_and_set_bit(cpu, addr->bits); | ||
| 825 | } | ||
| 826 | |||
| 827 | #define cpus_and(dst, src1, src2) __cpus_and(&(dst), &(src1), &(src2), NR_CPUS) | ||
| 828 | static inline int __cpus_and(cpumask_t *dstp, const cpumask_t *src1p, | ||
| 829 | const cpumask_t *src2p, int nbits) | ||
| 830 | { | ||
| 831 | return bitmap_and(dstp->bits, src1p->bits, src2p->bits, nbits); | ||
| 832 | } | ||
| 833 | |||
| 834 | #define cpus_or(dst, src1, src2) __cpus_or(&(dst), &(src1), &(src2), NR_CPUS) | ||
| 835 | static inline void __cpus_or(cpumask_t *dstp, const cpumask_t *src1p, | ||
| 836 | const cpumask_t *src2p, int nbits) | ||
| 837 | { | ||
| 838 | bitmap_or(dstp->bits, src1p->bits, src2p->bits, nbits); | ||
| 839 | } | ||
| 840 | |||
| 841 | #define cpus_xor(dst, src1, src2) __cpus_xor(&(dst), &(src1), &(src2), NR_CPUS) | ||
| 842 | static inline void __cpus_xor(cpumask_t *dstp, const cpumask_t *src1p, | ||
| 843 | const cpumask_t *src2p, int nbits) | ||
| 844 | { | ||
| 845 | bitmap_xor(dstp->bits, src1p->bits, src2p->bits, nbits); | ||
| 846 | } | ||
| 847 | |||
| 848 | #define cpus_andnot(dst, src1, src2) \ | ||
| 849 | __cpus_andnot(&(dst), &(src1), &(src2), NR_CPUS) | ||
| 850 | static inline int __cpus_andnot(cpumask_t *dstp, const cpumask_t *src1p, | ||
| 851 | const cpumask_t *src2p, int nbits) | ||
| 852 | { | ||
| 853 | return bitmap_andnot(dstp->bits, src1p->bits, src2p->bits, nbits); | ||
| 854 | } | ||
| 855 | |||
| 856 | #define cpus_equal(src1, src2) __cpus_equal(&(src1), &(src2), NR_CPUS) | ||
| 857 | static inline int __cpus_equal(const cpumask_t *src1p, | ||
| 858 | const cpumask_t *src2p, int nbits) | ||
| 859 | { | ||
| 860 | return bitmap_equal(src1p->bits, src2p->bits, nbits); | ||
| 861 | } | ||
| 862 | |||
| 863 | #define cpus_intersects(src1, src2) __cpus_intersects(&(src1), &(src2), NR_CPUS) | ||
| 864 | static inline int __cpus_intersects(const cpumask_t *src1p, | ||
| 865 | const cpumask_t *src2p, int nbits) | ||
| 866 | { | ||
| 867 | return bitmap_intersects(src1p->bits, src2p->bits, nbits); | ||
| 868 | } | ||
| 869 | |||
| 870 | #define cpus_subset(src1, src2) __cpus_subset(&(src1), &(src2), NR_CPUS) | ||
| 871 | static inline int __cpus_subset(const cpumask_t *src1p, | ||
| 872 | const cpumask_t *src2p, int nbits) | ||
| 873 | { | ||
| 874 | return bitmap_subset(src1p->bits, src2p->bits, nbits); | ||
| 875 | } | ||
| 876 | |||
| 877 | #define cpus_empty(src) __cpus_empty(&(src), NR_CPUS) | ||
| 878 | static inline int __cpus_empty(const cpumask_t *srcp, int nbits) | ||
| 879 | { | ||
| 880 | return bitmap_empty(srcp->bits, nbits); | ||
| 881 | } | ||
| 882 | |||
| 883 | #define cpus_weight(cpumask) __cpus_weight(&(cpumask), NR_CPUS) | ||
| 884 | static inline int __cpus_weight(const cpumask_t *srcp, int nbits) | ||
| 885 | { | ||
| 886 | return bitmap_weight(srcp->bits, nbits); | ||
| 887 | } | ||
| 888 | |||
| 889 | #define cpus_shift_left(dst, src, n) \ | ||
| 890 | __cpus_shift_left(&(dst), &(src), (n), NR_CPUS) | ||
| 891 | static inline void __cpus_shift_left(cpumask_t *dstp, | ||
| 892 | const cpumask_t *srcp, int n, int nbits) | ||
| 893 | { | ||
| 894 | bitmap_shift_left(dstp->bits, srcp->bits, n, nbits); | ||
| 895 | } | ||
| 896 | #endif /* !CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS */ | ||
| 897 | |||
| 1091 | #endif /* __LINUX_CPUMASK_H */ | 898 | #endif /* __LINUX_CPUMASK_H */ |
diff --git a/include/linux/cred.h b/include/linux/cred.h index 24520a539c6f..4e3387a89cb9 100644 --- a/include/linux/cred.h +++ b/include/linux/cred.h | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | #include <linux/capability.h> | 15 | #include <linux/capability.h> |
| 16 | #include <linux/init.h> | 16 | #include <linux/init.h> |
| 17 | #include <linux/key.h> | 17 | #include <linux/key.h> |
| 18 | #include <linux/selinux.h> | ||
| 18 | #include <asm/atomic.h> | 19 | #include <asm/atomic.h> |
| 19 | 20 | ||
| 20 | struct user_struct; | 21 | struct user_struct; |
| @@ -175,21 +176,7 @@ extern void __invalid_creds(const struct cred *, const char *, unsigned); | |||
| 175 | extern void __validate_process_creds(struct task_struct *, | 176 | extern void __validate_process_creds(struct task_struct *, |
| 176 | const char *, unsigned); | 177 | const char *, unsigned); |
| 177 | 178 | ||
| 178 | static inline bool creds_are_invalid(const struct cred *cred) | 179 | extern bool creds_are_invalid(const struct cred *cred); |
| 179 | { | ||
| 180 | if (cred->magic != CRED_MAGIC) | ||
| 181 | return true; | ||
| 182 | if (atomic_read(&cred->usage) < atomic_read(&cred->subscribers)) | ||
| 183 | return true; | ||
| 184 | #ifdef CONFIG_SECURITY_SELINUX | ||
| 185 | if ((unsigned long) cred->security < PAGE_SIZE) | ||
| 186 | return true; | ||
| 187 | if ((*(u32*)cred->security & 0xffffff00) == | ||
| 188 | (POISON_FREE << 24 | POISON_FREE << 16 | POISON_FREE << 8)) | ||
| 189 | return true; | ||
| 190 | #endif | ||
| 191 | return false; | ||
| 192 | } | ||
| 193 | 180 | ||
| 194 | static inline void __validate_creds(const struct cred *cred, | 181 | static inline void __validate_creds(const struct cred *cred, |
| 195 | const char *file, unsigned line) | 182 | const char *file, unsigned line) |
diff --git a/include/linux/cyclades.h b/include/linux/cyclades.h index 1fbdea4f08eb..a5049eaf782d 100644 --- a/include/linux/cyclades.h +++ b/include/linux/cyclades.h | |||
| @@ -499,6 +499,7 @@ struct cyclades_card { | |||
| 499 | void __iomem *p9050; | 499 | void __iomem *p9050; |
| 500 | struct RUNTIME_9060 __iomem *p9060; | 500 | struct RUNTIME_9060 __iomem *p9060; |
| 501 | } ctl_addr; | 501 | } ctl_addr; |
| 502 | struct BOARD_CTRL __iomem *board_ctrl; /* cyz specific */ | ||
| 502 | int irq; | 503 | int irq; |
| 503 | unsigned int num_chips; /* 0 if card absent, -1 if Z/PCI, else Y */ | 504 | unsigned int num_chips; /* 0 if card absent, -1 if Z/PCI, else Y */ |
| 504 | unsigned int first_line; /* minor number of first channel on card */ | 505 | unsigned int first_line; /* minor number of first channel on card */ |
| @@ -541,6 +542,15 @@ struct cyclades_port { | |||
| 541 | int magic; | 542 | int magic; |
| 542 | struct tty_port port; | 543 | struct tty_port port; |
| 543 | struct cyclades_card *card; | 544 | struct cyclades_card *card; |
| 545 | union { | ||
| 546 | struct { | ||
| 547 | void __iomem *base_addr; | ||
| 548 | } cyy; | ||
| 549 | struct { | ||
| 550 | struct CH_CTRL __iomem *ch_ctrl; | ||
| 551 | struct BUF_CTRL __iomem *buf_ctrl; | ||
| 552 | } cyz; | ||
| 553 | } u; | ||
| 544 | int line; | 554 | int line; |
| 545 | int flags; /* defined in tty.h */ | 555 | int flags; /* defined in tty.h */ |
| 546 | int type; /* UART type */ | 556 | int type; /* UART type */ |
| @@ -568,7 +578,6 @@ struct cyclades_port { | |||
| 568 | struct cyclades_idle_stats idle_stats; | 578 | struct cyclades_idle_stats idle_stats; |
| 569 | struct cyclades_icount icount; | 579 | struct cyclades_icount icount; |
| 570 | struct completion shutdown_wait; | 580 | struct completion shutdown_wait; |
| 571 | wait_queue_head_t delta_msr_wait; | ||
| 572 | int throttle; | 581 | int throttle; |
| 573 | }; | 582 | }; |
| 574 | 583 | ||
diff --git a/include/linux/dca.h b/include/linux/dca.h index 9c20c7e87d0a..d27a7a05718d 100644 --- a/include/linux/dca.h +++ b/include/linux/dca.h | |||
| @@ -20,6 +20,9 @@ | |||
| 20 | */ | 20 | */ |
| 21 | #ifndef DCA_H | 21 | #ifndef DCA_H |
| 22 | #define DCA_H | 22 | #define DCA_H |
| 23 | |||
| 24 | #include <linux/pci.h> | ||
| 25 | |||
| 23 | /* DCA Provider API */ | 26 | /* DCA Provider API */ |
| 24 | 27 | ||
| 25 | /* DCA Notifier Interface */ | 28 | /* DCA Notifier Interface */ |
| @@ -36,6 +39,12 @@ struct dca_provider { | |||
| 36 | int id; | 39 | int id; |
| 37 | }; | 40 | }; |
| 38 | 41 | ||
| 42 | struct dca_domain { | ||
| 43 | struct list_head node; | ||
| 44 | struct list_head dca_providers; | ||
| 45 | struct pci_bus *pci_rc; | ||
| 46 | }; | ||
| 47 | |||
| 39 | struct dca_ops { | 48 | struct dca_ops { |
| 40 | int (*add_requester) (struct dca_provider *, struct device *); | 49 | int (*add_requester) (struct dca_provider *, struct device *); |
| 41 | int (*remove_requester) (struct dca_provider *, struct device *); | 50 | int (*remove_requester) (struct dca_provider *, struct device *); |
| @@ -47,7 +56,7 @@ struct dca_ops { | |||
| 47 | struct dca_provider *alloc_dca_provider(struct dca_ops *ops, int priv_size); | 56 | struct dca_provider *alloc_dca_provider(struct dca_ops *ops, int priv_size); |
| 48 | void free_dca_provider(struct dca_provider *dca); | 57 | void free_dca_provider(struct dca_provider *dca); |
| 49 | int register_dca_provider(struct dca_provider *dca, struct device *dev); | 58 | int register_dca_provider(struct dca_provider *dca, struct device *dev); |
| 50 | void unregister_dca_provider(struct dca_provider *dca); | 59 | void unregister_dca_provider(struct dca_provider *dca, struct device *dev); |
| 51 | 60 | ||
| 52 | static inline void *dca_priv(struct dca_provider *dca) | 61 | static inline void *dca_priv(struct dca_provider *dca) |
| 53 | { | 62 | { |
diff --git a/include/linux/dcbnl.h b/include/linux/dcbnl.h index 7d2e10006188..b7cdbb4373df 100644 --- a/include/linux/dcbnl.h +++ b/include/linux/dcbnl.h | |||
| @@ -50,6 +50,8 @@ struct dcbmsg { | |||
| 50 | * @DCB_CMD_SNUMTCS: set the number of traffic classes | 50 | * @DCB_CMD_SNUMTCS: set the number of traffic classes |
| 51 | * @DCB_CMD_GBCN: set backward congestion notification configuration | 51 | * @DCB_CMD_GBCN: set backward congestion notification configuration |
| 52 | * @DCB_CMD_SBCN: get backward congestion notification configration. | 52 | * @DCB_CMD_SBCN: get backward congestion notification configration. |
| 53 | * @DCB_CMD_GAPP: get application protocol configuration | ||
| 54 | * @DCB_CMD_SAPP: set application protocol configuration | ||
| 53 | */ | 55 | */ |
| 54 | enum dcbnl_commands { | 56 | enum dcbnl_commands { |
| 55 | DCB_CMD_UNDEFINED, | 57 | DCB_CMD_UNDEFINED, |
| @@ -80,6 +82,9 @@ enum dcbnl_commands { | |||
| 80 | DCB_CMD_BCN_GCFG, | 82 | DCB_CMD_BCN_GCFG, |
| 81 | DCB_CMD_BCN_SCFG, | 83 | DCB_CMD_BCN_SCFG, |
| 82 | 84 | ||
| 85 | DCB_CMD_GAPP, | ||
| 86 | DCB_CMD_SAPP, | ||
| 87 | |||
| 83 | __DCB_CMD_ENUM_MAX, | 88 | __DCB_CMD_ENUM_MAX, |
| 84 | DCB_CMD_MAX = __DCB_CMD_ENUM_MAX - 1, | 89 | DCB_CMD_MAX = __DCB_CMD_ENUM_MAX - 1, |
| 85 | }; | 90 | }; |
| @@ -114,6 +119,7 @@ enum dcbnl_attrs { | |||
| 114 | DCB_ATTR_CAP, | 119 | DCB_ATTR_CAP, |
| 115 | DCB_ATTR_NUMTCS, | 120 | DCB_ATTR_NUMTCS, |
| 116 | DCB_ATTR_BCN, | 121 | DCB_ATTR_BCN, |
| 122 | DCB_ATTR_APP, | ||
| 117 | 123 | ||
| 118 | __DCB_ATTR_ENUM_MAX, | 124 | __DCB_ATTR_ENUM_MAX, |
| 119 | DCB_ATTR_MAX = __DCB_ATTR_ENUM_MAX - 1, | 125 | DCB_ATTR_MAX = __DCB_ATTR_ENUM_MAX - 1, |
| @@ -338,5 +344,17 @@ enum dcb_general_attr_values { | |||
| 338 | DCB_ATTR_VALUE_UNDEFINED = 0xff | 344 | DCB_ATTR_VALUE_UNDEFINED = 0xff |
| 339 | }; | 345 | }; |
| 340 | 346 | ||
| 347 | #define DCB_APP_IDTYPE_ETHTYPE 0x00 | ||
| 348 | #define DCB_APP_IDTYPE_PORTNUM 0x01 | ||
| 349 | enum dcbnl_app_attrs { | ||
| 350 | DCB_APP_ATTR_UNDEFINED, | ||
| 351 | |||
| 352 | DCB_APP_ATTR_IDTYPE, | ||
| 353 | DCB_APP_ATTR_ID, | ||
| 354 | DCB_APP_ATTR_PRIORITY, | ||
| 355 | |||
| 356 | __DCB_APP_ATTR_ENUM_MAX, | ||
| 357 | DCB_APP_ATTR_MAX = __DCB_APP_ATTR_ENUM_MAX - 1, | ||
| 358 | }; | ||
| 341 | 359 | ||
| 342 | #endif /* __LINUX_DCBNL_H__ */ | 360 | #endif /* __LINUX_DCBNL_H__ */ |
diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h index eb5c2ba2f81a..fc1b930f246c 100644 --- a/include/linux/debugfs.h +++ b/include/linux/debugfs.h | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | * 2 as published by the Free Software Foundation. | 9 | * 2 as published by the Free Software Foundation. |
| 10 | * | 10 | * |
| 11 | * debugfs is for people to use instead of /proc or /sys. | 11 | * debugfs is for people to use instead of /proc or /sys. |
| 12 | * See Documentation/DocBook/kernel-api for more details. | 12 | * See Documentation/DocBook/filesystems for more details. |
| 13 | */ | 13 | */ |
| 14 | 14 | ||
| 15 | #ifndef _DEBUGFS_H_ | 15 | #ifndef _DEBUGFS_H_ |
diff --git a/include/linux/delayacct.h b/include/linux/delayacct.h index f352f06fa063..5076fe0c8a96 100644 --- a/include/linux/delayacct.h +++ b/include/linux/delayacct.h | |||
| @@ -18,7 +18,6 @@ | |||
| 18 | #define _LINUX_DELAYACCT_H | 18 | #define _LINUX_DELAYACCT_H |
| 19 | 19 | ||
| 20 | #include <linux/sched.h> | 20 | #include <linux/sched.h> |
| 21 | #include <linux/taskstats_kern.h> | ||
| 22 | 21 | ||
| 23 | /* | 22 | /* |
| 24 | * Per-task flags relevant to delay accounting | 23 | * Per-task flags relevant to delay accounting |
diff --git a/include/linux/device.h b/include/linux/device.h index aebb81036db2..2ea3e4921812 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
| @@ -2,7 +2,8 @@ | |||
| 2 | * device.h - generic, centralized driver model | 2 | * device.h - generic, centralized driver model |
| 3 | * | 3 | * |
| 4 | * Copyright (c) 2001-2003 Patrick Mochel <mochel@osdl.org> | 4 | * Copyright (c) 2001-2003 Patrick Mochel <mochel@osdl.org> |
| 5 | * Copyright (c) 2004-2007 Greg Kroah-Hartman <gregkh@suse.de> | 5 | * Copyright (c) 2004-2009 Greg Kroah-Hartman <gregkh@suse.de> |
| 6 | * Copyright (c) 2008-2009 Novell Inc. | ||
| 6 | * | 7 | * |
| 7 | * This file is released under the GPLv2 | 8 | * This file is released under the GPLv2 |
| 8 | * | 9 | * |
| @@ -62,7 +63,7 @@ struct bus_type { | |||
| 62 | int (*suspend)(struct device *dev, pm_message_t state); | 63 | int (*suspend)(struct device *dev, pm_message_t state); |
| 63 | int (*resume)(struct device *dev); | 64 | int (*resume)(struct device *dev); |
| 64 | 65 | ||
| 65 | struct dev_pm_ops *pm; | 66 | const struct dev_pm_ops *pm; |
| 66 | 67 | ||
| 67 | struct bus_type_private *p; | 68 | struct bus_type_private *p; |
| 68 | }; | 69 | }; |
| @@ -123,16 +124,18 @@ struct device_driver { | |||
| 123 | struct bus_type *bus; | 124 | struct bus_type *bus; |
| 124 | 125 | ||
| 125 | struct module *owner; | 126 | struct module *owner; |
| 126 | const char *mod_name; /* used for built-in modules */ | 127 | const char *mod_name; /* used for built-in modules */ |
| 128 | |||
| 129 | bool suppress_bind_attrs; /* disables bind/unbind via sysfs */ | ||
| 127 | 130 | ||
| 128 | int (*probe) (struct device *dev); | 131 | int (*probe) (struct device *dev); |
| 129 | int (*remove) (struct device *dev); | 132 | int (*remove) (struct device *dev); |
| 130 | void (*shutdown) (struct device *dev); | 133 | void (*shutdown) (struct device *dev); |
| 131 | int (*suspend) (struct device *dev, pm_message_t state); | 134 | int (*suspend) (struct device *dev, pm_message_t state); |
| 132 | int (*resume) (struct device *dev); | 135 | int (*resume) (struct device *dev); |
| 133 | struct attribute_group **groups; | 136 | const struct attribute_group **groups; |
| 134 | 137 | ||
| 135 | struct dev_pm_ops *pm; | 138 | const struct dev_pm_ops *pm; |
| 136 | 139 | ||
| 137 | struct driver_private *p; | 140 | struct driver_private *p; |
| 138 | }; | 141 | }; |
| @@ -192,7 +195,7 @@ struct class { | |||
| 192 | struct kobject *dev_kobj; | 195 | struct kobject *dev_kobj; |
| 193 | 196 | ||
| 194 | int (*dev_uevent)(struct device *dev, struct kobj_uevent_env *env); | 197 | int (*dev_uevent)(struct device *dev, struct kobj_uevent_env *env); |
| 195 | char *(*nodename)(struct device *dev); | 198 | char *(*devnode)(struct device *dev, mode_t *mode); |
| 196 | 199 | ||
| 197 | void (*class_release)(struct class *class); | 200 | void (*class_release)(struct class *class); |
| 198 | void (*dev_release)(struct device *dev); | 201 | void (*dev_release)(struct device *dev); |
| @@ -200,7 +203,8 @@ struct class { | |||
| 200 | int (*suspend)(struct device *dev, pm_message_t state); | 203 | int (*suspend)(struct device *dev, pm_message_t state); |
| 201 | int (*resume)(struct device *dev); | 204 | int (*resume)(struct device *dev); |
| 202 | 205 | ||
| 203 | struct dev_pm_ops *pm; | 206 | const struct dev_pm_ops *pm; |
| 207 | |||
| 204 | struct class_private *p; | 208 | struct class_private *p; |
| 205 | }; | 209 | }; |
| 206 | 210 | ||
| @@ -223,6 +227,14 @@ extern void class_unregister(struct class *class); | |||
| 223 | __class_register(class, &__key); \ | 227 | __class_register(class, &__key); \ |
| 224 | }) | 228 | }) |
| 225 | 229 | ||
| 230 | struct class_compat; | ||
| 231 | struct class_compat *class_compat_register(const char *name); | ||
| 232 | void class_compat_unregister(struct class_compat *cls); | ||
| 233 | int class_compat_create_link(struct class_compat *cls, struct device *dev, | ||
| 234 | struct device *device_link); | ||
| 235 | void class_compat_remove_link(struct class_compat *cls, struct device *dev, | ||
| 236 | struct device *device_link); | ||
| 237 | |||
| 226 | extern void class_dev_iter_init(struct class_dev_iter *iter, | 238 | extern void class_dev_iter_init(struct class_dev_iter *iter, |
| 227 | struct class *class, | 239 | struct class *class, |
| 228 | struct device *start, | 240 | struct device *start, |
| @@ -286,12 +298,12 @@ extern void class_destroy(struct class *cls); | |||
| 286 | */ | 298 | */ |
| 287 | struct device_type { | 299 | struct device_type { |
| 288 | const char *name; | 300 | const char *name; |
| 289 | struct attribute_group **groups; | 301 | const struct attribute_group **groups; |
| 290 | int (*uevent)(struct device *dev, struct kobj_uevent_env *env); | 302 | int (*uevent)(struct device *dev, struct kobj_uevent_env *env); |
| 291 | char *(*nodename)(struct device *dev); | 303 | char *(*devnode)(struct device *dev, mode_t *mode); |
| 292 | void (*release)(struct device *dev); | 304 | void (*release)(struct device *dev); |
| 293 | 305 | ||
| 294 | struct dev_pm_ops *pm; | 306 | const struct dev_pm_ops *pm; |
| 295 | }; | 307 | }; |
| 296 | 308 | ||
| 297 | /* interface for exporting device attributes */ | 309 | /* interface for exporting device attributes */ |
| @@ -380,7 +392,6 @@ struct device { | |||
| 380 | struct bus_type *bus; /* type of bus device is on */ | 392 | struct bus_type *bus; /* type of bus device is on */ |
| 381 | struct device_driver *driver; /* which driver has allocated this | 393 | struct device_driver *driver; /* which driver has allocated this |
| 382 | device */ | 394 | device */ |
| 383 | void *driver_data; /* data private to the driver */ | ||
| 384 | void *platform_data; /* Platform specific data, device | 395 | void *platform_data; /* Platform specific data, device |
| 385 | core doesn't touch it */ | 396 | core doesn't touch it */ |
| 386 | struct dev_pm_info power; | 397 | struct dev_pm_info power; |
| @@ -411,7 +422,7 @@ struct device { | |||
| 411 | 422 | ||
| 412 | struct klist_node knode_class; | 423 | struct klist_node knode_class; |
| 413 | struct class *class; | 424 | struct class *class; |
| 414 | struct attribute_group **groups; /* optional groups */ | 425 | const struct attribute_group **groups; /* optional groups */ |
| 415 | 426 | ||
| 416 | void (*release)(struct device *dev); | 427 | void (*release)(struct device *dev); |
| 417 | }; | 428 | }; |
| @@ -446,16 +457,6 @@ static inline void set_dev_node(struct device *dev, int node) | |||
| 446 | } | 457 | } |
| 447 | #endif | 458 | #endif |
| 448 | 459 | ||
| 449 | static inline void *dev_get_drvdata(const struct device *dev) | ||
| 450 | { | ||
| 451 | return dev->driver_data; | ||
| 452 | } | ||
| 453 | |||
| 454 | static inline void dev_set_drvdata(struct device *dev, void *data) | ||
| 455 | { | ||
| 456 | dev->driver_data = data; | ||
| 457 | } | ||
| 458 | |||
| 459 | static inline unsigned int dev_get_uevent_suppress(const struct device *dev) | 460 | static inline unsigned int dev_get_uevent_suppress(const struct device *dev) |
| 460 | { | 461 | { |
| 461 | return dev->kobj.uevent_suppress; | 462 | return dev->kobj.uevent_suppress; |
| @@ -488,7 +489,10 @@ extern struct device *device_find_child(struct device *dev, void *data, | |||
| 488 | extern int device_rename(struct device *dev, char *new_name); | 489 | extern int device_rename(struct device *dev, char *new_name); |
| 489 | extern int device_move(struct device *dev, struct device *new_parent, | 490 | extern int device_move(struct device *dev, struct device *new_parent, |
| 490 | enum dpm_order dpm_order); | 491 | enum dpm_order dpm_order); |
| 491 | extern const char *device_get_nodename(struct device *dev, const char **tmp); | 492 | extern const char *device_get_devnode(struct device *dev, |
| 493 | mode_t *mode, const char **tmp); | ||
| 494 | extern void *dev_get_drvdata(const struct device *dev); | ||
| 495 | extern void dev_set_drvdata(struct device *dev, void *data); | ||
| 492 | 496 | ||
| 493 | /* | 497 | /* |
| 494 | * Root device objects for grouping under /sys/devices | 498 | * Root device objects for grouping under /sys/devices |
| @@ -501,6 +505,11 @@ static inline struct device *root_device_register(const char *name) | |||
| 501 | } | 505 | } |
| 502 | extern void root_device_unregister(struct device *root); | 506 | extern void root_device_unregister(struct device *root); |
| 503 | 507 | ||
| 508 | static inline void *dev_get_platdata(const struct device *dev) | ||
| 509 | { | ||
| 510 | return dev->platform_data; | ||
| 511 | } | ||
| 512 | |||
| 504 | /* | 513 | /* |
| 505 | * Manual binding of a device to driver. See drivers/base/bus.c | 514 | * Manual binding of a device to driver. See drivers/base/bus.c |
| 506 | * for information on use. | 515 | * for information on use. |
| @@ -546,6 +555,16 @@ extern void put_device(struct device *dev); | |||
| 546 | 555 | ||
| 547 | extern void wait_for_device_probe(void); | 556 | extern void wait_for_device_probe(void); |
| 548 | 557 | ||
| 558 | #ifdef CONFIG_DEVTMPFS | ||
| 559 | extern int devtmpfs_create_node(struct device *dev); | ||
| 560 | extern int devtmpfs_delete_node(struct device *dev); | ||
| 561 | extern int devtmpfs_mount(const char *mountpoint); | ||
| 562 | #else | ||
| 563 | static inline int devtmpfs_create_node(struct device *dev) { return 0; } | ||
| 564 | static inline int devtmpfs_delete_node(struct device *dev) { return 0; } | ||
| 565 | static inline int devtmpfs_mount(const char *mountpoint) { return 0; } | ||
| 566 | #endif | ||
| 567 | |||
| 549 | /* drivers/base/power/shutdown.c */ | 568 | /* drivers/base/power/shutdown.c */ |
| 550 | extern void device_shutdown(void); | 569 | extern void device_shutdown(void); |
| 551 | 570 | ||
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index c0f6c3cd788c..91b761846061 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h | |||
| @@ -58,6 +58,7 @@ struct dma_map_ops { | |||
| 58 | enum dma_data_direction dir); | 58 | enum dma_data_direction dir); |
| 59 | int (*mapping_error)(struct device *dev, dma_addr_t dma_addr); | 59 | int (*mapping_error)(struct device *dev, dma_addr_t dma_addr); |
| 60 | int (*dma_supported)(struct device *dev, u64 mask); | 60 | int (*dma_supported)(struct device *dev, u64 mask); |
| 61 | int (*set_dma_mask)(struct device *dev, u64 mask); | ||
| 61 | int is_phys; | 62 | int is_phys; |
| 62 | }; | 63 | }; |
| 63 | 64 | ||
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index ffefba81c818..2b9f2ac7ed60 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h | |||
| @@ -48,19 +48,20 @@ enum dma_status { | |||
| 48 | 48 | ||
| 49 | /** | 49 | /** |
| 50 | * enum dma_transaction_type - DMA transaction types/indexes | 50 | * enum dma_transaction_type - DMA transaction types/indexes |
| 51 | * | ||
| 52 | * Note: The DMA_ASYNC_TX capability is not to be set by drivers. It is | ||
| 53 | * automatically set as dma devices are registered. | ||
| 51 | */ | 54 | */ |
| 52 | enum dma_transaction_type { | 55 | enum dma_transaction_type { |
| 53 | DMA_MEMCPY, | 56 | DMA_MEMCPY, |
| 54 | DMA_XOR, | 57 | DMA_XOR, |
| 55 | DMA_PQ_XOR, | 58 | DMA_PQ, |
| 56 | DMA_DUAL_XOR, | 59 | DMA_XOR_VAL, |
| 57 | DMA_PQ_UPDATE, | 60 | DMA_PQ_VAL, |
| 58 | DMA_ZERO_SUM, | ||
| 59 | DMA_PQ_ZERO_SUM, | ||
| 60 | DMA_MEMSET, | 61 | DMA_MEMSET, |
| 61 | DMA_MEMCPY_CRC32C, | ||
| 62 | DMA_INTERRUPT, | 62 | DMA_INTERRUPT, |
| 63 | DMA_PRIVATE, | 63 | DMA_PRIVATE, |
| 64 | DMA_ASYNC_TX, | ||
| 64 | DMA_SLAVE, | 65 | DMA_SLAVE, |
| 65 | }; | 66 | }; |
| 66 | 67 | ||
| @@ -70,18 +71,25 @@ enum dma_transaction_type { | |||
| 70 | 71 | ||
| 71 | /** | 72 | /** |
| 72 | * enum dma_ctrl_flags - DMA flags to augment operation preparation, | 73 | * enum dma_ctrl_flags - DMA flags to augment operation preparation, |
| 73 | * control completion, and communicate status. | 74 | * control completion, and communicate status. |
| 74 | * @DMA_PREP_INTERRUPT - trigger an interrupt (callback) upon completion of | 75 | * @DMA_PREP_INTERRUPT - trigger an interrupt (callback) upon completion of |
| 75 | * this transaction | 76 | * this transaction |
| 76 | * @DMA_CTRL_ACK - the descriptor cannot be reused until the client | 77 | * @DMA_CTRL_ACK - the descriptor cannot be reused until the client |
| 77 | * acknowledges receipt, i.e. has has a chance to establish any | 78 | * acknowledges receipt, i.e. has has a chance to establish any dependency |
| 78 | * dependency chains | 79 | * chains |
| 79 | * @DMA_COMPL_SKIP_SRC_UNMAP - set to disable dma-unmapping the source buffer(s) | 80 | * @DMA_COMPL_SKIP_SRC_UNMAP - set to disable dma-unmapping the source buffer(s) |
| 80 | * @DMA_COMPL_SKIP_DEST_UNMAP - set to disable dma-unmapping the destination(s) | 81 | * @DMA_COMPL_SKIP_DEST_UNMAP - set to disable dma-unmapping the destination(s) |
| 81 | * @DMA_COMPL_SRC_UNMAP_SINGLE - set to do the source dma-unmapping as single | 82 | * @DMA_COMPL_SRC_UNMAP_SINGLE - set to do the source dma-unmapping as single |
| 82 | * (if not set, do the source dma-unmapping as page) | 83 | * (if not set, do the source dma-unmapping as page) |
| 83 | * @DMA_COMPL_DEST_UNMAP_SINGLE - set to do the destination dma-unmapping as single | 84 | * @DMA_COMPL_DEST_UNMAP_SINGLE - set to do the destination dma-unmapping as single |
| 84 | * (if not set, do the destination dma-unmapping as page) | 85 | * (if not set, do the destination dma-unmapping as page) |
| 86 | * @DMA_PREP_PQ_DISABLE_P - prevent generation of P while generating Q | ||
| 87 | * @DMA_PREP_PQ_DISABLE_Q - prevent generation of Q while generating P | ||
| 88 | * @DMA_PREP_CONTINUE - indicate to a driver that it is reusing buffers as | ||
| 89 | * sources that were the result of a previous operation, in the case of a PQ | ||
| 90 | * operation it continues the calculation with new sources | ||
| 91 | * @DMA_PREP_FENCE - tell the driver that subsequent operations depend | ||
| 92 | * on the result of this operation | ||
| 85 | */ | 93 | */ |
| 86 | enum dma_ctrl_flags { | 94 | enum dma_ctrl_flags { |
| 87 | DMA_PREP_INTERRUPT = (1 << 0), | 95 | DMA_PREP_INTERRUPT = (1 << 0), |
| @@ -90,9 +98,32 @@ enum dma_ctrl_flags { | |||
| 90 | DMA_COMPL_SKIP_DEST_UNMAP = (1 << 3), | 98 | DMA_COMPL_SKIP_DEST_UNMAP = (1 << 3), |
| 91 | DMA_COMPL_SRC_UNMAP_SINGLE = (1 << 4), | 99 | DMA_COMPL_SRC_UNMAP_SINGLE = (1 << 4), |
| 92 | DMA_COMPL_DEST_UNMAP_SINGLE = (1 << 5), | 100 | DMA_COMPL_DEST_UNMAP_SINGLE = (1 << 5), |
| 101 | DMA_PREP_PQ_DISABLE_P = (1 << 6), | ||
| 102 | DMA_PREP_PQ_DISABLE_Q = (1 << 7), | ||
| 103 | DMA_PREP_CONTINUE = (1 << 8), | ||
| 104 | DMA_PREP_FENCE = (1 << 9), | ||
| 93 | }; | 105 | }; |
| 94 | 106 | ||
| 95 | /** | 107 | /** |
| 108 | * enum sum_check_bits - bit position of pq_check_flags | ||
| 109 | */ | ||
| 110 | enum sum_check_bits { | ||
| 111 | SUM_CHECK_P = 0, | ||
| 112 | SUM_CHECK_Q = 1, | ||
| 113 | }; | ||
| 114 | |||
| 115 | /** | ||
| 116 | * enum pq_check_flags - result of async_{xor,pq}_zero_sum operations | ||
| 117 | * @SUM_CHECK_P_RESULT - 1 if xor zero sum error, 0 otherwise | ||
| 118 | * @SUM_CHECK_Q_RESULT - 1 if reed-solomon zero sum error, 0 otherwise | ||
| 119 | */ | ||
| 120 | enum sum_check_flags { | ||
| 121 | SUM_CHECK_P_RESULT = (1 << SUM_CHECK_P), | ||
| 122 | SUM_CHECK_Q_RESULT = (1 << SUM_CHECK_Q), | ||
| 123 | }; | ||
| 124 | |||
| 125 | |||
| 126 | /** | ||
| 96 | * dma_cap_mask_t - capabilities bitmap modeled after cpumask_t. | 127 | * dma_cap_mask_t - capabilities bitmap modeled after cpumask_t. |
| 97 | * See linux/cpumask.h | 128 | * See linux/cpumask.h |
| 98 | */ | 129 | */ |
| @@ -180,8 +211,6 @@ typedef void (*dma_async_tx_callback)(void *dma_async_param); | |||
| 180 | * @flags: flags to augment operation preparation, control completion, and | 211 | * @flags: flags to augment operation preparation, control completion, and |
| 181 | * communicate status | 212 | * communicate status |
| 182 | * @phys: physical address of the descriptor | 213 | * @phys: physical address of the descriptor |
| 183 | * @tx_list: driver common field for operations that require multiple | ||
| 184 | * descriptors | ||
| 185 | * @chan: target channel for this operation | 214 | * @chan: target channel for this operation |
| 186 | * @tx_submit: set the prepared descriptor(s) to be executed by the engine | 215 | * @tx_submit: set the prepared descriptor(s) to be executed by the engine |
| 187 | * @callback: routine to call after this operation is complete | 216 | * @callback: routine to call after this operation is complete |
| @@ -195,7 +224,6 @@ struct dma_async_tx_descriptor { | |||
| 195 | dma_cookie_t cookie; | 224 | dma_cookie_t cookie; |
| 196 | enum dma_ctrl_flags flags; /* not a 'long' to pack with cookie */ | 225 | enum dma_ctrl_flags flags; /* not a 'long' to pack with cookie */ |
| 197 | dma_addr_t phys; | 226 | dma_addr_t phys; |
| 198 | struct list_head tx_list; | ||
| 199 | struct dma_chan *chan; | 227 | struct dma_chan *chan; |
| 200 | dma_cookie_t (*tx_submit)(struct dma_async_tx_descriptor *tx); | 228 | dma_cookie_t (*tx_submit)(struct dma_async_tx_descriptor *tx); |
| 201 | dma_async_tx_callback callback; | 229 | dma_async_tx_callback callback; |
| @@ -213,6 +241,11 @@ struct dma_async_tx_descriptor { | |||
| 213 | * @global_node: list_head for global dma_device_list | 241 | * @global_node: list_head for global dma_device_list |
| 214 | * @cap_mask: one or more dma_capability flags | 242 | * @cap_mask: one or more dma_capability flags |
| 215 | * @max_xor: maximum number of xor sources, 0 if no capability | 243 | * @max_xor: maximum number of xor sources, 0 if no capability |
| 244 | * @max_pq: maximum number of PQ sources and PQ-continue capability | ||
| 245 | * @copy_align: alignment shift for memcpy operations | ||
| 246 | * @xor_align: alignment shift for xor operations | ||
| 247 | * @pq_align: alignment shift for pq operations | ||
| 248 | * @fill_align: alignment shift for memset operations | ||
| 216 | * @dev_id: unique device ID | 249 | * @dev_id: unique device ID |
| 217 | * @dev: struct device reference for dma mapping api | 250 | * @dev: struct device reference for dma mapping api |
| 218 | * @device_alloc_chan_resources: allocate resources and return the | 251 | * @device_alloc_chan_resources: allocate resources and return the |
| @@ -220,7 +253,9 @@ struct dma_async_tx_descriptor { | |||
| 220 | * @device_free_chan_resources: release DMA channel's resources | 253 | * @device_free_chan_resources: release DMA channel's resources |
| 221 | * @device_prep_dma_memcpy: prepares a memcpy operation | 254 | * @device_prep_dma_memcpy: prepares a memcpy operation |
| 222 | * @device_prep_dma_xor: prepares a xor operation | 255 | * @device_prep_dma_xor: prepares a xor operation |
| 223 | * @device_prep_dma_zero_sum: prepares a zero_sum operation | 256 | * @device_prep_dma_xor_val: prepares a xor validation operation |
| 257 | * @device_prep_dma_pq: prepares a pq operation | ||
| 258 | * @device_prep_dma_pq_val: prepares a pqzero_sum operation | ||
| 224 | * @device_prep_dma_memset: prepares a memset operation | 259 | * @device_prep_dma_memset: prepares a memset operation |
| 225 | * @device_prep_dma_interrupt: prepares an end of chain interrupt operation | 260 | * @device_prep_dma_interrupt: prepares an end of chain interrupt operation |
| 226 | * @device_prep_slave_sg: prepares a slave dma operation | 261 | * @device_prep_slave_sg: prepares a slave dma operation |
| @@ -235,7 +270,13 @@ struct dma_device { | |||
| 235 | struct list_head channels; | 270 | struct list_head channels; |
| 236 | struct list_head global_node; | 271 | struct list_head global_node; |
| 237 | dma_cap_mask_t cap_mask; | 272 | dma_cap_mask_t cap_mask; |
| 238 | int max_xor; | 273 | unsigned short max_xor; |
| 274 | unsigned short max_pq; | ||
| 275 | u8 copy_align; | ||
| 276 | u8 xor_align; | ||
| 277 | u8 pq_align; | ||
| 278 | u8 fill_align; | ||
| 279 | #define DMA_HAS_PQ_CONTINUE (1 << 15) | ||
| 239 | 280 | ||
| 240 | int dev_id; | 281 | int dev_id; |
| 241 | struct device *dev; | 282 | struct device *dev; |
| @@ -249,9 +290,17 @@ struct dma_device { | |||
| 249 | struct dma_async_tx_descriptor *(*device_prep_dma_xor)( | 290 | struct dma_async_tx_descriptor *(*device_prep_dma_xor)( |
| 250 | struct dma_chan *chan, dma_addr_t dest, dma_addr_t *src, | 291 | struct dma_chan *chan, dma_addr_t dest, dma_addr_t *src, |
| 251 | unsigned int src_cnt, size_t len, unsigned long flags); | 292 | unsigned int src_cnt, size_t len, unsigned long flags); |
| 252 | struct dma_async_tx_descriptor *(*device_prep_dma_zero_sum)( | 293 | struct dma_async_tx_descriptor *(*device_prep_dma_xor_val)( |
| 253 | struct dma_chan *chan, dma_addr_t *src, unsigned int src_cnt, | 294 | struct dma_chan *chan, dma_addr_t *src, unsigned int src_cnt, |
| 254 | size_t len, u32 *result, unsigned long flags); | 295 | size_t len, enum sum_check_flags *result, unsigned long flags); |
| 296 | struct dma_async_tx_descriptor *(*device_prep_dma_pq)( | ||
| 297 | struct dma_chan *chan, dma_addr_t *dst, dma_addr_t *src, | ||
| 298 | unsigned int src_cnt, const unsigned char *scf, | ||
| 299 | size_t len, unsigned long flags); | ||
| 300 | struct dma_async_tx_descriptor *(*device_prep_dma_pq_val)( | ||
| 301 | struct dma_chan *chan, dma_addr_t *pq, dma_addr_t *src, | ||
| 302 | unsigned int src_cnt, const unsigned char *scf, size_t len, | ||
| 303 | enum sum_check_flags *pqres, unsigned long flags); | ||
| 255 | struct dma_async_tx_descriptor *(*device_prep_dma_memset)( | 304 | struct dma_async_tx_descriptor *(*device_prep_dma_memset)( |
| 256 | struct dma_chan *chan, dma_addr_t dest, int value, size_t len, | 305 | struct dma_chan *chan, dma_addr_t dest, int value, size_t len, |
| 257 | unsigned long flags); | 306 | unsigned long flags); |
| @@ -270,6 +319,96 @@ struct dma_device { | |||
| 270 | void (*device_issue_pending)(struct dma_chan *chan); | 319 | void (*device_issue_pending)(struct dma_chan *chan); |
| 271 | }; | 320 | }; |
| 272 | 321 | ||
| 322 | static inline bool dmaengine_check_align(u8 align, size_t off1, size_t off2, size_t len) | ||
| 323 | { | ||
| 324 | size_t mask; | ||
| 325 | |||
| 326 | if (!align) | ||
| 327 | return true; | ||
| 328 | mask = (1 << align) - 1; | ||
| 329 | if (mask & (off1 | off2 | len)) | ||
| 330 | return false; | ||
| 331 | return true; | ||
| 332 | } | ||
| 333 | |||
| 334 | static inline bool is_dma_copy_aligned(struct dma_device *dev, size_t off1, | ||
| 335 | size_t off2, size_t len) | ||
| 336 | { | ||
| 337 | return dmaengine_check_align(dev->copy_align, off1, off2, len); | ||
| 338 | } | ||
| 339 | |||
| 340 | static inline bool is_dma_xor_aligned(struct dma_device *dev, size_t off1, | ||
| 341 | size_t off2, size_t len) | ||
| 342 | { | ||
| 343 | return dmaengine_check_align(dev->xor_align, off1, off2, len); | ||
| 344 | } | ||
| 345 | |||
| 346 | static inline bool is_dma_pq_aligned(struct dma_device *dev, size_t off1, | ||
| 347 | size_t off2, size_t len) | ||
| 348 | { | ||
| 349 | return dmaengine_check_align(dev->pq_align, off1, off2, len); | ||
| 350 | } | ||
| 351 | |||
| 352 | static inline bool is_dma_fill_aligned(struct dma_device *dev, size_t off1, | ||
| 353 | size_t off2, size_t len) | ||
| 354 | { | ||
| 355 | return dmaengine_check_align(dev->fill_align, off1, off2, len); | ||
| 356 | } | ||
| 357 | |||
| 358 | static inline void | ||
| 359 | dma_set_maxpq(struct dma_device *dma, int maxpq, int has_pq_continue) | ||
| 360 | { | ||
| 361 | dma->max_pq = maxpq; | ||
| 362 | if (has_pq_continue) | ||
| 363 | dma->max_pq |= DMA_HAS_PQ_CONTINUE; | ||
| 364 | } | ||
| 365 | |||
| 366 | static inline bool dmaf_continue(enum dma_ctrl_flags flags) | ||
| 367 | { | ||
| 368 | return (flags & DMA_PREP_CONTINUE) == DMA_PREP_CONTINUE; | ||
| 369 | } | ||
| 370 | |||
| 371 | static inline bool dmaf_p_disabled_continue(enum dma_ctrl_flags flags) | ||
| 372 | { | ||
| 373 | enum dma_ctrl_flags mask = DMA_PREP_CONTINUE | DMA_PREP_PQ_DISABLE_P; | ||
| 374 | |||
| 375 | return (flags & mask) == mask; | ||
| 376 | } | ||
| 377 | |||
| 378 | static inline bool dma_dev_has_pq_continue(struct dma_device *dma) | ||
| 379 | { | ||
| 380 | return (dma->max_pq & DMA_HAS_PQ_CONTINUE) == DMA_HAS_PQ_CONTINUE; | ||
| 381 | } | ||
| 382 | |||
| 383 | static unsigned short dma_dev_to_maxpq(struct dma_device *dma) | ||
| 384 | { | ||
| 385 | return dma->max_pq & ~DMA_HAS_PQ_CONTINUE; | ||
| 386 | } | ||
| 387 | |||
| 388 | /* dma_maxpq - reduce maxpq in the face of continued operations | ||
| 389 | * @dma - dma device with PQ capability | ||
| 390 | * @flags - to check if DMA_PREP_CONTINUE and DMA_PREP_PQ_DISABLE_P are set | ||
| 391 | * | ||
| 392 | * When an engine does not support native continuation we need 3 extra | ||
| 393 | * source slots to reuse P and Q with the following coefficients: | ||
| 394 | * 1/ {00} * P : remove P from Q', but use it as a source for P' | ||
| 395 | * 2/ {01} * Q : use Q to continue Q' calculation | ||
| 396 | * 3/ {00} * Q : subtract Q from P' to cancel (2) | ||
| 397 | * | ||
| 398 | * In the case where P is disabled we only need 1 extra source: | ||
| 399 | * 1/ {01} * Q : use Q to continue Q' calculation | ||
| 400 | */ | ||
| 401 | static inline int dma_maxpq(struct dma_device *dma, enum dma_ctrl_flags flags) | ||
| 402 | { | ||
| 403 | if (dma_dev_has_pq_continue(dma) || !dmaf_continue(flags)) | ||
| 404 | return dma_dev_to_maxpq(dma); | ||
| 405 | else if (dmaf_p_disabled_continue(flags)) | ||
| 406 | return dma_dev_to_maxpq(dma) - 1; | ||
| 407 | else if (dmaf_continue(flags)) | ||
| 408 | return dma_dev_to_maxpq(dma) - 3; | ||
| 409 | BUG(); | ||
| 410 | } | ||
| 411 | |||
| 273 | /* --- public DMA engine API --- */ | 412 | /* --- public DMA engine API --- */ |
| 274 | 413 | ||
| 275 | #ifdef CONFIG_DMA_ENGINE | 414 | #ifdef CONFIG_DMA_ENGINE |
| @@ -299,7 +438,11 @@ static inline void net_dmaengine_put(void) | |||
| 299 | #ifdef CONFIG_ASYNC_TX_DMA | 438 | #ifdef CONFIG_ASYNC_TX_DMA |
| 300 | #define async_dmaengine_get() dmaengine_get() | 439 | #define async_dmaengine_get() dmaengine_get() |
| 301 | #define async_dmaengine_put() dmaengine_put() | 440 | #define async_dmaengine_put() dmaengine_put() |
| 441 | #ifdef CONFIG_ASYNC_TX_DISABLE_CHANNEL_SWITCH | ||
| 442 | #define async_dma_find_channel(type) dma_find_channel(DMA_ASYNC_TX) | ||
| 443 | #else | ||
| 302 | #define async_dma_find_channel(type) dma_find_channel(type) | 444 | #define async_dma_find_channel(type) dma_find_channel(type) |
| 445 | #endif /* CONFIG_ASYNC_TX_DISABLE_CHANNEL_SWITCH */ | ||
| 303 | #else | 446 | #else |
| 304 | static inline void async_dmaengine_get(void) | 447 | static inline void async_dmaengine_get(void) |
| 305 | { | 448 | { |
| @@ -312,7 +455,7 @@ async_dma_find_channel(enum dma_transaction_type type) | |||
| 312 | { | 455 | { |
| 313 | return NULL; | 456 | return NULL; |
| 314 | } | 457 | } |
| 315 | #endif | 458 | #endif /* CONFIG_ASYNC_TX_DMA */ |
| 316 | 459 | ||
| 317 | dma_cookie_t dma_async_memcpy_buf_to_buf(struct dma_chan *chan, | 460 | dma_cookie_t dma_async_memcpy_buf_to_buf(struct dma_chan *chan, |
| 318 | void *dest, void *src, size_t len); | 461 | void *dest, void *src, size_t len); |
diff --git a/include/linux/dmar.h b/include/linux/dmar.h index 4a2b162c256a..5de4c9e5856d 100644 --- a/include/linux/dmar.h +++ b/include/linux/dmar.h | |||
| @@ -208,16 +208,9 @@ struct dmar_atsr_unit { | |||
| 208 | u8 include_all:1; /* include all ports */ | 208 | u8 include_all:1; /* include all ports */ |
| 209 | }; | 209 | }; |
| 210 | 210 | ||
| 211 | /* Intel DMAR initialization functions */ | ||
| 212 | extern int intel_iommu_init(void); | 211 | extern int intel_iommu_init(void); |
| 213 | #else | 212 | #else /* !CONFIG_DMAR: */ |
| 214 | static inline int intel_iommu_init(void) | 213 | static inline int intel_iommu_init(void) { return -ENODEV; } |
| 215 | { | 214 | #endif /* CONFIG_DMAR */ |
| 216 | #ifdef CONFIG_INTR_REMAP | 215 | |
| 217 | return dmar_dev_scope_init(); | ||
| 218 | #else | ||
| 219 | return -ENODEV; | ||
| 220 | #endif | ||
| 221 | } | ||
| 222 | #endif /* !CONFIG_DMAR */ | ||
| 223 | #endif /* __DMAR_H__ */ | 216 | #endif /* __DMAR_H__ */ |
diff --git a/include/linux/dtlk.h b/include/linux/dtlk.h index 2896d90118a9..22a7b9a5f5d1 100644 --- a/include/linux/dtlk.h +++ b/include/linux/dtlk.h | |||
| @@ -1,22 +1,3 @@ | |||
| 1 | #if 0 | ||
| 2 | |||
| 3 | #define TRACE_TXT(text) \ | ||
| 4 | { \ | ||
| 5 | if(dtlk_trace) \ | ||
| 6 | { \ | ||
| 7 | console_print(text); \ | ||
| 8 | console_print("\n"); \ | ||
| 9 | } \ | ||
| 10 | } | ||
| 11 | |||
| 12 | #define TRACE_CHR(chr) \ | ||
| 13 | { \ | ||
| 14 | if(dtlk_trace) \ | ||
| 15 | console_print(chr); \ | ||
| 16 | } \ | ||
| 17 | |||
| 18 | #endif | ||
| 19 | |||
| 20 | #define DTLK_MINOR 0 | 1 | #define DTLK_MINOR 0 |
| 21 | #define DTLK_IO_EXTENT 0x02 | 2 | #define DTLK_IO_EXTENT 0x02 |
| 22 | 3 | ||
diff --git a/include/linux/dvb/dmx.h b/include/linux/dvb/dmx.h index fef943738a24..f078f3ac82d4 100644 --- a/include/linux/dvb/dmx.h +++ b/include/linux/dvb/dmx.h | |||
| @@ -151,5 +151,7 @@ struct dmx_stc { | |||
| 151 | #define DMX_GET_CAPS _IOR('o', 48, dmx_caps_t) | 151 | #define DMX_GET_CAPS _IOR('o', 48, dmx_caps_t) |
| 152 | #define DMX_SET_SOURCE _IOW('o', 49, dmx_source_t) | 152 | #define DMX_SET_SOURCE _IOW('o', 49, dmx_source_t) |
| 153 | #define DMX_GET_STC _IOWR('o', 50, struct dmx_stc) | 153 | #define DMX_GET_STC _IOWR('o', 50, struct dmx_stc) |
| 154 | #define DMX_ADD_PID _IOW('o', 51, __u16) | ||
| 155 | #define DMX_REMOVE_PID _IOW('o', 52, __u16) | ||
| 154 | 156 | ||
| 155 | #endif /*_DVBDMX_H_*/ | 157 | #endif /*_DVBDMX_H_*/ |
diff --git a/include/linux/dvb/frontend.h b/include/linux/dvb/frontend.h index 51c8d2d49e42..b6cb5425cde3 100644 --- a/include/linux/dvb/frontend.h +++ b/include/linux/dvb/frontend.h | |||
| @@ -173,7 +173,8 @@ typedef enum fe_modulation { | |||
| 173 | typedef enum fe_transmit_mode { | 173 | typedef enum fe_transmit_mode { |
| 174 | TRANSMISSION_MODE_2K, | 174 | TRANSMISSION_MODE_2K, |
| 175 | TRANSMISSION_MODE_8K, | 175 | TRANSMISSION_MODE_8K, |
| 176 | TRANSMISSION_MODE_AUTO | 176 | TRANSMISSION_MODE_AUTO, |
| 177 | TRANSMISSION_MODE_4K | ||
| 177 | } fe_transmit_mode_t; | 178 | } fe_transmit_mode_t; |
| 178 | 179 | ||
| 179 | typedef enum fe_bandwidth { | 180 | typedef enum fe_bandwidth { |
| @@ -268,15 +269,42 @@ struct dvb_frontend_event { | |||
| 268 | #define DTV_FE_CAPABILITY 16 | 269 | #define DTV_FE_CAPABILITY 16 |
| 269 | #define DTV_DELIVERY_SYSTEM 17 | 270 | #define DTV_DELIVERY_SYSTEM 17 |
| 270 | 271 | ||
| 271 | #define DTV_API_VERSION 35 | 272 | /* ISDB-T and ISDB-Tsb */ |
| 272 | #define DTV_API_VERSION 35 | 273 | #define DTV_ISDBT_PARTIAL_RECEPTION 18 |
| 273 | #define DTV_CODE_RATE_HP 36 | 274 | #define DTV_ISDBT_SOUND_BROADCASTING 19 |
| 274 | #define DTV_CODE_RATE_LP 37 | ||
| 275 | #define DTV_GUARD_INTERVAL 38 | ||
| 276 | #define DTV_TRANSMISSION_MODE 39 | ||
| 277 | #define DTV_HIERARCHY 40 | ||
| 278 | 275 | ||
| 279 | #define DTV_MAX_COMMAND DTV_HIERARCHY | 276 | #define DTV_ISDBT_SB_SUBCHANNEL_ID 20 |
| 277 | #define DTV_ISDBT_SB_SEGMENT_IDX 21 | ||
| 278 | #define DTV_ISDBT_SB_SEGMENT_COUNT 22 | ||
| 279 | |||
| 280 | #define DTV_ISDBT_LAYERA_FEC 23 | ||
| 281 | #define DTV_ISDBT_LAYERA_MODULATION 24 | ||
| 282 | #define DTV_ISDBT_LAYERA_SEGMENT_COUNT 25 | ||
| 283 | #define DTV_ISDBT_LAYERA_TIME_INTERLEAVING 26 | ||
| 284 | |||
| 285 | #define DTV_ISDBT_LAYERB_FEC 27 | ||
| 286 | #define DTV_ISDBT_LAYERB_MODULATION 28 | ||
| 287 | #define DTV_ISDBT_LAYERB_SEGMENT_COUNT 29 | ||
| 288 | #define DTV_ISDBT_LAYERB_TIME_INTERLEAVING 30 | ||
| 289 | |||
| 290 | #define DTV_ISDBT_LAYERC_FEC 31 | ||
| 291 | #define DTV_ISDBT_LAYERC_MODULATION 32 | ||
| 292 | #define DTV_ISDBT_LAYERC_SEGMENT_COUNT 33 | ||
| 293 | #define DTV_ISDBT_LAYERC_TIME_INTERLEAVING 34 | ||
| 294 | |||
| 295 | #define DTV_API_VERSION 35 | ||
| 296 | |||
| 297 | #define DTV_CODE_RATE_HP 36 | ||
| 298 | #define DTV_CODE_RATE_LP 37 | ||
| 299 | #define DTV_GUARD_INTERVAL 38 | ||
| 300 | #define DTV_TRANSMISSION_MODE 39 | ||
| 301 | #define DTV_HIERARCHY 40 | ||
| 302 | |||
| 303 | #define DTV_ISDBT_LAYER_ENABLED 41 | ||
| 304 | |||
| 305 | #define DTV_ISDBS_TS_ID 42 | ||
| 306 | |||
| 307 | #define DTV_MAX_COMMAND DTV_ISDBS_TS_ID | ||
| 280 | 308 | ||
| 281 | typedef enum fe_pilot { | 309 | typedef enum fe_pilot { |
| 282 | PILOT_ON, | 310 | PILOT_ON, |
diff --git a/include/linux/dvb/version.h b/include/linux/dvb/version.h index 25b823b81734..540b0583d9fb 100644 --- a/include/linux/dvb/version.h +++ b/include/linux/dvb/version.h | |||
| @@ -24,6 +24,6 @@ | |||
| 24 | #define _DVBVERSION_H_ | 24 | #define _DVBVERSION_H_ |
| 25 | 25 | ||
| 26 | #define DVB_API_VERSION 5 | 26 | #define DVB_API_VERSION 5 |
| 27 | #define DVB_API_VERSION_MINOR 0 | 27 | #define DVB_API_VERSION_MINOR 1 |
| 28 | 28 | ||
| 29 | #endif /*_DVBVERSION_H_*/ | 29 | #endif /*_DVBVERSION_H_*/ |
diff --git a/include/linux/elf.h b/include/linux/elf.h index 45a937be6d38..90a4ed0ea0e5 100644 --- a/include/linux/elf.h +++ b/include/linux/elf.h | |||
| @@ -361,6 +361,7 @@ typedef struct elf64_shdr { | |||
| 361 | #define NT_PPC_VSX 0x102 /* PowerPC VSX registers */ | 361 | #define NT_PPC_VSX 0x102 /* PowerPC VSX registers */ |
| 362 | #define NT_386_TLS 0x200 /* i386 TLS slots (struct user_desc) */ | 362 | #define NT_386_TLS 0x200 /* i386 TLS slots (struct user_desc) */ |
| 363 | #define NT_386_IOPERM 0x201 /* x86 io permission bitmap (1=deny) */ | 363 | #define NT_386_IOPERM 0x201 /* x86 io permission bitmap (1=deny) */ |
| 364 | #define NT_PRXSTATUS 0x300 /* s390 upper register halves */ | ||
| 364 | 365 | ||
| 365 | 366 | ||
| 366 | /* Note header in a PT_NOTE section */ | 367 | /* Note header in a PT_NOTE section */ |
diff --git a/include/linux/enclosure.h b/include/linux/enclosure.h index 4332442b1b57..90d1c2184112 100644 --- a/include/linux/enclosure.h +++ b/include/linux/enclosure.h | |||
| @@ -122,8 +122,9 @@ enclosure_component_register(struct enclosure_device *, unsigned int, | |||
| 122 | enum enclosure_component_type, const char *); | 122 | enum enclosure_component_type, const char *); |
| 123 | int enclosure_add_device(struct enclosure_device *enclosure, int component, | 123 | int enclosure_add_device(struct enclosure_device *enclosure, int component, |
| 124 | struct device *dev); | 124 | struct device *dev); |
| 125 | int enclosure_remove_device(struct enclosure_device *enclosure, int component); | 125 | int enclosure_remove_device(struct enclosure_device *, struct device *); |
| 126 | struct enclosure_device *enclosure_find(struct device *dev); | 126 | struct enclosure_device *enclosure_find(struct device *dev, |
| 127 | struct enclosure_device *start); | ||
| 127 | int enclosure_for_each_device(int (*fn)(struct enclosure_device *, void *), | 128 | int enclosure_for_each_device(int (*fn)(struct enclosure_device *, void *), |
| 128 | void *data); | 129 | void *data); |
| 129 | 130 | ||
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index 9b660bd2e2b3..15e4eb713694 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h | |||
| @@ -362,12 +362,25 @@ struct ethtool_rxnfc { | |||
| 362 | __u32 rule_locs[0]; | 362 | __u32 rule_locs[0]; |
| 363 | }; | 363 | }; |
| 364 | 364 | ||
| 365 | #define ETHTOOL_FLASH_MAX_FILENAME 128 | ||
| 366 | enum ethtool_flash_op_type { | ||
| 367 | ETHTOOL_FLASH_ALL_REGIONS = 0, | ||
| 368 | }; | ||
| 369 | |||
| 370 | /* for passing firmware flashing related parameters */ | ||
| 371 | struct ethtool_flash { | ||
| 372 | __u32 cmd; | ||
| 373 | __u32 region; | ||
| 374 | char data[ETHTOOL_FLASH_MAX_FILENAME]; | ||
| 375 | }; | ||
| 376 | |||
| 365 | #ifdef __KERNEL__ | 377 | #ifdef __KERNEL__ |
| 366 | 378 | ||
| 367 | struct net_device; | 379 | struct net_device; |
| 368 | 380 | ||
| 369 | /* Some generic methods drivers may use in their ethtool_ops */ | 381 | /* Some generic methods drivers may use in their ethtool_ops */ |
| 370 | u32 ethtool_op_get_link(struct net_device *dev); | 382 | u32 ethtool_op_get_link(struct net_device *dev); |
| 383 | u32 ethtool_op_get_rx_csum(struct net_device *dev); | ||
| 371 | u32 ethtool_op_get_tx_csum(struct net_device *dev); | 384 | u32 ethtool_op_get_tx_csum(struct net_device *dev); |
| 372 | int ethtool_op_set_tx_csum(struct net_device *dev, u32 data); | 385 | int ethtool_op_set_tx_csum(struct net_device *dev, u32 data); |
| 373 | int ethtool_op_set_tx_hw_csum(struct net_device *dev, u32 data); | 386 | int ethtool_op_set_tx_hw_csum(struct net_device *dev, u32 data); |
| @@ -488,6 +501,7 @@ struct ethtool_ops { | |||
| 488 | int (*get_stats_count)(struct net_device *);/* use get_sset_count */ | 501 | int (*get_stats_count)(struct net_device *);/* use get_sset_count */ |
| 489 | int (*get_rxnfc)(struct net_device *, struct ethtool_rxnfc *, void *); | 502 | int (*get_rxnfc)(struct net_device *, struct ethtool_rxnfc *, void *); |
| 490 | int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *); | 503 | int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *); |
| 504 | int (*flash_device)(struct net_device *, struct ethtool_flash *); | ||
| 491 | }; | 505 | }; |
| 492 | #endif /* __KERNEL__ */ | 506 | #endif /* __KERNEL__ */ |
| 493 | 507 | ||
| @@ -544,6 +558,7 @@ struct ethtool_ops { | |||
| 544 | #define ETHTOOL_GRXCLSRLALL 0x00000030 /* Get all RX classification rule */ | 558 | #define ETHTOOL_GRXCLSRLALL 0x00000030 /* Get all RX classification rule */ |
| 545 | #define ETHTOOL_SRXCLSRLDEL 0x00000031 /* Delete RX classification rule */ | 559 | #define ETHTOOL_SRXCLSRLDEL 0x00000031 /* Delete RX classification rule */ |
| 546 | #define ETHTOOL_SRXCLSRLINS 0x00000032 /* Insert RX classification rule */ | 560 | #define ETHTOOL_SRXCLSRLINS 0x00000032 /* Insert RX classification rule */ |
| 561 | #define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device */ | ||
| 547 | 562 | ||
| 548 | /* compatibility with older code */ | 563 | /* compatibility with older code */ |
| 549 | #define SPARC_ETH_GSET ETHTOOL_GSET | 564 | #define SPARC_ETH_GSET ETHTOOL_GSET |
diff --git a/include/linux/eventfd.h b/include/linux/eventfd.h index 3b85ba6479f4..94dd10366a78 100644 --- a/include/linux/eventfd.h +++ b/include/linux/eventfd.h | |||
| @@ -27,6 +27,7 @@ | |||
| 27 | 27 | ||
| 28 | #ifdef CONFIG_EVENTFD | 28 | #ifdef CONFIG_EVENTFD |
| 29 | 29 | ||
| 30 | struct file *eventfd_file_create(unsigned int count, int flags); | ||
| 30 | struct eventfd_ctx *eventfd_ctx_get(struct eventfd_ctx *ctx); | 31 | struct eventfd_ctx *eventfd_ctx_get(struct eventfd_ctx *ctx); |
| 31 | void eventfd_ctx_put(struct eventfd_ctx *ctx); | 32 | void eventfd_ctx_put(struct eventfd_ctx *ctx); |
| 32 | struct file *eventfd_fget(int fd); | 33 | struct file *eventfd_fget(int fd); |
| @@ -40,6 +41,11 @@ int eventfd_signal(struct eventfd_ctx *ctx, int n); | |||
| 40 | * Ugly ugly ugly error layer to support modules that uses eventfd but | 41 | * Ugly ugly ugly error layer to support modules that uses eventfd but |
| 41 | * pretend to work in !CONFIG_EVENTFD configurations. Namely, AIO. | 42 | * pretend to work in !CONFIG_EVENTFD configurations. Namely, AIO. |
| 42 | */ | 43 | */ |
| 44 | static inline struct file *eventfd_file_create(unsigned int count, int flags) | ||
| 45 | { | ||
| 46 | return ERR_PTR(-ENOSYS); | ||
| 47 | } | ||
| 48 | |||
| 43 | static inline struct eventfd_ctx *eventfd_ctx_fdget(int fd) | 49 | static inline struct eventfd_ctx *eventfd_ctx_fdget(int fd) |
| 44 | { | 50 | { |
| 45 | return ERR_PTR(-ENOSYS); | 51 | return ERR_PTR(-ENOSYS); |
diff --git a/include/linux/ext3_fs_i.h b/include/linux/ext3_fs_i.h index ca1bfe90004f..93e7428156ba 100644 --- a/include/linux/ext3_fs_i.h +++ b/include/linux/ext3_fs_i.h | |||
| @@ -137,6 +137,14 @@ struct ext3_inode_info { | |||
| 137 | * by other means, so we have truncate_mutex. | 137 | * by other means, so we have truncate_mutex. |
| 138 | */ | 138 | */ |
| 139 | struct mutex truncate_mutex; | 139 | struct mutex truncate_mutex; |
| 140 | |||
| 141 | /* | ||
| 142 | * Transactions that contain inode's metadata needed to complete | ||
| 143 | * fsync and fdatasync, respectively. | ||
| 144 | */ | ||
| 145 | atomic_t i_sync_tid; | ||
| 146 | atomic_t i_datasync_tid; | ||
| 147 | |||
| 140 | struct inode vfs_inode; | 148 | struct inode vfs_inode; |
| 141 | }; | 149 | }; |
| 142 | 150 | ||
diff --git a/include/linux/fb.h b/include/linux/fb.h index f847df9e99b6..de9c722e7b90 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
| @@ -133,6 +133,7 @@ struct dentry; | |||
| 133 | #define FB_ACCEL_NEOMAGIC_NM2230 96 /* NeoMagic NM2230 */ | 133 | #define FB_ACCEL_NEOMAGIC_NM2230 96 /* NeoMagic NM2230 */ |
| 134 | #define FB_ACCEL_NEOMAGIC_NM2360 97 /* NeoMagic NM2360 */ | 134 | #define FB_ACCEL_NEOMAGIC_NM2360 97 /* NeoMagic NM2360 */ |
| 135 | #define FB_ACCEL_NEOMAGIC_NM2380 98 /* NeoMagic NM2380 */ | 135 | #define FB_ACCEL_NEOMAGIC_NM2380 98 /* NeoMagic NM2380 */ |
| 136 | #define FB_ACCEL_PXA3XX 99 /* PXA3xx */ | ||
| 136 | 137 | ||
| 137 | #define FB_ACCEL_SAVAGE4 0x80 /* S3 Savage4 */ | 138 | #define FB_ACCEL_SAVAGE4 0x80 /* S3 Savage4 */ |
| 138 | #define FB_ACCEL_SAVAGE3D 0x81 /* S3 Savage3D */ | 139 | #define FB_ACCEL_SAVAGE3D 0x81 /* S3 Savage3D */ |
| @@ -668,12 +669,6 @@ struct fb_ops { | |||
| 668 | /* perform fb specific mmap */ | 669 | /* perform fb specific mmap */ |
| 669 | int (*fb_mmap)(struct fb_info *info, struct vm_area_struct *vma); | 670 | int (*fb_mmap)(struct fb_info *info, struct vm_area_struct *vma); |
| 670 | 671 | ||
| 671 | /* save current hardware state */ | ||
| 672 | void (*fb_save_state)(struct fb_info *info); | ||
| 673 | |||
| 674 | /* restore saved state */ | ||
| 675 | void (*fb_restore_state)(struct fb_info *info); | ||
| 676 | |||
| 677 | /* get capability given var */ | 672 | /* get capability given var */ |
| 678 | void (*fb_get_caps)(struct fb_info *info, struct fb_blit_caps *caps, | 673 | void (*fb_get_caps)(struct fb_info *info, struct fb_blit_caps *caps, |
| 679 | struct fb_var_screeninfo *var); | 674 | struct fb_var_screeninfo *var); |
diff --git a/include/linux/firewire.h b/include/linux/firewire.h index 192d1e43c43c..7e1d4dec83e7 100644 --- a/include/linux/firewire.h +++ b/include/linux/firewire.h | |||
| @@ -134,20 +134,6 @@ struct fw_card { | |||
| 134 | u32 topology_map[(CSR_TOPOLOGY_MAP_END - CSR_TOPOLOGY_MAP) / 4]; | 134 | u32 topology_map[(CSR_TOPOLOGY_MAP_END - CSR_TOPOLOGY_MAP) / 4]; |
| 135 | }; | 135 | }; |
| 136 | 136 | ||
| 137 | static inline struct fw_card *fw_card_get(struct fw_card *card) | ||
| 138 | { | ||
| 139 | kref_get(&card->kref); | ||
| 140 | |||
| 141 | return card; | ||
| 142 | } | ||
| 143 | |||
| 144 | void fw_card_release(struct kref *kref); | ||
| 145 | |||
| 146 | static inline void fw_card_put(struct fw_card *card) | ||
| 147 | { | ||
| 148 | kref_put(&card->kref, fw_card_release); | ||
| 149 | } | ||
| 150 | |||
| 151 | struct fw_attribute_group { | 137 | struct fw_attribute_group { |
| 152 | struct attribute_group *groups[2]; | 138 | struct attribute_group *groups[2]; |
| 153 | struct attribute_group group; | 139 | struct attribute_group group; |
diff --git a/include/linux/flex_array.h b/include/linux/flex_array.h index 45ff18491514..1d747f72298b 100644 --- a/include/linux/flex_array.h +++ b/include/linux/flex_array.h | |||
| @@ -31,10 +31,32 @@ struct flex_array { | |||
| 31 | }; | 31 | }; |
| 32 | }; | 32 | }; |
| 33 | 33 | ||
| 34 | #define FLEX_ARRAY_INIT(size, total) { { {\ | 34 | /* Number of bytes left in base struct flex_array, excluding metadata */ |
| 35 | .element_size = (size), \ | 35 | #define FLEX_ARRAY_BASE_BYTES_LEFT \ |
| 36 | .total_nr_elements = (total), \ | 36 | (FLEX_ARRAY_BASE_SIZE - offsetof(struct flex_array, parts)) |
| 37 | } } } | 37 | |
| 38 | /* Number of pointers in base to struct flex_array_part pages */ | ||
| 39 | #define FLEX_ARRAY_NR_BASE_PTRS \ | ||
| 40 | (FLEX_ARRAY_BASE_BYTES_LEFT / sizeof(struct flex_array_part *)) | ||
| 41 | |||
| 42 | /* Number of elements of size that fit in struct flex_array_part */ | ||
| 43 | #define FLEX_ARRAY_ELEMENTS_PER_PART(size) \ | ||
| 44 | (FLEX_ARRAY_PART_SIZE / size) | ||
| 45 | |||
| 46 | /* | ||
| 47 | * Defines a statically allocated flex array and ensures its parameters are | ||
| 48 | * valid. | ||
| 49 | */ | ||
| 50 | #define DEFINE_FLEX_ARRAY(__arrayname, __element_size, __total) \ | ||
| 51 | struct flex_array __arrayname = { { { \ | ||
| 52 | .element_size = (__element_size), \ | ||
| 53 | .total_nr_elements = (__total), \ | ||
| 54 | } } }; \ | ||
| 55 | static inline void __arrayname##_invalid_parameter(void) \ | ||
| 56 | { \ | ||
| 57 | BUILD_BUG_ON((__total) > FLEX_ARRAY_NR_BASE_PTRS * \ | ||
| 58 | FLEX_ARRAY_ELEMENTS_PER_PART(__element_size)); \ | ||
| 59 | } | ||
| 38 | 60 | ||
| 39 | struct flex_array *flex_array_alloc(int element_size, unsigned int total, | 61 | struct flex_array *flex_array_alloc(int element_size, unsigned int total, |
| 40 | gfp_t flags); | 62 | gfp_t flags); |
| @@ -44,6 +66,8 @@ void flex_array_free(struct flex_array *fa); | |||
| 44 | void flex_array_free_parts(struct flex_array *fa); | 66 | void flex_array_free_parts(struct flex_array *fa); |
| 45 | int flex_array_put(struct flex_array *fa, unsigned int element_nr, void *src, | 67 | int flex_array_put(struct flex_array *fa, unsigned int element_nr, void *src, |
| 46 | gfp_t flags); | 68 | gfp_t flags); |
| 69 | int flex_array_clear(struct flex_array *fa, unsigned int element_nr); | ||
| 47 | void *flex_array_get(struct flex_array *fa, unsigned int element_nr); | 70 | void *flex_array_get(struct flex_array *fa, unsigned int element_nr); |
| 71 | int flex_array_shrink(struct flex_array *fa); | ||
| 48 | 72 | ||
| 49 | #endif /* _FLEX_ARRAY_H */ | 73 | #endif /* _FLEX_ARRAY_H */ |
diff --git a/include/linux/fs.h b/include/linux/fs.h index a79f48373e7e..2620a8c63571 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -161,8 +161,8 @@ struct inodes_stat_t { | |||
| 161 | * These aren't really reads or writes, they pass down information about | 161 | * These aren't really reads or writes, they pass down information about |
| 162 | * parts of device that are now unused by the file system. | 162 | * parts of device that are now unused by the file system. |
| 163 | */ | 163 | */ |
| 164 | #define DISCARD_NOBARRIER (1 << BIO_RW_DISCARD) | 164 | #define DISCARD_NOBARRIER (WRITE | (1 << BIO_RW_DISCARD)) |
| 165 | #define DISCARD_BARRIER ((1 << BIO_RW_DISCARD) | (1 << BIO_RW_BARRIER)) | 165 | #define DISCARD_BARRIER (DISCARD_NOBARRIER | (1 << BIO_RW_BARRIER)) |
| 166 | 166 | ||
| 167 | #define SEL_IN 1 | 167 | #define SEL_IN 1 |
| 168 | #define SEL_OUT 2 | 168 | #define SEL_OUT 2 |
| @@ -300,6 +300,10 @@ struct inodes_stat_t { | |||
| 300 | #define BLKTRACESTOP _IO(0x12,117) | 300 | #define BLKTRACESTOP _IO(0x12,117) |
| 301 | #define BLKTRACETEARDOWN _IO(0x12,118) | 301 | #define BLKTRACETEARDOWN _IO(0x12,118) |
| 302 | #define BLKDISCARD _IO(0x12,119) | 302 | #define BLKDISCARD _IO(0x12,119) |
| 303 | #define BLKIOMIN _IO(0x12,120) | ||
| 304 | #define BLKIOOPT _IO(0x12,121) | ||
| 305 | #define BLKALIGNOFF _IO(0x12,122) | ||
| 306 | #define BLKPBSZGET _IO(0x12,123) | ||
| 303 | 307 | ||
| 304 | #define BMAP_IOCTL 1 /* obsolete - kept for compatibility */ | 308 | #define BMAP_IOCTL 1 /* obsolete - kept for compatibility */ |
| 305 | #define FIBMAP _IO(0x00,1) /* bmap access */ | 309 | #define FIBMAP _IO(0x00,1) /* bmap access */ |
| @@ -595,6 +599,7 @@ struct address_space_operations { | |||
| 595 | int (*launder_page) (struct page *); | 599 | int (*launder_page) (struct page *); |
| 596 | int (*is_partially_uptodate) (struct page *, read_descriptor_t *, | 600 | int (*is_partially_uptodate) (struct page *, read_descriptor_t *, |
| 597 | unsigned long); | 601 | unsigned long); |
| 602 | int (*error_remove_page)(struct address_space *, struct page *); | ||
| 598 | }; | 603 | }; |
| 599 | 604 | ||
| 600 | /* | 605 | /* |
| @@ -640,7 +645,6 @@ struct block_device { | |||
| 640 | struct super_block * bd_super; | 645 | struct super_block * bd_super; |
| 641 | int bd_openers; | 646 | int bd_openers; |
| 642 | struct mutex bd_mutex; /* open/close mutex */ | 647 | struct mutex bd_mutex; /* open/close mutex */ |
| 643 | struct semaphore bd_mount_sem; | ||
| 644 | struct list_head bd_inodes; | 648 | struct list_head bd_inodes; |
| 645 | void * bd_holder; | 649 | void * bd_holder; |
| 646 | int bd_holders; | 650 | int bd_holders; |
| @@ -655,7 +659,6 @@ struct block_device { | |||
| 655 | int bd_invalidated; | 659 | int bd_invalidated; |
| 656 | struct gendisk * bd_disk; | 660 | struct gendisk * bd_disk; |
| 657 | struct list_head bd_list; | 661 | struct list_head bd_list; |
| 658 | struct backing_dev_info *bd_inode_backing_dev_info; | ||
| 659 | /* | 662 | /* |
| 660 | * Private data. You must have bd_claim'ed the block_device | 663 | * Private data. You must have bd_claim'ed the block_device |
| 661 | * to use this. NOTE: bd_claim allows an owner to claim | 664 | * to use this. NOTE: bd_claim allows an owner to claim |
| @@ -1067,8 +1070,8 @@ struct file_lock { | |||
| 1067 | struct fasync_struct * fl_fasync; /* for lease break notifications */ | 1070 | struct fasync_struct * fl_fasync; /* for lease break notifications */ |
| 1068 | unsigned long fl_break_time; /* for nonblocking lease breaks */ | 1071 | unsigned long fl_break_time; /* for nonblocking lease breaks */ |
| 1069 | 1072 | ||
| 1070 | struct file_lock_operations *fl_ops; /* Callbacks for filesystems */ | 1073 | const struct file_lock_operations *fl_ops; /* Callbacks for filesystems */ |
| 1071 | struct lock_manager_operations *fl_lmops; /* Callbacks for lockmanagers */ | 1074 | const struct lock_manager_operations *fl_lmops; /* Callbacks for lockmanagers */ |
| 1072 | union { | 1075 | union { |
| 1073 | struct nfs_lock_info nfs_fl; | 1076 | struct nfs_lock_info nfs_fl; |
| 1074 | struct nfs4_lock_info nfs4_fl; | 1077 | struct nfs4_lock_info nfs4_fl; |
| @@ -1316,11 +1319,11 @@ struct super_block { | |||
| 1316 | unsigned long s_blocksize; | 1319 | unsigned long s_blocksize; |
| 1317 | unsigned char s_blocksize_bits; | 1320 | unsigned char s_blocksize_bits; |
| 1318 | unsigned char s_dirt; | 1321 | unsigned char s_dirt; |
| 1319 | unsigned long long s_maxbytes; /* Max file size */ | 1322 | loff_t s_maxbytes; /* Max file size */ |
| 1320 | struct file_system_type *s_type; | 1323 | struct file_system_type *s_type; |
| 1321 | const struct super_operations *s_op; | 1324 | const struct super_operations *s_op; |
| 1322 | struct dquot_operations *dq_op; | 1325 | const struct dquot_operations *dq_op; |
| 1323 | struct quotactl_ops *s_qcop; | 1326 | const struct quotactl_ops *s_qcop; |
| 1324 | const struct export_operations *s_export_op; | 1327 | const struct export_operations *s_export_op; |
| 1325 | unsigned long s_flags; | 1328 | unsigned long s_flags; |
| 1326 | unsigned long s_magic; | 1329 | unsigned long s_magic; |
| @@ -1343,6 +1346,7 @@ struct super_block { | |||
| 1343 | int s_nr_dentry_unused; /* # of dentry on lru */ | 1346 | int s_nr_dentry_unused; /* # of dentry on lru */ |
| 1344 | 1347 | ||
| 1345 | struct block_device *s_bdev; | 1348 | struct block_device *s_bdev; |
| 1349 | struct backing_dev_info *s_bdi; | ||
| 1346 | struct mtd_info *s_mtd; | 1350 | struct mtd_info *s_mtd; |
| 1347 | struct list_head s_instances; | 1351 | struct list_head s_instances; |
| 1348 | struct quota_info s_dquot; /* Diskquota specific options */ | 1352 | struct quota_info s_dquot; /* Diskquota specific options */ |
| @@ -1455,11 +1459,6 @@ int fiemap_check_flags(struct fiemap_extent_info *fieinfo, u32 fs_flags); | |||
| 1455 | #define DT_SOCK 12 | 1459 | #define DT_SOCK 12 |
| 1456 | #define DT_WHT 14 | 1460 | #define DT_WHT 14 |
| 1457 | 1461 | ||
| 1458 | #define OSYNC_METADATA (1<<0) | ||
| 1459 | #define OSYNC_DATA (1<<1) | ||
| 1460 | #define OSYNC_INODE (1<<2) | ||
| 1461 | int generic_osync_inode(struct inode *, struct address_space *, int); | ||
| 1462 | |||
| 1463 | /* | 1462 | /* |
| 1464 | * This is the "filldir" function type, used by readdir() to let | 1463 | * This is the "filldir" function type, used by readdir() to let |
| 1465 | * the kernel specify what kind of dirent layout it wants to have. | 1464 | * the kernel specify what kind of dirent layout it wants to have. |
| @@ -2086,6 +2085,8 @@ extern int write_inode_now(struct inode *, int); | |||
| 2086 | extern int filemap_fdatawrite(struct address_space *); | 2085 | extern int filemap_fdatawrite(struct address_space *); |
| 2087 | extern int filemap_flush(struct address_space *); | 2086 | extern int filemap_flush(struct address_space *); |
| 2088 | extern int filemap_fdatawait(struct address_space *); | 2087 | extern int filemap_fdatawait(struct address_space *); |
| 2088 | extern int filemap_fdatawait_range(struct address_space *, loff_t lstart, | ||
| 2089 | loff_t lend); | ||
| 2089 | extern int filemap_write_and_wait(struct address_space *mapping); | 2090 | extern int filemap_write_and_wait(struct address_space *mapping); |
| 2090 | extern int filemap_write_and_wait_range(struct address_space *mapping, | 2091 | extern int filemap_write_and_wait_range(struct address_space *mapping, |
| 2091 | loff_t lstart, loff_t lend); | 2092 | loff_t lstart, loff_t lend); |
| @@ -2096,7 +2097,10 @@ extern int __filemap_fdatawrite_range(struct address_space *mapping, | |||
| 2096 | extern int filemap_fdatawrite_range(struct address_space *mapping, | 2097 | extern int filemap_fdatawrite_range(struct address_space *mapping, |
| 2097 | loff_t start, loff_t end); | 2098 | loff_t start, loff_t end); |
| 2098 | 2099 | ||
| 2100 | extern int vfs_fsync_range(struct file *file, struct dentry *dentry, | ||
| 2101 | loff_t start, loff_t end, int datasync); | ||
| 2099 | extern int vfs_fsync(struct file *file, struct dentry *dentry, int datasync); | 2102 | extern int vfs_fsync(struct file *file, struct dentry *dentry, int datasync); |
| 2103 | extern int generic_write_sync(struct file *file, loff_t pos, loff_t count); | ||
| 2100 | extern void sync_supers(void); | 2104 | extern void sync_supers(void); |
| 2101 | extern void emergency_sync(void); | 2105 | extern void emergency_sync(void); |
| 2102 | extern void emergency_remount(void); | 2106 | extern void emergency_remount(void); |
| @@ -2156,6 +2160,7 @@ extern ino_t iunique(struct super_block *, ino_t); | |||
| 2156 | extern int inode_needs_sync(struct inode *inode); | 2160 | extern int inode_needs_sync(struct inode *inode); |
| 2157 | extern void generic_delete_inode(struct inode *inode); | 2161 | extern void generic_delete_inode(struct inode *inode); |
| 2158 | extern void generic_drop_inode(struct inode *inode); | 2162 | extern void generic_drop_inode(struct inode *inode); |
| 2163 | extern int generic_detach_inode(struct inode *inode); | ||
| 2159 | 2164 | ||
| 2160 | extern struct inode *ilookup5_nowait(struct super_block *sb, | 2165 | extern struct inode *ilookup5_nowait(struct super_block *sb, |
| 2161 | unsigned long hashval, int (*test)(struct inode *, void *), | 2166 | unsigned long hashval, int (*test)(struct inode *, void *), |
| @@ -2202,9 +2207,9 @@ extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *); | |||
| 2202 | extern int file_read_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size); | 2207 | extern int file_read_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size); |
| 2203 | int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk); | 2208 | int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk); |
| 2204 | extern ssize_t generic_file_aio_read(struct kiocb *, const struct iovec *, unsigned long, loff_t); | 2209 | extern ssize_t generic_file_aio_read(struct kiocb *, const struct iovec *, unsigned long, loff_t); |
| 2210 | extern ssize_t __generic_file_aio_write(struct kiocb *, const struct iovec *, unsigned long, | ||
| 2211 | loff_t *); | ||
| 2205 | extern ssize_t generic_file_aio_write(struct kiocb *, const struct iovec *, unsigned long, loff_t); | 2212 | extern ssize_t generic_file_aio_write(struct kiocb *, const struct iovec *, unsigned long, loff_t); |
| 2206 | extern ssize_t generic_file_aio_write_nolock(struct kiocb *, const struct iovec *, | ||
| 2207 | unsigned long, loff_t); | ||
| 2208 | extern ssize_t generic_file_direct_write(struct kiocb *, const struct iovec *, | 2213 | extern ssize_t generic_file_direct_write(struct kiocb *, const struct iovec *, |
| 2209 | unsigned long *, loff_t, loff_t *, size_t, size_t); | 2214 | unsigned long *, loff_t, loff_t *, size_t, size_t); |
| 2210 | extern ssize_t generic_file_buffered_write(struct kiocb *, const struct iovec *, | 2215 | extern ssize_t generic_file_buffered_write(struct kiocb *, const struct iovec *, |
| @@ -2214,6 +2219,10 @@ extern ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t l | |||
| 2214 | extern int generic_segment_checks(const struct iovec *iov, | 2219 | extern int generic_segment_checks(const struct iovec *iov, |
| 2215 | unsigned long *nr_segs, size_t *count, int access_flags); | 2220 | unsigned long *nr_segs, size_t *count, int access_flags); |
| 2216 | 2221 | ||
| 2222 | /* fs/block_dev.c */ | ||
| 2223 | extern ssize_t blkdev_aio_write(struct kiocb *iocb, const struct iovec *iov, | ||
| 2224 | unsigned long nr_segs, loff_t pos); | ||
| 2225 | |||
| 2217 | /* fs/splice.c */ | 2226 | /* fs/splice.c */ |
| 2218 | extern ssize_t generic_file_splice_read(struct file *, loff_t *, | 2227 | extern ssize_t generic_file_splice_read(struct file *, loff_t *, |
| 2219 | struct pipe_inode_info *, size_t, unsigned int); | 2228 | struct pipe_inode_info *, size_t, unsigned int); |
| @@ -2330,6 +2339,7 @@ extern void get_filesystem(struct file_system_type *fs); | |||
| 2330 | extern void put_filesystem(struct file_system_type *fs); | 2339 | extern void put_filesystem(struct file_system_type *fs); |
| 2331 | extern struct file_system_type *get_fs_type(const char *name); | 2340 | extern struct file_system_type *get_fs_type(const char *name); |
| 2332 | extern struct super_block *get_super(struct block_device *); | 2341 | extern struct super_block *get_super(struct block_device *); |
| 2342 | extern struct super_block *get_active_super(struct block_device *bdev); | ||
| 2333 | extern struct super_block *user_get_super(dev_t); | 2343 | extern struct super_block *user_get_super(dev_t); |
| 2334 | extern void drop_super(struct super_block *sb); | 2344 | extern void drop_super(struct super_block *sb); |
| 2335 | 2345 | ||
| @@ -2377,7 +2387,8 @@ extern int buffer_migrate_page(struct address_space *, | |||
| 2377 | #define buffer_migrate_page NULL | 2387 | #define buffer_migrate_page NULL |
| 2378 | #endif | 2388 | #endif |
| 2379 | 2389 | ||
| 2380 | extern int inode_change_ok(struct inode *, struct iattr *); | 2390 | extern int inode_change_ok(const struct inode *, struct iattr *); |
| 2391 | extern int inode_newsize_ok(const struct inode *, loff_t offset); | ||
| 2381 | extern int __must_check inode_setattr(struct inode *, struct iattr *); | 2392 | extern int __must_check inode_setattr(struct inode *, struct iattr *); |
| 2382 | 2393 | ||
| 2383 | extern void file_update_time(struct file *file); | 2394 | extern void file_update_time(struct file *file); |
| @@ -2439,7 +2450,7 @@ static int __fops ## _open(struct inode *inode, struct file *file) \ | |||
| 2439 | __simple_attr_check_format(__fmt, 0ull); \ | 2450 | __simple_attr_check_format(__fmt, 0ull); \ |
| 2440 | return simple_attr_open(inode, file, __get, __set, __fmt); \ | 2451 | return simple_attr_open(inode, file, __get, __set, __fmt); \ |
| 2441 | } \ | 2452 | } \ |
| 2442 | static struct file_operations __fops = { \ | 2453 | static const struct file_operations __fops = { \ |
| 2443 | .owner = THIS_MODULE, \ | 2454 | .owner = THIS_MODULE, \ |
| 2444 | .open = __fops ## _open, \ | 2455 | .open = __fops ## _open, \ |
| 2445 | .release = simple_attr_release, \ | 2456 | .release = simple_attr_release, \ |
| @@ -2463,7 +2474,7 @@ ssize_t simple_attr_write(struct file *file, const char __user *buf, | |||
| 2463 | size_t len, loff_t *ppos); | 2474 | size_t len, loff_t *ppos); |
| 2464 | 2475 | ||
| 2465 | struct ctl_table; | 2476 | struct ctl_table; |
| 2466 | int proc_nr_files(struct ctl_table *table, int write, struct file *filp, | 2477 | int proc_nr_files(struct ctl_table *table, int write, |
| 2467 | void __user *buffer, size_t *lenp, loff_t *ppos); | 2478 | void __user *buffer, size_t *lenp, loff_t *ppos); |
| 2468 | 2479 | ||
| 2469 | int __init get_filesystem_list(char *buf); | 2480 | int __init get_filesystem_list(char *buf); |
diff --git a/include/linux/fscache-cache.h b/include/linux/fscache-cache.h index 84d3532dd3ea..7be0c6fbe880 100644 --- a/include/linux/fscache-cache.h +++ b/include/linux/fscache-cache.h | |||
| @@ -91,6 +91,8 @@ struct fscache_operation { | |||
| 91 | #define FSCACHE_OP_WAITING 4 /* cleared when op is woken */ | 91 | #define FSCACHE_OP_WAITING 4 /* cleared when op is woken */ |
| 92 | #define FSCACHE_OP_EXCLUSIVE 5 /* exclusive op, other ops must wait */ | 92 | #define FSCACHE_OP_EXCLUSIVE 5 /* exclusive op, other ops must wait */ |
| 93 | #define FSCACHE_OP_DEAD 6 /* op is now dead */ | 93 | #define FSCACHE_OP_DEAD 6 /* op is now dead */ |
| 94 | #define FSCACHE_OP_DEC_READ_CNT 7 /* decrement object->n_reads on destruction */ | ||
| 95 | #define FSCACHE_OP_KEEP_FLAGS 0xc0 /* flags to keep when repurposing an op */ | ||
| 94 | 96 | ||
| 95 | atomic_t usage; | 97 | atomic_t usage; |
| 96 | unsigned debug_id; /* debugging ID */ | 98 | unsigned debug_id; /* debugging ID */ |
| @@ -102,6 +104,16 @@ struct fscache_operation { | |||
| 102 | 104 | ||
| 103 | /* operation releaser */ | 105 | /* operation releaser */ |
| 104 | fscache_operation_release_t release; | 106 | fscache_operation_release_t release; |
| 107 | |||
| 108 | #ifdef CONFIG_SLOW_WORK_PROC | ||
| 109 | const char *name; /* operation name */ | ||
| 110 | const char *state; /* operation state */ | ||
| 111 | #define fscache_set_op_name(OP, N) do { (OP)->name = (N); } while(0) | ||
| 112 | #define fscache_set_op_state(OP, S) do { (OP)->state = (S); } while(0) | ||
| 113 | #else | ||
| 114 | #define fscache_set_op_name(OP, N) do { } while(0) | ||
| 115 | #define fscache_set_op_state(OP, S) do { } while(0) | ||
| 116 | #endif | ||
| 105 | }; | 117 | }; |
| 106 | 118 | ||
| 107 | extern atomic_t fscache_op_debug_id; | 119 | extern atomic_t fscache_op_debug_id; |
| @@ -125,6 +137,7 @@ static inline void fscache_operation_init(struct fscache_operation *op, | |||
| 125 | op->debug_id = atomic_inc_return(&fscache_op_debug_id); | 137 | op->debug_id = atomic_inc_return(&fscache_op_debug_id); |
| 126 | op->release = release; | 138 | op->release = release; |
| 127 | INIT_LIST_HEAD(&op->pend_link); | 139 | INIT_LIST_HEAD(&op->pend_link); |
| 140 | fscache_set_op_state(op, "Init"); | ||
| 128 | } | 141 | } |
| 129 | 142 | ||
| 130 | /** | 143 | /** |
| @@ -221,8 +234,10 @@ struct fscache_cache_ops { | |||
| 221 | struct fscache_object *(*alloc_object)(struct fscache_cache *cache, | 234 | struct fscache_object *(*alloc_object)(struct fscache_cache *cache, |
| 222 | struct fscache_cookie *cookie); | 235 | struct fscache_cookie *cookie); |
| 223 | 236 | ||
| 224 | /* look up the object for a cookie */ | 237 | /* look up the object for a cookie |
| 225 | void (*lookup_object)(struct fscache_object *object); | 238 | * - return -ETIMEDOUT to be requeued |
| 239 | */ | ||
| 240 | int (*lookup_object)(struct fscache_object *object); | ||
| 226 | 241 | ||
| 227 | /* finished looking up */ | 242 | /* finished looking up */ |
| 228 | void (*lookup_complete)(struct fscache_object *object); | 243 | void (*lookup_complete)(struct fscache_object *object); |
| @@ -297,12 +312,14 @@ struct fscache_cookie { | |||
| 297 | atomic_t usage; /* number of users of this cookie */ | 312 | atomic_t usage; /* number of users of this cookie */ |
| 298 | atomic_t n_children; /* number of children of this cookie */ | 313 | atomic_t n_children; /* number of children of this cookie */ |
| 299 | spinlock_t lock; | 314 | spinlock_t lock; |
| 315 | spinlock_t stores_lock; /* lock on page store tree */ | ||
| 300 | struct hlist_head backing_objects; /* object(s) backing this file/index */ | 316 | struct hlist_head backing_objects; /* object(s) backing this file/index */ |
| 301 | const struct fscache_cookie_def *def; /* definition */ | 317 | const struct fscache_cookie_def *def; /* definition */ |
| 302 | struct fscache_cookie *parent; /* parent of this entry */ | 318 | struct fscache_cookie *parent; /* parent of this entry */ |
| 303 | void *netfs_data; /* back pointer to netfs */ | 319 | void *netfs_data; /* back pointer to netfs */ |
| 304 | struct radix_tree_root stores; /* pages to be stored on this cookie */ | 320 | struct radix_tree_root stores; /* pages to be stored on this cookie */ |
| 305 | #define FSCACHE_COOKIE_PENDING_TAG 0 /* pages tag: pending write to cache */ | 321 | #define FSCACHE_COOKIE_PENDING_TAG 0 /* pages tag: pending write to cache */ |
| 322 | #define FSCACHE_COOKIE_STORING_TAG 1 /* pages tag: writing to cache */ | ||
| 306 | 323 | ||
| 307 | unsigned long flags; | 324 | unsigned long flags; |
| 308 | #define FSCACHE_COOKIE_LOOKING_UP 0 /* T if non-index cookie being looked up still */ | 325 | #define FSCACHE_COOKIE_LOOKING_UP 0 /* T if non-index cookie being looked up still */ |
| @@ -337,6 +354,7 @@ struct fscache_object { | |||
| 337 | FSCACHE_OBJECT_RECYCLING, /* retiring object */ | 354 | FSCACHE_OBJECT_RECYCLING, /* retiring object */ |
| 338 | FSCACHE_OBJECT_WITHDRAWING, /* withdrawing object */ | 355 | FSCACHE_OBJECT_WITHDRAWING, /* withdrawing object */ |
| 339 | FSCACHE_OBJECT_DEAD, /* object is now dead */ | 356 | FSCACHE_OBJECT_DEAD, /* object is now dead */ |
| 357 | FSCACHE_OBJECT__NSTATES | ||
| 340 | } state; | 358 | } state; |
| 341 | 359 | ||
| 342 | int debug_id; /* debugging ID */ | 360 | int debug_id; /* debugging ID */ |
| @@ -345,6 +363,7 @@ struct fscache_object { | |||
| 345 | int n_obj_ops; /* number of object ops outstanding on object */ | 363 | int n_obj_ops; /* number of object ops outstanding on object */ |
| 346 | int n_in_progress; /* number of ops in progress */ | 364 | int n_in_progress; /* number of ops in progress */ |
| 347 | int n_exclusive; /* number of exclusive ops queued */ | 365 | int n_exclusive; /* number of exclusive ops queued */ |
| 366 | atomic_t n_reads; /* number of read ops in progress */ | ||
| 348 | spinlock_t lock; /* state and operations lock */ | 367 | spinlock_t lock; /* state and operations lock */ |
| 349 | 368 | ||
| 350 | unsigned long lookup_jif; /* time at which lookup started */ | 369 | unsigned long lookup_jif; /* time at which lookup started */ |
| @@ -358,6 +377,7 @@ struct fscache_object { | |||
| 358 | #define FSCACHE_OBJECT_EV_RELEASE 4 /* T if netfs requested object release */ | 377 | #define FSCACHE_OBJECT_EV_RELEASE 4 /* T if netfs requested object release */ |
| 359 | #define FSCACHE_OBJECT_EV_RETIRE 5 /* T if netfs requested object retirement */ | 378 | #define FSCACHE_OBJECT_EV_RETIRE 5 /* T if netfs requested object retirement */ |
| 360 | #define FSCACHE_OBJECT_EV_WITHDRAW 6 /* T if cache requested object withdrawal */ | 379 | #define FSCACHE_OBJECT_EV_WITHDRAW 6 /* T if cache requested object withdrawal */ |
| 380 | #define FSCACHE_OBJECT_EVENTS_MASK 0x7f /* mask of all events*/ | ||
| 361 | 381 | ||
| 362 | unsigned long flags; | 382 | unsigned long flags; |
| 363 | #define FSCACHE_OBJECT_LOCK 0 /* T if object is busy being processed */ | 383 | #define FSCACHE_OBJECT_LOCK 0 /* T if object is busy being processed */ |
| @@ -373,7 +393,11 @@ struct fscache_object { | |||
| 373 | struct list_head dependents; /* FIFO of dependent objects */ | 393 | struct list_head dependents; /* FIFO of dependent objects */ |
| 374 | struct list_head dep_link; /* link in parent's dependents list */ | 394 | struct list_head dep_link; /* link in parent's dependents list */ |
| 375 | struct list_head pending_ops; /* unstarted operations on this object */ | 395 | struct list_head pending_ops; /* unstarted operations on this object */ |
| 396 | #ifdef CONFIG_FSCACHE_OBJECT_LIST | ||
| 397 | struct rb_node objlist_link; /* link in global object list */ | ||
| 398 | #endif | ||
| 376 | pgoff_t store_limit; /* current storage limit */ | 399 | pgoff_t store_limit; /* current storage limit */ |
| 400 | loff_t store_limit_l; /* current storage limit */ | ||
| 377 | }; | 401 | }; |
| 378 | 402 | ||
| 379 | extern const char *fscache_object_states[]; | 403 | extern const char *fscache_object_states[]; |
| @@ -383,6 +407,10 @@ extern const char *fscache_object_states[]; | |||
| 383 | (obj)->state >= FSCACHE_OBJECT_AVAILABLE && \ | 407 | (obj)->state >= FSCACHE_OBJECT_AVAILABLE && \ |
| 384 | (obj)->state < FSCACHE_OBJECT_DYING) | 408 | (obj)->state < FSCACHE_OBJECT_DYING) |
| 385 | 409 | ||
| 410 | #define fscache_object_is_dead(obj) \ | ||
| 411 | (test_bit(FSCACHE_IOERROR, &(obj)->cache->flags) && \ | ||
| 412 | (obj)->state >= FSCACHE_OBJECT_DYING) | ||
| 413 | |||
| 386 | extern const struct slow_work_ops fscache_object_slow_work_ops; | 414 | extern const struct slow_work_ops fscache_object_slow_work_ops; |
| 387 | 415 | ||
| 388 | /** | 416 | /** |
| @@ -414,6 +442,7 @@ void fscache_object_init(struct fscache_object *object, | |||
| 414 | object->events = object->event_mask = 0; | 442 | object->events = object->event_mask = 0; |
| 415 | object->flags = 0; | 443 | object->flags = 0; |
| 416 | object->store_limit = 0; | 444 | object->store_limit = 0; |
| 445 | object->store_limit_l = 0; | ||
| 417 | object->cache = cache; | 446 | object->cache = cache; |
| 418 | object->cookie = cookie; | 447 | object->cookie = cookie; |
| 419 | object->parent = NULL; | 448 | object->parent = NULL; |
| @@ -422,6 +451,12 @@ void fscache_object_init(struct fscache_object *object, | |||
| 422 | extern void fscache_object_lookup_negative(struct fscache_object *object); | 451 | extern void fscache_object_lookup_negative(struct fscache_object *object); |
| 423 | extern void fscache_obtained_object(struct fscache_object *object); | 452 | extern void fscache_obtained_object(struct fscache_object *object); |
| 424 | 453 | ||
| 454 | #ifdef CONFIG_FSCACHE_OBJECT_LIST | ||
| 455 | extern void fscache_object_destroy(struct fscache_object *object); | ||
| 456 | #else | ||
| 457 | #define fscache_object_destroy(object) do {} while(0) | ||
| 458 | #endif | ||
| 459 | |||
| 425 | /** | 460 | /** |
| 426 | * fscache_object_destroyed - Note destruction of an object in a cache | 461 | * fscache_object_destroyed - Note destruction of an object in a cache |
| 427 | * @cache: The cache from which the object came | 462 | * @cache: The cache from which the object came |
| @@ -460,6 +495,7 @@ static inline void fscache_object_lookup_error(struct fscache_object *object) | |||
| 460 | static inline | 495 | static inline |
| 461 | void fscache_set_store_limit(struct fscache_object *object, loff_t i_size) | 496 | void fscache_set_store_limit(struct fscache_object *object, loff_t i_size) |
| 462 | { | 497 | { |
| 498 | object->store_limit_l = i_size; | ||
| 463 | object->store_limit = i_size >> PAGE_SHIFT; | 499 | object->store_limit = i_size >> PAGE_SHIFT; |
| 464 | if (i_size & ~PAGE_MASK) | 500 | if (i_size & ~PAGE_MASK) |
| 465 | object->store_limit++; | 501 | object->store_limit++; |
diff --git a/include/linux/fscache.h b/include/linux/fscache.h index 6d8ee466e0a0..595ce49288b7 100644 --- a/include/linux/fscache.h +++ b/include/linux/fscache.h | |||
| @@ -202,6 +202,8 @@ extern int __fscache_write_page(struct fscache_cookie *, struct page *, gfp_t); | |||
| 202 | extern void __fscache_uncache_page(struct fscache_cookie *, struct page *); | 202 | extern void __fscache_uncache_page(struct fscache_cookie *, struct page *); |
| 203 | extern bool __fscache_check_page_write(struct fscache_cookie *, struct page *); | 203 | extern bool __fscache_check_page_write(struct fscache_cookie *, struct page *); |
| 204 | extern void __fscache_wait_on_page_write(struct fscache_cookie *, struct page *); | 204 | extern void __fscache_wait_on_page_write(struct fscache_cookie *, struct page *); |
| 205 | extern bool __fscache_maybe_release_page(struct fscache_cookie *, struct page *, | ||
| 206 | gfp_t); | ||
| 205 | 207 | ||
| 206 | /** | 208 | /** |
| 207 | * fscache_register_netfs - Register a filesystem as desiring caching services | 209 | * fscache_register_netfs - Register a filesystem as desiring caching services |
| @@ -615,4 +617,29 @@ void fscache_wait_on_page_write(struct fscache_cookie *cookie, | |||
| 615 | __fscache_wait_on_page_write(cookie, page); | 617 | __fscache_wait_on_page_write(cookie, page); |
| 616 | } | 618 | } |
| 617 | 619 | ||
| 620 | /** | ||
| 621 | * fscache_maybe_release_page - Consider releasing a page, cancelling a store | ||
| 622 | * @cookie: The cookie representing the cache object | ||
| 623 | * @page: The netfs page that is being cached. | ||
| 624 | * @gfp: The gfp flags passed to releasepage() | ||
| 625 | * | ||
| 626 | * Consider releasing a page for the vmscan algorithm, on behalf of the netfs's | ||
| 627 | * releasepage() call. A storage request on the page may cancelled if it is | ||
| 628 | * not currently being processed. | ||
| 629 | * | ||
| 630 | * The function returns true if the page no longer has a storage request on it, | ||
| 631 | * and false if a storage request is left in place. If true is returned, the | ||
| 632 | * page will have been passed to fscache_uncache_page(). If false is returned | ||
| 633 | * the page cannot be freed yet. | ||
| 634 | */ | ||
| 635 | static inline | ||
| 636 | bool fscache_maybe_release_page(struct fscache_cookie *cookie, | ||
| 637 | struct page *page, | ||
| 638 | gfp_t gfp) | ||
| 639 | { | ||
| 640 | if (fscache_cookie_valid(cookie) && PageFsCache(page)) | ||
| 641 | return __fscache_maybe_release_page(cookie, page, gfp); | ||
| 642 | return false; | ||
| 643 | } | ||
| 644 | |||
| 618 | #endif /* _LINUX_FSCACHE_H */ | 645 | #endif /* _LINUX_FSCACHE_H */ |
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index dc3b1328aaeb..0b4f97d24d7f 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
| @@ -19,7 +19,7 @@ | |||
| 19 | extern int ftrace_enabled; | 19 | extern int ftrace_enabled; |
| 20 | extern int | 20 | extern int |
| 21 | ftrace_enable_sysctl(struct ctl_table *table, int write, | 21 | ftrace_enable_sysctl(struct ctl_table *table, int write, |
| 22 | struct file *filp, void __user *buffer, size_t *lenp, | 22 | void __user *buffer, size_t *lenp, |
| 23 | loff_t *ppos); | 23 | loff_t *ppos); |
| 24 | 24 | ||
| 25 | typedef void (*ftrace_func_t)(unsigned long ip, unsigned long parent_ip); | 25 | typedef void (*ftrace_func_t)(unsigned long ip, unsigned long parent_ip); |
| @@ -94,7 +94,7 @@ static inline void ftrace_start(void) { } | |||
| 94 | extern int stack_tracer_enabled; | 94 | extern int stack_tracer_enabled; |
| 95 | int | 95 | int |
| 96 | stack_trace_sysctl(struct ctl_table *table, int write, | 96 | stack_trace_sysctl(struct ctl_table *table, int write, |
| 97 | struct file *file, void __user *buffer, size_t *lenp, | 97 | void __user *buffer, size_t *lenp, |
| 98 | loff_t *ppos); | 98 | loff_t *ppos); |
| 99 | #endif | 99 | #endif |
| 100 | 100 | ||
| @@ -241,7 +241,7 @@ extern void ftrace_enable_daemon(void); | |||
| 241 | # define ftrace_set_filter(buf, len, reset) do { } while (0) | 241 | # define ftrace_set_filter(buf, len, reset) do { } while (0) |
| 242 | # define ftrace_disable_daemon() do { } while (0) | 242 | # define ftrace_disable_daemon() do { } while (0) |
| 243 | # define ftrace_enable_daemon() do { } while (0) | 243 | # define ftrace_enable_daemon() do { } while (0) |
| 244 | static inline void ftrace_release(void *start, unsigned long size) { } | 244 | static inline void ftrace_release_mod(struct module *mod) {} |
| 245 | static inline int register_ftrace_command(struct ftrace_func_command *cmd) | 245 | static inline int register_ftrace_command(struct ftrace_func_command *cmd) |
| 246 | { | 246 | { |
| 247 | return -EINVAL; | 247 | return -EINVAL; |
| @@ -446,7 +446,6 @@ static inline void unpause_graph_tracing(void) { } | |||
| 446 | #endif /* CONFIG_FUNCTION_GRAPH_TRACER */ | 446 | #endif /* CONFIG_FUNCTION_GRAPH_TRACER */ |
| 447 | 447 | ||
| 448 | #ifdef CONFIG_TRACING | 448 | #ifdef CONFIG_TRACING |
| 449 | #include <linux/sched.h> | ||
| 450 | 449 | ||
| 451 | /* flags for current->trace */ | 450 | /* flags for current->trace */ |
| 452 | enum { | 451 | enum { |
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 23f7179bf74e..47bbdf9c38d0 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
| @@ -1,9 +1,10 @@ | |||
| 1 | #ifndef _LINUX_FTRACE_EVENT_H | 1 | #ifndef _LINUX_FTRACE_EVENT_H |
| 2 | #define _LINUX_FTRACE_EVENT_H | 2 | #define _LINUX_FTRACE_EVENT_H |
| 3 | 3 | ||
| 4 | #include <linux/trace_seq.h> | ||
| 5 | #include <linux/ring_buffer.h> | 4 | #include <linux/ring_buffer.h> |
| 5 | #include <linux/trace_seq.h> | ||
| 6 | #include <linux/percpu.h> | 6 | #include <linux/percpu.h> |
| 7 | #include <linux/hardirq.h> | ||
| 7 | 8 | ||
| 8 | struct trace_array; | 9 | struct trace_array; |
| 9 | struct tracer; | 10 | struct tracer; |
| @@ -34,7 +35,7 @@ struct trace_entry { | |||
| 34 | unsigned char flags; | 35 | unsigned char flags; |
| 35 | unsigned char preempt_count; | 36 | unsigned char preempt_count; |
| 36 | int pid; | 37 | int pid; |
| 37 | int tgid; | 38 | int lock_depth; |
| 38 | }; | 39 | }; |
| 39 | 40 | ||
| 40 | #define FTRACE_MAX_EVENT \ | 41 | #define FTRACE_MAX_EVENT \ |
| @@ -116,12 +117,12 @@ struct ftrace_event_call { | |||
| 116 | struct dentry *dir; | 117 | struct dentry *dir; |
| 117 | struct trace_event *event; | 118 | struct trace_event *event; |
| 118 | int enabled; | 119 | int enabled; |
| 119 | int (*regfunc)(void *); | 120 | int (*regfunc)(struct ftrace_event_call *); |
| 120 | void (*unregfunc)(void *); | 121 | void (*unregfunc)(struct ftrace_event_call *); |
| 121 | int id; | 122 | int id; |
| 122 | int (*raw_init)(void); | 123 | int (*raw_init)(struct ftrace_event_call *); |
| 123 | int (*show_format)(struct ftrace_event_call *call, | 124 | int (*show_format)(struct ftrace_event_call *, |
| 124 | struct trace_seq *s); | 125 | struct trace_seq *); |
| 125 | int (*define_fields)(struct ftrace_event_call *); | 126 | int (*define_fields)(struct ftrace_event_call *); |
| 126 | struct list_head fields; | 127 | struct list_head fields; |
| 127 | int filter_active; | 128 | int filter_active; |
| @@ -134,11 +135,16 @@ struct ftrace_event_call { | |||
| 134 | void (*profile_disable)(struct ftrace_event_call *); | 135 | void (*profile_disable)(struct ftrace_event_call *); |
| 135 | }; | 136 | }; |
| 136 | 137 | ||
| 138 | #define FTRACE_MAX_PROFILE_SIZE 2048 | ||
| 139 | |||
| 140 | extern char *perf_trace_buf; | ||
| 141 | extern char *perf_trace_buf_nmi; | ||
| 142 | |||
| 137 | #define MAX_FILTER_PRED 32 | 143 | #define MAX_FILTER_PRED 32 |
| 138 | #define MAX_FILTER_STR_VAL 128 | 144 | #define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */ |
| 139 | 145 | ||
| 140 | extern void destroy_preds(struct ftrace_event_call *call); | 146 | extern void destroy_preds(struct ftrace_event_call *call); |
| 141 | extern int filter_match_preds(struct ftrace_event_call *call, void *rec); | 147 | extern int filter_match_preds(struct event_filter *filter, void *rec); |
| 142 | extern int filter_current_check_discard(struct ring_buffer *buffer, | 148 | extern int filter_current_check_discard(struct ring_buffer *buffer, |
| 143 | struct ftrace_event_call *call, | 149 | struct ftrace_event_call *call, |
| 144 | void *rec, | 150 | void *rec, |
| @@ -151,11 +157,12 @@ enum { | |||
| 151 | FILTER_PTR_STRING, | 157 | FILTER_PTR_STRING, |
| 152 | }; | 158 | }; |
| 153 | 159 | ||
| 154 | extern int trace_define_field(struct ftrace_event_call *call, | ||
| 155 | const char *type, const char *name, | ||
| 156 | int offset, int size, int is_signed, | ||
| 157 | int filter_type); | ||
| 158 | extern int trace_define_common_fields(struct ftrace_event_call *call); | 160 | extern int trace_define_common_fields(struct ftrace_event_call *call); |
| 161 | extern int trace_define_field(struct ftrace_event_call *call, const char *type, | ||
| 162 | const char *name, int offset, int size, | ||
| 163 | int is_signed, int filter_type); | ||
| 164 | extern int trace_add_event_call(struct ftrace_event_call *call); | ||
| 165 | extern void trace_remove_event_call(struct ftrace_event_call *call); | ||
| 159 | 166 | ||
| 160 | #define is_signed_type(type) (((type)(-1)) < 0) | 167 | #define is_signed_type(type) (((type)(-1)) < 0) |
| 161 | 168 | ||
| @@ -180,4 +187,13 @@ do { \ | |||
| 180 | __trace_printk(ip, fmt, ##args); \ | 187 | __trace_printk(ip, fmt, ##args); \ |
| 181 | } while (0) | 188 | } while (0) |
| 182 | 189 | ||
| 190 | #ifdef CONFIG_EVENT_PROFILE | ||
| 191 | struct perf_event; | ||
| 192 | extern int ftrace_profile_enable(int event_id); | ||
| 193 | extern void ftrace_profile_disable(int event_id); | ||
| 194 | extern int ftrace_profile_set_filter(struct perf_event *event, int event_id, | ||
| 195 | char *filter_str); | ||
| 196 | extern void ftrace_profile_free_filter(struct perf_event *event); | ||
| 197 | #endif | ||
| 198 | |||
| 183 | #endif /* _LINUX_FTRACE_EVENT_H */ | 199 | #endif /* _LINUX_FTRACE_EVENT_H */ |
diff --git a/include/linux/fuse.h b/include/linux/fuse.h index cf593bf9fd32..3e2925a34bf0 100644 --- a/include/linux/fuse.h +++ b/include/linux/fuse.h | |||
| @@ -30,6 +30,10 @@ | |||
| 30 | * - add umask flag to input argument of open, mknod and mkdir | 30 | * - add umask flag to input argument of open, mknod and mkdir |
| 31 | * - add notification messages for invalidation of inodes and | 31 | * - add notification messages for invalidation of inodes and |
| 32 | * directory entries | 32 | * directory entries |
| 33 | * | ||
| 34 | * 7.13 | ||
| 35 | * - make max number of background requests and congestion threshold | ||
| 36 | * tunables | ||
| 33 | */ | 37 | */ |
| 34 | 38 | ||
| 35 | #ifndef _LINUX_FUSE_H | 39 | #ifndef _LINUX_FUSE_H |
| @@ -37,11 +41,31 @@ | |||
| 37 | 41 | ||
| 38 | #include <linux/types.h> | 42 | #include <linux/types.h> |
| 39 | 43 | ||
| 44 | /* | ||
| 45 | * Version negotiation: | ||
| 46 | * | ||
| 47 | * Both the kernel and userspace send the version they support in the | ||
| 48 | * INIT request and reply respectively. | ||
| 49 | * | ||
| 50 | * If the major versions match then both shall use the smallest | ||
| 51 | * of the two minor versions for communication. | ||
| 52 | * | ||
| 53 | * If the kernel supports a larger major version, then userspace shall | ||
| 54 | * reply with the major version it supports, ignore the rest of the | ||
| 55 | * INIT message and expect a new INIT message from the kernel with a | ||
| 56 | * matching major version. | ||
| 57 | * | ||
| 58 | * If the library supports a larger major version, then it shall fall | ||
| 59 | * back to the major protocol version sent by the kernel for | ||
| 60 | * communication and reply with that major version (and an arbitrary | ||
| 61 | * supported minor version). | ||
| 62 | */ | ||
| 63 | |||
| 40 | /** Version number of this interface */ | 64 | /** Version number of this interface */ |
| 41 | #define FUSE_KERNEL_VERSION 7 | 65 | #define FUSE_KERNEL_VERSION 7 |
| 42 | 66 | ||
| 43 | /** Minor version number of this interface */ | 67 | /** Minor version number of this interface */ |
| 44 | #define FUSE_KERNEL_MINOR_VERSION 12 | 68 | #define FUSE_KERNEL_MINOR_VERSION 13 |
| 45 | 69 | ||
| 46 | /** The node ID of the root inode */ | 70 | /** The node ID of the root inode */ |
| 47 | #define FUSE_ROOT_ID 1 | 71 | #define FUSE_ROOT_ID 1 |
| @@ -427,7 +451,8 @@ struct fuse_init_out { | |||
| 427 | __u32 minor; | 451 | __u32 minor; |
| 428 | __u32 max_readahead; | 452 | __u32 max_readahead; |
| 429 | __u32 flags; | 453 | __u32 flags; |
| 430 | __u32 unused; | 454 | __u16 max_background; |
| 455 | __u16 congestion_threshold; | ||
| 431 | __u32 max_write; | 456 | __u32 max_write; |
| 432 | }; | 457 | }; |
| 433 | 458 | ||
diff --git a/include/linux/futex.h b/include/linux/futex.h index 34956c8fdebf..1e5a26d79232 100644 --- a/include/linux/futex.h +++ b/include/linux/futex.h | |||
| @@ -4,11 +4,6 @@ | |||
| 4 | #include <linux/compiler.h> | 4 | #include <linux/compiler.h> |
| 5 | #include <linux/types.h> | 5 | #include <linux/types.h> |
| 6 | 6 | ||
| 7 | struct inode; | ||
| 8 | struct mm_struct; | ||
| 9 | struct task_struct; | ||
| 10 | union ktime; | ||
| 11 | |||
| 12 | /* Second argument to futex syscall */ | 7 | /* Second argument to futex syscall */ |
| 13 | 8 | ||
| 14 | 9 | ||
| @@ -38,8 +33,8 @@ union ktime; | |||
| 38 | #define FUTEX_LOCK_PI_PRIVATE (FUTEX_LOCK_PI | FUTEX_PRIVATE_FLAG) | 33 | #define FUTEX_LOCK_PI_PRIVATE (FUTEX_LOCK_PI | FUTEX_PRIVATE_FLAG) |
| 39 | #define FUTEX_UNLOCK_PI_PRIVATE (FUTEX_UNLOCK_PI | FUTEX_PRIVATE_FLAG) | 34 | #define FUTEX_UNLOCK_PI_PRIVATE (FUTEX_UNLOCK_PI | FUTEX_PRIVATE_FLAG) |
| 40 | #define FUTEX_TRYLOCK_PI_PRIVATE (FUTEX_TRYLOCK_PI | FUTEX_PRIVATE_FLAG) | 35 | #define FUTEX_TRYLOCK_PI_PRIVATE (FUTEX_TRYLOCK_PI | FUTEX_PRIVATE_FLAG) |
| 41 | #define FUTEX_WAIT_BITSET_PRIVATE (FUTEX_WAIT_BITS | FUTEX_PRIVATE_FLAG) | 36 | #define FUTEX_WAIT_BITSET_PRIVATE (FUTEX_WAIT_BITSET | FUTEX_PRIVATE_FLAG) |
| 42 | #define FUTEX_WAKE_BITSET_PRIVATE (FUTEX_WAKE_BITS | FUTEX_PRIVATE_FLAG) | 37 | #define FUTEX_WAKE_BITSET_PRIVATE (FUTEX_WAKE_BITSET | FUTEX_PRIVATE_FLAG) |
| 43 | #define FUTEX_WAIT_REQUEUE_PI_PRIVATE (FUTEX_WAIT_REQUEUE_PI | \ | 38 | #define FUTEX_WAIT_REQUEUE_PI_PRIVATE (FUTEX_WAIT_REQUEUE_PI | \ |
| 44 | FUTEX_PRIVATE_FLAG) | 39 | FUTEX_PRIVATE_FLAG) |
| 45 | #define FUTEX_CMP_REQUEUE_PI_PRIVATE (FUTEX_CMP_REQUEUE_PI | \ | 40 | #define FUTEX_CMP_REQUEUE_PI_PRIVATE (FUTEX_CMP_REQUEUE_PI | \ |
| @@ -129,6 +124,11 @@ struct robust_list_head { | |||
| 129 | #define FUTEX_BITSET_MATCH_ANY 0xffffffff | 124 | #define FUTEX_BITSET_MATCH_ANY 0xffffffff |
| 130 | 125 | ||
| 131 | #ifdef __KERNEL__ | 126 | #ifdef __KERNEL__ |
| 127 | struct inode; | ||
| 128 | struct mm_struct; | ||
| 129 | struct task_struct; | ||
| 130 | union ktime; | ||
| 131 | |||
| 132 | long do_futex(u32 __user *uaddr, int op, u32 val, union ktime *timeout, | 132 | long do_futex(u32 __user *uaddr, int op, u32 val, union ktime *timeout, |
| 133 | u32 __user *uaddr2, u32 val2, u32 val3); | 133 | u32 __user *uaddr2, u32 val2, u32 val3); |
| 134 | 134 | ||
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 45fc320a53c6..297df45ffd0a 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
| @@ -98,7 +98,7 @@ struct hd_struct { | |||
| 98 | int make_it_fail; | 98 | int make_it_fail; |
| 99 | #endif | 99 | #endif |
| 100 | unsigned long stamp; | 100 | unsigned long stamp; |
| 101 | int in_flight; | 101 | int in_flight[2]; |
| 102 | #ifdef CONFIG_SMP | 102 | #ifdef CONFIG_SMP |
| 103 | struct disk_stats *dkstats; | 103 | struct disk_stats *dkstats; |
| 104 | #else | 104 | #else |
| @@ -142,7 +142,7 @@ struct gendisk { | |||
| 142 | * disks that can't be partitioned. */ | 142 | * disks that can't be partitioned. */ |
| 143 | 143 | ||
| 144 | char disk_name[DISK_NAME_LEN]; /* name of major driver */ | 144 | char disk_name[DISK_NAME_LEN]; /* name of major driver */ |
| 145 | char *(*nodename)(struct gendisk *gd); | 145 | char *(*devnode)(struct gendisk *gd, mode_t *mode); |
| 146 | /* Array of pointers to partitions indexed by partno. | 146 | /* Array of pointers to partitions indexed by partno. |
| 147 | * Protected with matching bdev lock but stat and other | 147 | * Protected with matching bdev lock but stat and other |
| 148 | * non-critical accesses use RCU. Always access through | 148 | * non-critical accesses use RCU. Always access through |
| @@ -151,7 +151,7 @@ struct gendisk { | |||
| 151 | struct disk_part_tbl *part_tbl; | 151 | struct disk_part_tbl *part_tbl; |
| 152 | struct hd_struct part0; | 152 | struct hd_struct part0; |
| 153 | 153 | ||
| 154 | struct block_device_operations *fops; | 154 | const struct block_device_operations *fops; |
| 155 | struct request_queue *queue; | 155 | struct request_queue *queue; |
| 156 | void *private_data; | 156 | void *private_data; |
| 157 | 157 | ||
| @@ -322,18 +322,23 @@ static inline void free_part_stats(struct hd_struct *part) | |||
| 322 | #define part_stat_sub(cpu, gendiskp, field, subnd) \ | 322 | #define part_stat_sub(cpu, gendiskp, field, subnd) \ |
| 323 | part_stat_add(cpu, gendiskp, field, -subnd) | 323 | part_stat_add(cpu, gendiskp, field, -subnd) |
| 324 | 324 | ||
| 325 | static inline void part_inc_in_flight(struct hd_struct *part) | 325 | static inline void part_inc_in_flight(struct hd_struct *part, int rw) |
| 326 | { | 326 | { |
| 327 | part->in_flight++; | 327 | part->in_flight[rw]++; |
| 328 | if (part->partno) | 328 | if (part->partno) |
| 329 | part_to_disk(part)->part0.in_flight++; | 329 | part_to_disk(part)->part0.in_flight[rw]++; |
| 330 | } | 330 | } |
| 331 | 331 | ||
| 332 | static inline void part_dec_in_flight(struct hd_struct *part) | 332 | static inline void part_dec_in_flight(struct hd_struct *part, int rw) |
| 333 | { | 333 | { |
| 334 | part->in_flight--; | 334 | part->in_flight[rw]--; |
| 335 | if (part->partno) | 335 | if (part->partno) |
| 336 | part_to_disk(part)->part0.in_flight--; | 336 | part_to_disk(part)->part0.in_flight[rw]--; |
| 337 | } | ||
| 338 | |||
| 339 | static inline int part_in_flight(struct hd_struct *part) | ||
| 340 | { | ||
| 341 | return part->in_flight[0] + part->in_flight[1]; | ||
| 337 | } | 342 | } |
| 338 | 343 | ||
| 339 | /* block/blk-core.c */ | 344 | /* block/blk-core.c */ |
| @@ -546,6 +551,8 @@ extern ssize_t part_size_show(struct device *dev, | |||
| 546 | struct device_attribute *attr, char *buf); | 551 | struct device_attribute *attr, char *buf); |
| 547 | extern ssize_t part_stat_show(struct device *dev, | 552 | extern ssize_t part_stat_show(struct device *dev, |
| 548 | struct device_attribute *attr, char *buf); | 553 | struct device_attribute *attr, char *buf); |
| 554 | extern ssize_t part_inflight_show(struct device *dev, | ||
| 555 | struct device_attribute *attr, char *buf); | ||
| 549 | #ifdef CONFIG_FAIL_MAKE_REQUEST | 556 | #ifdef CONFIG_FAIL_MAKE_REQUEST |
| 550 | extern ssize_t part_fail_show(struct device *dev, | 557 | extern ssize_t part_fail_show(struct device *dev, |
| 551 | struct device_attribute *attr, char *buf); | 558 | struct device_attribute *attr, char *buf); |
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 7c777a0da17a..557bdad320b6 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
| @@ -220,7 +220,7 @@ static inline enum zone_type gfp_zone(gfp_t flags) | |||
| 220 | ((1 << ZONES_SHIFT) - 1); | 220 | ((1 << ZONES_SHIFT) - 1); |
| 221 | 221 | ||
| 222 | if (__builtin_constant_p(bit)) | 222 | if (__builtin_constant_p(bit)) |
| 223 | BUILD_BUG_ON((GFP_ZONE_BAD >> bit) & 1); | 223 | MAYBE_BUILD_BUG_ON((GFP_ZONE_BAD >> bit) & 1); |
| 224 | else { | 224 | else { |
| 225 | #ifdef CONFIG_DEBUG_VM | 225 | #ifdef CONFIG_DEBUG_VM |
| 226 | BUG_ON((GFP_ZONE_BAD >> bit) & 1); | 226 | BUG_ON((GFP_ZONE_BAD >> bit) & 1); |
| @@ -326,7 +326,6 @@ void free_pages_exact(void *virt, size_t size); | |||
| 326 | extern void __free_pages(struct page *page, unsigned int order); | 326 | extern void __free_pages(struct page *page, unsigned int order); |
| 327 | extern void free_pages(unsigned long addr, unsigned int order); | 327 | extern void free_pages(unsigned long addr, unsigned int order); |
| 328 | extern void free_hot_page(struct page *page); | 328 | extern void free_hot_page(struct page *page); |
| 329 | extern void free_cold_page(struct page *page); | ||
| 330 | 329 | ||
| 331 | #define __free_page(page) __free_pages((page), 0) | 330 | #define __free_page(page) __free_pages((page), 0) |
| 332 | #define free_page(addr) free_pages((addr),0) | 331 | #define free_page(addr) free_pages((addr),0) |
| @@ -336,18 +335,6 @@ void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp); | |||
| 336 | void drain_all_pages(void); | 335 | void drain_all_pages(void); |
| 337 | void drain_local_pages(void *dummy); | 336 | void drain_local_pages(void *dummy); |
| 338 | 337 | ||
| 339 | extern bool oom_killer_disabled; | ||
| 340 | |||
| 341 | static inline void oom_killer_disable(void) | ||
| 342 | { | ||
| 343 | oom_killer_disabled = true; | ||
| 344 | } | ||
| 345 | |||
| 346 | static inline void oom_killer_enable(void) | ||
| 347 | { | ||
| 348 | oom_killer_disabled = false; | ||
| 349 | } | ||
| 350 | |||
| 351 | extern gfp_t gfp_allowed_mask; | 338 | extern gfp_t gfp_allowed_mask; |
| 352 | 339 | ||
| 353 | static inline void set_gfp_allowed_mask(gfp_t mask) | 340 | static inline void set_gfp_allowed_mask(gfp_t mask) |
diff --git a/include/linux/gfs2_ondisk.h b/include/linux/gfs2_ondisk.h index c56b4bce56d0..81f90a59cda6 100644 --- a/include/linux/gfs2_ondisk.h +++ b/include/linux/gfs2_ondisk.h | |||
| @@ -81,7 +81,11 @@ struct gfs2_meta_header { | |||
| 81 | __be32 mh_type; | 81 | __be32 mh_type; |
| 82 | __be64 __pad0; /* Was generation number in gfs1 */ | 82 | __be64 __pad0; /* Was generation number in gfs1 */ |
| 83 | __be32 mh_format; | 83 | __be32 mh_format; |
| 84 | __be32 __pad1; /* Was incarnation number in gfs1 */ | 84 | /* This union is to keep userspace happy */ |
| 85 | union { | ||
| 86 | __be32 mh_jid; /* Was incarnation number in gfs1 */ | ||
| 87 | __be32 __pad1; | ||
| 88 | }; | ||
| 85 | }; | 89 | }; |
| 86 | 90 | ||
| 87 | /* | 91 | /* |
| @@ -333,6 +337,28 @@ struct gfs2_leaf { | |||
| 333 | 337 | ||
| 334 | /* | 338 | /* |
| 335 | * Extended attribute header format | 339 | * Extended attribute header format |
| 340 | * | ||
| 341 | * This works in a similar way to dirents. There is a fixed size header | ||
| 342 | * followed by a variable length section made up of the name and the | ||
| 343 | * associated data. In the case of a "stuffed" entry, the value is | ||
| 344 | * inline directly after the name, the ea_num_ptrs entry will be | ||
| 345 | * zero in that case. For non-"stuffed" entries, there will be | ||
| 346 | * a set of pointers (aligned to 8 byte boundary) to the block(s) | ||
| 347 | * containing the value. | ||
| 348 | * | ||
| 349 | * The blocks containing the values and the blocks containing the | ||
| 350 | * extended attribute headers themselves all start with the common | ||
| 351 | * metadata header. Each inode, if it has extended attributes, will | ||
| 352 | * have either a single block containing the extended attribute headers | ||
| 353 | * or a single indirect block pointing to blocks containing the | ||
| 354 | * extended attribure headers. | ||
| 355 | * | ||
| 356 | * The maximim size of the data part of an extended attribute is 64k | ||
| 357 | * so the number of blocks required depends upon block size. Since the | ||
| 358 | * block size also determines the number of pointers in an indirect | ||
| 359 | * block, its a fairly complicated calculation to work out the maximum | ||
| 360 | * number of blocks that an inode may have relating to extended attributes. | ||
| 361 | * | ||
| 336 | */ | 362 | */ |
| 337 | 363 | ||
| 338 | #define GFS2_EA_MAX_NAME_LEN 255 | 364 | #define GFS2_EA_MAX_NAME_LEN 255 |
diff --git a/include/linux/gpio.h b/include/linux/gpio.h index e10c49a5b96e..059bd189d35d 100644 --- a/include/linux/gpio.h +++ b/include/linux/gpio.h | |||
| @@ -12,6 +12,8 @@ | |||
| 12 | #include <linux/types.h> | 12 | #include <linux/types.h> |
| 13 | #include <linux/errno.h> | 13 | #include <linux/errno.h> |
| 14 | 14 | ||
| 15 | struct device; | ||
| 16 | |||
| 15 | /* | 17 | /* |
| 16 | * Some platforms don't support the GPIO programming interface. | 18 | * Some platforms don't support the GPIO programming interface. |
| 17 | * | 19 | * |
| @@ -89,6 +91,15 @@ static inline int gpio_export(unsigned gpio, bool direction_may_change) | |||
| 89 | return -EINVAL; | 91 | return -EINVAL; |
| 90 | } | 92 | } |
| 91 | 93 | ||
| 94 | static inline int gpio_export_link(struct device *dev, const char *name, | ||
| 95 | unsigned gpio) | ||
| 96 | { | ||
| 97 | /* GPIO can never have been exported */ | ||
| 98 | WARN_ON(1); | ||
| 99 | return -EINVAL; | ||
| 100 | } | ||
| 101 | |||
| 102 | |||
| 92 | static inline void gpio_unexport(unsigned gpio) | 103 | static inline void gpio_unexport(unsigned gpio) |
| 93 | { | 104 | { |
| 94 | /* GPIO can never have been exported */ | 105 | /* GPIO can never have been exported */ |
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index 6d527ee82b2b..d5b387669dab 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h | |||
| @@ -139,10 +139,34 @@ static inline void account_system_vtime(struct task_struct *tsk) | |||
| 139 | #endif | 139 | #endif |
| 140 | 140 | ||
| 141 | #if defined(CONFIG_NO_HZ) | 141 | #if defined(CONFIG_NO_HZ) |
| 142 | #if defined(CONFIG_TINY_RCU) | ||
| 143 | extern void rcu_enter_nohz(void); | ||
| 144 | extern void rcu_exit_nohz(void); | ||
| 145 | |||
| 146 | static inline void rcu_irq_enter(void) | ||
| 147 | { | ||
| 148 | rcu_exit_nohz(); | ||
| 149 | } | ||
| 150 | |||
| 151 | static inline void rcu_irq_exit(void) | ||
| 152 | { | ||
| 153 | rcu_enter_nohz(); | ||
| 154 | } | ||
| 155 | |||
| 156 | static inline void rcu_nmi_enter(void) | ||
| 157 | { | ||
| 158 | } | ||
| 159 | |||
| 160 | static inline void rcu_nmi_exit(void) | ||
| 161 | { | ||
| 162 | } | ||
| 163 | |||
| 164 | #else | ||
| 142 | extern void rcu_irq_enter(void); | 165 | extern void rcu_irq_enter(void); |
| 143 | extern void rcu_irq_exit(void); | 166 | extern void rcu_irq_exit(void); |
| 144 | extern void rcu_nmi_enter(void); | 167 | extern void rcu_nmi_enter(void); |
| 145 | extern void rcu_nmi_exit(void); | 168 | extern void rcu_nmi_exit(void); |
| 169 | #endif | ||
| 146 | #else | 170 | #else |
| 147 | # define rcu_irq_enter() do { } while (0) | 171 | # define rcu_irq_enter() do { } while (0) |
| 148 | # define rcu_irq_exit() do { } while (0) | 172 | # define rcu_irq_exit() do { } while (0) |
diff --git a/include/linux/hayesesp.h b/include/linux/hayesesp.h index 940aeb51d53f..92b08cfe4a75 100644 --- a/include/linux/hayesesp.h +++ b/include/linux/hayesesp.h | |||
| @@ -96,7 +96,6 @@ struct esp_struct { | |||
| 96 | int xmit_head; | 96 | int xmit_head; |
| 97 | int xmit_tail; | 97 | int xmit_tail; |
| 98 | int xmit_cnt; | 98 | int xmit_cnt; |
| 99 | wait_queue_head_t delta_msr_wait; | ||
| 100 | wait_queue_head_t break_wait; | 99 | wait_queue_head_t break_wait; |
| 101 | struct async_icount icount; /* kernel counters for the 4 input interrupts */ | 100 | struct async_icount icount; /* kernel counters for the 4 input interrupts */ |
| 102 | struct hayes_esp_config config; /* port configuration */ | 101 | struct hayes_esp_config config; /* port configuration */ |
diff --git a/include/linux/hdlc.h b/include/linux/hdlc.h index 6a6e701f1631..ee275c8b3df1 100644 --- a/include/linux/hdlc.h +++ b/include/linux/hdlc.h | |||
| @@ -38,7 +38,7 @@ struct hdlc_proto { | |||
| 38 | int (*ioctl)(struct net_device *dev, struct ifreq *ifr); | 38 | int (*ioctl)(struct net_device *dev, struct ifreq *ifr); |
| 39 | __be16 (*type_trans)(struct sk_buff *skb, struct net_device *dev); | 39 | __be16 (*type_trans)(struct sk_buff *skb, struct net_device *dev); |
| 40 | int (*netif_rx)(struct sk_buff *skb); | 40 | int (*netif_rx)(struct sk_buff *skb); |
| 41 | int (*xmit)(struct sk_buff *skb, struct net_device *dev); | 41 | netdev_tx_t (*xmit)(struct sk_buff *skb, struct net_device *dev); |
| 42 | struct module *module; | 42 | struct module *module; |
| 43 | struct hdlc_proto *next; /* next protocol in the list */ | 43 | struct hdlc_proto *next; /* next protocol in the list */ |
| 44 | }; | 44 | }; |
| @@ -51,7 +51,7 @@ typedef struct hdlc_device { | |||
| 51 | unsigned short encoding, unsigned short parity); | 51 | unsigned short encoding, unsigned short parity); |
| 52 | 52 | ||
| 53 | /* hardware driver must handle this instead of dev->hard_start_xmit */ | 53 | /* hardware driver must handle this instead of dev->hard_start_xmit */ |
| 54 | int (*xmit)(struct sk_buff *skb, struct net_device *dev); | 54 | netdev_tx_t (*xmit)(struct sk_buff *skb, struct net_device *dev); |
| 55 | 55 | ||
| 56 | /* Things below are for HDLC layer internal use only */ | 56 | /* Things below are for HDLC layer internal use only */ |
| 57 | const struct hdlc_proto *proto; | 57 | const struct hdlc_proto *proto; |
| @@ -60,7 +60,7 @@ typedef struct hdlc_device { | |||
| 60 | spinlock_t state_lock; | 60 | spinlock_t state_lock; |
| 61 | void *state; | 61 | void *state; |
| 62 | void *priv; | 62 | void *priv; |
| 63 | }hdlc_device; | 63 | } hdlc_device; |
| 64 | 64 | ||
| 65 | 65 | ||
| 66 | 66 | ||
| @@ -106,7 +106,7 @@ void hdlc_close(struct net_device *dev); | |||
| 106 | /* May be used by hardware driver */ | 106 | /* May be used by hardware driver */ |
| 107 | int hdlc_change_mtu(struct net_device *dev, int new_mtu); | 107 | int hdlc_change_mtu(struct net_device *dev, int new_mtu); |
| 108 | /* Must be pointed to by hw driver's dev->netdev_ops->ndo_start_xmit */ | 108 | /* Must be pointed to by hw driver's dev->netdev_ops->ndo_start_xmit */ |
| 109 | int hdlc_start_xmit(struct sk_buff *skb, struct net_device *dev); | 109 | netdev_tx_t hdlc_start_xmit(struct sk_buff *skb, struct net_device *dev); |
| 110 | 110 | ||
| 111 | int attach_hdlc_protocol(struct net_device *dev, struct hdlc_proto *proto, | 111 | int attach_hdlc_protocol(struct net_device *dev, struct hdlc_proto *proto, |
| 112 | size_t size); | 112 | size_t size); |
diff --git a/include/linux/hid-debug.h b/include/linux/hid-debug.h index 50d568ec178a..53744fa1c8b7 100644 --- a/include/linux/hid-debug.h +++ b/include/linux/hid-debug.h | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | #define __HID_DEBUG_H | 2 | #define __HID_DEBUG_H |
| 3 | 3 | ||
| 4 | /* | 4 | /* |
| 5 | * Copyright (c) 2007 Jiri Kosina | 5 | * Copyright (c) 2007-2009 Jiri Kosina |
| 6 | */ | 6 | */ |
| 7 | 7 | ||
| 8 | /* | 8 | /* |
| @@ -22,24 +22,44 @@ | |||
| 22 | * | 22 | * |
| 23 | */ | 23 | */ |
| 24 | 24 | ||
| 25 | #ifdef CONFIG_HID_DEBUG | 25 | #define HID_DEBUG_BUFSIZE 512 |
| 26 | 26 | ||
| 27 | void hid_dump_input(struct hid_usage *, __s32); | 27 | #ifdef CONFIG_DEBUG_FS |
| 28 | void hid_dump_device(struct hid_device *); | 28 | |
| 29 | void hid_dump_field(struct hid_field *, int); | 29 | void hid_dump_input(struct hid_device *, struct hid_usage *, __s32); |
| 30 | void hid_resolv_usage(unsigned); | 30 | void hid_dump_device(struct hid_device *, struct seq_file *); |
| 31 | void hid_resolv_event(__u8, __u16); | 31 | void hid_dump_field(struct hid_field *, int, struct seq_file *); |
| 32 | char *hid_resolv_usage(unsigned, struct seq_file *); | ||
| 33 | void hid_debug_register(struct hid_device *, const char *); | ||
| 34 | void hid_debug_unregister(struct hid_device *); | ||
| 35 | void hid_debug_init(void); | ||
| 36 | void hid_debug_exit(void); | ||
| 37 | void hid_debug_event(struct hid_device *, char *); | ||
| 32 | 38 | ||
| 33 | #else | ||
| 34 | 39 | ||
| 35 | #define hid_dump_input(a,b) do { } while (0) | 40 | struct hid_debug_list { |
| 36 | #define hid_dump_device(c) do { } while (0) | 41 | char *hid_debug_buf; |
| 37 | #define hid_dump_field(a,b) do { } while (0) | 42 | int head; |
| 38 | #define hid_resolv_usage(a) do { } while (0) | 43 | int tail; |
| 39 | #define hid_resolv_event(a,b) do { } while (0) | 44 | struct fasync_struct *fasync; |
| 45 | struct hid_device *hdev; | ||
| 46 | struct list_head node; | ||
| 47 | struct mutex read_mutex; | ||
| 48 | }; | ||
| 40 | 49 | ||
| 41 | #endif /* CONFIG_HID_DEBUG */ | 50 | #else |
| 42 | 51 | ||
| 52 | #define hid_dump_input(a,b,c) do { } while (0) | ||
| 53 | #define hid_dump_device(a,b) do { } while (0) | ||
| 54 | #define hid_dump_field(a,b,c) do { } while (0) | ||
| 55 | #define hid_resolv_usage(a,b) do { } while (0) | ||
| 56 | #define hid_debug_register(a, b) do { } while (0) | ||
| 57 | #define hid_debug_unregister(a) do { } while (0) | ||
| 58 | #define hid_debug_init() do { } while (0) | ||
| 59 | #define hid_debug_exit() do { } while (0) | ||
| 60 | #define hid_debug_event(a,b) do { } while (0) | ||
| 61 | |||
| 62 | #endif | ||
| 43 | 63 | ||
| 44 | #endif | 64 | #endif |
| 45 | 65 | ||
diff --git a/include/linux/hid.h b/include/linux/hid.h index 53489fd4d700..10f628416740 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h | |||
| @@ -494,12 +494,21 @@ struct hid_device { /* device report descriptor */ | |||
| 494 | 494 | ||
| 495 | /* hiddev event handler */ | 495 | /* hiddev event handler */ |
| 496 | int (*hiddev_connect)(struct hid_device *, unsigned int); | 496 | int (*hiddev_connect)(struct hid_device *, unsigned int); |
| 497 | void (*hiddev_disconnect)(struct hid_device *); | ||
| 497 | void (*hiddev_hid_event) (struct hid_device *, struct hid_field *field, | 498 | void (*hiddev_hid_event) (struct hid_device *, struct hid_field *field, |
| 498 | struct hid_usage *, __s32); | 499 | struct hid_usage *, __s32); |
| 499 | void (*hiddev_report_event) (struct hid_device *, struct hid_report *); | 500 | void (*hiddev_report_event) (struct hid_device *, struct hid_report *); |
| 500 | 501 | ||
| 501 | /* handler for raw output data, used by hidraw */ | 502 | /* handler for raw output data, used by hidraw */ |
| 502 | int (*hid_output_raw_report) (struct hid_device *, __u8 *, size_t); | 503 | int (*hid_output_raw_report) (struct hid_device *, __u8 *, size_t); |
| 504 | |||
| 505 | /* debugging support via debugfs */ | ||
| 506 | unsigned short debug; | ||
| 507 | struct dentry *debug_dir; | ||
| 508 | struct dentry *debug_rdesc; | ||
| 509 | struct dentry *debug_events; | ||
| 510 | struct list_head debug_list; | ||
| 511 | wait_queue_head_t debug_wait; | ||
| 503 | }; | 512 | }; |
| 504 | 513 | ||
| 505 | static inline void *hid_get_drvdata(struct hid_device *hdev) | 514 | static inline void *hid_get_drvdata(struct hid_device *hdev) |
| @@ -657,9 +666,7 @@ struct hid_ll_driver { | |||
| 657 | 666 | ||
| 658 | /* HID core API */ | 667 | /* HID core API */ |
| 659 | 668 | ||
| 660 | #ifdef CONFIG_HID_DEBUG | ||
| 661 | extern int hid_debug; | 669 | extern int hid_debug; |
| 662 | #endif | ||
| 663 | 670 | ||
| 664 | extern int hid_add_device(struct hid_device *); | 671 | extern int hid_add_device(struct hid_device *); |
| 665 | extern void hid_destroy_device(struct hid_device *); | 672 | extern void hid_destroy_device(struct hid_device *); |
| @@ -685,6 +692,7 @@ struct hid_device *hid_allocate_device(void); | |||
| 685 | int hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size); | 692 | int hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size); |
| 686 | int hid_check_keys_pressed(struct hid_device *hid); | 693 | int hid_check_keys_pressed(struct hid_device *hid); |
| 687 | int hid_connect(struct hid_device *hid, unsigned int connect_mask); | 694 | int hid_connect(struct hid_device *hid, unsigned int connect_mask); |
| 695 | void hid_disconnect(struct hid_device *hid); | ||
| 688 | 696 | ||
| 689 | /** | 697 | /** |
| 690 | * hid_map_usage - map usage input bits | 698 | * hid_map_usage - map usage input bits |
| @@ -794,6 +802,7 @@ static inline int __must_check hid_hw_start(struct hid_device *hdev, | |||
| 794 | */ | 802 | */ |
| 795 | static inline void hid_hw_stop(struct hid_device *hdev) | 803 | static inline void hid_hw_stop(struct hid_device *hdev) |
| 796 | { | 804 | { |
| 805 | hid_disconnect(hdev); | ||
| 797 | hdev->ll_driver->stop(hdev); | 806 | hdev->ll_driver->stop(hdev); |
| 798 | } | 807 | } |
| 799 | 808 | ||
| @@ -815,21 +824,9 @@ int hid_pidff_init(struct hid_device *hid); | |||
| 815 | #define hid_pidff_init NULL | 824 | #define hid_pidff_init NULL |
| 816 | #endif | 825 | #endif |
| 817 | 826 | ||
| 818 | #ifdef CONFIG_HID_DEBUG | ||
| 819 | #define dbg_hid(format, arg...) if (hid_debug) \ | 827 | #define dbg_hid(format, arg...) if (hid_debug) \ |
| 820 | printk(KERN_DEBUG "%s: " format ,\ | 828 | printk(KERN_DEBUG "%s: " format ,\ |
| 821 | __FILE__ , ## arg) | 829 | __FILE__ , ## arg) |
| 822 | #define dbg_hid_line(format, arg...) if (hid_debug) \ | ||
| 823 | printk(format, ## arg) | ||
| 824 | #else | ||
| 825 | static inline int __attribute__((format(printf, 1, 2))) | ||
| 826 | dbg_hid(const char *fmt, ...) | ||
| 827 | { | ||
| 828 | return 0; | ||
| 829 | } | ||
| 830 | #define dbg_hid_line dbg_hid | ||
| 831 | #endif /* HID_DEBUG */ | ||
| 832 | |||
| 833 | #define err_hid(format, arg...) printk(KERN_ERR "%s: " format "\n" , \ | 830 | #define err_hid(format, arg...) printk(KERN_ERR "%s: " format "\n" , \ |
| 834 | __FILE__ , ## arg) | 831 | __FILE__ , ## arg) |
| 835 | #endif /* HID_FF */ | 832 | #endif /* HID_FF */ |
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index 4759917adc71..ff037f0b1b4e 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h | |||
| @@ -91,7 +91,6 @@ enum hrtimer_restart { | |||
| 91 | * @function: timer expiry callback function | 91 | * @function: timer expiry callback function |
| 92 | * @base: pointer to the timer base (per cpu and per clock) | 92 | * @base: pointer to the timer base (per cpu and per clock) |
| 93 | * @state: state information (See bit values above) | 93 | * @state: state information (See bit values above) |
| 94 | * @cb_entry: list head to enqueue an expired timer into the callback list | ||
| 95 | * @start_site: timer statistics field to store the site where the timer | 94 | * @start_site: timer statistics field to store the site where the timer |
| 96 | * was started | 95 | * was started |
| 97 | * @start_comm: timer statistics field to store the name of the process which | 96 | * @start_comm: timer statistics field to store the name of the process which |
| @@ -108,7 +107,6 @@ struct hrtimer { | |||
| 108 | enum hrtimer_restart (*function)(struct hrtimer *); | 107 | enum hrtimer_restart (*function)(struct hrtimer *); |
| 109 | struct hrtimer_clock_base *base; | 108 | struct hrtimer_clock_base *base; |
| 110 | unsigned long state; | 109 | unsigned long state; |
| 111 | struct list_head cb_entry; | ||
| 112 | #ifdef CONFIG_TIMER_STATS | 110 | #ifdef CONFIG_TIMER_STATS |
| 113 | int start_pid; | 111 | int start_pid; |
| 114 | void *start_site; | 112 | void *start_site; |
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 5cbc620bdfe0..41a59afc70fa 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
| @@ -3,15 +3,15 @@ | |||
| 3 | 3 | ||
| 4 | #include <linux/fs.h> | 4 | #include <linux/fs.h> |
| 5 | 5 | ||
| 6 | struct ctl_table; | ||
| 7 | struct user_struct; | ||
| 8 | |||
| 6 | #ifdef CONFIG_HUGETLB_PAGE | 9 | #ifdef CONFIG_HUGETLB_PAGE |
| 7 | 10 | ||
| 8 | #include <linux/mempolicy.h> | 11 | #include <linux/mempolicy.h> |
| 9 | #include <linux/shm.h> | 12 | #include <linux/shm.h> |
| 10 | #include <asm/tlbflush.h> | 13 | #include <asm/tlbflush.h> |
| 11 | 14 | ||
| 12 | struct ctl_table; | ||
| 13 | struct user_struct; | ||
| 14 | |||
| 15 | int PageHuge(struct page *page); | 15 | int PageHuge(struct page *page); |
| 16 | 16 | ||
| 17 | static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) | 17 | static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) |
| @@ -20,11 +20,13 @@ static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) | |||
| 20 | } | 20 | } |
| 21 | 21 | ||
| 22 | void reset_vma_resv_huge_pages(struct vm_area_struct *vma); | 22 | void reset_vma_resv_huge_pages(struct vm_area_struct *vma); |
| 23 | int hugetlb_sysctl_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); | 23 | int hugetlb_sysctl_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *); |
| 24 | int hugetlb_overcommit_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); | 24 | int hugetlb_overcommit_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *); |
| 25 | int hugetlb_treat_movable_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); | 25 | int hugetlb_treat_movable_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *); |
| 26 | int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct vm_area_struct *); | 26 | int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct vm_area_struct *); |
| 27 | int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, struct page **, struct vm_area_struct **, unsigned long *, int *, int, int); | 27 | int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, |
| 28 | struct page **, struct vm_area_struct **, | ||
| 29 | unsigned long *, int *, int, unsigned int flags); | ||
| 28 | void unmap_hugepage_range(struct vm_area_struct *, | 30 | void unmap_hugepage_range(struct vm_area_struct *, |
| 29 | unsigned long, unsigned long, struct page *); | 31 | unsigned long, unsigned long, struct page *); |
| 30 | void __unmap_hugepage_range(struct vm_area_struct *, | 32 | void __unmap_hugepage_range(struct vm_area_struct *, |
| @@ -110,6 +112,21 @@ static inline void hugetlb_report_meminfo(struct seq_file *m) | |||
| 110 | 112 | ||
| 111 | #endif /* !CONFIG_HUGETLB_PAGE */ | 113 | #endif /* !CONFIG_HUGETLB_PAGE */ |
| 112 | 114 | ||
| 115 | #define HUGETLB_ANON_FILE "anon_hugepage" | ||
| 116 | |||
| 117 | enum { | ||
| 118 | /* | ||
| 119 | * The file will be used as an shm file so shmfs accounting rules | ||
| 120 | * apply | ||
| 121 | */ | ||
| 122 | HUGETLB_SHMFS_INODE = 1, | ||
| 123 | /* | ||
| 124 | * The file is being created on the internal vfs mount and shmfs | ||
| 125 | * accounting rules do not apply | ||
| 126 | */ | ||
| 127 | HUGETLB_ANONHUGE_INODE = 2, | ||
| 128 | }; | ||
| 129 | |||
| 113 | #ifdef CONFIG_HUGETLBFS | 130 | #ifdef CONFIG_HUGETLBFS |
| 114 | struct hugetlbfs_config { | 131 | struct hugetlbfs_config { |
| 115 | uid_t uid; | 132 | uid_t uid; |
| @@ -146,9 +163,9 @@ static inline struct hugetlbfs_sb_info *HUGETLBFS_SB(struct super_block *sb) | |||
| 146 | } | 163 | } |
| 147 | 164 | ||
| 148 | extern const struct file_operations hugetlbfs_file_operations; | 165 | extern const struct file_operations hugetlbfs_file_operations; |
| 149 | extern struct vm_operations_struct hugetlb_vm_ops; | 166 | extern const struct vm_operations_struct hugetlb_vm_ops; |
| 150 | struct file *hugetlb_file_setup(const char *name, size_t size, int acct, | 167 | struct file *hugetlb_file_setup(const char *name, size_t size, int acct, |
| 151 | struct user_struct **user); | 168 | struct user_struct **user, int creat_flags); |
| 152 | int hugetlb_get_quota(struct address_space *mapping, long delta); | 169 | int hugetlb_get_quota(struct address_space *mapping, long delta); |
| 153 | void hugetlb_put_quota(struct address_space *mapping, long delta); | 170 | void hugetlb_put_quota(struct address_space *mapping, long delta); |
| 154 | 171 | ||
| @@ -170,7 +187,11 @@ static inline void set_file_hugepages(struct file *file) | |||
| 170 | 187 | ||
| 171 | #define is_file_hugepages(file) 0 | 188 | #define is_file_hugepages(file) 0 |
| 172 | #define set_file_hugepages(file) BUG() | 189 | #define set_file_hugepages(file) BUG() |
| 173 | #define hugetlb_file_setup(name,size,acct,user) ERR_PTR(-ENOSYS) | 190 | static inline struct file *hugetlb_file_setup(const char *name, size_t size, |
| 191 | int acctflag, struct user_struct **user, int creat_flags) | ||
| 192 | { | ||
| 193 | return ERR_PTR(-ENOSYS); | ||
| 194 | } | ||
| 174 | 195 | ||
| 175 | #endif /* !CONFIG_HUGETLBFS */ | 196 | #endif /* !CONFIG_HUGETLBFS */ |
| 176 | 197 | ||
| @@ -185,7 +206,8 @@ unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr, | |||
| 185 | #define HSTATE_NAME_LEN 32 | 206 | #define HSTATE_NAME_LEN 32 |
| 186 | /* Defines one hugetlb page size */ | 207 | /* Defines one hugetlb page size */ |
| 187 | struct hstate { | 208 | struct hstate { |
| 188 | int hugetlb_next_nid; | 209 | int next_nid_to_alloc; |
| 210 | int next_nid_to_free; | ||
| 189 | unsigned int order; | 211 | unsigned int order; |
| 190 | unsigned long mask; | 212 | unsigned long mask; |
| 191 | unsigned long max_huge_pages; | 213 | unsigned long max_huge_pages; |
diff --git a/include/linux/hw_breakpoint.h b/include/linux/hw_breakpoint.h new file mode 100644 index 000000000000..a03daed08c59 --- /dev/null +++ b/include/linux/hw_breakpoint.h | |||
| @@ -0,0 +1,131 @@ | |||
| 1 | #ifndef _LINUX_HW_BREAKPOINT_H | ||
| 2 | #define _LINUX_HW_BREAKPOINT_H | ||
| 3 | |||
| 4 | enum { | ||
| 5 | HW_BREAKPOINT_LEN_1 = 1, | ||
| 6 | HW_BREAKPOINT_LEN_2 = 2, | ||
| 7 | HW_BREAKPOINT_LEN_4 = 4, | ||
| 8 | HW_BREAKPOINT_LEN_8 = 8, | ||
| 9 | }; | ||
| 10 | |||
| 11 | enum { | ||
| 12 | HW_BREAKPOINT_R = 1, | ||
| 13 | HW_BREAKPOINT_W = 2, | ||
| 14 | HW_BREAKPOINT_X = 4, | ||
| 15 | }; | ||
| 16 | |||
| 17 | #ifdef __KERNEL__ | ||
| 18 | |||
| 19 | #include <linux/perf_event.h> | ||
| 20 | |||
| 21 | #ifdef CONFIG_HAVE_HW_BREAKPOINT | ||
| 22 | |||
| 23 | /* As it's for in-kernel or ptrace use, we want it to be pinned */ | ||
| 24 | #define DEFINE_BREAKPOINT_ATTR(name) \ | ||
| 25 | struct perf_event_attr name = { \ | ||
| 26 | .type = PERF_TYPE_BREAKPOINT, \ | ||
| 27 | .size = sizeof(name), \ | ||
| 28 | .pinned = 1, \ | ||
| 29 | }; | ||
| 30 | |||
| 31 | static inline void hw_breakpoint_init(struct perf_event_attr *attr) | ||
| 32 | { | ||
| 33 | attr->type = PERF_TYPE_BREAKPOINT; | ||
| 34 | attr->size = sizeof(*attr); | ||
| 35 | attr->pinned = 1; | ||
| 36 | } | ||
| 37 | |||
| 38 | static inline unsigned long hw_breakpoint_addr(struct perf_event *bp) | ||
| 39 | { | ||
| 40 | return bp->attr.bp_addr; | ||
| 41 | } | ||
| 42 | |||
| 43 | static inline int hw_breakpoint_type(struct perf_event *bp) | ||
| 44 | { | ||
| 45 | return bp->attr.bp_type; | ||
| 46 | } | ||
| 47 | |||
| 48 | static inline int hw_breakpoint_len(struct perf_event *bp) | ||
| 49 | { | ||
| 50 | return bp->attr.bp_len; | ||
| 51 | } | ||
| 52 | |||
| 53 | extern struct perf_event * | ||
| 54 | register_user_hw_breakpoint(struct perf_event_attr *attr, | ||
| 55 | perf_callback_t triggered, | ||
| 56 | struct task_struct *tsk); | ||
| 57 | |||
| 58 | /* FIXME: only change from the attr, and don't unregister */ | ||
| 59 | extern struct perf_event * | ||
| 60 | modify_user_hw_breakpoint(struct perf_event *bp, | ||
| 61 | struct perf_event_attr *attr, | ||
| 62 | perf_callback_t triggered, | ||
| 63 | struct task_struct *tsk); | ||
| 64 | |||
| 65 | /* | ||
| 66 | * Kernel breakpoints are not associated with any particular thread. | ||
| 67 | */ | ||
| 68 | extern struct perf_event * | ||
| 69 | register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr, | ||
| 70 | perf_callback_t triggered, | ||
| 71 | int cpu); | ||
| 72 | |||
| 73 | extern struct perf_event ** | ||
| 74 | register_wide_hw_breakpoint(struct perf_event_attr *attr, | ||
| 75 | perf_callback_t triggered); | ||
| 76 | |||
| 77 | extern int register_perf_hw_breakpoint(struct perf_event *bp); | ||
| 78 | extern int __register_perf_hw_breakpoint(struct perf_event *bp); | ||
| 79 | extern void unregister_hw_breakpoint(struct perf_event *bp); | ||
| 80 | extern void unregister_wide_hw_breakpoint(struct perf_event **cpu_events); | ||
| 81 | |||
| 82 | extern int reserve_bp_slot(struct perf_event *bp); | ||
| 83 | extern void release_bp_slot(struct perf_event *bp); | ||
| 84 | |||
| 85 | extern void flush_ptrace_hw_breakpoint(struct task_struct *tsk); | ||
| 86 | |||
| 87 | static inline struct arch_hw_breakpoint *counter_arch_bp(struct perf_event *bp) | ||
| 88 | { | ||
| 89 | return &bp->hw.info; | ||
| 90 | } | ||
| 91 | |||
| 92 | #else /* !CONFIG_HAVE_HW_BREAKPOINT */ | ||
| 93 | |||
| 94 | static inline struct perf_event * | ||
| 95 | register_user_hw_breakpoint(struct perf_event_attr *attr, | ||
| 96 | perf_callback_t triggered, | ||
| 97 | struct task_struct *tsk) { return NULL; } | ||
| 98 | static inline struct perf_event * | ||
| 99 | modify_user_hw_breakpoint(struct perf_event *bp, | ||
| 100 | struct perf_event_attr *attr, | ||
| 101 | perf_callback_t triggered, | ||
| 102 | struct task_struct *tsk) { return NULL; } | ||
| 103 | static inline struct perf_event * | ||
| 104 | register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr, | ||
| 105 | perf_callback_t triggered, | ||
| 106 | int cpu) { return NULL; } | ||
| 107 | static inline struct perf_event ** | ||
| 108 | register_wide_hw_breakpoint(struct perf_event_attr *attr, | ||
| 109 | perf_callback_t triggered) { return NULL; } | ||
| 110 | static inline int | ||
| 111 | register_perf_hw_breakpoint(struct perf_event *bp) { return -ENOSYS; } | ||
| 112 | static inline int | ||
| 113 | __register_perf_hw_breakpoint(struct perf_event *bp) { return -ENOSYS; } | ||
| 114 | static inline void unregister_hw_breakpoint(struct perf_event *bp) { } | ||
| 115 | static inline void | ||
| 116 | unregister_wide_hw_breakpoint(struct perf_event **cpu_events) { } | ||
| 117 | static inline int | ||
| 118 | reserve_bp_slot(struct perf_event *bp) {return -ENOSYS; } | ||
| 119 | static inline void release_bp_slot(struct perf_event *bp) { } | ||
| 120 | |||
| 121 | static inline void flush_ptrace_hw_breakpoint(struct task_struct *tsk) { } | ||
| 122 | |||
| 123 | static inline struct arch_hw_breakpoint *counter_arch_bp(struct perf_event *bp) | ||
| 124 | { | ||
| 125 | return NULL; | ||
| 126 | } | ||
| 127 | |||
| 128 | #endif /* CONFIG_HAVE_HW_BREAKPOINT */ | ||
| 129 | #endif /* __KERNEL__ */ | ||
| 130 | |||
| 131 | #endif /* _LINUX_HW_BREAKPOINT_H */ | ||
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h index c9087de5c6c6..e844a0b18695 100644 --- a/include/linux/i2c-id.h +++ b/include/linux/i2c-id.h | |||
| @@ -28,17 +28,6 @@ | |||
| 28 | identify a legacy client. If you don't need them, just don't set them. */ | 28 | identify a legacy client. If you don't need them, just don't set them. */ |
| 29 | 29 | ||
| 30 | /* | 30 | /* |
| 31 | * ---- Driver types ----------------------------------------------------- | ||
| 32 | */ | ||
| 33 | |||
| 34 | #define I2C_DRIVERID_MSP3400 1 | ||
| 35 | #define I2C_DRIVERID_TUNER 2 | ||
| 36 | #define I2C_DRIVERID_TDA7432 27 /* Stereo sound processor */ | ||
| 37 | #define I2C_DRIVERID_TVAUDIO 29 /* Generic TV sound driver */ | ||
| 38 | #define I2C_DRIVERID_SAA711X 73 /* saa711x video encoders */ | ||
| 39 | #define I2C_DRIVERID_INFRARED 75 /* I2C InfraRed on Video boards */ | ||
| 40 | |||
| 41 | /* | ||
| 42 | * ---- Adapter types ---------------------------------------------------- | 31 | * ---- Adapter types ---------------------------------------------------- |
| 43 | */ | 32 | */ |
| 44 | 33 | ||
diff --git a/include/linux/i2c-pnx.h b/include/linux/i2c-pnx.h index f13255e06406..9eb07bbc6522 100644 --- a/include/linux/i2c-pnx.h +++ b/include/linux/i2c-pnx.h | |||
| @@ -21,7 +21,7 @@ struct i2c_pnx_mif { | |||
| 21 | int mode; /* Interface mode */ | 21 | int mode; /* Interface mode */ |
| 22 | struct completion complete; /* I/O completion */ | 22 | struct completion complete; /* I/O completion */ |
| 23 | struct timer_list timer; /* Timeout */ | 23 | struct timer_list timer; /* Timeout */ |
| 24 | char * buf; /* Data buffer */ | 24 | u8 * buf; /* Data buffer */ |
| 25 | int len; /* Length of data buffer */ | 25 | int len; /* Length of data buffer */ |
| 26 | }; | 26 | }; |
| 27 | 27 | ||
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index f4784c0fe975..7b40cda57a70 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
| @@ -98,7 +98,6 @@ extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client *client, | |||
| 98 | 98 | ||
| 99 | /** | 99 | /** |
| 100 | * struct i2c_driver - represent an I2C device driver | 100 | * struct i2c_driver - represent an I2C device driver |
| 101 | * @id: Unique driver ID (optional) | ||
| 102 | * @class: What kind of i2c device we instantiate (for detect) | 101 | * @class: What kind of i2c device we instantiate (for detect) |
| 103 | * @attach_adapter: Callback for bus addition (for legacy drivers) | 102 | * @attach_adapter: Callback for bus addition (for legacy drivers) |
| 104 | * @detach_adapter: Callback for bus removal (for legacy drivers) | 103 | * @detach_adapter: Callback for bus removal (for legacy drivers) |
| @@ -135,7 +134,6 @@ extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client *client, | |||
| 135 | * not allowed. | 134 | * not allowed. |
| 136 | */ | 135 | */ |
| 137 | struct i2c_driver { | 136 | struct i2c_driver { |
| 138 | int id; | ||
| 139 | unsigned int class; | 137 | unsigned int class; |
| 140 | 138 | ||
| 141 | /* Notifies the driver that a new bus has appeared or is about to be | 139 | /* Notifies the driver that a new bus has appeared or is about to be |
| @@ -363,6 +361,24 @@ static inline void i2c_set_adapdata(struct i2c_adapter *dev, void *data) | |||
| 363 | dev_set_drvdata(&dev->dev, data); | 361 | dev_set_drvdata(&dev->dev, data); |
| 364 | } | 362 | } |
| 365 | 363 | ||
| 364 | /** | ||
| 365 | * i2c_lock_adapter - Prevent access to an I2C bus segment | ||
| 366 | * @adapter: Target I2C bus segment | ||
| 367 | */ | ||
| 368 | static inline void i2c_lock_adapter(struct i2c_adapter *adapter) | ||
| 369 | { | ||
| 370 | mutex_lock(&adapter->bus_lock); | ||
| 371 | } | ||
| 372 | |||
| 373 | /** | ||
| 374 | * i2c_unlock_adapter - Reauthorize access to an I2C bus segment | ||
| 375 | * @adapter: Target I2C bus segment | ||
| 376 | */ | ||
| 377 | static inline void i2c_unlock_adapter(struct i2c_adapter *adapter) | ||
| 378 | { | ||
| 379 | mutex_unlock(&adapter->bus_lock); | ||
| 380 | } | ||
| 381 | |||
| 366 | /*flags for the client struct: */ | 382 | /*flags for the client struct: */ |
| 367 | #define I2C_CLIENT_PEC 0x04 /* Use Packet Error Checking */ | 383 | #define I2C_CLIENT_PEC 0x04 /* Use Packet Error Checking */ |
| 368 | #define I2C_CLIENT_TEN 0x10 /* we have a ten bit chip address */ | 384 | #define I2C_CLIENT_TEN 0x10 /* we have a ten bit chip address */ |
diff --git a/include/linux/i2c/adp5588.h b/include/linux/i2c/adp5588.h new file mode 100644 index 000000000000..fc5db826b48e --- /dev/null +++ b/include/linux/i2c/adp5588.h | |||
| @@ -0,0 +1,92 @@ | |||
| 1 | /* | ||
| 2 | * Analog Devices ADP5588 I/O Expander and QWERTY Keypad Controller | ||
| 3 | * | ||
| 4 | * Copyright 2009 Analog Devices Inc. | ||
| 5 | * | ||
| 6 | * Licensed under the GPL-2 or later. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #ifndef _ADP5588_H | ||
| 10 | #define _ADP5588_H | ||
| 11 | |||
| 12 | #define DEV_ID 0x00 /* Device ID */ | ||
| 13 | #define CFG 0x01 /* Configuration Register1 */ | ||
| 14 | #define INT_STAT 0x02 /* Interrupt Status Register */ | ||
| 15 | #define KEY_LCK_EC_STAT 0x03 /* Key Lock and Event Counter Register */ | ||
| 16 | #define Key_EVENTA 0x04 /* Key Event Register A */ | ||
| 17 | #define Key_EVENTB 0x05 /* Key Event Register B */ | ||
| 18 | #define Key_EVENTC 0x06 /* Key Event Register C */ | ||
| 19 | #define Key_EVENTD 0x07 /* Key Event Register D */ | ||
| 20 | #define Key_EVENTE 0x08 /* Key Event Register E */ | ||
| 21 | #define Key_EVENTF 0x09 /* Key Event Register F */ | ||
| 22 | #define Key_EVENTG 0x0A /* Key Event Register G */ | ||
| 23 | #define Key_EVENTH 0x0B /* Key Event Register H */ | ||
| 24 | #define Key_EVENTI 0x0C /* Key Event Register I */ | ||
| 25 | #define Key_EVENTJ 0x0D /* Key Event Register J */ | ||
| 26 | #define KP_LCK_TMR 0x0E /* Keypad Lock1 to Lock2 Timer */ | ||
| 27 | #define UNLOCK1 0x0F /* Unlock Key1 */ | ||
| 28 | #define UNLOCK2 0x10 /* Unlock Key2 */ | ||
| 29 | #define GPIO_INT_STAT1 0x11 /* GPIO Interrupt Status */ | ||
| 30 | #define GPIO_INT_STAT2 0x12 /* GPIO Interrupt Status */ | ||
| 31 | #define GPIO_INT_STAT3 0x13 /* GPIO Interrupt Status */ | ||
| 32 | #define GPIO_DAT_STAT1 0x14 /* GPIO Data Status, Read twice to clear */ | ||
| 33 | #define GPIO_DAT_STAT2 0x15 /* GPIO Data Status, Read twice to clear */ | ||
| 34 | #define GPIO_DAT_STAT3 0x16 /* GPIO Data Status, Read twice to clear */ | ||
| 35 | #define GPIO_DAT_OUT1 0x17 /* GPIO DATA OUT */ | ||
| 36 | #define GPIO_DAT_OUT2 0x18 /* GPIO DATA OUT */ | ||
| 37 | #define GPIO_DAT_OUT3 0x19 /* GPIO DATA OUT */ | ||
| 38 | #define GPIO_INT_EN1 0x1A /* GPIO Interrupt Enable */ | ||
| 39 | #define GPIO_INT_EN2 0x1B /* GPIO Interrupt Enable */ | ||
| 40 | #define GPIO_INT_EN3 0x1C /* GPIO Interrupt Enable */ | ||
| 41 | #define KP_GPIO1 0x1D /* Keypad or GPIO Selection */ | ||
| 42 | #define KP_GPIO2 0x1E /* Keypad or GPIO Selection */ | ||
| 43 | #define KP_GPIO3 0x1F /* Keypad or GPIO Selection */ | ||
| 44 | #define GPI_EM1 0x20 /* GPI Event Mode 1 */ | ||
| 45 | #define GPI_EM2 0x21 /* GPI Event Mode 2 */ | ||
| 46 | #define GPI_EM3 0x22 /* GPI Event Mode 3 */ | ||
| 47 | #define GPIO_DIR1 0x23 /* GPIO Data Direction */ | ||
| 48 | #define GPIO_DIR2 0x24 /* GPIO Data Direction */ | ||
| 49 | #define GPIO_DIR3 0x25 /* GPIO Data Direction */ | ||
| 50 | #define GPIO_INT_LVL1 0x26 /* GPIO Edge/Level Detect */ | ||
| 51 | #define GPIO_INT_LVL2 0x27 /* GPIO Edge/Level Detect */ | ||
| 52 | #define GPIO_INT_LVL3 0x28 /* GPIO Edge/Level Detect */ | ||
| 53 | #define Debounce_DIS1 0x29 /* Debounce Disable */ | ||
| 54 | #define Debounce_DIS2 0x2A /* Debounce Disable */ | ||
| 55 | #define Debounce_DIS3 0x2B /* Debounce Disable */ | ||
| 56 | #define GPIO_PULL1 0x2C /* GPIO Pull Disable */ | ||
| 57 | #define GPIO_PULL2 0x2D /* GPIO Pull Disable */ | ||
| 58 | #define GPIO_PULL3 0x2E /* GPIO Pull Disable */ | ||
| 59 | #define CMP_CFG_STAT 0x30 /* Comparator Configuration and Status Register */ | ||
| 60 | #define CMP_CONFG_SENS1 0x31 /* Sensor1 Comparator Configuration Register */ | ||
| 61 | #define CMP_CONFG_SENS2 0x32 /* L2 Light Sensor Reference Level, Output Falling for Sensor 1 */ | ||
| 62 | #define CMP1_LVL2_TRIP 0x33 /* L2 Light Sensor Hysteresis (Active when Output Rising) for Sensor 1 */ | ||
| 63 | #define CMP1_LVL2_HYS 0x34 /* L3 Light Sensor Reference Level, Output Falling For Sensor 1 */ | ||
| 64 | #define CMP1_LVL3_TRIP 0x35 /* L3 Light Sensor Hysteresis (Active when Output Rising) For Sensor 1 */ | ||
| 65 | #define CMP1_LVL3_HYS 0x36 /* Sensor 2 Comparator Configuration Register */ | ||
| 66 | #define CMP2_LVL2_TRIP 0x37 /* L2 Light Sensor Reference Level, Output Falling for Sensor 2 */ | ||
| 67 | #define CMP2_LVL2_HYS 0x38 /* L2 Light Sensor Hysteresis (Active when Output Rising) for Sensor 2 */ | ||
| 68 | #define CMP2_LVL3_TRIP 0x39 /* L3 Light Sensor Reference Level, Output Falling For Sensor 2 */ | ||
| 69 | #define CMP2_LVL3_HYS 0x3A /* L3 Light Sensor Hysteresis (Active when Output Rising) For Sensor 2 */ | ||
| 70 | #define CMP1_ADC_DAT_R1 0x3B /* Comparator 1 ADC data Register1 */ | ||
| 71 | #define CMP1_ADC_DAT_R2 0x3C /* Comparator 1 ADC data Register2 */ | ||
| 72 | #define CMP2_ADC_DAT_R1 0x3D /* Comparator 2 ADC data Register1 */ | ||
| 73 | #define CMP2_ADC_DAT_R2 0x3E /* Comparator 2 ADC data Register2 */ | ||
| 74 | |||
| 75 | #define ADP5588_DEVICE_ID_MASK 0xF | ||
| 76 | |||
| 77 | /* Put one of these structures in i2c_board_info platform_data */ | ||
| 78 | |||
| 79 | #define ADP5588_KEYMAPSIZE 80 | ||
| 80 | |||
| 81 | struct adp5588_kpad_platform_data { | ||
| 82 | int rows; /* Number of rows */ | ||
| 83 | int cols; /* Number of columns */ | ||
| 84 | const unsigned short *keymap; /* Pointer to keymap */ | ||
| 85 | unsigned short keymapsize; /* Keymap size */ | ||
| 86 | unsigned repeat:1; /* Enable key repeat */ | ||
| 87 | unsigned en_keylock:1; /* Enable Key Lock feature */ | ||
| 88 | unsigned short unlock_key1; /* Unlock Key 1 */ | ||
| 89 | unsigned short unlock_key2; /* Unlock Key 2 */ | ||
| 90 | }; | ||
| 91 | |||
| 92 | #endif | ||
diff --git a/include/linux/i2c/mcs5000_ts.h b/include/linux/i2c/mcs5000_ts.h new file mode 100644 index 000000000000..5a117b5ca15e --- /dev/null +++ b/include/linux/i2c/mcs5000_ts.h | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | /* | ||
| 2 | * mcs5000_ts.h | ||
| 3 | * | ||
| 4 | * Copyright (C) 2009 Samsung Electronics Co.Ltd | ||
| 5 | * Author: Joonyoung Shim <jy0922.shim@samsung.com> | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify it | ||
| 8 | * under the terms of the GNU General Public License as published by the | ||
| 9 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 10 | * option) any later version. | ||
| 11 | * | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __LINUX_MCS5000_TS_H | ||
| 15 | #define __LINUX_MCS5000_TS_H | ||
| 16 | |||
| 17 | /* platform data for the MELFAS MCS-5000 touchscreen driver */ | ||
| 18 | struct mcs5000_ts_platform_data { | ||
| 19 | void (*cfg_pin)(void); | ||
| 20 | int x_size; | ||
| 21 | int y_size; | ||
| 22 | }; | ||
| 23 | |||
| 24 | #endif /* __LINUX_MCS5000_TS_H */ | ||
diff --git a/include/linux/i2c/twl4030.h b/include/linux/i2c/twl4030.h index 0dc80ef24975..508824ee35e6 100644 --- a/include/linux/i2c/twl4030.h +++ b/include/linux/i2c/twl4030.h | |||
| @@ -25,6 +25,9 @@ | |||
| 25 | #ifndef __TWL4030_H_ | 25 | #ifndef __TWL4030_H_ |
| 26 | #define __TWL4030_H_ | 26 | #define __TWL4030_H_ |
| 27 | 27 | ||
| 28 | #include <linux/types.h> | ||
| 29 | #include <linux/input/matrix_keypad.h> | ||
| 30 | |||
| 28 | /* | 31 | /* |
| 29 | * Using the twl4030 core we address registers using a pair | 32 | * Using the twl4030 core we address registers using a pair |
| 30 | * { module id, relative register offset } | 33 | * { module id, relative register offset } |
| @@ -220,19 +223,28 @@ int twl4030_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); | |||
| 220 | 223 | ||
| 221 | /* Power bus message definitions */ | 224 | /* Power bus message definitions */ |
| 222 | 225 | ||
| 223 | #define DEV_GRP_NULL 0x0 | 226 | /* The TWL4030/5030 splits its power-management resources (the various |
| 224 | #define DEV_GRP_P1 0x1 | 227 | * regulators, clock and reset lines) into 3 processor groups - P1, P2 and |
| 225 | #define DEV_GRP_P2 0x2 | 228 | * P3. These groups can then be configured to transition between sleep, wait-on |
| 226 | #define DEV_GRP_P3 0x4 | 229 | * and active states by sending messages to the power bus. See Section 5.4.2 |
| 230 | * Power Resources of TWL4030 TRM | ||
| 231 | */ | ||
| 227 | 232 | ||
| 228 | #define RES_GRP_RES 0x0 | 233 | /* Processor groups */ |
| 229 | #define RES_GRP_PP 0x1 | 234 | #define DEV_GRP_NULL 0x0 |
| 230 | #define RES_GRP_RC 0x2 | 235 | #define DEV_GRP_P1 0x1 /* P1: all OMAP devices */ |
| 236 | #define DEV_GRP_P2 0x2 /* P2: all Modem devices */ | ||
| 237 | #define DEV_GRP_P3 0x4 /* P3: all peripheral devices */ | ||
| 238 | |||
| 239 | /* Resource groups */ | ||
| 240 | #define RES_GRP_RES 0x0 /* Reserved */ | ||
| 241 | #define RES_GRP_PP 0x1 /* Power providers */ | ||
| 242 | #define RES_GRP_RC 0x2 /* Reset and control */ | ||
| 231 | #define RES_GRP_PP_RC 0x3 | 243 | #define RES_GRP_PP_RC 0x3 |
| 232 | #define RES_GRP_PR 0x4 | 244 | #define RES_GRP_PR 0x4 /* Power references */ |
| 233 | #define RES_GRP_PP_PR 0x5 | 245 | #define RES_GRP_PP_PR 0x5 |
| 234 | #define RES_GRP_RC_PR 0x6 | 246 | #define RES_GRP_RC_PR 0x6 |
| 235 | #define RES_GRP_ALL 0x7 | 247 | #define RES_GRP_ALL 0x7 /* All resource groups */ |
| 236 | 248 | ||
| 237 | #define RES_TYPE2_R0 0x0 | 249 | #define RES_TYPE2_R0 0x0 |
| 238 | 250 | ||
| @@ -243,6 +255,41 @@ int twl4030_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); | |||
| 243 | #define RES_STATE_SLEEP 0x8 | 255 | #define RES_STATE_SLEEP 0x8 |
| 244 | #define RES_STATE_OFF 0x0 | 256 | #define RES_STATE_OFF 0x0 |
| 245 | 257 | ||
| 258 | /* Power resources */ | ||
| 259 | |||
| 260 | /* Power providers */ | ||
| 261 | #define RES_VAUX1 1 | ||
| 262 | #define RES_VAUX2 2 | ||
| 263 | #define RES_VAUX3 3 | ||
| 264 | #define RES_VAUX4 4 | ||
| 265 | #define RES_VMMC1 5 | ||
| 266 | #define RES_VMMC2 6 | ||
| 267 | #define RES_VPLL1 7 | ||
| 268 | #define RES_VPLL2 8 | ||
| 269 | #define RES_VSIM 9 | ||
| 270 | #define RES_VDAC 10 | ||
| 271 | #define RES_VINTANA1 11 | ||
| 272 | #define RES_VINTANA2 12 | ||
| 273 | #define RES_VINTDIG 13 | ||
| 274 | #define RES_VIO 14 | ||
| 275 | #define RES_VDD1 15 | ||
| 276 | #define RES_VDD2 16 | ||
| 277 | #define RES_VUSB_1V5 17 | ||
| 278 | #define RES_VUSB_1V8 18 | ||
| 279 | #define RES_VUSB_3V1 19 | ||
| 280 | #define RES_VUSBCP 20 | ||
| 281 | #define RES_REGEN 21 | ||
| 282 | /* Reset and control */ | ||
| 283 | #define RES_NRES_PWRON 22 | ||
| 284 | #define RES_CLKEN 23 | ||
| 285 | #define RES_SYSEN 24 | ||
| 286 | #define RES_HFCLKOUT 25 | ||
| 287 | #define RES_32KCLKOUT 26 | ||
| 288 | #define RES_RESET 27 | ||
| 289 | /* Power Reference */ | ||
| 290 | #define RES_Main_Ref 28 | ||
| 291 | |||
| 292 | #define TOTAL_RESOURCES 28 | ||
| 246 | /* | 293 | /* |
| 247 | * Power Bus Message Format ... these can be sent individually by Linux, | 294 | * Power Bus Message Format ... these can be sent individually by Linux, |
| 248 | * but are usually part of downloaded scripts that are run when various | 295 | * but are usually part of downloaded scripts that are run when various |
| @@ -302,13 +349,17 @@ struct twl4030_madc_platform_data { | |||
| 302 | int irq_line; | 349 | int irq_line; |
| 303 | }; | 350 | }; |
| 304 | 351 | ||
| 352 | /* Boards have uniqe mappings of {row, col} --> keycode. | ||
| 353 | * Column and row are 8 bits each, but range only from 0..7. | ||
| 354 | * a PERSISTENT_KEY is "always on" and never reported. | ||
| 355 | */ | ||
| 356 | #define PERSISTENT_KEY(r, c) KEY((r), (c), KEY_RESERVED) | ||
| 357 | |||
| 305 | struct twl4030_keypad_data { | 358 | struct twl4030_keypad_data { |
| 306 | int rows; | 359 | const struct matrix_keymap_data *keymap_data; |
| 307 | int cols; | 360 | unsigned rows; |
| 308 | int *keymap; | 361 | unsigned cols; |
| 309 | int irq; | 362 | bool rep; |
| 310 | unsigned int keymapsize; | ||
| 311 | unsigned int rep:1; | ||
| 312 | }; | 363 | }; |
| 313 | 364 | ||
| 314 | enum twl4030_usb_mode { | 365 | enum twl4030_usb_mode { |
| @@ -320,6 +371,36 @@ struct twl4030_usb_data { | |||
| 320 | enum twl4030_usb_mode usb_mode; | 371 | enum twl4030_usb_mode usb_mode; |
| 321 | }; | 372 | }; |
| 322 | 373 | ||
| 374 | struct twl4030_ins { | ||
| 375 | u16 pmb_message; | ||
| 376 | u8 delay; | ||
| 377 | }; | ||
| 378 | |||
| 379 | struct twl4030_script { | ||
| 380 | struct twl4030_ins *script; | ||
| 381 | unsigned size; | ||
| 382 | u8 flags; | ||
| 383 | #define TWL4030_WRST_SCRIPT (1<<0) | ||
| 384 | #define TWL4030_WAKEUP12_SCRIPT (1<<1) | ||
| 385 | #define TWL4030_WAKEUP3_SCRIPT (1<<2) | ||
| 386 | #define TWL4030_SLEEP_SCRIPT (1<<3) | ||
| 387 | }; | ||
| 388 | |||
| 389 | struct twl4030_resconfig { | ||
| 390 | u8 resource; | ||
| 391 | u8 devgroup; /* Processor group that Power resource belongs to */ | ||
| 392 | u8 type; /* Power resource addressed, 6 / broadcast message */ | ||
| 393 | u8 type2; /* Power resource addressed, 3 / broadcast message */ | ||
| 394 | }; | ||
| 395 | |||
| 396 | struct twl4030_power_data { | ||
| 397 | struct twl4030_script **scripts; | ||
| 398 | unsigned num; | ||
| 399 | struct twl4030_resconfig *resource_config; | ||
| 400 | }; | ||
| 401 | |||
| 402 | extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts); | ||
| 403 | |||
| 323 | struct twl4030_platform_data { | 404 | struct twl4030_platform_data { |
| 324 | unsigned irq_base, irq_end; | 405 | unsigned irq_base, irq_end; |
| 325 | struct twl4030_bci_platform_data *bci; | 406 | struct twl4030_bci_platform_data *bci; |
| @@ -327,6 +408,7 @@ struct twl4030_platform_data { | |||
| 327 | struct twl4030_madc_platform_data *madc; | 408 | struct twl4030_madc_platform_data *madc; |
| 328 | struct twl4030_keypad_data *keypad; | 409 | struct twl4030_keypad_data *keypad; |
| 329 | struct twl4030_usb_data *usb; | 410 | struct twl4030_usb_data *usb; |
| 411 | struct twl4030_power_data *power; | ||
| 330 | 412 | ||
| 331 | /* LDO regulators */ | 413 | /* LDO regulators */ |
| 332 | struct regulator_init_data *vdac; | 414 | struct regulator_init_data *vdac; |
| @@ -357,7 +439,6 @@ int twl4030_sih_setup(int module); | |||
| 357 | #define TWL4030_VAUX3_DEV_GRP 0x1F | 439 | #define TWL4030_VAUX3_DEV_GRP 0x1F |
| 358 | #define TWL4030_VAUX3_DEDICATED 0x22 | 440 | #define TWL4030_VAUX3_DEDICATED 0x22 |
| 359 | 441 | ||
| 360 | |||
| 361 | #if defined(CONFIG_TWL4030_BCI_BATTERY) || \ | 442 | #if defined(CONFIG_TWL4030_BCI_BATTERY) || \ |
| 362 | defined(CONFIG_TWL4030_BCI_BATTERY_MODULE) | 443 | defined(CONFIG_TWL4030_BCI_BATTERY_MODULE) |
| 363 | extern int twl4030charger_usb_en(int enable); | 444 | extern int twl4030charger_usb_en(int enable); |
diff --git a/include/linux/i8042.h b/include/linux/i8042.h index 7907a72403ee..60c3360ef6ad 100644 --- a/include/linux/i8042.h +++ b/include/linux/i8042.h | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | * the Free Software Foundation. | 7 | * the Free Software Foundation. |
| 8 | */ | 8 | */ |
| 9 | 9 | ||
| 10 | #include <linux/types.h> | ||
| 10 | 11 | ||
| 11 | /* | 12 | /* |
| 12 | * Standard commands. | 13 | * Standard commands. |
| @@ -30,6 +31,35 @@ | |||
| 30 | #define I8042_CMD_MUX_PFX 0x0090 | 31 | #define I8042_CMD_MUX_PFX 0x0090 |
| 31 | #define I8042_CMD_MUX_SEND 0x1090 | 32 | #define I8042_CMD_MUX_SEND 0x1090 |
| 32 | 33 | ||
| 34 | struct serio; | ||
| 35 | |||
| 36 | #if defined(CONFIG_SERIO_I8042) || defined(CONFIG_SERIO_I8042_MODULE) | ||
| 37 | |||
| 38 | void i8042_lock_chip(void); | ||
| 39 | void i8042_unlock_chip(void); | ||
| 33 | int i8042_command(unsigned char *param, int command); | 40 | int i8042_command(unsigned char *param, int command); |
| 41 | bool i8042_check_port_owner(const struct serio *); | ||
| 42 | |||
| 43 | #else | ||
| 44 | |||
| 45 | void i8042_lock_chip(void) | ||
| 46 | { | ||
| 47 | } | ||
| 48 | |||
| 49 | void i8042_unlock_chip(void) | ||
| 50 | { | ||
| 51 | } | ||
| 52 | |||
| 53 | int i8042_command(unsigned char *param, int command) | ||
| 54 | { | ||
| 55 | return -ENOSYS; | ||
| 56 | } | ||
| 57 | |||
| 58 | bool i8042_check_port_owner(const struct serio *serio) | ||
| 59 | { | ||
| 60 | return false; | ||
| 61 | } | ||
| 62 | |||
| 63 | #endif | ||
| 34 | 64 | ||
| 35 | #endif | 65 | #endif |
diff --git a/include/linux/icmpv6.h b/include/linux/icmpv6.h index b6a85183c333..c0d8357917e2 100644 --- a/include/linux/icmpv6.h +++ b/include/linux/icmpv6.h | |||
| @@ -171,8 +171,6 @@ struct icmp6_filter { | |||
| 171 | #ifdef __KERNEL__ | 171 | #ifdef __KERNEL__ |
| 172 | 172 | ||
| 173 | #include <linux/netdevice.h> | 173 | #include <linux/netdevice.h> |
| 174 | #include <linux/skbuff.h> | ||
| 175 | |||
| 176 | 174 | ||
| 177 | extern void icmpv6_send(struct sk_buff *skb, | 175 | extern void icmpv6_send(struct sk_buff *skb, |
| 178 | u8 type, u8 code, | 176 | u8 type, u8 code, |
diff --git a/include/linux/ide.h b/include/linux/ide.h index edc93a6d931d..e4135d6e0556 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
| @@ -258,6 +258,7 @@ enum { | |||
| 258 | IDE_TFLAG_DYN = (1 << 5), | 258 | IDE_TFLAG_DYN = (1 << 5), |
| 259 | IDE_TFLAG_FS = (1 << 6), | 259 | IDE_TFLAG_FS = (1 << 6), |
| 260 | IDE_TFLAG_MULTI_PIO = (1 << 7), | 260 | IDE_TFLAG_MULTI_PIO = (1 << 7), |
| 261 | IDE_TFLAG_SET_XFER = (1 << 8), | ||
| 261 | }; | 262 | }; |
| 262 | 263 | ||
| 263 | enum { | 264 | enum { |
| @@ -294,7 +295,7 @@ struct ide_cmd { | |||
| 294 | } out, in; | 295 | } out, in; |
| 295 | } valid; | 296 | } valid; |
| 296 | 297 | ||
| 297 | u8 tf_flags; | 298 | u16 tf_flags; |
| 298 | u8 ftf_flags; /* for TASKFILE ioctl */ | 299 | u8 ftf_flags; /* for TASKFILE ioctl */ |
| 299 | int protocol; | 300 | int protocol; |
| 300 | 301 | ||
| @@ -918,8 +919,7 @@ __IDE_PROC_DEVSET(_name, _min, _max, NULL, NULL) | |||
| 918 | typedef struct { | 919 | typedef struct { |
| 919 | const char *name; | 920 | const char *name; |
| 920 | mode_t mode; | 921 | mode_t mode; |
| 921 | read_proc_t *read_proc; | 922 | const struct file_operations *proc_fops; |
| 922 | write_proc_t *write_proc; | ||
| 923 | } ide_proc_entry_t; | 923 | } ide_proc_entry_t; |
| 924 | 924 | ||
| 925 | void proc_ide_create(void); | 925 | void proc_ide_create(void); |
| @@ -931,24 +931,8 @@ void ide_proc_unregister_port(ide_hwif_t *); | |||
| 931 | void ide_proc_register_driver(ide_drive_t *, struct ide_driver *); | 931 | void ide_proc_register_driver(ide_drive_t *, struct ide_driver *); |
| 932 | void ide_proc_unregister_driver(ide_drive_t *, struct ide_driver *); | 932 | void ide_proc_unregister_driver(ide_drive_t *, struct ide_driver *); |
| 933 | 933 | ||
| 934 | read_proc_t proc_ide_read_capacity; | 934 | extern const struct file_operations ide_capacity_proc_fops; |
| 935 | read_proc_t proc_ide_read_geometry; | 935 | extern const struct file_operations ide_geometry_proc_fops; |
| 936 | |||
| 937 | /* | ||
| 938 | * Standard exit stuff: | ||
| 939 | */ | ||
| 940 | #define PROC_IDE_READ_RETURN(page,start,off,count,eof,len) \ | ||
| 941 | { \ | ||
| 942 | len -= off; \ | ||
| 943 | if (len < count) { \ | ||
| 944 | *eof = 1; \ | ||
| 945 | if (len <= 0) \ | ||
| 946 | return 0; \ | ||
| 947 | } else \ | ||
| 948 | len = count; \ | ||
| 949 | *start = page + off; \ | ||
| 950 | return len; \ | ||
| 951 | } | ||
| 952 | #else | 936 | #else |
| 953 | static inline void proc_ide_create(void) { ; } | 937 | static inline void proc_ide_create(void) { ; } |
| 954 | static inline void proc_ide_destroy(void) { ; } | 938 | static inline void proc_ide_destroy(void) { ; } |
| @@ -960,7 +944,6 @@ static inline void ide_proc_register_driver(ide_drive_t *drive, | |||
| 960 | struct ide_driver *driver) { ; } | 944 | struct ide_driver *driver) { ; } |
| 961 | static inline void ide_proc_unregister_driver(ide_drive_t *drive, | 945 | static inline void ide_proc_unregister_driver(ide_drive_t *drive, |
| 962 | struct ide_driver *driver) { ; } | 946 | struct ide_driver *driver) { ; } |
| 963 | #define PROC_IDE_READ_RETURN(page,start,off,count,eof,len) return 0; | ||
| 964 | #endif | 947 | #endif |
| 965 | 948 | ||
| 966 | enum { | 949 | enum { |
| @@ -1081,6 +1064,7 @@ extern void ide_fixstring(u8 *, const int, const int); | |||
| 1081 | 1064 | ||
| 1082 | int ide_busy_sleep(ide_drive_t *, unsigned long, int); | 1065 | int ide_busy_sleep(ide_drive_t *, unsigned long, int); |
| 1083 | 1066 | ||
| 1067 | int __ide_wait_stat(ide_drive_t *, u8, u8, unsigned long, u8 *); | ||
| 1084 | int ide_wait_stat(ide_startstop_t *, ide_drive_t *, u8, u8, unsigned long); | 1068 | int ide_wait_stat(ide_startstop_t *, ide_drive_t *, u8, u8, unsigned long); |
| 1085 | 1069 | ||
| 1086 | ide_startstop_t ide_do_park_unpark(ide_drive_t *, struct request *); | 1070 | ide_startstop_t ide_do_park_unpark(ide_drive_t *, struct request *); |
| @@ -1169,7 +1153,7 @@ int ide_no_data_taskfile(ide_drive_t *, struct ide_cmd *); | |||
| 1169 | 1153 | ||
| 1170 | int ide_taskfile_ioctl(ide_drive_t *, unsigned long); | 1154 | int ide_taskfile_ioctl(ide_drive_t *, unsigned long); |
| 1171 | 1155 | ||
| 1172 | int ide_dev_read_id(ide_drive_t *, u8, u16 *); | 1156 | int ide_dev_read_id(ide_drive_t *, u8, u16 *, int); |
| 1173 | 1157 | ||
| 1174 | extern int ide_driveid_update(ide_drive_t *); | 1158 | extern int ide_driveid_update(ide_drive_t *); |
| 1175 | extern int ide_config_drive_speed(ide_drive_t *, u8); | 1159 | extern int ide_config_drive_speed(ide_drive_t *, u8); |
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index a9173d5434d1..52e15e079c61 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h | |||
| @@ -115,7 +115,7 @@ | |||
| 115 | #define IEEE80211_MAX_SSID_LEN 32 | 115 | #define IEEE80211_MAX_SSID_LEN 32 |
| 116 | 116 | ||
| 117 | #define IEEE80211_MAX_MESH_ID_LEN 32 | 117 | #define IEEE80211_MAX_MESH_ID_LEN 32 |
| 118 | #define IEEE80211_MESH_CONFIG_LEN 19 | 118 | #define IEEE80211_MESH_CONFIG_LEN 24 |
| 119 | 119 | ||
| 120 | #define IEEE80211_QOS_CTL_LEN 2 | 120 | #define IEEE80211_QOS_CTL_LEN 2 |
| 121 | #define IEEE80211_QOS_CTL_TID_MASK 0x000F | 121 | #define IEEE80211_QOS_CTL_TID_MASK 0x000F |
| @@ -802,6 +802,31 @@ struct ieee80211_ht_cap { | |||
| 802 | #define IEEE80211_HT_AMPDU_PARM_FACTOR 0x03 | 802 | #define IEEE80211_HT_AMPDU_PARM_FACTOR 0x03 |
| 803 | #define IEEE80211_HT_AMPDU_PARM_DENSITY 0x1C | 803 | #define IEEE80211_HT_AMPDU_PARM_DENSITY 0x1C |
| 804 | 804 | ||
| 805 | /* | ||
| 806 | * Maximum length of AMPDU that the STA can receive. | ||
| 807 | * Length = 2 ^ (13 + max_ampdu_length_exp) - 1 (octets) | ||
| 808 | */ | ||
| 809 | enum ieee80211_max_ampdu_length_exp { | ||
| 810 | IEEE80211_HT_MAX_AMPDU_8K = 0, | ||
| 811 | IEEE80211_HT_MAX_AMPDU_16K = 1, | ||
| 812 | IEEE80211_HT_MAX_AMPDU_32K = 2, | ||
| 813 | IEEE80211_HT_MAX_AMPDU_64K = 3 | ||
| 814 | }; | ||
| 815 | |||
| 816 | #define IEEE80211_HT_MAX_AMPDU_FACTOR 13 | ||
| 817 | |||
| 818 | /* Minimum MPDU start spacing */ | ||
| 819 | enum ieee80211_min_mpdu_spacing { | ||
| 820 | IEEE80211_HT_MPDU_DENSITY_NONE = 0, /* No restriction */ | ||
| 821 | IEEE80211_HT_MPDU_DENSITY_0_25 = 1, /* 1/4 usec */ | ||
| 822 | IEEE80211_HT_MPDU_DENSITY_0_5 = 2, /* 1/2 usec */ | ||
| 823 | IEEE80211_HT_MPDU_DENSITY_1 = 3, /* 1 usec */ | ||
| 824 | IEEE80211_HT_MPDU_DENSITY_2 = 4, /* 2 usec */ | ||
| 825 | IEEE80211_HT_MPDU_DENSITY_4 = 5, /* 4 usec */ | ||
| 826 | IEEE80211_HT_MPDU_DENSITY_8 = 6, /* 8 usec */ | ||
| 827 | IEEE80211_HT_MPDU_DENSITY_16 = 7 /* 16 usec */ | ||
| 828 | }; | ||
| 829 | |||
| 805 | /** | 830 | /** |
| 806 | * struct ieee80211_ht_info - HT information | 831 | * struct ieee80211_ht_info - HT information |
| 807 | * | 832 | * |
| @@ -1196,6 +1221,10 @@ enum ieee80211_sa_query_action { | |||
| 1196 | #define WLAN_CIPHER_SUITE_WEP104 0x000FAC05 | 1221 | #define WLAN_CIPHER_SUITE_WEP104 0x000FAC05 |
| 1197 | #define WLAN_CIPHER_SUITE_AES_CMAC 0x000FAC06 | 1222 | #define WLAN_CIPHER_SUITE_AES_CMAC 0x000FAC06 |
| 1198 | 1223 | ||
| 1224 | /* AKM suite selectors */ | ||
| 1225 | #define WLAN_AKM_SUITE_8021X 0x000FAC01 | ||
| 1226 | #define WLAN_AKM_SUITE_PSK 0x000FAC02 | ||
| 1227 | |||
| 1199 | #define WLAN_MAX_KEY_LEN 32 | 1228 | #define WLAN_MAX_KEY_LEN 32 |
| 1200 | 1229 | ||
| 1201 | /** | 1230 | /** |
diff --git a/include/linux/if_addr.h b/include/linux/if_addr.h index a60c821be44c..fd9740466757 100644 --- a/include/linux/if_addr.h +++ b/include/linux/if_addr.h | |||
| @@ -41,6 +41,7 @@ enum | |||
| 41 | 41 | ||
| 42 | #define IFA_F_NODAD 0x02 | 42 | #define IFA_F_NODAD 0x02 |
| 43 | #define IFA_F_OPTIMISTIC 0x04 | 43 | #define IFA_F_OPTIMISTIC 0x04 |
| 44 | #define IFA_F_DADFAILED 0x08 | ||
| 44 | #define IFA_F_HOMEADDRESS 0x10 | 45 | #define IFA_F_HOMEADDRESS 0x10 |
| 45 | #define IFA_F_DEPRECATED 0x20 | 46 | #define IFA_F_DEPRECATED 0x20 |
| 46 | #define IFA_F_TENTATIVE 0x40 | 47 | #define IFA_F_TENTATIVE 0x40 |
diff --git a/include/linux/if_arp.h b/include/linux/if_arp.h index b554300ef8bf..282eb37e2dec 100644 --- a/include/linux/if_arp.h +++ b/include/linux/if_arp.h | |||
| @@ -87,7 +87,6 @@ | |||
| 87 | #define ARPHRD_IEEE80211_PRISM 802 /* IEEE 802.11 + Prism2 header */ | 87 | #define ARPHRD_IEEE80211_PRISM 802 /* IEEE 802.11 + Prism2 header */ |
| 88 | #define ARPHRD_IEEE80211_RADIOTAP 803 /* IEEE 802.11 + radiotap header */ | 88 | #define ARPHRD_IEEE80211_RADIOTAP 803 /* IEEE 802.11 + radiotap header */ |
| 89 | #define ARPHRD_IEEE802154 804 | 89 | #define ARPHRD_IEEE802154 804 |
| 90 | #define ARPHRD_IEEE802154_PHY 805 | ||
| 91 | 90 | ||
| 92 | #define ARPHRD_PHONET 820 /* PhoNet media type */ | 91 | #define ARPHRD_PHONET 820 /* PhoNet media type */ |
| 93 | #define ARPHRD_PHONET_PIPE 821 /* PhoNet pipe header */ | 92 | #define ARPHRD_PHONET_PIPE 821 /* PhoNet pipe header */ |
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h index 70fdba2bbf71..580b6004d00e 100644 --- a/include/linux/if_ether.h +++ b/include/linux/if_ether.h | |||
| @@ -139,10 +139,10 @@ extern ssize_t sysfs_format_mac(char *buf, const unsigned char *addr, int len); | |||
| 139 | /* | 139 | /* |
| 140 | * Display a 6 byte device address (MAC) in a readable format. | 140 | * Display a 6 byte device address (MAC) in a readable format. |
| 141 | */ | 141 | */ |
| 142 | extern char *print_mac(char *buf, const unsigned char *addr); | 142 | extern char *print_mac(char *buf, const unsigned char *addr) __deprecated; |
| 143 | #define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x" | 143 | #define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x" |
| 144 | #define MAC_BUF_SIZE 18 | 144 | #define MAC_BUF_SIZE 18 |
| 145 | #define DECLARE_MAC_BUF(var) char var[MAC_BUF_SIZE] __maybe_unused | 145 | #define DECLARE_MAC_BUF(var) char var[MAC_BUF_SIZE] |
| 146 | 146 | ||
| 147 | #endif | 147 | #endif |
| 148 | 148 | ||
diff --git a/include/linux/if_frad.h b/include/linux/if_frad.h index 673f2209453d..80b3a1056a5f 100644 --- a/include/linux/if_frad.h +++ b/include/linux/if_frad.h | |||
| @@ -69,11 +69,6 @@ struct dlci_conf { | |||
| 69 | 69 | ||
| 70 | #define DLCI_VALID_FLAGS 0x000B | 70 | #define DLCI_VALID_FLAGS 0x000B |
| 71 | 71 | ||
| 72 | /* FRAD driver uses these to indicate what it did with packet */ | ||
| 73 | #define DLCI_RET_OK 0x00 | ||
| 74 | #define DLCI_RET_ERR 0x01 | ||
| 75 | #define DLCI_RET_DROP 0x02 | ||
| 76 | |||
| 77 | /* defines for the actual Frame Relay hardware */ | 72 | /* defines for the actual Frame Relay hardware */ |
| 78 | #define FRAD_GET_CONF (SIOCDEVPRIVATE) | 73 | #define FRAD_GET_CONF (SIOCDEVPRIVATE) |
| 79 | #define FRAD_SET_CONF (SIOCDEVPRIVATE + 1) | 74 | #define FRAD_SET_CONF (SIOCDEVPRIVATE + 1) |
diff --git a/include/linux/if_tun.h b/include/linux/if_tun.h index 915ba5789f0e..3f5fd523b49d 100644 --- a/include/linux/if_tun.h +++ b/include/linux/if_tun.h | |||
| @@ -62,6 +62,7 @@ | |||
| 62 | #define TUN_F_TSO4 0x02 /* I can handle TSO for IPv4 packets */ | 62 | #define TUN_F_TSO4 0x02 /* I can handle TSO for IPv4 packets */ |
| 63 | #define TUN_F_TSO6 0x04 /* I can handle TSO for IPv6 packets */ | 63 | #define TUN_F_TSO6 0x04 /* I can handle TSO for IPv6 packets */ |
| 64 | #define TUN_F_TSO_ECN 0x08 /* I can handle TSO with ECN bits. */ | 64 | #define TUN_F_TSO_ECN 0x08 /* I can handle TSO with ECN bits. */ |
| 65 | #define TUN_F_UFO 0x10 /* I can handle UFO packets */ | ||
| 65 | 66 | ||
| 66 | /* Protocol info prepended to the packets (when IFF_NO_PI is not set) */ | 67 | /* Protocol info prepended to the packets (when IFF_NO_PI is not set) */ |
| 67 | #define TUN_PKT_STRIP 0x0001 | 68 | #define TUN_PKT_STRIP 0x0001 |
diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h index 5eb9b0f857e0..5a9aae4adb44 100644 --- a/include/linux/if_tunnel.h +++ b/include/linux/if_tunnel.h | |||
| @@ -44,7 +44,7 @@ struct ip_tunnel_prl { | |||
| 44 | __u16 flags; | 44 | __u16 flags; |
| 45 | __u16 __reserved; | 45 | __u16 __reserved; |
| 46 | __u32 datalen; | 46 | __u32 datalen; |
| 47 | __u32 rs_delay; | 47 | __u32 __reserved2; |
| 48 | /* data follows */ | 48 | /* data follows */ |
| 49 | }; | 49 | }; |
| 50 | 50 | ||
diff --git a/include/linux/igmp.h b/include/linux/igmp.h index 92fbd8cbd68f..fe158e0e20e6 100644 --- a/include/linux/igmp.h +++ b/include/linux/igmp.h | |||
| @@ -233,6 +233,8 @@ extern void ip_mc_init_dev(struct in_device *); | |||
| 233 | extern void ip_mc_destroy_dev(struct in_device *); | 233 | extern void ip_mc_destroy_dev(struct in_device *); |
| 234 | extern void ip_mc_up(struct in_device *); | 234 | extern void ip_mc_up(struct in_device *); |
| 235 | extern void ip_mc_down(struct in_device *); | 235 | extern void ip_mc_down(struct in_device *); |
| 236 | extern void ip_mc_unmap(struct in_device *); | ||
| 237 | extern void ip_mc_remap(struct in_device *); | ||
| 236 | extern void ip_mc_dec_group(struct in_device *in_dev, __be32 addr); | 238 | extern void ip_mc_dec_group(struct in_device *in_dev, __be32 addr); |
| 237 | extern void ip_mc_inc_group(struct in_device *in_dev, __be32 addr); | 239 | extern void ip_mc_inc_group(struct in_device *in_dev, __be32 addr); |
| 238 | extern void ip_mc_rejoin_group(struct ip_mc_list *im); | 240 | extern void ip_mc_rejoin_group(struct ip_mc_list *im); |
diff --git a/include/linux/init.h b/include/linux/init.h index 400adbb45414..ff8bde520d03 100644 --- a/include/linux/init.h +++ b/include/linux/init.h | |||
| @@ -271,6 +271,7 @@ void __init parse_early_options(char *cmdline); | |||
| 271 | #else /* MODULE */ | 271 | #else /* MODULE */ |
| 272 | 272 | ||
| 273 | /* Don't use these in modules, but some people do... */ | 273 | /* Don't use these in modules, but some people do... */ |
| 274 | #define early_initcall(fn) module_init(fn) | ||
| 274 | #define core_initcall(fn) module_init(fn) | 275 | #define core_initcall(fn) module_init(fn) |
| 275 | #define postcore_initcall(fn) module_init(fn) | 276 | #define postcore_initcall(fn) module_init(fn) |
| 276 | #define arch_initcall(fn) module_init(fn) | 277 | #define arch_initcall(fn) module_init(fn) |
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 9e7f2e8fc66e..8d10aa7fd4c9 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
| @@ -83,16 +83,12 @@ extern struct group_info init_groups; | |||
| 83 | #define INIT_IDS | 83 | #define INIT_IDS |
| 84 | #endif | 84 | #endif |
| 85 | 85 | ||
| 86 | #ifdef CONFIG_SECURITY_FILE_CAPABILITIES | ||
| 87 | /* | 86 | /* |
| 88 | * Because of the reduced scope of CAP_SETPCAP when filesystem | 87 | * Because of the reduced scope of CAP_SETPCAP when filesystem |
| 89 | * capabilities are in effect, it is safe to allow CAP_SETPCAP to | 88 | * capabilities are in effect, it is safe to allow CAP_SETPCAP to |
| 90 | * be available in the default configuration. | 89 | * be available in the default configuration. |
| 91 | */ | 90 | */ |
| 92 | # define CAP_INIT_BSET CAP_FULL_SET | 91 | # define CAP_INIT_BSET CAP_FULL_SET |
| 93 | #else | ||
| 94 | # define CAP_INIT_BSET CAP_INIT_EFF_SET | ||
| 95 | #endif | ||
| 96 | 92 | ||
| 97 | #ifdef CONFIG_TREE_PREEMPT_RCU | 93 | #ifdef CONFIG_TREE_PREEMPT_RCU |
| 98 | #define INIT_TASK_RCU_PREEMPT(tsk) \ | 94 | #define INIT_TASK_RCU_PREEMPT(tsk) \ |
| @@ -106,13 +102,13 @@ extern struct group_info init_groups; | |||
| 106 | 102 | ||
| 107 | extern struct cred init_cred; | 103 | extern struct cred init_cred; |
| 108 | 104 | ||
| 109 | #ifdef CONFIG_PERF_COUNTERS | 105 | #ifdef CONFIG_PERF_EVENTS |
| 110 | # define INIT_PERF_COUNTERS(tsk) \ | 106 | # define INIT_PERF_EVENTS(tsk) \ |
| 111 | .perf_counter_mutex = \ | 107 | .perf_event_mutex = \ |
| 112 | __MUTEX_INITIALIZER(tsk.perf_counter_mutex), \ | 108 | __MUTEX_INITIALIZER(tsk.perf_event_mutex), \ |
| 113 | .perf_counter_list = LIST_HEAD_INIT(tsk.perf_counter_list), | 109 | .perf_event_list = LIST_HEAD_INIT(tsk.perf_event_list), |
| 114 | #else | 110 | #else |
| 115 | # define INIT_PERF_COUNTERS(tsk) | 111 | # define INIT_PERF_EVENTS(tsk) |
| 116 | #endif | 112 | #endif |
| 117 | 113 | ||
| 118 | /* | 114 | /* |
| @@ -178,7 +174,7 @@ extern struct cred init_cred; | |||
| 178 | }, \ | 174 | }, \ |
| 179 | .dirties = INIT_PROP_LOCAL_SINGLE(dirties), \ | 175 | .dirties = INIT_PROP_LOCAL_SINGLE(dirties), \ |
| 180 | INIT_IDS \ | 176 | INIT_IDS \ |
| 181 | INIT_PERF_COUNTERS(tsk) \ | 177 | INIT_PERF_EVENTS(tsk) \ |
| 182 | INIT_TRACE_IRQFLAGS \ | 178 | INIT_TRACE_IRQFLAGS \ |
| 183 | INIT_LOCKDEP \ | 179 | INIT_LOCKDEP \ |
| 184 | INIT_FTRACE_GRAPH \ | 180 | INIT_FTRACE_GRAPH \ |
diff --git a/include/linux/input.h b/include/linux/input.h index 8b3bc3e0d146..c2b1a7d244d9 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
| @@ -1123,7 +1123,7 @@ struct input_dev { | |||
| 1123 | struct mutex mutex; | 1123 | struct mutex mutex; |
| 1124 | 1124 | ||
| 1125 | unsigned int users; | 1125 | unsigned int users; |
| 1126 | int going_away; | 1126 | bool going_away; |
| 1127 | 1127 | ||
| 1128 | struct device dev; | 1128 | struct device dev; |
| 1129 | 1129 | ||
| @@ -1377,6 +1377,10 @@ extern struct class input_class; | |||
| 1377 | * methods; erase() is optional. set_gain() and set_autocenter() need | 1377 | * methods; erase() is optional. set_gain() and set_autocenter() need |
| 1378 | * only be implemented if driver sets up FF_GAIN and FF_AUTOCENTER | 1378 | * only be implemented if driver sets up FF_GAIN and FF_AUTOCENTER |
| 1379 | * bits. | 1379 | * bits. |
| 1380 | * | ||
| 1381 | * Note that playback(), set_gain() and set_autocenter() are called with | ||
| 1382 | * dev->event_lock spinlock held and interrupts off and thus may not | ||
| 1383 | * sleep. | ||
| 1380 | */ | 1384 | */ |
| 1381 | struct ff_device { | 1385 | struct ff_device { |
| 1382 | int (*upload)(struct input_dev *dev, struct ff_effect *effect, | 1386 | int (*upload)(struct input_dev *dev, struct ff_effect *effect, |
diff --git a/include/linux/input/eeti_ts.h b/include/linux/input/eeti_ts.h new file mode 100644 index 000000000000..f875b316249d --- /dev/null +++ b/include/linux/input/eeti_ts.h | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | #ifndef LINUX_INPUT_EETI_TS_H | ||
| 2 | #define LINUX_INPUT_EETI_TS_H | ||
| 3 | |||
| 4 | struct eeti_ts_platform_data { | ||
| 5 | unsigned int irq_active_high; | ||
| 6 | }; | ||
| 7 | |||
| 8 | #endif /* LINUX_INPUT_EETI_TS_H */ | ||
| 9 | |||
diff --git a/include/linux/input/matrix_keypad.h b/include/linux/input/matrix_keypad.h index 15d5903af2dd..b3cd42d50e16 100644 --- a/include/linux/input/matrix_keypad.h +++ b/include/linux/input/matrix_keypad.h | |||
| @@ -63,4 +63,36 @@ struct matrix_keypad_platform_data { | |||
| 63 | bool wakeup; | 63 | bool wakeup; |
| 64 | }; | 64 | }; |
| 65 | 65 | ||
| 66 | /** | ||
| 67 | * matrix_keypad_build_keymap - convert platform keymap into matrix keymap | ||
| 68 | * @keymap_data: keymap supplied by the platform code | ||
| 69 | * @row_shift: number of bits to shift row value by to advance to the next | ||
| 70 | * line in the keymap | ||
| 71 | * @keymap: expanded version of keymap that is suitable for use by | ||
| 72 | * matrix keyboad driver | ||
| 73 | * @keybit: pointer to bitmap of keys supported by input device | ||
| 74 | * | ||
| 75 | * This function converts platform keymap (encoded with KEY() macro) into | ||
| 76 | * an array of keycodes that is suitable for using in a standard matrix | ||
| 77 | * keyboard driver that uses row and col as indices. | ||
| 78 | */ | ||
| 79 | static inline void | ||
| 80 | matrix_keypad_build_keymap(const struct matrix_keymap_data *keymap_data, | ||
| 81 | unsigned int row_shift, | ||
| 82 | unsigned short *keymap, unsigned long *keybit) | ||
| 83 | { | ||
| 84 | int i; | ||
| 85 | |||
| 86 | for (i = 0; i < keymap_data->keymap_size; i++) { | ||
| 87 | unsigned int key = keymap_data->keymap[i]; | ||
| 88 | unsigned int row = KEY_ROW(key); | ||
| 89 | unsigned int col = KEY_COL(key); | ||
| 90 | unsigned short code = KEY_VAL(key); | ||
| 91 | |||
| 92 | keymap[MATRIX_SCAN_CODE(row, col, row_shift)] = code; | ||
| 93 | __set_bit(code, keybit); | ||
| 94 | } | ||
| 95 | __clear_bit(KEY_RESERVED, keybit); | ||
| 96 | } | ||
| 97 | |||
| 66 | #endif /* _MATRIX_KEYPAD_H */ | 98 | #endif /* _MATRIX_KEYPAD_H */ |
diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h index 482dc91fd53a..4f0a72a9740c 100644 --- a/include/linux/intel-iommu.h +++ b/include/linux/intel-iommu.h | |||
| @@ -360,4 +360,6 @@ extern void qi_flush_dev_iotlb(struct intel_iommu *iommu, u16 sid, u16 qdep, | |||
| 360 | 360 | ||
| 361 | extern int qi_submit_sync(struct qi_desc *desc, struct intel_iommu *iommu); | 361 | extern int qi_submit_sync(struct qi_desc *desc, struct intel_iommu *iommu); |
| 362 | 362 | ||
| 363 | extern int dmar_ir_support(void); | ||
| 364 | |||
| 363 | #endif | 365 | #endif |
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 1ac57e522a1f..75f3f00ac1e5 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
| @@ -10,7 +10,6 @@ | |||
| 10 | #include <linux/irqreturn.h> | 10 | #include <linux/irqreturn.h> |
| 11 | #include <linux/irqnr.h> | 11 | #include <linux/irqnr.h> |
| 12 | #include <linux/hardirq.h> | 12 | #include <linux/hardirq.h> |
| 13 | #include <linux/sched.h> | ||
| 14 | #include <linux/irqflags.h> | 13 | #include <linux/irqflags.h> |
| 15 | #include <linux/smp.h> | 14 | #include <linux/smp.h> |
| 16 | #include <linux/percpu.h> | 15 | #include <linux/percpu.h> |
| @@ -84,7 +83,6 @@ typedef irqreturn_t (*irq_handler_t)(int, void *); | |||
| 84 | * struct irqaction - per interrupt action descriptor | 83 | * struct irqaction - per interrupt action descriptor |
| 85 | * @handler: interrupt handler function | 84 | * @handler: interrupt handler function |
| 86 | * @flags: flags (see IRQF_* above) | 85 | * @flags: flags (see IRQF_* above) |
| 87 | * @mask: no comment as it is useless and about to be removed | ||
| 88 | * @name: name of the device | 86 | * @name: name of the device |
| 89 | * @dev_id: cookie to identify the device | 87 | * @dev_id: cookie to identify the device |
| 90 | * @next: pointer to the next irqaction for shared interrupts | 88 | * @next: pointer to the next irqaction for shared interrupts |
| @@ -97,7 +95,6 @@ typedef irqreturn_t (*irq_handler_t)(int, void *); | |||
| 97 | struct irqaction { | 95 | struct irqaction { |
| 98 | irq_handler_t handler; | 96 | irq_handler_t handler; |
| 99 | unsigned long flags; | 97 | unsigned long flags; |
| 100 | cpumask_t mask; | ||
| 101 | const char *name; | 98 | const char *name; |
| 102 | void *dev_id; | 99 | void *dev_id; |
| 103 | struct irqaction *next; | 100 | struct irqaction *next; |
| @@ -348,6 +345,7 @@ enum | |||
| 348 | NET_TX_SOFTIRQ, | 345 | NET_TX_SOFTIRQ, |
| 349 | NET_RX_SOFTIRQ, | 346 | NET_RX_SOFTIRQ, |
| 350 | BLOCK_SOFTIRQ, | 347 | BLOCK_SOFTIRQ, |
| 348 | BLOCK_IOPOLL_SOFTIRQ, | ||
| 351 | TASKLET_SOFTIRQ, | 349 | TASKLET_SOFTIRQ, |
| 352 | SCHED_SOFTIRQ, | 350 | SCHED_SOFTIRQ, |
| 353 | HRTIMER_SOFTIRQ, | 351 | HRTIMER_SOFTIRQ, |
| @@ -605,12 +603,7 @@ static inline void init_irq_proc(void) | |||
| 605 | } | 603 | } |
| 606 | #endif | 604 | #endif |
| 607 | 605 | ||
| 608 | #if defined(CONFIG_GENERIC_HARDIRQS) && defined(CONFIG_DEBUG_SHIRQ) | 606 | struct seq_file; |
| 609 | extern void debug_poll_all_shared_irqs(void); | ||
| 610 | #else | ||
| 611 | static inline void debug_poll_all_shared_irqs(void) { } | ||
| 612 | #endif | ||
| 613 | |||
| 614 | int show_interrupts(struct seq_file *p, void *v); | 607 | int show_interrupts(struct seq_file *p, void *v); |
| 615 | 608 | ||
| 616 | struct irq_desc; | 609 | struct irq_desc; |
diff --git a/include/linux/io-mapping.h b/include/linux/io-mapping.h index 0adb0f91568c..97eb928b4924 100644 --- a/include/linux/io-mapping.h +++ b/include/linux/io-mapping.h | |||
| @@ -49,23 +49,30 @@ static inline struct io_mapping * | |||
| 49 | io_mapping_create_wc(resource_size_t base, unsigned long size) | 49 | io_mapping_create_wc(resource_size_t base, unsigned long size) |
| 50 | { | 50 | { |
| 51 | struct io_mapping *iomap; | 51 | struct io_mapping *iomap; |
| 52 | 52 | pgprot_t prot; | |
| 53 | if (!is_io_mapping_possible(base, size)) | ||
| 54 | return NULL; | ||
| 55 | 53 | ||
| 56 | iomap = kmalloc(sizeof(*iomap), GFP_KERNEL); | 54 | iomap = kmalloc(sizeof(*iomap), GFP_KERNEL); |
| 57 | if (!iomap) | 55 | if (!iomap) |
| 58 | return NULL; | 56 | goto out_err; |
| 57 | |||
| 58 | if (iomap_create_wc(base, size, &prot)) | ||
| 59 | goto out_free; | ||
| 59 | 60 | ||
| 60 | iomap->base = base; | 61 | iomap->base = base; |
| 61 | iomap->size = size; | 62 | iomap->size = size; |
| 62 | iomap->prot = pgprot_writecombine(__pgprot(__PAGE_KERNEL)); | 63 | iomap->prot = prot; |
| 63 | return iomap; | 64 | return iomap; |
| 65 | |||
| 66 | out_free: | ||
| 67 | kfree(iomap); | ||
| 68 | out_err: | ||
| 69 | return NULL; | ||
| 64 | } | 70 | } |
| 65 | 71 | ||
| 66 | static inline void | 72 | static inline void |
| 67 | io_mapping_free(struct io_mapping *mapping) | 73 | io_mapping_free(struct io_mapping *mapping) |
| 68 | { | 74 | { |
| 75 | iomap_free(mapping->base, mapping->size); | ||
| 69 | kfree(mapping); | 76 | kfree(mapping); |
| 70 | } | 77 | } |
| 71 | 78 | ||
diff --git a/include/linux/ioport.h b/include/linux/ioport.h index 786e7b8cece9..83aa81297ea3 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h | |||
| @@ -184,5 +184,9 @@ extern void __devm_release_region(struct device *dev, struct resource *parent, | |||
| 184 | extern int iomem_map_sanity_check(resource_size_t addr, unsigned long size); | 184 | extern int iomem_map_sanity_check(resource_size_t addr, unsigned long size); |
| 185 | extern int iomem_is_exclusive(u64 addr); | 185 | extern int iomem_is_exclusive(u64 addr); |
| 186 | 186 | ||
| 187 | extern int | ||
| 188 | walk_system_ram_range(unsigned long start_pfn, unsigned long nr_pages, | ||
| 189 | void *arg, int (*func)(unsigned long, unsigned long, void *)); | ||
| 190 | |||
| 187 | #endif /* __ASSEMBLY__ */ | 191 | #endif /* __ASSEMBLY__ */ |
| 188 | #endif /* _LINUX_IOPORT_H */ | 192 | #endif /* _LINUX_IOPORT_H */ |
diff --git a/include/linux/iova.h b/include/linux/iova.h index 228f6c94b69c..76a0759e88ec 100644 --- a/include/linux/iova.h +++ b/include/linux/iova.h | |||
| @@ -28,7 +28,6 @@ struct iova { | |||
| 28 | 28 | ||
| 29 | /* holds all the iova translations for a domain */ | 29 | /* holds all the iova translations for a domain */ |
| 30 | struct iova_domain { | 30 | struct iova_domain { |
| 31 | spinlock_t iova_alloc_lock;/* Lock to protect iova allocation */ | ||
| 32 | spinlock_t iova_rbtree_lock; /* Lock to protect update of rbtree */ | 31 | spinlock_t iova_rbtree_lock; /* Lock to protect update of rbtree */ |
| 33 | struct rb_root rbroot; /* iova domain rbtree root */ | 32 | struct rb_root rbroot; /* iova domain rbtree root */ |
| 34 | struct rb_node *cached32_node; /* Save last alloced node */ | 33 | struct rb_node *cached32_node; /* Save last alloced node */ |
diff --git a/include/linux/ipc.h b/include/linux/ipc.h index b8826107b518..3b1594d662b0 100644 --- a/include/linux/ipc.h +++ b/include/linux/ipc.h | |||
| @@ -78,8 +78,6 @@ struct ipc_kludge { | |||
| 78 | #define IPCCALL(version,op) ((version)<<16 | (op)) | 78 | #define IPCCALL(version,op) ((version)<<16 | (op)) |
| 79 | 79 | ||
| 80 | #ifdef __KERNEL__ | 80 | #ifdef __KERNEL__ |
| 81 | |||
| 82 | #include <linux/kref.h> | ||
| 83 | #include <linux/spinlock.h> | 81 | #include <linux/spinlock.h> |
| 84 | 82 | ||
| 85 | #define IPCMNI 32768 /* <= MAX_INT limit for ipc arrays (including sysctl changes) */ | 83 | #define IPCMNI 32768 /* <= MAX_INT limit for ipc arrays (including sysctl changes) */ |
diff --git a/include/linux/irqflags.h b/include/linux/irqflags.h index b02a3f1d46a0..006bf45eae30 100644 --- a/include/linux/irqflags.h +++ b/include/linux/irqflags.h | |||
| @@ -124,6 +124,6 @@ | |||
| 124 | typecheck(unsigned long, flags); \ | 124 | typecheck(unsigned long, flags); \ |
| 125 | raw_irqs_disabled_flags(flags); \ | 125 | raw_irqs_disabled_flags(flags); \ |
| 126 | }) | 126 | }) |
| 127 | #endif /* CONFIG_X86 */ | 127 | #endif /* CONFIG_TRACE_IRQFLAGS_SUPPORT */ |
| 128 | 128 | ||
| 129 | #endif | 129 | #endif |
diff --git a/include/linux/isdn/hdlc.h b/include/linux/isdn/hdlc.h new file mode 100644 index 000000000000..4b3ecc40889a --- /dev/null +++ b/include/linux/isdn/hdlc.h | |||
| @@ -0,0 +1,82 @@ | |||
| 1 | /* | ||
| 2 | * hdlc.h -- General purpose ISDN HDLC decoder. | ||
| 3 | * | ||
| 4 | * Implementation of a HDLC decoder/encoder in software. | ||
| 5 | * Neccessary because some ISDN devices don't have HDLC | ||
| 6 | * controllers. | ||
| 7 | * | ||
| 8 | * Copyright (C) | ||
| 9 | * 2009 Karsten Keil <keil@b1-systems.de> | ||
| 10 | * 2002 Wolfgang Mües <wolfgang@iksw-muees.de> | ||
| 11 | * 2001 Frode Isaksen <fisaksen@bewan.com> | ||
| 12 | * 2001 Kai Germaschewski <kai.germaschewski@gmx.de> | ||
| 13 | * | ||
| 14 | * This program is free software; you can redistribute it and/or modify | ||
| 15 | * it under the terms of the GNU General Public License as published by | ||
| 16 | * the Free Software Foundation; either version 2 of the License, or | ||
| 17 | * (at your option) any later version. | ||
| 18 | * | ||
| 19 | * This program is distributed in the hope that it will be useful, | ||
| 20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 22 | * GNU General Public License for more details. | ||
| 23 | * | ||
| 24 | * You should have received a copy of the GNU General Public License | ||
| 25 | * along with this program; if not, write to the Free Software | ||
| 26 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 27 | */ | ||
| 28 | |||
| 29 | #ifndef __ISDNHDLC_H__ | ||
| 30 | #define __ISDNHDLC_H__ | ||
| 31 | |||
| 32 | struct isdnhdlc_vars { | ||
| 33 | int bit_shift; | ||
| 34 | int hdlc_bits1; | ||
| 35 | int data_bits; | ||
| 36 | int ffbit_shift; /* encoding only */ | ||
| 37 | int state; | ||
| 38 | int dstpos; | ||
| 39 | |||
| 40 | u16 crc; | ||
| 41 | |||
| 42 | u8 cbin; | ||
| 43 | u8 shift_reg; | ||
| 44 | u8 ffvalue; | ||
| 45 | |||
| 46 | /* set if transferring data */ | ||
| 47 | u32 data_received:1; | ||
| 48 | /* set if D channel (send idle instead of flags) */ | ||
| 49 | u32 dchannel:1; | ||
| 50 | /* set if 56K adaptation */ | ||
| 51 | u32 do_adapt56:1; | ||
| 52 | /* set if in closing phase (need to send CRC + flag) */ | ||
| 53 | u32 do_closing:1; | ||
| 54 | /* set if data is bitreverse */ | ||
| 55 | u32 do_bitreverse:1; | ||
| 56 | }; | ||
| 57 | |||
| 58 | /* Feature Flags */ | ||
| 59 | #define HDLC_56KBIT 0x01 | ||
| 60 | #define HDLC_DCHANNEL 0x02 | ||
| 61 | #define HDLC_BITREVERSE 0x04 | ||
| 62 | |||
| 63 | /* | ||
| 64 | The return value from isdnhdlc_decode is | ||
| 65 | the frame length, 0 if no complete frame was decoded, | ||
| 66 | or a negative error number | ||
| 67 | */ | ||
| 68 | #define HDLC_FRAMING_ERROR 1 | ||
| 69 | #define HDLC_CRC_ERROR 2 | ||
| 70 | #define HDLC_LENGTH_ERROR 3 | ||
| 71 | |||
| 72 | extern void isdnhdlc_rcv_init(struct isdnhdlc_vars *hdlc, u32 features); | ||
| 73 | |||
| 74 | extern int isdnhdlc_decode(struct isdnhdlc_vars *hdlc, const u8 *src, | ||
| 75 | int slen, int *count, u8 *dst, int dsize); | ||
| 76 | |||
| 77 | extern void isdnhdlc_out_init(struct isdnhdlc_vars *hdlc, u32 features); | ||
| 78 | |||
| 79 | extern int isdnhdlc_encode(struct isdnhdlc_vars *hdlc, const u8 *src, | ||
| 80 | u16 slen, int *count, u8 *dst, int dsize); | ||
| 81 | |||
| 82 | #endif /* __ISDNHDLC_H__ */ | ||
diff --git a/include/linux/isdn_ppp.h b/include/linux/isdn_ppp.h index 4c218ee7587a..8687a7dc0632 100644 --- a/include/linux/isdn_ppp.h +++ b/include/linux/isdn_ppp.h | |||
| @@ -157,7 +157,7 @@ typedef struct { | |||
| 157 | 157 | ||
| 158 | typedef struct { | 158 | typedef struct { |
| 159 | int mp_mrru; /* unused */ | 159 | int mp_mrru; /* unused */ |
| 160 | struct sk_buff_head frags; /* fragments sl list */ | 160 | struct sk_buff * frags; /* fragments sl list -- use skb->next */ |
| 161 | long frames; /* number of frames in the frame list */ | 161 | long frames; /* number of frames in the frame list */ |
| 162 | unsigned int seq; /* last processed packet seq #: any packets | 162 | unsigned int seq; /* last processed packet seq #: any packets |
| 163 | * with smaller seq # will be dropped | 163 | * with smaller seq # will be dropped |
diff --git a/include/linux/jbd.h b/include/linux/jbd.h index c2049a04fa0b..331530cd3cc6 100644 --- a/include/linux/jbd.h +++ b/include/linux/jbd.h | |||
| @@ -446,7 +446,7 @@ struct transaction_s | |||
| 446 | /* | 446 | /* |
| 447 | * Where in the log does this transaction's commit start? [no locking] | 447 | * Where in the log does this transaction's commit start? [no locking] |
| 448 | */ | 448 | */ |
| 449 | unsigned long t_log_start; | 449 | unsigned int t_log_start; |
| 450 | 450 | ||
| 451 | /* Number of buffers on the t_buffers list [j_list_lock] */ | 451 | /* Number of buffers on the t_buffers list [j_list_lock] */ |
| 452 | int t_nr_buffers; | 452 | int t_nr_buffers; |
| @@ -556,7 +556,7 @@ struct transaction_s | |||
| 556 | * This transaction is being forced and some process is | 556 | * This transaction is being forced and some process is |
| 557 | * waiting for it to finish. | 557 | * waiting for it to finish. |
| 558 | */ | 558 | */ |
| 559 | int t_synchronous_commit:1; | 559 | unsigned int t_synchronous_commit:1; |
| 560 | }; | 560 | }; |
| 561 | 561 | ||
| 562 | /** | 562 | /** |
| @@ -701,26 +701,26 @@ struct journal_s | |||
| 701 | * Journal head: identifies the first unused block in the journal. | 701 | * Journal head: identifies the first unused block in the journal. |
| 702 | * [j_state_lock] | 702 | * [j_state_lock] |
| 703 | */ | 703 | */ |
| 704 | unsigned long j_head; | 704 | unsigned int j_head; |
| 705 | 705 | ||
| 706 | /* | 706 | /* |
| 707 | * Journal tail: identifies the oldest still-used block in the journal. | 707 | * Journal tail: identifies the oldest still-used block in the journal. |
| 708 | * [j_state_lock] | 708 | * [j_state_lock] |
| 709 | */ | 709 | */ |
| 710 | unsigned long j_tail; | 710 | unsigned int j_tail; |
| 711 | 711 | ||
| 712 | /* | 712 | /* |
| 713 | * Journal free: how many free blocks are there in the journal? | 713 | * Journal free: how many free blocks are there in the journal? |
| 714 | * [j_state_lock] | 714 | * [j_state_lock] |
| 715 | */ | 715 | */ |
| 716 | unsigned long j_free; | 716 | unsigned int j_free; |
| 717 | 717 | ||
| 718 | /* | 718 | /* |
| 719 | * Journal start and end: the block numbers of the first usable block | 719 | * Journal start and end: the block numbers of the first usable block |
| 720 | * and one beyond the last usable block in the journal. [j_state_lock] | 720 | * and one beyond the last usable block in the journal. [j_state_lock] |
| 721 | */ | 721 | */ |
| 722 | unsigned long j_first; | 722 | unsigned int j_first; |
| 723 | unsigned long j_last; | 723 | unsigned int j_last; |
| 724 | 724 | ||
| 725 | /* | 725 | /* |
| 726 | * Device, blocksize and starting block offset for the location where we | 726 | * Device, blocksize and starting block offset for the location where we |
| @@ -728,7 +728,7 @@ struct journal_s | |||
| 728 | */ | 728 | */ |
| 729 | struct block_device *j_dev; | 729 | struct block_device *j_dev; |
| 730 | int j_blocksize; | 730 | int j_blocksize; |
| 731 | unsigned long j_blk_offset; | 731 | unsigned int j_blk_offset; |
| 732 | 732 | ||
| 733 | /* | 733 | /* |
| 734 | * Device which holds the client fs. For internal journal this will be | 734 | * Device which holds the client fs. For internal journal this will be |
| @@ -859,7 +859,7 @@ extern void __journal_clean_data_list(transaction_t *transaction); | |||
| 859 | 859 | ||
| 860 | /* Log buffer allocation */ | 860 | /* Log buffer allocation */ |
| 861 | extern struct journal_head * journal_get_descriptor_buffer(journal_t *); | 861 | extern struct journal_head * journal_get_descriptor_buffer(journal_t *); |
| 862 | int journal_next_log_block(journal_t *, unsigned long *); | 862 | int journal_next_log_block(journal_t *, unsigned int *); |
| 863 | 863 | ||
| 864 | /* Commit management */ | 864 | /* Commit management */ |
| 865 | extern void journal_commit_transaction(journal_t *); | 865 | extern void journal_commit_transaction(journal_t *); |
| @@ -874,7 +874,7 @@ extern int | |||
| 874 | journal_write_metadata_buffer(transaction_t *transaction, | 874 | journal_write_metadata_buffer(transaction_t *transaction, |
| 875 | struct journal_head *jh_in, | 875 | struct journal_head *jh_in, |
| 876 | struct journal_head **jh_out, | 876 | struct journal_head **jh_out, |
| 877 | unsigned long blocknr); | 877 | unsigned int blocknr); |
| 878 | 878 | ||
| 879 | /* Transaction locking */ | 879 | /* Transaction locking */ |
| 880 | extern void __wait_on_journal (journal_t *); | 880 | extern void __wait_on_journal (journal_t *); |
| @@ -942,7 +942,7 @@ extern void journal_abort (journal_t *, int); | |||
| 942 | extern int journal_errno (journal_t *); | 942 | extern int journal_errno (journal_t *); |
| 943 | extern void journal_ack_err (journal_t *); | 943 | extern void journal_ack_err (journal_t *); |
| 944 | extern int journal_clear_err (journal_t *); | 944 | extern int journal_clear_err (journal_t *); |
| 945 | extern int journal_bmap(journal_t *, unsigned long, unsigned long *); | 945 | extern int journal_bmap(journal_t *, unsigned int, unsigned int *); |
| 946 | extern int journal_force_commit(journal_t *); | 946 | extern int journal_force_commit(journal_t *); |
| 947 | 947 | ||
| 948 | /* | 948 | /* |
| @@ -976,14 +976,14 @@ extern int journal_init_revoke_caches(void); | |||
| 976 | 976 | ||
| 977 | extern void journal_destroy_revoke(journal_t *); | 977 | extern void journal_destroy_revoke(journal_t *); |
| 978 | extern int journal_revoke (handle_t *, | 978 | extern int journal_revoke (handle_t *, |
| 979 | unsigned long, struct buffer_head *); | 979 | unsigned int, struct buffer_head *); |
| 980 | extern int journal_cancel_revoke(handle_t *, struct journal_head *); | 980 | extern int journal_cancel_revoke(handle_t *, struct journal_head *); |
| 981 | extern void journal_write_revoke_records(journal_t *, | 981 | extern void journal_write_revoke_records(journal_t *, |
| 982 | transaction_t *, int); | 982 | transaction_t *, int); |
| 983 | 983 | ||
| 984 | /* Recovery revoke support */ | 984 | /* Recovery revoke support */ |
| 985 | extern int journal_set_revoke(journal_t *, unsigned long, tid_t); | 985 | extern int journal_set_revoke(journal_t *, unsigned int, tid_t); |
| 986 | extern int journal_test_revoke(journal_t *, unsigned long, tid_t); | 986 | extern int journal_test_revoke(journal_t *, unsigned int, tid_t); |
| 987 | extern void journal_clear_revoke(journal_t *); | 987 | extern void journal_clear_revoke(journal_t *); |
| 988 | extern void journal_switch_revoke_table(journal_t *journal); | 988 | extern void journal_switch_revoke_table(journal_t *journal); |
| 989 | 989 | ||
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index d97eb652d6ca..f1011f7f3d41 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h | |||
| @@ -464,9 +464,9 @@ struct handle_s | |||
| 464 | */ | 464 | */ |
| 465 | struct transaction_chp_stats_s { | 465 | struct transaction_chp_stats_s { |
| 466 | unsigned long cs_chp_time; | 466 | unsigned long cs_chp_time; |
| 467 | unsigned long cs_forced_to_close; | 467 | __u32 cs_forced_to_close; |
| 468 | unsigned long cs_written; | 468 | __u32 cs_written; |
| 469 | unsigned long cs_dropped; | 469 | __u32 cs_dropped; |
| 470 | }; | 470 | }; |
| 471 | 471 | ||
| 472 | /* The transaction_t type is the guts of the journaling mechanism. It | 472 | /* The transaction_t type is the guts of the journaling mechanism. It |
| @@ -652,7 +652,7 @@ struct transaction_s | |||
| 652 | * This transaction is being forced and some process is | 652 | * This transaction is being forced and some process is |
| 653 | * waiting for it to finish. | 653 | * waiting for it to finish. |
| 654 | */ | 654 | */ |
| 655 | int t_synchronous_commit:1; | 655 | unsigned int t_synchronous_commit:1; |
| 656 | 656 | ||
| 657 | /* | 657 | /* |
| 658 | * For use by the filesystem to store fs-specific data | 658 | * For use by the filesystem to store fs-specific data |
| @@ -668,23 +668,16 @@ struct transaction_run_stats_s { | |||
| 668 | unsigned long rs_flushing; | 668 | unsigned long rs_flushing; |
| 669 | unsigned long rs_logging; | 669 | unsigned long rs_logging; |
| 670 | 670 | ||
| 671 | unsigned long rs_handle_count; | 671 | __u32 rs_handle_count; |
| 672 | unsigned long rs_blocks; | 672 | __u32 rs_blocks; |
| 673 | unsigned long rs_blocks_logged; | 673 | __u32 rs_blocks_logged; |
| 674 | }; | 674 | }; |
| 675 | 675 | ||
| 676 | struct transaction_stats_s { | 676 | struct transaction_stats_s { |
| 677 | int ts_type; | ||
| 678 | unsigned long ts_tid; | 677 | unsigned long ts_tid; |
| 679 | union { | 678 | struct transaction_run_stats_s run; |
| 680 | struct transaction_run_stats_s run; | ||
| 681 | struct transaction_chp_stats_s chp; | ||
| 682 | } u; | ||
| 683 | }; | 679 | }; |
| 684 | 680 | ||
| 685 | #define JBD2_STATS_RUN 1 | ||
| 686 | #define JBD2_STATS_CHECKPOINT 2 | ||
| 687 | |||
| 688 | static inline unsigned long | 681 | static inline unsigned long |
| 689 | jbd2_time_diff(unsigned long start, unsigned long end) | 682 | jbd2_time_diff(unsigned long start, unsigned long end) |
| 690 | { | 683 | { |
| @@ -988,12 +981,6 @@ struct journal_s | |||
| 988 | /* | 981 | /* |
| 989 | * Journal statistics | 982 | * Journal statistics |
| 990 | */ | 983 | */ |
| 991 | struct transaction_stats_s *j_history; | ||
| 992 | int j_history_max; | ||
| 993 | int j_history_cur; | ||
| 994 | /* | ||
| 995 | * Protect the transactions statistics history | ||
| 996 | */ | ||
| 997 | spinlock_t j_history_lock; | 984 | spinlock_t j_history_lock; |
| 998 | struct proc_dir_entry *j_proc_entry; | 985 | struct proc_dir_entry *j_proc_entry; |
| 999 | struct transaction_stats_s j_stats; | 986 | struct transaction_stats_s j_stats; |
diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h index 1a9cf78bfce5..6811f4bfc6e7 100644 --- a/include/linux/jiffies.h +++ b/include/linux/jiffies.h | |||
| @@ -307,6 +307,7 @@ extern clock_t jiffies_to_clock_t(long x); | |||
| 307 | extern unsigned long clock_t_to_jiffies(unsigned long x); | 307 | extern unsigned long clock_t_to_jiffies(unsigned long x); |
| 308 | extern u64 jiffies_64_to_clock_t(u64 x); | 308 | extern u64 jiffies_64_to_clock_t(u64 x); |
| 309 | extern u64 nsec_to_clock_t(u64 x); | 309 | extern u64 nsec_to_clock_t(u64 x); |
| 310 | extern unsigned long nsecs_to_jiffies(u64 n); | ||
| 310 | 311 | ||
| 311 | #define TIMESTAMP_SIZE 30 | 312 | #define TIMESTAMP_SIZE 30 |
| 312 | 313 | ||
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 2b5b1e0899a8..3fa4c590cf12 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
| @@ -15,7 +15,6 @@ | |||
| 15 | #include <linux/bitops.h> | 15 | #include <linux/bitops.h> |
| 16 | #include <linux/log2.h> | 16 | #include <linux/log2.h> |
| 17 | #include <linux/typecheck.h> | 17 | #include <linux/typecheck.h> |
| 18 | #include <linux/ratelimit.h> | ||
| 19 | #include <linux/dynamic_debug.h> | 18 | #include <linux/dynamic_debug.h> |
| 20 | #include <asm/byteorder.h> | 19 | #include <asm/byteorder.h> |
| 21 | #include <asm/bug.h> | 20 | #include <asm/bug.h> |
| @@ -146,7 +145,7 @@ extern int _cond_resched(void); | |||
| 146 | #define might_sleep_if(cond) do { if (cond) might_sleep(); } while (0) | 145 | #define might_sleep_if(cond) do { if (cond) might_sleep(); } while (0) |
| 147 | 146 | ||
| 148 | #define abs(x) ({ \ | 147 | #define abs(x) ({ \ |
| 149 | int __x = (x); \ | 148 | long __x = (x); \ |
| 150 | (__x < 0) ? -__x : __x; \ | 149 | (__x < 0) ? -__x : __x; \ |
| 151 | }) | 150 | }) |
| 152 | 151 | ||
| @@ -241,19 +240,21 @@ asmlinkage int vprintk(const char *fmt, va_list args) | |||
| 241 | asmlinkage int printk(const char * fmt, ...) | 240 | asmlinkage int printk(const char * fmt, ...) |
| 242 | __attribute__ ((format (printf, 1, 2))) __cold; | 241 | __attribute__ ((format (printf, 1, 2))) __cold; |
| 243 | 242 | ||
| 244 | extern struct ratelimit_state printk_ratelimit_state; | 243 | extern int __printk_ratelimit(const char *func); |
| 245 | extern int printk_ratelimit(void); | 244 | #define printk_ratelimit() __printk_ratelimit(__func__) |
| 246 | extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, | 245 | extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, |
| 247 | unsigned int interval_msec); | 246 | unsigned int interval_msec); |
| 248 | 247 | ||
| 248 | extern int printk_delay_msec; | ||
| 249 | |||
| 249 | /* | 250 | /* |
| 250 | * Print a one-time message (analogous to WARN_ONCE() et al): | 251 | * Print a one-time message (analogous to WARN_ONCE() et al): |
| 251 | */ | 252 | */ |
| 252 | #define printk_once(x...) ({ \ | 253 | #define printk_once(x...) ({ \ |
| 253 | static int __print_once = 1; \ | 254 | static bool __print_once = true; \ |
| 254 | \ | 255 | \ |
| 255 | if (__print_once) { \ | 256 | if (__print_once) { \ |
| 256 | __print_once = 0; \ | 257 | __print_once = false; \ |
| 257 | printk(x); \ | 258 | printk(x); \ |
| 258 | } \ | 259 | } \ |
| 259 | }) | 260 | }) |
| @@ -657,6 +658,12 @@ extern int do_sysinfo(struct sysinfo *info); | |||
| 657 | 658 | ||
| 658 | #endif /* __KERNEL__ */ | 659 | #endif /* __KERNEL__ */ |
| 659 | 660 | ||
| 661 | #ifndef __EXPORTED_HEADERS__ | ||
| 662 | #ifndef __KERNEL__ | ||
| 663 | #warning Attempt to use kernel headers from user space, see http://kernelnewbies.org/KernelHeaders | ||
| 664 | #endif /* __KERNEL__ */ | ||
| 665 | #endif /* __EXPORTED_HEADERS__ */ | ||
| 666 | |||
| 660 | #define SI_LOAD_SHIFT 16 | 667 | #define SI_LOAD_SHIFT 16 |
| 661 | struct sysinfo { | 668 | struct sysinfo { |
| 662 | long uptime; /* Seconds since boot */ | 669 | long uptime; /* Seconds since boot */ |
| @@ -676,13 +683,17 @@ struct sysinfo { | |||
| 676 | }; | 683 | }; |
| 677 | 684 | ||
| 678 | /* Force a compilation error if condition is true */ | 685 | /* Force a compilation error if condition is true */ |
| 679 | #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)])) | 686 | #define BUILD_BUG_ON(condition) ((void)BUILD_BUG_ON_ZERO(condition)) |
| 687 | |||
| 688 | /* Force a compilation error if condition is constant and true */ | ||
| 689 | #define MAYBE_BUILD_BUG_ON(cond) ((void)sizeof(char[1 - 2 * !!(cond)])) | ||
| 680 | 690 | ||
| 681 | /* Force a compilation error if condition is true, but also produce a | 691 | /* Force a compilation error if condition is true, but also produce a |
| 682 | result (of value 0 and type size_t), so the expression can be used | 692 | result (of value 0 and type size_t), so the expression can be used |
| 683 | e.g. in a structure initializer (or where-ever else comma expressions | 693 | e.g. in a structure initializer (or where-ever else comma expressions |
| 684 | aren't permitted). */ | 694 | aren't permitted). */ |
| 685 | #define BUILD_BUG_ON_ZERO(e) (sizeof(char[1 - 2 * !!(e)]) - 1) | 695 | #define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); })) |
| 696 | #define BUILD_BUG_ON_NULL(e) ((void *)sizeof(struct { int:-!!(e); })) | ||
| 686 | 697 | ||
| 687 | /* Trap pasters of __FUNCTION__ at compile-time */ | 698 | /* Trap pasters of __FUNCTION__ at compile-time */ |
| 688 | #define __FUNCTION__ (__func__) | 699 | #define __FUNCTION__ (__func__) |
diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h index 348fa8874b52..c059044bc6dc 100644 --- a/include/linux/kernel_stat.h +++ b/include/linux/kernel_stat.h | |||
| @@ -25,6 +25,7 @@ struct cpu_usage_stat { | |||
| 25 | cputime64_t iowait; | 25 | cputime64_t iowait; |
| 26 | cputime64_t steal; | 26 | cputime64_t steal; |
| 27 | cputime64_t guest; | 27 | cputime64_t guest; |
| 28 | cputime64_t guest_nice; | ||
| 28 | }; | 29 | }; |
| 29 | 30 | ||
| 30 | struct kernel_stat { | 31 | struct kernel_stat { |
diff --git a/include/linux/kfifo.h b/include/linux/kfifo.h index 29f62e1733ff..ad6bdf5a5970 100644 --- a/include/linux/kfifo.h +++ b/include/linux/kfifo.h | |||
| @@ -38,7 +38,7 @@ extern struct kfifo *kfifo_alloc(unsigned int size, gfp_t gfp_mask, | |||
| 38 | spinlock_t *lock); | 38 | spinlock_t *lock); |
| 39 | extern void kfifo_free(struct kfifo *fifo); | 39 | extern void kfifo_free(struct kfifo *fifo); |
| 40 | extern unsigned int __kfifo_put(struct kfifo *fifo, | 40 | extern unsigned int __kfifo_put(struct kfifo *fifo, |
| 41 | unsigned char *buffer, unsigned int len); | 41 | const unsigned char *buffer, unsigned int len); |
| 42 | extern unsigned int __kfifo_get(struct kfifo *fifo, | 42 | extern unsigned int __kfifo_get(struct kfifo *fifo, |
| 43 | unsigned char *buffer, unsigned int len); | 43 | unsigned char *buffer, unsigned int len); |
| 44 | 44 | ||
| @@ -77,7 +77,7 @@ static inline void kfifo_reset(struct kfifo *fifo) | |||
| 77 | * bytes copied. | 77 | * bytes copied. |
| 78 | */ | 78 | */ |
| 79 | static inline unsigned int kfifo_put(struct kfifo *fifo, | 79 | static inline unsigned int kfifo_put(struct kfifo *fifo, |
| 80 | unsigned char *buffer, unsigned int len) | 80 | const unsigned char *buffer, unsigned int len) |
| 81 | { | 81 | { |
| 82 | unsigned long flags; | 82 | unsigned long flags; |
| 83 | unsigned int ret; | 83 | unsigned int ret; |
diff --git a/include/linux/kmemcheck.h b/include/linux/kmemcheck.h index dc2fd545db00..e880d4cf9e22 100644 --- a/include/linux/kmemcheck.h +++ b/include/linux/kmemcheck.h | |||
| @@ -144,10 +144,15 @@ static inline bool kmemcheck_is_obj_initialized(unsigned long addr, size_t size) | |||
| 144 | int name##_end[0]; | 144 | int name##_end[0]; |
| 145 | 145 | ||
| 146 | #define kmemcheck_annotate_bitfield(ptr, name) \ | 146 | #define kmemcheck_annotate_bitfield(ptr, name) \ |
| 147 | do if (ptr) { \ | 147 | do { \ |
| 148 | int _n = (long) &((ptr)->name##_end) \ | 148 | int _n; \ |
| 149 | \ | ||
| 150 | if (!ptr) \ | ||
| 151 | break; \ | ||
| 152 | \ | ||
| 153 | _n = (long) &((ptr)->name##_end) \ | ||
| 149 | - (long) &((ptr)->name##_begin); \ | 154 | - (long) &((ptr)->name##_begin); \ |
| 150 | BUILD_BUG_ON(_n < 0); \ | 155 | MAYBE_BUILD_BUG_ON(_n < 0); \ |
| 151 | \ | 156 | \ |
| 152 | kmemcheck_mark_initialized(&((ptr)->name##_begin), _n); \ | 157 | kmemcheck_mark_initialized(&((ptr)->name##_begin), _n); \ |
| 153 | } while (0) | 158 | } while (0) |
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h index bcd9c07848be..1b672f74a32f 100644 --- a/include/linux/kprobes.h +++ b/include/linux/kprobes.h | |||
| @@ -48,13 +48,13 @@ | |||
| 48 | #define KPROBE_HIT_SSDONE 0x00000008 | 48 | #define KPROBE_HIT_SSDONE 0x00000008 |
| 49 | 49 | ||
| 50 | /* Attach to insert probes on any functions which should be ignored*/ | 50 | /* Attach to insert probes on any functions which should be ignored*/ |
| 51 | #define __kprobes __attribute__((__section__(".kprobes.text"))) notrace | 51 | #define __kprobes __attribute__((__section__(".kprobes.text"))) |
| 52 | #else /* CONFIG_KPROBES */ | 52 | #else /* CONFIG_KPROBES */ |
| 53 | typedef int kprobe_opcode_t; | 53 | typedef int kprobe_opcode_t; |
| 54 | struct arch_specific_insn { | 54 | struct arch_specific_insn { |
| 55 | int dummy; | 55 | int dummy; |
| 56 | }; | 56 | }; |
| 57 | #define __kprobes notrace | 57 | #define __kprobes |
| 58 | #endif /* CONFIG_KPROBES */ | 58 | #endif /* CONFIG_KPROBES */ |
| 59 | 59 | ||
| 60 | struct kprobe; | 60 | struct kprobe; |
| @@ -296,6 +296,8 @@ void recycle_rp_inst(struct kretprobe_instance *ri, struct hlist_head *head); | |||
| 296 | int disable_kprobe(struct kprobe *kp); | 296 | int disable_kprobe(struct kprobe *kp); |
| 297 | int enable_kprobe(struct kprobe *kp); | 297 | int enable_kprobe(struct kprobe *kp); |
| 298 | 298 | ||
| 299 | void dump_kprobe(struct kprobe *kp); | ||
| 300 | |||
| 299 | #else /* !CONFIG_KPROBES: */ | 301 | #else /* !CONFIG_KPROBES: */ |
| 300 | 302 | ||
| 301 | static inline int kprobes_built_in(void) | 303 | static inline int kprobes_built_in(void) |
diff --git a/include/linux/kref.h b/include/linux/kref.h index 0cef6badd6fb..b0cb0ebad9e6 100644 --- a/include/linux/kref.h +++ b/include/linux/kref.h | |||
| @@ -16,7 +16,6 @@ | |||
| 16 | #define _KREF_H_ | 16 | #define _KREF_H_ |
| 17 | 17 | ||
| 18 | #include <linux/types.h> | 18 | #include <linux/types.h> |
| 19 | #include <asm/atomic.h> | ||
| 20 | 19 | ||
| 21 | struct kref { | 20 | struct kref { |
| 22 | atomic_t refcount; | 21 | atomic_t refcount; |
diff --git a/include/linux/ksm.h b/include/linux/ksm.h new file mode 100644 index 000000000000..a485c14ecd5d --- /dev/null +++ b/include/linux/ksm.h | |||
| @@ -0,0 +1,79 @@ | |||
| 1 | #ifndef __LINUX_KSM_H | ||
| 2 | #define __LINUX_KSM_H | ||
| 3 | /* | ||
| 4 | * Memory merging support. | ||
| 5 | * | ||
| 6 | * This code enables dynamic sharing of identical pages found in different | ||
| 7 | * memory areas, even if they are not shared by fork(). | ||
| 8 | */ | ||
| 9 | |||
| 10 | #include <linux/bitops.h> | ||
| 11 | #include <linux/mm.h> | ||
| 12 | #include <linux/sched.h> | ||
| 13 | #include <linux/vmstat.h> | ||
| 14 | |||
| 15 | #ifdef CONFIG_KSM | ||
| 16 | int ksm_madvise(struct vm_area_struct *vma, unsigned long start, | ||
| 17 | unsigned long end, int advice, unsigned long *vm_flags); | ||
| 18 | int __ksm_enter(struct mm_struct *mm); | ||
| 19 | void __ksm_exit(struct mm_struct *mm); | ||
| 20 | |||
| 21 | static inline int ksm_fork(struct mm_struct *mm, struct mm_struct *oldmm) | ||
| 22 | { | ||
| 23 | if (test_bit(MMF_VM_MERGEABLE, &oldmm->flags)) | ||
| 24 | return __ksm_enter(mm); | ||
| 25 | return 0; | ||
| 26 | } | ||
| 27 | |||
| 28 | static inline void ksm_exit(struct mm_struct *mm) | ||
| 29 | { | ||
| 30 | if (test_bit(MMF_VM_MERGEABLE, &mm->flags)) | ||
| 31 | __ksm_exit(mm); | ||
| 32 | } | ||
| 33 | |||
| 34 | /* | ||
| 35 | * A KSM page is one of those write-protected "shared pages" or "merged pages" | ||
| 36 | * which KSM maps into multiple mms, wherever identical anonymous page content | ||
| 37 | * is found in VM_MERGEABLE vmas. It's a PageAnon page, with NULL anon_vma. | ||
| 38 | */ | ||
| 39 | static inline int PageKsm(struct page *page) | ||
| 40 | { | ||
| 41 | return ((unsigned long)page->mapping == PAGE_MAPPING_ANON); | ||
| 42 | } | ||
| 43 | |||
| 44 | /* | ||
| 45 | * But we have to avoid the checking which page_add_anon_rmap() performs. | ||
| 46 | */ | ||
| 47 | static inline void page_add_ksm_rmap(struct page *page) | ||
| 48 | { | ||
| 49 | if (atomic_inc_and_test(&page->_mapcount)) { | ||
| 50 | page->mapping = (void *) PAGE_MAPPING_ANON; | ||
| 51 | __inc_zone_page_state(page, NR_ANON_PAGES); | ||
| 52 | } | ||
| 53 | } | ||
| 54 | #else /* !CONFIG_KSM */ | ||
| 55 | |||
| 56 | static inline int ksm_madvise(struct vm_area_struct *vma, unsigned long start, | ||
| 57 | unsigned long end, int advice, unsigned long *vm_flags) | ||
| 58 | { | ||
| 59 | return 0; | ||
| 60 | } | ||
| 61 | |||
| 62 | static inline int ksm_fork(struct mm_struct *mm, struct mm_struct *oldmm) | ||
| 63 | { | ||
| 64 | return 0; | ||
| 65 | } | ||
| 66 | |||
| 67 | static inline void ksm_exit(struct mm_struct *mm) | ||
| 68 | { | ||
| 69 | } | ||
| 70 | |||
| 71 | static inline int PageKsm(struct page *page) | ||
| 72 | { | ||
| 73 | return 0; | ||
| 74 | } | ||
| 75 | |||
| 76 | /* No stub required for page_add_ksm_rmap(page) */ | ||
| 77 | #endif /* !CONFIG_KSM */ | ||
| 78 | |||
| 79 | #endif | ||
diff --git a/include/linux/kvm.h b/include/linux/kvm.h index 3db5d8d37485..f8f8900fc5ec 100644 --- a/include/linux/kvm.h +++ b/include/linux/kvm.h | |||
| @@ -14,7 +14,7 @@ | |||
| 14 | 14 | ||
| 15 | #define KVM_API_VERSION 12 | 15 | #define KVM_API_VERSION 12 |
| 16 | 16 | ||
| 17 | /* for KVM_TRACE_ENABLE */ | 17 | /* for KVM_TRACE_ENABLE, deprecated */ |
| 18 | struct kvm_user_trace_setup { | 18 | struct kvm_user_trace_setup { |
| 19 | __u32 buf_size; /* sub_buffer size of each per-cpu */ | 19 | __u32 buf_size; /* sub_buffer size of each per-cpu */ |
| 20 | __u32 buf_nr; /* the number of sub_buffers of each per-cpu */ | 20 | __u32 buf_nr; /* the number of sub_buffers of each per-cpu */ |
| @@ -70,6 +70,14 @@ struct kvm_irqchip { | |||
| 70 | } chip; | 70 | } chip; |
| 71 | }; | 71 | }; |
| 72 | 72 | ||
| 73 | /* for KVM_CREATE_PIT2 */ | ||
| 74 | struct kvm_pit_config { | ||
| 75 | __u32 flags; | ||
| 76 | __u32 pad[15]; | ||
| 77 | }; | ||
| 78 | |||
| 79 | #define KVM_PIT_SPEAKER_DUMMY 1 | ||
| 80 | |||
| 73 | #define KVM_EXIT_UNKNOWN 0 | 81 | #define KVM_EXIT_UNKNOWN 0 |
| 74 | #define KVM_EXIT_EXCEPTION 1 | 82 | #define KVM_EXIT_EXCEPTION 1 |
| 75 | #define KVM_EXIT_IO 2 | 83 | #define KVM_EXIT_IO 2 |
| @@ -87,6 +95,10 @@ struct kvm_irqchip { | |||
| 87 | #define KVM_EXIT_S390_RESET 14 | 95 | #define KVM_EXIT_S390_RESET 14 |
| 88 | #define KVM_EXIT_DCR 15 | 96 | #define KVM_EXIT_DCR 15 |
| 89 | #define KVM_EXIT_NMI 16 | 97 | #define KVM_EXIT_NMI 16 |
| 98 | #define KVM_EXIT_INTERNAL_ERROR 17 | ||
| 99 | |||
| 100 | /* For KVM_EXIT_INTERNAL_ERROR */ | ||
| 101 | #define KVM_INTERNAL_ERROR_EMULATION 1 | ||
| 90 | 102 | ||
| 91 | /* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */ | 103 | /* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */ |
| 92 | struct kvm_run { | 104 | struct kvm_run { |
| @@ -173,6 +185,9 @@ struct kvm_run { | |||
| 173 | __u32 data; | 185 | __u32 data; |
| 174 | __u8 is_write; | 186 | __u8 is_write; |
| 175 | } dcr; | 187 | } dcr; |
| 188 | struct { | ||
| 189 | __u32 suberror; | ||
| 190 | } internal; | ||
| 176 | /* Fix the size of the union. */ | 191 | /* Fix the size of the union. */ |
| 177 | char padding[256]; | 192 | char padding[256]; |
| 178 | }; | 193 | }; |
| @@ -292,6 +307,28 @@ struct kvm_guest_debug { | |||
| 292 | struct kvm_guest_debug_arch arch; | 307 | struct kvm_guest_debug_arch arch; |
| 293 | }; | 308 | }; |
| 294 | 309 | ||
| 310 | enum { | ||
| 311 | kvm_ioeventfd_flag_nr_datamatch, | ||
| 312 | kvm_ioeventfd_flag_nr_pio, | ||
| 313 | kvm_ioeventfd_flag_nr_deassign, | ||
| 314 | kvm_ioeventfd_flag_nr_max, | ||
| 315 | }; | ||
| 316 | |||
| 317 | #define KVM_IOEVENTFD_FLAG_DATAMATCH (1 << kvm_ioeventfd_flag_nr_datamatch) | ||
| 318 | #define KVM_IOEVENTFD_FLAG_PIO (1 << kvm_ioeventfd_flag_nr_pio) | ||
| 319 | #define KVM_IOEVENTFD_FLAG_DEASSIGN (1 << kvm_ioeventfd_flag_nr_deassign) | ||
| 320 | |||
| 321 | #define KVM_IOEVENTFD_VALID_FLAG_MASK ((1 << kvm_ioeventfd_flag_nr_max) - 1) | ||
| 322 | |||
| 323 | struct kvm_ioeventfd { | ||
| 324 | __u64 datamatch; | ||
| 325 | __u64 addr; /* legal pio/mmio address */ | ||
| 326 | __u32 len; /* 1, 2, 4, or 8 bytes */ | ||
| 327 | __s32 fd; | ||
| 328 | __u32 flags; | ||
| 329 | __u8 pad[36]; | ||
| 330 | }; | ||
| 331 | |||
| 295 | #define KVM_TRC_SHIFT 16 | 332 | #define KVM_TRC_SHIFT 16 |
| 296 | /* | 333 | /* |
| 297 | * kvm trace categories | 334 | * kvm trace categories |
| @@ -310,35 +347,6 @@ struct kvm_guest_debug { | |||
| 310 | #define KVM_TRC_CYCLE_SIZE 8 | 347 | #define KVM_TRC_CYCLE_SIZE 8 |
| 311 | #define KVM_TRC_EXTRA_MAX 7 | 348 | #define KVM_TRC_EXTRA_MAX 7 |
| 312 | 349 | ||
| 313 | /* This structure represents a single trace buffer record. */ | ||
| 314 | struct kvm_trace_rec { | ||
| 315 | /* variable rec_val | ||
| 316 | * is split into: | ||
| 317 | * bits 0 - 27 -> event id | ||
| 318 | * bits 28 -30 -> number of extra data args of size u32 | ||
| 319 | * bits 31 -> binary indicator for if tsc is in record | ||
| 320 | */ | ||
| 321 | __u32 rec_val; | ||
| 322 | __u32 pid; | ||
| 323 | __u32 vcpu_id; | ||
| 324 | union { | ||
| 325 | struct { | ||
| 326 | __u64 timestamp; | ||
| 327 | __u32 extra_u32[KVM_TRC_EXTRA_MAX]; | ||
| 328 | } __attribute__((packed)) timestamp; | ||
| 329 | struct { | ||
| 330 | __u32 extra_u32[KVM_TRC_EXTRA_MAX]; | ||
| 331 | } notimestamp; | ||
| 332 | } u; | ||
| 333 | }; | ||
| 334 | |||
| 335 | #define TRACE_REC_EVENT_ID(val) \ | ||
| 336 | (0x0fffffff & (val)) | ||
| 337 | #define TRACE_REC_NUM_DATA_ARGS(val) \ | ||
| 338 | (0x70000000 & ((val) << 28)) | ||
| 339 | #define TRACE_REC_TCS(val) \ | ||
| 340 | (0x80000000 & ((val) << 31)) | ||
| 341 | |||
| 342 | #define KVMIO 0xAE | 350 | #define KVMIO 0xAE |
| 343 | 351 | ||
| 344 | /* | 352 | /* |
| @@ -415,6 +423,19 @@ struct kvm_trace_rec { | |||
| 415 | #define KVM_CAP_ASSIGN_DEV_IRQ 29 | 423 | #define KVM_CAP_ASSIGN_DEV_IRQ 29 |
| 416 | /* Another bug in KVM_SET_USER_MEMORY_REGION fixed: */ | 424 | /* Another bug in KVM_SET_USER_MEMORY_REGION fixed: */ |
| 417 | #define KVM_CAP_JOIN_MEMORY_REGIONS_WORKS 30 | 425 | #define KVM_CAP_JOIN_MEMORY_REGIONS_WORKS 30 |
| 426 | #ifdef __KVM_HAVE_MCE | ||
| 427 | #define KVM_CAP_MCE 31 | ||
| 428 | #endif | ||
| 429 | #define KVM_CAP_IRQFD 32 | ||
| 430 | #ifdef __KVM_HAVE_PIT | ||
| 431 | #define KVM_CAP_PIT2 33 | ||
| 432 | #endif | ||
| 433 | #define KVM_CAP_SET_BOOT_CPU_ID 34 | ||
| 434 | #ifdef __KVM_HAVE_PIT_STATE2 | ||
| 435 | #define KVM_CAP_PIT_STATE2 35 | ||
| 436 | #endif | ||
| 437 | #define KVM_CAP_IOEVENTFD 36 | ||
| 438 | #define KVM_CAP_SET_IDENTITY_MAP_ADDR 37 | ||
| 418 | 439 | ||
| 419 | #ifdef KVM_CAP_IRQ_ROUTING | 440 | #ifdef KVM_CAP_IRQ_ROUTING |
| 420 | 441 | ||
| @@ -454,15 +475,32 @@ struct kvm_irq_routing { | |||
| 454 | 475 | ||
| 455 | #endif | 476 | #endif |
| 456 | 477 | ||
| 478 | #ifdef KVM_CAP_MCE | ||
| 479 | /* x86 MCE */ | ||
| 480 | struct kvm_x86_mce { | ||
| 481 | __u64 status; | ||
| 482 | __u64 addr; | ||
| 483 | __u64 misc; | ||
| 484 | __u64 mcg_status; | ||
| 485 | __u8 bank; | ||
| 486 | __u8 pad1[7]; | ||
| 487 | __u64 pad2[3]; | ||
| 488 | }; | ||
| 489 | #endif | ||
| 490 | |||
| 491 | #define KVM_IRQFD_FLAG_DEASSIGN (1 << 0) | ||
| 492 | |||
| 493 | struct kvm_irqfd { | ||
| 494 | __u32 fd; | ||
| 495 | __u32 gsi; | ||
| 496 | __u32 flags; | ||
| 497 | __u8 pad[20]; | ||
| 498 | }; | ||
| 499 | |||
| 457 | /* | 500 | /* |
| 458 | * ioctls for VM fds | 501 | * ioctls for VM fds |
| 459 | */ | 502 | */ |
| 460 | #define KVM_SET_MEMORY_REGION _IOW(KVMIO, 0x40, struct kvm_memory_region) | 503 | #define KVM_SET_MEMORY_REGION _IOW(KVMIO, 0x40, struct kvm_memory_region) |
| 461 | #define KVM_SET_NR_MMU_PAGES _IO(KVMIO, 0x44) | ||
| 462 | #define KVM_GET_NR_MMU_PAGES _IO(KVMIO, 0x45) | ||
| 463 | #define KVM_SET_USER_MEMORY_REGION _IOW(KVMIO, 0x46,\ | ||
| 464 | struct kvm_userspace_memory_region) | ||
| 465 | #define KVM_SET_TSS_ADDR _IO(KVMIO, 0x47) | ||
| 466 | /* | 504 | /* |
| 467 | * KVM_CREATE_VCPU receives as a parameter the vcpu slot, and returns | 505 | * KVM_CREATE_VCPU receives as a parameter the vcpu slot, and returns |
| 468 | * a vcpu fd. | 506 | * a vcpu fd. |
| @@ -470,6 +508,12 @@ struct kvm_irq_routing { | |||
| 470 | #define KVM_CREATE_VCPU _IO(KVMIO, 0x41) | 508 | #define KVM_CREATE_VCPU _IO(KVMIO, 0x41) |
| 471 | #define KVM_GET_DIRTY_LOG _IOW(KVMIO, 0x42, struct kvm_dirty_log) | 509 | #define KVM_GET_DIRTY_LOG _IOW(KVMIO, 0x42, struct kvm_dirty_log) |
| 472 | #define KVM_SET_MEMORY_ALIAS _IOW(KVMIO, 0x43, struct kvm_memory_alias) | 510 | #define KVM_SET_MEMORY_ALIAS _IOW(KVMIO, 0x43, struct kvm_memory_alias) |
| 511 | #define KVM_SET_NR_MMU_PAGES _IO(KVMIO, 0x44) | ||
| 512 | #define KVM_GET_NR_MMU_PAGES _IO(KVMIO, 0x45) | ||
| 513 | #define KVM_SET_USER_MEMORY_REGION _IOW(KVMIO, 0x46,\ | ||
| 514 | struct kvm_userspace_memory_region) | ||
| 515 | #define KVM_SET_TSS_ADDR _IO(KVMIO, 0x47) | ||
| 516 | #define KVM_SET_IDENTITY_MAP_ADDR _IOW(KVMIO, 0x48, __u64) | ||
| 473 | /* Device model IOC */ | 517 | /* Device model IOC */ |
| 474 | #define KVM_CREATE_IRQCHIP _IO(KVMIO, 0x60) | 518 | #define KVM_CREATE_IRQCHIP _IO(KVMIO, 0x60) |
| 475 | #define KVM_IRQ_LINE _IOW(KVMIO, 0x61, struct kvm_irq_level) | 519 | #define KVM_IRQ_LINE _IOW(KVMIO, 0x61, struct kvm_irq_level) |
| @@ -498,6 +542,10 @@ struct kvm_irq_routing { | |||
| 498 | #define KVM_ASSIGN_SET_MSIX_ENTRY \ | 542 | #define KVM_ASSIGN_SET_MSIX_ENTRY \ |
| 499 | _IOW(KVMIO, 0x74, struct kvm_assigned_msix_entry) | 543 | _IOW(KVMIO, 0x74, struct kvm_assigned_msix_entry) |
| 500 | #define KVM_DEASSIGN_DEV_IRQ _IOW(KVMIO, 0x75, struct kvm_assigned_irq) | 544 | #define KVM_DEASSIGN_DEV_IRQ _IOW(KVMIO, 0x75, struct kvm_assigned_irq) |
| 545 | #define KVM_IRQFD _IOW(KVMIO, 0x76, struct kvm_irqfd) | ||
| 546 | #define KVM_CREATE_PIT2 _IOW(KVMIO, 0x77, struct kvm_pit_config) | ||
| 547 | #define KVM_SET_BOOT_CPU_ID _IO(KVMIO, 0x78) | ||
| 548 | #define KVM_IOEVENTFD _IOW(KVMIO, 0x79, struct kvm_ioeventfd) | ||
| 501 | 549 | ||
| 502 | /* | 550 | /* |
| 503 | * ioctls for vcpu fds | 551 | * ioctls for vcpu fds |
| @@ -541,6 +589,10 @@ struct kvm_irq_routing { | |||
| 541 | #define KVM_NMI _IO(KVMIO, 0x9a) | 589 | #define KVM_NMI _IO(KVMIO, 0x9a) |
| 542 | /* Available with KVM_CAP_SET_GUEST_DEBUG */ | 590 | /* Available with KVM_CAP_SET_GUEST_DEBUG */ |
| 543 | #define KVM_SET_GUEST_DEBUG _IOW(KVMIO, 0x9b, struct kvm_guest_debug) | 591 | #define KVM_SET_GUEST_DEBUG _IOW(KVMIO, 0x9b, struct kvm_guest_debug) |
| 592 | /* MCE for x86 */ | ||
| 593 | #define KVM_X86_SETUP_MCE _IOW(KVMIO, 0x9c, __u64) | ||
| 594 | #define KVM_X86_GET_MCE_CAP_SUPPORTED _IOR(KVMIO, 0x9d, __u64) | ||
| 595 | #define KVM_X86_SET_MCE _IOW(KVMIO, 0x9e, struct kvm_x86_mce) | ||
| 544 | 596 | ||
| 545 | /* | 597 | /* |
| 546 | * Deprecated interfaces | 598 | * Deprecated interfaces |
| @@ -563,6 +615,9 @@ struct kvm_debug_guest { | |||
| 563 | #define KVM_IA64_VCPU_GET_STACK _IOR(KVMIO, 0x9a, void *) | 615 | #define KVM_IA64_VCPU_GET_STACK _IOR(KVMIO, 0x9a, void *) |
| 564 | #define KVM_IA64_VCPU_SET_STACK _IOW(KVMIO, 0x9b, void *) | 616 | #define KVM_IA64_VCPU_SET_STACK _IOW(KVMIO, 0x9b, void *) |
| 565 | 617 | ||
| 618 | #define KVM_GET_PIT2 _IOR(KVMIO, 0x9f, struct kvm_pit_state2) | ||
| 619 | #define KVM_SET_PIT2 _IOW(KVMIO, 0xa0, struct kvm_pit_state2) | ||
| 620 | |||
| 566 | #define KVM_TRC_INJ_VIRQ (KVM_TRC_HANDLER + 0x02) | 621 | #define KVM_TRC_INJ_VIRQ (KVM_TRC_HANDLER + 0x02) |
| 567 | #define KVM_TRC_REDELIVER_EVT (KVM_TRC_HANDLER + 0x03) | 622 | #define KVM_TRC_REDELIVER_EVT (KVM_TRC_HANDLER + 0x03) |
| 568 | #define KVM_TRC_PEND_INTR (KVM_TRC_HANDLER + 0x04) | 623 | #define KVM_TRC_PEND_INTR (KVM_TRC_HANDLER + 0x04) |
| @@ -633,7 +688,7 @@ struct kvm_assigned_msix_nr { | |||
| 633 | __u16 padding; | 688 | __u16 padding; |
| 634 | }; | 689 | }; |
| 635 | 690 | ||
| 636 | #define KVM_MAX_MSIX_PER_DEV 512 | 691 | #define KVM_MAX_MSIX_PER_DEV 256 |
| 637 | struct kvm_assigned_msix_entry { | 692 | struct kvm_assigned_msix_entry { |
| 638 | __u32 assigned_dev_id; | 693 | __u32 assigned_dev_id; |
| 639 | __u32 gsi; | 694 | __u32 gsi; |
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 3060bdc35ffe..b7bbb5ddd7ae 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
| @@ -15,7 +15,6 @@ | |||
| 15 | #include <linux/sched.h> | 15 | #include <linux/sched.h> |
| 16 | #include <linux/mm.h> | 16 | #include <linux/mm.h> |
| 17 | #include <linux/preempt.h> | 17 | #include <linux/preempt.h> |
| 18 | #include <linux/marker.h> | ||
| 19 | #include <linux/msi.h> | 18 | #include <linux/msi.h> |
| 20 | #include <asm/signal.h> | 19 | #include <asm/signal.h> |
| 21 | 20 | ||
| @@ -42,6 +41,7 @@ | |||
| 42 | 41 | ||
| 43 | #define KVM_USERSPACE_IRQ_SOURCE_ID 0 | 42 | #define KVM_USERSPACE_IRQ_SOURCE_ID 0 |
| 44 | 43 | ||
| 44 | struct kvm; | ||
| 45 | struct kvm_vcpu; | 45 | struct kvm_vcpu; |
| 46 | extern struct kmem_cache *kvm_vcpu_cache; | 46 | extern struct kmem_cache *kvm_vcpu_cache; |
| 47 | 47 | ||
| @@ -59,10 +59,18 @@ struct kvm_io_bus { | |||
| 59 | 59 | ||
| 60 | void kvm_io_bus_init(struct kvm_io_bus *bus); | 60 | void kvm_io_bus_init(struct kvm_io_bus *bus); |
| 61 | void kvm_io_bus_destroy(struct kvm_io_bus *bus); | 61 | void kvm_io_bus_destroy(struct kvm_io_bus *bus); |
| 62 | struct kvm_io_device *kvm_io_bus_find_dev(struct kvm_io_bus *bus, | 62 | int kvm_io_bus_write(struct kvm_io_bus *bus, gpa_t addr, int len, |
| 63 | gpa_t addr, int len, int is_write); | 63 | const void *val); |
| 64 | void kvm_io_bus_register_dev(struct kvm_io_bus *bus, | 64 | int kvm_io_bus_read(struct kvm_io_bus *bus, gpa_t addr, int len, |
| 65 | struct kvm_io_device *dev); | 65 | void *val); |
| 66 | int __kvm_io_bus_register_dev(struct kvm_io_bus *bus, | ||
| 67 | struct kvm_io_device *dev); | ||
| 68 | int kvm_io_bus_register_dev(struct kvm *kvm, struct kvm_io_bus *bus, | ||
| 69 | struct kvm_io_device *dev); | ||
| 70 | void __kvm_io_bus_unregister_dev(struct kvm_io_bus *bus, | ||
| 71 | struct kvm_io_device *dev); | ||
| 72 | void kvm_io_bus_unregister_dev(struct kvm *kvm, struct kvm_io_bus *bus, | ||
| 73 | struct kvm_io_device *dev); | ||
| 66 | 74 | ||
| 67 | struct kvm_vcpu { | 75 | struct kvm_vcpu { |
| 68 | struct kvm *kvm; | 76 | struct kvm *kvm; |
| @@ -103,7 +111,7 @@ struct kvm_memory_slot { | |||
| 103 | struct { | 111 | struct { |
| 104 | unsigned long rmap_pde; | 112 | unsigned long rmap_pde; |
| 105 | int write_count; | 113 | int write_count; |
| 106 | } *lpage_info; | 114 | } *lpage_info[KVM_NR_PAGE_SIZES - 1]; |
| 107 | unsigned long userspace_addr; | 115 | unsigned long userspace_addr; |
| 108 | int user_alloc; | 116 | int user_alloc; |
| 109 | }; | 117 | }; |
| @@ -124,7 +132,6 @@ struct kvm_kernel_irq_routing_entry { | |||
| 124 | }; | 132 | }; |
| 125 | 133 | ||
| 126 | struct kvm { | 134 | struct kvm { |
| 127 | struct mutex lock; /* protects the vcpus array and APIC accesses */ | ||
| 128 | spinlock_t mmu_lock; | 135 | spinlock_t mmu_lock; |
| 129 | spinlock_t requests_lock; | 136 | spinlock_t requests_lock; |
| 130 | struct rw_semaphore slots_lock; | 137 | struct rw_semaphore slots_lock; |
| @@ -132,10 +139,23 @@ struct kvm { | |||
| 132 | int nmemslots; | 139 | int nmemslots; |
| 133 | struct kvm_memory_slot memslots[KVM_MEMORY_SLOTS + | 140 | struct kvm_memory_slot memslots[KVM_MEMORY_SLOTS + |
| 134 | KVM_PRIVATE_MEM_SLOTS]; | 141 | KVM_PRIVATE_MEM_SLOTS]; |
| 142 | #ifdef CONFIG_KVM_APIC_ARCHITECTURE | ||
| 143 | u32 bsp_vcpu_id; | ||
| 144 | struct kvm_vcpu *bsp_vcpu; | ||
| 145 | #endif | ||
| 135 | struct kvm_vcpu *vcpus[KVM_MAX_VCPUS]; | 146 | struct kvm_vcpu *vcpus[KVM_MAX_VCPUS]; |
| 147 | atomic_t online_vcpus; | ||
| 136 | struct list_head vm_list; | 148 | struct list_head vm_list; |
| 149 | struct mutex lock; | ||
| 137 | struct kvm_io_bus mmio_bus; | 150 | struct kvm_io_bus mmio_bus; |
| 138 | struct kvm_io_bus pio_bus; | 151 | struct kvm_io_bus pio_bus; |
| 152 | #ifdef CONFIG_HAVE_KVM_EVENTFD | ||
| 153 | struct { | ||
| 154 | spinlock_t lock; | ||
| 155 | struct list_head items; | ||
| 156 | } irqfds; | ||
| 157 | struct list_head ioeventfds; | ||
| 158 | #endif | ||
| 139 | struct kvm_vm_stat stat; | 159 | struct kvm_vm_stat stat; |
| 140 | struct kvm_arch arch; | 160 | struct kvm_arch arch; |
| 141 | atomic_t users_count; | 161 | atomic_t users_count; |
| @@ -144,6 +164,7 @@ struct kvm { | |||
| 144 | struct kvm_coalesced_mmio_ring *coalesced_mmio_ring; | 164 | struct kvm_coalesced_mmio_ring *coalesced_mmio_ring; |
| 145 | #endif | 165 | #endif |
| 146 | 166 | ||
| 167 | struct mutex irq_lock; | ||
| 147 | #ifdef CONFIG_HAVE_KVM_IRQCHIP | 168 | #ifdef CONFIG_HAVE_KVM_IRQCHIP |
| 148 | struct list_head irq_routing; /* of kvm_kernel_irq_routing_entry */ | 169 | struct list_head irq_routing; /* of kvm_kernel_irq_routing_entry */ |
| 149 | struct hlist_head mask_notifier_list; | 170 | struct hlist_head mask_notifier_list; |
| @@ -167,6 +188,17 @@ struct kvm { | |||
| 167 | #define kvm_printf(kvm, fmt ...) printk(KERN_DEBUG fmt) | 188 | #define kvm_printf(kvm, fmt ...) printk(KERN_DEBUG fmt) |
| 168 | #define vcpu_printf(vcpu, fmt...) kvm_printf(vcpu->kvm, fmt) | 189 | #define vcpu_printf(vcpu, fmt...) kvm_printf(vcpu->kvm, fmt) |
| 169 | 190 | ||
| 191 | static inline struct kvm_vcpu *kvm_get_vcpu(struct kvm *kvm, int i) | ||
| 192 | { | ||
| 193 | smp_rmb(); | ||
| 194 | return kvm->vcpus[i]; | ||
| 195 | } | ||
| 196 | |||
| 197 | #define kvm_for_each_vcpu(idx, vcpup, kvm) \ | ||
| 198 | for (idx = 0, vcpup = kvm_get_vcpu(kvm, idx); \ | ||
| 199 | idx < atomic_read(&kvm->online_vcpus) && vcpup; \ | ||
| 200 | vcpup = kvm_get_vcpu(kvm, ++idx)) | ||
| 201 | |||
| 170 | int kvm_vcpu_init(struct kvm_vcpu *vcpu, struct kvm *kvm, unsigned id); | 202 | int kvm_vcpu_init(struct kvm_vcpu *vcpu, struct kvm *kvm, unsigned id); |
| 171 | void kvm_vcpu_uninit(struct kvm_vcpu *vcpu); | 203 | void kvm_vcpu_uninit(struct kvm_vcpu *vcpu); |
| 172 | 204 | ||
| @@ -201,6 +233,7 @@ int kvm_arch_set_memory_region(struct kvm *kvm, | |||
| 201 | struct kvm_userspace_memory_region *mem, | 233 | struct kvm_userspace_memory_region *mem, |
| 202 | struct kvm_memory_slot old, | 234 | struct kvm_memory_slot old, |
| 203 | int user_alloc); | 235 | int user_alloc); |
| 236 | void kvm_disable_largepages(void); | ||
| 204 | void kvm_arch_flush_shadow(struct kvm *kvm); | 237 | void kvm_arch_flush_shadow(struct kvm *kvm); |
| 205 | gfn_t unalias_gfn(struct kvm *kvm, gfn_t gfn); | 238 | gfn_t unalias_gfn(struct kvm *kvm, gfn_t gfn); |
| 206 | struct page *gfn_to_page(struct kvm *kvm, gfn_t gfn); | 239 | struct page *gfn_to_page(struct kvm *kvm, gfn_t gfn); |
| @@ -243,8 +276,6 @@ long kvm_arch_dev_ioctl(struct file *filp, | |||
| 243 | unsigned int ioctl, unsigned long arg); | 276 | unsigned int ioctl, unsigned long arg); |
| 244 | long kvm_arch_vcpu_ioctl(struct file *filp, | 277 | long kvm_arch_vcpu_ioctl(struct file *filp, |
| 245 | unsigned int ioctl, unsigned long arg); | 278 | unsigned int ioctl, unsigned long arg); |
| 246 | void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu); | ||
| 247 | void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu); | ||
| 248 | 279 | ||
| 249 | int kvm_dev_ioctl_check_extension(long ext); | 280 | int kvm_dev_ioctl_check_extension(long ext); |
| 250 | 281 | ||
| @@ -300,7 +331,6 @@ int kvm_arch_hardware_setup(void); | |||
| 300 | void kvm_arch_hardware_unsetup(void); | 331 | void kvm_arch_hardware_unsetup(void); |
| 301 | void kvm_arch_check_processor_compat(void *rtn); | 332 | void kvm_arch_check_processor_compat(void *rtn); |
| 302 | int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu); | 333 | int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu); |
| 303 | int kvm_arch_interrupt_allowed(struct kvm_vcpu *vcpu); | ||
| 304 | 334 | ||
| 305 | void kvm_free_physmem(struct kvm *kvm); | 335 | void kvm_free_physmem(struct kvm *kvm); |
| 306 | 336 | ||
| @@ -309,8 +339,6 @@ void kvm_arch_destroy_vm(struct kvm *kvm); | |||
| 309 | void kvm_free_all_assigned_devices(struct kvm *kvm); | 339 | void kvm_free_all_assigned_devices(struct kvm *kvm); |
| 310 | void kvm_arch_sync_events(struct kvm *kvm); | 340 | void kvm_arch_sync_events(struct kvm *kvm); |
| 311 | 341 | ||
| 312 | int kvm_cpu_get_interrupt(struct kvm_vcpu *v); | ||
| 313 | int kvm_cpu_has_interrupt(struct kvm_vcpu *v); | ||
| 314 | int kvm_cpu_has_pending_timer(struct kvm_vcpu *vcpu); | 342 | int kvm_cpu_has_pending_timer(struct kvm_vcpu *vcpu); |
| 315 | void kvm_vcpu_kick(struct kvm_vcpu *vcpu); | 343 | void kvm_vcpu_kick(struct kvm_vcpu *vcpu); |
| 316 | 344 | ||
| @@ -366,7 +394,8 @@ int kvm_set_irq(struct kvm *kvm, int irq_source_id, int irq, int level); | |||
| 366 | void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin); | 394 | void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin); |
| 367 | void kvm_register_irq_ack_notifier(struct kvm *kvm, | 395 | void kvm_register_irq_ack_notifier(struct kvm *kvm, |
| 368 | struct kvm_irq_ack_notifier *kian); | 396 | struct kvm_irq_ack_notifier *kian); |
| 369 | void kvm_unregister_irq_ack_notifier(struct kvm_irq_ack_notifier *kian); | 397 | void kvm_unregister_irq_ack_notifier(struct kvm *kvm, |
| 398 | struct kvm_irq_ack_notifier *kian); | ||
| 370 | int kvm_request_irq_source_id(struct kvm *kvm); | 399 | int kvm_request_irq_source_id(struct kvm *kvm); |
| 371 | void kvm_free_irq_source_id(struct kvm *kvm, int irq_source_id); | 400 | void kvm_free_irq_source_id(struct kvm *kvm, int irq_source_id); |
| 372 | 401 | ||
| @@ -459,37 +488,6 @@ struct kvm_stats_debugfs_item { | |||
| 459 | extern struct kvm_stats_debugfs_item debugfs_entries[]; | 488 | extern struct kvm_stats_debugfs_item debugfs_entries[]; |
| 460 | extern struct dentry *kvm_debugfs_dir; | 489 | extern struct dentry *kvm_debugfs_dir; |
| 461 | 490 | ||
| 462 | #define KVMTRACE_5D(evt, vcpu, d1, d2, d3, d4, d5, name) \ | ||
| 463 | trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \ | ||
| 464 | vcpu, 5, d1, d2, d3, d4, d5) | ||
| 465 | #define KVMTRACE_4D(evt, vcpu, d1, d2, d3, d4, name) \ | ||
| 466 | trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \ | ||
| 467 | vcpu, 4, d1, d2, d3, d4, 0) | ||
| 468 | #define KVMTRACE_3D(evt, vcpu, d1, d2, d3, name) \ | ||
| 469 | trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \ | ||
| 470 | vcpu, 3, d1, d2, d3, 0, 0) | ||
| 471 | #define KVMTRACE_2D(evt, vcpu, d1, d2, name) \ | ||
| 472 | trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \ | ||
| 473 | vcpu, 2, d1, d2, 0, 0, 0) | ||
| 474 | #define KVMTRACE_1D(evt, vcpu, d1, name) \ | ||
| 475 | trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \ | ||
| 476 | vcpu, 1, d1, 0, 0, 0, 0) | ||
| 477 | #define KVMTRACE_0D(evt, vcpu, name) \ | ||
| 478 | trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \ | ||
| 479 | vcpu, 0, 0, 0, 0, 0, 0) | ||
| 480 | |||
| 481 | #ifdef CONFIG_KVM_TRACE | ||
| 482 | int kvm_trace_ioctl(unsigned int ioctl, unsigned long arg); | ||
| 483 | void kvm_trace_cleanup(void); | ||
| 484 | #else | ||
| 485 | static inline | ||
| 486 | int kvm_trace_ioctl(unsigned int ioctl, unsigned long arg) | ||
| 487 | { | ||
| 488 | return -EINVAL; | ||
| 489 | } | ||
| 490 | #define kvm_trace_cleanup() ((void)0) | ||
| 491 | #endif | ||
| 492 | |||
| 493 | #ifdef KVM_ARCH_WANT_MMU_NOTIFIER | 491 | #ifdef KVM_ARCH_WANT_MMU_NOTIFIER |
| 494 | static inline int mmu_notifier_retry(struct kvm_vcpu *vcpu, unsigned long mmu_seq) | 492 | static inline int mmu_notifier_retry(struct kvm_vcpu *vcpu, unsigned long mmu_seq) |
| 495 | { | 493 | { |
| @@ -525,4 +523,33 @@ static inline void kvm_free_irq_routing(struct kvm *kvm) {} | |||
| 525 | 523 | ||
| 526 | #endif | 524 | #endif |
| 527 | 525 | ||
| 526 | #ifdef CONFIG_HAVE_KVM_EVENTFD | ||
| 527 | |||
| 528 | void kvm_eventfd_init(struct kvm *kvm); | ||
| 529 | int kvm_irqfd(struct kvm *kvm, int fd, int gsi, int flags); | ||
| 530 | void kvm_irqfd_release(struct kvm *kvm); | ||
| 531 | int kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args); | ||
| 532 | |||
| 533 | #else | ||
| 534 | |||
| 535 | static inline void kvm_eventfd_init(struct kvm *kvm) {} | ||
| 536 | static inline int kvm_irqfd(struct kvm *kvm, int fd, int gsi, int flags) | ||
| 537 | { | ||
| 538 | return -EINVAL; | ||
| 539 | } | ||
| 540 | |||
| 541 | static inline void kvm_irqfd_release(struct kvm *kvm) {} | ||
| 542 | static inline int kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args) | ||
| 543 | { | ||
| 544 | return -ENOSYS; | ||
| 545 | } | ||
| 546 | |||
| 547 | #endif /* CONFIG_HAVE_KVM_EVENTFD */ | ||
| 548 | |||
| 549 | #ifdef CONFIG_KVM_APIC_ARCHITECTURE | ||
| 550 | static inline bool kvm_vcpu_is_bsp(struct kvm_vcpu *vcpu) | ||
| 551 | { | ||
| 552 | return vcpu->kvm->bsp_vcpu_id == vcpu->vcpu_id; | ||
| 553 | } | ||
| 554 | #endif | ||
| 528 | #endif | 555 | #endif |
diff --git a/include/linux/kvm_para.h b/include/linux/kvm_para.h index 3ddce03766ca..d73109243fda 100644 --- a/include/linux/kvm_para.h +++ b/include/linux/kvm_para.h | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | #define KVM_ENOSYS 1000 | 13 | #define KVM_ENOSYS 1000 |
| 14 | #define KVM_EFAULT EFAULT | 14 | #define KVM_EFAULT EFAULT |
| 15 | #define KVM_E2BIG E2BIG | 15 | #define KVM_E2BIG E2BIG |
| 16 | #define KVM_EPERM EPERM | ||
| 16 | 17 | ||
| 17 | #define KVM_HC_VAPIC_POLL_IRQ 1 | 18 | #define KVM_HC_VAPIC_POLL_IRQ 1 |
| 18 | #define KVM_HC_MMU_OP 2 | 19 | #define KVM_HC_MMU_OP 2 |
diff --git a/include/linux/libata.h b/include/linux/libata.h index 76319bf03e37..87698640c091 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
| @@ -418,6 +418,17 @@ enum { | |||
| 418 | ATA_TIMING_ACTIVE | ATA_TIMING_RECOVER | | 418 | ATA_TIMING_ACTIVE | ATA_TIMING_RECOVER | |
| 419 | ATA_TIMING_DMACK_HOLD | ATA_TIMING_CYCLE | | 419 | ATA_TIMING_DMACK_HOLD | ATA_TIMING_CYCLE | |
| 420 | ATA_TIMING_UDMA, | 420 | ATA_TIMING_UDMA, |
| 421 | |||
| 422 | /* ACPI constants */ | ||
| 423 | ATA_ACPI_FILTER_SETXFER = 1 << 0, | ||
| 424 | ATA_ACPI_FILTER_LOCK = 1 << 1, | ||
| 425 | ATA_ACPI_FILTER_DIPM = 1 << 2, | ||
| 426 | ATA_ACPI_FILTER_FPDMA_OFFSET = 1 << 3, /* FPDMA non-zero offset */ | ||
| 427 | ATA_ACPI_FILTER_FPDMA_AA = 1 << 4, /* FPDMA auto activate */ | ||
| 428 | |||
| 429 | ATA_ACPI_FILTER_DEFAULT = ATA_ACPI_FILTER_SETXFER | | ||
| 430 | ATA_ACPI_FILTER_LOCK | | ||
| 431 | ATA_ACPI_FILTER_DIPM, | ||
| 421 | }; | 432 | }; |
| 422 | 433 | ||
| 423 | enum ata_xfer_mask { | 434 | enum ata_xfer_mask { |
| @@ -587,6 +598,7 @@ struct ata_device { | |||
| 587 | #ifdef CONFIG_ATA_ACPI | 598 | #ifdef CONFIG_ATA_ACPI |
| 588 | acpi_handle acpi_handle; | 599 | acpi_handle acpi_handle; |
| 589 | union acpi_object *gtf_cache; | 600 | union acpi_object *gtf_cache; |
| 601 | unsigned int gtf_filter; | ||
| 590 | #endif | 602 | #endif |
| 591 | /* n_sector is CLEAR_BEGIN, read comment above CLEAR_BEGIN */ | 603 | /* n_sector is CLEAR_BEGIN, read comment above CLEAR_BEGIN */ |
| 592 | u64 n_sectors; /* size of device, if ATA */ | 604 | u64 n_sectors; /* size of device, if ATA */ |
diff --git a/include/linux/libps2.h b/include/linux/libps2.h index b94534b7e266..79603a6c356f 100644 --- a/include/linux/libps2.h +++ b/include/linux/libps2.h | |||
| @@ -44,6 +44,9 @@ struct ps2dev { | |||
| 44 | void ps2_init(struct ps2dev *ps2dev, struct serio *serio); | 44 | void ps2_init(struct ps2dev *ps2dev, struct serio *serio); |
| 45 | int ps2_sendbyte(struct ps2dev *ps2dev, unsigned char byte, int timeout); | 45 | int ps2_sendbyte(struct ps2dev *ps2dev, unsigned char byte, int timeout); |
| 46 | void ps2_drain(struct ps2dev *ps2dev, int maxbytes, int timeout); | 46 | void ps2_drain(struct ps2dev *ps2dev, int maxbytes, int timeout); |
| 47 | void ps2_begin_command(struct ps2dev *ps2dev); | ||
| 48 | void ps2_end_command(struct ps2dev *ps2dev); | ||
| 49 | int __ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command); | ||
| 47 | int ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command); | 50 | int ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command); |
| 48 | int ps2_handle_ack(struct ps2dev *ps2dev, unsigned char data); | 51 | int ps2_handle_ack(struct ps2dev *ps2dev, unsigned char data); |
| 49 | int ps2_handle_response(struct ps2dev *ps2dev, unsigned char data); | 52 | int ps2_handle_response(struct ps2dev *ps2dev, unsigned char data); |
diff --git a/include/linux/linkage.h b/include/linux/linkage.h index 691f59171c6c..5126cceb6ae9 100644 --- a/include/linux/linkage.h +++ b/include/linux/linkage.h | |||
| @@ -57,6 +57,7 @@ | |||
| 57 | 57 | ||
| 58 | #ifdef __ASSEMBLY__ | 58 | #ifdef __ASSEMBLY__ |
| 59 | 59 | ||
| 60 | #ifndef LINKER_SCRIPT | ||
| 60 | #define ALIGN __ALIGN | 61 | #define ALIGN __ALIGN |
| 61 | #define ALIGN_STR __ALIGN_STR | 62 | #define ALIGN_STR __ALIGN_STR |
| 62 | 63 | ||
| @@ -66,6 +67,7 @@ | |||
| 66 | ALIGN; \ | 67 | ALIGN; \ |
| 67 | name: | 68 | name: |
| 68 | #endif | 69 | #endif |
| 70 | #endif /* LINKER_SCRIPT */ | ||
| 69 | 71 | ||
| 70 | #ifndef WEAK | 72 | #ifndef WEAK |
| 71 | #define WEAK(name) \ | 73 | #define WEAK(name) \ |
diff --git a/include/linux/lis3lv02d.h b/include/linux/lis3lv02d.h index ad651f4e45ac..3cc2f2c53e4c 100644 --- a/include/linux/lis3lv02d.h +++ b/include/linux/lis3lv02d.h | |||
| @@ -32,8 +32,17 @@ struct lis3lv02d_platform_data { | |||
| 32 | #define LIS3_IRQ2_DATA_READY (4 << 3) | 32 | #define LIS3_IRQ2_DATA_READY (4 << 3) |
| 33 | #define LIS3_IRQ2_CLICK (7 << 3) | 33 | #define LIS3_IRQ2_CLICK (7 << 3) |
| 34 | #define LIS3_IRQ_OPEN_DRAIN (1 << 6) | 34 | #define LIS3_IRQ_OPEN_DRAIN (1 << 6) |
| 35 | #define LIS3_IRQ_ACTIVE_HIGH (1 << 7) | 35 | #define LIS3_IRQ_ACTIVE_LOW (1 << 7) |
| 36 | unsigned char irq_cfg; | 36 | unsigned char irq_cfg; |
| 37 | |||
| 38 | #define LIS3_WAKEUP_X_LO (1 << 0) | ||
| 39 | #define LIS3_WAKEUP_X_HI (1 << 1) | ||
| 40 | #define LIS3_WAKEUP_Y_LO (1 << 2) | ||
| 41 | #define LIS3_WAKEUP_Y_HI (1 << 3) | ||
| 42 | #define LIS3_WAKEUP_Z_LO (1 << 4) | ||
| 43 | #define LIS3_WAKEUP_Z_HI (1 << 5) | ||
| 44 | unsigned char wakeup_flags; | ||
| 45 | unsigned char wakeup_thresh; | ||
| 37 | }; | 46 | }; |
| 38 | 47 | ||
| 39 | #endif /* __LIS3LV02D_H_ */ | 48 | #endif /* __LIS3LV02D_H_ */ |
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h index c325b187966b..a34dea46b629 100644 --- a/include/linux/lockd/lockd.h +++ b/include/linux/lockd/lockd.h | |||
| @@ -338,49 +338,6 @@ static inline int nlm_privileged_requester(const struct svc_rqst *rqstp) | |||
| 338 | } | 338 | } |
| 339 | } | 339 | } |
| 340 | 340 | ||
| 341 | static inline int __nlm_cmp_addr4(const struct sockaddr *sap1, | ||
| 342 | const struct sockaddr *sap2) | ||
| 343 | { | ||
| 344 | const struct sockaddr_in *sin1 = (const struct sockaddr_in *)sap1; | ||
| 345 | const struct sockaddr_in *sin2 = (const struct sockaddr_in *)sap2; | ||
| 346 | return sin1->sin_addr.s_addr == sin2->sin_addr.s_addr; | ||
| 347 | } | ||
| 348 | |||
| 349 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | ||
| 350 | static inline int __nlm_cmp_addr6(const struct sockaddr *sap1, | ||
| 351 | const struct sockaddr *sap2) | ||
| 352 | { | ||
| 353 | const struct sockaddr_in6 *sin1 = (const struct sockaddr_in6 *)sap1; | ||
| 354 | const struct sockaddr_in6 *sin2 = (const struct sockaddr_in6 *)sap2; | ||
| 355 | return ipv6_addr_equal(&sin1->sin6_addr, &sin2->sin6_addr); | ||
| 356 | } | ||
| 357 | #else /* !(CONFIG_IPV6 || CONFIG_IPV6_MODULE) */ | ||
| 358 | static inline int __nlm_cmp_addr6(const struct sockaddr *sap1, | ||
| 359 | const struct sockaddr *sap2) | ||
| 360 | { | ||
| 361 | return 0; | ||
| 362 | } | ||
| 363 | #endif /* !(CONFIG_IPV6 || CONFIG_IPV6_MODULE) */ | ||
| 364 | |||
| 365 | /* | ||
| 366 | * Compare two host addresses | ||
| 367 | * | ||
| 368 | * Return TRUE if the addresses are the same; otherwise FALSE. | ||
| 369 | */ | ||
| 370 | static inline int nlm_cmp_addr(const struct sockaddr *sap1, | ||
| 371 | const struct sockaddr *sap2) | ||
| 372 | { | ||
| 373 | if (sap1->sa_family == sap2->sa_family) { | ||
| 374 | switch (sap1->sa_family) { | ||
| 375 | case AF_INET: | ||
| 376 | return __nlm_cmp_addr4(sap1, sap2); | ||
| 377 | case AF_INET6: | ||
| 378 | return __nlm_cmp_addr6(sap1, sap2); | ||
| 379 | } | ||
| 380 | } | ||
| 381 | return 0; | ||
| 382 | } | ||
| 383 | |||
| 384 | /* | 341 | /* |
| 385 | * Compare two NLM locks. | 342 | * Compare two NLM locks. |
| 386 | * When the second lock is of type F_UNLCK, this acts like a wildcard. | 343 | * When the second lock is of type F_UNLCK, this acts like a wildcard. |
| @@ -395,7 +352,7 @@ static inline int nlm_compare_locks(const struct file_lock *fl1, | |||
| 395 | &&(fl1->fl_type == fl2->fl_type || fl2->fl_type == F_UNLCK); | 352 | &&(fl1->fl_type == fl2->fl_type || fl2->fl_type == F_UNLCK); |
| 396 | } | 353 | } |
| 397 | 354 | ||
| 398 | extern struct lock_manager_operations nlmsvc_lock_operations; | 355 | extern const struct lock_manager_operations nlmsvc_lock_operations; |
| 399 | 356 | ||
| 400 | #endif /* __KERNEL__ */ | 357 | #endif /* __KERNEL__ */ |
| 401 | 358 | ||
diff --git a/include/linux/lsm_audit.h b/include/linux/lsm_audit.h index 190c37854870..f78f83d7663f 100644 --- a/include/linux/lsm_audit.h +++ b/include/linux/lsm_audit.h | |||
| @@ -26,14 +26,15 @@ | |||
| 26 | 26 | ||
| 27 | /* Auxiliary data to use in generating the audit record. */ | 27 | /* Auxiliary data to use in generating the audit record. */ |
| 28 | struct common_audit_data { | 28 | struct common_audit_data { |
| 29 | char type; | 29 | char type; |
| 30 | #define LSM_AUDIT_DATA_FS 1 | 30 | #define LSM_AUDIT_DATA_FS 1 |
| 31 | #define LSM_AUDIT_DATA_NET 2 | 31 | #define LSM_AUDIT_DATA_NET 2 |
| 32 | #define LSM_AUDIT_DATA_CAP 3 | 32 | #define LSM_AUDIT_DATA_CAP 3 |
| 33 | #define LSM_AUDIT_DATA_IPC 4 | 33 | #define LSM_AUDIT_DATA_IPC 4 |
| 34 | #define LSM_AUDIT_DATA_TASK 5 | 34 | #define LSM_AUDIT_DATA_TASK 5 |
| 35 | #define LSM_AUDIT_DATA_KEY 6 | 35 | #define LSM_AUDIT_DATA_KEY 6 |
| 36 | #define LSM_AUDIT_NO_AUDIT 7 | 36 | #define LSM_AUDIT_NO_AUDIT 7 |
| 37 | #define LSM_AUDIT_DATA_KMOD 8 | ||
| 37 | struct task_struct *tsk; | 38 | struct task_struct *tsk; |
| 38 | union { | 39 | union { |
| 39 | struct { | 40 | struct { |
| @@ -66,6 +67,7 @@ struct common_audit_data { | |||
| 66 | char *key_desc; | 67 | char *key_desc; |
| 67 | } key_struct; | 68 | } key_struct; |
| 68 | #endif | 69 | #endif |
| 70 | char *kmod_name; | ||
| 69 | } u; | 71 | } u; |
| 70 | /* this union contains LSM specific data */ | 72 | /* this union contains LSM specific data */ |
| 71 | union { | 73 | union { |
diff --git a/include/linux/mISDNhw.h b/include/linux/mISDNhw.h index 7f9831da847f..4af841408fb5 100644 --- a/include/linux/mISDNhw.h +++ b/include/linux/mISDNhw.h | |||
| @@ -168,6 +168,7 @@ struct bchannel { | |||
| 168 | extern int mISDN_initdchannel(struct dchannel *, int, void *); | 168 | extern int mISDN_initdchannel(struct dchannel *, int, void *); |
| 169 | extern int mISDN_initbchannel(struct bchannel *, int); | 169 | extern int mISDN_initbchannel(struct bchannel *, int); |
| 170 | extern int mISDN_freedchannel(struct dchannel *); | 170 | extern int mISDN_freedchannel(struct dchannel *); |
| 171 | extern void mISDN_clear_bchannel(struct bchannel *); | ||
| 171 | extern int mISDN_freebchannel(struct bchannel *); | 172 | extern int mISDN_freebchannel(struct bchannel *); |
| 172 | extern void queue_ch_frame(struct mISDNchannel *, u_int, | 173 | extern void queue_ch_frame(struct mISDNchannel *, u_int, |
| 173 | int, struct sk_buff *); | 174 | int, struct sk_buff *); |
diff --git a/include/linux/mISDNif.h b/include/linux/mISDNif.h index 45100b39a7cf..78c3bed1c3f5 100644 --- a/include/linux/mISDNif.h +++ b/include/linux/mISDNif.h | |||
| @@ -37,7 +37,7 @@ | |||
| 37 | */ | 37 | */ |
| 38 | #define MISDN_MAJOR_VERSION 1 | 38 | #define MISDN_MAJOR_VERSION 1 |
| 39 | #define MISDN_MINOR_VERSION 1 | 39 | #define MISDN_MINOR_VERSION 1 |
| 40 | #define MISDN_RELEASE 20 | 40 | #define MISDN_RELEASE 21 |
| 41 | 41 | ||
| 42 | /* primitives for information exchange | 42 | /* primitives for information exchange |
| 43 | * generell format | 43 | * generell format |
| @@ -104,7 +104,7 @@ | |||
| 104 | #define DL_UNITDATA_IND 0x3108 | 104 | #define DL_UNITDATA_IND 0x3108 |
| 105 | #define DL_INFORMATION_IND 0x0008 | 105 | #define DL_INFORMATION_IND 0x0008 |
| 106 | 106 | ||
| 107 | /* intern layer 2 managment */ | 107 | /* intern layer 2 management */ |
| 108 | #define MDL_ASSIGN_REQ 0x1804 | 108 | #define MDL_ASSIGN_REQ 0x1804 |
| 109 | #define MDL_ASSIGN_IND 0x1904 | 109 | #define MDL_ASSIGN_IND 0x1904 |
| 110 | #define MDL_REMOVE_REQ 0x1A04 | 110 | #define MDL_REMOVE_REQ 0x1A04 |
| @@ -153,6 +153,18 @@ | |||
| 153 | #define HFC_VOL_CHANGE_RX 0x2602 | 153 | #define HFC_VOL_CHANGE_RX 0x2602 |
| 154 | #define HFC_SPL_LOOP_ON 0x2603 | 154 | #define HFC_SPL_LOOP_ON 0x2603 |
| 155 | #define HFC_SPL_LOOP_OFF 0x2604 | 155 | #define HFC_SPL_LOOP_OFF 0x2604 |
| 156 | /* for T30 FAX and analog modem */ | ||
| 157 | #define HW_MOD_FRM 0x4000 | ||
| 158 | #define HW_MOD_FRH 0x4001 | ||
| 159 | #define HW_MOD_FTM 0x4002 | ||
| 160 | #define HW_MOD_FTH 0x4003 | ||
| 161 | #define HW_MOD_FTS 0x4004 | ||
| 162 | #define HW_MOD_CONNECT 0x4010 | ||
| 163 | #define HW_MOD_OK 0x4011 | ||
| 164 | #define HW_MOD_NOCARR 0x4012 | ||
| 165 | #define HW_MOD_FCERROR 0x4013 | ||
| 166 | #define HW_MOD_READY 0x4014 | ||
| 167 | #define HW_MOD_LASTDATA 0x4015 | ||
| 156 | 168 | ||
| 157 | /* DSP_TONE_PATT_ON parameter */ | 169 | /* DSP_TONE_PATT_ON parameter */ |
| 158 | #define TONE_OFF 0x0000 | 170 | #define TONE_OFF 0x0000 |
| @@ -224,6 +236,8 @@ | |||
| 224 | #define ISDN_P_B_L2DTMF 0x24 | 236 | #define ISDN_P_B_L2DTMF 0x24 |
| 225 | #define ISDN_P_B_L2DSP 0x25 | 237 | #define ISDN_P_B_L2DSP 0x25 |
| 226 | #define ISDN_P_B_L2DSPHDLC 0x26 | 238 | #define ISDN_P_B_L2DSPHDLC 0x26 |
| 239 | #define ISDN_P_B_T30_FAX 0x27 | ||
| 240 | #define ISDN_P_B_MODEM_ASYNC 0x28 | ||
| 227 | 241 | ||
| 228 | #define OPTION_L2_PMX 1 | 242 | #define OPTION_L2_PMX 1 |
| 229 | #define OPTION_L2_PTP 2 | 243 | #define OPTION_L2_PTP 2 |
diff --git a/include/linux/magic.h b/include/linux/magic.h index 1923327b9869..76285e01b39e 100644 --- a/include/linux/magic.h +++ b/include/linux/magic.h | |||
| @@ -12,7 +12,9 @@ | |||
| 12 | #define SYSFS_MAGIC 0x62656572 | 12 | #define SYSFS_MAGIC 0x62656572 |
| 13 | #define SECURITYFS_MAGIC 0x73636673 | 13 | #define SECURITYFS_MAGIC 0x73636673 |
| 14 | #define SELINUX_MAGIC 0xf97cff8c | 14 | #define SELINUX_MAGIC 0xf97cff8c |
| 15 | #define RAMFS_MAGIC 0x858458f6 /* some random number */ | ||
| 15 | #define TMPFS_MAGIC 0x01021994 | 16 | #define TMPFS_MAGIC 0x01021994 |
| 17 | #define HUGETLBFS_MAGIC 0x958458f6 /* some random number */ | ||
| 16 | #define SQUASHFS_MAGIC 0x73717368 | 18 | #define SQUASHFS_MAGIC 0x73717368 |
| 17 | #define EFS_SUPER_MAGIC 0x414A53 | 19 | #define EFS_SUPER_MAGIC 0x414A53 |
| 18 | #define EXT2_SUPER_MAGIC 0xEF53 | 20 | #define EXT2_SUPER_MAGIC 0xEF53 |
| @@ -53,4 +55,8 @@ | |||
| 53 | #define INOTIFYFS_SUPER_MAGIC 0x2BAD1DEA | 55 | #define INOTIFYFS_SUPER_MAGIC 0x2BAD1DEA |
| 54 | 56 | ||
| 55 | #define STACK_END_MAGIC 0x57AC6E9D | 57 | #define STACK_END_MAGIC 0x57AC6E9D |
| 58 | |||
| 59 | #define DEVPTS_SUPER_MAGIC 0x1cd1 | ||
| 60 | #define SOCKFS_MAGIC 0x534F434B | ||
| 61 | |||
| 56 | #endif /* __LINUX_MAGIC_H__ */ | 62 | #endif /* __LINUX_MAGIC_H__ */ |
diff --git a/include/linux/marker.h b/include/linux/marker.h deleted file mode 100644 index b85e74ca782f..000000000000 --- a/include/linux/marker.h +++ /dev/null | |||
| @@ -1,221 +0,0 @@ | |||
| 1 | #ifndef _LINUX_MARKER_H | ||
| 2 | #define _LINUX_MARKER_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * Code markup for dynamic and static tracing. | ||
| 6 | * | ||
| 7 | * See Documentation/marker.txt. | ||
| 8 | * | ||
| 9 | * (C) Copyright 2006 Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> | ||
| 10 | * | ||
| 11 | * This file is released under the GPLv2. | ||
| 12 | * See the file COPYING for more details. | ||
| 13 | */ | ||
| 14 | |||
| 15 | #include <stdarg.h> | ||
| 16 | #include <linux/types.h> | ||
| 17 | |||
| 18 | struct module; | ||
| 19 | struct marker; | ||
| 20 | |||
| 21 | /** | ||
| 22 | * marker_probe_func - Type of a marker probe function | ||
| 23 | * @probe_private: probe private data | ||
| 24 | * @call_private: call site private data | ||
| 25 | * @fmt: format string | ||
| 26 | * @args: variable argument list pointer. Use a pointer to overcome C's | ||
| 27 | * inability to pass this around as a pointer in a portable manner in | ||
| 28 | * the callee otherwise. | ||
| 29 | * | ||
| 30 | * Type of marker probe functions. They receive the mdata and need to parse the | ||
| 31 | * format string to recover the variable argument list. | ||
| 32 | */ | ||
| 33 | typedef void marker_probe_func(void *probe_private, void *call_private, | ||
| 34 | const char *fmt, va_list *args); | ||
| 35 | |||
| 36 | struct marker_probe_closure { | ||
| 37 | marker_probe_func *func; /* Callback */ | ||
| 38 | void *probe_private; /* Private probe data */ | ||
| 39 | }; | ||
| 40 | |||
| 41 | struct marker { | ||
| 42 | const char *name; /* Marker name */ | ||
| 43 | const char *format; /* Marker format string, describing the | ||
| 44 | * variable argument list. | ||
| 45 | */ | ||
| 46 | char state; /* Marker state. */ | ||
| 47 | char ptype; /* probe type : 0 : single, 1 : multi */ | ||
| 48 | /* Probe wrapper */ | ||
| 49 | void (*call)(const struct marker *mdata, void *call_private, ...); | ||
| 50 | struct marker_probe_closure single; | ||
| 51 | struct marker_probe_closure *multi; | ||
| 52 | const char *tp_name; /* Optional tracepoint name */ | ||
| 53 | void *tp_cb; /* Optional tracepoint callback */ | ||
| 54 | } __attribute__((aligned(8))); | ||
| 55 | |||
| 56 | #ifdef CONFIG_MARKERS | ||
| 57 | |||
| 58 | #define _DEFINE_MARKER(name, tp_name_str, tp_cb, format) \ | ||
| 59 | static const char __mstrtab_##name[] \ | ||
| 60 | __attribute__((section("__markers_strings"))) \ | ||
| 61 | = #name "\0" format; \ | ||
| 62 | static struct marker __mark_##name \ | ||
| 63 | __attribute__((section("__markers"), aligned(8))) = \ | ||
| 64 | { __mstrtab_##name, &__mstrtab_##name[sizeof(#name)], \ | ||
| 65 | 0, 0, marker_probe_cb, { __mark_empty_function, NULL},\ | ||
| 66 | NULL, tp_name_str, tp_cb } | ||
| 67 | |||
| 68 | #define DEFINE_MARKER(name, format) \ | ||
| 69 | _DEFINE_MARKER(name, NULL, NULL, format) | ||
| 70 | |||
| 71 | #define DEFINE_MARKER_TP(name, tp_name, tp_cb, format) \ | ||
| 72 | _DEFINE_MARKER(name, #tp_name, tp_cb, format) | ||
| 73 | |||
| 74 | /* | ||
| 75 | * Note : the empty asm volatile with read constraint is used here instead of a | ||
| 76 | * "used" attribute to fix a gcc 4.1.x bug. | ||
| 77 | * Make sure the alignment of the structure in the __markers section will | ||
| 78 | * not add unwanted padding between the beginning of the section and the | ||
| 79 | * structure. Force alignment to the same alignment as the section start. | ||
| 80 | * | ||
| 81 | * The "generic" argument controls which marker enabling mechanism must be used. | ||
| 82 | * If generic is true, a variable read is used. | ||
| 83 | * If generic is false, immediate values are used. | ||
| 84 | */ | ||
| 85 | #define __trace_mark(generic, name, call_private, format, args...) \ | ||
| 86 | do { \ | ||
| 87 | DEFINE_MARKER(name, format); \ | ||
| 88 | __mark_check_format(format, ## args); \ | ||
| 89 | if (unlikely(__mark_##name.state)) { \ | ||
| 90 | (*__mark_##name.call) \ | ||
| 91 | (&__mark_##name, call_private, ## args);\ | ||
| 92 | } \ | ||
| 93 | } while (0) | ||
| 94 | |||
| 95 | #define __trace_mark_tp(name, call_private, tp_name, tp_cb, format, args...) \ | ||
| 96 | do { \ | ||
| 97 | void __check_tp_type(void) \ | ||
| 98 | { \ | ||
| 99 | register_trace_##tp_name(tp_cb); \ | ||
| 100 | } \ | ||
| 101 | DEFINE_MARKER_TP(name, tp_name, tp_cb, format); \ | ||
| 102 | __mark_check_format(format, ## args); \ | ||
| 103 | (*__mark_##name.call)(&__mark_##name, call_private, \ | ||
| 104 | ## args); \ | ||
| 105 | } while (0) | ||
| 106 | |||
| 107 | extern void marker_update_probe_range(struct marker *begin, | ||
| 108 | struct marker *end); | ||
| 109 | |||
| 110 | #define GET_MARKER(name) (__mark_##name) | ||
| 111 | |||
| 112 | #else /* !CONFIG_MARKERS */ | ||
| 113 | #define DEFINE_MARKER(name, tp_name, tp_cb, format) | ||
| 114 | #define __trace_mark(generic, name, call_private, format, args...) \ | ||
| 115 | __mark_check_format(format, ## args) | ||
| 116 | #define __trace_mark_tp(name, call_private, tp_name, tp_cb, format, args...) \ | ||
| 117 | do { \ | ||
| 118 | void __check_tp_type(void) \ | ||
| 119 | { \ | ||
| 120 | register_trace_##tp_name(tp_cb); \ | ||
| 121 | } \ | ||
| 122 | __mark_check_format(format, ## args); \ | ||
| 123 | } while (0) | ||
| 124 | static inline void marker_update_probe_range(struct marker *begin, | ||
| 125 | struct marker *end) | ||
| 126 | { } | ||
| 127 | #define GET_MARKER(name) | ||
| 128 | #endif /* CONFIG_MARKERS */ | ||
| 129 | |||
| 130 | /** | ||
| 131 | * trace_mark - Marker using code patching | ||
| 132 | * @name: marker name, not quoted. | ||
| 133 | * @format: format string | ||
| 134 | * @args...: variable argument list | ||
| 135 | * | ||
| 136 | * Places a marker using optimized code patching technique (imv_read()) | ||
| 137 | * to be enabled when immediate values are present. | ||
| 138 | */ | ||
| 139 | #define trace_mark(name, format, args...) \ | ||
| 140 | __trace_mark(0, name, NULL, format, ## args) | ||
| 141 | |||
| 142 | /** | ||
| 143 | * _trace_mark - Marker using variable read | ||
| 144 | * @name: marker name, not quoted. | ||
| 145 | * @format: format string | ||
| 146 | * @args...: variable argument list | ||
| 147 | * | ||
| 148 | * Places a marker using a standard memory read (_imv_read()) to be | ||
| 149 | * enabled. Should be used for markers in code paths where instruction | ||
| 150 | * modification based enabling is not welcome. (__init and __exit functions, | ||
| 151 | * lockdep, some traps, printk). | ||
| 152 | */ | ||
| 153 | #define _trace_mark(name, format, args...) \ | ||
| 154 | __trace_mark(1, name, NULL, format, ## args) | ||
| 155 | |||
| 156 | /** | ||
| 157 | * trace_mark_tp - Marker in a tracepoint callback | ||
| 158 | * @name: marker name, not quoted. | ||
| 159 | * @tp_name: tracepoint name, not quoted. | ||
| 160 | * @tp_cb: tracepoint callback. Should have an associated global symbol so it | ||
| 161 | * is not optimized away by the compiler (should not be static). | ||
| 162 | * @format: format string | ||
| 163 | * @args...: variable argument list | ||
| 164 | * | ||
| 165 | * Places a marker in a tracepoint callback. | ||
| 166 | */ | ||
| 167 | #define trace_mark_tp(name, tp_name, tp_cb, format, args...) \ | ||
| 168 | __trace_mark_tp(name, NULL, tp_name, tp_cb, format, ## args) | ||
| 169 | |||
| 170 | /** | ||
| 171 | * MARK_NOARGS - Format string for a marker with no argument. | ||
| 172 | */ | ||
| 173 | #define MARK_NOARGS " " | ||
| 174 | |||
| 175 | /* To be used for string format validity checking with gcc */ | ||
| 176 | static inline void __printf(1, 2) ___mark_check_format(const char *fmt, ...) | ||
| 177 | { | ||
| 178 | } | ||
| 179 | |||
| 180 | #define __mark_check_format(format, args...) \ | ||
| 181 | do { \ | ||
| 182 | if (0) \ | ||
| 183 | ___mark_check_format(format, ## args); \ | ||
| 184 | } while (0) | ||
| 185 | |||
| 186 | extern marker_probe_func __mark_empty_function; | ||
| 187 | |||
| 188 | extern void marker_probe_cb(const struct marker *mdata, | ||
| 189 | void *call_private, ...); | ||
| 190 | |||
| 191 | /* | ||
| 192 | * Connect a probe to a marker. | ||
| 193 | * private data pointer must be a valid allocated memory address, or NULL. | ||
| 194 | */ | ||
| 195 | extern int marker_probe_register(const char *name, const char *format, | ||
| 196 | marker_probe_func *probe, void *probe_private); | ||
| 197 | |||
| 198 | /* | ||
| 199 | * Returns the private data given to marker_probe_register. | ||
| 200 | */ | ||
| 201 | extern int marker_probe_unregister(const char *name, | ||
| 202 | marker_probe_func *probe, void *probe_private); | ||
| 203 | /* | ||
| 204 | * Unregister a marker by providing the registered private data. | ||
| 205 | */ | ||
| 206 | extern int marker_probe_unregister_private_data(marker_probe_func *probe, | ||
| 207 | void *probe_private); | ||
| 208 | |||
| 209 | extern void *marker_get_private_data(const char *name, marker_probe_func *probe, | ||
| 210 | int num); | ||
| 211 | |||
| 212 | /* | ||
| 213 | * marker_synchronize_unregister must be called between the last marker probe | ||
| 214 | * unregistration and the first one of | ||
| 215 | * - the end of module exit function | ||
| 216 | * - the free of any resource used by the probes | ||
| 217 | * to ensure the code and data are valid for any possibly running probes. | ||
| 218 | */ | ||
| 219 | #define marker_synchronize_unregister() synchronize_sched() | ||
| 220 | |||
| 221 | #endif | ||
diff --git a/include/linux/mdio.h b/include/linux/mdio.h index cfdf1df2875e..c779b49a1fda 100644 --- a/include/linux/mdio.h +++ b/include/linux/mdio.h | |||
| @@ -304,7 +304,7 @@ static inline __u16 mdio_phy_id_devad(int phy_id) | |||
| 304 | */ | 304 | */ |
| 305 | struct mdio_if_info { | 305 | struct mdio_if_info { |
| 306 | int prtad; | 306 | int prtad; |
| 307 | u32 __bitwise mmds; | 307 | u32 mmds; |
| 308 | unsigned mode_support; | 308 | unsigned mode_support; |
| 309 | 309 | ||
| 310 | struct net_device *dev; | 310 | struct net_device *dev; |
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index e46a0734ab6e..bf9213b2db8f 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
| @@ -118,6 +118,9 @@ static inline bool mem_cgroup_disabled(void) | |||
| 118 | 118 | ||
| 119 | extern bool mem_cgroup_oom_called(struct task_struct *task); | 119 | extern bool mem_cgroup_oom_called(struct task_struct *task); |
| 120 | void mem_cgroup_update_mapped_file_stat(struct page *page, int val); | 120 | void mem_cgroup_update_mapped_file_stat(struct page *page, int val); |
| 121 | unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order, | ||
| 122 | gfp_t gfp_mask, int nid, | ||
| 123 | int zid); | ||
| 121 | #else /* CONFIG_CGROUP_MEM_RES_CTLR */ | 124 | #else /* CONFIG_CGROUP_MEM_RES_CTLR */ |
| 122 | struct mem_cgroup; | 125 | struct mem_cgroup; |
| 123 | 126 | ||
| @@ -276,6 +279,13 @@ static inline void mem_cgroup_update_mapped_file_stat(struct page *page, | |||
| 276 | { | 279 | { |
| 277 | } | 280 | } |
| 278 | 281 | ||
| 282 | static inline | ||
| 283 | unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order, | ||
| 284 | gfp_t gfp_mask, int nid, int zid) | ||
| 285 | { | ||
| 286 | return 0; | ||
| 287 | } | ||
| 288 | |||
| 279 | #endif /* CONFIG_CGROUP_MEM_CONT */ | 289 | #endif /* CONFIG_CGROUP_MEM_CONT */ |
| 280 | 290 | ||
| 281 | #endif /* _LINUX_MEMCONTROL_H */ | 291 | #endif /* _LINUX_MEMCONTROL_H */ |
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h index d95f72e79b82..fed969281a41 100644 --- a/include/linux/memory_hotplug.h +++ b/include/linux/memory_hotplug.h | |||
| @@ -191,14 +191,6 @@ static inline void register_page_bootmem_info_node(struct pglist_data *pgdat) | |||
| 191 | 191 | ||
| 192 | #endif /* ! CONFIG_MEMORY_HOTPLUG */ | 192 | #endif /* ! CONFIG_MEMORY_HOTPLUG */ |
| 193 | 193 | ||
| 194 | /* | ||
| 195 | * Walk through all memory which is registered as resource. | ||
| 196 | * arg is (start_pfn, nr_pages, private_arg_pointer) | ||
| 197 | */ | ||
| 198 | extern int walk_memory_resource(unsigned long start_pfn, | ||
| 199 | unsigned long nr_pages, void *arg, | ||
| 200 | int (*func)(unsigned long, unsigned long, void *)); | ||
| 201 | |||
| 202 | #ifdef CONFIG_MEMORY_HOTREMOVE | 194 | #ifdef CONFIG_MEMORY_HOTREMOVE |
| 203 | 195 | ||
| 204 | extern int is_mem_section_removable(unsigned long pfn, unsigned long nr_pages); | 196 | extern int is_mem_section_removable(unsigned long pfn, unsigned long nr_pages); |
diff --git a/include/linux/mempool.h b/include/linux/mempool.h index 9be484d11283..7c08052e3321 100644 --- a/include/linux/mempool.h +++ b/include/linux/mempool.h | |||
| @@ -47,22 +47,16 @@ mempool_create_slab_pool(int min_nr, struct kmem_cache *kc) | |||
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | /* | 49 | /* |
| 50 | * 2 mempool_alloc_t's and a mempool_free_t to kmalloc/kzalloc and kfree | 50 | * a mempool_alloc_t and a mempool_free_t to kmalloc and kfree the |
| 51 | * the amount of memory specified by pool_data | 51 | * amount of memory specified by pool_data |
| 52 | */ | 52 | */ |
| 53 | void *mempool_kmalloc(gfp_t gfp_mask, void *pool_data); | 53 | void *mempool_kmalloc(gfp_t gfp_mask, void *pool_data); |
| 54 | void *mempool_kzalloc(gfp_t gfp_mask, void *pool_data); | ||
| 55 | void mempool_kfree(void *element, void *pool_data); | 54 | void mempool_kfree(void *element, void *pool_data); |
| 56 | static inline mempool_t *mempool_create_kmalloc_pool(int min_nr, size_t size) | 55 | static inline mempool_t *mempool_create_kmalloc_pool(int min_nr, size_t size) |
| 57 | { | 56 | { |
| 58 | return mempool_create(min_nr, mempool_kmalloc, mempool_kfree, | 57 | return mempool_create(min_nr, mempool_kmalloc, mempool_kfree, |
| 59 | (void *) size); | 58 | (void *) size); |
| 60 | } | 59 | } |
| 61 | static inline mempool_t *mempool_create_kzalloc_pool(int min_nr, size_t size) | ||
| 62 | { | ||
| 63 | return mempool_create(min_nr, mempool_kzalloc, mempool_kfree, | ||
| 64 | (void *) size); | ||
| 65 | } | ||
| 66 | 60 | ||
| 67 | /* | 61 | /* |
| 68 | * A mempool_alloc_t and mempool_free_t for a simple page allocator that | 62 | * A mempool_alloc_t and mempool_free_t for a simple page allocator that |
diff --git a/include/linux/mfd/ab3100.h b/include/linux/mfd/ab3100.h index 7a3f316e3848..e9aa4c9d749d 100644 --- a/include/linux/mfd/ab3100.h +++ b/include/linux/mfd/ab3100.h | |||
| @@ -6,6 +6,8 @@ | |||
| 6 | */ | 6 | */ |
| 7 | 7 | ||
| 8 | #include <linux/device.h> | 8 | #include <linux/device.h> |
| 9 | #include <linux/workqueue.h> | ||
| 10 | #include <linux/regulator/machine.h> | ||
| 9 | 11 | ||
| 10 | #ifndef MFD_AB3100_H | 12 | #ifndef MFD_AB3100_H |
| 11 | #define MFD_AB3100_H | 13 | #define MFD_AB3100_H |
| @@ -56,6 +58,14 @@ | |||
| 56 | #define AB3100_STR_BATT_REMOVAL (0x40) | 58 | #define AB3100_STR_BATT_REMOVAL (0x40) |
| 57 | #define AB3100_STR_VBUS (0x80) | 59 | #define AB3100_STR_VBUS (0x80) |
| 58 | 60 | ||
| 61 | /* | ||
| 62 | * AB3100 contains 8 regulators, one external regulator controller | ||
| 63 | * and a buck converter, further the LDO E and buck converter can | ||
| 64 | * have separate settings if they are in sleep mode, this is | ||
| 65 | * modeled as a separate regulator. | ||
| 66 | */ | ||
| 67 | #define AB3100_NUM_REGULATORS 10 | ||
| 68 | |||
| 59 | /** | 69 | /** |
| 60 | * struct ab3100 | 70 | * struct ab3100 |
| 61 | * @access_mutex: lock out concurrent accesses to the AB3100 registers | 71 | * @access_mutex: lock out concurrent accesses to the AB3100 registers |
| @@ -86,11 +96,30 @@ struct ab3100 { | |||
| 86 | bool startup_events_read; | 96 | bool startup_events_read; |
| 87 | }; | 97 | }; |
| 88 | 98 | ||
| 89 | int ab3100_set_register(struct ab3100 *ab3100, u8 reg, u8 regval); | 99 | /** |
| 90 | int ab3100_get_register(struct ab3100 *ab3100, u8 reg, u8 *regval); | 100 | * struct ab3100_platform_data |
| 91 | int ab3100_get_register_page(struct ab3100 *ab3100, | 101 | * Data supplied to initialize board connections to the AB3100 |
| 102 | * @reg_constraints: regulator constraints for target board | ||
| 103 | * the order of these constraints are: LDO A, C, D, E, | ||
| 104 | * F, G, H, K, EXT and BUCK. | ||
| 105 | * @reg_initvals: initial values for the regulator registers | ||
| 106 | * plus two sleep settings for LDO E and the BUCK converter. | ||
| 107 | * exactly AB3100_NUM_REGULATORS+2 values must be sent in. | ||
| 108 | * Order: LDO A, C, E, E sleep, F, G, H, K, EXT, BUCK, | ||
| 109 | * BUCK sleep, LDO D. (LDO D need to be initialized last.) | ||
| 110 | * @external_voltage: voltage level of the external regulator. | ||
| 111 | */ | ||
| 112 | struct ab3100_platform_data { | ||
| 113 | struct regulator_init_data reg_constraints[AB3100_NUM_REGULATORS]; | ||
| 114 | u8 reg_initvals[AB3100_NUM_REGULATORS+2]; | ||
| 115 | int external_voltage; | ||
| 116 | }; | ||
| 117 | |||
| 118 | int ab3100_set_register_interruptible(struct ab3100 *ab3100, u8 reg, u8 regval); | ||
| 119 | int ab3100_get_register_interruptible(struct ab3100 *ab3100, u8 reg, u8 *regval); | ||
| 120 | int ab3100_get_register_page_interruptible(struct ab3100 *ab3100, | ||
| 92 | u8 first_reg, u8 *regvals, u8 numregs); | 121 | u8 first_reg, u8 *regvals, u8 numregs); |
| 93 | int ab3100_mask_and_set_register(struct ab3100 *ab3100, | 122 | int ab3100_mask_and_set_register_interruptible(struct ab3100 *ab3100, |
| 94 | u8 reg, u8 andmask, u8 ormask); | 123 | u8 reg, u8 andmask, u8 ormask); |
| 95 | u8 ab3100_get_chip_type(struct ab3100 *ab3100); | 124 | u8 ab3100_get_chip_type(struct ab3100 *ab3100); |
| 96 | int ab3100_event_register(struct ab3100 *ab3100, | 125 | int ab3100_event_register(struct ab3100 *ab3100, |
diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h index 49ef857cdb2d..11d740b8831d 100644 --- a/include/linux/mfd/core.h +++ b/include/linux/mfd/core.h | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | */ | 23 | */ |
| 24 | struct mfd_cell { | 24 | struct mfd_cell { |
| 25 | const char *name; | 25 | const char *name; |
| 26 | int id; | ||
| 26 | 27 | ||
| 27 | int (*enable)(struct platform_device *dev); | 28 | int (*enable)(struct platform_device *dev); |
| 28 | int (*disable)(struct platform_device *dev); | 29 | int (*disable)(struct platform_device *dev); |
diff --git a/include/linux/mfd/da903x.h b/include/linux/mfd/da903x.h index 115dbe965082..c63b65c94429 100644 --- a/include/linux/mfd/da903x.h +++ b/include/linux/mfd/da903x.h | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | #ifndef __LINUX_PMIC_DA903X_H | 1 | #ifndef __LINUX_PMIC_DA903X_H |
| 2 | #define __LINUX_PMIC_DA903X_H | 2 | #define __LINUX_PMIC_DA903X_H |
| 3 | 3 | ||
| 4 | /* Unified sub device IDs for DA9030/DA9034 */ | 4 | /* Unified sub device IDs for DA9030/DA9034/DA9035 */ |
| 5 | enum { | 5 | enum { |
| 6 | DA9030_ID_LED_1, | 6 | DA9030_ID_LED_1, |
| 7 | DA9030_ID_LED_2, | 7 | DA9030_ID_LED_2, |
| @@ -57,6 +57,8 @@ enum { | |||
| 57 | DA9034_ID_LDO13, | 57 | DA9034_ID_LDO13, |
| 58 | DA9034_ID_LDO14, | 58 | DA9034_ID_LDO14, |
| 59 | DA9034_ID_LDO15, | 59 | DA9034_ID_LDO15, |
| 60 | |||
| 61 | DA9035_ID_BUCK3, | ||
| 60 | }; | 62 | }; |
| 61 | 63 | ||
| 62 | /* | 64 | /* |
diff --git a/include/linux/mfd/ezx-pcap.h b/include/linux/mfd/ezx-pcap.h index c12c3c0932bf..e5124ceea769 100644 --- a/include/linux/mfd/ezx-pcap.h +++ b/include/linux/mfd/ezx-pcap.h | |||
| @@ -25,9 +25,12 @@ struct pcap_chip; | |||
| 25 | 25 | ||
| 26 | int ezx_pcap_write(struct pcap_chip *, u8, u32); | 26 | int ezx_pcap_write(struct pcap_chip *, u8, u32); |
| 27 | int ezx_pcap_read(struct pcap_chip *, u8, u32 *); | 27 | int ezx_pcap_read(struct pcap_chip *, u8, u32 *); |
| 28 | int ezx_pcap_set_bits(struct pcap_chip *, u8, u32, u32); | ||
| 28 | int pcap_to_irq(struct pcap_chip *, int); | 29 | int pcap_to_irq(struct pcap_chip *, int); |
| 30 | int irq_to_pcap(struct pcap_chip *, int); | ||
| 29 | int pcap_adc_async(struct pcap_chip *, u8, u32, u8[], void *, void *); | 31 | int pcap_adc_async(struct pcap_chip *, u8, u32, u8[], void *, void *); |
| 30 | int pcap_adc_sync(struct pcap_chip *, u8, u32, u8[], u16[]); | 32 | int pcap_adc_sync(struct pcap_chip *, u8, u32, u8[], u16[]); |
| 33 | void pcap_set_ts_bits(struct pcap_chip *, u32); | ||
| 31 | 34 | ||
| 32 | #define PCAP_SECOND_PORT 1 | 35 | #define PCAP_SECOND_PORT 1 |
| 33 | #define PCAP_CS_AH 2 | 36 | #define PCAP_CS_AH 2 |
| @@ -224,7 +227,6 @@ int pcap_adc_sync(struct pcap_chip *, u8, u32, u8[], u16[]); | |||
| 224 | #define PCAP_LED1 1 | 227 | #define PCAP_LED1 1 |
| 225 | #define PCAP_BL0 2 | 228 | #define PCAP_BL0 2 |
| 226 | #define PCAP_BL1 3 | 229 | #define PCAP_BL1 3 |
| 227 | #define PCAP_VIB 4 | ||
| 228 | #define PCAP_LED_3MA 0 | 230 | #define PCAP_LED_3MA 0 |
| 229 | #define PCAP_LED_4MA 1 | 231 | #define PCAP_LED_4MA 1 |
| 230 | #define PCAP_LED_5MA 2 | 232 | #define PCAP_LED_5MA 2 |
| @@ -243,9 +245,6 @@ int pcap_adc_sync(struct pcap_chip *, u8, u32, u8[], u16[]); | |||
| 243 | #define PCAP_LED0_C_SHIFT 15 | 245 | #define PCAP_LED0_C_SHIFT 15 |
| 244 | #define PCAP_LED1_C_SHIFT 17 | 246 | #define PCAP_LED1_C_SHIFT 17 |
| 245 | #define PCAP_BL1_SHIFT 20 | 247 | #define PCAP_BL1_SHIFT 20 |
| 246 | #define PCAP_VIB_MASK 0x3 | ||
| 247 | #define PCAP_VIB_SHIFT 20 | ||
| 248 | #define PCAP_VIB_EN (1 << 19) | ||
| 249 | 248 | ||
| 250 | /* RTC */ | 249 | /* RTC */ |
| 251 | #define PCAP_RTC_DAY_MASK 0x3fff | 250 | #define PCAP_RTC_DAY_MASK 0x3fff |
diff --git a/include/linux/mfd/mc13783-private.h b/include/linux/mfd/mc13783-private.h new file mode 100644 index 000000000000..47e698cb0f16 --- /dev/null +++ b/include/linux/mfd/mc13783-private.h | |||
| @@ -0,0 +1,396 @@ | |||
| 1 | /* | ||
| 2 | * Copyright 2009 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de> | ||
| 3 | * | ||
| 4 | * Initial development of this code was funded by | ||
| 5 | * Phytec Messtechnik GmbH, http://www.phytec.de | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License as published by | ||
| 9 | * the Free Software Foundation; either version 2 of the License, or | ||
| 10 | * (at your option) any later version. | ||
| 11 | * | ||
| 12 | * This program is distributed in the hope that it will be useful, | ||
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | * GNU General Public License for more details. | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License | ||
| 18 | * along with this program; if not, write to the Free Software | ||
| 19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 20 | */ | ||
| 21 | |||
| 22 | #ifndef __LINUX_MFD_MC13783_PRIV_H | ||
| 23 | #define __LINUX_MFD_MC13783_PRIV_H | ||
| 24 | |||
| 25 | #include <linux/platform_device.h> | ||
| 26 | #include <linux/mfd/mc13783.h> | ||
| 27 | #include <linux/workqueue.h> | ||
| 28 | #include <linux/mutex.h> | ||
| 29 | |||
| 30 | struct mc13783_irq { | ||
| 31 | void (*handler)(int, void *); | ||
| 32 | void *data; | ||
| 33 | }; | ||
| 34 | |||
| 35 | #define MC13783_NUM_IRQ 2 | ||
| 36 | #define MC13783_IRQ_TS 0 | ||
| 37 | #define MC13783_IRQ_REGULATOR 1 | ||
| 38 | |||
| 39 | #define MC13783_ADC_MODE_TS 1 | ||
| 40 | #define MC13783_ADC_MODE_SINGLE_CHAN 2 | ||
| 41 | #define MC13783_ADC_MODE_MULT_CHAN 3 | ||
| 42 | |||
| 43 | struct mc13783 { | ||
| 44 | int revision; | ||
| 45 | struct device *dev; | ||
| 46 | struct spi_device *spi_device; | ||
| 47 | |||
| 48 | int (*read_dev)(void *data, char reg, int count, u32 *dst); | ||
| 49 | int (*write_dev)(void *data, char reg, int count, const u32 *src); | ||
| 50 | |||
| 51 | struct mutex io_lock; | ||
| 52 | void *io_data; | ||
| 53 | int irq; | ||
| 54 | unsigned int flags; | ||
| 55 | |||
| 56 | struct mc13783_irq irq_handler[MC13783_NUM_IRQ]; | ||
| 57 | struct work_struct work; | ||
| 58 | struct completion adc_done; | ||
| 59 | unsigned int ts_active; | ||
| 60 | struct mutex adc_conv_lock; | ||
| 61 | |||
| 62 | struct mc13783_regulator_init_data *regulators; | ||
| 63 | int num_regulators; | ||
| 64 | }; | ||
| 65 | |||
| 66 | int mc13783_reg_read(struct mc13783 *, int reg_num, u32 *); | ||
| 67 | int mc13783_reg_write(struct mc13783 *, int, u32); | ||
| 68 | int mc13783_set_bits(struct mc13783 *, int, u32, u32); | ||
| 69 | int mc13783_free_irq(struct mc13783 *mc13783, int irq); | ||
| 70 | int mc13783_register_irq(struct mc13783 *mc13783, int irq, | ||
| 71 | void (*handler) (int, void *), void *data); | ||
| 72 | |||
| 73 | #define MC13783_REG_INTERRUPT_STATUS_0 0 | ||
| 74 | #define MC13783_REG_INTERRUPT_MASK_0 1 | ||
| 75 | #define MC13783_REG_INTERRUPT_SENSE_0 2 | ||
| 76 | #define MC13783_REG_INTERRUPT_STATUS_1 3 | ||
| 77 | #define MC13783_REG_INTERRUPT_MASK_1 4 | ||
| 78 | #define MC13783_REG_INTERRUPT_SENSE_1 5 | ||
| 79 | #define MC13783_REG_POWER_UP_MODE_SENSE 6 | ||
| 80 | #define MC13783_REG_REVISION 7 | ||
| 81 | #define MC13783_REG_SEMAPHORE 8 | ||
| 82 | #define MC13783_REG_ARBITRATION_PERIPHERAL_AUDIO 9 | ||
| 83 | #define MC13783_REG_ARBITRATION_SWITCHERS 10 | ||
| 84 | #define MC13783_REG_ARBITRATION_REGULATORS_0 11 | ||
| 85 | #define MC13783_REG_ARBITRATION_REGULATORS_1 12 | ||
| 86 | #define MC13783_REG_POWER_CONTROL_0 13 | ||
| 87 | #define MC13783_REG_POWER_CONTROL_1 14 | ||
| 88 | #define MC13783_REG_POWER_CONTROL_2 15 | ||
| 89 | #define MC13783_REG_REGEN_ASSIGNMENT 16 | ||
| 90 | #define MC13783_REG_CONTROL_SPARE 17 | ||
| 91 | #define MC13783_REG_MEMORY_A 18 | ||
| 92 | #define MC13783_REG_MEMORY_B 19 | ||
| 93 | #define MC13783_REG_RTC_TIME 20 | ||
| 94 | #define MC13783_REG_RTC_ALARM 21 | ||
| 95 | #define MC13783_REG_RTC_DAY 22 | ||
| 96 | #define MC13783_REG_RTC_DAY_ALARM 23 | ||
| 97 | #define MC13783_REG_SWITCHERS_0 24 | ||
| 98 | #define MC13783_REG_SWITCHERS_1 25 | ||
| 99 | #define MC13783_REG_SWITCHERS_2 26 | ||
| 100 | #define MC13783_REG_SWITCHERS_3 27 | ||
| 101 | #define MC13783_REG_SWITCHERS_4 28 | ||
| 102 | #define MC13783_REG_SWITCHERS_5 29 | ||
| 103 | #define MC13783_REG_REGULATOR_SETTING_0 30 | ||
| 104 | #define MC13783_REG_REGULATOR_SETTING_1 31 | ||
| 105 | #define MC13783_REG_REGULATOR_MODE_0 32 | ||
| 106 | #define MC13783_REG_REGULATOR_MODE_1 33 | ||
| 107 | #define MC13783_REG_POWER_MISCELLANEOUS 34 | ||
| 108 | #define MC13783_REG_POWER_SPARE 35 | ||
| 109 | #define MC13783_REG_AUDIO_RX_0 36 | ||
| 110 | #define MC13783_REG_AUDIO_RX_1 37 | ||
| 111 | #define MC13783_REG_AUDIO_TX 38 | ||
| 112 | #define MC13783_REG_AUDIO_SSI_NETWORK 39 | ||
| 113 | #define MC13783_REG_AUDIO_CODEC 40 | ||
| 114 | #define MC13783_REG_AUDIO_STEREO_DAC 41 | ||
| 115 | #define MC13783_REG_AUDIO_SPARE 42 | ||
| 116 | #define MC13783_REG_ADC_0 43 | ||
| 117 | #define MC13783_REG_ADC_1 44 | ||
| 118 | #define MC13783_REG_ADC_2 45 | ||
| 119 | #define MC13783_REG_ADC_3 46 | ||
| 120 | #define MC13783_REG_ADC_4 47 | ||
| 121 | #define MC13783_REG_CHARGER 48 | ||
| 122 | #define MC13783_REG_USB 49 | ||
| 123 | #define MC13783_REG_CHARGE_USB_SPARE 50 | ||
| 124 | #define MC13783_REG_LED_CONTROL_0 51 | ||
| 125 | #define MC13783_REG_LED_CONTROL_1 52 | ||
| 126 | #define MC13783_REG_LED_CONTROL_2 53 | ||
| 127 | #define MC13783_REG_LED_CONTROL_3 54 | ||
| 128 | #define MC13783_REG_LED_CONTROL_4 55 | ||
| 129 | #define MC13783_REG_LED_CONTROL_5 56 | ||
| 130 | #define MC13783_REG_SPARE 57 | ||
| 131 | #define MC13783_REG_TRIM_0 58 | ||
| 132 | #define MC13783_REG_TRIM_1 59 | ||
| 133 | #define MC13783_REG_TEST_0 60 | ||
| 134 | #define MC13783_REG_TEST_1 61 | ||
| 135 | #define MC13783_REG_TEST_2 62 | ||
| 136 | #define MC13783_REG_TEST_3 63 | ||
| 137 | #define MC13783_REG_NB 64 | ||
| 138 | |||
| 139 | |||
| 140 | /* | ||
| 141 | * Interrupt Status | ||
| 142 | */ | ||
| 143 | #define MC13783_INT_STAT_ADCDONEI (1 << 0) | ||
| 144 | #define MC13783_INT_STAT_ADCBISDONEI (1 << 1) | ||
| 145 | #define MC13783_INT_STAT_TSI (1 << 2) | ||
| 146 | #define MC13783_INT_STAT_WHIGHI (1 << 3) | ||
| 147 | #define MC13783_INT_STAT_WLOWI (1 << 4) | ||
| 148 | #define MC13783_INT_STAT_CHGDETI (1 << 6) | ||
| 149 | #define MC13783_INT_STAT_CHGOVI (1 << 7) | ||
| 150 | #define MC13783_INT_STAT_CHGREVI (1 << 8) | ||
| 151 | #define MC13783_INT_STAT_CHGSHORTI (1 << 9) | ||
| 152 | #define MC13783_INT_STAT_CCCVI (1 << 10) | ||
| 153 | #define MC13783_INT_STAT_CHGCURRI (1 << 11) | ||
| 154 | #define MC13783_INT_STAT_BPONI (1 << 12) | ||
| 155 | #define MC13783_INT_STAT_LOBATLI (1 << 13) | ||
| 156 | #define MC13783_INT_STAT_LOBATHI (1 << 14) | ||
| 157 | #define MC13783_INT_STAT_UDPI (1 << 15) | ||
| 158 | #define MC13783_INT_STAT_USBI (1 << 16) | ||
| 159 | #define MC13783_INT_STAT_IDI (1 << 19) | ||
| 160 | #define MC13783_INT_STAT_Unused (1 << 20) | ||
| 161 | #define MC13783_INT_STAT_SE1I (1 << 21) | ||
| 162 | #define MC13783_INT_STAT_CKDETI (1 << 22) | ||
| 163 | #define MC13783_INT_STAT_UDMI (1 << 23) | ||
| 164 | |||
| 165 | /* | ||
| 166 | * Interrupt Mask | ||
| 167 | */ | ||
| 168 | #define MC13783_INT_MASK_ADCDONEM (1 << 0) | ||
| 169 | #define MC13783_INT_MASK_ADCBISDONEM (1 << 1) | ||
| 170 | #define MC13783_INT_MASK_TSM (1 << 2) | ||
| 171 | #define MC13783_INT_MASK_WHIGHM (1 << 3) | ||
| 172 | #define MC13783_INT_MASK_WLOWM (1 << 4) | ||
| 173 | #define MC13783_INT_MASK_CHGDETM (1 << 6) | ||
| 174 | #define MC13783_INT_MASK_CHGOVM (1 << 7) | ||
| 175 | #define MC13783_INT_MASK_CHGREVM (1 << 8) | ||
| 176 | #define MC13783_INT_MASK_CHGSHORTM (1 << 9) | ||
| 177 | #define MC13783_INT_MASK_CCCVM (1 << 10) | ||
| 178 | #define MC13783_INT_MASK_CHGCURRM (1 << 11) | ||
| 179 | #define MC13783_INT_MASK_BPONM (1 << 12) | ||
| 180 | #define MC13783_INT_MASK_LOBATLM (1 << 13) | ||
| 181 | #define MC13783_INT_MASK_LOBATHM (1 << 14) | ||
| 182 | #define MC13783_INT_MASK_UDPM (1 << 15) | ||
| 183 | #define MC13783_INT_MASK_USBM (1 << 16) | ||
| 184 | #define MC13783_INT_MASK_IDM (1 << 19) | ||
| 185 | #define MC13783_INT_MASK_SE1M (1 << 21) | ||
| 186 | #define MC13783_INT_MASK_CKDETM (1 << 22) | ||
| 187 | |||
| 188 | /* | ||
| 189 | * Reg Regulator Mode 0 | ||
| 190 | */ | ||
| 191 | #define MC13783_REGCTRL_VAUDIO_EN (1 << 0) | ||
| 192 | #define MC13783_REGCTRL_VAUDIO_STBY (1 << 1) | ||
| 193 | #define MC13783_REGCTRL_VAUDIO_MODE (1 << 2) | ||
| 194 | #define MC13783_REGCTRL_VIOHI_EN (1 << 3) | ||
| 195 | #define MC13783_REGCTRL_VIOHI_STBY (1 << 4) | ||
| 196 | #define MC13783_REGCTRL_VIOHI_MODE (1 << 5) | ||
| 197 | #define MC13783_REGCTRL_VIOLO_EN (1 << 6) | ||
| 198 | #define MC13783_REGCTRL_VIOLO_STBY (1 << 7) | ||
| 199 | #define MC13783_REGCTRL_VIOLO_MODE (1 << 8) | ||
| 200 | #define MC13783_REGCTRL_VDIG_EN (1 << 9) | ||
| 201 | #define MC13783_REGCTRL_VDIG_STBY (1 << 10) | ||
| 202 | #define MC13783_REGCTRL_VDIG_MODE (1 << 11) | ||
| 203 | #define MC13783_REGCTRL_VGEN_EN (1 << 12) | ||
| 204 | #define MC13783_REGCTRL_VGEN_STBY (1 << 13) | ||
| 205 | #define MC13783_REGCTRL_VGEN_MODE (1 << 14) | ||
| 206 | #define MC13783_REGCTRL_VRFDIG_EN (1 << 15) | ||
| 207 | #define MC13783_REGCTRL_VRFDIG_STBY (1 << 16) | ||
| 208 | #define MC13783_REGCTRL_VRFDIG_MODE (1 << 17) | ||
| 209 | #define MC13783_REGCTRL_VRFREF_EN (1 << 18) | ||
| 210 | #define MC13783_REGCTRL_VRFREF_STBY (1 << 19) | ||
| 211 | #define MC13783_REGCTRL_VRFREF_MODE (1 << 20) | ||
| 212 | #define MC13783_REGCTRL_VRFCP_EN (1 << 21) | ||
| 213 | #define MC13783_REGCTRL_VRFCP_STBY (1 << 22) | ||
| 214 | #define MC13783_REGCTRL_VRFCP_MODE (1 << 23) | ||
| 215 | |||
| 216 | /* | ||
| 217 | * Reg Regulator Mode 1 | ||
| 218 | */ | ||
| 219 | #define MC13783_REGCTRL_VSIM_EN (1 << 0) | ||
| 220 | #define MC13783_REGCTRL_VSIM_STBY (1 << 1) | ||
| 221 | #define MC13783_REGCTRL_VSIM_MODE (1 << 2) | ||
| 222 | #define MC13783_REGCTRL_VESIM_EN (1 << 3) | ||
| 223 | #define MC13783_REGCTRL_VESIM_STBY (1 << 4) | ||
| 224 | #define MC13783_REGCTRL_VESIM_MODE (1 << 5) | ||
| 225 | #define MC13783_REGCTRL_VCAM_EN (1 << 6) | ||
| 226 | #define MC13783_REGCTRL_VCAM_STBY (1 << 7) | ||
| 227 | #define MC13783_REGCTRL_VCAM_MODE (1 << 8) | ||
| 228 | #define MC13783_REGCTRL_VRFBG_EN (1 << 9) | ||
| 229 | #define MC13783_REGCTRL_VRFBG_STBY (1 << 10) | ||
| 230 | #define MC13783_REGCTRL_VVIB_EN (1 << 11) | ||
| 231 | #define MC13783_REGCTRL_VRF1_EN (1 << 12) | ||
| 232 | #define MC13783_REGCTRL_VRF1_STBY (1 << 13) | ||
| 233 | #define MC13783_REGCTRL_VRF1_MODE (1 << 14) | ||
| 234 | #define MC13783_REGCTRL_VRF2_EN (1 << 15) | ||
| 235 | #define MC13783_REGCTRL_VRF2_STBY (1 << 16) | ||
| 236 | #define MC13783_REGCTRL_VRF2_MODE (1 << 17) | ||
| 237 | #define MC13783_REGCTRL_VMMC1_EN (1 << 18) | ||
| 238 | #define MC13783_REGCTRL_VMMC1_STBY (1 << 19) | ||
| 239 | #define MC13783_REGCTRL_VMMC1_MODE (1 << 20) | ||
| 240 | #define MC13783_REGCTRL_VMMC2_EN (1 << 21) | ||
| 241 | #define MC13783_REGCTRL_VMMC2_STBY (1 << 22) | ||
| 242 | #define MC13783_REGCTRL_VMMC2_MODE (1 << 23) | ||
| 243 | |||
| 244 | /* | ||
| 245 | * Reg Regulator Misc. | ||
| 246 | */ | ||
| 247 | #define MC13783_REGCTRL_GPO1_EN (1 << 6) | ||
| 248 | #define MC13783_REGCTRL_GPO2_EN (1 << 8) | ||
| 249 | #define MC13783_REGCTRL_GPO3_EN (1 << 10) | ||
| 250 | #define MC13783_REGCTRL_GPO4_EN (1 << 12) | ||
| 251 | #define MC13783_REGCTRL_VIBPINCTRL (1 << 14) | ||
| 252 | |||
| 253 | /* | ||
| 254 | * Reg Switcher 4 | ||
| 255 | */ | ||
| 256 | #define MC13783_SWCTRL_SW1A_MODE (1 << 0) | ||
| 257 | #define MC13783_SWCTRL_SW1A_STBY_MODE (1 << 2) | ||
| 258 | #define MC13783_SWCTRL_SW1A_DVS_SPEED (1 << 6) | ||
| 259 | #define MC13783_SWCTRL_SW1A_PANIC_MODE (1 << 8) | ||
| 260 | #define MC13783_SWCTRL_SW1A_SOFTSTART (1 << 9) | ||
| 261 | #define MC13783_SWCTRL_SW1B_MODE (1 << 10) | ||
| 262 | #define MC13783_SWCTRL_SW1B_STBY_MODE (1 << 12) | ||
| 263 | #define MC13783_SWCTRL_SW1B_DVS_SPEED (1 << 14) | ||
| 264 | #define MC13783_SWCTRL_SW1B_PANIC_MODE (1 << 16) | ||
| 265 | #define MC13783_SWCTRL_SW1B_SOFTSTART (1 << 17) | ||
| 266 | #define MC13783_SWCTRL_PLL_EN (1 << 18) | ||
| 267 | #define MC13783_SWCTRL_PLL_FACTOR (1 << 19) | ||
| 268 | |||
| 269 | /* | ||
| 270 | * Reg Switcher 5 | ||
| 271 | */ | ||
| 272 | #define MC13783_SWCTRL_SW2A_MODE (1 << 0) | ||
| 273 | #define MC13783_SWCTRL_SW2A_STBY_MODE (1 << 2) | ||
| 274 | #define MC13783_SWCTRL_SW2A_DVS_SPEED (1 << 6) | ||
| 275 | #define MC13783_SWCTRL_SW2A_PANIC_MODE (1 << 8) | ||
| 276 | #define MC13783_SWCTRL_SW2A_SOFTSTART (1 << 9) | ||
| 277 | #define MC13783_SWCTRL_SW2B_MODE (1 << 10) | ||
| 278 | #define MC13783_SWCTRL_SW2B_STBY_MODE (1 << 12) | ||
| 279 | #define MC13783_SWCTRL_SW2B_DVS_SPEED (1 << 14) | ||
| 280 | #define MC13783_SWCTRL_SW2B_PANIC_MODE (1 << 16) | ||
| 281 | #define MC13783_SWCTRL_SW2B_SOFTSTART (1 << 17) | ||
| 282 | #define MC13783_SWSET_SW3 (1 << 18) | ||
| 283 | #define MC13783_SWCTRL_SW3_EN (1 << 20) | ||
| 284 | #define MC13783_SWCTRL_SW3_STBY (1 << 21) | ||
| 285 | #define MC13783_SWCTRL_SW3_MODE (1 << 22) | ||
| 286 | |||
| 287 | /* | ||
| 288 | * ADC/Touch | ||
| 289 | */ | ||
| 290 | #define MC13783_ADC0_LICELLCON (1 << 0) | ||
| 291 | #define MC13783_ADC0_CHRGICON (1 << 1) | ||
| 292 | #define MC13783_ADC0_BATICON (1 << 2) | ||
| 293 | #define MC13783_ADC0_RTHEN (1 << 3) | ||
| 294 | #define MC13783_ADC0_DTHEN (1 << 4) | ||
| 295 | #define MC13783_ADC0_UIDEN (1 << 5) | ||
| 296 | #define MC13783_ADC0_ADOUTEN (1 << 6) | ||
| 297 | #define MC13783_ADC0_ADOUTPER (1 << 7) | ||
| 298 | #define MC13783_ADC0_ADREFEN (1 << 10) | ||
| 299 | #define MC13783_ADC0_ADREFMODE (1 << 11) | ||
| 300 | #define MC13783_ADC0_TSMOD0 (1 << 12) | ||
| 301 | #define MC13783_ADC0_TSMOD1 (1 << 13) | ||
| 302 | #define MC13783_ADC0_TSMOD2 (1 << 14) | ||
| 303 | #define MC13783_ADC0_CHRGRAWDIV (1 << 15) | ||
| 304 | #define MC13783_ADC0_ADINC1 (1 << 16) | ||
| 305 | #define MC13783_ADC0_ADINC2 (1 << 17) | ||
| 306 | #define MC13783_ADC0_WCOMP (1 << 18) | ||
| 307 | #define MC13783_ADC0_ADCBIS0 (1 << 23) | ||
| 308 | |||
| 309 | #define MC13783_ADC1_ADEN (1 << 0) | ||
| 310 | #define MC13783_ADC1_RAND (1 << 1) | ||
| 311 | #define MC13783_ADC1_ADSEL (1 << 3) | ||
| 312 | #define MC13783_ADC1_TRIGMASK (1 << 4) | ||
| 313 | #define MC13783_ADC1_ADA10 (1 << 5) | ||
| 314 | #define MC13783_ADC1_ADA11 (1 << 6) | ||
| 315 | #define MC13783_ADC1_ADA12 (1 << 7) | ||
| 316 | #define MC13783_ADC1_ADA20 (1 << 8) | ||
| 317 | #define MC13783_ADC1_ADA21 (1 << 9) | ||
| 318 | #define MC13783_ADC1_ADA22 (1 << 10) | ||
| 319 | #define MC13783_ADC1_ATO0 (1 << 11) | ||
| 320 | #define MC13783_ADC1_ATO1 (1 << 12) | ||
| 321 | #define MC13783_ADC1_ATO2 (1 << 13) | ||
| 322 | #define MC13783_ADC1_ATO3 (1 << 14) | ||
| 323 | #define MC13783_ADC1_ATO4 (1 << 15) | ||
| 324 | #define MC13783_ADC1_ATO5 (1 << 16) | ||
| 325 | #define MC13783_ADC1_ATO6 (1 << 17) | ||
| 326 | #define MC13783_ADC1_ATO7 (1 << 18) | ||
| 327 | #define MC13783_ADC1_ATOX (1 << 19) | ||
| 328 | #define MC13783_ADC1_ASC (1 << 20) | ||
| 329 | #define MC13783_ADC1_ADTRIGIGN (1 << 21) | ||
| 330 | #define MC13783_ADC1_ADONESHOT (1 << 22) | ||
| 331 | #define MC13783_ADC1_ADCBIS1 (1 << 23) | ||
| 332 | |||
| 333 | #define MC13783_ADC1_CHAN0_SHIFT 5 | ||
| 334 | #define MC13783_ADC1_CHAN1_SHIFT 8 | ||
| 335 | |||
| 336 | #define MC13783_ADC2_ADD10 (1 << 2) | ||
| 337 | #define MC13783_ADC2_ADD11 (1 << 3) | ||
| 338 | #define MC13783_ADC2_ADD12 (1 << 4) | ||
| 339 | #define MC13783_ADC2_ADD13 (1 << 5) | ||
| 340 | #define MC13783_ADC2_ADD14 (1 << 6) | ||
| 341 | #define MC13783_ADC2_ADD15 (1 << 7) | ||
| 342 | #define MC13783_ADC2_ADD16 (1 << 8) | ||
| 343 | #define MC13783_ADC2_ADD17 (1 << 9) | ||
| 344 | #define MC13783_ADC2_ADD18 (1 << 10) | ||
| 345 | #define MC13783_ADC2_ADD19 (1 << 11) | ||
| 346 | #define MC13783_ADC2_ADD20 (1 << 14) | ||
| 347 | #define MC13783_ADC2_ADD21 (1 << 15) | ||
| 348 | #define MC13783_ADC2_ADD22 (1 << 16) | ||
| 349 | #define MC13783_ADC2_ADD23 (1 << 17) | ||
| 350 | #define MC13783_ADC2_ADD24 (1 << 18) | ||
| 351 | #define MC13783_ADC2_ADD25 (1 << 19) | ||
| 352 | #define MC13783_ADC2_ADD26 (1 << 20) | ||
| 353 | #define MC13783_ADC2_ADD27 (1 << 21) | ||
| 354 | #define MC13783_ADC2_ADD28 (1 << 22) | ||
| 355 | #define MC13783_ADC2_ADD29 (1 << 23) | ||
| 356 | |||
| 357 | #define MC13783_ADC3_WHIGH0 (1 << 0) | ||
| 358 | #define MC13783_ADC3_WHIGH1 (1 << 1) | ||
| 359 | #define MC13783_ADC3_WHIGH2 (1 << 2) | ||
| 360 | #define MC13783_ADC3_WHIGH3 (1 << 3) | ||
| 361 | #define MC13783_ADC3_WHIGH4 (1 << 4) | ||
| 362 | #define MC13783_ADC3_WHIGH5 (1 << 5) | ||
| 363 | #define MC13783_ADC3_ICID0 (1 << 6) | ||
| 364 | #define MC13783_ADC3_ICID1 (1 << 7) | ||
| 365 | #define MC13783_ADC3_ICID2 (1 << 8) | ||
| 366 | #define MC13783_ADC3_WLOW0 (1 << 9) | ||
| 367 | #define MC13783_ADC3_WLOW1 (1 << 10) | ||
| 368 | #define MC13783_ADC3_WLOW2 (1 << 11) | ||
| 369 | #define MC13783_ADC3_WLOW3 (1 << 12) | ||
| 370 | #define MC13783_ADC3_WLOW4 (1 << 13) | ||
| 371 | #define MC13783_ADC3_WLOW5 (1 << 14) | ||
| 372 | #define MC13783_ADC3_ADCBIS2 (1 << 23) | ||
| 373 | |||
| 374 | #define MC13783_ADC4_ADDBIS10 (1 << 2) | ||
| 375 | #define MC13783_ADC4_ADDBIS11 (1 << 3) | ||
| 376 | #define MC13783_ADC4_ADDBIS12 (1 << 4) | ||
| 377 | #define MC13783_ADC4_ADDBIS13 (1 << 5) | ||
| 378 | #define MC13783_ADC4_ADDBIS14 (1 << 6) | ||
| 379 | #define MC13783_ADC4_ADDBIS15 (1 << 7) | ||
| 380 | #define MC13783_ADC4_ADDBIS16 (1 << 8) | ||
| 381 | #define MC13783_ADC4_ADDBIS17 (1 << 9) | ||
| 382 | #define MC13783_ADC4_ADDBIS18 (1 << 10) | ||
| 383 | #define MC13783_ADC4_ADDBIS19 (1 << 11) | ||
| 384 | #define MC13783_ADC4_ADDBIS20 (1 << 14) | ||
| 385 | #define MC13783_ADC4_ADDBIS21 (1 << 15) | ||
| 386 | #define MC13783_ADC4_ADDBIS22 (1 << 16) | ||
| 387 | #define MC13783_ADC4_ADDBIS23 (1 << 17) | ||
| 388 | #define MC13783_ADC4_ADDBIS24 (1 << 18) | ||
| 389 | #define MC13783_ADC4_ADDBIS25 (1 << 19) | ||
| 390 | #define MC13783_ADC4_ADDBIS26 (1 << 20) | ||
| 391 | #define MC13783_ADC4_ADDBIS27 (1 << 21) | ||
| 392 | #define MC13783_ADC4_ADDBIS28 (1 << 22) | ||
| 393 | #define MC13783_ADC4_ADDBIS29 (1 << 23) | ||
| 394 | |||
| 395 | #endif /* __LINUX_MFD_MC13783_PRIV_H */ | ||
| 396 | |||
diff --git a/include/linux/mfd/mc13783.h b/include/linux/mfd/mc13783.h new file mode 100644 index 000000000000..b3a2a7243573 --- /dev/null +++ b/include/linux/mfd/mc13783.h | |||
| @@ -0,0 +1,84 @@ | |||
| 1 | /* | ||
| 2 | * Copyright 2009 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de> | ||
| 3 | * | ||
| 4 | * Initial development of this code was funded by | ||
| 5 | * Phytec Messtechnik GmbH, http://www.phytec.de | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License as published by | ||
| 9 | * the Free Software Foundation; either version 2 of the License, or | ||
| 10 | * (at your option) any later version. | ||
| 11 | * | ||
| 12 | * This program is distributed in the hope that it will be useful, | ||
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | * GNU General Public License for more details. | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License | ||
| 18 | * along with this program; if not, write to the Free Software | ||
| 19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 20 | */ | ||
| 21 | |||
| 22 | #ifndef __INCLUDE_LINUX_MFD_MC13783_H | ||
| 23 | #define __INCLUDE_LINUX_MFD_MC13783_H | ||
| 24 | |||
| 25 | struct mc13783; | ||
| 26 | struct regulator_init_data; | ||
| 27 | |||
| 28 | struct mc13783_regulator_init_data { | ||
| 29 | int id; | ||
| 30 | struct regulator_init_data *init_data; | ||
| 31 | }; | ||
| 32 | |||
| 33 | struct mc13783_platform_data { | ||
| 34 | struct mc13783_regulator_init_data *regulators; | ||
| 35 | int num_regulators; | ||
| 36 | unsigned int flags; | ||
| 37 | }; | ||
| 38 | |||
| 39 | /* mc13783_platform_data flags */ | ||
| 40 | #define MC13783_USE_TOUCHSCREEN (1 << 0) | ||
| 41 | #define MC13783_USE_CODEC (1 << 1) | ||
| 42 | #define MC13783_USE_ADC (1 << 2) | ||
| 43 | #define MC13783_USE_RTC (1 << 3) | ||
| 44 | #define MC13783_USE_REGULATOR (1 << 4) | ||
| 45 | |||
| 46 | int mc13783_adc_do_conversion(struct mc13783 *mc13783, unsigned int mode, | ||
| 47 | unsigned int channel, unsigned int *sample); | ||
| 48 | |||
| 49 | void mc13783_adc_set_ts_status(struct mc13783 *mc13783, unsigned int status); | ||
| 50 | |||
| 51 | #define MC13783_SW_SW1A 0 | ||
| 52 | #define MC13783_SW_SW1B 1 | ||
| 53 | #define MC13783_SW_SW2A 2 | ||
| 54 | #define MC13783_SW_SW2B 3 | ||
| 55 | #define MC13783_SW_SW3 4 | ||
| 56 | #define MC13783_SW_PLL 5 | ||
| 57 | #define MC13783_REGU_VAUDIO 6 | ||
| 58 | #define MC13783_REGU_VIOHI 7 | ||
| 59 | #define MC13783_REGU_VIOLO 8 | ||
| 60 | #define MC13783_REGU_VDIG 9 | ||
| 61 | #define MC13783_REGU_VGEN 10 | ||
| 62 | #define MC13783_REGU_VRFDIG 11 | ||
| 63 | #define MC13783_REGU_VRFREF 12 | ||
| 64 | #define MC13783_REGU_VRFCP 13 | ||
| 65 | #define MC13783_REGU_VSIM 14 | ||
| 66 | #define MC13783_REGU_VESIM 15 | ||
| 67 | #define MC13783_REGU_VCAM 16 | ||
| 68 | #define MC13783_REGU_VRFBG 17 | ||
| 69 | #define MC13783_REGU_VVIB 18 | ||
| 70 | #define MC13783_REGU_VRF1 19 | ||
| 71 | #define MC13783_REGU_VRF2 20 | ||
| 72 | #define MC13783_REGU_VMMC1 21 | ||
| 73 | #define MC13783_REGU_VMMC2 22 | ||
| 74 | #define MC13783_REGU_GPO1 23 | ||
| 75 | #define MC13783_REGU_GPO2 24 | ||
| 76 | #define MC13783_REGU_GPO3 25 | ||
| 77 | #define MC13783_REGU_GPO4 26 | ||
| 78 | #define MC13783_REGU_V1 27 | ||
| 79 | #define MC13783_REGU_V2 28 | ||
| 80 | #define MC13783_REGU_V3 29 | ||
| 81 | #define MC13783_REGU_V4 30 | ||
| 82 | |||
| 83 | #endif /* __INCLUDE_LINUX_MFD_MC13783_H */ | ||
| 84 | |||
diff --git a/include/linux/mfd/pcf50633/adc.h b/include/linux/mfd/pcf50633/adc.h index 56669b4183ad..b35e62801ffa 100644 --- a/include/linux/mfd/pcf50633/adc.h +++ b/include/linux/mfd/pcf50633/adc.h | |||
| @@ -25,7 +25,8 @@ | |||
| 25 | #define PCF50633_REG_ADCS3 0x57 | 25 | #define PCF50633_REG_ADCS3 0x57 |
| 26 | 26 | ||
| 27 | #define PCF50633_ADCC1_ADCSTART 0x01 | 27 | #define PCF50633_ADCC1_ADCSTART 0x01 |
| 28 | #define PCF50633_ADCC1_RES_10BIT 0x02 | 28 | #define PCF50633_ADCC1_RES_8BIT 0x02 |
| 29 | #define PCF50633_ADCC1_RES_10BIT 0x00 | ||
| 29 | #define PCF50633_ADCC1_AVERAGE_NO 0x00 | 30 | #define PCF50633_ADCC1_AVERAGE_NO 0x00 |
| 30 | #define PCF50633_ADCC1_AVERAGE_4 0x04 | 31 | #define PCF50633_ADCC1_AVERAGE_4 0x04 |
| 31 | #define PCF50633_ADCC1_AVERAGE_8 0x08 | 32 | #define PCF50633_ADCC1_AVERAGE_8 0x08 |
diff --git a/include/linux/mfd/pcf50633/core.h b/include/linux/mfd/pcf50633/core.h index c8f51c3c0a72..9aba7b779fbc 100644 --- a/include/linux/mfd/pcf50633/core.h +++ b/include/linux/mfd/pcf50633/core.h | |||
| @@ -136,6 +136,7 @@ struct pcf50633 { | |||
| 136 | int irq; | 136 | int irq; |
| 137 | struct pcf50633_irq irq_handler[PCF50633_NUM_IRQ]; | 137 | struct pcf50633_irq irq_handler[PCF50633_NUM_IRQ]; |
| 138 | struct work_struct irq_work; | 138 | struct work_struct irq_work; |
| 139 | struct workqueue_struct *work_queue; | ||
| 139 | struct mutex lock; | 140 | struct mutex lock; |
| 140 | 141 | ||
| 141 | u8 mask_regs[5]; | 142 | u8 mask_regs[5]; |
diff --git a/include/linux/mfd/wm831x/auxadc.h b/include/linux/mfd/wm831x/auxadc.h new file mode 100644 index 000000000000..b132067e9e99 --- /dev/null +++ b/include/linux/mfd/wm831x/auxadc.h | |||
| @@ -0,0 +1,216 @@ | |||
| 1 | /* | ||
| 2 | * include/linux/mfd/wm831x/auxadc.h -- Auxiliary ADC interface for WM831x | ||
| 3 | * | ||
| 4 | * Copyright 2009 Wolfson Microelectronics PLC. | ||
| 5 | * | ||
| 6 | * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify it | ||
| 9 | * under the terms of the GNU General Public License as published by the | ||
| 10 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 11 | * option) any later version. | ||
| 12 | * | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef __MFD_WM831X_AUXADC_H__ | ||
| 16 | #define __MFD_WM831X_AUXADC_H__ | ||
| 17 | |||
| 18 | /* | ||
| 19 | * R16429 (0x402D) - AuxADC Data | ||
| 20 | */ | ||
| 21 | #define WM831X_AUX_DATA_SRC_MASK 0xF000 /* AUX_DATA_SRC - [15:12] */ | ||
| 22 | #define WM831X_AUX_DATA_SRC_SHIFT 12 /* AUX_DATA_SRC - [15:12] */ | ||
| 23 | #define WM831X_AUX_DATA_SRC_WIDTH 4 /* AUX_DATA_SRC - [15:12] */ | ||
| 24 | #define WM831X_AUX_DATA_MASK 0x0FFF /* AUX_DATA - [11:0] */ | ||
| 25 | #define WM831X_AUX_DATA_SHIFT 0 /* AUX_DATA - [11:0] */ | ||
| 26 | #define WM831X_AUX_DATA_WIDTH 12 /* AUX_DATA - [11:0] */ | ||
| 27 | |||
| 28 | /* | ||
| 29 | * R16430 (0x402E) - AuxADC Control | ||
| 30 | */ | ||
| 31 | #define WM831X_AUX_ENA 0x8000 /* AUX_ENA */ | ||
| 32 | #define WM831X_AUX_ENA_MASK 0x8000 /* AUX_ENA */ | ||
| 33 | #define WM831X_AUX_ENA_SHIFT 15 /* AUX_ENA */ | ||
| 34 | #define WM831X_AUX_ENA_WIDTH 1 /* AUX_ENA */ | ||
| 35 | #define WM831X_AUX_CVT_ENA 0x4000 /* AUX_CVT_ENA */ | ||
| 36 | #define WM831X_AUX_CVT_ENA_MASK 0x4000 /* AUX_CVT_ENA */ | ||
| 37 | #define WM831X_AUX_CVT_ENA_SHIFT 14 /* AUX_CVT_ENA */ | ||
| 38 | #define WM831X_AUX_CVT_ENA_WIDTH 1 /* AUX_CVT_ENA */ | ||
| 39 | #define WM831X_AUX_SLPENA 0x1000 /* AUX_SLPENA */ | ||
| 40 | #define WM831X_AUX_SLPENA_MASK 0x1000 /* AUX_SLPENA */ | ||
| 41 | #define WM831X_AUX_SLPENA_SHIFT 12 /* AUX_SLPENA */ | ||
| 42 | #define WM831X_AUX_SLPENA_WIDTH 1 /* AUX_SLPENA */ | ||
| 43 | #define WM831X_AUX_FRC_ENA 0x0800 /* AUX_FRC_ENA */ | ||
| 44 | #define WM831X_AUX_FRC_ENA_MASK 0x0800 /* AUX_FRC_ENA */ | ||
| 45 | #define WM831X_AUX_FRC_ENA_SHIFT 11 /* AUX_FRC_ENA */ | ||
| 46 | #define WM831X_AUX_FRC_ENA_WIDTH 1 /* AUX_FRC_ENA */ | ||
| 47 | #define WM831X_AUX_RATE_MASK 0x003F /* AUX_RATE - [5:0] */ | ||
| 48 | #define WM831X_AUX_RATE_SHIFT 0 /* AUX_RATE - [5:0] */ | ||
| 49 | #define WM831X_AUX_RATE_WIDTH 6 /* AUX_RATE - [5:0] */ | ||
| 50 | |||
| 51 | /* | ||
| 52 | * R16431 (0x402F) - AuxADC Source | ||
| 53 | */ | ||
| 54 | #define WM831X_AUX_CAL_SEL 0x8000 /* AUX_CAL_SEL */ | ||
| 55 | #define WM831X_AUX_CAL_SEL_MASK 0x8000 /* AUX_CAL_SEL */ | ||
| 56 | #define WM831X_AUX_CAL_SEL_SHIFT 15 /* AUX_CAL_SEL */ | ||
| 57 | #define WM831X_AUX_CAL_SEL_WIDTH 1 /* AUX_CAL_SEL */ | ||
| 58 | #define WM831X_AUX_BKUP_BATT_SEL 0x0400 /* AUX_BKUP_BATT_SEL */ | ||
| 59 | #define WM831X_AUX_BKUP_BATT_SEL_MASK 0x0400 /* AUX_BKUP_BATT_SEL */ | ||
| 60 | #define WM831X_AUX_BKUP_BATT_SEL_SHIFT 10 /* AUX_BKUP_BATT_SEL */ | ||
| 61 | #define WM831X_AUX_BKUP_BATT_SEL_WIDTH 1 /* AUX_BKUP_BATT_SEL */ | ||
| 62 | #define WM831X_AUX_WALL_SEL 0x0200 /* AUX_WALL_SEL */ | ||
| 63 | #define WM831X_AUX_WALL_SEL_MASK 0x0200 /* AUX_WALL_SEL */ | ||
| 64 | #define WM831X_AUX_WALL_SEL_SHIFT 9 /* AUX_WALL_SEL */ | ||
| 65 | #define WM831X_AUX_WALL_SEL_WIDTH 1 /* AUX_WALL_SEL */ | ||
| 66 | #define WM831X_AUX_BATT_SEL 0x0100 /* AUX_BATT_SEL */ | ||
| 67 | #define WM831X_AUX_BATT_SEL_MASK 0x0100 /* AUX_BATT_SEL */ | ||
| 68 | #define WM831X_AUX_BATT_SEL_SHIFT 8 /* AUX_BATT_SEL */ | ||
| 69 | #define WM831X_AUX_BATT_SEL_WIDTH 1 /* AUX_BATT_SEL */ | ||
| 70 | #define WM831X_AUX_USB_SEL 0x0080 /* AUX_USB_SEL */ | ||
| 71 | #define WM831X_AUX_USB_SEL_MASK 0x0080 /* AUX_USB_SEL */ | ||
| 72 | #define WM831X_AUX_USB_SEL_SHIFT 7 /* AUX_USB_SEL */ | ||
| 73 | #define WM831X_AUX_USB_SEL_WIDTH 1 /* AUX_USB_SEL */ | ||
| 74 | #define WM831X_AUX_SYSVDD_SEL 0x0040 /* AUX_SYSVDD_SEL */ | ||
| 75 | #define WM831X_AUX_SYSVDD_SEL_MASK 0x0040 /* AUX_SYSVDD_SEL */ | ||
| 76 | #define WM831X_AUX_SYSVDD_SEL_SHIFT 6 /* AUX_SYSVDD_SEL */ | ||
| 77 | #define WM831X_AUX_SYSVDD_SEL_WIDTH 1 /* AUX_SYSVDD_SEL */ | ||
| 78 | #define WM831X_AUX_BATT_TEMP_SEL 0x0020 /* AUX_BATT_TEMP_SEL */ | ||
| 79 | #define WM831X_AUX_BATT_TEMP_SEL_MASK 0x0020 /* AUX_BATT_TEMP_SEL */ | ||
| 80 | #define WM831X_AUX_BATT_TEMP_SEL_SHIFT 5 /* AUX_BATT_TEMP_SEL */ | ||
| 81 | #define WM831X_AUX_BATT_TEMP_SEL_WIDTH 1 /* AUX_BATT_TEMP_SEL */ | ||
| 82 | #define WM831X_AUX_CHIP_TEMP_SEL 0x0010 /* AUX_CHIP_TEMP_SEL */ | ||
| 83 | #define WM831X_AUX_CHIP_TEMP_SEL_MASK 0x0010 /* AUX_CHIP_TEMP_SEL */ | ||
| 84 | #define WM831X_AUX_CHIP_TEMP_SEL_SHIFT 4 /* AUX_CHIP_TEMP_SEL */ | ||
| 85 | #define WM831X_AUX_CHIP_TEMP_SEL_WIDTH 1 /* AUX_CHIP_TEMP_SEL */ | ||
| 86 | #define WM831X_AUX_AUX4_SEL 0x0008 /* AUX_AUX4_SEL */ | ||
| 87 | #define WM831X_AUX_AUX4_SEL_MASK 0x0008 /* AUX_AUX4_SEL */ | ||
| 88 | #define WM831X_AUX_AUX4_SEL_SHIFT 3 /* AUX_AUX4_SEL */ | ||
| 89 | #define WM831X_AUX_AUX4_SEL_WIDTH 1 /* AUX_AUX4_SEL */ | ||
| 90 | #define WM831X_AUX_AUX3_SEL 0x0004 /* AUX_AUX3_SEL */ | ||
| 91 | #define WM831X_AUX_AUX3_SEL_MASK 0x0004 /* AUX_AUX3_SEL */ | ||
| 92 | #define WM831X_AUX_AUX3_SEL_SHIFT 2 /* AUX_AUX3_SEL */ | ||
| 93 | #define WM831X_AUX_AUX3_SEL_WIDTH 1 /* AUX_AUX3_SEL */ | ||
| 94 | #define WM831X_AUX_AUX2_SEL 0x0002 /* AUX_AUX2_SEL */ | ||
| 95 | #define WM831X_AUX_AUX2_SEL_MASK 0x0002 /* AUX_AUX2_SEL */ | ||
| 96 | #define WM831X_AUX_AUX2_SEL_SHIFT 1 /* AUX_AUX2_SEL */ | ||
| 97 | #define WM831X_AUX_AUX2_SEL_WIDTH 1 /* AUX_AUX2_SEL */ | ||
| 98 | #define WM831X_AUX_AUX1_SEL 0x0001 /* AUX_AUX1_SEL */ | ||
| 99 | #define WM831X_AUX_AUX1_SEL_MASK 0x0001 /* AUX_AUX1_SEL */ | ||
| 100 | #define WM831X_AUX_AUX1_SEL_SHIFT 0 /* AUX_AUX1_SEL */ | ||
| 101 | #define WM831X_AUX_AUX1_SEL_WIDTH 1 /* AUX_AUX1_SEL */ | ||
| 102 | |||
| 103 | /* | ||
| 104 | * R16432 (0x4030) - Comparator Control | ||
| 105 | */ | ||
| 106 | #define WM831X_DCOMP4_STS 0x0800 /* DCOMP4_STS */ | ||
| 107 | #define WM831X_DCOMP4_STS_MASK 0x0800 /* DCOMP4_STS */ | ||
| 108 | #define WM831X_DCOMP4_STS_SHIFT 11 /* DCOMP4_STS */ | ||
| 109 | #define WM831X_DCOMP4_STS_WIDTH 1 /* DCOMP4_STS */ | ||
| 110 | #define WM831X_DCOMP3_STS 0x0400 /* DCOMP3_STS */ | ||
| 111 | #define WM831X_DCOMP3_STS_MASK 0x0400 /* DCOMP3_STS */ | ||
| 112 | #define WM831X_DCOMP3_STS_SHIFT 10 /* DCOMP3_STS */ | ||
| 113 | #define WM831X_DCOMP3_STS_WIDTH 1 /* DCOMP3_STS */ | ||
| 114 | #define WM831X_DCOMP2_STS 0x0200 /* DCOMP2_STS */ | ||
| 115 | #define WM831X_DCOMP2_STS_MASK 0x0200 /* DCOMP2_STS */ | ||
| 116 | #define WM831X_DCOMP2_STS_SHIFT 9 /* DCOMP2_STS */ | ||
| 117 | #define WM831X_DCOMP2_STS_WIDTH 1 /* DCOMP2_STS */ | ||
| 118 | #define WM831X_DCOMP1_STS 0x0100 /* DCOMP1_STS */ | ||
| 119 | #define WM831X_DCOMP1_STS_MASK 0x0100 /* DCOMP1_STS */ | ||
| 120 | #define WM831X_DCOMP1_STS_SHIFT 8 /* DCOMP1_STS */ | ||
| 121 | #define WM831X_DCOMP1_STS_WIDTH 1 /* DCOMP1_STS */ | ||
| 122 | #define WM831X_DCMP4_ENA 0x0008 /* DCMP4_ENA */ | ||
| 123 | #define WM831X_DCMP4_ENA_MASK 0x0008 /* DCMP4_ENA */ | ||
| 124 | #define WM831X_DCMP4_ENA_SHIFT 3 /* DCMP4_ENA */ | ||
| 125 | #define WM831X_DCMP4_ENA_WIDTH 1 /* DCMP4_ENA */ | ||
| 126 | #define WM831X_DCMP3_ENA 0x0004 /* DCMP3_ENA */ | ||
| 127 | #define WM831X_DCMP3_ENA_MASK 0x0004 /* DCMP3_ENA */ | ||
| 128 | #define WM831X_DCMP3_ENA_SHIFT 2 /* DCMP3_ENA */ | ||
| 129 | #define WM831X_DCMP3_ENA_WIDTH 1 /* DCMP3_ENA */ | ||
| 130 | #define WM831X_DCMP2_ENA 0x0002 /* DCMP2_ENA */ | ||
| 131 | #define WM831X_DCMP2_ENA_MASK 0x0002 /* DCMP2_ENA */ | ||
| 132 | #define WM831X_DCMP2_ENA_SHIFT 1 /* DCMP2_ENA */ | ||
| 133 | #define WM831X_DCMP2_ENA_WIDTH 1 /* DCMP2_ENA */ | ||
| 134 | #define WM831X_DCMP1_ENA 0x0001 /* DCMP1_ENA */ | ||
| 135 | #define WM831X_DCMP1_ENA_MASK 0x0001 /* DCMP1_ENA */ | ||
| 136 | #define WM831X_DCMP1_ENA_SHIFT 0 /* DCMP1_ENA */ | ||
| 137 | #define WM831X_DCMP1_ENA_WIDTH 1 /* DCMP1_ENA */ | ||
| 138 | |||
| 139 | /* | ||
| 140 | * R16433 (0x4031) - Comparator 1 | ||
| 141 | */ | ||
| 142 | #define WM831X_DCMP1_SRC_MASK 0xE000 /* DCMP1_SRC - [15:13] */ | ||
| 143 | #define WM831X_DCMP1_SRC_SHIFT 13 /* DCMP1_SRC - [15:13] */ | ||
| 144 | #define WM831X_DCMP1_SRC_WIDTH 3 /* DCMP1_SRC - [15:13] */ | ||
| 145 | #define WM831X_DCMP1_GT 0x1000 /* DCMP1_GT */ | ||
| 146 | #define WM831X_DCMP1_GT_MASK 0x1000 /* DCMP1_GT */ | ||
| 147 | #define WM831X_DCMP1_GT_SHIFT 12 /* DCMP1_GT */ | ||
| 148 | #define WM831X_DCMP1_GT_WIDTH 1 /* DCMP1_GT */ | ||
| 149 | #define WM831X_DCMP1_THR_MASK 0x0FFF /* DCMP1_THR - [11:0] */ | ||
| 150 | #define WM831X_DCMP1_THR_SHIFT 0 /* DCMP1_THR - [11:0] */ | ||
| 151 | #define WM831X_DCMP1_THR_WIDTH 12 /* DCMP1_THR - [11:0] */ | ||
| 152 | |||
| 153 | /* | ||
| 154 | * R16434 (0x4032) - Comparator 2 | ||
| 155 | */ | ||
| 156 | #define WM831X_DCMP2_SRC_MASK 0xE000 /* DCMP2_SRC - [15:13] */ | ||
| 157 | #define WM831X_DCMP2_SRC_SHIFT 13 /* DCMP2_SRC - [15:13] */ | ||
| 158 | #define WM831X_DCMP2_SRC_WIDTH 3 /* DCMP2_SRC - [15:13] */ | ||
| 159 | #define WM831X_DCMP2_GT 0x1000 /* DCMP2_GT */ | ||
| 160 | #define WM831X_DCMP2_GT_MASK 0x1000 /* DCMP2_GT */ | ||
| 161 | #define WM831X_DCMP2_GT_SHIFT 12 /* DCMP2_GT */ | ||
| 162 | #define WM831X_DCMP2_GT_WIDTH 1 /* DCMP2_GT */ | ||
| 163 | #define WM831X_DCMP2_THR_MASK 0x0FFF /* DCMP2_THR - [11:0] */ | ||
| 164 | #define WM831X_DCMP2_THR_SHIFT 0 /* DCMP2_THR - [11:0] */ | ||
| 165 | #define WM831X_DCMP2_THR_WIDTH 12 /* DCMP2_THR - [11:0] */ | ||
| 166 | |||
| 167 | /* | ||
| 168 | * R16435 (0x4033) - Comparator 3 | ||
| 169 | */ | ||
| 170 | #define WM831X_DCMP3_SRC_MASK 0xE000 /* DCMP3_SRC - [15:13] */ | ||
| 171 | #define WM831X_DCMP3_SRC_SHIFT 13 /* DCMP3_SRC - [15:13] */ | ||
| 172 | #define WM831X_DCMP3_SRC_WIDTH 3 /* DCMP3_SRC - [15:13] */ | ||
| 173 | #define WM831X_DCMP3_GT 0x1000 /* DCMP3_GT */ | ||
| 174 | #define WM831X_DCMP3_GT_MASK 0x1000 /* DCMP3_GT */ | ||
| 175 | #define WM831X_DCMP3_GT_SHIFT 12 /* DCMP3_GT */ | ||
| 176 | #define WM831X_DCMP3_GT_WIDTH 1 /* DCMP3_GT */ | ||
| 177 | #define WM831X_DCMP3_THR_MASK 0x0FFF /* DCMP3_THR - [11:0] */ | ||
| 178 | #define WM831X_DCMP3_THR_SHIFT 0 /* DCMP3_THR - [11:0] */ | ||
| 179 | #define WM831X_DCMP3_THR_WIDTH 12 /* DCMP3_THR - [11:0] */ | ||
| 180 | |||
| 181 | /* | ||
| 182 | * R16436 (0x4034) - Comparator 4 | ||
| 183 | */ | ||
| 184 | #define WM831X_DCMP4_SRC_MASK 0xE000 /* DCMP4_SRC - [15:13] */ | ||
| 185 | #define WM831X_DCMP4_SRC_SHIFT 13 /* DCMP4_SRC - [15:13] */ | ||
| 186 | #define WM831X_DCMP4_SRC_WIDTH 3 /* DCMP4_SRC - [15:13] */ | ||
| 187 | #define WM831X_DCMP4_GT 0x1000 /* DCMP4_GT */ | ||
| 188 | #define WM831X_DCMP4_GT_MASK 0x1000 /* DCMP4_GT */ | ||
| 189 | #define WM831X_DCMP4_GT_SHIFT 12 /* DCMP4_GT */ | ||
| 190 | #define WM831X_DCMP4_GT_WIDTH 1 /* DCMP4_GT */ | ||
| 191 | #define WM831X_DCMP4_THR_MASK 0x0FFF /* DCMP4_THR - [11:0] */ | ||
| 192 | #define WM831X_DCMP4_THR_SHIFT 0 /* DCMP4_THR - [11:0] */ | ||
| 193 | #define WM831X_DCMP4_THR_WIDTH 12 /* DCMP4_THR - [11:0] */ | ||
| 194 | |||
| 195 | #define WM831X_AUX_CAL_FACTOR 0xfff | ||
| 196 | #define WM831X_AUX_CAL_NOMINAL 0x222 | ||
| 197 | |||
| 198 | enum wm831x_auxadc { | ||
| 199 | WM831X_AUX_CAL = 15, | ||
| 200 | WM831X_AUX_BKUP_BATT = 10, | ||
| 201 | WM831X_AUX_WALL = 9, | ||
| 202 | WM831X_AUX_BATT = 8, | ||
| 203 | WM831X_AUX_USB = 7, | ||
| 204 | WM831X_AUX_SYSVDD = 6, | ||
| 205 | WM831X_AUX_BATT_TEMP = 5, | ||
| 206 | WM831X_AUX_CHIP_TEMP = 4, | ||
| 207 | WM831X_AUX_AUX4 = 3, | ||
| 208 | WM831X_AUX_AUX3 = 2, | ||
| 209 | WM831X_AUX_AUX2 = 1, | ||
| 210 | WM831X_AUX_AUX1 = 0, | ||
| 211 | }; | ||
| 212 | |||
| 213 | int wm831x_auxadc_read(struct wm831x *wm831x, enum wm831x_auxadc input); | ||
| 214 | int wm831x_auxadc_read_uv(struct wm831x *wm831x, enum wm831x_auxadc input); | ||
| 215 | |||
| 216 | #endif | ||
diff --git a/include/linux/mfd/wm831x/core.h b/include/linux/mfd/wm831x/core.h new file mode 100644 index 000000000000..91eb493bf14c --- /dev/null +++ b/include/linux/mfd/wm831x/core.h | |||
| @@ -0,0 +1,289 @@ | |||
| 1 | /* | ||
| 2 | * include/linux/mfd/wm831x/core.h -- Core interface for WM831x | ||
| 3 | * | ||
| 4 | * Copyright 2009 Wolfson Microelectronics PLC. | ||
| 5 | * | ||
| 6 | * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify it | ||
| 9 | * under the terms of the GNU General Public License as published by the | ||
| 10 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 11 | * option) any later version. | ||
| 12 | * | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef __MFD_WM831X_CORE_H__ | ||
| 16 | #define __MFD_WM831X_CORE_H__ | ||
| 17 | |||
| 18 | #include <linux/interrupt.h> | ||
| 19 | #include <linux/workqueue.h> | ||
| 20 | |||
| 21 | /* | ||
| 22 | * Register values. | ||
| 23 | */ | ||
| 24 | #define WM831X_RESET_ID 0x00 | ||
| 25 | #define WM831X_REVISION 0x01 | ||
| 26 | #define WM831X_PARENT_ID 0x4000 | ||
| 27 | #define WM831X_SYSVDD_CONTROL 0x4001 | ||
| 28 | #define WM831X_THERMAL_MONITORING 0x4002 | ||
| 29 | #define WM831X_POWER_STATE 0x4003 | ||
| 30 | #define WM831X_WATCHDOG 0x4004 | ||
| 31 | #define WM831X_ON_PIN_CONTROL 0x4005 | ||
| 32 | #define WM831X_RESET_CONTROL 0x4006 | ||
| 33 | #define WM831X_CONTROL_INTERFACE 0x4007 | ||
| 34 | #define WM831X_SECURITY_KEY 0x4008 | ||
| 35 | #define WM831X_SOFTWARE_SCRATCH 0x4009 | ||
| 36 | #define WM831X_OTP_CONTROL 0x400A | ||
| 37 | #define WM831X_GPIO_LEVEL 0x400C | ||
| 38 | #define WM831X_SYSTEM_STATUS 0x400D | ||
| 39 | #define WM831X_ON_SOURCE 0x400E | ||
| 40 | #define WM831X_OFF_SOURCE 0x400F | ||
| 41 | #define WM831X_SYSTEM_INTERRUPTS 0x4010 | ||
| 42 | #define WM831X_INTERRUPT_STATUS_1 0x4011 | ||
| 43 | #define WM831X_INTERRUPT_STATUS_2 0x4012 | ||
| 44 | #define WM831X_INTERRUPT_STATUS_3 0x4013 | ||
| 45 | #define WM831X_INTERRUPT_STATUS_4 0x4014 | ||
| 46 | #define WM831X_INTERRUPT_STATUS_5 0x4015 | ||
| 47 | #define WM831X_IRQ_CONFIG 0x4017 | ||
| 48 | #define WM831X_SYSTEM_INTERRUPTS_MASK 0x4018 | ||
| 49 | #define WM831X_INTERRUPT_STATUS_1_MASK 0x4019 | ||
| 50 | #define WM831X_INTERRUPT_STATUS_2_MASK 0x401A | ||
| 51 | #define WM831X_INTERRUPT_STATUS_3_MASK 0x401B | ||
| 52 | #define WM831X_INTERRUPT_STATUS_4_MASK 0x401C | ||
| 53 | #define WM831X_INTERRUPT_STATUS_5_MASK 0x401D | ||
| 54 | #define WM831X_RTC_WRITE_COUNTER 0x4020 | ||
| 55 | #define WM831X_RTC_TIME_1 0x4021 | ||
| 56 | #define WM831X_RTC_TIME_2 0x4022 | ||
| 57 | #define WM831X_RTC_ALARM_1 0x4023 | ||
| 58 | #define WM831X_RTC_ALARM_2 0x4024 | ||
| 59 | #define WM831X_RTC_CONTROL 0x4025 | ||
| 60 | #define WM831X_RTC_TRIM 0x4026 | ||
| 61 | #define WM831X_TOUCH_CONTROL_1 0x4028 | ||
| 62 | #define WM831X_TOUCH_CONTROL_2 0x4029 | ||
| 63 | #define WM831X_TOUCH_DATA_X 0x402A | ||
| 64 | #define WM831X_TOUCH_DATA_Y 0x402B | ||
| 65 | #define WM831X_TOUCH_DATA_Z 0x402C | ||
| 66 | #define WM831X_AUXADC_DATA 0x402D | ||
| 67 | #define WM831X_AUXADC_CONTROL 0x402E | ||
| 68 | #define WM831X_AUXADC_SOURCE 0x402F | ||
| 69 | #define WM831X_COMPARATOR_CONTROL 0x4030 | ||
| 70 | #define WM831X_COMPARATOR_1 0x4031 | ||
| 71 | #define WM831X_COMPARATOR_2 0x4032 | ||
| 72 | #define WM831X_COMPARATOR_3 0x4033 | ||
| 73 | #define WM831X_COMPARATOR_4 0x4034 | ||
| 74 | #define WM831X_GPIO1_CONTROL 0x4038 | ||
| 75 | #define WM831X_GPIO2_CONTROL 0x4039 | ||
| 76 | #define WM831X_GPIO3_CONTROL 0x403A | ||
| 77 | #define WM831X_GPIO4_CONTROL 0x403B | ||
| 78 | #define WM831X_GPIO5_CONTROL 0x403C | ||
| 79 | #define WM831X_GPIO6_CONTROL 0x403D | ||
| 80 | #define WM831X_GPIO7_CONTROL 0x403E | ||
| 81 | #define WM831X_GPIO8_CONTROL 0x403F | ||
| 82 | #define WM831X_GPIO9_CONTROL 0x4040 | ||
| 83 | #define WM831X_GPIO10_CONTROL 0x4041 | ||
| 84 | #define WM831X_GPIO11_CONTROL 0x4042 | ||
| 85 | #define WM831X_GPIO12_CONTROL 0x4043 | ||
| 86 | #define WM831X_GPIO13_CONTROL 0x4044 | ||
| 87 | #define WM831X_GPIO14_CONTROL 0x4045 | ||
| 88 | #define WM831X_GPIO15_CONTROL 0x4046 | ||
| 89 | #define WM831X_GPIO16_CONTROL 0x4047 | ||
| 90 | #define WM831X_CHARGER_CONTROL_1 0x4048 | ||
| 91 | #define WM831X_CHARGER_CONTROL_2 0x4049 | ||
| 92 | #define WM831X_CHARGER_STATUS 0x404A | ||
| 93 | #define WM831X_BACKUP_CHARGER_CONTROL 0x404B | ||
| 94 | #define WM831X_STATUS_LED_1 0x404C | ||
| 95 | #define WM831X_STATUS_LED_2 0x404D | ||
| 96 | #define WM831X_CURRENT_SINK_1 0x404E | ||
| 97 | #define WM831X_CURRENT_SINK_2 0x404F | ||
| 98 | #define WM831X_DCDC_ENABLE 0x4050 | ||
| 99 | #define WM831X_LDO_ENABLE 0x4051 | ||
| 100 | #define WM831X_DCDC_STATUS 0x4052 | ||
| 101 | #define WM831X_LDO_STATUS 0x4053 | ||
| 102 | #define WM831X_DCDC_UV_STATUS 0x4054 | ||
| 103 | #define WM831X_LDO_UV_STATUS 0x4055 | ||
| 104 | #define WM831X_DC1_CONTROL_1 0x4056 | ||
| 105 | #define WM831X_DC1_CONTROL_2 0x4057 | ||
| 106 | #define WM831X_DC1_ON_CONFIG 0x4058 | ||
| 107 | #define WM831X_DC1_SLEEP_CONTROL 0x4059 | ||
| 108 | #define WM831X_DC1_DVS_CONTROL 0x405A | ||
| 109 | #define WM831X_DC2_CONTROL_1 0x405B | ||
| 110 | #define WM831X_DC2_CONTROL_2 0x405C | ||
| 111 | #define WM831X_DC2_ON_CONFIG 0x405D | ||
| 112 | #define WM831X_DC2_SLEEP_CONTROL 0x405E | ||
| 113 | #define WM831X_DC2_DVS_CONTROL 0x405F | ||
| 114 | #define WM831X_DC3_CONTROL_1 0x4060 | ||
| 115 | #define WM831X_DC3_CONTROL_2 0x4061 | ||
| 116 | #define WM831X_DC3_ON_CONFIG 0x4062 | ||
| 117 | #define WM831X_DC3_SLEEP_CONTROL 0x4063 | ||
| 118 | #define WM831X_DC4_CONTROL 0x4064 | ||
| 119 | #define WM831X_DC4_SLEEP_CONTROL 0x4065 | ||
| 120 | #define WM831X_EPE1_CONTROL 0x4066 | ||
| 121 | #define WM831X_EPE2_CONTROL 0x4067 | ||
| 122 | #define WM831X_LDO1_CONTROL 0x4068 | ||
| 123 | #define WM831X_LDO1_ON_CONTROL 0x4069 | ||
| 124 | #define WM831X_LDO1_SLEEP_CONTROL 0x406A | ||
| 125 | #define WM831X_LDO2_CONTROL 0x406B | ||
| 126 | #define WM831X_LDO2_ON_CONTROL 0x406C | ||
| 127 | #define WM831X_LDO2_SLEEP_CONTROL 0x406D | ||
| 128 | #define WM831X_LDO3_CONTROL 0x406E | ||
| 129 | #define WM831X_LDO3_ON_CONTROL 0x406F | ||
| 130 | #define WM831X_LDO3_SLEEP_CONTROL 0x4070 | ||
| 131 | #define WM831X_LDO4_CONTROL 0x4071 | ||
| 132 | #define WM831X_LDO4_ON_CONTROL 0x4072 | ||
| 133 | #define WM831X_LDO4_SLEEP_CONTROL 0x4073 | ||
| 134 | #define WM831X_LDO5_CONTROL 0x4074 | ||
| 135 | #define WM831X_LDO5_ON_CONTROL 0x4075 | ||
| 136 | #define WM831X_LDO5_SLEEP_CONTROL 0x4076 | ||
| 137 | #define WM831X_LDO6_CONTROL 0x4077 | ||
| 138 | #define WM831X_LDO6_ON_CONTROL 0x4078 | ||
| 139 | #define WM831X_LDO6_SLEEP_CONTROL 0x4079 | ||
| 140 | #define WM831X_LDO7_CONTROL 0x407A | ||
| 141 | #define WM831X_LDO7_ON_CONTROL 0x407B | ||
| 142 | #define WM831X_LDO7_SLEEP_CONTROL 0x407C | ||
| 143 | #define WM831X_LDO8_CONTROL 0x407D | ||
| 144 | #define WM831X_LDO8_ON_CONTROL 0x407E | ||
| 145 | #define WM831X_LDO8_SLEEP_CONTROL 0x407F | ||
| 146 | #define WM831X_LDO9_CONTROL 0x4080 | ||
| 147 | #define WM831X_LDO9_ON_CONTROL 0x4081 | ||
| 148 | #define WM831X_LDO9_SLEEP_CONTROL 0x4082 | ||
| 149 | #define WM831X_LDO10_CONTROL 0x4083 | ||
| 150 | #define WM831X_LDO10_ON_CONTROL 0x4084 | ||
| 151 | #define WM831X_LDO10_SLEEP_CONTROL 0x4085 | ||
| 152 | #define WM831X_LDO11_ON_CONTROL 0x4087 | ||
| 153 | #define WM831X_LDO11_SLEEP_CONTROL 0x4088 | ||
| 154 | #define WM831X_POWER_GOOD_SOURCE_1 0x408E | ||
| 155 | #define WM831X_POWER_GOOD_SOURCE_2 0x408F | ||
| 156 | #define WM831X_CLOCK_CONTROL_1 0x4090 | ||
| 157 | #define WM831X_CLOCK_CONTROL_2 0x4091 | ||
| 158 | #define WM831X_FLL_CONTROL_1 0x4092 | ||
| 159 | #define WM831X_FLL_CONTROL_2 0x4093 | ||
| 160 | #define WM831X_FLL_CONTROL_3 0x4094 | ||
| 161 | #define WM831X_FLL_CONTROL_4 0x4095 | ||
| 162 | #define WM831X_FLL_CONTROL_5 0x4096 | ||
| 163 | #define WM831X_UNIQUE_ID_1 0x7800 | ||
| 164 | #define WM831X_UNIQUE_ID_2 0x7801 | ||
| 165 | #define WM831X_UNIQUE_ID_3 0x7802 | ||
| 166 | #define WM831X_UNIQUE_ID_4 0x7803 | ||
| 167 | #define WM831X_UNIQUE_ID_5 0x7804 | ||
| 168 | #define WM831X_UNIQUE_ID_6 0x7805 | ||
| 169 | #define WM831X_UNIQUE_ID_7 0x7806 | ||
| 170 | #define WM831X_UNIQUE_ID_8 0x7807 | ||
| 171 | #define WM831X_FACTORY_OTP_ID 0x7808 | ||
| 172 | #define WM831X_FACTORY_OTP_1 0x7809 | ||
| 173 | #define WM831X_FACTORY_OTP_2 0x780A | ||
| 174 | #define WM831X_FACTORY_OTP_3 0x780B | ||
| 175 | #define WM831X_FACTORY_OTP_4 0x780C | ||
| 176 | #define WM831X_FACTORY_OTP_5 0x780D | ||
| 177 | #define WM831X_CUSTOMER_OTP_ID 0x7810 | ||
| 178 | #define WM831X_DC1_OTP_CONTROL 0x7811 | ||
| 179 | #define WM831X_DC2_OTP_CONTROL 0x7812 | ||
| 180 | #define WM831X_DC3_OTP_CONTROL 0x7813 | ||
| 181 | #define WM831X_LDO1_2_OTP_CONTROL 0x7814 | ||
| 182 | #define WM831X_LDO3_4_OTP_CONTROL 0x7815 | ||
| 183 | #define WM831X_LDO5_6_OTP_CONTROL 0x7816 | ||
| 184 | #define WM831X_LDO7_8_OTP_CONTROL 0x7817 | ||
| 185 | #define WM831X_LDO9_10_OTP_CONTROL 0x7818 | ||
| 186 | #define WM831X_LDO11_EPE_CONTROL 0x7819 | ||
| 187 | #define WM831X_GPIO1_OTP_CONTROL 0x781A | ||
| 188 | #define WM831X_GPIO2_OTP_CONTROL 0x781B | ||
| 189 | #define WM831X_GPIO3_OTP_CONTROL 0x781C | ||
| 190 | #define WM831X_GPIO4_OTP_CONTROL 0x781D | ||
| 191 | #define WM831X_GPIO5_OTP_CONTROL 0x781E | ||
| 192 | #define WM831X_GPIO6_OTP_CONTROL 0x781F | ||
| 193 | #define WM831X_DBE_CHECK_DATA 0x7827 | ||
| 194 | |||
| 195 | /* | ||
| 196 | * R0 (0x00) - Reset ID | ||
| 197 | */ | ||
| 198 | #define WM831X_CHIP_ID_MASK 0xFFFF /* CHIP_ID - [15:0] */ | ||
| 199 | #define WM831X_CHIP_ID_SHIFT 0 /* CHIP_ID - [15:0] */ | ||
| 200 | #define WM831X_CHIP_ID_WIDTH 16 /* CHIP_ID - [15:0] */ | ||
| 201 | |||
| 202 | /* | ||
| 203 | * R1 (0x01) - Revision | ||
| 204 | */ | ||
| 205 | #define WM831X_PARENT_REV_MASK 0xFF00 /* PARENT_REV - [15:8] */ | ||
| 206 | #define WM831X_PARENT_REV_SHIFT 8 /* PARENT_REV - [15:8] */ | ||
| 207 | #define WM831X_PARENT_REV_WIDTH 8 /* PARENT_REV - [15:8] */ | ||
| 208 | #define WM831X_CHILD_REV_MASK 0x00FF /* CHILD_REV - [7:0] */ | ||
| 209 | #define WM831X_CHILD_REV_SHIFT 0 /* CHILD_REV - [7:0] */ | ||
| 210 | #define WM831X_CHILD_REV_WIDTH 8 /* CHILD_REV - [7:0] */ | ||
| 211 | |||
| 212 | /* | ||
| 213 | * R16384 (0x4000) - Parent ID | ||
| 214 | */ | ||
| 215 | #define WM831X_PARENT_ID_MASK 0xFFFF /* PARENT_ID - [15:0] */ | ||
| 216 | #define WM831X_PARENT_ID_SHIFT 0 /* PARENT_ID - [15:0] */ | ||
| 217 | #define WM831X_PARENT_ID_WIDTH 16 /* PARENT_ID - [15:0] */ | ||
| 218 | |||
| 219 | /* | ||
| 220 | * R16389 (0x4005) - ON Pin Control | ||
| 221 | */ | ||
| 222 | #define WM831X_ON_PIN_SECACT_MASK 0x0300 /* ON_PIN_SECACT - [9:8] */ | ||
| 223 | #define WM831X_ON_PIN_SECACT_SHIFT 8 /* ON_PIN_SECACT - [9:8] */ | ||
| 224 | #define WM831X_ON_PIN_SECACT_WIDTH 2 /* ON_PIN_SECACT - [9:8] */ | ||
| 225 | #define WM831X_ON_PIN_PRIMACT_MASK 0x0030 /* ON_PIN_PRIMACT - [5:4] */ | ||
| 226 | #define WM831X_ON_PIN_PRIMACT_SHIFT 4 /* ON_PIN_PRIMACT - [5:4] */ | ||
| 227 | #define WM831X_ON_PIN_PRIMACT_WIDTH 2 /* ON_PIN_PRIMACT - [5:4] */ | ||
| 228 | #define WM831X_ON_PIN_STS 0x0008 /* ON_PIN_STS */ | ||
| 229 | #define WM831X_ON_PIN_STS_MASK 0x0008 /* ON_PIN_STS */ | ||
| 230 | #define WM831X_ON_PIN_STS_SHIFT 3 /* ON_PIN_STS */ | ||
| 231 | #define WM831X_ON_PIN_STS_WIDTH 1 /* ON_PIN_STS */ | ||
| 232 | #define WM831X_ON_PIN_TO_MASK 0x0003 /* ON_PIN_TO - [1:0] */ | ||
| 233 | #define WM831X_ON_PIN_TO_SHIFT 0 /* ON_PIN_TO - [1:0] */ | ||
| 234 | #define WM831X_ON_PIN_TO_WIDTH 2 /* ON_PIN_TO - [1:0] */ | ||
| 235 | |||
| 236 | struct regulator_dev; | ||
| 237 | |||
| 238 | struct wm831x { | ||
| 239 | struct mutex io_lock; | ||
| 240 | |||
| 241 | struct device *dev; | ||
| 242 | int (*read_dev)(struct wm831x *wm831x, unsigned short reg, | ||
| 243 | int bytes, void *dest); | ||
| 244 | int (*write_dev)(struct wm831x *wm831x, unsigned short reg, | ||
| 245 | int bytes, void *src); | ||
| 246 | |||
| 247 | void *control_data; | ||
| 248 | |||
| 249 | int irq; /* Our chip IRQ */ | ||
| 250 | struct mutex irq_lock; | ||
| 251 | struct workqueue_struct *irq_wq; | ||
| 252 | struct work_struct irq_work; | ||
| 253 | unsigned int irq_base; | ||
| 254 | int irq_masks[5]; | ||
| 255 | |||
| 256 | struct mutex auxadc_lock; | ||
| 257 | |||
| 258 | /* The WM831x has a security key blocking access to certain | ||
| 259 | * registers. The mutex is taken by the accessors for locking | ||
| 260 | * and unlocking the security key, locked is used to fail | ||
| 261 | * writes if the lock is held. | ||
| 262 | */ | ||
| 263 | struct mutex key_lock; | ||
| 264 | unsigned int locked:1; | ||
| 265 | }; | ||
| 266 | |||
| 267 | /* Device I/O API */ | ||
| 268 | int wm831x_reg_read(struct wm831x *wm831x, unsigned short reg); | ||
| 269 | int wm831x_reg_write(struct wm831x *wm831x, unsigned short reg, | ||
| 270 | unsigned short val); | ||
| 271 | void wm831x_reg_lock(struct wm831x *wm831x); | ||
| 272 | int wm831x_reg_unlock(struct wm831x *wm831x); | ||
| 273 | int wm831x_set_bits(struct wm831x *wm831x, unsigned short reg, | ||
| 274 | unsigned short mask, unsigned short val); | ||
| 275 | int wm831x_bulk_read(struct wm831x *wm831x, unsigned short reg, | ||
| 276 | int count, u16 *buf); | ||
| 277 | |||
| 278 | int wm831x_irq_init(struct wm831x *wm831x, int irq); | ||
| 279 | void wm831x_irq_exit(struct wm831x *wm831x); | ||
| 280 | |||
| 281 | int __must_check wm831x_request_irq(struct wm831x *wm831x, | ||
| 282 | unsigned int irq, irq_handler_t handler, | ||
| 283 | unsigned long flags, const char *name, | ||
| 284 | void *dev); | ||
| 285 | void wm831x_free_irq(struct wm831x *wm831x, unsigned int, void *); | ||
| 286 | void wm831x_disable_irq(struct wm831x *wm831x, int irq); | ||
| 287 | void wm831x_enable_irq(struct wm831x *wm831x, int irq); | ||
| 288 | |||
| 289 | #endif | ||
diff --git a/include/linux/mfd/wm831x/gpio.h b/include/linux/mfd/wm831x/gpio.h new file mode 100644 index 000000000000..2835614af0e3 --- /dev/null +++ b/include/linux/mfd/wm831x/gpio.h | |||
| @@ -0,0 +1,55 @@ | |||
| 1 | /* | ||
| 2 | * include/linux/mfd/wm831x/gpio.h -- GPIO for WM831x | ||
| 3 | * | ||
| 4 | * Copyright 2009 Wolfson Microelectronics PLC. | ||
| 5 | * | ||
| 6 | * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify it | ||
| 9 | * under the terms of the GNU General Public License as published by the | ||
| 10 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 11 | * option) any later version. | ||
| 12 | * | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef __MFD_WM831X_GPIO_H__ | ||
| 16 | #define __MFD_WM831X_GPIO_H__ | ||
| 17 | |||
| 18 | /* | ||
| 19 | * R16440-16455 (0x4038-0x4047) - GPIOx Control | ||
| 20 | */ | ||
| 21 | #define WM831X_GPN_DIR 0x8000 /* GPN_DIR */ | ||
| 22 | #define WM831X_GPN_DIR_MASK 0x8000 /* GPN_DIR */ | ||
| 23 | #define WM831X_GPN_DIR_SHIFT 15 /* GPN_DIR */ | ||
| 24 | #define WM831X_GPN_DIR_WIDTH 1 /* GPN_DIR */ | ||
| 25 | #define WM831X_GPN_PULL_MASK 0x6000 /* GPN_PULL - [14:13] */ | ||
| 26 | #define WM831X_GPN_PULL_SHIFT 13 /* GPN_PULL - [14:13] */ | ||
| 27 | #define WM831X_GPN_PULL_WIDTH 2 /* GPN_PULL - [14:13] */ | ||
| 28 | #define WM831X_GPN_INT_MODE 0x1000 /* GPN_INT_MODE */ | ||
| 29 | #define WM831X_GPN_INT_MODE_MASK 0x1000 /* GPN_INT_MODE */ | ||
| 30 | #define WM831X_GPN_INT_MODE_SHIFT 12 /* GPN_INT_MODE */ | ||
| 31 | #define WM831X_GPN_INT_MODE_WIDTH 1 /* GPN_INT_MODE */ | ||
| 32 | #define WM831X_GPN_PWR_DOM 0x0800 /* GPN_PWR_DOM */ | ||
| 33 | #define WM831X_GPN_PWR_DOM_MASK 0x0800 /* GPN_PWR_DOM */ | ||
| 34 | #define WM831X_GPN_PWR_DOM_SHIFT 11 /* GPN_PWR_DOM */ | ||
| 35 | #define WM831X_GPN_PWR_DOM_WIDTH 1 /* GPN_PWR_DOM */ | ||
| 36 | #define WM831X_GPN_POL 0x0400 /* GPN_POL */ | ||
| 37 | #define WM831X_GPN_POL_MASK 0x0400 /* GPN_POL */ | ||
| 38 | #define WM831X_GPN_POL_SHIFT 10 /* GPN_POL */ | ||
| 39 | #define WM831X_GPN_POL_WIDTH 1 /* GPN_POL */ | ||
| 40 | #define WM831X_GPN_OD 0x0200 /* GPN_OD */ | ||
| 41 | #define WM831X_GPN_OD_MASK 0x0200 /* GPN_OD */ | ||
| 42 | #define WM831X_GPN_OD_SHIFT 9 /* GPN_OD */ | ||
| 43 | #define WM831X_GPN_OD_WIDTH 1 /* GPN_OD */ | ||
| 44 | #define WM831X_GPN_TRI 0x0080 /* GPN_TRI */ | ||
| 45 | #define WM831X_GPN_TRI_MASK 0x0080 /* GPN_TRI */ | ||
| 46 | #define WM831X_GPN_TRI_SHIFT 7 /* GPN_TRI */ | ||
| 47 | #define WM831X_GPN_TRI_WIDTH 1 /* GPN_TRI */ | ||
| 48 | #define WM831X_GPN_FN_MASK 0x000F /* GPN_FN - [3:0] */ | ||
| 49 | #define WM831X_GPN_FN_SHIFT 0 /* GPN_FN - [3:0] */ | ||
| 50 | #define WM831X_GPN_FN_WIDTH 4 /* GPN_FN - [3:0] */ | ||
| 51 | |||
| 52 | #define WM831X_GPIO_PULL_NONE (0 << WM831X_GPN_PULL_SHIFT) | ||
| 53 | #define WM831X_GPIO_PULL_DOWN (1 << WM831X_GPN_PULL_SHIFT) | ||
| 54 | #define WM831X_GPIO_PULL_UP (2 << WM831X_GPN_PULL_SHIFT) | ||
| 55 | #endif | ||
diff --git a/include/linux/mfd/wm831x/irq.h b/include/linux/mfd/wm831x/irq.h new file mode 100644 index 000000000000..3a8c97656fda --- /dev/null +++ b/include/linux/mfd/wm831x/irq.h | |||
| @@ -0,0 +1,764 @@ | |||
| 1 | /* | ||
| 2 | * include/linux/mfd/wm831x/irq.h -- Interrupt controller for WM831x | ||
| 3 | * | ||
| 4 | * Copyright 2009 Wolfson Microelectronics PLC. | ||
| 5 | * | ||
| 6 | * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify it | ||
| 9 | * under the terms of the GNU General Public License as published by the | ||
| 10 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 11 | * option) any later version. | ||
| 12 | * | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef __MFD_WM831X_IRQ_H__ | ||
| 16 | #define __MFD_WM831X_IRQ_H__ | ||
| 17 | |||
| 18 | /* Interrupt number assignments within Linux */ | ||
| 19 | #define WM831X_IRQ_TEMP_THW 0 | ||
| 20 | #define WM831X_IRQ_GPIO_1 1 | ||
| 21 | #define WM831X_IRQ_GPIO_2 2 | ||
| 22 | #define WM831X_IRQ_GPIO_3 3 | ||
| 23 | #define WM831X_IRQ_GPIO_4 4 | ||
| 24 | #define WM831X_IRQ_GPIO_5 5 | ||
| 25 | #define WM831X_IRQ_GPIO_6 6 | ||
| 26 | #define WM831X_IRQ_GPIO_7 7 | ||
| 27 | #define WM831X_IRQ_GPIO_8 8 | ||
| 28 | #define WM831X_IRQ_GPIO_9 9 | ||
| 29 | #define WM831X_IRQ_GPIO_10 10 | ||
| 30 | #define WM831X_IRQ_GPIO_11 11 | ||
| 31 | #define WM831X_IRQ_GPIO_12 12 | ||
| 32 | #define WM831X_IRQ_GPIO_13 13 | ||
| 33 | #define WM831X_IRQ_GPIO_14 14 | ||
| 34 | #define WM831X_IRQ_GPIO_15 15 | ||
| 35 | #define WM831X_IRQ_GPIO_16 16 | ||
| 36 | #define WM831X_IRQ_ON 17 | ||
| 37 | #define WM831X_IRQ_PPM_SYSLO 18 | ||
| 38 | #define WM831X_IRQ_PPM_PWR_SRC 19 | ||
| 39 | #define WM831X_IRQ_PPM_USB_CURR 20 | ||
| 40 | #define WM831X_IRQ_WDOG_TO 21 | ||
| 41 | #define WM831X_IRQ_RTC_PER 22 | ||
| 42 | #define WM831X_IRQ_RTC_ALM 23 | ||
| 43 | #define WM831X_IRQ_CHG_BATT_HOT 24 | ||
| 44 | #define WM831X_IRQ_CHG_BATT_COLD 25 | ||
| 45 | #define WM831X_IRQ_CHG_BATT_FAIL 26 | ||
| 46 | #define WM831X_IRQ_CHG_OV 27 | ||
| 47 | #define WM831X_IRQ_CHG_END 29 | ||
| 48 | #define WM831X_IRQ_CHG_TO 30 | ||
| 49 | #define WM831X_IRQ_CHG_MODE 31 | ||
| 50 | #define WM831X_IRQ_CHG_START 32 | ||
| 51 | #define WM831X_IRQ_TCHDATA 33 | ||
| 52 | #define WM831X_IRQ_TCHPD 34 | ||
| 53 | #define WM831X_IRQ_AUXADC_DATA 35 | ||
| 54 | #define WM831X_IRQ_AUXADC_DCOMP1 36 | ||
| 55 | #define WM831X_IRQ_AUXADC_DCOMP2 37 | ||
| 56 | #define WM831X_IRQ_AUXADC_DCOMP3 38 | ||
| 57 | #define WM831X_IRQ_AUXADC_DCOMP4 39 | ||
| 58 | #define WM831X_IRQ_CS1 40 | ||
| 59 | #define WM831X_IRQ_CS2 41 | ||
| 60 | #define WM831X_IRQ_HC_DC1 42 | ||
| 61 | #define WM831X_IRQ_HC_DC2 43 | ||
| 62 | #define WM831X_IRQ_UV_LDO1 44 | ||
| 63 | #define WM831X_IRQ_UV_LDO2 45 | ||
| 64 | #define WM831X_IRQ_UV_LDO3 46 | ||
| 65 | #define WM831X_IRQ_UV_LDO4 47 | ||
| 66 | #define WM831X_IRQ_UV_LDO5 48 | ||
| 67 | #define WM831X_IRQ_UV_LDO6 49 | ||
| 68 | #define WM831X_IRQ_UV_LDO7 50 | ||
| 69 | #define WM831X_IRQ_UV_LDO8 51 | ||
| 70 | #define WM831X_IRQ_UV_LDO9 52 | ||
| 71 | #define WM831X_IRQ_UV_LDO10 53 | ||
| 72 | #define WM831X_IRQ_UV_DC1 54 | ||
| 73 | #define WM831X_IRQ_UV_DC2 55 | ||
| 74 | #define WM831X_IRQ_UV_DC3 56 | ||
| 75 | #define WM831X_IRQ_UV_DC4 57 | ||
| 76 | |||
| 77 | #define WM831X_NUM_IRQS 58 | ||
| 78 | |||
| 79 | /* | ||
| 80 | * R16400 (0x4010) - System Interrupts | ||
| 81 | */ | ||
| 82 | #define WM831X_PS_INT 0x8000 /* PS_INT */ | ||
| 83 | #define WM831X_PS_INT_MASK 0x8000 /* PS_INT */ | ||
| 84 | #define WM831X_PS_INT_SHIFT 15 /* PS_INT */ | ||
| 85 | #define WM831X_PS_INT_WIDTH 1 /* PS_INT */ | ||
| 86 | #define WM831X_TEMP_INT 0x4000 /* TEMP_INT */ | ||
| 87 | #define WM831X_TEMP_INT_MASK 0x4000 /* TEMP_INT */ | ||
| 88 | #define WM831X_TEMP_INT_SHIFT 14 /* TEMP_INT */ | ||
| 89 | #define WM831X_TEMP_INT_WIDTH 1 /* TEMP_INT */ | ||
| 90 | #define WM831X_GP_INT 0x2000 /* GP_INT */ | ||
| 91 | #define WM831X_GP_INT_MASK 0x2000 /* GP_INT */ | ||
| 92 | #define WM831X_GP_INT_SHIFT 13 /* GP_INT */ | ||
| 93 | #define WM831X_GP_INT_WIDTH 1 /* GP_INT */ | ||
| 94 | #define WM831X_ON_PIN_INT 0x1000 /* ON_PIN_INT */ | ||
| 95 | #define WM831X_ON_PIN_INT_MASK 0x1000 /* ON_PIN_INT */ | ||
| 96 | #define WM831X_ON_PIN_INT_SHIFT 12 /* ON_PIN_INT */ | ||
| 97 | #define WM831X_ON_PIN_INT_WIDTH 1 /* ON_PIN_INT */ | ||
| 98 | #define WM831X_WDOG_INT 0x0800 /* WDOG_INT */ | ||
| 99 | #define WM831X_WDOG_INT_MASK 0x0800 /* WDOG_INT */ | ||
| 100 | #define WM831X_WDOG_INT_SHIFT 11 /* WDOG_INT */ | ||
| 101 | #define WM831X_WDOG_INT_WIDTH 1 /* WDOG_INT */ | ||
| 102 | #define WM831X_TCHDATA_INT 0x0400 /* TCHDATA_INT */ | ||
| 103 | #define WM831X_TCHDATA_INT_MASK 0x0400 /* TCHDATA_INT */ | ||
| 104 | #define WM831X_TCHDATA_INT_SHIFT 10 /* TCHDATA_INT */ | ||
| 105 | #define WM831X_TCHDATA_INT_WIDTH 1 /* TCHDATA_INT */ | ||
| 106 | #define WM831X_TCHPD_INT 0x0200 /* TCHPD_INT */ | ||
| 107 | #define WM831X_TCHPD_INT_MASK 0x0200 /* TCHPD_INT */ | ||
| 108 | #define WM831X_TCHPD_INT_SHIFT 9 /* TCHPD_INT */ | ||
| 109 | #define WM831X_TCHPD_INT_WIDTH 1 /* TCHPD_INT */ | ||
| 110 | #define WM831X_AUXADC_INT 0x0100 /* AUXADC_INT */ | ||
| 111 | #define WM831X_AUXADC_INT_MASK 0x0100 /* AUXADC_INT */ | ||
| 112 | #define WM831X_AUXADC_INT_SHIFT 8 /* AUXADC_INT */ | ||
| 113 | #define WM831X_AUXADC_INT_WIDTH 1 /* AUXADC_INT */ | ||
| 114 | #define WM831X_PPM_INT 0x0080 /* PPM_INT */ | ||
| 115 | #define WM831X_PPM_INT_MASK 0x0080 /* PPM_INT */ | ||
| 116 | #define WM831X_PPM_INT_SHIFT 7 /* PPM_INT */ | ||
| 117 | #define WM831X_PPM_INT_WIDTH 1 /* PPM_INT */ | ||
| 118 | #define WM831X_CS_INT 0x0040 /* CS_INT */ | ||
| 119 | #define WM831X_CS_INT_MASK 0x0040 /* CS_INT */ | ||
| 120 | #define WM831X_CS_INT_SHIFT 6 /* CS_INT */ | ||
| 121 | #define WM831X_CS_INT_WIDTH 1 /* CS_INT */ | ||
| 122 | #define WM831X_RTC_INT 0x0020 /* RTC_INT */ | ||
| 123 | #define WM831X_RTC_INT_MASK 0x0020 /* RTC_INT */ | ||
| 124 | #define WM831X_RTC_INT_SHIFT 5 /* RTC_INT */ | ||
| 125 | #define WM831X_RTC_INT_WIDTH 1 /* RTC_INT */ | ||
| 126 | #define WM831X_OTP_INT 0x0010 /* OTP_INT */ | ||
| 127 | #define WM831X_OTP_INT_MASK 0x0010 /* OTP_INT */ | ||
| 128 | #define WM831X_OTP_INT_SHIFT 4 /* OTP_INT */ | ||
| 129 | #define WM831X_OTP_INT_WIDTH 1 /* OTP_INT */ | ||
| 130 | #define WM831X_CHILD_INT 0x0008 /* CHILD_INT */ | ||
| 131 | #define WM831X_CHILD_INT_MASK 0x0008 /* CHILD_INT */ | ||
| 132 | #define WM831X_CHILD_INT_SHIFT 3 /* CHILD_INT */ | ||
| 133 | #define WM831X_CHILD_INT_WIDTH 1 /* CHILD_INT */ | ||
| 134 | #define WM831X_CHG_INT 0x0004 /* CHG_INT */ | ||
| 135 | #define WM831X_CHG_INT_MASK 0x0004 /* CHG_INT */ | ||
| 136 | #define WM831X_CHG_INT_SHIFT 2 /* CHG_INT */ | ||
| 137 | #define WM831X_CHG_INT_WIDTH 1 /* CHG_INT */ | ||
| 138 | #define WM831X_HC_INT 0x0002 /* HC_INT */ | ||
| 139 | #define WM831X_HC_INT_MASK 0x0002 /* HC_INT */ | ||
| 140 | #define WM831X_HC_INT_SHIFT 1 /* HC_INT */ | ||
| 141 | #define WM831X_HC_INT_WIDTH 1 /* HC_INT */ | ||
| 142 | #define WM831X_UV_INT 0x0001 /* UV_INT */ | ||
| 143 | #define WM831X_UV_INT_MASK 0x0001 /* UV_INT */ | ||
| 144 | #define WM831X_UV_INT_SHIFT 0 /* UV_INT */ | ||
| 145 | #define WM831X_UV_INT_WIDTH 1 /* UV_INT */ | ||
| 146 | |||
| 147 | /* | ||
| 148 | * R16401 (0x4011) - Interrupt Status 1 | ||
| 149 | */ | ||
| 150 | #define WM831X_PPM_SYSLO_EINT 0x8000 /* PPM_SYSLO_EINT */ | ||
| 151 | #define WM831X_PPM_SYSLO_EINT_MASK 0x8000 /* PPM_SYSLO_EINT */ | ||
| 152 | #define WM831X_PPM_SYSLO_EINT_SHIFT 15 /* PPM_SYSLO_EINT */ | ||
| 153 | #define WM831X_PPM_SYSLO_EINT_WIDTH 1 /* PPM_SYSLO_EINT */ | ||
| 154 | #define WM831X_PPM_PWR_SRC_EINT 0x4000 /* PPM_PWR_SRC_EINT */ | ||
| 155 | #define WM831X_PPM_PWR_SRC_EINT_MASK 0x4000 /* PPM_PWR_SRC_EINT */ | ||
| 156 | #define WM831X_PPM_PWR_SRC_EINT_SHIFT 14 /* PPM_PWR_SRC_EINT */ | ||
| 157 | #define WM831X_PPM_PWR_SRC_EINT_WIDTH 1 /* PPM_PWR_SRC_EINT */ | ||
| 158 | #define WM831X_PPM_USB_CURR_EINT 0x2000 /* PPM_USB_CURR_EINT */ | ||
| 159 | #define WM831X_PPM_USB_CURR_EINT_MASK 0x2000 /* PPM_USB_CURR_EINT */ | ||
| 160 | #define WM831X_PPM_USB_CURR_EINT_SHIFT 13 /* PPM_USB_CURR_EINT */ | ||
| 161 | #define WM831X_PPM_USB_CURR_EINT_WIDTH 1 /* PPM_USB_CURR_EINT */ | ||
| 162 | #define WM831X_ON_PIN_EINT 0x1000 /* ON_PIN_EINT */ | ||
| 163 | #define WM831X_ON_PIN_EINT_MASK 0x1000 /* ON_PIN_EINT */ | ||
| 164 | #define WM831X_ON_PIN_EINT_SHIFT 12 /* ON_PIN_EINT */ | ||
| 165 | #define WM831X_ON_PIN_EINT_WIDTH 1 /* ON_PIN_EINT */ | ||
| 166 | #define WM831X_WDOG_TO_EINT 0x0800 /* WDOG_TO_EINT */ | ||
| 167 | #define WM831X_WDOG_TO_EINT_MASK 0x0800 /* WDOG_TO_EINT */ | ||
| 168 | #define WM831X_WDOG_TO_EINT_SHIFT 11 /* WDOG_TO_EINT */ | ||
| 169 | #define WM831X_WDOG_TO_EINT_WIDTH 1 /* WDOG_TO_EINT */ | ||
| 170 | #define WM831X_TCHDATA_EINT 0x0400 /* TCHDATA_EINT */ | ||
| 171 | #define WM831X_TCHDATA_EINT_MASK 0x0400 /* TCHDATA_EINT */ | ||
| 172 | #define WM831X_TCHDATA_EINT_SHIFT 10 /* TCHDATA_EINT */ | ||
| 173 | #define WM831X_TCHDATA_EINT_WIDTH 1 /* TCHDATA_EINT */ | ||
| 174 | #define WM831X_TCHPD_EINT 0x0200 /* TCHPD_EINT */ | ||
| 175 | #define WM831X_TCHPD_EINT_MASK 0x0200 /* TCHPD_EINT */ | ||
| 176 | #define WM831X_TCHPD_EINT_SHIFT 9 /* TCHPD_EINT */ | ||
| 177 | #define WM831X_TCHPD_EINT_WIDTH 1 /* TCHPD_EINT */ | ||
| 178 | #define WM831X_AUXADC_DATA_EINT 0x0100 /* AUXADC_DATA_EINT */ | ||
| 179 | #define WM831X_AUXADC_DATA_EINT_MASK 0x0100 /* AUXADC_DATA_EINT */ | ||
| 180 | #define WM831X_AUXADC_DATA_EINT_SHIFT 8 /* AUXADC_DATA_EINT */ | ||
| 181 | #define WM831X_AUXADC_DATA_EINT_WIDTH 1 /* AUXADC_DATA_EINT */ | ||
| 182 | #define WM831X_AUXADC_DCOMP4_EINT 0x0080 /* AUXADC_DCOMP4_EINT */ | ||
| 183 | #define WM831X_AUXADC_DCOMP4_EINT_MASK 0x0080 /* AUXADC_DCOMP4_EINT */ | ||
| 184 | #define WM831X_AUXADC_DCOMP4_EINT_SHIFT 7 /* AUXADC_DCOMP4_EINT */ | ||
| 185 | #define WM831X_AUXADC_DCOMP4_EINT_WIDTH 1 /* AUXADC_DCOMP4_EINT */ | ||
| 186 | #define WM831X_AUXADC_DCOMP3_EINT 0x0040 /* AUXADC_DCOMP3_EINT */ | ||
| 187 | #define WM831X_AUXADC_DCOMP3_EINT_MASK 0x0040 /* AUXADC_DCOMP3_EINT */ | ||
| 188 | #define WM831X_AUXADC_DCOMP3_EINT_SHIFT 6 /* AUXADC_DCOMP3_EINT */ | ||
| 189 | #define WM831X_AUXADC_DCOMP3_EINT_WIDTH 1 /* AUXADC_DCOMP3_EINT */ | ||
| 190 | #define WM831X_AUXADC_DCOMP2_EINT 0x0020 /* AUXADC_DCOMP2_EINT */ | ||
| 191 | #define WM831X_AUXADC_DCOMP2_EINT_MASK 0x0020 /* AUXADC_DCOMP2_EINT */ | ||
| 192 | #define WM831X_AUXADC_DCOMP2_EINT_SHIFT 5 /* AUXADC_DCOMP2_EINT */ | ||
| 193 | #define WM831X_AUXADC_DCOMP2_EINT_WIDTH 1 /* AUXADC_DCOMP2_EINT */ | ||
| 194 | #define WM831X_AUXADC_DCOMP1_EINT 0x0010 /* AUXADC_DCOMP1_EINT */ | ||
| 195 | #define WM831X_AUXADC_DCOMP1_EINT_MASK 0x0010 /* AUXADC_DCOMP1_EINT */ | ||
| 196 | #define WM831X_AUXADC_DCOMP1_EINT_SHIFT 4 /* AUXADC_DCOMP1_EINT */ | ||
| 197 | #define WM831X_AUXADC_DCOMP1_EINT_WIDTH 1 /* AUXADC_DCOMP1_EINT */ | ||
| 198 | #define WM831X_RTC_PER_EINT 0x0008 /* RTC_PER_EINT */ | ||
| 199 | #define WM831X_RTC_PER_EINT_MASK 0x0008 /* RTC_PER_EINT */ | ||
| 200 | #define WM831X_RTC_PER_EINT_SHIFT 3 /* RTC_PER_EINT */ | ||
| 201 | #define WM831X_RTC_PER_EINT_WIDTH 1 /* RTC_PER_EINT */ | ||
| 202 | #define WM831X_RTC_ALM_EINT 0x0004 /* RTC_ALM_EINT */ | ||
| 203 | #define WM831X_RTC_ALM_EINT_MASK 0x0004 /* RTC_ALM_EINT */ | ||
| 204 | #define WM831X_RTC_ALM_EINT_SHIFT 2 /* RTC_ALM_EINT */ | ||
| 205 | #define WM831X_RTC_ALM_EINT_WIDTH 1 /* RTC_ALM_EINT */ | ||
| 206 | #define WM831X_TEMP_THW_EINT 0x0002 /* TEMP_THW_EINT */ | ||
| 207 | #define WM831X_TEMP_THW_EINT_MASK 0x0002 /* TEMP_THW_EINT */ | ||
| 208 | #define WM831X_TEMP_THW_EINT_SHIFT 1 /* TEMP_THW_EINT */ | ||
| 209 | #define WM831X_TEMP_THW_EINT_WIDTH 1 /* TEMP_THW_EINT */ | ||
| 210 | |||
| 211 | /* | ||
| 212 | * R16402 (0x4012) - Interrupt Status 2 | ||
| 213 | */ | ||
| 214 | #define WM831X_CHG_BATT_HOT_EINT 0x8000 /* CHG_BATT_HOT_EINT */ | ||
| 215 | #define WM831X_CHG_BATT_HOT_EINT_MASK 0x8000 /* CHG_BATT_HOT_EINT */ | ||
| 216 | #define WM831X_CHG_BATT_HOT_EINT_SHIFT 15 /* CHG_BATT_HOT_EINT */ | ||
| 217 | #define WM831X_CHG_BATT_HOT_EINT_WIDTH 1 /* CHG_BATT_HOT_EINT */ | ||
| 218 | #define WM831X_CHG_BATT_COLD_EINT 0x4000 /* CHG_BATT_COLD_EINT */ | ||
| 219 | #define WM831X_CHG_BATT_COLD_EINT_MASK 0x4000 /* CHG_BATT_COLD_EINT */ | ||
| 220 | #define WM831X_CHG_BATT_COLD_EINT_SHIFT 14 /* CHG_BATT_COLD_EINT */ | ||
| 221 | #define WM831X_CHG_BATT_COLD_EINT_WIDTH 1 /* CHG_BATT_COLD_EINT */ | ||
| 222 | #define WM831X_CHG_BATT_FAIL_EINT 0x2000 /* CHG_BATT_FAIL_EINT */ | ||
| 223 | #define WM831X_CHG_BATT_FAIL_EINT_MASK 0x2000 /* CHG_BATT_FAIL_EINT */ | ||
| 224 | #define WM831X_CHG_BATT_FAIL_EINT_SHIFT 13 /* CHG_BATT_FAIL_EINT */ | ||
| 225 | #define WM831X_CHG_BATT_FAIL_EINT_WIDTH 1 /* CHG_BATT_FAIL_EINT */ | ||
| 226 | #define WM831X_CHG_OV_EINT 0x1000 /* CHG_OV_EINT */ | ||
| 227 | #define WM831X_CHG_OV_EINT_MASK 0x1000 /* CHG_OV_EINT */ | ||
| 228 | #define WM831X_CHG_OV_EINT_SHIFT 12 /* CHG_OV_EINT */ | ||
| 229 | #define WM831X_CHG_OV_EINT_WIDTH 1 /* CHG_OV_EINT */ | ||
| 230 | #define WM831X_CHG_END_EINT 0x0800 /* CHG_END_EINT */ | ||
| 231 | #define WM831X_CHG_END_EINT_MASK 0x0800 /* CHG_END_EINT */ | ||
| 232 | #define WM831X_CHG_END_EINT_SHIFT 11 /* CHG_END_EINT */ | ||
| 233 | #define WM831X_CHG_END_EINT_WIDTH 1 /* CHG_END_EINT */ | ||
| 234 | #define WM831X_CHG_TO_EINT 0x0400 /* CHG_TO_EINT */ | ||
| 235 | #define WM831X_CHG_TO_EINT_MASK 0x0400 /* CHG_TO_EINT */ | ||
| 236 | #define WM831X_CHG_TO_EINT_SHIFT 10 /* CHG_TO_EINT */ | ||
| 237 | #define WM831X_CHG_TO_EINT_WIDTH 1 /* CHG_TO_EINT */ | ||
| 238 | #define WM831X_CHG_MODE_EINT 0x0200 /* CHG_MODE_EINT */ | ||
| 239 | #define WM831X_CHG_MODE_EINT_MASK 0x0200 /* CHG_MODE_EINT */ | ||
| 240 | #define WM831X_CHG_MODE_EINT_SHIFT 9 /* CHG_MODE_EINT */ | ||
| 241 | #define WM831X_CHG_MODE_EINT_WIDTH 1 /* CHG_MODE_EINT */ | ||
| 242 | #define WM831X_CHG_START_EINT 0x0100 /* CHG_START_EINT */ | ||
| 243 | #define WM831X_CHG_START_EINT_MASK 0x0100 /* CHG_START_EINT */ | ||
| 244 | #define WM831X_CHG_START_EINT_SHIFT 8 /* CHG_START_EINT */ | ||
| 245 | #define WM831X_CHG_START_EINT_WIDTH 1 /* CHG_START_EINT */ | ||
| 246 | #define WM831X_CS2_EINT 0x0080 /* CS2_EINT */ | ||
| 247 | #define WM831X_CS2_EINT_MASK 0x0080 /* CS2_EINT */ | ||
| 248 | #define WM831X_CS2_EINT_SHIFT 7 /* CS2_EINT */ | ||
| 249 | #define WM831X_CS2_EINT_WIDTH 1 /* CS2_EINT */ | ||
| 250 | #define WM831X_CS1_EINT 0x0040 /* CS1_EINT */ | ||
| 251 | #define WM831X_CS1_EINT_MASK 0x0040 /* CS1_EINT */ | ||
| 252 | #define WM831X_CS1_EINT_SHIFT 6 /* CS1_EINT */ | ||
| 253 | #define WM831X_CS1_EINT_WIDTH 1 /* CS1_EINT */ | ||
| 254 | #define WM831X_OTP_CMD_END_EINT 0x0020 /* OTP_CMD_END_EINT */ | ||
| 255 | #define WM831X_OTP_CMD_END_EINT_MASK 0x0020 /* OTP_CMD_END_EINT */ | ||
| 256 | #define WM831X_OTP_CMD_END_EINT_SHIFT 5 /* OTP_CMD_END_EINT */ | ||
| 257 | #define WM831X_OTP_CMD_END_EINT_WIDTH 1 /* OTP_CMD_END_EINT */ | ||
| 258 | #define WM831X_OTP_ERR_EINT 0x0010 /* OTP_ERR_EINT */ | ||
| 259 | #define WM831X_OTP_ERR_EINT_MASK 0x0010 /* OTP_ERR_EINT */ | ||
| 260 | #define WM831X_OTP_ERR_EINT_SHIFT 4 /* OTP_ERR_EINT */ | ||
| 261 | #define WM831X_OTP_ERR_EINT_WIDTH 1 /* OTP_ERR_EINT */ | ||
| 262 | #define WM831X_PS_POR_EINT 0x0004 /* PS_POR_EINT */ | ||
| 263 | #define WM831X_PS_POR_EINT_MASK 0x0004 /* PS_POR_EINT */ | ||
| 264 | #define WM831X_PS_POR_EINT_SHIFT 2 /* PS_POR_EINT */ | ||
| 265 | #define WM831X_PS_POR_EINT_WIDTH 1 /* PS_POR_EINT */ | ||
| 266 | #define WM831X_PS_SLEEP_OFF_EINT 0x0002 /* PS_SLEEP_OFF_EINT */ | ||
| 267 | #define WM831X_PS_SLEEP_OFF_EINT_MASK 0x0002 /* PS_SLEEP_OFF_EINT */ | ||
| 268 | #define WM831X_PS_SLEEP_OFF_EINT_SHIFT 1 /* PS_SLEEP_OFF_EINT */ | ||
| 269 | #define WM831X_PS_SLEEP_OFF_EINT_WIDTH 1 /* PS_SLEEP_OFF_EINT */ | ||
| 270 | #define WM831X_PS_ON_WAKE_EINT 0x0001 /* PS_ON_WAKE_EINT */ | ||
| 271 | #define WM831X_PS_ON_WAKE_EINT_MASK 0x0001 /* PS_ON_WAKE_EINT */ | ||
| 272 | #define WM831X_PS_ON_WAKE_EINT_SHIFT 0 /* PS_ON_WAKE_EINT */ | ||
| 273 | #define WM831X_PS_ON_WAKE_EINT_WIDTH 1 /* PS_ON_WAKE_EINT */ | ||
| 274 | |||
| 275 | /* | ||
| 276 | * R16403 (0x4013) - Interrupt Status 3 | ||
| 277 | */ | ||
| 278 | #define WM831X_UV_LDO10_EINT 0x0200 /* UV_LDO10_EINT */ | ||
| 279 | #define WM831X_UV_LDO10_EINT_MASK 0x0200 /* UV_LDO10_EINT */ | ||
| 280 | #define WM831X_UV_LDO10_EINT_SHIFT 9 /* UV_LDO10_EINT */ | ||
| 281 | #define WM831X_UV_LDO10_EINT_WIDTH 1 /* UV_LDO10_EINT */ | ||
| 282 | #define WM831X_UV_LDO9_EINT 0x0100 /* UV_LDO9_EINT */ | ||
| 283 | #define WM831X_UV_LDO9_EINT_MASK 0x0100 /* UV_LDO9_EINT */ | ||
| 284 | #define WM831X_UV_LDO9_EINT_SHIFT 8 /* UV_LDO9_EINT */ | ||
| 285 | #define WM831X_UV_LDO9_EINT_WIDTH 1 /* UV_LDO9_EINT */ | ||
| 286 | #define WM831X_UV_LDO8_EINT 0x0080 /* UV_LDO8_EINT */ | ||
| 287 | #define WM831X_UV_LDO8_EINT_MASK 0x0080 /* UV_LDO8_EINT */ | ||
| 288 | #define WM831X_UV_LDO8_EINT_SHIFT 7 /* UV_LDO8_EINT */ | ||
| 289 | #define WM831X_UV_LDO8_EINT_WIDTH 1 /* UV_LDO8_EINT */ | ||
| 290 | #define WM831X_UV_LDO7_EINT 0x0040 /* UV_LDO7_EINT */ | ||
| 291 | #define WM831X_UV_LDO7_EINT_MASK 0x0040 /* UV_LDO7_EINT */ | ||
| 292 | #define WM831X_UV_LDO7_EINT_SHIFT 6 /* UV_LDO7_EINT */ | ||
| 293 | #define WM831X_UV_LDO7_EINT_WIDTH 1 /* UV_LDO7_EINT */ | ||
| 294 | #define WM831X_UV_LDO6_EINT 0x0020 /* UV_LDO6_EINT */ | ||
| 295 | #define WM831X_UV_LDO6_EINT_MASK 0x0020 /* UV_LDO6_EINT */ | ||
| 296 | #define WM831X_UV_LDO6_EINT_SHIFT 5 /* UV_LDO6_EINT */ | ||
| 297 | #define WM831X_UV_LDO6_EINT_WIDTH 1 /* UV_LDO6_EINT */ | ||
| 298 | #define WM831X_UV_LDO5_EINT 0x0010 /* UV_LDO5_EINT */ | ||
| 299 | #define WM831X_UV_LDO5_EINT_MASK 0x0010 /* UV_LDO5_EINT */ | ||
| 300 | #define WM831X_UV_LDO5_EINT_SHIFT 4 /* UV_LDO5_EINT */ | ||
| 301 | #define WM831X_UV_LDO5_EINT_WIDTH 1 /* UV_LDO5_EINT */ | ||
| 302 | #define WM831X_UV_LDO4_EINT 0x0008 /* UV_LDO4_EINT */ | ||
| 303 | #define WM831X_UV_LDO4_EINT_MASK 0x0008 /* UV_LDO4_EINT */ | ||
| 304 | #define WM831X_UV_LDO4_EINT_SHIFT 3 /* UV_LDO4_EINT */ | ||
| 305 | #define WM831X_UV_LDO4_EINT_WIDTH 1 /* UV_LDO4_EINT */ | ||
| 306 | #define WM831X_UV_LDO3_EINT 0x0004 /* UV_LDO3_EINT */ | ||
| 307 | #define WM831X_UV_LDO3_EINT_MASK 0x0004 /* UV_LDO3_EINT */ | ||
| 308 | #define WM831X_UV_LDO3_EINT_SHIFT 2 /* UV_LDO3_EINT */ | ||
| 309 | #define WM831X_UV_LDO3_EINT_WIDTH 1 /* UV_LDO3_EINT */ | ||
| 310 | #define WM831X_UV_LDO2_EINT 0x0002 /* UV_LDO2_EINT */ | ||
| 311 | #define WM831X_UV_LDO2_EINT_MASK 0x0002 /* UV_LDO2_EINT */ | ||
| 312 | #define WM831X_UV_LDO2_EINT_SHIFT 1 /* UV_LDO2_EINT */ | ||
| 313 | #define WM831X_UV_LDO2_EINT_WIDTH 1 /* UV_LDO2_EINT */ | ||
| 314 | #define WM831X_UV_LDO1_EINT 0x0001 /* UV_LDO1_EINT */ | ||
| 315 | #define WM831X_UV_LDO1_EINT_MASK 0x0001 /* UV_LDO1_EINT */ | ||
| 316 | #define WM831X_UV_LDO1_EINT_SHIFT 0 /* UV_LDO1_EINT */ | ||
| 317 | #define WM831X_UV_LDO1_EINT_WIDTH 1 /* UV_LDO1_EINT */ | ||
| 318 | |||
| 319 | /* | ||
| 320 | * R16404 (0x4014) - Interrupt Status 4 | ||
| 321 | */ | ||
| 322 | #define WM831X_HC_DC2_EINT 0x0200 /* HC_DC2_EINT */ | ||
| 323 | #define WM831X_HC_DC2_EINT_MASK 0x0200 /* HC_DC2_EINT */ | ||
| 324 | #define WM831X_HC_DC2_EINT_SHIFT 9 /* HC_DC2_EINT */ | ||
| 325 | #define WM831X_HC_DC2_EINT_WIDTH 1 /* HC_DC2_EINT */ | ||
| 326 | #define WM831X_HC_DC1_EINT 0x0100 /* HC_DC1_EINT */ | ||
| 327 | #define WM831X_HC_DC1_EINT_MASK 0x0100 /* HC_DC1_EINT */ | ||
| 328 | #define WM831X_HC_DC1_EINT_SHIFT 8 /* HC_DC1_EINT */ | ||
| 329 | #define WM831X_HC_DC1_EINT_WIDTH 1 /* HC_DC1_EINT */ | ||
| 330 | #define WM831X_UV_DC4_EINT 0x0008 /* UV_DC4_EINT */ | ||
| 331 | #define WM831X_UV_DC4_EINT_MASK 0x0008 /* UV_DC4_EINT */ | ||
| 332 | #define WM831X_UV_DC4_EINT_SHIFT 3 /* UV_DC4_EINT */ | ||
| 333 | #define WM831X_UV_DC4_EINT_WIDTH 1 /* UV_DC4_EINT */ | ||
| 334 | #define WM831X_UV_DC3_EINT 0x0004 /* UV_DC3_EINT */ | ||
| 335 | #define WM831X_UV_DC3_EINT_MASK 0x0004 /* UV_DC3_EINT */ | ||
| 336 | #define WM831X_UV_DC3_EINT_SHIFT 2 /* UV_DC3_EINT */ | ||
| 337 | #define WM831X_UV_DC3_EINT_WIDTH 1 /* UV_DC3_EINT */ | ||
| 338 | #define WM831X_UV_DC2_EINT 0x0002 /* UV_DC2_EINT */ | ||
| 339 | #define WM831X_UV_DC2_EINT_MASK 0x0002 /* UV_DC2_EINT */ | ||
| 340 | #define WM831X_UV_DC2_EINT_SHIFT 1 /* UV_DC2_EINT */ | ||
| 341 | #define WM831X_UV_DC2_EINT_WIDTH 1 /* UV_DC2_EINT */ | ||
| 342 | #define WM831X_UV_DC1_EINT 0x0001 /* UV_DC1_EINT */ | ||
| 343 | #define WM831X_UV_DC1_EINT_MASK 0x0001 /* UV_DC1_EINT */ | ||
| 344 | #define WM831X_UV_DC1_EINT_SHIFT 0 /* UV_DC1_EINT */ | ||
| 345 | #define WM831X_UV_DC1_EINT_WIDTH 1 /* UV_DC1_EINT */ | ||
| 346 | |||
| 347 | /* | ||
| 348 | * R16405 (0x4015) - Interrupt Status 5 | ||
| 349 | */ | ||
| 350 | #define WM831X_GP16_EINT 0x8000 /* GP16_EINT */ | ||
| 351 | #define WM831X_GP16_EINT_MASK 0x8000 /* GP16_EINT */ | ||
| 352 | #define WM831X_GP16_EINT_SHIFT 15 /* GP16_EINT */ | ||
| 353 | #define WM831X_GP16_EINT_WIDTH 1 /* GP16_EINT */ | ||
| 354 | #define WM831X_GP15_EINT 0x4000 /* GP15_EINT */ | ||
| 355 | #define WM831X_GP15_EINT_MASK 0x4000 /* GP15_EINT */ | ||
| 356 | #define WM831X_GP15_EINT_SHIFT 14 /* GP15_EINT */ | ||
| 357 | #define WM831X_GP15_EINT_WIDTH 1 /* GP15_EINT */ | ||
| 358 | #define WM831X_GP14_EINT 0x2000 /* GP14_EINT */ | ||
| 359 | #define WM831X_GP14_EINT_MASK 0x2000 /* GP14_EINT */ | ||
| 360 | #define WM831X_GP14_EINT_SHIFT 13 /* GP14_EINT */ | ||
| 361 | #define WM831X_GP14_EINT_WIDTH 1 /* GP14_EINT */ | ||
| 362 | #define WM831X_GP13_EINT 0x1000 /* GP13_EINT */ | ||
| 363 | #define WM831X_GP13_EINT_MASK 0x1000 /* GP13_EINT */ | ||
| 364 | #define WM831X_GP13_EINT_SHIFT 12 /* GP13_EINT */ | ||
| 365 | #define WM831X_GP13_EINT_WIDTH 1 /* GP13_EINT */ | ||
| 366 | #define WM831X_GP12_EINT 0x0800 /* GP12_EINT */ | ||
| 367 | #define WM831X_GP12_EINT_MASK 0x0800 /* GP12_EINT */ | ||
| 368 | #define WM831X_GP12_EINT_SHIFT 11 /* GP12_EINT */ | ||
| 369 | #define WM831X_GP12_EINT_WIDTH 1 /* GP12_EINT */ | ||
| 370 | #define WM831X_GP11_EINT 0x0400 /* GP11_EINT */ | ||
| 371 | #define WM831X_GP11_EINT_MASK 0x0400 /* GP11_EINT */ | ||
| 372 | #define WM831X_GP11_EINT_SHIFT 10 /* GP11_EINT */ | ||
| 373 | #define WM831X_GP11_EINT_WIDTH 1 /* GP11_EINT */ | ||
| 374 | #define WM831X_GP10_EINT 0x0200 /* GP10_EINT */ | ||
| 375 | #define WM831X_GP10_EINT_MASK 0x0200 /* GP10_EINT */ | ||
| 376 | #define WM831X_GP10_EINT_SHIFT 9 /* GP10_EINT */ | ||
| 377 | #define WM831X_GP10_EINT_WIDTH 1 /* GP10_EINT */ | ||
| 378 | #define WM831X_GP9_EINT 0x0100 /* GP9_EINT */ | ||
| 379 | #define WM831X_GP9_EINT_MASK 0x0100 /* GP9_EINT */ | ||
| 380 | #define WM831X_GP9_EINT_SHIFT 8 /* GP9_EINT */ | ||
| 381 | #define WM831X_GP9_EINT_WIDTH 1 /* GP9_EINT */ | ||
| 382 | #define WM831X_GP8_EINT 0x0080 /* GP8_EINT */ | ||
| 383 | #define WM831X_GP8_EINT_MASK 0x0080 /* GP8_EINT */ | ||
| 384 | #define WM831X_GP8_EINT_SHIFT 7 /* GP8_EINT */ | ||
| 385 | #define WM831X_GP8_EINT_WIDTH 1 /* GP8_EINT */ | ||
| 386 | #define WM831X_GP7_EINT 0x0040 /* GP7_EINT */ | ||
| 387 | #define WM831X_GP7_EINT_MASK 0x0040 /* GP7_EINT */ | ||
| 388 | #define WM831X_GP7_EINT_SHIFT 6 /* GP7_EINT */ | ||
| 389 | #define WM831X_GP7_EINT_WIDTH 1 /* GP7_EINT */ | ||
| 390 | #define WM831X_GP6_EINT 0x0020 /* GP6_EINT */ | ||
| 391 | #define WM831X_GP6_EINT_MASK 0x0020 /* GP6_EINT */ | ||
| 392 | #define WM831X_GP6_EINT_SHIFT 5 /* GP6_EINT */ | ||
| 393 | #define WM831X_GP6_EINT_WIDTH 1 /* GP6_EINT */ | ||
| 394 | #define WM831X_GP5_EINT 0x0010 /* GP5_EINT */ | ||
| 395 | #define WM831X_GP5_EINT_MASK 0x0010 /* GP5_EINT */ | ||
| 396 | #define WM831X_GP5_EINT_SHIFT 4 /* GP5_EINT */ | ||
| 397 | #define WM831X_GP5_EINT_WIDTH 1 /* GP5_EINT */ | ||
| 398 | #define WM831X_GP4_EINT 0x0008 /* GP4_EINT */ | ||
| 399 | #define WM831X_GP4_EINT_MASK 0x0008 /* GP4_EINT */ | ||
| 400 | #define WM831X_GP4_EINT_SHIFT 3 /* GP4_EINT */ | ||
| 401 | #define WM831X_GP4_EINT_WIDTH 1 /* GP4_EINT */ | ||
| 402 | #define WM831X_GP3_EINT 0x0004 /* GP3_EINT */ | ||
| 403 | #define WM831X_GP3_EINT_MASK 0x0004 /* GP3_EINT */ | ||
| 404 | #define WM831X_GP3_EINT_SHIFT 2 /* GP3_EINT */ | ||
| 405 | #define WM831X_GP3_EINT_WIDTH 1 /* GP3_EINT */ | ||
| 406 | #define WM831X_GP2_EINT 0x0002 /* GP2_EINT */ | ||
| 407 | #define WM831X_GP2_EINT_MASK 0x0002 /* GP2_EINT */ | ||
| 408 | #define WM831X_GP2_EINT_SHIFT 1 /* GP2_EINT */ | ||
| 409 | #define WM831X_GP2_EINT_WIDTH 1 /* GP2_EINT */ | ||
| 410 | #define WM831X_GP1_EINT 0x0001 /* GP1_EINT */ | ||
| 411 | #define WM831X_GP1_EINT_MASK 0x0001 /* GP1_EINT */ | ||
| 412 | #define WM831X_GP1_EINT_SHIFT 0 /* GP1_EINT */ | ||
| 413 | #define WM831X_GP1_EINT_WIDTH 1 /* GP1_EINT */ | ||
| 414 | |||
| 415 | /* | ||
| 416 | * R16407 (0x4017) - IRQ Config | ||
| 417 | */ | ||
| 418 | #define WM831X_IRQ_OD 0x0002 /* IRQ_OD */ | ||
| 419 | #define WM831X_IRQ_OD_MASK 0x0002 /* IRQ_OD */ | ||
| 420 | #define WM831X_IRQ_OD_SHIFT 1 /* IRQ_OD */ | ||
| 421 | #define WM831X_IRQ_OD_WIDTH 1 /* IRQ_OD */ | ||
| 422 | #define WM831X_IM_IRQ 0x0001 /* IM_IRQ */ | ||
| 423 | #define WM831X_IM_IRQ_MASK 0x0001 /* IM_IRQ */ | ||
| 424 | #define WM831X_IM_IRQ_SHIFT 0 /* IM_IRQ */ | ||
| 425 | #define WM831X_IM_IRQ_WIDTH 1 /* IM_IRQ */ | ||
| 426 | |||
| 427 | /* | ||
| 428 | * R16408 (0x4018) - System Interrupts Mask | ||
| 429 | */ | ||
| 430 | #define WM831X_IM_PS_INT 0x8000 /* IM_PS_INT */ | ||
| 431 | #define WM831X_IM_PS_INT_MASK 0x8000 /* IM_PS_INT */ | ||
| 432 | #define WM831X_IM_PS_INT_SHIFT 15 /* IM_PS_INT */ | ||
| 433 | #define WM831X_IM_PS_INT_WIDTH 1 /* IM_PS_INT */ | ||
| 434 | #define WM831X_IM_TEMP_INT 0x4000 /* IM_TEMP_INT */ | ||
| 435 | #define WM831X_IM_TEMP_INT_MASK 0x4000 /* IM_TEMP_INT */ | ||
| 436 | #define WM831X_IM_TEMP_INT_SHIFT 14 /* IM_TEMP_INT */ | ||
| 437 | #define WM831X_IM_TEMP_INT_WIDTH 1 /* IM_TEMP_INT */ | ||
| 438 | #define WM831X_IM_GP_INT 0x2000 /* IM_GP_INT */ | ||
| 439 | #define WM831X_IM_GP_INT_MASK 0x2000 /* IM_GP_INT */ | ||
| 440 | #define WM831X_IM_GP_INT_SHIFT 13 /* IM_GP_INT */ | ||
| 441 | #define WM831X_IM_GP_INT_WIDTH 1 /* IM_GP_INT */ | ||
| 442 | #define WM831X_IM_ON_PIN_INT 0x1000 /* IM_ON_PIN_INT */ | ||
| 443 | #define WM831X_IM_ON_PIN_INT_MASK 0x1000 /* IM_ON_PIN_INT */ | ||
| 444 | #define WM831X_IM_ON_PIN_INT_SHIFT 12 /* IM_ON_PIN_INT */ | ||
| 445 | #define WM831X_IM_ON_PIN_INT_WIDTH 1 /* IM_ON_PIN_INT */ | ||
| 446 | #define WM831X_IM_WDOG_INT 0x0800 /* IM_WDOG_INT */ | ||
| 447 | #define WM831X_IM_WDOG_INT_MASK 0x0800 /* IM_WDOG_INT */ | ||
| 448 | #define WM831X_IM_WDOG_INT_SHIFT 11 /* IM_WDOG_INT */ | ||
| 449 | #define WM831X_IM_WDOG_INT_WIDTH 1 /* IM_WDOG_INT */ | ||
| 450 | #define WM831X_IM_TCHDATA_INT 0x0400 /* IM_TCHDATA_INT */ | ||
| 451 | #define WM831X_IM_TCHDATA_INT_MASK 0x0400 /* IM_TCHDATA_INT */ | ||
| 452 | #define WM831X_IM_TCHDATA_INT_SHIFT 10 /* IM_TCHDATA_INT */ | ||
| 453 | #define WM831X_IM_TCHDATA_INT_WIDTH 1 /* IM_TCHDATA_INT */ | ||
| 454 | #define WM831X_IM_TCHPD_INT 0x0200 /* IM_TCHPD_INT */ | ||
| 455 | #define WM831X_IM_TCHPD_INT_MASK 0x0200 /* IM_TCHPD_INT */ | ||
| 456 | #define WM831X_IM_TCHPD_INT_SHIFT 9 /* IM_TCHPD_INT */ | ||
| 457 | #define WM831X_IM_TCHPD_INT_WIDTH 1 /* IM_TCHPD_INT */ | ||
| 458 | #define WM831X_IM_AUXADC_INT 0x0100 /* IM_AUXADC_INT */ | ||
| 459 | #define WM831X_IM_AUXADC_INT_MASK 0x0100 /* IM_AUXADC_INT */ | ||
| 460 | #define WM831X_IM_AUXADC_INT_SHIFT 8 /* IM_AUXADC_INT */ | ||
| 461 | #define WM831X_IM_AUXADC_INT_WIDTH 1 /* IM_AUXADC_INT */ | ||
| 462 | #define WM831X_IM_PPM_INT 0x0080 /* IM_PPM_INT */ | ||
| 463 | #define WM831X_IM_PPM_INT_MASK 0x0080 /* IM_PPM_INT */ | ||
| 464 | #define WM831X_IM_PPM_INT_SHIFT 7 /* IM_PPM_INT */ | ||
| 465 | #define WM831X_IM_PPM_INT_WIDTH 1 /* IM_PPM_INT */ | ||
| 466 | #define WM831X_IM_CS_INT 0x0040 /* IM_CS_INT */ | ||
| 467 | #define WM831X_IM_CS_INT_MASK 0x0040 /* IM_CS_INT */ | ||
| 468 | #define WM831X_IM_CS_INT_SHIFT 6 /* IM_CS_INT */ | ||
| 469 | #define WM831X_IM_CS_INT_WIDTH 1 /* IM_CS_INT */ | ||
| 470 | #define WM831X_IM_RTC_INT 0x0020 /* IM_RTC_INT */ | ||
| 471 | #define WM831X_IM_RTC_INT_MASK 0x0020 /* IM_RTC_INT */ | ||
| 472 | #define WM831X_IM_RTC_INT_SHIFT 5 /* IM_RTC_INT */ | ||
| 473 | #define WM831X_IM_RTC_INT_WIDTH 1 /* IM_RTC_INT */ | ||
| 474 | #define WM831X_IM_OTP_INT 0x0010 /* IM_OTP_INT */ | ||
| 475 | #define WM831X_IM_OTP_INT_MASK 0x0010 /* IM_OTP_INT */ | ||
| 476 | #define WM831X_IM_OTP_INT_SHIFT 4 /* IM_OTP_INT */ | ||
| 477 | #define WM831X_IM_OTP_INT_WIDTH 1 /* IM_OTP_INT */ | ||
| 478 | #define WM831X_IM_CHILD_INT 0x0008 /* IM_CHILD_INT */ | ||
| 479 | #define WM831X_IM_CHILD_INT_MASK 0x0008 /* IM_CHILD_INT */ | ||
| 480 | #define WM831X_IM_CHILD_INT_SHIFT 3 /* IM_CHILD_INT */ | ||
| 481 | #define WM831X_IM_CHILD_INT_WIDTH 1 /* IM_CHILD_INT */ | ||
| 482 | #define WM831X_IM_CHG_INT 0x0004 /* IM_CHG_INT */ | ||
| 483 | #define WM831X_IM_CHG_INT_MASK 0x0004 /* IM_CHG_INT */ | ||
| 484 | #define WM831X_IM_CHG_INT_SHIFT 2 /* IM_CHG_INT */ | ||
| 485 | #define WM831X_IM_CHG_INT_WIDTH 1 /* IM_CHG_INT */ | ||
| 486 | #define WM831X_IM_HC_INT 0x0002 /* IM_HC_INT */ | ||
| 487 | #define WM831X_IM_HC_INT_MASK 0x0002 /* IM_HC_INT */ | ||
| 488 | #define WM831X_IM_HC_INT_SHIFT 1 /* IM_HC_INT */ | ||
| 489 | #define WM831X_IM_HC_INT_WIDTH 1 /* IM_HC_INT */ | ||
| 490 | #define WM831X_IM_UV_INT 0x0001 /* IM_UV_INT */ | ||
| 491 | #define WM831X_IM_UV_INT_MASK 0x0001 /* IM_UV_INT */ | ||
| 492 | #define WM831X_IM_UV_INT_SHIFT 0 /* IM_UV_INT */ | ||
| 493 | #define WM831X_IM_UV_INT_WIDTH 1 /* IM_UV_INT */ | ||
| 494 | |||
| 495 | /* | ||
| 496 | * R16409 (0x4019) - Interrupt Status 1 Mask | ||
| 497 | */ | ||
| 498 | #define WM831X_IM_PPM_SYSLO_EINT 0x8000 /* IM_PPM_SYSLO_EINT */ | ||
| 499 | #define WM831X_IM_PPM_SYSLO_EINT_MASK 0x8000 /* IM_PPM_SYSLO_EINT */ | ||
| 500 | #define WM831X_IM_PPM_SYSLO_EINT_SHIFT 15 /* IM_PPM_SYSLO_EINT */ | ||
| 501 | #define WM831X_IM_PPM_SYSLO_EINT_WIDTH 1 /* IM_PPM_SYSLO_EINT */ | ||
| 502 | #define WM831X_IM_PPM_PWR_SRC_EINT 0x4000 /* IM_PPM_PWR_SRC_EINT */ | ||
| 503 | #define WM831X_IM_PPM_PWR_SRC_EINT_MASK 0x4000 /* IM_PPM_PWR_SRC_EINT */ | ||
| 504 | #define WM831X_IM_PPM_PWR_SRC_EINT_SHIFT 14 /* IM_PPM_PWR_SRC_EINT */ | ||
| 505 | #define WM831X_IM_PPM_PWR_SRC_EINT_WIDTH 1 /* IM_PPM_PWR_SRC_EINT */ | ||
| 506 | #define WM831X_IM_PPM_USB_CURR_EINT 0x2000 /* IM_PPM_USB_CURR_EINT */ | ||
| 507 | #define WM831X_IM_PPM_USB_CURR_EINT_MASK 0x2000 /* IM_PPM_USB_CURR_EINT */ | ||
| 508 | #define WM831X_IM_PPM_USB_CURR_EINT_SHIFT 13 /* IM_PPM_USB_CURR_EINT */ | ||
| 509 | #define WM831X_IM_PPM_USB_CURR_EINT_WIDTH 1 /* IM_PPM_USB_CURR_EINT */ | ||
| 510 | #define WM831X_IM_ON_PIN_EINT 0x1000 /* IM_ON_PIN_EINT */ | ||
| 511 | #define WM831X_IM_ON_PIN_EINT_MASK 0x1000 /* IM_ON_PIN_EINT */ | ||
| 512 | #define WM831X_IM_ON_PIN_EINT_SHIFT 12 /* IM_ON_PIN_EINT */ | ||
| 513 | #define WM831X_IM_ON_PIN_EINT_WIDTH 1 /* IM_ON_PIN_EINT */ | ||
| 514 | #define WM831X_IM_WDOG_TO_EINT 0x0800 /* IM_WDOG_TO_EINT */ | ||
| 515 | #define WM831X_IM_WDOG_TO_EINT_MASK 0x0800 /* IM_WDOG_TO_EINT */ | ||
| 516 | #define WM831X_IM_WDOG_TO_EINT_SHIFT 11 /* IM_WDOG_TO_EINT */ | ||
| 517 | #define WM831X_IM_WDOG_TO_EINT_WIDTH 1 /* IM_WDOG_TO_EINT */ | ||
| 518 | #define WM831X_IM_TCHDATA_EINT 0x0400 /* IM_TCHDATA_EINT */ | ||
| 519 | #define WM831X_IM_TCHDATA_EINT_MASK 0x0400 /* IM_TCHDATA_EINT */ | ||
| 520 | #define WM831X_IM_TCHDATA_EINT_SHIFT 10 /* IM_TCHDATA_EINT */ | ||
| 521 | #define WM831X_IM_TCHDATA_EINT_WIDTH 1 /* IM_TCHDATA_EINT */ | ||
| 522 | #define WM831X_IM_TCHPD_EINT 0x0200 /* IM_TCHPD_EINT */ | ||
| 523 | #define WM831X_IM_TCHPD_EINT_MASK 0x0200 /* IM_TCHPD_EINT */ | ||
| 524 | #define WM831X_IM_TCHPD_EINT_SHIFT 9 /* IM_TCHPD_EINT */ | ||
| 525 | #define WM831X_IM_TCHPD_EINT_WIDTH 1 /* IM_TCHPD_EINT */ | ||
| 526 | #define WM831X_IM_AUXADC_DATA_EINT 0x0100 /* IM_AUXADC_DATA_EINT */ | ||
| 527 | #define WM831X_IM_AUXADC_DATA_EINT_MASK 0x0100 /* IM_AUXADC_DATA_EINT */ | ||
| 528 | #define WM831X_IM_AUXADC_DATA_EINT_SHIFT 8 /* IM_AUXADC_DATA_EINT */ | ||
| 529 | #define WM831X_IM_AUXADC_DATA_EINT_WIDTH 1 /* IM_AUXADC_DATA_EINT */ | ||
| 530 | #define WM831X_IM_AUXADC_DCOMP4_EINT 0x0080 /* IM_AUXADC_DCOMP4_EINT */ | ||
| 531 | #define WM831X_IM_AUXADC_DCOMP4_EINT_MASK 0x0080 /* IM_AUXADC_DCOMP4_EINT */ | ||
| 532 | #define WM831X_IM_AUXADC_DCOMP4_EINT_SHIFT 7 /* IM_AUXADC_DCOMP4_EINT */ | ||
| 533 | #define WM831X_IM_AUXADC_DCOMP4_EINT_WIDTH 1 /* IM_AUXADC_DCOMP4_EINT */ | ||
| 534 | #define WM831X_IM_AUXADC_DCOMP3_EINT 0x0040 /* IM_AUXADC_DCOMP3_EINT */ | ||
| 535 | #define WM831X_IM_AUXADC_DCOMP3_EINT_MASK 0x0040 /* IM_AUXADC_DCOMP3_EINT */ | ||
| 536 | #define WM831X_IM_AUXADC_DCOMP3_EINT_SHIFT 6 /* IM_AUXADC_DCOMP3_EINT */ | ||
| 537 | #define WM831X_IM_AUXADC_DCOMP3_EINT_WIDTH 1 /* IM_AUXADC_DCOMP3_EINT */ | ||
| 538 | #define WM831X_IM_AUXADC_DCOMP2_EINT 0x0020 /* IM_AUXADC_DCOMP2_EINT */ | ||
| 539 | #define WM831X_IM_AUXADC_DCOMP2_EINT_MASK 0x0020 /* IM_AUXADC_DCOMP2_EINT */ | ||
| 540 | #define WM831X_IM_AUXADC_DCOMP2_EINT_SHIFT 5 /* IM_AUXADC_DCOMP2_EINT */ | ||
| 541 | #define WM831X_IM_AUXADC_DCOMP2_EINT_WIDTH 1 /* IM_AUXADC_DCOMP2_EINT */ | ||
| 542 | #define WM831X_IM_AUXADC_DCOMP1_EINT 0x0010 /* IM_AUXADC_DCOMP1_EINT */ | ||
| 543 | #define WM831X_IM_AUXADC_DCOMP1_EINT_MASK 0x0010 /* IM_AUXADC_DCOMP1_EINT */ | ||
| 544 | #define WM831X_IM_AUXADC_DCOMP1_EINT_SHIFT 4 /* IM_AUXADC_DCOMP1_EINT */ | ||
| 545 | #define WM831X_IM_AUXADC_DCOMP1_EINT_WIDTH 1 /* IM_AUXADC_DCOMP1_EINT */ | ||
| 546 | #define WM831X_IM_RTC_PER_EINT 0x0008 /* IM_RTC_PER_EINT */ | ||
| 547 | #define WM831X_IM_RTC_PER_EINT_MASK 0x0008 /* IM_RTC_PER_EINT */ | ||
| 548 | #define WM831X_IM_RTC_PER_EINT_SHIFT 3 /* IM_RTC_PER_EINT */ | ||
| 549 | #define WM831X_IM_RTC_PER_EINT_WIDTH 1 /* IM_RTC_PER_EINT */ | ||
| 550 | #define WM831X_IM_RTC_ALM_EINT 0x0004 /* IM_RTC_ALM_EINT */ | ||
| 551 | #define WM831X_IM_RTC_ALM_EINT_MASK 0x0004 /* IM_RTC_ALM_EINT */ | ||
| 552 | #define WM831X_IM_RTC_ALM_EINT_SHIFT 2 /* IM_RTC_ALM_EINT */ | ||
| 553 | #define WM831X_IM_RTC_ALM_EINT_WIDTH 1 /* IM_RTC_ALM_EINT */ | ||
| 554 | #define WM831X_IM_TEMP_THW_EINT 0x0002 /* IM_TEMP_THW_EINT */ | ||
| 555 | #define WM831X_IM_TEMP_THW_EINT_MASK 0x0002 /* IM_TEMP_THW_EINT */ | ||
| 556 | #define WM831X_IM_TEMP_THW_EINT_SHIFT 1 /* IM_TEMP_THW_EINT */ | ||
| 557 | #define WM831X_IM_TEMP_THW_EINT_WIDTH 1 /* IM_TEMP_THW_EINT */ | ||
| 558 | |||
| 559 | /* | ||
| 560 | * R16410 (0x401A) - Interrupt Status 2 Mask | ||
| 561 | */ | ||
| 562 | #define WM831X_IM_CHG_BATT_HOT_EINT 0x8000 /* IM_CHG_BATT_HOT_EINT */ | ||
| 563 | #define WM831X_IM_CHG_BATT_HOT_EINT_MASK 0x8000 /* IM_CHG_BATT_HOT_EINT */ | ||
| 564 | #define WM831X_IM_CHG_BATT_HOT_EINT_SHIFT 15 /* IM_CHG_BATT_HOT_EINT */ | ||
| 565 | #define WM831X_IM_CHG_BATT_HOT_EINT_WIDTH 1 /* IM_CHG_BATT_HOT_EINT */ | ||
| 566 | #define WM831X_IM_CHG_BATT_COLD_EINT 0x4000 /* IM_CHG_BATT_COLD_EINT */ | ||
| 567 | #define WM831X_IM_CHG_BATT_COLD_EINT_MASK 0x4000 /* IM_CHG_BATT_COLD_EINT */ | ||
| 568 | #define WM831X_IM_CHG_BATT_COLD_EINT_SHIFT 14 /* IM_CHG_BATT_COLD_EINT */ | ||
| 569 | #define WM831X_IM_CHG_BATT_COLD_EINT_WIDTH 1 /* IM_CHG_BATT_COLD_EINT */ | ||
| 570 | #define WM831X_IM_CHG_BATT_FAIL_EINT 0x2000 /* IM_CHG_BATT_FAIL_EINT */ | ||
| 571 | #define WM831X_IM_CHG_BATT_FAIL_EINT_MASK 0x2000 /* IM_CHG_BATT_FAIL_EINT */ | ||
| 572 | #define WM831X_IM_CHG_BATT_FAIL_EINT_SHIFT 13 /* IM_CHG_BATT_FAIL_EINT */ | ||
| 573 | #define WM831X_IM_CHG_BATT_FAIL_EINT_WIDTH 1 /* IM_CHG_BATT_FAIL_EINT */ | ||
| 574 | #define WM831X_IM_CHG_OV_EINT 0x1000 /* IM_CHG_OV_EINT */ | ||
| 575 | #define WM831X_IM_CHG_OV_EINT_MASK 0x1000 /* IM_CHG_OV_EINT */ | ||
| 576 | #define WM831X_IM_CHG_OV_EINT_SHIFT 12 /* IM_CHG_OV_EINT */ | ||
| 577 | #define WM831X_IM_CHG_OV_EINT_WIDTH 1 /* IM_CHG_OV_EINT */ | ||
| 578 | #define WM831X_IM_CHG_END_EINT 0x0800 /* IM_CHG_END_EINT */ | ||
| 579 | #define WM831X_IM_CHG_END_EINT_MASK 0x0800 /* IM_CHG_END_EINT */ | ||
| 580 | #define WM831X_IM_CHG_END_EINT_SHIFT 11 /* IM_CHG_END_EINT */ | ||
| 581 | #define WM831X_IM_CHG_END_EINT_WIDTH 1 /* IM_CHG_END_EINT */ | ||
| 582 | #define WM831X_IM_CHG_TO_EINT 0x0400 /* IM_CHG_TO_EINT */ | ||
| 583 | #define WM831X_IM_CHG_TO_EINT_MASK 0x0400 /* IM_CHG_TO_EINT */ | ||
| 584 | #define WM831X_IM_CHG_TO_EINT_SHIFT 10 /* IM_CHG_TO_EINT */ | ||
| 585 | #define WM831X_IM_CHG_TO_EINT_WIDTH 1 /* IM_CHG_TO_EINT */ | ||
| 586 | #define WM831X_IM_CHG_MODE_EINT 0x0200 /* IM_CHG_MODE_EINT */ | ||
| 587 | #define WM831X_IM_CHG_MODE_EINT_MASK 0x0200 /* IM_CHG_MODE_EINT */ | ||
| 588 | #define WM831X_IM_CHG_MODE_EINT_SHIFT 9 /* IM_CHG_MODE_EINT */ | ||
| 589 | #define WM831X_IM_CHG_MODE_EINT_WIDTH 1 /* IM_CHG_MODE_EINT */ | ||
| 590 | #define WM831X_IM_CHG_START_EINT 0x0100 /* IM_CHG_START_EINT */ | ||
| 591 | #define WM831X_IM_CHG_START_EINT_MASK 0x0100 /* IM_CHG_START_EINT */ | ||
| 592 | #define WM831X_IM_CHG_START_EINT_SHIFT 8 /* IM_CHG_START_EINT */ | ||
| 593 | #define WM831X_IM_CHG_START_EINT_WIDTH 1 /* IM_CHG_START_EINT */ | ||
| 594 | #define WM831X_IM_CS2_EINT 0x0080 /* IM_CS2_EINT */ | ||
| 595 | #define WM831X_IM_CS2_EINT_MASK 0x0080 /* IM_CS2_EINT */ | ||
| 596 | #define WM831X_IM_CS2_EINT_SHIFT 7 /* IM_CS2_EINT */ | ||
| 597 | #define WM831X_IM_CS2_EINT_WIDTH 1 /* IM_CS2_EINT */ | ||
| 598 | #define WM831X_IM_CS1_EINT 0x0040 /* IM_CS1_EINT */ | ||
| 599 | #define WM831X_IM_CS1_EINT_MASK 0x0040 /* IM_CS1_EINT */ | ||
| 600 | #define WM831X_IM_CS1_EINT_SHIFT 6 /* IM_CS1_EINT */ | ||
| 601 | #define WM831X_IM_CS1_EINT_WIDTH 1 /* IM_CS1_EINT */ | ||
| 602 | #define WM831X_IM_OTP_CMD_END_EINT 0x0020 /* IM_OTP_CMD_END_EINT */ | ||
| 603 | #define WM831X_IM_OTP_CMD_END_EINT_MASK 0x0020 /* IM_OTP_CMD_END_EINT */ | ||
| 604 | #define WM831X_IM_OTP_CMD_END_EINT_SHIFT 5 /* IM_OTP_CMD_END_EINT */ | ||
| 605 | #define WM831X_IM_OTP_CMD_END_EINT_WIDTH 1 /* IM_OTP_CMD_END_EINT */ | ||
| 606 | #define WM831X_IM_OTP_ERR_EINT 0x0010 /* IM_OTP_ERR_EINT */ | ||
| 607 | #define WM831X_IM_OTP_ERR_EINT_MASK 0x0010 /* IM_OTP_ERR_EINT */ | ||
| 608 | #define WM831X_IM_OTP_ERR_EINT_SHIFT 4 /* IM_OTP_ERR_EINT */ | ||
| 609 | #define WM831X_IM_OTP_ERR_EINT_WIDTH 1 /* IM_OTP_ERR_EINT */ | ||
| 610 | #define WM831X_IM_PS_POR_EINT 0x0004 /* IM_PS_POR_EINT */ | ||
| 611 | #define WM831X_IM_PS_POR_EINT_MASK 0x0004 /* IM_PS_POR_EINT */ | ||
| 612 | #define WM831X_IM_PS_POR_EINT_SHIFT 2 /* IM_PS_POR_EINT */ | ||
| 613 | #define WM831X_IM_PS_POR_EINT_WIDTH 1 /* IM_PS_POR_EINT */ | ||
| 614 | #define WM831X_IM_PS_SLEEP_OFF_EINT 0x0002 /* IM_PS_SLEEP_OFF_EINT */ | ||
| 615 | #define WM831X_IM_PS_SLEEP_OFF_EINT_MASK 0x0002 /* IM_PS_SLEEP_OFF_EINT */ | ||
| 616 | #define WM831X_IM_PS_SLEEP_OFF_EINT_SHIFT 1 /* IM_PS_SLEEP_OFF_EINT */ | ||
| 617 | #define WM831X_IM_PS_SLEEP_OFF_EINT_WIDTH 1 /* IM_PS_SLEEP_OFF_EINT */ | ||
| 618 | #define WM831X_IM_PS_ON_WAKE_EINT 0x0001 /* IM_PS_ON_WAKE_EINT */ | ||
| 619 | #define WM831X_IM_PS_ON_WAKE_EINT_MASK 0x0001 /* IM_PS_ON_WAKE_EINT */ | ||
| 620 | #define WM831X_IM_PS_ON_WAKE_EINT_SHIFT 0 /* IM_PS_ON_WAKE_EINT */ | ||
| 621 | #define WM831X_IM_PS_ON_WAKE_EINT_WIDTH 1 /* IM_PS_ON_WAKE_EINT */ | ||
| 622 | |||
| 623 | /* | ||
| 624 | * R16411 (0x401B) - Interrupt Status 3 Mask | ||
| 625 | */ | ||
| 626 | #define WM831X_IM_UV_LDO10_EINT 0x0200 /* IM_UV_LDO10_EINT */ | ||
| 627 | #define WM831X_IM_UV_LDO10_EINT_MASK 0x0200 /* IM_UV_LDO10_EINT */ | ||
| 628 | #define WM831X_IM_UV_LDO10_EINT_SHIFT 9 /* IM_UV_LDO10_EINT */ | ||
| 629 | #define WM831X_IM_UV_LDO10_EINT_WIDTH 1 /* IM_UV_LDO10_EINT */ | ||
| 630 | #define WM831X_IM_UV_LDO9_EINT 0x0100 /* IM_UV_LDO9_EINT */ | ||
| 631 | #define WM831X_IM_UV_LDO9_EINT_MASK 0x0100 /* IM_UV_LDO9_EINT */ | ||
| 632 | #define WM831X_IM_UV_LDO9_EINT_SHIFT 8 /* IM_UV_LDO9_EINT */ | ||
| 633 | #define WM831X_IM_UV_LDO9_EINT_WIDTH 1 /* IM_UV_LDO9_EINT */ | ||
| 634 | #define WM831X_IM_UV_LDO8_EINT 0x0080 /* IM_UV_LDO8_EINT */ | ||
| 635 | #define WM831X_IM_UV_LDO8_EINT_MASK 0x0080 /* IM_UV_LDO8_EINT */ | ||
| 636 | #define WM831X_IM_UV_LDO8_EINT_SHIFT 7 /* IM_UV_LDO8_EINT */ | ||
| 637 | #define WM831X_IM_UV_LDO8_EINT_WIDTH 1 /* IM_UV_LDO8_EINT */ | ||
| 638 | #define WM831X_IM_UV_LDO7_EINT 0x0040 /* IM_UV_LDO7_EINT */ | ||
| 639 | #define WM831X_IM_UV_LDO7_EINT_MASK 0x0040 /* IM_UV_LDO7_EINT */ | ||
| 640 | #define WM831X_IM_UV_LDO7_EINT_SHIFT 6 /* IM_UV_LDO7_EINT */ | ||
| 641 | #define WM831X_IM_UV_LDO7_EINT_WIDTH 1 /* IM_UV_LDO7_EINT */ | ||
| 642 | #define WM831X_IM_UV_LDO6_EINT 0x0020 /* IM_UV_LDO6_EINT */ | ||
| 643 | #define WM831X_IM_UV_LDO6_EINT_MASK 0x0020 /* IM_UV_LDO6_EINT */ | ||
| 644 | #define WM831X_IM_UV_LDO6_EINT_SHIFT 5 /* IM_UV_LDO6_EINT */ | ||
| 645 | #define WM831X_IM_UV_LDO6_EINT_WIDTH 1 /* IM_UV_LDO6_EINT */ | ||
| 646 | #define WM831X_IM_UV_LDO5_EINT 0x0010 /* IM_UV_LDO5_EINT */ | ||
| 647 | #define WM831X_IM_UV_LDO5_EINT_MASK 0x0010 /* IM_UV_LDO5_EINT */ | ||
| 648 | #define WM831X_IM_UV_LDO5_EINT_SHIFT 4 /* IM_UV_LDO5_EINT */ | ||
| 649 | #define WM831X_IM_UV_LDO5_EINT_WIDTH 1 /* IM_UV_LDO5_EINT */ | ||
| 650 | #define WM831X_IM_UV_LDO4_EINT 0x0008 /* IM_UV_LDO4_EINT */ | ||
| 651 | #define WM831X_IM_UV_LDO4_EINT_MASK 0x0008 /* IM_UV_LDO4_EINT */ | ||
| 652 | #define WM831X_IM_UV_LDO4_EINT_SHIFT 3 /* IM_UV_LDO4_EINT */ | ||
| 653 | #define WM831X_IM_UV_LDO4_EINT_WIDTH 1 /* IM_UV_LDO4_EINT */ | ||
| 654 | #define WM831X_IM_UV_LDO3_EINT 0x0004 /* IM_UV_LDO3_EINT */ | ||
| 655 | #define WM831X_IM_UV_LDO3_EINT_MASK 0x0004 /* IM_UV_LDO3_EINT */ | ||
| 656 | #define WM831X_IM_UV_LDO3_EINT_SHIFT 2 /* IM_UV_LDO3_EINT */ | ||
| 657 | #define WM831X_IM_UV_LDO3_EINT_WIDTH 1 /* IM_UV_LDO3_EINT */ | ||
| 658 | #define WM831X_IM_UV_LDO2_EINT 0x0002 /* IM_UV_LDO2_EINT */ | ||
| 659 | #define WM831X_IM_UV_LDO2_EINT_MASK 0x0002 /* IM_UV_LDO2_EINT */ | ||
| 660 | #define WM831X_IM_UV_LDO2_EINT_SHIFT 1 /* IM_UV_LDO2_EINT */ | ||
| 661 | #define WM831X_IM_UV_LDO2_EINT_WIDTH 1 /* IM_UV_LDO2_EINT */ | ||
| 662 | #define WM831X_IM_UV_LDO1_EINT 0x0001 /* IM_UV_LDO1_EINT */ | ||
| 663 | #define WM831X_IM_UV_LDO1_EINT_MASK 0x0001 /* IM_UV_LDO1_EINT */ | ||
| 664 | #define WM831X_IM_UV_LDO1_EINT_SHIFT 0 /* IM_UV_LDO1_EINT */ | ||
| 665 | #define WM831X_IM_UV_LDO1_EINT_WIDTH 1 /* IM_UV_LDO1_EINT */ | ||
| 666 | |||
| 667 | /* | ||
| 668 | * R16412 (0x401C) - Interrupt Status 4 Mask | ||
| 669 | */ | ||
| 670 | #define WM831X_IM_HC_DC2_EINT 0x0200 /* IM_HC_DC2_EINT */ | ||
| 671 | #define WM831X_IM_HC_DC2_EINT_MASK 0x0200 /* IM_HC_DC2_EINT */ | ||
| 672 | #define WM831X_IM_HC_DC2_EINT_SHIFT 9 /* IM_HC_DC2_EINT */ | ||
| 673 | #define WM831X_IM_HC_DC2_EINT_WIDTH 1 /* IM_HC_DC2_EINT */ | ||
| 674 | #define WM831X_IM_HC_DC1_EINT 0x0100 /* IM_HC_DC1_EINT */ | ||
| 675 | #define WM831X_IM_HC_DC1_EINT_MASK 0x0100 /* IM_HC_DC1_EINT */ | ||
| 676 | #define WM831X_IM_HC_DC1_EINT_SHIFT 8 /* IM_HC_DC1_EINT */ | ||
| 677 | #define WM831X_IM_HC_DC1_EINT_WIDTH 1 /* IM_HC_DC1_EINT */ | ||
| 678 | #define WM831X_IM_UV_DC4_EINT 0x0008 /* IM_UV_DC4_EINT */ | ||
| 679 | #define WM831X_IM_UV_DC4_EINT_MASK 0x0008 /* IM_UV_DC4_EINT */ | ||
| 680 | #define WM831X_IM_UV_DC4_EINT_SHIFT 3 /* IM_UV_DC4_EINT */ | ||
| 681 | #define WM831X_IM_UV_DC4_EINT_WIDTH 1 /* IM_UV_DC4_EINT */ | ||
| 682 | #define WM831X_IM_UV_DC3_EINT 0x0004 /* IM_UV_DC3_EINT */ | ||
| 683 | #define WM831X_IM_UV_DC3_EINT_MASK 0x0004 /* IM_UV_DC3_EINT */ | ||
| 684 | #define WM831X_IM_UV_DC3_EINT_SHIFT 2 /* IM_UV_DC3_EINT */ | ||
| 685 | #define WM831X_IM_UV_DC3_EINT_WIDTH 1 /* IM_UV_DC3_EINT */ | ||
| 686 | #define WM831X_IM_UV_DC2_EINT 0x0002 /* IM_UV_DC2_EINT */ | ||
| 687 | #define WM831X_IM_UV_DC2_EINT_MASK 0x0002 /* IM_UV_DC2_EINT */ | ||
| 688 | #define WM831X_IM_UV_DC2_EINT_SHIFT 1 /* IM_UV_DC2_EINT */ | ||
| 689 | #define WM831X_IM_UV_DC2_EINT_WIDTH 1 /* IM_UV_DC2_EINT */ | ||
| 690 | #define WM831X_IM_UV_DC1_EINT 0x0001 /* IM_UV_DC1_EINT */ | ||
| 691 | #define WM831X_IM_UV_DC1_EINT_MASK 0x0001 /* IM_UV_DC1_EINT */ | ||
| 692 | #define WM831X_IM_UV_DC1_EINT_SHIFT 0 /* IM_UV_DC1_EINT */ | ||
| 693 | #define WM831X_IM_UV_DC1_EINT_WIDTH 1 /* IM_UV_DC1_EINT */ | ||
| 694 | |||
| 695 | /* | ||
| 696 | * R16413 (0x401D) - Interrupt Status 5 Mask | ||
| 697 | */ | ||
| 698 | #define WM831X_IM_GP16_EINT 0x8000 /* IM_GP16_EINT */ | ||
| 699 | #define WM831X_IM_GP16_EINT_MASK 0x8000 /* IM_GP16_EINT */ | ||
| 700 | #define WM831X_IM_GP16_EINT_SHIFT 15 /* IM_GP16_EINT */ | ||
| 701 | #define WM831X_IM_GP16_EINT_WIDTH 1 /* IM_GP16_EINT */ | ||
| 702 | #define WM831X_IM_GP15_EINT 0x4000 /* IM_GP15_EINT */ | ||
| 703 | #define WM831X_IM_GP15_EINT_MASK 0x4000 /* IM_GP15_EINT */ | ||
| 704 | #define WM831X_IM_GP15_EINT_SHIFT 14 /* IM_GP15_EINT */ | ||
| 705 | #define WM831X_IM_GP15_EINT_WIDTH 1 /* IM_GP15_EINT */ | ||
| 706 | #define WM831X_IM_GP14_EINT 0x2000 /* IM_GP14_EINT */ | ||
| 707 | #define WM831X_IM_GP14_EINT_MASK 0x2000 /* IM_GP14_EINT */ | ||
| 708 | #define WM831X_IM_GP14_EINT_SHIFT 13 /* IM_GP14_EINT */ | ||
| 709 | #define WM831X_IM_GP14_EINT_WIDTH 1 /* IM_GP14_EINT */ | ||
| 710 | #define WM831X_IM_GP13_EINT 0x1000 /* IM_GP13_EINT */ | ||
| 711 | #define WM831X_IM_GP13_EINT_MASK 0x1000 /* IM_GP13_EINT */ | ||
| 712 | #define WM831X_IM_GP13_EINT_SHIFT 12 /* IM_GP13_EINT */ | ||
| 713 | #define WM831X_IM_GP13_EINT_WIDTH 1 /* IM_GP13_EINT */ | ||
| 714 | #define WM831X_IM_GP12_EINT 0x0800 /* IM_GP12_EINT */ | ||
| 715 | #define WM831X_IM_GP12_EINT_MASK 0x0800 /* IM_GP12_EINT */ | ||
| 716 | #define WM831X_IM_GP12_EINT_SHIFT 11 /* IM_GP12_EINT */ | ||
| 717 | #define WM831X_IM_GP12_EINT_WIDTH 1 /* IM_GP12_EINT */ | ||
| 718 | #define WM831X_IM_GP11_EINT 0x0400 /* IM_GP11_EINT */ | ||
| 719 | #define WM831X_IM_GP11_EINT_MASK 0x0400 /* IM_GP11_EINT */ | ||
| 720 | #define WM831X_IM_GP11_EINT_SHIFT 10 /* IM_GP11_EINT */ | ||
| 721 | #define WM831X_IM_GP11_EINT_WIDTH 1 /* IM_GP11_EINT */ | ||
| 722 | #define WM831X_IM_GP10_EINT 0x0200 /* IM_GP10_EINT */ | ||
| 723 | #define WM831X_IM_GP10_EINT_MASK 0x0200 /* IM_GP10_EINT */ | ||
| 724 | #define WM831X_IM_GP10_EINT_SHIFT 9 /* IM_GP10_EINT */ | ||
| 725 | #define WM831X_IM_GP10_EINT_WIDTH 1 /* IM_GP10_EINT */ | ||
| 726 | #define WM831X_IM_GP9_EINT 0x0100 /* IM_GP9_EINT */ | ||
| 727 | #define WM831X_IM_GP9_EINT_MASK 0x0100 /* IM_GP9_EINT */ | ||
| 728 | #define WM831X_IM_GP9_EINT_SHIFT 8 /* IM_GP9_EINT */ | ||
| 729 | #define WM831X_IM_GP9_EINT_WIDTH 1 /* IM_GP9_EINT */ | ||
| 730 | #define WM831X_IM_GP8_EINT 0x0080 /* IM_GP8_EINT */ | ||
| 731 | #define WM831X_IM_GP8_EINT_MASK 0x0080 /* IM_GP8_EINT */ | ||
| 732 | #define WM831X_IM_GP8_EINT_SHIFT 7 /* IM_GP8_EINT */ | ||
| 733 | #define WM831X_IM_GP8_EINT_WIDTH 1 /* IM_GP8_EINT */ | ||
| 734 | #define WM831X_IM_GP7_EINT 0x0040 /* IM_GP7_EINT */ | ||
| 735 | #define WM831X_IM_GP7_EINT_MASK 0x0040 /* IM_GP7_EINT */ | ||
| 736 | #define WM831X_IM_GP7_EINT_SHIFT 6 /* IM_GP7_EINT */ | ||
| 737 | #define WM831X_IM_GP7_EINT_WIDTH 1 /* IM_GP7_EINT */ | ||
| 738 | #define WM831X_IM_GP6_EINT 0x0020 /* IM_GP6_EINT */ | ||
| 739 | #define WM831X_IM_GP6_EINT_MASK 0x0020 /* IM_GP6_EINT */ | ||
| 740 | #define WM831X_IM_GP6_EINT_SHIFT 5 /* IM_GP6_EINT */ | ||
| 741 | #define WM831X_IM_GP6_EINT_WIDTH 1 /* IM_GP6_EINT */ | ||
| 742 | #define WM831X_IM_GP5_EINT 0x0010 /* IM_GP5_EINT */ | ||
| 743 | #define WM831X_IM_GP5_EINT_MASK 0x0010 /* IM_GP5_EINT */ | ||
| 744 | #define WM831X_IM_GP5_EINT_SHIFT 4 /* IM_GP5_EINT */ | ||
| 745 | #define WM831X_IM_GP5_EINT_WIDTH 1 /* IM_GP5_EINT */ | ||
| 746 | #define WM831X_IM_GP4_EINT 0x0008 /* IM_GP4_EINT */ | ||
| 747 | #define WM831X_IM_GP4_EINT_MASK 0x0008 /* IM_GP4_EINT */ | ||
| 748 | #define WM831X_IM_GP4_EINT_SHIFT 3 /* IM_GP4_EINT */ | ||
| 749 | #define WM831X_IM_GP4_EINT_WIDTH 1 /* IM_GP4_EINT */ | ||
| 750 | #define WM831X_IM_GP3_EINT 0x0004 /* IM_GP3_EINT */ | ||
| 751 | #define WM831X_IM_GP3_EINT_MASK 0x0004 /* IM_GP3_EINT */ | ||
| 752 | #define WM831X_IM_GP3_EINT_SHIFT 2 /* IM_GP3_EINT */ | ||
| 753 | #define WM831X_IM_GP3_EINT_WIDTH 1 /* IM_GP3_EINT */ | ||
| 754 | #define WM831X_IM_GP2_EINT 0x0002 /* IM_GP2_EINT */ | ||
| 755 | #define WM831X_IM_GP2_EINT_MASK 0x0002 /* IM_GP2_EINT */ | ||
| 756 | #define WM831X_IM_GP2_EINT_SHIFT 1 /* IM_GP2_EINT */ | ||
| 757 | #define WM831X_IM_GP2_EINT_WIDTH 1 /* IM_GP2_EINT */ | ||
| 758 | #define WM831X_IM_GP1_EINT 0x0001 /* IM_GP1_EINT */ | ||
| 759 | #define WM831X_IM_GP1_EINT_MASK 0x0001 /* IM_GP1_EINT */ | ||
| 760 | #define WM831X_IM_GP1_EINT_SHIFT 0 /* IM_GP1_EINT */ | ||
| 761 | #define WM831X_IM_GP1_EINT_WIDTH 1 /* IM_GP1_EINT */ | ||
| 762 | |||
| 763 | |||
| 764 | #endif | ||
diff --git a/include/linux/mfd/wm831x/otp.h b/include/linux/mfd/wm831x/otp.h new file mode 100644 index 000000000000..ce1f81a39bfc --- /dev/null +++ b/include/linux/mfd/wm831x/otp.h | |||
| @@ -0,0 +1,162 @@ | |||
| 1 | /* | ||
| 2 | * include/linux/mfd/wm831x/otp.h -- OTP interface for WM831x | ||
| 3 | * | ||
| 4 | * Copyright 2009 Wolfson Microelectronics PLC. | ||
| 5 | * | ||
| 6 | * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify it | ||
| 9 | * under the terms of the GNU General Public License as published by the | ||
| 10 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 11 | * option) any later version. | ||
| 12 | * | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef __MFD_WM831X_OTP_H__ | ||
| 16 | #define __MFD_WM831X_OTP_H__ | ||
| 17 | |||
| 18 | int wm831x_otp_init(struct wm831x *wm831x); | ||
| 19 | void wm831x_otp_exit(struct wm831x *wm831x); | ||
| 20 | |||
| 21 | /* | ||
| 22 | * R30720 (0x7800) - Unique ID 1 | ||
| 23 | */ | ||
| 24 | #define WM831X_UNIQUE_ID_MASK 0xFFFF /* UNIQUE_ID - [15:0] */ | ||
| 25 | #define WM831X_UNIQUE_ID_SHIFT 0 /* UNIQUE_ID - [15:0] */ | ||
| 26 | #define WM831X_UNIQUE_ID_WIDTH 16 /* UNIQUE_ID - [15:0] */ | ||
| 27 | |||
| 28 | /* | ||
| 29 | * R30721 (0x7801) - Unique ID 2 | ||
| 30 | */ | ||
| 31 | #define WM831X_UNIQUE_ID_MASK 0xFFFF /* UNIQUE_ID - [15:0] */ | ||
| 32 | #define WM831X_UNIQUE_ID_SHIFT 0 /* UNIQUE_ID - [15:0] */ | ||
| 33 | #define WM831X_UNIQUE_ID_WIDTH 16 /* UNIQUE_ID - [15:0] */ | ||
| 34 | |||
| 35 | /* | ||
| 36 | * R30722 (0x7802) - Unique ID 3 | ||
| 37 | */ | ||
| 38 | #define WM831X_UNIQUE_ID_MASK 0xFFFF /* UNIQUE_ID - [15:0] */ | ||
| 39 | #define WM831X_UNIQUE_ID_SHIFT 0 /* UNIQUE_ID - [15:0] */ | ||
| 40 | #define WM831X_UNIQUE_ID_WIDTH 16 /* UNIQUE_ID - [15:0] */ | ||
| 41 | |||
| 42 | /* | ||
| 43 | * R30723 (0x7803) - Unique ID 4 | ||
| 44 | */ | ||
| 45 | #define WM831X_UNIQUE_ID_MASK 0xFFFF /* UNIQUE_ID - [15:0] */ | ||
| 46 | #define WM831X_UNIQUE_ID_SHIFT 0 /* UNIQUE_ID - [15:0] */ | ||
| 47 | #define WM831X_UNIQUE_ID_WIDTH 16 /* UNIQUE_ID - [15:0] */ | ||
| 48 | |||
| 49 | /* | ||
| 50 | * R30724 (0x7804) - Unique ID 5 | ||
| 51 | */ | ||
| 52 | #define WM831X_UNIQUE_ID_MASK 0xFFFF /* UNIQUE_ID - [15:0] */ | ||
| 53 | #define WM831X_UNIQUE_ID_SHIFT 0 /* UNIQUE_ID - [15:0] */ | ||
| 54 | #define WM831X_UNIQUE_ID_WIDTH 16 /* UNIQUE_ID - [15:0] */ | ||
| 55 | |||
| 56 | /* | ||
| 57 | * R30725 (0x7805) - Unique ID 6 | ||
| 58 | */ | ||
| 59 | #define WM831X_UNIQUE_ID_MASK 0xFFFF /* UNIQUE_ID - [15:0] */ | ||
| 60 | #define WM831X_UNIQUE_ID_SHIFT 0 /* UNIQUE_ID - [15:0] */ | ||
| 61 | #define WM831X_UNIQUE_ID_WIDTH 16 /* UNIQUE_ID - [15:0] */ | ||
| 62 | |||
| 63 | /* | ||
| 64 | * R30726 (0x7806) - Unique ID 7 | ||
| 65 | */ | ||
| 66 | #define WM831X_UNIQUE_ID_MASK 0xFFFF /* UNIQUE_ID - [15:0] */ | ||
| 67 | #define WM831X_UNIQUE_ID_SHIFT 0 /* UNIQUE_ID - [15:0] */ | ||
| 68 | #define WM831X_UNIQUE_ID_WIDTH 16 /* UNIQUE_ID - [15:0] */ | ||
| 69 | |||
| 70 | /* | ||
| 71 | * R30727 (0x7807) - Unique ID 8 | ||
| 72 | */ | ||
| 73 | #define WM831X_UNIQUE_ID_MASK 0xFFFF /* UNIQUE_ID - [15:0] */ | ||
| 74 | #define WM831X_UNIQUE_ID_SHIFT 0 /* UNIQUE_ID - [15:0] */ | ||
| 75 | #define WM831X_UNIQUE_ID_WIDTH 16 /* UNIQUE_ID - [15:0] */ | ||
| 76 | |||
| 77 | /* | ||
| 78 | * R30728 (0x7808) - Factory OTP ID | ||
| 79 | */ | ||
| 80 | #define WM831X_OTP_FACT_ID_MASK 0xFFFE /* OTP_FACT_ID - [15:1] */ | ||
| 81 | #define WM831X_OTP_FACT_ID_SHIFT 1 /* OTP_FACT_ID - [15:1] */ | ||
| 82 | #define WM831X_OTP_FACT_ID_WIDTH 15 /* OTP_FACT_ID - [15:1] */ | ||
| 83 | #define WM831X_OTP_FACT_FINAL 0x0001 /* OTP_FACT_FINAL */ | ||
| 84 | #define WM831X_OTP_FACT_FINAL_MASK 0x0001 /* OTP_FACT_FINAL */ | ||
| 85 | #define WM831X_OTP_FACT_FINAL_SHIFT 0 /* OTP_FACT_FINAL */ | ||
| 86 | #define WM831X_OTP_FACT_FINAL_WIDTH 1 /* OTP_FACT_FINAL */ | ||
| 87 | |||
| 88 | /* | ||
| 89 | * R30729 (0x7809) - Factory OTP 1 | ||
| 90 | */ | ||
| 91 | #define WM831X_DC3_TRIM_MASK 0xF000 /* DC3_TRIM - [15:12] */ | ||
| 92 | #define WM831X_DC3_TRIM_SHIFT 12 /* DC3_TRIM - [15:12] */ | ||
| 93 | #define WM831X_DC3_TRIM_WIDTH 4 /* DC3_TRIM - [15:12] */ | ||
| 94 | #define WM831X_DC2_TRIM_MASK 0x0FC0 /* DC2_TRIM - [11:6] */ | ||
| 95 | #define WM831X_DC2_TRIM_SHIFT 6 /* DC2_TRIM - [11:6] */ | ||
| 96 | #define WM831X_DC2_TRIM_WIDTH 6 /* DC2_TRIM - [11:6] */ | ||
| 97 | #define WM831X_DC1_TRIM_MASK 0x003F /* DC1_TRIM - [5:0] */ | ||
| 98 | #define WM831X_DC1_TRIM_SHIFT 0 /* DC1_TRIM - [5:0] */ | ||
| 99 | #define WM831X_DC1_TRIM_WIDTH 6 /* DC1_TRIM - [5:0] */ | ||
| 100 | |||
| 101 | /* | ||
| 102 | * R30730 (0x780A) - Factory OTP 2 | ||
| 103 | */ | ||
| 104 | #define WM831X_CHIP_ID_MASK 0xFFFF /* CHIP_ID - [15:0] */ | ||
| 105 | #define WM831X_CHIP_ID_SHIFT 0 /* CHIP_ID - [15:0] */ | ||
| 106 | #define WM831X_CHIP_ID_WIDTH 16 /* CHIP_ID - [15:0] */ | ||
| 107 | |||
| 108 | /* | ||
| 109 | * R30731 (0x780B) - Factory OTP 3 | ||
| 110 | */ | ||
| 111 | #define WM831X_OSC_TRIM_MASK 0x0780 /* OSC_TRIM - [10:7] */ | ||
| 112 | #define WM831X_OSC_TRIM_SHIFT 7 /* OSC_TRIM - [10:7] */ | ||
| 113 | #define WM831X_OSC_TRIM_WIDTH 4 /* OSC_TRIM - [10:7] */ | ||
| 114 | #define WM831X_BG_TRIM_MASK 0x0078 /* BG_TRIM - [6:3] */ | ||
| 115 | #define WM831X_BG_TRIM_SHIFT 3 /* BG_TRIM - [6:3] */ | ||
| 116 | #define WM831X_BG_TRIM_WIDTH 4 /* BG_TRIM - [6:3] */ | ||
| 117 | #define WM831X_LPBG_TRIM_MASK 0x0007 /* LPBG_TRIM - [2:0] */ | ||
| 118 | #define WM831X_LPBG_TRIM_SHIFT 0 /* LPBG_TRIM - [2:0] */ | ||
| 119 | #define WM831X_LPBG_TRIM_WIDTH 3 /* LPBG_TRIM - [2:0] */ | ||
| 120 | |||
| 121 | /* | ||
| 122 | * R30732 (0x780C) - Factory OTP 4 | ||
| 123 | */ | ||
| 124 | #define WM831X_CHILD_I2C_ADDR_MASK 0x00FE /* CHILD_I2C_ADDR - [7:1] */ | ||
| 125 | #define WM831X_CHILD_I2C_ADDR_SHIFT 1 /* CHILD_I2C_ADDR - [7:1] */ | ||
| 126 | #define WM831X_CHILD_I2C_ADDR_WIDTH 7 /* CHILD_I2C_ADDR - [7:1] */ | ||
| 127 | #define WM831X_CH_AW 0x0001 /* CH_AW */ | ||
| 128 | #define WM831X_CH_AW_MASK 0x0001 /* CH_AW */ | ||
| 129 | #define WM831X_CH_AW_SHIFT 0 /* CH_AW */ | ||
| 130 | #define WM831X_CH_AW_WIDTH 1 /* CH_AW */ | ||
| 131 | |||
| 132 | /* | ||
| 133 | * R30733 (0x780D) - Factory OTP 5 | ||
| 134 | */ | ||
| 135 | #define WM831X_CHARGE_TRIM_MASK 0x003F /* CHARGE_TRIM - [5:0] */ | ||
| 136 | #define WM831X_CHARGE_TRIM_SHIFT 0 /* CHARGE_TRIM - [5:0] */ | ||
| 137 | #define WM831X_CHARGE_TRIM_WIDTH 6 /* CHARGE_TRIM - [5:0] */ | ||
| 138 | |||
| 139 | /* | ||
| 140 | * R30736 (0x7810) - Customer OTP ID | ||
| 141 | */ | ||
| 142 | #define WM831X_OTP_AUTO_PROG 0x8000 /* OTP_AUTO_PROG */ | ||
| 143 | #define WM831X_OTP_AUTO_PROG_MASK 0x8000 /* OTP_AUTO_PROG */ | ||
| 144 | #define WM831X_OTP_AUTO_PROG_SHIFT 15 /* OTP_AUTO_PROG */ | ||
| 145 | #define WM831X_OTP_AUTO_PROG_WIDTH 1 /* OTP_AUTO_PROG */ | ||
| 146 | #define WM831X_OTP_CUST_ID_MASK 0x7FFE /* OTP_CUST_ID - [14:1] */ | ||
| 147 | #define WM831X_OTP_CUST_ID_SHIFT 1 /* OTP_CUST_ID - [14:1] */ | ||
| 148 | #define WM831X_OTP_CUST_ID_WIDTH 14 /* OTP_CUST_ID - [14:1] */ | ||
| 149 | #define WM831X_OTP_CUST_FINAL 0x0001 /* OTP_CUST_FINAL */ | ||
| 150 | #define WM831X_OTP_CUST_FINAL_MASK 0x0001 /* OTP_CUST_FINAL */ | ||
| 151 | #define WM831X_OTP_CUST_FINAL_SHIFT 0 /* OTP_CUST_FINAL */ | ||
| 152 | #define WM831X_OTP_CUST_FINAL_WIDTH 1 /* OTP_CUST_FINAL */ | ||
| 153 | |||
| 154 | /* | ||
| 155 | * R30759 (0x7827) - DBE CHECK DATA | ||
| 156 | */ | ||
| 157 | #define WM831X_DBE_VALID_DATA_MASK 0xFFFF /* DBE_VALID_DATA - [15:0] */ | ||
| 158 | #define WM831X_DBE_VALID_DATA_SHIFT 0 /* DBE_VALID_DATA - [15:0] */ | ||
| 159 | #define WM831X_DBE_VALID_DATA_WIDTH 16 /* DBE_VALID_DATA - [15:0] */ | ||
| 160 | |||
| 161 | |||
| 162 | #endif | ||
diff --git a/include/linux/mfd/wm831x/pdata.h b/include/linux/mfd/wm831x/pdata.h new file mode 100644 index 000000000000..90d820260aad --- /dev/null +++ b/include/linux/mfd/wm831x/pdata.h | |||
| @@ -0,0 +1,113 @@ | |||
| 1 | /* | ||
| 2 | * include/linux/mfd/wm831x/pdata.h -- Platform data for WM831x | ||
| 3 | * | ||
| 4 | * Copyright 2009 Wolfson Microelectronics PLC. | ||
| 5 | * | ||
| 6 | * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify it | ||
| 9 | * under the terms of the GNU General Public License as published by the | ||
| 10 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 11 | * option) any later version. | ||
| 12 | * | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef __MFD_WM831X_PDATA_H__ | ||
| 16 | #define __MFD_WM831X_PDATA_H__ | ||
| 17 | |||
| 18 | struct wm831x; | ||
| 19 | struct regulator_init_data; | ||
| 20 | |||
| 21 | struct wm831x_backlight_pdata { | ||
| 22 | int isink; /** ISINK to use, 1 or 2 */ | ||
| 23 | int max_uA; /** Maximum current to allow */ | ||
| 24 | }; | ||
| 25 | |||
| 26 | struct wm831x_backup_pdata { | ||
| 27 | int charger_enable; | ||
| 28 | int no_constant_voltage; /** Disable constant voltage charging */ | ||
| 29 | int vlim; /** Voltage limit in milivolts */ | ||
| 30 | int ilim; /** Current limit in microamps */ | ||
| 31 | }; | ||
| 32 | |||
| 33 | struct wm831x_battery_pdata { | ||
| 34 | int enable; /** Enable charging */ | ||
| 35 | int fast_enable; /** Enable fast charging */ | ||
| 36 | int off_mask; /** Mask OFF while charging */ | ||
| 37 | int trickle_ilim; /** Trickle charge current limit, in mA */ | ||
| 38 | int vsel; /** Target voltage, in mV */ | ||
| 39 | int eoc_iterm; /** End of trickle charge current, in mA */ | ||
| 40 | int fast_ilim; /** Fast charge current limit, in mA */ | ||
| 41 | int timeout; /** Charge cycle timeout, in minutes */ | ||
| 42 | }; | ||
| 43 | |||
| 44 | /* Sources for status LED configuration. Values are register values | ||
| 45 | * plus 1 to allow for a zero default for preserve. | ||
| 46 | */ | ||
| 47 | enum wm831x_status_src { | ||
| 48 | WM831X_STATUS_PRESERVE = 0, /* Keep the current hardware setting */ | ||
| 49 | WM831X_STATUS_OTP = 1, | ||
| 50 | WM831X_STATUS_POWER = 2, | ||
| 51 | WM831X_STATUS_CHARGER = 3, | ||
| 52 | WM831X_STATUS_MANUAL = 4, | ||
| 53 | }; | ||
| 54 | |||
| 55 | struct wm831x_status_pdata { | ||
| 56 | enum wm831x_status_src default_src; | ||
| 57 | const char *name; | ||
| 58 | const char *default_trigger; | ||
| 59 | }; | ||
| 60 | |||
| 61 | struct wm831x_touch_pdata { | ||
| 62 | int fivewire; /** 1 for five wire mode, 0 for 4 wire */ | ||
| 63 | int isel; /** Current for pen down (uA) */ | ||
| 64 | int rpu; /** Pen down sensitivity resistor divider */ | ||
| 65 | int pressure; /** Report pressure (boolean) */ | ||
| 66 | int data_irq; /** Touch data ready IRQ */ | ||
| 67 | }; | ||
| 68 | |||
| 69 | enum wm831x_watchdog_action { | ||
| 70 | WM831X_WDOG_NONE = 0, | ||
| 71 | WM831X_WDOG_INTERRUPT = 1, | ||
| 72 | WM831X_WDOG_RESET = 2, | ||
| 73 | WM831X_WDOG_WAKE = 3, | ||
| 74 | }; | ||
| 75 | |||
| 76 | struct wm831x_watchdog_pdata { | ||
| 77 | enum wm831x_watchdog_action primary, secondary; | ||
| 78 | int update_gpio; | ||
| 79 | unsigned int software:1; | ||
| 80 | }; | ||
| 81 | |||
| 82 | #define WM831X_MAX_STATUS 2 | ||
| 83 | #define WM831X_MAX_DCDC 4 | ||
| 84 | #define WM831X_MAX_EPE 2 | ||
| 85 | #define WM831X_MAX_LDO 11 | ||
| 86 | #define WM831X_MAX_ISINK 2 | ||
| 87 | |||
| 88 | struct wm831x_pdata { | ||
| 89 | /** Called before subdevices are set up */ | ||
| 90 | int (*pre_init)(struct wm831x *wm831x); | ||
| 91 | /** Called after subdevices are set up */ | ||
| 92 | int (*post_init)(struct wm831x *wm831x); | ||
| 93 | |||
| 94 | int gpio_base; | ||
| 95 | struct wm831x_backlight_pdata *backlight; | ||
| 96 | struct wm831x_backup_pdata *backup; | ||
| 97 | struct wm831x_battery_pdata *battery; | ||
| 98 | struct wm831x_touch_pdata *touch; | ||
| 99 | struct wm831x_watchdog_pdata *watchdog; | ||
| 100 | |||
| 101 | /** LED1 = 0 and so on */ | ||
| 102 | struct wm831x_status_pdata *status[WM831X_MAX_STATUS]; | ||
| 103 | /** DCDC1 = 0 and so on */ | ||
| 104 | struct regulator_init_data *dcdc[WM831X_MAX_DCDC]; | ||
| 105 | /** EPE1 = 0 and so on */ | ||
| 106 | struct regulator_init_data *epe[WM831X_MAX_EPE]; | ||
| 107 | /** LDO1 = 0 and so on */ | ||
| 108 | struct regulator_init_data *ldo[WM831X_MAX_LDO]; | ||
| 109 | /** ISINK1 = 0 and so on*/ | ||
| 110 | struct regulator_init_data *isink[WM831X_MAX_ISINK]; | ||
| 111 | }; | ||
| 112 | |||
| 113 | #endif | ||
diff --git a/include/linux/mfd/wm831x/pmu.h b/include/linux/mfd/wm831x/pmu.h new file mode 100644 index 000000000000..b18cbb027bc3 --- /dev/null +++ b/include/linux/mfd/wm831x/pmu.h | |||
| @@ -0,0 +1,189 @@ | |||
| 1 | /* | ||
| 2 | * include/linux/mfd/wm831x/pmu.h -- PMU for WM831x | ||
| 3 | * | ||
| 4 | * Copyright 2009 Wolfson Microelectronics PLC. | ||
| 5 | * | ||
| 6 | * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify it | ||
| 9 | * under the terms of the GNU General Public License as published by the | ||
| 10 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 11 | * option) any later version. | ||
| 12 | * | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef __MFD_WM831X_PMU_H__ | ||
| 16 | #define __MFD_WM831X_PMU_H__ | ||
| 17 | |||
| 18 | /* | ||
| 19 | * R16387 (0x4003) - Power State | ||
| 20 | */ | ||
| 21 | #define WM831X_CHIP_ON 0x8000 /* CHIP_ON */ | ||
| 22 | #define WM831X_CHIP_ON_MASK 0x8000 /* CHIP_ON */ | ||
| 23 | #define WM831X_CHIP_ON_SHIFT 15 /* CHIP_ON */ | ||
| 24 | #define WM831X_CHIP_ON_WIDTH 1 /* CHIP_ON */ | ||
| 25 | #define WM831X_CHIP_SLP 0x4000 /* CHIP_SLP */ | ||
| 26 | #define WM831X_CHIP_SLP_MASK 0x4000 /* CHIP_SLP */ | ||
| 27 | #define WM831X_CHIP_SLP_SHIFT 14 /* CHIP_SLP */ | ||
| 28 | #define WM831X_CHIP_SLP_WIDTH 1 /* CHIP_SLP */ | ||
| 29 | #define WM831X_REF_LP 0x1000 /* REF_LP */ | ||
| 30 | #define WM831X_REF_LP_MASK 0x1000 /* REF_LP */ | ||
| 31 | #define WM831X_REF_LP_SHIFT 12 /* REF_LP */ | ||
| 32 | #define WM831X_REF_LP_WIDTH 1 /* REF_LP */ | ||
| 33 | #define WM831X_PWRSTATE_DLY_MASK 0x0C00 /* PWRSTATE_DLY - [11:10] */ | ||
| 34 | #define WM831X_PWRSTATE_DLY_SHIFT 10 /* PWRSTATE_DLY - [11:10] */ | ||
| 35 | #define WM831X_PWRSTATE_DLY_WIDTH 2 /* PWRSTATE_DLY - [11:10] */ | ||
| 36 | #define WM831X_SWRST_DLY 0x0200 /* SWRST_DLY */ | ||
| 37 | #define WM831X_SWRST_DLY_MASK 0x0200 /* SWRST_DLY */ | ||
| 38 | #define WM831X_SWRST_DLY_SHIFT 9 /* SWRST_DLY */ | ||
| 39 | #define WM831X_SWRST_DLY_WIDTH 1 /* SWRST_DLY */ | ||
| 40 | #define WM831X_USB100MA_STARTUP_MASK 0x0030 /* USB100MA_STARTUP - [5:4] */ | ||
| 41 | #define WM831X_USB100MA_STARTUP_SHIFT 4 /* USB100MA_STARTUP - [5:4] */ | ||
| 42 | #define WM831X_USB100MA_STARTUP_WIDTH 2 /* USB100MA_STARTUP - [5:4] */ | ||
| 43 | #define WM831X_USB_CURR_STS 0x0008 /* USB_CURR_STS */ | ||
| 44 | #define WM831X_USB_CURR_STS_MASK 0x0008 /* USB_CURR_STS */ | ||
| 45 | #define WM831X_USB_CURR_STS_SHIFT 3 /* USB_CURR_STS */ | ||
| 46 | #define WM831X_USB_CURR_STS_WIDTH 1 /* USB_CURR_STS */ | ||
| 47 | #define WM831X_USB_ILIM_MASK 0x0007 /* USB_ILIM - [2:0] */ | ||
| 48 | #define WM831X_USB_ILIM_SHIFT 0 /* USB_ILIM - [2:0] */ | ||
| 49 | #define WM831X_USB_ILIM_WIDTH 3 /* USB_ILIM - [2:0] */ | ||
| 50 | |||
| 51 | /* | ||
| 52 | * R16397 (0x400D) - System Status | ||
| 53 | */ | ||
| 54 | #define WM831X_THW_STS 0x8000 /* THW_STS */ | ||
| 55 | #define WM831X_THW_STS_MASK 0x8000 /* THW_STS */ | ||
| 56 | #define WM831X_THW_STS_SHIFT 15 /* THW_STS */ | ||
| 57 | #define WM831X_THW_STS_WIDTH 1 /* THW_STS */ | ||
| 58 | #define WM831X_PWR_SRC_BATT 0x0400 /* PWR_SRC_BATT */ | ||
| 59 | #define WM831X_PWR_SRC_BATT_MASK 0x0400 /* PWR_SRC_BATT */ | ||
| 60 | #define WM831X_PWR_SRC_BATT_SHIFT 10 /* PWR_SRC_BATT */ | ||
| 61 | #define WM831X_PWR_SRC_BATT_WIDTH 1 /* PWR_SRC_BATT */ | ||
| 62 | #define WM831X_PWR_WALL 0x0200 /* PWR_WALL */ | ||
| 63 | #define WM831X_PWR_WALL_MASK 0x0200 /* PWR_WALL */ | ||
| 64 | #define WM831X_PWR_WALL_SHIFT 9 /* PWR_WALL */ | ||
| 65 | #define WM831X_PWR_WALL_WIDTH 1 /* PWR_WALL */ | ||
| 66 | #define WM831X_PWR_USB 0x0100 /* PWR_USB */ | ||
| 67 | #define WM831X_PWR_USB_MASK 0x0100 /* PWR_USB */ | ||
| 68 | #define WM831X_PWR_USB_SHIFT 8 /* PWR_USB */ | ||
| 69 | #define WM831X_PWR_USB_WIDTH 1 /* PWR_USB */ | ||
| 70 | #define WM831X_MAIN_STATE_MASK 0x001F /* MAIN_STATE - [4:0] */ | ||
| 71 | #define WM831X_MAIN_STATE_SHIFT 0 /* MAIN_STATE - [4:0] */ | ||
| 72 | #define WM831X_MAIN_STATE_WIDTH 5 /* MAIN_STATE - [4:0] */ | ||
| 73 | |||
| 74 | /* | ||
| 75 | * R16456 (0x4048) - Charger Control 1 | ||
| 76 | */ | ||
| 77 | #define WM831X_CHG_ENA 0x8000 /* CHG_ENA */ | ||
| 78 | #define WM831X_CHG_ENA_MASK 0x8000 /* CHG_ENA */ | ||
| 79 | #define WM831X_CHG_ENA_SHIFT 15 /* CHG_ENA */ | ||
| 80 | #define WM831X_CHG_ENA_WIDTH 1 /* CHG_ENA */ | ||
| 81 | #define WM831X_CHG_FRC 0x4000 /* CHG_FRC */ | ||
| 82 | #define WM831X_CHG_FRC_MASK 0x4000 /* CHG_FRC */ | ||
| 83 | #define WM831X_CHG_FRC_SHIFT 14 /* CHG_FRC */ | ||
| 84 | #define WM831X_CHG_FRC_WIDTH 1 /* CHG_FRC */ | ||
| 85 | #define WM831X_CHG_ITERM_MASK 0x1C00 /* CHG_ITERM - [12:10] */ | ||
| 86 | #define WM831X_CHG_ITERM_SHIFT 10 /* CHG_ITERM - [12:10] */ | ||
| 87 | #define WM831X_CHG_ITERM_WIDTH 3 /* CHG_ITERM - [12:10] */ | ||
| 88 | #define WM831X_CHG_FAST 0x0020 /* CHG_FAST */ | ||
| 89 | #define WM831X_CHG_FAST_MASK 0x0020 /* CHG_FAST */ | ||
| 90 | #define WM831X_CHG_FAST_SHIFT 5 /* CHG_FAST */ | ||
| 91 | #define WM831X_CHG_FAST_WIDTH 1 /* CHG_FAST */ | ||
| 92 | #define WM831X_CHG_IMON_ENA 0x0002 /* CHG_IMON_ENA */ | ||
| 93 | #define WM831X_CHG_IMON_ENA_MASK 0x0002 /* CHG_IMON_ENA */ | ||
| 94 | #define WM831X_CHG_IMON_ENA_SHIFT 1 /* CHG_IMON_ENA */ | ||
| 95 | #define WM831X_CHG_IMON_ENA_WIDTH 1 /* CHG_IMON_ENA */ | ||
| 96 | #define WM831X_CHG_CHIP_TEMP_MON 0x0001 /* CHG_CHIP_TEMP_MON */ | ||
| 97 | #define WM831X_CHG_CHIP_TEMP_MON_MASK 0x0001 /* CHG_CHIP_TEMP_MON */ | ||
| 98 | #define WM831X_CHG_CHIP_TEMP_MON_SHIFT 0 /* CHG_CHIP_TEMP_MON */ | ||
| 99 | #define WM831X_CHG_CHIP_TEMP_MON_WIDTH 1 /* CHG_CHIP_TEMP_MON */ | ||
| 100 | |||
| 101 | /* | ||
| 102 | * R16457 (0x4049) - Charger Control 2 | ||
| 103 | */ | ||
| 104 | #define WM831X_CHG_OFF_MSK 0x4000 /* CHG_OFF_MSK */ | ||
| 105 | #define WM831X_CHG_OFF_MSK_MASK 0x4000 /* CHG_OFF_MSK */ | ||
| 106 | #define WM831X_CHG_OFF_MSK_SHIFT 14 /* CHG_OFF_MSK */ | ||
| 107 | #define WM831X_CHG_OFF_MSK_WIDTH 1 /* CHG_OFF_MSK */ | ||
| 108 | #define WM831X_CHG_TIME_MASK 0x0F00 /* CHG_TIME - [11:8] */ | ||
| 109 | #define WM831X_CHG_TIME_SHIFT 8 /* CHG_TIME - [11:8] */ | ||
| 110 | #define WM831X_CHG_TIME_WIDTH 4 /* CHG_TIME - [11:8] */ | ||
| 111 | #define WM831X_CHG_TRKL_ILIM_MASK 0x00C0 /* CHG_TRKL_ILIM - [7:6] */ | ||
| 112 | #define WM831X_CHG_TRKL_ILIM_SHIFT 6 /* CHG_TRKL_ILIM - [7:6] */ | ||
| 113 | #define WM831X_CHG_TRKL_ILIM_WIDTH 2 /* CHG_TRKL_ILIM - [7:6] */ | ||
| 114 | #define WM831X_CHG_VSEL_MASK 0x0030 /* CHG_VSEL - [5:4] */ | ||
| 115 | #define WM831X_CHG_VSEL_SHIFT 4 /* CHG_VSEL - [5:4] */ | ||
| 116 | #define WM831X_CHG_VSEL_WIDTH 2 /* CHG_VSEL - [5:4] */ | ||
| 117 | #define WM831X_CHG_FAST_ILIM_MASK 0x000F /* CHG_FAST_ILIM - [3:0] */ | ||
| 118 | #define WM831X_CHG_FAST_ILIM_SHIFT 0 /* CHG_FAST_ILIM - [3:0] */ | ||
| 119 | #define WM831X_CHG_FAST_ILIM_WIDTH 4 /* CHG_FAST_ILIM - [3:0] */ | ||
| 120 | |||
| 121 | /* | ||
| 122 | * R16458 (0x404A) - Charger Status | ||
| 123 | */ | ||
| 124 | #define WM831X_BATT_OV_STS 0x8000 /* BATT_OV_STS */ | ||
| 125 | #define WM831X_BATT_OV_STS_MASK 0x8000 /* BATT_OV_STS */ | ||
| 126 | #define WM831X_BATT_OV_STS_SHIFT 15 /* BATT_OV_STS */ | ||
| 127 | #define WM831X_BATT_OV_STS_WIDTH 1 /* BATT_OV_STS */ | ||
| 128 | #define WM831X_CHG_STATE_MASK 0x7000 /* CHG_STATE - [14:12] */ | ||
| 129 | #define WM831X_CHG_STATE_SHIFT 12 /* CHG_STATE - [14:12] */ | ||
| 130 | #define WM831X_CHG_STATE_WIDTH 3 /* CHG_STATE - [14:12] */ | ||
| 131 | #define WM831X_BATT_HOT_STS 0x0800 /* BATT_HOT_STS */ | ||
| 132 | #define WM831X_BATT_HOT_STS_MASK 0x0800 /* BATT_HOT_STS */ | ||
| 133 | #define WM831X_BATT_HOT_STS_SHIFT 11 /* BATT_HOT_STS */ | ||
| 134 | #define WM831X_BATT_HOT_STS_WIDTH 1 /* BATT_HOT_STS */ | ||
| 135 | #define WM831X_BATT_COLD_STS 0x0400 /* BATT_COLD_STS */ | ||
| 136 | #define WM831X_BATT_COLD_STS_MASK 0x0400 /* BATT_COLD_STS */ | ||
| 137 | #define WM831X_BATT_COLD_STS_SHIFT 10 /* BATT_COLD_STS */ | ||
| 138 | #define WM831X_BATT_COLD_STS_WIDTH 1 /* BATT_COLD_STS */ | ||
| 139 | #define WM831X_CHG_TOPOFF 0x0200 /* CHG_TOPOFF */ | ||
| 140 | #define WM831X_CHG_TOPOFF_MASK 0x0200 /* CHG_TOPOFF */ | ||
| 141 | #define WM831X_CHG_TOPOFF_SHIFT 9 /* CHG_TOPOFF */ | ||
| 142 | #define WM831X_CHG_TOPOFF_WIDTH 1 /* CHG_TOPOFF */ | ||
| 143 | #define WM831X_CHG_ACTIVE 0x0100 /* CHG_ACTIVE */ | ||
| 144 | #define WM831X_CHG_ACTIVE_MASK 0x0100 /* CHG_ACTIVE */ | ||
| 145 | #define WM831X_CHG_ACTIVE_SHIFT 8 /* CHG_ACTIVE */ | ||
| 146 | #define WM831X_CHG_ACTIVE_WIDTH 1 /* CHG_ACTIVE */ | ||
| 147 | #define WM831X_CHG_TIME_ELAPSED_MASK 0x00FF /* CHG_TIME_ELAPSED - [7:0] */ | ||
| 148 | #define WM831X_CHG_TIME_ELAPSED_SHIFT 0 /* CHG_TIME_ELAPSED - [7:0] */ | ||
| 149 | #define WM831X_CHG_TIME_ELAPSED_WIDTH 8 /* CHG_TIME_ELAPSED - [7:0] */ | ||
| 150 | |||
| 151 | #define WM831X_CHG_STATE_OFF (0 << WM831X_CHG_STATE_SHIFT) | ||
| 152 | #define WM831X_CHG_STATE_TRICKLE (1 << WM831X_CHG_STATE_SHIFT) | ||
| 153 | #define WM831X_CHG_STATE_FAST (2 << WM831X_CHG_STATE_SHIFT) | ||
| 154 | #define WM831X_CHG_STATE_TRICKLE_OT (3 << WM831X_CHG_STATE_SHIFT) | ||
| 155 | #define WM831X_CHG_STATE_FAST_OT (4 << WM831X_CHG_STATE_SHIFT) | ||
| 156 | #define WM831X_CHG_STATE_DEFECTIVE (5 << WM831X_CHG_STATE_SHIFT) | ||
| 157 | |||
| 158 | /* | ||
| 159 | * R16459 (0x404B) - Backup Charger Control | ||
| 160 | */ | ||
| 161 | #define WM831X_BKUP_CHG_ENA 0x8000 /* BKUP_CHG_ENA */ | ||
| 162 | #define WM831X_BKUP_CHG_ENA_MASK 0x8000 /* BKUP_CHG_ENA */ | ||
| 163 | #define WM831X_BKUP_CHG_ENA_SHIFT 15 /* BKUP_CHG_ENA */ | ||
| 164 | #define WM831X_BKUP_CHG_ENA_WIDTH 1 /* BKUP_CHG_ENA */ | ||
| 165 | #define WM831X_BKUP_CHG_STS 0x4000 /* BKUP_CHG_STS */ | ||
| 166 | #define WM831X_BKUP_CHG_STS_MASK 0x4000 /* BKUP_CHG_STS */ | ||
| 167 | #define WM831X_BKUP_CHG_STS_SHIFT 14 /* BKUP_CHG_STS */ | ||
| 168 | #define WM831X_BKUP_CHG_STS_WIDTH 1 /* BKUP_CHG_STS */ | ||
| 169 | #define WM831X_BKUP_CHG_MODE 0x1000 /* BKUP_CHG_MODE */ | ||
| 170 | #define WM831X_BKUP_CHG_MODE_MASK 0x1000 /* BKUP_CHG_MODE */ | ||
| 171 | #define WM831X_BKUP_CHG_MODE_SHIFT 12 /* BKUP_CHG_MODE */ | ||
| 172 | #define WM831X_BKUP_CHG_MODE_WIDTH 1 /* BKUP_CHG_MODE */ | ||
| 173 | #define WM831X_BKUP_BATT_DET_ENA 0x0800 /* BKUP_BATT_DET_ENA */ | ||
| 174 | #define WM831X_BKUP_BATT_DET_ENA_MASK 0x0800 /* BKUP_BATT_DET_ENA */ | ||
| 175 | #define WM831X_BKUP_BATT_DET_ENA_SHIFT 11 /* BKUP_BATT_DET_ENA */ | ||
| 176 | #define WM831X_BKUP_BATT_DET_ENA_WIDTH 1 /* BKUP_BATT_DET_ENA */ | ||
| 177 | #define WM831X_BKUP_BATT_STS 0x0400 /* BKUP_BATT_STS */ | ||
| 178 | #define WM831X_BKUP_BATT_STS_MASK 0x0400 /* BKUP_BATT_STS */ | ||
| 179 | #define WM831X_BKUP_BATT_STS_SHIFT 10 /* BKUP_BATT_STS */ | ||
| 180 | #define WM831X_BKUP_BATT_STS_WIDTH 1 /* BKUP_BATT_STS */ | ||
| 181 | #define WM831X_BKUP_CHG_VLIM 0x0010 /* BKUP_CHG_VLIM */ | ||
| 182 | #define WM831X_BKUP_CHG_VLIM_MASK 0x0010 /* BKUP_CHG_VLIM */ | ||
| 183 | #define WM831X_BKUP_CHG_VLIM_SHIFT 4 /* BKUP_CHG_VLIM */ | ||
| 184 | #define WM831X_BKUP_CHG_VLIM_WIDTH 1 /* BKUP_CHG_VLIM */ | ||
| 185 | #define WM831X_BKUP_CHG_ILIM_MASK 0x0003 /* BKUP_CHG_ILIM - [1:0] */ | ||
| 186 | #define WM831X_BKUP_CHG_ILIM_SHIFT 0 /* BKUP_CHG_ILIM - [1:0] */ | ||
| 187 | #define WM831X_BKUP_CHG_ILIM_WIDTH 2 /* BKUP_CHG_ILIM - [1:0] */ | ||
| 188 | |||
| 189 | #endif | ||
diff --git a/include/linux/mfd/wm831x/regulator.h b/include/linux/mfd/wm831x/regulator.h new file mode 100644 index 000000000000..955d30fc6a27 --- /dev/null +++ b/include/linux/mfd/wm831x/regulator.h | |||
| @@ -0,0 +1,1218 @@ | |||
| 1 | /* | ||
| 2 | * linux/mfd/wm831x/regulator.h -- Regulator definitons for wm831x | ||
| 3 | * | ||
| 4 | * Copyright 2009 Wolfson Microelectronics PLC. | ||
| 5 | * | ||
| 6 | * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify it | ||
| 9 | * under the terms of the GNU General Public License as published by the | ||
| 10 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 11 | * option) any later version. | ||
| 12 | * | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef __MFD_WM831X_REGULATOR_H__ | ||
| 16 | #define __MFD_WM831X_REGULATOR_H__ | ||
| 17 | |||
| 18 | /* | ||
| 19 | * R16462 (0x404E) - Current Sink 1 | ||
| 20 | */ | ||
| 21 | #define WM831X_CS1_ENA 0x8000 /* CS1_ENA */ | ||
| 22 | #define WM831X_CS1_ENA_MASK 0x8000 /* CS1_ENA */ | ||
| 23 | #define WM831X_CS1_ENA_SHIFT 15 /* CS1_ENA */ | ||
| 24 | #define WM831X_CS1_ENA_WIDTH 1 /* CS1_ENA */ | ||
| 25 | #define WM831X_CS1_DRIVE 0x4000 /* CS1_DRIVE */ | ||
| 26 | #define WM831X_CS1_DRIVE_MASK 0x4000 /* CS1_DRIVE */ | ||
| 27 | #define WM831X_CS1_DRIVE_SHIFT 14 /* CS1_DRIVE */ | ||
| 28 | #define WM831X_CS1_DRIVE_WIDTH 1 /* CS1_DRIVE */ | ||
| 29 | #define WM831X_CS1_SLPENA 0x1000 /* CS1_SLPENA */ | ||
| 30 | #define WM831X_CS1_SLPENA_MASK 0x1000 /* CS1_SLPENA */ | ||
| 31 | #define WM831X_CS1_SLPENA_SHIFT 12 /* CS1_SLPENA */ | ||
| 32 | #define WM831X_CS1_SLPENA_WIDTH 1 /* CS1_SLPENA */ | ||
| 33 | #define WM831X_CS1_OFF_RAMP_MASK 0x0C00 /* CS1_OFF_RAMP - [11:10] */ | ||
| 34 | #define WM831X_CS1_OFF_RAMP_SHIFT 10 /* CS1_OFF_RAMP - [11:10] */ | ||
| 35 | #define WM831X_CS1_OFF_RAMP_WIDTH 2 /* CS1_OFF_RAMP - [11:10] */ | ||
| 36 | #define WM831X_CS1_ON_RAMP_MASK 0x0300 /* CS1_ON_RAMP - [9:8] */ | ||
| 37 | #define WM831X_CS1_ON_RAMP_SHIFT 8 /* CS1_ON_RAMP - [9:8] */ | ||
| 38 | #define WM831X_CS1_ON_RAMP_WIDTH 2 /* CS1_ON_RAMP - [9:8] */ | ||
| 39 | #define WM831X_CS1_ISEL_MASK 0x003F /* CS1_ISEL - [5:0] */ | ||
| 40 | #define WM831X_CS1_ISEL_SHIFT 0 /* CS1_ISEL - [5:0] */ | ||
| 41 | #define WM831X_CS1_ISEL_WIDTH 6 /* CS1_ISEL - [5:0] */ | ||
| 42 | |||
| 43 | /* | ||
| 44 | * R16463 (0x404F) - Current Sink 2 | ||
| 45 | */ | ||
| 46 | #define WM831X_CS2_ENA 0x8000 /* CS2_ENA */ | ||
| 47 | #define WM831X_CS2_ENA_MASK 0x8000 /* CS2_ENA */ | ||
| 48 | #define WM831X_CS2_ENA_SHIFT 15 /* CS2_ENA */ | ||
| 49 | #define WM831X_CS2_ENA_WIDTH 1 /* CS2_ENA */ | ||
| 50 | #define WM831X_CS2_DRIVE 0x4000 /* CS2_DRIVE */ | ||
| 51 | #define WM831X_CS2_DRIVE_MASK 0x4000 /* CS2_DRIVE */ | ||
| 52 | #define WM831X_CS2_DRIVE_SHIFT 14 /* CS2_DRIVE */ | ||
| 53 | #define WM831X_CS2_DRIVE_WIDTH 1 /* CS2_DRIVE */ | ||
| 54 | #define WM831X_CS2_SLPENA 0x1000 /* CS2_SLPENA */ | ||
| 55 | #define WM831X_CS2_SLPENA_MASK 0x1000 /* CS2_SLPENA */ | ||
| 56 | #define WM831X_CS2_SLPENA_SHIFT 12 /* CS2_SLPENA */ | ||
| 57 | #define WM831X_CS2_SLPENA_WIDTH 1 /* CS2_SLPENA */ | ||
| 58 | #define WM831X_CS2_OFF_RAMP_MASK 0x0C00 /* CS2_OFF_RAMP - [11:10] */ | ||
| 59 | #define WM831X_CS2_OFF_RAMP_SHIFT 10 /* CS2_OFF_RAMP - [11:10] */ | ||
| 60 | #define WM831X_CS2_OFF_RAMP_WIDTH 2 /* CS2_OFF_RAMP - [11:10] */ | ||
| 61 | #define WM831X_CS2_ON_RAMP_MASK 0x0300 /* CS2_ON_RAMP - [9:8] */ | ||
| 62 | #define WM831X_CS2_ON_RAMP_SHIFT 8 /* CS2_ON_RAMP - [9:8] */ | ||
| 63 | #define WM831X_CS2_ON_RAMP_WIDTH 2 /* CS2_ON_RAMP - [9:8] */ | ||
| 64 | #define WM831X_CS2_ISEL_MASK 0x003F /* CS2_ISEL - [5:0] */ | ||
| 65 | #define WM831X_CS2_ISEL_SHIFT 0 /* CS2_ISEL - [5:0] */ | ||
| 66 | #define WM831X_CS2_ISEL_WIDTH 6 /* CS2_ISEL - [5:0] */ | ||
| 67 | |||
| 68 | /* | ||
| 69 | * R16464 (0x4050) - DCDC Enable | ||
| 70 | */ | ||
| 71 | #define WM831X_EPE2_ENA 0x0080 /* EPE2_ENA */ | ||
| 72 | #define WM831X_EPE2_ENA_MASK 0x0080 /* EPE2_ENA */ | ||
| 73 | #define WM831X_EPE2_ENA_SHIFT 7 /* EPE2_ENA */ | ||
| 74 | #define WM831X_EPE2_ENA_WIDTH 1 /* EPE2_ENA */ | ||
| 75 | #define WM831X_EPE1_ENA 0x0040 /* EPE1_ENA */ | ||
| 76 | #define WM831X_EPE1_ENA_MASK 0x0040 /* EPE1_ENA */ | ||
| 77 | #define WM831X_EPE1_ENA_SHIFT 6 /* EPE1_ENA */ | ||
| 78 | #define WM831X_EPE1_ENA_WIDTH 1 /* EPE1_ENA */ | ||
| 79 | #define WM831X_DC4_ENA 0x0008 /* DC4_ENA */ | ||
| 80 | #define WM831X_DC4_ENA_MASK 0x0008 /* DC4_ENA */ | ||
| 81 | #define WM831X_DC4_ENA_SHIFT 3 /* DC4_ENA */ | ||
| 82 | #define WM831X_DC4_ENA_WIDTH 1 /* DC4_ENA */ | ||
| 83 | #define WM831X_DC3_ENA 0x0004 /* DC3_ENA */ | ||
| 84 | #define WM831X_DC3_ENA_MASK 0x0004 /* DC3_ENA */ | ||
| 85 | #define WM831X_DC3_ENA_SHIFT 2 /* DC3_ENA */ | ||
| 86 | #define WM831X_DC3_ENA_WIDTH 1 /* DC3_ENA */ | ||
| 87 | #define WM831X_DC2_ENA 0x0002 /* DC2_ENA */ | ||
| 88 | #define WM831X_DC2_ENA_MASK 0x0002 /* DC2_ENA */ | ||
| 89 | #define WM831X_DC2_ENA_SHIFT 1 /* DC2_ENA */ | ||
| 90 | #define WM831X_DC2_ENA_WIDTH 1 /* DC2_ENA */ | ||
| 91 | #define WM831X_DC1_ENA 0x0001 /* DC1_ENA */ | ||
| 92 | #define WM831X_DC1_ENA_MASK 0x0001 /* DC1_ENA */ | ||
| 93 | #define WM831X_DC1_ENA_SHIFT 0 /* DC1_ENA */ | ||
| 94 | #define WM831X_DC1_ENA_WIDTH 1 /* DC1_ENA */ | ||
| 95 | |||
| 96 | /* | ||
| 97 | * R16465 (0x4051) - LDO Enable | ||
| 98 | */ | ||
| 99 | #define WM831X_LDO11_ENA 0x0400 /* LDO11_ENA */ | ||
| 100 | #define WM831X_LDO11_ENA_MASK 0x0400 /* LDO11_ENA */ | ||
| 101 | #define WM831X_LDO11_ENA_SHIFT 10 /* LDO11_ENA */ | ||
| 102 | #define WM831X_LDO11_ENA_WIDTH 1 /* LDO11_ENA */ | ||
| 103 | #define WM831X_LDO10_ENA 0x0200 /* LDO10_ENA */ | ||
| 104 | #define WM831X_LDO10_ENA_MASK 0x0200 /* LDO10_ENA */ | ||
| 105 | #define WM831X_LDO10_ENA_SHIFT 9 /* LDO10_ENA */ | ||
| 106 | #define WM831X_LDO10_ENA_WIDTH 1 /* LDO10_ENA */ | ||
| 107 | #define WM831X_LDO9_ENA 0x0100 /* LDO9_ENA */ | ||
| 108 | #define WM831X_LDO9_ENA_MASK 0x0100 /* LDO9_ENA */ | ||
| 109 | #define WM831X_LDO9_ENA_SHIFT 8 /* LDO9_ENA */ | ||
| 110 | #define WM831X_LDO9_ENA_WIDTH 1 /* LDO9_ENA */ | ||
| 111 | #define WM831X_LDO8_ENA 0x0080 /* LDO8_ENA */ | ||
| 112 | #define WM831X_LDO8_ENA_MASK 0x0080 /* LDO8_ENA */ | ||
| 113 | #define WM831X_LDO8_ENA_SHIFT 7 /* LDO8_ENA */ | ||
| 114 | #define WM831X_LDO8_ENA_WIDTH 1 /* LDO8_ENA */ | ||
| 115 | #define WM831X_LDO7_ENA 0x0040 /* LDO7_ENA */ | ||
| 116 | #define WM831X_LDO7_ENA_MASK 0x0040 /* LDO7_ENA */ | ||
| 117 | #define WM831X_LDO7_ENA_SHIFT 6 /* LDO7_ENA */ | ||
| 118 | #define WM831X_LDO7_ENA_WIDTH 1 /* LDO7_ENA */ | ||
| 119 | #define WM831X_LDO6_ENA 0x0020 /* LDO6_ENA */ | ||
| 120 | #define WM831X_LDO6_ENA_MASK 0x0020 /* LDO6_ENA */ | ||
| 121 | #define WM831X_LDO6_ENA_SHIFT 5 /* LDO6_ENA */ | ||
| 122 | #define WM831X_LDO6_ENA_WIDTH 1 /* LDO6_ENA */ | ||
| 123 | #define WM831X_LDO5_ENA 0x0010 /* LDO5_ENA */ | ||
| 124 | #define WM831X_LDO5_ENA_MASK 0x0010 /* LDO5_ENA */ | ||
| 125 | #define WM831X_LDO5_ENA_SHIFT 4 /* LDO5_ENA */ | ||
| 126 | #define WM831X_LDO5_ENA_WIDTH 1 /* LDO5_ENA */ | ||
| 127 | #define WM831X_LDO4_ENA 0x0008 /* LDO4_ENA */ | ||
| 128 | #define WM831X_LDO4_ENA_MASK 0x0008 /* LDO4_ENA */ | ||
| 129 | #define WM831X_LDO4_ENA_SHIFT 3 /* LDO4_ENA */ | ||
| 130 | #define WM831X_LDO4_ENA_WIDTH 1 /* LDO4_ENA */ | ||
| 131 | #define WM831X_LDO3_ENA 0x0004 /* LDO3_ENA */ | ||
| 132 | #define WM831X_LDO3_ENA_MASK 0x0004 /* LDO3_ENA */ | ||
| 133 | #define WM831X_LDO3_ENA_SHIFT 2 /* LDO3_ENA */ | ||
| 134 | #define WM831X_LDO3_ENA_WIDTH 1 /* LDO3_ENA */ | ||
| 135 | #define WM831X_LDO2_ENA 0x0002 /* LDO2_ENA */ | ||
| 136 | #define WM831X_LDO2_ENA_MASK 0x0002 /* LDO2_ENA */ | ||
| 137 | #define WM831X_LDO2_ENA_SHIFT 1 /* LDO2_ENA */ | ||
| 138 | #define WM831X_LDO2_ENA_WIDTH 1 /* LDO2_ENA */ | ||
| 139 | #define WM831X_LDO1_ENA 0x0001 /* LDO1_ENA */ | ||
| 140 | #define WM831X_LDO1_ENA_MASK 0x0001 /* LDO1_ENA */ | ||
| 141 | #define WM831X_LDO1_ENA_SHIFT 0 /* LDO1_ENA */ | ||
| 142 | #define WM831X_LDO1_ENA_WIDTH 1 /* LDO1_ENA */ | ||
| 143 | |||
| 144 | /* | ||
| 145 | * R16466 (0x4052) - DCDC Status | ||
| 146 | */ | ||
| 147 | #define WM831X_EPE2_STS 0x0080 /* EPE2_STS */ | ||
| 148 | #define WM831X_EPE2_STS_MASK 0x0080 /* EPE2_STS */ | ||
| 149 | #define WM831X_EPE2_STS_SHIFT 7 /* EPE2_STS */ | ||
| 150 | #define WM831X_EPE2_STS_WIDTH 1 /* EPE2_STS */ | ||
| 151 | #define WM831X_EPE1_STS 0x0040 /* EPE1_STS */ | ||
| 152 | #define WM831X_EPE1_STS_MASK 0x0040 /* EPE1_STS */ | ||
| 153 | #define WM831X_EPE1_STS_SHIFT 6 /* EPE1_STS */ | ||
| 154 | #define WM831X_EPE1_STS_WIDTH 1 /* EPE1_STS */ | ||
| 155 | #define WM831X_DC4_STS 0x0008 /* DC4_STS */ | ||
| 156 | #define WM831X_DC4_STS_MASK 0x0008 /* DC4_STS */ | ||
| 157 | #define WM831X_DC4_STS_SHIFT 3 /* DC4_STS */ | ||
| 158 | #define WM831X_DC4_STS_WIDTH 1 /* DC4_STS */ | ||
| 159 | #define WM831X_DC3_STS 0x0004 /* DC3_STS */ | ||
| 160 | #define WM831X_DC3_STS_MASK 0x0004 /* DC3_STS */ | ||
| 161 | #define WM831X_DC3_STS_SHIFT 2 /* DC3_STS */ | ||
| 162 | #define WM831X_DC3_STS_WIDTH 1 /* DC3_STS */ | ||
| 163 | #define WM831X_DC2_STS 0x0002 /* DC2_STS */ | ||
| 164 | #define WM831X_DC2_STS_MASK 0x0002 /* DC2_STS */ | ||
| 165 | #define WM831X_DC2_STS_SHIFT 1 /* DC2_STS */ | ||
| 166 | #define WM831X_DC2_STS_WIDTH 1 /* DC2_STS */ | ||
| 167 | #define WM831X_DC1_STS 0x0001 /* DC1_STS */ | ||
| 168 | #define WM831X_DC1_STS_MASK 0x0001 /* DC1_STS */ | ||
| 169 | #define WM831X_DC1_STS_SHIFT 0 /* DC1_STS */ | ||
| 170 | #define WM831X_DC1_STS_WIDTH 1 /* DC1_STS */ | ||
| 171 | |||
| 172 | /* | ||
| 173 | * R16467 (0x4053) - LDO Status | ||
| 174 | */ | ||
| 175 | #define WM831X_LDO11_STS 0x0400 /* LDO11_STS */ | ||
| 176 | #define WM831X_LDO11_STS_MASK 0x0400 /* LDO11_STS */ | ||
| 177 | #define WM831X_LDO11_STS_SHIFT 10 /* LDO11_STS */ | ||
| 178 | #define WM831X_LDO11_STS_WIDTH 1 /* LDO11_STS */ | ||
| 179 | #define WM831X_LDO10_STS 0x0200 /* LDO10_STS */ | ||
| 180 | #define WM831X_LDO10_STS_MASK 0x0200 /* LDO10_STS */ | ||
| 181 | #define WM831X_LDO10_STS_SHIFT 9 /* LDO10_STS */ | ||
| 182 | #define WM831X_LDO10_STS_WIDTH 1 /* LDO10_STS */ | ||
| 183 | #define WM831X_LDO9_STS 0x0100 /* LDO9_STS */ | ||
| 184 | #define WM831X_LDO9_STS_MASK 0x0100 /* LDO9_STS */ | ||
| 185 | #define WM831X_LDO9_STS_SHIFT 8 /* LDO9_STS */ | ||
| 186 | #define WM831X_LDO9_STS_WIDTH 1 /* LDO9_STS */ | ||
| 187 | #define WM831X_LDO8_STS 0x0080 /* LDO8_STS */ | ||
| 188 | #define WM831X_LDO8_STS_MASK 0x0080 /* LDO8_STS */ | ||
| 189 | #define WM831X_LDO8_STS_SHIFT 7 /* LDO8_STS */ | ||
| 190 | #define WM831X_LDO8_STS_WIDTH 1 /* LDO8_STS */ | ||
| 191 | #define WM831X_LDO7_STS 0x0040 /* LDO7_STS */ | ||
| 192 | #define WM831X_LDO7_STS_MASK 0x0040 /* LDO7_STS */ | ||
| 193 | #define WM831X_LDO7_STS_SHIFT 6 /* LDO7_STS */ | ||
| 194 | #define WM831X_LDO7_STS_WIDTH 1 /* LDO7_STS */ | ||
| 195 | #define WM831X_LDO6_STS 0x0020 /* LDO6_STS */ | ||
| 196 | #define WM831X_LDO6_STS_MASK 0x0020 /* LDO6_STS */ | ||
| 197 | #define WM831X_LDO6_STS_SHIFT 5 /* LDO6_STS */ | ||
| 198 | #define WM831X_LDO6_STS_WIDTH 1 /* LDO6_STS */ | ||
| 199 | #define WM831X_LDO5_STS 0x0010 /* LDO5_STS */ | ||
| 200 | #define WM831X_LDO5_STS_MASK 0x0010 /* LDO5_STS */ | ||
| 201 | #define WM831X_LDO5_STS_SHIFT 4 /* LDO5_STS */ | ||
| 202 | #define WM831X_LDO5_STS_WIDTH 1 /* LDO5_STS */ | ||
| 203 | #define WM831X_LDO4_STS 0x0008 /* LDO4_STS */ | ||
| 204 | #define WM831X_LDO4_STS_MASK 0x0008 /* LDO4_STS */ | ||
| 205 | #define WM831X_LDO4_STS_SHIFT 3 /* LDO4_STS */ | ||
| 206 | #define WM831X_LDO4_STS_WIDTH 1 /* LDO4_STS */ | ||
| 207 | #define WM831X_LDO3_STS 0x0004 /* LDO3_STS */ | ||
| 208 | #define WM831X_LDO3_STS_MASK 0x0004 /* LDO3_STS */ | ||
| 209 | #define WM831X_LDO3_STS_SHIFT 2 /* LDO3_STS */ | ||
| 210 | #define WM831X_LDO3_STS_WIDTH 1 /* LDO3_STS */ | ||
| 211 | #define WM831X_LDO2_STS 0x0002 /* LDO2_STS */ | ||
| 212 | #define WM831X_LDO2_STS_MASK 0x0002 /* LDO2_STS */ | ||
| 213 | #define WM831X_LDO2_STS_SHIFT 1 /* LDO2_STS */ | ||
| 214 | #define WM831X_LDO2_STS_WIDTH 1 /* LDO2_STS */ | ||
| 215 | #define WM831X_LDO1_STS 0x0001 /* LDO1_STS */ | ||
| 216 | #define WM831X_LDO1_STS_MASK 0x0001 /* LDO1_STS */ | ||
| 217 | #define WM831X_LDO1_STS_SHIFT 0 /* LDO1_STS */ | ||
| 218 | #define WM831X_LDO1_STS_WIDTH 1 /* LDO1_STS */ | ||
| 219 | |||
| 220 | /* | ||
| 221 | * R16468 (0x4054) - DCDC UV Status | ||
| 222 | */ | ||
| 223 | #define WM831X_DC2_OV_STS 0x2000 /* DC2_OV_STS */ | ||
| 224 | #define WM831X_DC2_OV_STS_MASK 0x2000 /* DC2_OV_STS */ | ||
| 225 | #define WM831X_DC2_OV_STS_SHIFT 13 /* DC2_OV_STS */ | ||
| 226 | #define WM831X_DC2_OV_STS_WIDTH 1 /* DC2_OV_STS */ | ||
| 227 | #define WM831X_DC1_OV_STS 0x1000 /* DC1_OV_STS */ | ||
| 228 | #define WM831X_DC1_OV_STS_MASK 0x1000 /* DC1_OV_STS */ | ||
| 229 | #define WM831X_DC1_OV_STS_SHIFT 12 /* DC1_OV_STS */ | ||
| 230 | #define WM831X_DC1_OV_STS_WIDTH 1 /* DC1_OV_STS */ | ||
| 231 | #define WM831X_DC2_HC_STS 0x0200 /* DC2_HC_STS */ | ||
| 232 | #define WM831X_DC2_HC_STS_MASK 0x0200 /* DC2_HC_STS */ | ||
| 233 | #define WM831X_DC2_HC_STS_SHIFT 9 /* DC2_HC_STS */ | ||
| 234 | #define WM831X_DC2_HC_STS_WIDTH 1 /* DC2_HC_STS */ | ||
| 235 | #define WM831X_DC1_HC_STS 0x0100 /* DC1_HC_STS */ | ||
| 236 | #define WM831X_DC1_HC_STS_MASK 0x0100 /* DC1_HC_STS */ | ||
| 237 | #define WM831X_DC1_HC_STS_SHIFT 8 /* DC1_HC_STS */ | ||
| 238 | #define WM831X_DC1_HC_STS_WIDTH 1 /* DC1_HC_STS */ | ||
| 239 | #define WM831X_DC4_UV_STS 0x0008 /* DC4_UV_STS */ | ||
| 240 | #define WM831X_DC4_UV_STS_MASK 0x0008 /* DC4_UV_STS */ | ||
| 241 | #define WM831X_DC4_UV_STS_SHIFT 3 /* DC4_UV_STS */ | ||
| 242 | #define WM831X_DC4_UV_STS_WIDTH 1 /* DC4_UV_STS */ | ||
| 243 | #define WM831X_DC3_UV_STS 0x0004 /* DC3_UV_STS */ | ||
| 244 | #define WM831X_DC3_UV_STS_MASK 0x0004 /* DC3_UV_STS */ | ||
| 245 | #define WM831X_DC3_UV_STS_SHIFT 2 /* DC3_UV_STS */ | ||
| 246 | #define WM831X_DC3_UV_STS_WIDTH 1 /* DC3_UV_STS */ | ||
| 247 | #define WM831X_DC2_UV_STS 0x0002 /* DC2_UV_STS */ | ||
| 248 | #define WM831X_DC2_UV_STS_MASK 0x0002 /* DC2_UV_STS */ | ||
| 249 | #define WM831X_DC2_UV_STS_SHIFT 1 /* DC2_UV_STS */ | ||
| 250 | #define WM831X_DC2_UV_STS_WIDTH 1 /* DC2_UV_STS */ | ||
| 251 | #define WM831X_DC1_UV_STS 0x0001 /* DC1_UV_STS */ | ||
| 252 | #define WM831X_DC1_UV_STS_MASK 0x0001 /* DC1_UV_STS */ | ||
| 253 | #define WM831X_DC1_UV_STS_SHIFT 0 /* DC1_UV_STS */ | ||
| 254 | #define WM831X_DC1_UV_STS_WIDTH 1 /* DC1_UV_STS */ | ||
| 255 | |||
| 256 | /* | ||
| 257 | * R16469 (0x4055) - LDO UV Status | ||
| 258 | */ | ||
| 259 | #define WM831X_INTLDO_UV_STS 0x8000 /* INTLDO_UV_STS */ | ||
| 260 | #define WM831X_INTLDO_UV_STS_MASK 0x8000 /* INTLDO_UV_STS */ | ||
| 261 | #define WM831X_INTLDO_UV_STS_SHIFT 15 /* INTLDO_UV_STS */ | ||
| 262 | #define WM831X_INTLDO_UV_STS_WIDTH 1 /* INTLDO_UV_STS */ | ||
| 263 | #define WM831X_LDO10_UV_STS 0x0200 /* LDO10_UV_STS */ | ||
| 264 | #define WM831X_LDO10_UV_STS_MASK 0x0200 /* LDO10_UV_STS */ | ||
| 265 | #define WM831X_LDO10_UV_STS_SHIFT 9 /* LDO10_UV_STS */ | ||
| 266 | #define WM831X_LDO10_UV_STS_WIDTH 1 /* LDO10_UV_STS */ | ||
| 267 | #define WM831X_LDO9_UV_STS 0x0100 /* LDO9_UV_STS */ | ||
| 268 | #define WM831X_LDO9_UV_STS_MASK 0x0100 /* LDO9_UV_STS */ | ||
| 269 | #define WM831X_LDO9_UV_STS_SHIFT 8 /* LDO9_UV_STS */ | ||
| 270 | #define WM831X_LDO9_UV_STS_WIDTH 1 /* LDO9_UV_STS */ | ||
| 271 | #define WM831X_LDO8_UV_STS 0x0080 /* LDO8_UV_STS */ | ||
| 272 | #define WM831X_LDO8_UV_STS_MASK 0x0080 /* LDO8_UV_STS */ | ||
| 273 | #define WM831X_LDO8_UV_STS_SHIFT 7 /* LDO8_UV_STS */ | ||
| 274 | #define WM831X_LDO8_UV_STS_WIDTH 1 /* LDO8_UV_STS */ | ||
| 275 | #define WM831X_LDO7_UV_STS 0x0040 /* LDO7_UV_STS */ | ||
| 276 | #define WM831X_LDO7_UV_STS_MASK 0x0040 /* LDO7_UV_STS */ | ||
| 277 | #define WM831X_LDO7_UV_STS_SHIFT 6 /* LDO7_UV_STS */ | ||
| 278 | #define WM831X_LDO7_UV_STS_WIDTH 1 /* LDO7_UV_STS */ | ||
| 279 | #define WM831X_LDO6_UV_STS 0x0020 /* LDO6_UV_STS */ | ||
| 280 | #define WM831X_LDO6_UV_STS_MASK 0x0020 /* LDO6_UV_STS */ | ||
| 281 | #define WM831X_LDO6_UV_STS_SHIFT 5 /* LDO6_UV_STS */ | ||
| 282 | #define WM831X_LDO6_UV_STS_WIDTH 1 /* LDO6_UV_STS */ | ||
| 283 | #define WM831X_LDO5_UV_STS 0x0010 /* LDO5_UV_STS */ | ||
| 284 | #define WM831X_LDO5_UV_STS_MASK 0x0010 /* LDO5_UV_STS */ | ||
| 285 | #define WM831X_LDO5_UV_STS_SHIFT 4 /* LDO5_UV_STS */ | ||
| 286 | #define WM831X_LDO5_UV_STS_WIDTH 1 /* LDO5_UV_STS */ | ||
| 287 | #define WM831X_LDO4_UV_STS 0x0008 /* LDO4_UV_STS */ | ||
| 288 | #define WM831X_LDO4_UV_STS_MASK 0x0008 /* LDO4_UV_STS */ | ||
| 289 | #define WM831X_LDO4_UV_STS_SHIFT 3 /* LDO4_UV_STS */ | ||
| 290 | #define WM831X_LDO4_UV_STS_WIDTH 1 /* LDO4_UV_STS */ | ||
| 291 | #define WM831X_LDO3_UV_STS 0x0004 /* LDO3_UV_STS */ | ||
| 292 | #define WM831X_LDO3_UV_STS_MASK 0x0004 /* LDO3_UV_STS */ | ||
| 293 | #define WM831X_LDO3_UV_STS_SHIFT 2 /* LDO3_UV_STS */ | ||
| 294 | #define WM831X_LDO3_UV_STS_WIDTH 1 /* LDO3_UV_STS */ | ||
| 295 | #define WM831X_LDO2_UV_STS 0x0002 /* LDO2_UV_STS */ | ||
| 296 | #define WM831X_LDO2_UV_STS_MASK 0x0002 /* LDO2_UV_STS */ | ||
| 297 | #define WM831X_LDO2_UV_STS_SHIFT 1 /* LDO2_UV_STS */ | ||
| 298 | #define WM831X_LDO2_UV_STS_WIDTH 1 /* LDO2_UV_STS */ | ||
| 299 | #define WM831X_LDO1_UV_STS 0x0001 /* LDO1_UV_STS */ | ||
| 300 | #define WM831X_LDO1_UV_STS_MASK 0x0001 /* LDO1_UV_STS */ | ||
| 301 | #define WM831X_LDO1_UV_STS_SHIFT 0 /* LDO1_UV_STS */ | ||
| 302 | #define WM831X_LDO1_UV_STS_WIDTH 1 /* LDO1_UV_STS */ | ||
| 303 | |||
| 304 | /* | ||
| 305 | * R16470 (0x4056) - DC1 Control 1 | ||
| 306 | */ | ||
| 307 | #define WM831X_DC1_RATE_MASK 0xC000 /* DC1_RATE - [15:14] */ | ||
| 308 | #define WM831X_DC1_RATE_SHIFT 14 /* DC1_RATE - [15:14] */ | ||
| 309 | #define WM831X_DC1_RATE_WIDTH 2 /* DC1_RATE - [15:14] */ | ||
| 310 | #define WM831X_DC1_PHASE 0x1000 /* DC1_PHASE */ | ||
| 311 | #define WM831X_DC1_PHASE_MASK 0x1000 /* DC1_PHASE */ | ||
| 312 | #define WM831X_DC1_PHASE_SHIFT 12 /* DC1_PHASE */ | ||
| 313 | #define WM831X_DC1_PHASE_WIDTH 1 /* DC1_PHASE */ | ||
| 314 | #define WM831X_DC1_FREQ_MASK 0x0300 /* DC1_FREQ - [9:8] */ | ||
| 315 | #define WM831X_DC1_FREQ_SHIFT 8 /* DC1_FREQ - [9:8] */ | ||
| 316 | #define WM831X_DC1_FREQ_WIDTH 2 /* DC1_FREQ - [9:8] */ | ||
| 317 | #define WM831X_DC1_FLT 0x0080 /* DC1_FLT */ | ||
| 318 | #define WM831X_DC1_FLT_MASK 0x0080 /* DC1_FLT */ | ||
| 319 | #define WM831X_DC1_FLT_SHIFT 7 /* DC1_FLT */ | ||
| 320 | #define WM831X_DC1_FLT_WIDTH 1 /* DC1_FLT */ | ||
| 321 | #define WM831X_DC1_SOFT_START_MASK 0x0030 /* DC1_SOFT_START - [5:4] */ | ||
| 322 | #define WM831X_DC1_SOFT_START_SHIFT 4 /* DC1_SOFT_START - [5:4] */ | ||
| 323 | #define WM831X_DC1_SOFT_START_WIDTH 2 /* DC1_SOFT_START - [5:4] */ | ||
| 324 | #define WM831X_DC1_CAP_MASK 0x0003 /* DC1_CAP - [1:0] */ | ||
| 325 | #define WM831X_DC1_CAP_SHIFT 0 /* DC1_CAP - [1:0] */ | ||
| 326 | #define WM831X_DC1_CAP_WIDTH 2 /* DC1_CAP - [1:0] */ | ||
| 327 | |||
| 328 | /* | ||
| 329 | * R16471 (0x4057) - DC1 Control 2 | ||
| 330 | */ | ||
| 331 | #define WM831X_DC1_ERR_ACT_MASK 0xC000 /* DC1_ERR_ACT - [15:14] */ | ||
| 332 | #define WM831X_DC1_ERR_ACT_SHIFT 14 /* DC1_ERR_ACT - [15:14] */ | ||
| 333 | #define WM831X_DC1_ERR_ACT_WIDTH 2 /* DC1_ERR_ACT - [15:14] */ | ||
| 334 | #define WM831X_DC1_HWC_SRC_MASK 0x1800 /* DC1_HWC_SRC - [12:11] */ | ||
| 335 | #define WM831X_DC1_HWC_SRC_SHIFT 11 /* DC1_HWC_SRC - [12:11] */ | ||
| 336 | #define WM831X_DC1_HWC_SRC_WIDTH 2 /* DC1_HWC_SRC - [12:11] */ | ||
| 337 | #define WM831X_DC1_HWC_VSEL 0x0400 /* DC1_HWC_VSEL */ | ||
| 338 | #define WM831X_DC1_HWC_VSEL_MASK 0x0400 /* DC1_HWC_VSEL */ | ||
| 339 | #define WM831X_DC1_HWC_VSEL_SHIFT 10 /* DC1_HWC_VSEL */ | ||
| 340 | #define WM831X_DC1_HWC_VSEL_WIDTH 1 /* DC1_HWC_VSEL */ | ||
| 341 | #define WM831X_DC1_HWC_MODE_MASK 0x0300 /* DC1_HWC_MODE - [9:8] */ | ||
| 342 | #define WM831X_DC1_HWC_MODE_SHIFT 8 /* DC1_HWC_MODE - [9:8] */ | ||
| 343 | #define WM831X_DC1_HWC_MODE_WIDTH 2 /* DC1_HWC_MODE - [9:8] */ | ||
| 344 | #define WM831X_DC1_HC_THR_MASK 0x0070 /* DC1_HC_THR - [6:4] */ | ||
| 345 | #define WM831X_DC1_HC_THR_SHIFT 4 /* DC1_HC_THR - [6:4] */ | ||
| 346 | #define WM831X_DC1_HC_THR_WIDTH 3 /* DC1_HC_THR - [6:4] */ | ||
| 347 | #define WM831X_DC1_HC_IND_ENA 0x0001 /* DC1_HC_IND_ENA */ | ||
| 348 | #define WM831X_DC1_HC_IND_ENA_MASK 0x0001 /* DC1_HC_IND_ENA */ | ||
| 349 | #define WM831X_DC1_HC_IND_ENA_SHIFT 0 /* DC1_HC_IND_ENA */ | ||
| 350 | #define WM831X_DC1_HC_IND_ENA_WIDTH 1 /* DC1_HC_IND_ENA */ | ||
| 351 | |||
| 352 | /* | ||
| 353 | * R16472 (0x4058) - DC1 ON Config | ||
| 354 | */ | ||
| 355 | #define WM831X_DC1_ON_SLOT_MASK 0xE000 /* DC1_ON_SLOT - [15:13] */ | ||
| 356 | #define WM831X_DC1_ON_SLOT_SHIFT 13 /* DC1_ON_SLOT - [15:13] */ | ||
| 357 | #define WM831X_DC1_ON_SLOT_WIDTH 3 /* DC1_ON_SLOT - [15:13] */ | ||
| 358 | #define WM831X_DC1_ON_MODE_MASK 0x0300 /* DC1_ON_MODE - [9:8] */ | ||
| 359 | #define WM831X_DC1_ON_MODE_SHIFT 8 /* DC1_ON_MODE - [9:8] */ | ||
| 360 | #define WM831X_DC1_ON_MODE_WIDTH 2 /* DC1_ON_MODE - [9:8] */ | ||
| 361 | #define WM831X_DC1_ON_VSEL_MASK 0x007F /* DC1_ON_VSEL - [6:0] */ | ||
| 362 | #define WM831X_DC1_ON_VSEL_SHIFT 0 /* DC1_ON_VSEL - [6:0] */ | ||
| 363 | #define WM831X_DC1_ON_VSEL_WIDTH 7 /* DC1_ON_VSEL - [6:0] */ | ||
| 364 | |||
| 365 | /* | ||
| 366 | * R16473 (0x4059) - DC1 SLEEP Control | ||
| 367 | */ | ||
| 368 | #define WM831X_DC1_SLP_SLOT_MASK 0xE000 /* DC1_SLP_SLOT - [15:13] */ | ||
| 369 | #define WM831X_DC1_SLP_SLOT_SHIFT 13 /* DC1_SLP_SLOT - [15:13] */ | ||
| 370 | #define WM831X_DC1_SLP_SLOT_WIDTH 3 /* DC1_SLP_SLOT - [15:13] */ | ||
| 371 | #define WM831X_DC1_SLP_MODE_MASK 0x0300 /* DC1_SLP_MODE - [9:8] */ | ||
| 372 | #define WM831X_DC1_SLP_MODE_SHIFT 8 /* DC1_SLP_MODE - [9:8] */ | ||
| 373 | #define WM831X_DC1_SLP_MODE_WIDTH 2 /* DC1_SLP_MODE - [9:8] */ | ||
| 374 | #define WM831X_DC1_SLP_VSEL_MASK 0x007F /* DC1_SLP_VSEL - [6:0] */ | ||
| 375 | #define WM831X_DC1_SLP_VSEL_SHIFT 0 /* DC1_SLP_VSEL - [6:0] */ | ||
| 376 | #define WM831X_DC1_SLP_VSEL_WIDTH 7 /* DC1_SLP_VSEL - [6:0] */ | ||
| 377 | |||
| 378 | /* | ||
| 379 | * R16474 (0x405A) - DC1 DVS Control | ||
| 380 | */ | ||
| 381 | #define WM831X_DC1_DVS_SRC_MASK 0x1800 /* DC1_DVS_SRC - [12:11] */ | ||
| 382 | #define WM831X_DC1_DVS_SRC_SHIFT 11 /* DC1_DVS_SRC - [12:11] */ | ||
| 383 | #define WM831X_DC1_DVS_SRC_WIDTH 2 /* DC1_DVS_SRC - [12:11] */ | ||
| 384 | #define WM831X_DC1_DVS_VSEL_MASK 0x007F /* DC1_DVS_VSEL - [6:0] */ | ||
| 385 | #define WM831X_DC1_DVS_VSEL_SHIFT 0 /* DC1_DVS_VSEL - [6:0] */ | ||
| 386 | #define WM831X_DC1_DVS_VSEL_WIDTH 7 /* DC1_DVS_VSEL - [6:0] */ | ||
| 387 | |||
| 388 | /* | ||
| 389 | * R16475 (0x405B) - DC2 Control 1 | ||
| 390 | */ | ||
| 391 | #define WM831X_DC2_RATE_MASK 0xC000 /* DC2_RATE - [15:14] */ | ||
| 392 | #define WM831X_DC2_RATE_SHIFT 14 /* DC2_RATE - [15:14] */ | ||
| 393 | #define WM831X_DC2_RATE_WIDTH 2 /* DC2_RATE - [15:14] */ | ||
| 394 | #define WM831X_DC2_PHASE 0x1000 /* DC2_PHASE */ | ||
| 395 | #define WM831X_DC2_PHASE_MASK 0x1000 /* DC2_PHASE */ | ||
| 396 | #define WM831X_DC2_PHASE_SHIFT 12 /* DC2_PHASE */ | ||
| 397 | #define WM831X_DC2_PHASE_WIDTH 1 /* DC2_PHASE */ | ||
| 398 | #define WM831X_DC2_FREQ_MASK 0x0300 /* DC2_FREQ - [9:8] */ | ||
| 399 | #define WM831X_DC2_FREQ_SHIFT 8 /* DC2_FREQ - [9:8] */ | ||
| 400 | #define WM831X_DC2_FREQ_WIDTH 2 /* DC2_FREQ - [9:8] */ | ||
| 401 | #define WM831X_DC2_FLT 0x0080 /* DC2_FLT */ | ||
| 402 | #define WM831X_DC2_FLT_MASK 0x0080 /* DC2_FLT */ | ||
| 403 | #define WM831X_DC2_FLT_SHIFT 7 /* DC2_FLT */ | ||
| 404 | #define WM831X_DC2_FLT_WIDTH 1 /* DC2_FLT */ | ||
| 405 | #define WM831X_DC2_SOFT_START_MASK 0x0030 /* DC2_SOFT_START - [5:4] */ | ||
| 406 | #define WM831X_DC2_SOFT_START_SHIFT 4 /* DC2_SOFT_START - [5:4] */ | ||
| 407 | #define WM831X_DC2_SOFT_START_WIDTH 2 /* DC2_SOFT_START - [5:4] */ | ||
| 408 | #define WM831X_DC2_CAP_MASK 0x0003 /* DC2_CAP - [1:0] */ | ||
| 409 | #define WM831X_DC2_CAP_SHIFT 0 /* DC2_CAP - [1:0] */ | ||
| 410 | #define WM831X_DC2_CAP_WIDTH 2 /* DC2_CAP - [1:0] */ | ||
| 411 | |||
| 412 | /* | ||
| 413 | * R16476 (0x405C) - DC2 Control 2 | ||
| 414 | */ | ||
| 415 | #define WM831X_DC2_ERR_ACT_MASK 0xC000 /* DC2_ERR_ACT - [15:14] */ | ||
| 416 | #define WM831X_DC2_ERR_ACT_SHIFT 14 /* DC2_ERR_ACT - [15:14] */ | ||
| 417 | #define WM831X_DC2_ERR_ACT_WIDTH 2 /* DC2_ERR_ACT - [15:14] */ | ||
| 418 | #define WM831X_DC2_HWC_SRC_MASK 0x1800 /* DC2_HWC_SRC - [12:11] */ | ||
| 419 | #define WM831X_DC2_HWC_SRC_SHIFT 11 /* DC2_HWC_SRC - [12:11] */ | ||
| 420 | #define WM831X_DC2_HWC_SRC_WIDTH 2 /* DC2_HWC_SRC - [12:11] */ | ||
| 421 | #define WM831X_DC2_HWC_VSEL 0x0400 /* DC2_HWC_VSEL */ | ||
| 422 | #define WM831X_DC2_HWC_VSEL_MASK 0x0400 /* DC2_HWC_VSEL */ | ||
| 423 | #define WM831X_DC2_HWC_VSEL_SHIFT 10 /* DC2_HWC_VSEL */ | ||
| 424 | #define WM831X_DC2_HWC_VSEL_WIDTH 1 /* DC2_HWC_VSEL */ | ||
| 425 | #define WM831X_DC2_HWC_MODE_MASK 0x0300 /* DC2_HWC_MODE - [9:8] */ | ||
| 426 | #define WM831X_DC2_HWC_MODE_SHIFT 8 /* DC2_HWC_MODE - [9:8] */ | ||
| 427 | #define WM831X_DC2_HWC_MODE_WIDTH 2 /* DC2_HWC_MODE - [9:8] */ | ||
| 428 | #define WM831X_DC2_HC_THR_MASK 0x0070 /* DC2_HC_THR - [6:4] */ | ||
| 429 | #define WM831X_DC2_HC_THR_SHIFT 4 /* DC2_HC_THR - [6:4] */ | ||
| 430 | #define WM831X_DC2_HC_THR_WIDTH 3 /* DC2_HC_THR - [6:4] */ | ||
| 431 | #define WM831X_DC2_HC_IND_ENA 0x0001 /* DC2_HC_IND_ENA */ | ||
| 432 | #define WM831X_DC2_HC_IND_ENA_MASK 0x0001 /* DC2_HC_IND_ENA */ | ||
| 433 | #define WM831X_DC2_HC_IND_ENA_SHIFT 0 /* DC2_HC_IND_ENA */ | ||
| 434 | #define WM831X_DC2_HC_IND_ENA_WIDTH 1 /* DC2_HC_IND_ENA */ | ||
| 435 | |||
| 436 | /* | ||
| 437 | * R16477 (0x405D) - DC2 ON Config | ||
| 438 | */ | ||
| 439 | #define WM831X_DC2_ON_SLOT_MASK 0xE000 /* DC2_ON_SLOT - [15:13] */ | ||
| 440 | #define WM831X_DC2_ON_SLOT_SHIFT 13 /* DC2_ON_SLOT - [15:13] */ | ||
| 441 | #define WM831X_DC2_ON_SLOT_WIDTH 3 /* DC2_ON_SLOT - [15:13] */ | ||
| 442 | #define WM831X_DC2_ON_MODE_MASK 0x0300 /* DC2_ON_MODE - [9:8] */ | ||
| 443 | #define WM831X_DC2_ON_MODE_SHIFT 8 /* DC2_ON_MODE - [9:8] */ | ||
| 444 | #define WM831X_DC2_ON_MODE_WIDTH 2 /* DC2_ON_MODE - [9:8] */ | ||
| 445 | #define WM831X_DC2_ON_VSEL_MASK 0x007F /* DC2_ON_VSEL - [6:0] */ | ||
| 446 | #define WM831X_DC2_ON_VSEL_SHIFT 0 /* DC2_ON_VSEL - [6:0] */ | ||
| 447 | #define WM831X_DC2_ON_VSEL_WIDTH 7 /* DC2_ON_VSEL - [6:0] */ | ||
| 448 | |||
| 449 | /* | ||
| 450 | * R16478 (0x405E) - DC2 SLEEP Control | ||
| 451 | */ | ||
| 452 | #define WM831X_DC2_SLP_SLOT_MASK 0xE000 /* DC2_SLP_SLOT - [15:13] */ | ||
| 453 | #define WM831X_DC2_SLP_SLOT_SHIFT 13 /* DC2_SLP_SLOT - [15:13] */ | ||
| 454 | #define WM831X_DC2_SLP_SLOT_WIDTH 3 /* DC2_SLP_SLOT - [15:13] */ | ||
| 455 | #define WM831X_DC2_SLP_MODE_MASK 0x0300 /* DC2_SLP_MODE - [9:8] */ | ||
| 456 | #define WM831X_DC2_SLP_MODE_SHIFT 8 /* DC2_SLP_MODE - [9:8] */ | ||
| 457 | #define WM831X_DC2_SLP_MODE_WIDTH 2 /* DC2_SLP_MODE - [9:8] */ | ||
| 458 | #define WM831X_DC2_SLP_VSEL_MASK 0x007F /* DC2_SLP_VSEL - [6:0] */ | ||
| 459 | #define WM831X_DC2_SLP_VSEL_SHIFT 0 /* DC2_SLP_VSEL - [6:0] */ | ||
| 460 | #define WM831X_DC2_SLP_VSEL_WIDTH 7 /* DC2_SLP_VSEL - [6:0] */ | ||
| 461 | |||
| 462 | /* | ||
| 463 | * R16479 (0x405F) - DC2 DVS Control | ||
| 464 | */ | ||
| 465 | #define WM831X_DC2_DVS_SRC_MASK 0x1800 /* DC2_DVS_SRC - [12:11] */ | ||
| 466 | #define WM831X_DC2_DVS_SRC_SHIFT 11 /* DC2_DVS_SRC - [12:11] */ | ||
| 467 | #define WM831X_DC2_DVS_SRC_WIDTH 2 /* DC2_DVS_SRC - [12:11] */ | ||
| 468 | #define WM831X_DC2_DVS_VSEL_MASK 0x007F /* DC2_DVS_VSEL - [6:0] */ | ||
| 469 | #define WM831X_DC2_DVS_VSEL_SHIFT 0 /* DC2_DVS_VSEL - [6:0] */ | ||
| 470 | #define WM831X_DC2_DVS_VSEL_WIDTH 7 /* DC2_DVS_VSEL - [6:0] */ | ||
| 471 | |||
| 472 | /* | ||
| 473 | * R16480 (0x4060) - DC3 Control 1 | ||
| 474 | */ | ||
| 475 | #define WM831X_DC3_PHASE 0x1000 /* DC3_PHASE */ | ||
| 476 | #define WM831X_DC3_PHASE_MASK 0x1000 /* DC3_PHASE */ | ||
| 477 | #define WM831X_DC3_PHASE_SHIFT 12 /* DC3_PHASE */ | ||
| 478 | #define WM831X_DC3_PHASE_WIDTH 1 /* DC3_PHASE */ | ||
| 479 | #define WM831X_DC3_FLT 0x0080 /* DC3_FLT */ | ||
| 480 | #define WM831X_DC3_FLT_MASK 0x0080 /* DC3_FLT */ | ||
| 481 | #define WM831X_DC3_FLT_SHIFT 7 /* DC3_FLT */ | ||
| 482 | #define WM831X_DC3_FLT_WIDTH 1 /* DC3_FLT */ | ||
| 483 | #define WM831X_DC3_SOFT_START_MASK 0x0030 /* DC3_SOFT_START - [5:4] */ | ||
| 484 | #define WM831X_DC3_SOFT_START_SHIFT 4 /* DC3_SOFT_START - [5:4] */ | ||
| 485 | #define WM831X_DC3_SOFT_START_WIDTH 2 /* DC3_SOFT_START - [5:4] */ | ||
| 486 | #define WM831X_DC3_STNBY_LIM_MASK 0x000C /* DC3_STNBY_LIM - [3:2] */ | ||
| 487 | #define WM831X_DC3_STNBY_LIM_SHIFT 2 /* DC3_STNBY_LIM - [3:2] */ | ||
| 488 | #define WM831X_DC3_STNBY_LIM_WIDTH 2 /* DC3_STNBY_LIM - [3:2] */ | ||
| 489 | #define WM831X_DC3_CAP_MASK 0x0003 /* DC3_CAP - [1:0] */ | ||
| 490 | #define WM831X_DC3_CAP_SHIFT 0 /* DC3_CAP - [1:0] */ | ||
| 491 | #define WM831X_DC3_CAP_WIDTH 2 /* DC3_CAP - [1:0] */ | ||
| 492 | |||
| 493 | /* | ||
| 494 | * R16481 (0x4061) - DC3 Control 2 | ||
| 495 | */ | ||
| 496 | #define WM831X_DC3_ERR_ACT_MASK 0xC000 /* DC3_ERR_ACT - [15:14] */ | ||
| 497 | #define WM831X_DC3_ERR_ACT_SHIFT 14 /* DC3_ERR_ACT - [15:14] */ | ||
| 498 | #define WM831X_DC3_ERR_ACT_WIDTH 2 /* DC3_ERR_ACT - [15:14] */ | ||
| 499 | #define WM831X_DC3_HWC_SRC_MASK 0x1800 /* DC3_HWC_SRC - [12:11] */ | ||
| 500 | #define WM831X_DC3_HWC_SRC_SHIFT 11 /* DC3_HWC_SRC - [12:11] */ | ||
| 501 | #define WM831X_DC3_HWC_SRC_WIDTH 2 /* DC3_HWC_SRC - [12:11] */ | ||
| 502 | #define WM831X_DC3_HWC_VSEL 0x0400 /* DC3_HWC_VSEL */ | ||
| 503 | #define WM831X_DC3_HWC_VSEL_MASK 0x0400 /* DC3_HWC_VSEL */ | ||
| 504 | #define WM831X_DC3_HWC_VSEL_SHIFT 10 /* DC3_HWC_VSEL */ | ||
| 505 | #define WM831X_DC3_HWC_VSEL_WIDTH 1 /* DC3_HWC_VSEL */ | ||
| 506 | #define WM831X_DC3_HWC_MODE_MASK 0x0300 /* DC3_HWC_MODE - [9:8] */ | ||
| 507 | #define WM831X_DC3_HWC_MODE_SHIFT 8 /* DC3_HWC_MODE - [9:8] */ | ||
| 508 | #define WM831X_DC3_HWC_MODE_WIDTH 2 /* DC3_HWC_MODE - [9:8] */ | ||
| 509 | #define WM831X_DC3_OVP 0x0080 /* DC3_OVP */ | ||
| 510 | #define WM831X_DC3_OVP_MASK 0x0080 /* DC3_OVP */ | ||
| 511 | #define WM831X_DC3_OVP_SHIFT 7 /* DC3_OVP */ | ||
| 512 | #define WM831X_DC3_OVP_WIDTH 1 /* DC3_OVP */ | ||
| 513 | |||
| 514 | /* | ||
| 515 | * R16482 (0x4062) - DC3 ON Config | ||
| 516 | */ | ||
| 517 | #define WM831X_DC3_ON_SLOT_MASK 0xE000 /* DC3_ON_SLOT - [15:13] */ | ||
| 518 | #define WM831X_DC3_ON_SLOT_SHIFT 13 /* DC3_ON_SLOT - [15:13] */ | ||
| 519 | #define WM831X_DC3_ON_SLOT_WIDTH 3 /* DC3_ON_SLOT - [15:13] */ | ||
| 520 | #define WM831X_DC3_ON_MODE_MASK 0x0300 /* DC3_ON_MODE - [9:8] */ | ||
| 521 | #define WM831X_DC3_ON_MODE_SHIFT 8 /* DC3_ON_MODE - [9:8] */ | ||
| 522 | #define WM831X_DC3_ON_MODE_WIDTH 2 /* DC3_ON_MODE - [9:8] */ | ||
| 523 | #define WM831X_DC3_ON_VSEL_MASK 0x007F /* DC3_ON_VSEL - [6:0] */ | ||
| 524 | #define WM831X_DC3_ON_VSEL_SHIFT 0 /* DC3_ON_VSEL - [6:0] */ | ||
| 525 | #define WM831X_DC3_ON_VSEL_WIDTH 7 /* DC3_ON_VSEL - [6:0] */ | ||
| 526 | |||
| 527 | /* | ||
| 528 | * R16483 (0x4063) - DC3 SLEEP Control | ||
| 529 | */ | ||
| 530 | #define WM831X_DC3_SLP_SLOT_MASK 0xE000 /* DC3_SLP_SLOT - [15:13] */ | ||
| 531 | #define WM831X_DC3_SLP_SLOT_SHIFT 13 /* DC3_SLP_SLOT - [15:13] */ | ||
| 532 | #define WM831X_DC3_SLP_SLOT_WIDTH 3 /* DC3_SLP_SLOT - [15:13] */ | ||
| 533 | #define WM831X_DC3_SLP_MODE_MASK 0x0300 /* DC3_SLP_MODE - [9:8] */ | ||
| 534 | #define WM831X_DC3_SLP_MODE_SHIFT 8 /* DC3_SLP_MODE - [9:8] */ | ||
| 535 | #define WM831X_DC3_SLP_MODE_WIDTH 2 /* DC3_SLP_MODE - [9:8] */ | ||
| 536 | #define WM831X_DC3_SLP_VSEL_MASK 0x007F /* DC3_SLP_VSEL - [6:0] */ | ||
| 537 | #define WM831X_DC3_SLP_VSEL_SHIFT 0 /* DC3_SLP_VSEL - [6:0] */ | ||
| 538 | #define WM831X_DC3_SLP_VSEL_WIDTH 7 /* DC3_SLP_VSEL - [6:0] */ | ||
| 539 | |||
| 540 | /* | ||
| 541 | * R16484 (0x4064) - DC4 Control | ||
| 542 | */ | ||
| 543 | #define WM831X_DC4_ERR_ACT_MASK 0xC000 /* DC4_ERR_ACT - [15:14] */ | ||
| 544 | #define WM831X_DC4_ERR_ACT_SHIFT 14 /* DC4_ERR_ACT - [15:14] */ | ||
| 545 | #define WM831X_DC4_ERR_ACT_WIDTH 2 /* DC4_ERR_ACT - [15:14] */ | ||
| 546 | #define WM831X_DC4_HWC_SRC_MASK 0x1800 /* DC4_HWC_SRC - [12:11] */ | ||
| 547 | #define WM831X_DC4_HWC_SRC_SHIFT 11 /* DC4_HWC_SRC - [12:11] */ | ||
| 548 | #define WM831X_DC4_HWC_SRC_WIDTH 2 /* DC4_HWC_SRC - [12:11] */ | ||
| 549 | #define WM831X_DC4_HWC_MODE 0x0100 /* DC4_HWC_MODE */ | ||
| 550 | #define WM831X_DC4_HWC_MODE_MASK 0x0100 /* DC4_HWC_MODE */ | ||
| 551 | #define WM831X_DC4_HWC_MODE_SHIFT 8 /* DC4_HWC_MODE */ | ||
| 552 | #define WM831X_DC4_HWC_MODE_WIDTH 1 /* DC4_HWC_MODE */ | ||
| 553 | #define WM831X_DC4_RANGE_MASK 0x000C /* DC4_RANGE - [3:2] */ | ||
| 554 | #define WM831X_DC4_RANGE_SHIFT 2 /* DC4_RANGE - [3:2] */ | ||
| 555 | #define WM831X_DC4_RANGE_WIDTH 2 /* DC4_RANGE - [3:2] */ | ||
| 556 | #define WM831X_DC4_FBSRC 0x0001 /* DC4_FBSRC */ | ||
| 557 | #define WM831X_DC4_FBSRC_MASK 0x0001 /* DC4_FBSRC */ | ||
| 558 | #define WM831X_DC4_FBSRC_SHIFT 0 /* DC4_FBSRC */ | ||
| 559 | #define WM831X_DC4_FBSRC_WIDTH 1 /* DC4_FBSRC */ | ||
| 560 | |||
| 561 | /* | ||
| 562 | * R16485 (0x4065) - DC4 SLEEP Control | ||
| 563 | */ | ||
| 564 | #define WM831X_DC4_SLPENA 0x0100 /* DC4_SLPENA */ | ||
| 565 | #define WM831X_DC4_SLPENA_MASK 0x0100 /* DC4_SLPENA */ | ||
| 566 | #define WM831X_DC4_SLPENA_SHIFT 8 /* DC4_SLPENA */ | ||
| 567 | #define WM831X_DC4_SLPENA_WIDTH 1 /* DC4_SLPENA */ | ||
| 568 | |||
| 569 | /* | ||
| 570 | * R16488 (0x4068) - LDO1 Control | ||
| 571 | */ | ||
| 572 | #define WM831X_LDO1_ERR_ACT_MASK 0xC000 /* LDO1_ERR_ACT - [15:14] */ | ||
| 573 | #define WM831X_LDO1_ERR_ACT_SHIFT 14 /* LDO1_ERR_ACT - [15:14] */ | ||
| 574 | #define WM831X_LDO1_ERR_ACT_WIDTH 2 /* LDO1_ERR_ACT - [15:14] */ | ||
| 575 | #define WM831X_LDO1_HWC_SRC_MASK 0x1800 /* LDO1_HWC_SRC - [12:11] */ | ||
| 576 | #define WM831X_LDO1_HWC_SRC_SHIFT 11 /* LDO1_HWC_SRC - [12:11] */ | ||
| 577 | #define WM831X_LDO1_HWC_SRC_WIDTH 2 /* LDO1_HWC_SRC - [12:11] */ | ||
| 578 | #define WM831X_LDO1_HWC_VSEL 0x0400 /* LDO1_HWC_VSEL */ | ||
| 579 | #define WM831X_LDO1_HWC_VSEL_MASK 0x0400 /* LDO1_HWC_VSEL */ | ||
| 580 | #define WM831X_LDO1_HWC_VSEL_SHIFT 10 /* LDO1_HWC_VSEL */ | ||
| 581 | #define WM831X_LDO1_HWC_VSEL_WIDTH 1 /* LDO1_HWC_VSEL */ | ||
| 582 | #define WM831X_LDO1_HWC_MODE_MASK 0x0300 /* LDO1_HWC_MODE - [9:8] */ | ||
| 583 | #define WM831X_LDO1_HWC_MODE_SHIFT 8 /* LDO1_HWC_MODE - [9:8] */ | ||
| 584 | #define WM831X_LDO1_HWC_MODE_WIDTH 2 /* LDO1_HWC_MODE - [9:8] */ | ||
| 585 | #define WM831X_LDO1_FLT 0x0080 /* LDO1_FLT */ | ||
| 586 | #define WM831X_LDO1_FLT_MASK 0x0080 /* LDO1_FLT */ | ||
| 587 | #define WM831X_LDO1_FLT_SHIFT 7 /* LDO1_FLT */ | ||
| 588 | #define WM831X_LDO1_FLT_WIDTH 1 /* LDO1_FLT */ | ||
| 589 | #define WM831X_LDO1_SWI 0x0040 /* LDO1_SWI */ | ||
| 590 | #define WM831X_LDO1_SWI_MASK 0x0040 /* LDO1_SWI */ | ||
| 591 | #define WM831X_LDO1_SWI_SHIFT 6 /* LDO1_SWI */ | ||
| 592 | #define WM831X_LDO1_SWI_WIDTH 1 /* LDO1_SWI */ | ||
| 593 | #define WM831X_LDO1_LP_MODE 0x0001 /* LDO1_LP_MODE */ | ||
| 594 | #define WM831X_LDO1_LP_MODE_MASK 0x0001 /* LDO1_LP_MODE */ | ||
| 595 | #define WM831X_LDO1_LP_MODE_SHIFT 0 /* LDO1_LP_MODE */ | ||
| 596 | #define WM831X_LDO1_LP_MODE_WIDTH 1 /* LDO1_LP_MODE */ | ||
| 597 | |||
| 598 | /* | ||
| 599 | * R16489 (0x4069) - LDO1 ON Control | ||
| 600 | */ | ||
| 601 | #define WM831X_LDO1_ON_SLOT_MASK 0xE000 /* LDO1_ON_SLOT - [15:13] */ | ||
| 602 | #define WM831X_LDO1_ON_SLOT_SHIFT 13 /* LDO1_ON_SLOT - [15:13] */ | ||
| 603 | #define WM831X_LDO1_ON_SLOT_WIDTH 3 /* LDO1_ON_SLOT - [15:13] */ | ||
| 604 | #define WM831X_LDO1_ON_MODE 0x0100 /* LDO1_ON_MODE */ | ||
| 605 | #define WM831X_LDO1_ON_MODE_MASK 0x0100 /* LDO1_ON_MODE */ | ||
| 606 | #define WM831X_LDO1_ON_MODE_SHIFT 8 /* LDO1_ON_MODE */ | ||
| 607 | #define WM831X_LDO1_ON_MODE_WIDTH 1 /* LDO1_ON_MODE */ | ||
| 608 | #define WM831X_LDO1_ON_VSEL_MASK 0x001F /* LDO1_ON_VSEL - [4:0] */ | ||
| 609 | #define WM831X_LDO1_ON_VSEL_SHIFT 0 /* LDO1_ON_VSEL - [4:0] */ | ||
| 610 | #define WM831X_LDO1_ON_VSEL_WIDTH 5 /* LDO1_ON_VSEL - [4:0] */ | ||
| 611 | |||
| 612 | /* | ||
| 613 | * R16490 (0x406A) - LDO1 SLEEP Control | ||
| 614 | */ | ||
| 615 | #define WM831X_LDO1_SLP_SLOT_MASK 0xE000 /* LDO1_SLP_SLOT - [15:13] */ | ||
| 616 | #define WM831X_LDO1_SLP_SLOT_SHIFT 13 /* LDO1_SLP_SLOT - [15:13] */ | ||
| 617 | #define WM831X_LDO1_SLP_SLOT_WIDTH 3 /* LDO1_SLP_SLOT - [15:13] */ | ||
| 618 | #define WM831X_LDO1_SLP_MODE 0x0100 /* LDO1_SLP_MODE */ | ||
| 619 | #define WM831X_LDO1_SLP_MODE_MASK 0x0100 /* LDO1_SLP_MODE */ | ||
| 620 | #define WM831X_LDO1_SLP_MODE_SHIFT 8 /* LDO1_SLP_MODE */ | ||
| 621 | #define WM831X_LDO1_SLP_MODE_WIDTH 1 /* LDO1_SLP_MODE */ | ||
| 622 | #define WM831X_LDO1_SLP_VSEL_MASK 0x001F /* LDO1_SLP_VSEL - [4:0] */ | ||
| 623 | #define WM831X_LDO1_SLP_VSEL_SHIFT 0 /* LDO1_SLP_VSEL - [4:0] */ | ||
| 624 | #define WM831X_LDO1_SLP_VSEL_WIDTH 5 /* LDO1_SLP_VSEL - [4:0] */ | ||
| 625 | |||
| 626 | /* | ||
| 627 | * R16491 (0x406B) - LDO2 Control | ||
| 628 | */ | ||
| 629 | #define WM831X_LDO2_ERR_ACT_MASK 0xC000 /* LDO2_ERR_ACT - [15:14] */ | ||
| 630 | #define WM831X_LDO2_ERR_ACT_SHIFT 14 /* LDO2_ERR_ACT - [15:14] */ | ||
| 631 | #define WM831X_LDO2_ERR_ACT_WIDTH 2 /* LDO2_ERR_ACT - [15:14] */ | ||
| 632 | #define WM831X_LDO2_HWC_SRC_MASK 0x1800 /* LDO2_HWC_SRC - [12:11] */ | ||
| 633 | #define WM831X_LDO2_HWC_SRC_SHIFT 11 /* LDO2_HWC_SRC - [12:11] */ | ||
| 634 | #define WM831X_LDO2_HWC_SRC_WIDTH 2 /* LDO2_HWC_SRC - [12:11] */ | ||
| 635 | #define WM831X_LDO2_HWC_VSEL 0x0400 /* LDO2_HWC_VSEL */ | ||
| 636 | #define WM831X_LDO2_HWC_VSEL_MASK 0x0400 /* LDO2_HWC_VSEL */ | ||
| 637 | #define WM831X_LDO2_HWC_VSEL_SHIFT 10 /* LDO2_HWC_VSEL */ | ||
| 638 | #define WM831X_LDO2_HWC_VSEL_WIDTH 1 /* LDO2_HWC_VSEL */ | ||
| 639 | #define WM831X_LDO2_HWC_MODE_MASK 0x0300 /* LDO2_HWC_MODE - [9:8] */ | ||
| 640 | #define WM831X_LDO2_HWC_MODE_SHIFT 8 /* LDO2_HWC_MODE - [9:8] */ | ||
| 641 | #define WM831X_LDO2_HWC_MODE_WIDTH 2 /* LDO2_HWC_MODE - [9:8] */ | ||
| 642 | #define WM831X_LDO2_FLT 0x0080 /* LDO2_FLT */ | ||
| 643 | #define WM831X_LDO2_FLT_MASK 0x0080 /* LDO2_FLT */ | ||
| 644 | #define WM831X_LDO2_FLT_SHIFT 7 /* LDO2_FLT */ | ||
| 645 | #define WM831X_LDO2_FLT_WIDTH 1 /* LDO2_FLT */ | ||
| 646 | #define WM831X_LDO2_SWI 0x0040 /* LDO2_SWI */ | ||
| 647 | #define WM831X_LDO2_SWI_MASK 0x0040 /* LDO2_SWI */ | ||
| 648 | #define WM831X_LDO2_SWI_SHIFT 6 /* LDO2_SWI */ | ||
| 649 | #define WM831X_LDO2_SWI_WIDTH 1 /* LDO2_SWI */ | ||
| 650 | #define WM831X_LDO2_LP_MODE 0x0001 /* LDO2_LP_MODE */ | ||
| 651 | #define WM831X_LDO2_LP_MODE_MASK 0x0001 /* LDO2_LP_MODE */ | ||
| 652 | #define WM831X_LDO2_LP_MODE_SHIFT 0 /* LDO2_LP_MODE */ | ||
| 653 | #define WM831X_LDO2_LP_MODE_WIDTH 1 /* LDO2_LP_MODE */ | ||
| 654 | |||
| 655 | /* | ||
| 656 | * R16492 (0x406C) - LDO2 ON Control | ||
| 657 | */ | ||
| 658 | #define WM831X_LDO2_ON_SLOT_MASK 0xE000 /* LDO2_ON_SLOT - [15:13] */ | ||
| 659 | #define WM831X_LDO2_ON_SLOT_SHIFT 13 /* LDO2_ON_SLOT - [15:13] */ | ||
| 660 | #define WM831X_LDO2_ON_SLOT_WIDTH 3 /* LDO2_ON_SLOT - [15:13] */ | ||
| 661 | #define WM831X_LDO2_ON_MODE 0x0100 /* LDO2_ON_MODE */ | ||
| 662 | #define WM831X_LDO2_ON_MODE_MASK 0x0100 /* LDO2_ON_MODE */ | ||
| 663 | #define WM831X_LDO2_ON_MODE_SHIFT 8 /* LDO2_ON_MODE */ | ||
| 664 | #define WM831X_LDO2_ON_MODE_WIDTH 1 /* LDO2_ON_MODE */ | ||
| 665 | #define WM831X_LDO2_ON_VSEL_MASK 0x001F /* LDO2_ON_VSEL - [4:0] */ | ||
| 666 | #define WM831X_LDO2_ON_VSEL_SHIFT 0 /* LDO2_ON_VSEL - [4:0] */ | ||
| 667 | #define WM831X_LDO2_ON_VSEL_WIDTH 5 /* LDO2_ON_VSEL - [4:0] */ | ||
| 668 | |||
| 669 | /* | ||
| 670 | * R16493 (0x406D) - LDO2 SLEEP Control | ||
| 671 | */ | ||
| 672 | #define WM831X_LDO2_SLP_SLOT_MASK 0xE000 /* LDO2_SLP_SLOT - [15:13] */ | ||
| 673 | #define WM831X_LDO2_SLP_SLOT_SHIFT 13 /* LDO2_SLP_SLOT - [15:13] */ | ||
| 674 | #define WM831X_LDO2_SLP_SLOT_WIDTH 3 /* LDO2_SLP_SLOT - [15:13] */ | ||
| 675 | #define WM831X_LDO2_SLP_MODE 0x0100 /* LDO2_SLP_MODE */ | ||
| 676 | #define WM831X_LDO2_SLP_MODE_MASK 0x0100 /* LDO2_SLP_MODE */ | ||
| 677 | #define WM831X_LDO2_SLP_MODE_SHIFT 8 /* LDO2_SLP_MODE */ | ||
| 678 | #define WM831X_LDO2_SLP_MODE_WIDTH 1 /* LDO2_SLP_MODE */ | ||
| 679 | #define WM831X_LDO2_SLP_VSEL_MASK 0x001F /* LDO2_SLP_VSEL - [4:0] */ | ||
| 680 | #define WM831X_LDO2_SLP_VSEL_SHIFT 0 /* LDO2_SLP_VSEL - [4:0] */ | ||
| 681 | #define WM831X_LDO2_SLP_VSEL_WIDTH 5 /* LDO2_SLP_VSEL - [4:0] */ | ||
| 682 | |||
| 683 | /* | ||
| 684 | * R16494 (0x406E) - LDO3 Control | ||
| 685 | */ | ||
| 686 | #define WM831X_LDO3_ERR_ACT_MASK 0xC000 /* LDO3_ERR_ACT - [15:14] */ | ||
| 687 | #define WM831X_LDO3_ERR_ACT_SHIFT 14 /* LDO3_ERR_ACT - [15:14] */ | ||
| 688 | #define WM831X_LDO3_ERR_ACT_WIDTH 2 /* LDO3_ERR_ACT - [15:14] */ | ||
| 689 | #define WM831X_LDO3_HWC_SRC_MASK 0x1800 /* LDO3_HWC_SRC - [12:11] */ | ||
| 690 | #define WM831X_LDO3_HWC_SRC_SHIFT 11 /* LDO3_HWC_SRC - [12:11] */ | ||
| 691 | #define WM831X_LDO3_HWC_SRC_WIDTH 2 /* LDO3_HWC_SRC - [12:11] */ | ||
| 692 | #define WM831X_LDO3_HWC_VSEL 0x0400 /* LDO3_HWC_VSEL */ | ||
| 693 | #define WM831X_LDO3_HWC_VSEL_MASK 0x0400 /* LDO3_HWC_VSEL */ | ||
| 694 | #define WM831X_LDO3_HWC_VSEL_SHIFT 10 /* LDO3_HWC_VSEL */ | ||
| 695 | #define WM831X_LDO3_HWC_VSEL_WIDTH 1 /* LDO3_HWC_VSEL */ | ||
| 696 | #define WM831X_LDO3_HWC_MODE_MASK 0x0300 /* LDO3_HWC_MODE - [9:8] */ | ||
| 697 | #define WM831X_LDO3_HWC_MODE_SHIFT 8 /* LDO3_HWC_MODE - [9:8] */ | ||
| 698 | #define WM831X_LDO3_HWC_MODE_WIDTH 2 /* LDO3_HWC_MODE - [9:8] */ | ||
| 699 | #define WM831X_LDO3_FLT 0x0080 /* LDO3_FLT */ | ||
| 700 | #define WM831X_LDO3_FLT_MASK 0x0080 /* LDO3_FLT */ | ||
| 701 | #define WM831X_LDO3_FLT_SHIFT 7 /* LDO3_FLT */ | ||
| 702 | #define WM831X_LDO3_FLT_WIDTH 1 /* LDO3_FLT */ | ||
| 703 | #define WM831X_LDO3_SWI 0x0040 /* LDO3_SWI */ | ||
| 704 | #define WM831X_LDO3_SWI_MASK 0x0040 /* LDO3_SWI */ | ||
| 705 | #define WM831X_LDO3_SWI_SHIFT 6 /* LDO3_SWI */ | ||
| 706 | #define WM831X_LDO3_SWI_WIDTH 1 /* LDO3_SWI */ | ||
| 707 | #define WM831X_LDO3_LP_MODE 0x0001 /* LDO3_LP_MODE */ | ||
| 708 | #define WM831X_LDO3_LP_MODE_MASK 0x0001 /* LDO3_LP_MODE */ | ||
| 709 | #define WM831X_LDO3_LP_MODE_SHIFT 0 /* LDO3_LP_MODE */ | ||
| 710 | #define WM831X_LDO3_LP_MODE_WIDTH 1 /* LDO3_LP_MODE */ | ||
| 711 | |||
| 712 | /* | ||
| 713 | * R16495 (0x406F) - LDO3 ON Control | ||
| 714 | */ | ||
| 715 | #define WM831X_LDO3_ON_SLOT_MASK 0xE000 /* LDO3_ON_SLOT - [15:13] */ | ||
| 716 | #define WM831X_LDO3_ON_SLOT_SHIFT 13 /* LDO3_ON_SLOT - [15:13] */ | ||
| 717 | #define WM831X_LDO3_ON_SLOT_WIDTH 3 /* LDO3_ON_SLOT - [15:13] */ | ||
| 718 | #define WM831X_LDO3_ON_MODE 0x0100 /* LDO3_ON_MODE */ | ||
| 719 | #define WM831X_LDO3_ON_MODE_MASK 0x0100 /* LDO3_ON_MODE */ | ||
| 720 | #define WM831X_LDO3_ON_MODE_SHIFT 8 /* LDO3_ON_MODE */ | ||
| 721 | #define WM831X_LDO3_ON_MODE_WIDTH 1 /* LDO3_ON_MODE */ | ||
| 722 | #define WM831X_LDO3_ON_VSEL_MASK 0x001F /* LDO3_ON_VSEL - [4:0] */ | ||
| 723 | #define WM831X_LDO3_ON_VSEL_SHIFT 0 /* LDO3_ON_VSEL - [4:0] */ | ||
| 724 | #define WM831X_LDO3_ON_VSEL_WIDTH 5 /* LDO3_ON_VSEL - [4:0] */ | ||
| 725 | |||
| 726 | /* | ||
| 727 | * R16496 (0x4070) - LDO3 SLEEP Control | ||
| 728 | */ | ||
| 729 | #define WM831X_LDO3_SLP_SLOT_MASK 0xE000 /* LDO3_SLP_SLOT - [15:13] */ | ||
| 730 | #define WM831X_LDO3_SLP_SLOT_SHIFT 13 /* LDO3_SLP_SLOT - [15:13] */ | ||
| 731 | #define WM831X_LDO3_SLP_SLOT_WIDTH 3 /* LDO3_SLP_SLOT - [15:13] */ | ||
| 732 | #define WM831X_LDO3_SLP_MODE 0x0100 /* LDO3_SLP_MODE */ | ||
| 733 | #define WM831X_LDO3_SLP_MODE_MASK 0x0100 /* LDO3_SLP_MODE */ | ||
| 734 | #define WM831X_LDO3_SLP_MODE_SHIFT 8 /* LDO3_SLP_MODE */ | ||
| 735 | #define WM831X_LDO3_SLP_MODE_WIDTH 1 /* LDO3_SLP_MODE */ | ||
| 736 | #define WM831X_LDO3_SLP_VSEL_MASK 0x001F /* LDO3_SLP_VSEL - [4:0] */ | ||
| 737 | #define WM831X_LDO3_SLP_VSEL_SHIFT 0 /* LDO3_SLP_VSEL - [4:0] */ | ||
| 738 | #define WM831X_LDO3_SLP_VSEL_WIDTH 5 /* LDO3_SLP_VSEL - [4:0] */ | ||
| 739 | |||
| 740 | /* | ||
| 741 | * R16497 (0x4071) - LDO4 Control | ||
| 742 | */ | ||
| 743 | #define WM831X_LDO4_ERR_ACT_MASK 0xC000 /* LDO4_ERR_ACT - [15:14] */ | ||
| 744 | #define WM831X_LDO4_ERR_ACT_SHIFT 14 /* LDO4_ERR_ACT - [15:14] */ | ||
| 745 | #define WM831X_LDO4_ERR_ACT_WIDTH 2 /* LDO4_ERR_ACT - [15:14] */ | ||
| 746 | #define WM831X_LDO4_HWC_SRC_MASK 0x1800 /* LDO4_HWC_SRC - [12:11] */ | ||
| 747 | #define WM831X_LDO4_HWC_SRC_SHIFT 11 /* LDO4_HWC_SRC - [12:11] */ | ||
| 748 | #define WM831X_LDO4_HWC_SRC_WIDTH 2 /* LDO4_HWC_SRC - [12:11] */ | ||
| 749 | #define WM831X_LDO4_HWC_VSEL 0x0400 /* LDO4_HWC_VSEL */ | ||
| 750 | #define WM831X_LDO4_HWC_VSEL_MASK 0x0400 /* LDO4_HWC_VSEL */ | ||
| 751 | #define WM831X_LDO4_HWC_VSEL_SHIFT 10 /* LDO4_HWC_VSEL */ | ||
| 752 | #define WM831X_LDO4_HWC_VSEL_WIDTH 1 /* LDO4_HWC_VSEL */ | ||
| 753 | #define WM831X_LDO4_HWC_MODE_MASK 0x0300 /* LDO4_HWC_MODE - [9:8] */ | ||
| 754 | #define WM831X_LDO4_HWC_MODE_SHIFT 8 /* LDO4_HWC_MODE - [9:8] */ | ||
| 755 | #define WM831X_LDO4_HWC_MODE_WIDTH 2 /* LDO4_HWC_MODE - [9:8] */ | ||
| 756 | #define WM831X_LDO4_FLT 0x0080 /* LDO4_FLT */ | ||
| 757 | #define WM831X_LDO4_FLT_MASK 0x0080 /* LDO4_FLT */ | ||
| 758 | #define WM831X_LDO4_FLT_SHIFT 7 /* LDO4_FLT */ | ||
| 759 | #define WM831X_LDO4_FLT_WIDTH 1 /* LDO4_FLT */ | ||
| 760 | #define WM831X_LDO4_SWI 0x0040 /* LDO4_SWI */ | ||
| 761 | #define WM831X_LDO4_SWI_MASK 0x0040 /* LDO4_SWI */ | ||
| 762 | #define WM831X_LDO4_SWI_SHIFT 6 /* LDO4_SWI */ | ||
| 763 | #define WM831X_LDO4_SWI_WIDTH 1 /* LDO4_SWI */ | ||
| 764 | #define WM831X_LDO4_LP_MODE 0x0001 /* LDO4_LP_MODE */ | ||
| 765 | #define WM831X_LDO4_LP_MODE_MASK 0x0001 /* LDO4_LP_MODE */ | ||
| 766 | #define WM831X_LDO4_LP_MODE_SHIFT 0 /* LDO4_LP_MODE */ | ||
| 767 | #define WM831X_LDO4_LP_MODE_WIDTH 1 /* LDO4_LP_MODE */ | ||
| 768 | |||
| 769 | /* | ||
| 770 | * R16498 (0x4072) - LDO4 ON Control | ||
| 771 | */ | ||
| 772 | #define WM831X_LDO4_ON_SLOT_MASK 0xE000 /* LDO4_ON_SLOT - [15:13] */ | ||
| 773 | #define WM831X_LDO4_ON_SLOT_SHIFT 13 /* LDO4_ON_SLOT - [15:13] */ | ||
| 774 | #define WM831X_LDO4_ON_SLOT_WIDTH 3 /* LDO4_ON_SLOT - [15:13] */ | ||
| 775 | #define WM831X_LDO4_ON_MODE 0x0100 /* LDO4_ON_MODE */ | ||
| 776 | #define WM831X_LDO4_ON_MODE_MASK 0x0100 /* LDO4_ON_MODE */ | ||
| 777 | #define WM831X_LDO4_ON_MODE_SHIFT 8 /* LDO4_ON_MODE */ | ||
| 778 | #define WM831X_LDO4_ON_MODE_WIDTH 1 /* LDO4_ON_MODE */ | ||
| 779 | #define WM831X_LDO4_ON_VSEL_MASK 0x001F /* LDO4_ON_VSEL - [4:0] */ | ||
| 780 | #define WM831X_LDO4_ON_VSEL_SHIFT 0 /* LDO4_ON_VSEL - [4:0] */ | ||
| 781 | #define WM831X_LDO4_ON_VSEL_WIDTH 5 /* LDO4_ON_VSEL - [4:0] */ | ||
| 782 | |||
| 783 | /* | ||
| 784 | * R16499 (0x4073) - LDO4 SLEEP Control | ||
| 785 | */ | ||
| 786 | #define WM831X_LDO4_SLP_SLOT_MASK 0xE000 /* LDO4_SLP_SLOT - [15:13] */ | ||
| 787 | #define WM831X_LDO4_SLP_SLOT_SHIFT 13 /* LDO4_SLP_SLOT - [15:13] */ | ||
| 788 | #define WM831X_LDO4_SLP_SLOT_WIDTH 3 /* LDO4_SLP_SLOT - [15:13] */ | ||
| 789 | #define WM831X_LDO4_SLP_MODE 0x0100 /* LDO4_SLP_MODE */ | ||
| 790 | #define WM831X_LDO4_SLP_MODE_MASK 0x0100 /* LDO4_SLP_MODE */ | ||
| 791 | #define WM831X_LDO4_SLP_MODE_SHIFT 8 /* LDO4_SLP_MODE */ | ||
| 792 | #define WM831X_LDO4_SLP_MODE_WIDTH 1 /* LDO4_SLP_MODE */ | ||
| 793 | #define WM831X_LDO4_SLP_VSEL_MASK 0x001F /* LDO4_SLP_VSEL - [4:0] */ | ||
| 794 | #define WM831X_LDO4_SLP_VSEL_SHIFT 0 /* LDO4_SLP_VSEL - [4:0] */ | ||
| 795 | #define WM831X_LDO4_SLP_VSEL_WIDTH 5 /* LDO4_SLP_VSEL - [4:0] */ | ||
| 796 | |||
| 797 | /* | ||
| 798 | * R16500 (0x4074) - LDO5 Control | ||
| 799 | */ | ||
| 800 | #define WM831X_LDO5_ERR_ACT_MASK 0xC000 /* LDO5_ERR_ACT - [15:14] */ | ||
| 801 | #define WM831X_LDO5_ERR_ACT_SHIFT 14 /* LDO5_ERR_ACT - [15:14] */ | ||
| 802 | #define WM831X_LDO5_ERR_ACT_WIDTH 2 /* LDO5_ERR_ACT - [15:14] */ | ||
| 803 | #define WM831X_LDO5_HWC_SRC_MASK 0x1800 /* LDO5_HWC_SRC - [12:11] */ | ||
| 804 | #define WM831X_LDO5_HWC_SRC_SHIFT 11 /* LDO5_HWC_SRC - [12:11] */ | ||
| 805 | #define WM831X_LDO5_HWC_SRC_WIDTH 2 /* LDO5_HWC_SRC - [12:11] */ | ||
| 806 | #define WM831X_LDO5_HWC_VSEL 0x0400 /* LDO5_HWC_VSEL */ | ||
| 807 | #define WM831X_LDO5_HWC_VSEL_MASK 0x0400 /* LDO5_HWC_VSEL */ | ||
| 808 | #define WM831X_LDO5_HWC_VSEL_SHIFT 10 /* LDO5_HWC_VSEL */ | ||
| 809 | #define WM831X_LDO5_HWC_VSEL_WIDTH 1 /* LDO5_HWC_VSEL */ | ||
| 810 | #define WM831X_LDO5_HWC_MODE_MASK 0x0300 /* LDO5_HWC_MODE - [9:8] */ | ||
| 811 | #define WM831X_LDO5_HWC_MODE_SHIFT 8 /* LDO5_HWC_MODE - [9:8] */ | ||
| 812 | #define WM831X_LDO5_HWC_MODE_WIDTH 2 /* LDO5_HWC_MODE - [9:8] */ | ||
| 813 | #define WM831X_LDO5_FLT 0x0080 /* LDO5_FLT */ | ||
| 814 | #define WM831X_LDO5_FLT_MASK 0x0080 /* LDO5_FLT */ | ||
| 815 | #define WM831X_LDO5_FLT_SHIFT 7 /* LDO5_FLT */ | ||
| 816 | #define WM831X_LDO5_FLT_WIDTH 1 /* LDO5_FLT */ | ||
| 817 | #define WM831X_LDO5_SWI 0x0040 /* LDO5_SWI */ | ||
| 818 | #define WM831X_LDO5_SWI_MASK 0x0040 /* LDO5_SWI */ | ||
| 819 | #define WM831X_LDO5_SWI_SHIFT 6 /* LDO5_SWI */ | ||
| 820 | #define WM831X_LDO5_SWI_WIDTH 1 /* LDO5_SWI */ | ||
| 821 | #define WM831X_LDO5_LP_MODE 0x0001 /* LDO5_LP_MODE */ | ||
| 822 | #define WM831X_LDO5_LP_MODE_MASK 0x0001 /* LDO5_LP_MODE */ | ||
| 823 | #define WM831X_LDO5_LP_MODE_SHIFT 0 /* LDO5_LP_MODE */ | ||
| 824 | #define WM831X_LDO5_LP_MODE_WIDTH 1 /* LDO5_LP_MODE */ | ||
| 825 | |||
| 826 | /* | ||
| 827 | * R16501 (0x4075) - LDO5 ON Control | ||
| 828 | */ | ||
| 829 | #define WM831X_LDO5_ON_SLOT_MASK 0xE000 /* LDO5_ON_SLOT - [15:13] */ | ||
| 830 | #define WM831X_LDO5_ON_SLOT_SHIFT 13 /* LDO5_ON_SLOT - [15:13] */ | ||
| 831 | #define WM831X_LDO5_ON_SLOT_WIDTH 3 /* LDO5_ON_SLOT - [15:13] */ | ||
| 832 | #define WM831X_LDO5_ON_MODE 0x0100 /* LDO5_ON_MODE */ | ||
| 833 | #define WM831X_LDO5_ON_MODE_MASK 0x0100 /* LDO5_ON_MODE */ | ||
| 834 | #define WM831X_LDO5_ON_MODE_SHIFT 8 /* LDO5_ON_MODE */ | ||
| 835 | #define WM831X_LDO5_ON_MODE_WIDTH 1 /* LDO5_ON_MODE */ | ||
| 836 | #define WM831X_LDO5_ON_VSEL_MASK 0x001F /* LDO5_ON_VSEL - [4:0] */ | ||
| 837 | #define WM831X_LDO5_ON_VSEL_SHIFT 0 /* LDO5_ON_VSEL - [4:0] */ | ||
| 838 | #define WM831X_LDO5_ON_VSEL_WIDTH 5 /* LDO5_ON_VSEL - [4:0] */ | ||
| 839 | |||
| 840 | /* | ||
| 841 | * R16502 (0x4076) - LDO5 SLEEP Control | ||
| 842 | */ | ||
| 843 | #define WM831X_LDO5_SLP_SLOT_MASK 0xE000 /* LDO5_SLP_SLOT - [15:13] */ | ||
| 844 | #define WM831X_LDO5_SLP_SLOT_SHIFT 13 /* LDO5_SLP_SLOT - [15:13] */ | ||
| 845 | #define WM831X_LDO5_SLP_SLOT_WIDTH 3 /* LDO5_SLP_SLOT - [15:13] */ | ||
| 846 | #define WM831X_LDO5_SLP_MODE 0x0100 /* LDO5_SLP_MODE */ | ||
| 847 | #define WM831X_LDO5_SLP_MODE_MASK 0x0100 /* LDO5_SLP_MODE */ | ||
| 848 | #define WM831X_LDO5_SLP_MODE_SHIFT 8 /* LDO5_SLP_MODE */ | ||
| 849 | #define WM831X_LDO5_SLP_MODE_WIDTH 1 /* LDO5_SLP_MODE */ | ||
| 850 | #define WM831X_LDO5_SLP_VSEL_MASK 0x001F /* LDO5_SLP_VSEL - [4:0] */ | ||
| 851 | #define WM831X_LDO5_SLP_VSEL_SHIFT 0 /* LDO5_SLP_VSEL - [4:0] */ | ||
| 852 | #define WM831X_LDO5_SLP_VSEL_WIDTH 5 /* LDO5_SLP_VSEL - [4:0] */ | ||
| 853 | |||
| 854 | /* | ||
| 855 | * R16503 (0x4077) - LDO6 Control | ||
| 856 | */ | ||
| 857 | #define WM831X_LDO6_ERR_ACT_MASK 0xC000 /* LDO6_ERR_ACT - [15:14] */ | ||
| 858 | #define WM831X_LDO6_ERR_ACT_SHIFT 14 /* LDO6_ERR_ACT - [15:14] */ | ||
| 859 | #define WM831X_LDO6_ERR_ACT_WIDTH 2 /* LDO6_ERR_ACT - [15:14] */ | ||
| 860 | #define WM831X_LDO6_HWC_SRC_MASK 0x1800 /* LDO6_HWC_SRC - [12:11] */ | ||
| 861 | #define WM831X_LDO6_HWC_SRC_SHIFT 11 /* LDO6_HWC_SRC - [12:11] */ | ||
| 862 | #define WM831X_LDO6_HWC_SRC_WIDTH 2 /* LDO6_HWC_SRC - [12:11] */ | ||
| 863 | #define WM831X_LDO6_HWC_VSEL 0x0400 /* LDO6_HWC_VSEL */ | ||
| 864 | #define WM831X_LDO6_HWC_VSEL_MASK 0x0400 /* LDO6_HWC_VSEL */ | ||
| 865 | #define WM831X_LDO6_HWC_VSEL_SHIFT 10 /* LDO6_HWC_VSEL */ | ||
| 866 | #define WM831X_LDO6_HWC_VSEL_WIDTH 1 /* LDO6_HWC_VSEL */ | ||
| 867 | #define WM831X_LDO6_HWC_MODE_MASK 0x0300 /* LDO6_HWC_MODE - [9:8] */ | ||
| 868 | #define WM831X_LDO6_HWC_MODE_SHIFT 8 /* LDO6_HWC_MODE - [9:8] */ | ||
| 869 | #define WM831X_LDO6_HWC_MODE_WIDTH 2 /* LDO6_HWC_MODE - [9:8] */ | ||
| 870 | #define WM831X_LDO6_FLT 0x0080 /* LDO6_FLT */ | ||
| 871 | #define WM831X_LDO6_FLT_MASK 0x0080 /* LDO6_FLT */ | ||
| 872 | #define WM831X_LDO6_FLT_SHIFT 7 /* LDO6_FLT */ | ||
| 873 | #define WM831X_LDO6_FLT_WIDTH 1 /* LDO6_FLT */ | ||
| 874 | #define WM831X_LDO6_SWI 0x0040 /* LDO6_SWI */ | ||
| 875 | #define WM831X_LDO6_SWI_MASK 0x0040 /* LDO6_SWI */ | ||
| 876 | #define WM831X_LDO6_SWI_SHIFT 6 /* LDO6_SWI */ | ||
| 877 | #define WM831X_LDO6_SWI_WIDTH 1 /* LDO6_SWI */ | ||
| 878 | #define WM831X_LDO6_LP_MODE 0x0001 /* LDO6_LP_MODE */ | ||
| 879 | #define WM831X_LDO6_LP_MODE_MASK 0x0001 /* LDO6_LP_MODE */ | ||
| 880 | #define WM831X_LDO6_LP_MODE_SHIFT 0 /* LDO6_LP_MODE */ | ||
| 881 | #define WM831X_LDO6_LP_MODE_WIDTH 1 /* LDO6_LP_MODE */ | ||
| 882 | |||
| 883 | /* | ||
| 884 | * R16504 (0x4078) - LDO6 ON Control | ||
| 885 | */ | ||
| 886 | #define WM831X_LDO6_ON_SLOT_MASK 0xE000 /* LDO6_ON_SLOT - [15:13] */ | ||
| 887 | #define WM831X_LDO6_ON_SLOT_SHIFT 13 /* LDO6_ON_SLOT - [15:13] */ | ||
| 888 | #define WM831X_LDO6_ON_SLOT_WIDTH 3 /* LDO6_ON_SLOT - [15:13] */ | ||
| 889 | #define WM831X_LDO6_ON_MODE 0x0100 /* LDO6_ON_MODE */ | ||
| 890 | #define WM831X_LDO6_ON_MODE_MASK 0x0100 /* LDO6_ON_MODE */ | ||
| 891 | #define WM831X_LDO6_ON_MODE_SHIFT 8 /* LDO6_ON_MODE */ | ||
| 892 | #define WM831X_LDO6_ON_MODE_WIDTH 1 /* LDO6_ON_MODE */ | ||
| 893 | #define WM831X_LDO6_ON_VSEL_MASK 0x001F /* LDO6_ON_VSEL - [4:0] */ | ||
| 894 | #define WM831X_LDO6_ON_VSEL_SHIFT 0 /* LDO6_ON_VSEL - [4:0] */ | ||
| 895 | #define WM831X_LDO6_ON_VSEL_WIDTH 5 /* LDO6_ON_VSEL - [4:0] */ | ||
| 896 | |||
| 897 | /* | ||
| 898 | * R16505 (0x4079) - LDO6 SLEEP Control | ||
| 899 | */ | ||
| 900 | #define WM831X_LDO6_SLP_SLOT_MASK 0xE000 /* LDO6_SLP_SLOT - [15:13] */ | ||
| 901 | #define WM831X_LDO6_SLP_SLOT_SHIFT 13 /* LDO6_SLP_SLOT - [15:13] */ | ||
| 902 | #define WM831X_LDO6_SLP_SLOT_WIDTH 3 /* LDO6_SLP_SLOT - [15:13] */ | ||
| 903 | #define WM831X_LDO6_SLP_MODE 0x0100 /* LDO6_SLP_MODE */ | ||
| 904 | #define WM831X_LDO6_SLP_MODE_MASK 0x0100 /* LDO6_SLP_MODE */ | ||
| 905 | #define WM831X_LDO6_SLP_MODE_SHIFT 8 /* LDO6_SLP_MODE */ | ||
| 906 | #define WM831X_LDO6_SLP_MODE_WIDTH 1 /* LDO6_SLP_MODE */ | ||
| 907 | #define WM831X_LDO6_SLP_VSEL_MASK 0x001F /* LDO6_SLP_VSEL - [4:0] */ | ||
| 908 | #define WM831X_LDO6_SLP_VSEL_SHIFT 0 /* LDO6_SLP_VSEL - [4:0] */ | ||
| 909 | #define WM831X_LDO6_SLP_VSEL_WIDTH 5 /* LDO6_SLP_VSEL - [4:0] */ | ||
| 910 | |||
| 911 | /* | ||
| 912 | * R16506 (0x407A) - LDO7 Control | ||
| 913 | */ | ||
| 914 | #define WM831X_LDO7_ERR_ACT_MASK 0xC000 /* LDO7_ERR_ACT - [15:14] */ | ||
| 915 | #define WM831X_LDO7_ERR_ACT_SHIFT 14 /* LDO7_ERR_ACT - [15:14] */ | ||
| 916 | #define WM831X_LDO7_ERR_ACT_WIDTH 2 /* LDO7_ERR_ACT - [15:14] */ | ||
| 917 | #define WM831X_LDO7_HWC_SRC_MASK 0x1800 /* LDO7_HWC_SRC - [12:11] */ | ||
| 918 | #define WM831X_LDO7_HWC_SRC_SHIFT 11 /* LDO7_HWC_SRC - [12:11] */ | ||
| 919 | #define WM831X_LDO7_HWC_SRC_WIDTH 2 /* LDO7_HWC_SRC - [12:11] */ | ||
| 920 | #define WM831X_LDO7_HWC_VSEL 0x0400 /* LDO7_HWC_VSEL */ | ||
| 921 | #define WM831X_LDO7_HWC_VSEL_MASK 0x0400 /* LDO7_HWC_VSEL */ | ||
| 922 | #define WM831X_LDO7_HWC_VSEL_SHIFT 10 /* LDO7_HWC_VSEL */ | ||
| 923 | #define WM831X_LDO7_HWC_VSEL_WIDTH 1 /* LDO7_HWC_VSEL */ | ||
| 924 | #define WM831X_LDO7_HWC_MODE_MASK 0x0300 /* LDO7_HWC_MODE - [9:8] */ | ||
| 925 | #define WM831X_LDO7_HWC_MODE_SHIFT 8 /* LDO7_HWC_MODE - [9:8] */ | ||
| 926 | #define WM831X_LDO7_HWC_MODE_WIDTH 2 /* LDO7_HWC_MODE - [9:8] */ | ||
| 927 | #define WM831X_LDO7_FLT 0x0080 /* LDO7_FLT */ | ||
| 928 | #define WM831X_LDO7_FLT_MASK 0x0080 /* LDO7_FLT */ | ||
| 929 | #define WM831X_LDO7_FLT_SHIFT 7 /* LDO7_FLT */ | ||
| 930 | #define WM831X_LDO7_FLT_WIDTH 1 /* LDO7_FLT */ | ||
| 931 | #define WM831X_LDO7_SWI 0x0040 /* LDO7_SWI */ | ||
| 932 | #define WM831X_LDO7_SWI_MASK 0x0040 /* LDO7_SWI */ | ||
| 933 | #define WM831X_LDO7_SWI_SHIFT 6 /* LDO7_SWI */ | ||
| 934 | #define WM831X_LDO7_SWI_WIDTH 1 /* LDO7_SWI */ | ||
| 935 | |||
| 936 | /* | ||
| 937 | * R16507 (0x407B) - LDO7 ON Control | ||
| 938 | */ | ||
| 939 | #define WM831X_LDO7_ON_SLOT_MASK 0xE000 /* LDO7_ON_SLOT - [15:13] */ | ||
| 940 | #define WM831X_LDO7_ON_SLOT_SHIFT 13 /* LDO7_ON_SLOT - [15:13] */ | ||
| 941 | #define WM831X_LDO7_ON_SLOT_WIDTH 3 /* LDO7_ON_SLOT - [15:13] */ | ||
| 942 | #define WM831X_LDO7_ON_MODE 0x0100 /* LDO7_ON_MODE */ | ||
| 943 | #define WM831X_LDO7_ON_MODE_MASK 0x0100 /* LDO7_ON_MODE */ | ||
| 944 | #define WM831X_LDO7_ON_MODE_SHIFT 8 /* LDO7_ON_MODE */ | ||
| 945 | #define WM831X_LDO7_ON_MODE_WIDTH 1 /* LDO7_ON_MODE */ | ||
| 946 | #define WM831X_LDO7_ON_VSEL_MASK 0x001F /* LDO7_ON_VSEL - [4:0] */ | ||
| 947 | #define WM831X_LDO7_ON_VSEL_SHIFT 0 /* LDO7_ON_VSEL - [4:0] */ | ||
| 948 | #define WM831X_LDO7_ON_VSEL_WIDTH 5 /* LDO7_ON_VSEL - [4:0] */ | ||
| 949 | |||
| 950 | /* | ||
| 951 | * R16508 (0x407C) - LDO7 SLEEP Control | ||
| 952 | */ | ||
| 953 | #define WM831X_LDO7_SLP_SLOT_MASK 0xE000 /* LDO7_SLP_SLOT - [15:13] */ | ||
| 954 | #define WM831X_LDO7_SLP_SLOT_SHIFT 13 /* LDO7_SLP_SLOT - [15:13] */ | ||
| 955 | #define WM831X_LDO7_SLP_SLOT_WIDTH 3 /* LDO7_SLP_SLOT - [15:13] */ | ||
| 956 | #define WM831X_LDO7_SLP_MODE 0x0100 /* LDO7_SLP_MODE */ | ||
| 957 | #define WM831X_LDO7_SLP_MODE_MASK 0x0100 /* LDO7_SLP_MODE */ | ||
| 958 | #define WM831X_LDO7_SLP_MODE_SHIFT 8 /* LDO7_SLP_MODE */ | ||
| 959 | #define WM831X_LDO7_SLP_MODE_WIDTH 1 /* LDO7_SLP_MODE */ | ||
| 960 | #define WM831X_LDO7_SLP_VSEL_MASK 0x001F /* LDO7_SLP_VSEL - [4:0] */ | ||
| 961 | #define WM831X_LDO7_SLP_VSEL_SHIFT 0 /* LDO7_SLP_VSEL - [4:0] */ | ||
| 962 | #define WM831X_LDO7_SLP_VSEL_WIDTH 5 /* LDO7_SLP_VSEL - [4:0] */ | ||
| 963 | |||
| 964 | /* | ||
| 965 | * R16509 (0x407D) - LDO8 Control | ||
| 966 | */ | ||
| 967 | #define WM831X_LDO8_ERR_ACT_MASK 0xC000 /* LDO8_ERR_ACT - [15:14] */ | ||
| 968 | #define WM831X_LDO8_ERR_ACT_SHIFT 14 /* LDO8_ERR_ACT - [15:14] */ | ||
| 969 | #define WM831X_LDO8_ERR_ACT_WIDTH 2 /* LDO8_ERR_ACT - [15:14] */ | ||
| 970 | #define WM831X_LDO8_HWC_SRC_MASK 0x1800 /* LDO8_HWC_SRC - [12:11] */ | ||
| 971 | #define WM831X_LDO8_HWC_SRC_SHIFT 11 /* LDO8_HWC_SRC - [12:11] */ | ||
| 972 | #define WM831X_LDO8_HWC_SRC_WIDTH 2 /* LDO8_HWC_SRC - [12:11] */ | ||
| 973 | #define WM831X_LDO8_HWC_VSEL 0x0400 /* LDO8_HWC_VSEL */ | ||
| 974 | #define WM831X_LDO8_HWC_VSEL_MASK 0x0400 /* LDO8_HWC_VSEL */ | ||
| 975 | #define WM831X_LDO8_HWC_VSEL_SHIFT 10 /* LDO8_HWC_VSEL */ | ||
| 976 | #define WM831X_LDO8_HWC_VSEL_WIDTH 1 /* LDO8_HWC_VSEL */ | ||
| 977 | #define WM831X_LDO8_HWC_MODE_MASK 0x0300 /* LDO8_HWC_MODE - [9:8] */ | ||
| 978 | #define WM831X_LDO8_HWC_MODE_SHIFT 8 /* LDO8_HWC_MODE - [9:8] */ | ||
| 979 | #define WM831X_LDO8_HWC_MODE_WIDTH 2 /* LDO8_HWC_MODE - [9:8] */ | ||
| 980 | #define WM831X_LDO8_FLT 0x0080 /* LDO8_FLT */ | ||
| 981 | #define WM831X_LDO8_FLT_MASK 0x0080 /* LDO8_FLT */ | ||
| 982 | #define WM831X_LDO8_FLT_SHIFT 7 /* LDO8_FLT */ | ||
| 983 | #define WM831X_LDO8_FLT_WIDTH 1 /* LDO8_FLT */ | ||
| 984 | #define WM831X_LDO8_SWI 0x0040 /* LDO8_SWI */ | ||
| 985 | #define WM831X_LDO8_SWI_MASK 0x0040 /* LDO8_SWI */ | ||
| 986 | #define WM831X_LDO8_SWI_SHIFT 6 /* LDO8_SWI */ | ||
| 987 | #define WM831X_LDO8_SWI_WIDTH 1 /* LDO8_SWI */ | ||
| 988 | |||
| 989 | /* | ||
| 990 | * R16510 (0x407E) - LDO8 ON Control | ||
| 991 | */ | ||
| 992 | #define WM831X_LDO8_ON_SLOT_MASK 0xE000 /* LDO8_ON_SLOT - [15:13] */ | ||
| 993 | #define WM831X_LDO8_ON_SLOT_SHIFT 13 /* LDO8_ON_SLOT - [15:13] */ | ||
| 994 | #define WM831X_LDO8_ON_SLOT_WIDTH 3 /* LDO8_ON_SLOT - [15:13] */ | ||
| 995 | #define WM831X_LDO8_ON_MODE 0x0100 /* LDO8_ON_MODE */ | ||
| 996 | #define WM831X_LDO8_ON_MODE_MASK 0x0100 /* LDO8_ON_MODE */ | ||
| 997 | #define WM831X_LDO8_ON_MODE_SHIFT 8 /* LDO8_ON_MODE */ | ||
| 998 | #define WM831X_LDO8_ON_MODE_WIDTH 1 /* LDO8_ON_MODE */ | ||
| 999 | #define WM831X_LDO8_ON_VSEL_MASK 0x001F /* LDO8_ON_VSEL - [4:0] */ | ||
| 1000 | #define WM831X_LDO8_ON_VSEL_SHIFT 0 /* LDO8_ON_VSEL - [4:0] */ | ||
| 1001 | #define WM831X_LDO8_ON_VSEL_WIDTH 5 /* LDO8_ON_VSEL - [4:0] */ | ||
| 1002 | |||
| 1003 | /* | ||
| 1004 | * R16511 (0x407F) - LDO8 SLEEP Control | ||
| 1005 | */ | ||
| 1006 | #define WM831X_LDO8_SLP_SLOT_MASK 0xE000 /* LDO8_SLP_SLOT - [15:13] */ | ||
| 1007 | #define WM831X_LDO8_SLP_SLOT_SHIFT 13 /* LDO8_SLP_SLOT - [15:13] */ | ||
| 1008 | #define WM831X_LDO8_SLP_SLOT_WIDTH 3 /* LDO8_SLP_SLOT - [15:13] */ | ||
| 1009 | #define WM831X_LDO8_SLP_MODE 0x0100 /* LDO8_SLP_MODE */ | ||
| 1010 | #define WM831X_LDO8_SLP_MODE_MASK 0x0100 /* LDO8_SLP_MODE */ | ||
| 1011 | #define WM831X_LDO8_SLP_MODE_SHIFT 8 /* LDO8_SLP_MODE */ | ||
| 1012 | #define WM831X_LDO8_SLP_MODE_WIDTH 1 /* LDO8_SLP_MODE */ | ||
| 1013 | #define WM831X_LDO8_SLP_VSEL_MASK 0x001F /* LDO8_SLP_VSEL - [4:0] */ | ||
| 1014 | #define WM831X_LDO8_SLP_VSEL_SHIFT 0 /* LDO8_SLP_VSEL - [4:0] */ | ||
| 1015 | #define WM831X_LDO8_SLP_VSEL_WIDTH 5 /* LDO8_SLP_VSEL - [4:0] */ | ||
| 1016 | |||
| 1017 | /* | ||
| 1018 | * R16512 (0x4080) - LDO9 Control | ||
| 1019 | */ | ||
| 1020 | #define WM831X_LDO9_ERR_ACT_MASK 0xC000 /* LDO9_ERR_ACT - [15:14] */ | ||
| 1021 | #define WM831X_LDO9_ERR_ACT_SHIFT 14 /* LDO9_ERR_ACT - [15:14] */ | ||
| 1022 | #define WM831X_LDO9_ERR_ACT_WIDTH 2 /* LDO9_ERR_ACT - [15:14] */ | ||
| 1023 | #define WM831X_LDO9_HWC_SRC_MASK 0x1800 /* LDO9_HWC_SRC - [12:11] */ | ||
| 1024 | #define WM831X_LDO9_HWC_SRC_SHIFT 11 /* LDO9_HWC_SRC - [12:11] */ | ||
| 1025 | #define WM831X_LDO9_HWC_SRC_WIDTH 2 /* LDO9_HWC_SRC - [12:11] */ | ||
| 1026 | #define WM831X_LDO9_HWC_VSEL 0x0400 /* LDO9_HWC_VSEL */ | ||
| 1027 | #define WM831X_LDO9_HWC_VSEL_MASK 0x0400 /* LDO9_HWC_VSEL */ | ||
| 1028 | #define WM831X_LDO9_HWC_VSEL_SHIFT 10 /* LDO9_HWC_VSEL */ | ||
| 1029 | #define WM831X_LDO9_HWC_VSEL_WIDTH 1 /* LDO9_HWC_VSEL */ | ||
| 1030 | #define WM831X_LDO9_HWC_MODE_MASK 0x0300 /* LDO9_HWC_MODE - [9:8] */ | ||
| 1031 | #define WM831X_LDO9_HWC_MODE_SHIFT 8 /* LDO9_HWC_MODE - [9:8] */ | ||
| 1032 | #define WM831X_LDO9_HWC_MODE_WIDTH 2 /* LDO9_HWC_MODE - [9:8] */ | ||
| 1033 | #define WM831X_LDO9_FLT 0x0080 /* LDO9_FLT */ | ||
| 1034 | #define WM831X_LDO9_FLT_MASK 0x0080 /* LDO9_FLT */ | ||
| 1035 | #define WM831X_LDO9_FLT_SHIFT 7 /* LDO9_FLT */ | ||
| 1036 | #define WM831X_LDO9_FLT_WIDTH 1 /* LDO9_FLT */ | ||
| 1037 | #define WM831X_LDO9_SWI 0x0040 /* LDO9_SWI */ | ||
| 1038 | #define WM831X_LDO9_SWI_MASK 0x0040 /* LDO9_SWI */ | ||
| 1039 | #define WM831X_LDO9_SWI_SHIFT 6 /* LDO9_SWI */ | ||
| 1040 | #define WM831X_LDO9_SWI_WIDTH 1 /* LDO9_SWI */ | ||
| 1041 | |||
| 1042 | /* | ||
| 1043 | * R16513 (0x4081) - LDO9 ON Control | ||
| 1044 | */ | ||
| 1045 | #define WM831X_LDO9_ON_SLOT_MASK 0xE000 /* LDO9_ON_SLOT - [15:13] */ | ||
| 1046 | #define WM831X_LDO9_ON_SLOT_SHIFT 13 /* LDO9_ON_SLOT - [15:13] */ | ||
| 1047 | #define WM831X_LDO9_ON_SLOT_WIDTH 3 /* LDO9_ON_SLOT - [15:13] */ | ||
| 1048 | #define WM831X_LDO9_ON_MODE 0x0100 /* LDO9_ON_MODE */ | ||
| 1049 | #define WM831X_LDO9_ON_MODE_MASK 0x0100 /* LDO9_ON_MODE */ | ||
| 1050 | #define WM831X_LDO9_ON_MODE_SHIFT 8 /* LDO9_ON_MODE */ | ||
| 1051 | #define WM831X_LDO9_ON_MODE_WIDTH 1 /* LDO9_ON_MODE */ | ||
| 1052 | #define WM831X_LDO9_ON_VSEL_MASK 0x001F /* LDO9_ON_VSEL - [4:0] */ | ||
| 1053 | #define WM831X_LDO9_ON_VSEL_SHIFT 0 /* LDO9_ON_VSEL - [4:0] */ | ||
| 1054 | #define WM831X_LDO9_ON_VSEL_WIDTH 5 /* LDO9_ON_VSEL - [4:0] */ | ||
| 1055 | |||
| 1056 | /* | ||
| 1057 | * R16514 (0x4082) - LDO9 SLEEP Control | ||
| 1058 | */ | ||
| 1059 | #define WM831X_LDO9_SLP_SLOT_MASK 0xE000 /* LDO9_SLP_SLOT - [15:13] */ | ||
| 1060 | #define WM831X_LDO9_SLP_SLOT_SHIFT 13 /* LDO9_SLP_SLOT - [15:13] */ | ||
| 1061 | #define WM831X_LDO9_SLP_SLOT_WIDTH 3 /* LDO9_SLP_SLOT - [15:13] */ | ||
| 1062 | #define WM831X_LDO9_SLP_MODE 0x0100 /* LDO9_SLP_MODE */ | ||
| 1063 | #define WM831X_LDO9_SLP_MODE_MASK 0x0100 /* LDO9_SLP_MODE */ | ||
| 1064 | #define WM831X_LDO9_SLP_MODE_SHIFT 8 /* LDO9_SLP_MODE */ | ||
| 1065 | #define WM831X_LDO9_SLP_MODE_WIDTH 1 /* LDO9_SLP_MODE */ | ||
| 1066 | #define WM831X_LDO9_SLP_VSEL_MASK 0x001F /* LDO9_SLP_VSEL - [4:0] */ | ||
| 1067 | #define WM831X_LDO9_SLP_VSEL_SHIFT 0 /* LDO9_SLP_VSEL - [4:0] */ | ||
| 1068 | #define WM831X_LDO9_SLP_VSEL_WIDTH 5 /* LDO9_SLP_VSEL - [4:0] */ | ||
| 1069 | |||
| 1070 | /* | ||
| 1071 | * R16515 (0x4083) - LDO10 Control | ||
| 1072 | */ | ||
| 1073 | #define WM831X_LDO10_ERR_ACT_MASK 0xC000 /* LDO10_ERR_ACT - [15:14] */ | ||
| 1074 | #define WM831X_LDO10_ERR_ACT_SHIFT 14 /* LDO10_ERR_ACT - [15:14] */ | ||
| 1075 | #define WM831X_LDO10_ERR_ACT_WIDTH 2 /* LDO10_ERR_ACT - [15:14] */ | ||
| 1076 | #define WM831X_LDO10_HWC_SRC_MASK 0x1800 /* LDO10_HWC_SRC - [12:11] */ | ||
| 1077 | #define WM831X_LDO10_HWC_SRC_SHIFT 11 /* LDO10_HWC_SRC - [12:11] */ | ||
| 1078 | #define WM831X_LDO10_HWC_SRC_WIDTH 2 /* LDO10_HWC_SRC - [12:11] */ | ||
| 1079 | #define WM831X_LDO10_HWC_VSEL 0x0400 /* LDO10_HWC_VSEL */ | ||
| 1080 | #define WM831X_LDO10_HWC_VSEL_MASK 0x0400 /* LDO10_HWC_VSEL */ | ||
| 1081 | #define WM831X_LDO10_HWC_VSEL_SHIFT 10 /* LDO10_HWC_VSEL */ | ||
| 1082 | #define WM831X_LDO10_HWC_VSEL_WIDTH 1 /* LDO10_HWC_VSEL */ | ||
| 1083 | #define WM831X_LDO10_HWC_MODE_MASK 0x0300 /* LDO10_HWC_MODE - [9:8] */ | ||
| 1084 | #define WM831X_LDO10_HWC_MODE_SHIFT 8 /* LDO10_HWC_MODE - [9:8] */ | ||
| 1085 | #define WM831X_LDO10_HWC_MODE_WIDTH 2 /* LDO10_HWC_MODE - [9:8] */ | ||
| 1086 | #define WM831X_LDO10_FLT 0x0080 /* LDO10_FLT */ | ||
| 1087 | #define WM831X_LDO10_FLT_MASK 0x0080 /* LDO10_FLT */ | ||
| 1088 | #define WM831X_LDO10_FLT_SHIFT 7 /* LDO10_FLT */ | ||
| 1089 | #define WM831X_LDO10_FLT_WIDTH 1 /* LDO10_FLT */ | ||
| 1090 | #define WM831X_LDO10_SWI 0x0040 /* LDO10_SWI */ | ||
| 1091 | #define WM831X_LDO10_SWI_MASK 0x0040 /* LDO10_SWI */ | ||
| 1092 | #define WM831X_LDO10_SWI_SHIFT 6 /* LDO10_SWI */ | ||
| 1093 | #define WM831X_LDO10_SWI_WIDTH 1 /* LDO10_SWI */ | ||
| 1094 | |||
| 1095 | /* | ||
| 1096 | * R16516 (0x4084) - LDO10 ON Control | ||
| 1097 | */ | ||
| 1098 | #define WM831X_LDO10_ON_SLOT_MASK 0xE000 /* LDO10_ON_SLOT - [15:13] */ | ||
| 1099 | #define WM831X_LDO10_ON_SLOT_SHIFT 13 /* LDO10_ON_SLOT - [15:13] */ | ||
| 1100 | #define WM831X_LDO10_ON_SLOT_WIDTH 3 /* LDO10_ON_SLOT - [15:13] */ | ||
| 1101 | #define WM831X_LDO10_ON_MODE 0x0100 /* LDO10_ON_MODE */ | ||
| 1102 | #define WM831X_LDO10_ON_MODE_MASK 0x0100 /* LDO10_ON_MODE */ | ||
| 1103 | #define WM831X_LDO10_ON_MODE_SHIFT 8 /* LDO10_ON_MODE */ | ||
| 1104 | #define WM831X_LDO10_ON_MODE_WIDTH 1 /* LDO10_ON_MODE */ | ||
| 1105 | #define WM831X_LDO10_ON_VSEL_MASK 0x001F /* LDO10_ON_VSEL - [4:0] */ | ||
| 1106 | #define WM831X_LDO10_ON_VSEL_SHIFT 0 /* LDO10_ON_VSEL - [4:0] */ | ||
| 1107 | #define WM831X_LDO10_ON_VSEL_WIDTH 5 /* LDO10_ON_VSEL - [4:0] */ | ||
| 1108 | |||
| 1109 | /* | ||
| 1110 | * R16517 (0x4085) - LDO10 SLEEP Control | ||
| 1111 | */ | ||
| 1112 | #define WM831X_LDO10_SLP_SLOT_MASK 0xE000 /* LDO10_SLP_SLOT - [15:13] */ | ||
| 1113 | #define WM831X_LDO10_SLP_SLOT_SHIFT 13 /* LDO10_SLP_SLOT - [15:13] */ | ||
| 1114 | #define WM831X_LDO10_SLP_SLOT_WIDTH 3 /* LDO10_SLP_SLOT - [15:13] */ | ||
| 1115 | #define WM831X_LDO10_SLP_MODE 0x0100 /* LDO10_SLP_MODE */ | ||
| 1116 | #define WM831X_LDO10_SLP_MODE_MASK 0x0100 /* LDO10_SLP_MODE */ | ||
| 1117 | #define WM831X_LDO10_SLP_MODE_SHIFT 8 /* LDO10_SLP_MODE */ | ||
| 1118 | #define WM831X_LDO10_SLP_MODE_WIDTH 1 /* LDO10_SLP_MODE */ | ||
| 1119 | #define WM831X_LDO10_SLP_VSEL_MASK 0x001F /* LDO10_SLP_VSEL - [4:0] */ | ||
| 1120 | #define WM831X_LDO10_SLP_VSEL_SHIFT 0 /* LDO10_SLP_VSEL - [4:0] */ | ||
| 1121 | #define WM831X_LDO10_SLP_VSEL_WIDTH 5 /* LDO10_SLP_VSEL - [4:0] */ | ||
| 1122 | |||
| 1123 | /* | ||
| 1124 | * R16519 (0x4087) - LDO11 ON Control | ||
| 1125 | */ | ||
| 1126 | #define WM831X_LDO11_ON_SLOT_MASK 0xE000 /* LDO11_ON_SLOT - [15:13] */ | ||
| 1127 | #define WM831X_LDO11_ON_SLOT_SHIFT 13 /* LDO11_ON_SLOT - [15:13] */ | ||
| 1128 | #define WM831X_LDO11_ON_SLOT_WIDTH 3 /* LDO11_ON_SLOT - [15:13] */ | ||
| 1129 | #define WM831X_LDO11_OFFENA 0x1000 /* LDO11_OFFENA */ | ||
| 1130 | #define WM831X_LDO11_OFFENA_MASK 0x1000 /* LDO11_OFFENA */ | ||
| 1131 | #define WM831X_LDO11_OFFENA_SHIFT 12 /* LDO11_OFFENA */ | ||
| 1132 | #define WM831X_LDO11_OFFENA_WIDTH 1 /* LDO11_OFFENA */ | ||
| 1133 | #define WM831X_LDO11_VSEL_SRC 0x0080 /* LDO11_VSEL_SRC */ | ||
| 1134 | #define WM831X_LDO11_VSEL_SRC_MASK 0x0080 /* LDO11_VSEL_SRC */ | ||
| 1135 | #define WM831X_LDO11_VSEL_SRC_SHIFT 7 /* LDO11_VSEL_SRC */ | ||
| 1136 | #define WM831X_LDO11_VSEL_SRC_WIDTH 1 /* LDO11_VSEL_SRC */ | ||
| 1137 | #define WM831X_LDO11_ON_VSEL_MASK 0x000F /* LDO11_ON_VSEL - [3:0] */ | ||
| 1138 | #define WM831X_LDO11_ON_VSEL_SHIFT 0 /* LDO11_ON_VSEL - [3:0] */ | ||
| 1139 | #define WM831X_LDO11_ON_VSEL_WIDTH 4 /* LDO11_ON_VSEL - [3:0] */ | ||
| 1140 | |||
| 1141 | /* | ||
| 1142 | * R16520 (0x4088) - LDO11 SLEEP Control | ||
| 1143 | */ | ||
| 1144 | #define WM831X_LDO11_SLP_SLOT_MASK 0xE000 /* LDO11_SLP_SLOT - [15:13] */ | ||
| 1145 | #define WM831X_LDO11_SLP_SLOT_SHIFT 13 /* LDO11_SLP_SLOT - [15:13] */ | ||
| 1146 | #define WM831X_LDO11_SLP_SLOT_WIDTH 3 /* LDO11_SLP_SLOT - [15:13] */ | ||
| 1147 | #define WM831X_LDO11_SLP_VSEL_MASK 0x000F /* LDO11_SLP_VSEL - [3:0] */ | ||
| 1148 | #define WM831X_LDO11_SLP_VSEL_SHIFT 0 /* LDO11_SLP_VSEL - [3:0] */ | ||
| 1149 | #define WM831X_LDO11_SLP_VSEL_WIDTH 4 /* LDO11_SLP_VSEL - [3:0] */ | ||
| 1150 | |||
| 1151 | /* | ||
| 1152 | * R16526 (0x408E) - Power Good Source 1 | ||
| 1153 | */ | ||
| 1154 | #define WM831X_DC4_OK 0x0008 /* DC4_OK */ | ||
| 1155 | #define WM831X_DC4_OK_MASK 0x0008 /* DC4_OK */ | ||
| 1156 | #define WM831X_DC4_OK_SHIFT 3 /* DC4_OK */ | ||
| 1157 | #define WM831X_DC4_OK_WIDTH 1 /* DC4_OK */ | ||
| 1158 | #define WM831X_DC3_OK 0x0004 /* DC3_OK */ | ||
| 1159 | #define WM831X_DC3_OK_MASK 0x0004 /* DC3_OK */ | ||
| 1160 | #define WM831X_DC3_OK_SHIFT 2 /* DC3_OK */ | ||
| 1161 | #define WM831X_DC3_OK_WIDTH 1 /* DC3_OK */ | ||
| 1162 | #define WM831X_DC2_OK 0x0002 /* DC2_OK */ | ||
| 1163 | #define WM831X_DC2_OK_MASK 0x0002 /* DC2_OK */ | ||
| 1164 | #define WM831X_DC2_OK_SHIFT 1 /* DC2_OK */ | ||
| 1165 | #define WM831X_DC2_OK_WIDTH 1 /* DC2_OK */ | ||
| 1166 | #define WM831X_DC1_OK 0x0001 /* DC1_OK */ | ||
| 1167 | #define WM831X_DC1_OK_MASK 0x0001 /* DC1_OK */ | ||
| 1168 | #define WM831X_DC1_OK_SHIFT 0 /* DC1_OK */ | ||
| 1169 | #define WM831X_DC1_OK_WIDTH 1 /* DC1_OK */ | ||
| 1170 | |||
| 1171 | /* | ||
| 1172 | * R16527 (0x408F) - Power Good Source 2 | ||
| 1173 | */ | ||
| 1174 | #define WM831X_LDO10_OK 0x0200 /* LDO10_OK */ | ||
| 1175 | #define WM831X_LDO10_OK_MASK 0x0200 /* LDO10_OK */ | ||
| 1176 | #define WM831X_LDO10_OK_SHIFT 9 /* LDO10_OK */ | ||
| 1177 | #define WM831X_LDO10_OK_WIDTH 1 /* LDO10_OK */ | ||
| 1178 | #define WM831X_LDO9_OK 0x0100 /* LDO9_OK */ | ||
| 1179 | #define WM831X_LDO9_OK_MASK 0x0100 /* LDO9_OK */ | ||
| 1180 | #define WM831X_LDO9_OK_SHIFT 8 /* LDO9_OK */ | ||
| 1181 | #define WM831X_LDO9_OK_WIDTH 1 /* LDO9_OK */ | ||
| 1182 | #define WM831X_LDO8_OK 0x0080 /* LDO8_OK */ | ||
| 1183 | #define WM831X_LDO8_OK_MASK 0x0080 /* LDO8_OK */ | ||
| 1184 | #define WM831X_LDO8_OK_SHIFT 7 /* LDO8_OK */ | ||
| 1185 | #define WM831X_LDO8_OK_WIDTH 1 /* LDO8_OK */ | ||
| 1186 | #define WM831X_LDO7_OK 0x0040 /* LDO7_OK */ | ||
| 1187 | #define WM831X_LDO7_OK_MASK 0x0040 /* LDO7_OK */ | ||
| 1188 | #define WM831X_LDO7_OK_SHIFT 6 /* LDO7_OK */ | ||
| 1189 | #define WM831X_LDO7_OK_WIDTH 1 /* LDO7_OK */ | ||
| 1190 | #define WM831X_LDO6_OK 0x0020 /* LDO6_OK */ | ||
| 1191 | #define WM831X_LDO6_OK_MASK 0x0020 /* LDO6_OK */ | ||
| 1192 | #define WM831X_LDO6_OK_SHIFT 5 /* LDO6_OK */ | ||
| 1193 | #define WM831X_LDO6_OK_WIDTH 1 /* LDO6_OK */ | ||
| 1194 | #define WM831X_LDO5_OK 0x0010 /* LDO5_OK */ | ||
| 1195 | #define WM831X_LDO5_OK_MASK 0x0010 /* LDO5_OK */ | ||
| 1196 | #define WM831X_LDO5_OK_SHIFT 4 /* LDO5_OK */ | ||
| 1197 | #define WM831X_LDO5_OK_WIDTH 1 /* LDO5_OK */ | ||
| 1198 | #define WM831X_LDO4_OK 0x0008 /* LDO4_OK */ | ||
| 1199 | #define WM831X_LDO4_OK_MASK 0x0008 /* LDO4_OK */ | ||
| 1200 | #define WM831X_LDO4_OK_SHIFT 3 /* LDO4_OK */ | ||
| 1201 | #define WM831X_LDO4_OK_WIDTH 1 /* LDO4_OK */ | ||
| 1202 | #define WM831X_LDO3_OK 0x0004 /* LDO3_OK */ | ||
| 1203 | #define WM831X_LDO3_OK_MASK 0x0004 /* LDO3_OK */ | ||
| 1204 | #define WM831X_LDO3_OK_SHIFT 2 /* LDO3_OK */ | ||
| 1205 | #define WM831X_LDO3_OK_WIDTH 1 /* LDO3_OK */ | ||
| 1206 | #define WM831X_LDO2_OK 0x0002 /* LDO2_OK */ | ||
| 1207 | #define WM831X_LDO2_OK_MASK 0x0002 /* LDO2_OK */ | ||
| 1208 | #define WM831X_LDO2_OK_SHIFT 1 /* LDO2_OK */ | ||
| 1209 | #define WM831X_LDO2_OK_WIDTH 1 /* LDO2_OK */ | ||
| 1210 | #define WM831X_LDO1_OK 0x0001 /* LDO1_OK */ | ||
| 1211 | #define WM831X_LDO1_OK_MASK 0x0001 /* LDO1_OK */ | ||
| 1212 | #define WM831X_LDO1_OK_SHIFT 0 /* LDO1_OK */ | ||
| 1213 | #define WM831X_LDO1_OK_WIDTH 1 /* LDO1_OK */ | ||
| 1214 | |||
| 1215 | #define WM831X_ISINK_MAX_ISEL 55 | ||
| 1216 | extern int wm831x_isinkv_values[WM831X_ISINK_MAX_ISEL + 1]; | ||
| 1217 | |||
| 1218 | #endif | ||
diff --git a/include/linux/mfd/wm831x/status.h b/include/linux/mfd/wm831x/status.h new file mode 100644 index 000000000000..6bc090d0e3ac --- /dev/null +++ b/include/linux/mfd/wm831x/status.h | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | /* | ||
| 2 | * include/linux/mfd/wm831x/status.h -- Status LEDs for WM831x | ||
| 3 | * | ||
| 4 | * Copyright 2009 Wolfson Microelectronics PLC. | ||
| 5 | * | ||
| 6 | * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify it | ||
| 9 | * under the terms of the GNU General Public License as published by the | ||
| 10 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 11 | * option) any later version. | ||
| 12 | * | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef __MFD_WM831X_STATUS_H__ | ||
| 16 | #define __MFD_WM831X_STATUS_H__ | ||
| 17 | |||
| 18 | #define WM831X_LED_SRC_MASK 0xC000 /* LED_SRC - [15:14] */ | ||
| 19 | #define WM831X_LED_SRC_SHIFT 14 /* LED_SRC - [15:14] */ | ||
| 20 | #define WM831X_LED_SRC_WIDTH 2 /* LED_SRC - [15:14] */ | ||
| 21 | #define WM831X_LED_MODE_MASK 0x0300 /* LED_MODE - [9:8] */ | ||
| 22 | #define WM831X_LED_MODE_SHIFT 8 /* LED_MODE - [9:8] */ | ||
| 23 | #define WM831X_LED_MODE_WIDTH 2 /* LED_MODE - [9:8] */ | ||
| 24 | #define WM831X_LED_SEQ_LEN_MASK 0x0030 /* LED_SEQ_LEN - [5:4] */ | ||
| 25 | #define WM831X_LED_SEQ_LEN_SHIFT 4 /* LED_SEQ_LEN - [5:4] */ | ||
| 26 | #define WM831X_LED_SEQ_LEN_WIDTH 2 /* LED_SEQ_LEN - [5:4] */ | ||
| 27 | #define WM831X_LED_DUR_MASK 0x000C /* LED_DUR - [3:2] */ | ||
| 28 | #define WM831X_LED_DUR_SHIFT 2 /* LED_DUR - [3:2] */ | ||
| 29 | #define WM831X_LED_DUR_WIDTH 2 /* LED_DUR - [3:2] */ | ||
| 30 | #define WM831X_LED_DUTY_CYC_MASK 0x0003 /* LED_DUTY_CYC - [1:0] */ | ||
| 31 | #define WM831X_LED_DUTY_CYC_SHIFT 0 /* LED_DUTY_CYC - [1:0] */ | ||
| 32 | #define WM831X_LED_DUTY_CYC_WIDTH 2 /* LED_DUTY_CYC - [1:0] */ | ||
| 33 | |||
| 34 | #endif | ||
diff --git a/include/linux/mfd/wm831x/watchdog.h b/include/linux/mfd/wm831x/watchdog.h new file mode 100644 index 000000000000..97a99b52956f --- /dev/null +++ b/include/linux/mfd/wm831x/watchdog.h | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | /* | ||
| 2 | * include/linux/mfd/wm831x/watchdog.h -- Watchdog for WM831x | ||
| 3 | * | ||
| 4 | * Copyright 2009 Wolfson Microelectronics PLC. | ||
| 5 | * | ||
| 6 | * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify it | ||
| 9 | * under the terms of the GNU General Public License as published by the | ||
| 10 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 11 | * option) any later version. | ||
| 12 | * | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef __MFD_WM831X_WATCHDOG_H__ | ||
| 16 | #define __MFD_WM831X_WATCHDOG_H__ | ||
| 17 | |||
| 18 | |||
| 19 | /* | ||
| 20 | * R16388 (0x4004) - Watchdog | ||
| 21 | */ | ||
| 22 | #define WM831X_WDOG_ENA 0x8000 /* WDOG_ENA */ | ||
| 23 | #define WM831X_WDOG_ENA_MASK 0x8000 /* WDOG_ENA */ | ||
| 24 | #define WM831X_WDOG_ENA_SHIFT 15 /* WDOG_ENA */ | ||
| 25 | #define WM831X_WDOG_ENA_WIDTH 1 /* WDOG_ENA */ | ||
| 26 | #define WM831X_WDOG_DEBUG 0x4000 /* WDOG_DEBUG */ | ||
| 27 | #define WM831X_WDOG_DEBUG_MASK 0x4000 /* WDOG_DEBUG */ | ||
| 28 | #define WM831X_WDOG_DEBUG_SHIFT 14 /* WDOG_DEBUG */ | ||
| 29 | #define WM831X_WDOG_DEBUG_WIDTH 1 /* WDOG_DEBUG */ | ||
| 30 | #define WM831X_WDOG_RST_SRC 0x2000 /* WDOG_RST_SRC */ | ||
| 31 | #define WM831X_WDOG_RST_SRC_MASK 0x2000 /* WDOG_RST_SRC */ | ||
| 32 | #define WM831X_WDOG_RST_SRC_SHIFT 13 /* WDOG_RST_SRC */ | ||
| 33 | #define WM831X_WDOG_RST_SRC_WIDTH 1 /* WDOG_RST_SRC */ | ||
| 34 | #define WM831X_WDOG_SLPENA 0x1000 /* WDOG_SLPENA */ | ||
| 35 | #define WM831X_WDOG_SLPENA_MASK 0x1000 /* WDOG_SLPENA */ | ||
| 36 | #define WM831X_WDOG_SLPENA_SHIFT 12 /* WDOG_SLPENA */ | ||
| 37 | #define WM831X_WDOG_SLPENA_WIDTH 1 /* WDOG_SLPENA */ | ||
| 38 | #define WM831X_WDOG_RESET 0x0800 /* WDOG_RESET */ | ||
| 39 | #define WM831X_WDOG_RESET_MASK 0x0800 /* WDOG_RESET */ | ||
| 40 | #define WM831X_WDOG_RESET_SHIFT 11 /* WDOG_RESET */ | ||
| 41 | #define WM831X_WDOG_RESET_WIDTH 1 /* WDOG_RESET */ | ||
| 42 | #define WM831X_WDOG_SECACT_MASK 0x0300 /* WDOG_SECACT - [9:8] */ | ||
| 43 | #define WM831X_WDOG_SECACT_SHIFT 8 /* WDOG_SECACT - [9:8] */ | ||
| 44 | #define WM831X_WDOG_SECACT_WIDTH 2 /* WDOG_SECACT - [9:8] */ | ||
| 45 | #define WM831X_WDOG_PRIMACT_MASK 0x0030 /* WDOG_PRIMACT - [5:4] */ | ||
| 46 | #define WM831X_WDOG_PRIMACT_SHIFT 4 /* WDOG_PRIMACT - [5:4] */ | ||
| 47 | #define WM831X_WDOG_PRIMACT_WIDTH 2 /* WDOG_PRIMACT - [5:4] */ | ||
| 48 | #define WM831X_WDOG_TO_MASK 0x0007 /* WDOG_TO - [2:0] */ | ||
| 49 | #define WM831X_WDOG_TO_SHIFT 0 /* WDOG_TO - [2:0] */ | ||
| 50 | #define WM831X_WDOG_TO_WIDTH 3 /* WDOG_TO - [2:0] */ | ||
| 51 | |||
| 52 | #endif | ||
diff --git a/include/linux/mfd/wm8350/core.h b/include/linux/mfd/wm8350/core.h index 42cca672f340..1d595de6a055 100644 --- a/include/linux/mfd/wm8350/core.h +++ b/include/linux/mfd/wm8350/core.h | |||
| @@ -605,6 +605,11 @@ struct wm8350_irq { | |||
| 605 | void *data; | 605 | void *data; |
| 606 | }; | 606 | }; |
| 607 | 607 | ||
| 608 | struct wm8350_hwmon { | ||
| 609 | struct platform_device *pdev; | ||
| 610 | struct device *classdev; | ||
| 611 | }; | ||
| 612 | |||
| 608 | struct wm8350 { | 613 | struct wm8350 { |
| 609 | struct device *dev; | 614 | struct device *dev; |
| 610 | 615 | ||
| @@ -621,7 +626,6 @@ struct wm8350 { | |||
| 621 | struct mutex auxadc_mutex; | 626 | struct mutex auxadc_mutex; |
| 622 | 627 | ||
| 623 | /* Interrupt handling */ | 628 | /* Interrupt handling */ |
| 624 | struct work_struct irq_work; | ||
| 625 | struct mutex irq_mutex; /* IRQ table mutex */ | 629 | struct mutex irq_mutex; /* IRQ table mutex */ |
| 626 | struct wm8350_irq irq[WM8350_NUM_IRQ]; | 630 | struct wm8350_irq irq[WM8350_NUM_IRQ]; |
| 627 | int chip_irq; | 631 | int chip_irq; |
| @@ -629,6 +633,7 @@ struct wm8350 { | |||
| 629 | /* Client devices */ | 633 | /* Client devices */ |
| 630 | struct wm8350_codec codec; | 634 | struct wm8350_codec codec; |
| 631 | struct wm8350_gpio gpio; | 635 | struct wm8350_gpio gpio; |
| 636 | struct wm8350_hwmon hwmon; | ||
| 632 | struct wm8350_pmic pmic; | 637 | struct wm8350_pmic pmic; |
| 633 | struct wm8350_power power; | 638 | struct wm8350_power power; |
| 634 | struct wm8350_rtc rtc; | 639 | struct wm8350_rtc rtc; |
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h index 052117744629..adaf3c15e449 100644 --- a/include/linux/miscdevice.h +++ b/include/linux/miscdevice.h | |||
| @@ -41,7 +41,8 @@ struct miscdevice { | |||
| 41 | struct list_head list; | 41 | struct list_head list; |
| 42 | struct device *parent; | 42 | struct device *parent; |
| 43 | struct device *this_device; | 43 | struct device *this_device; |
| 44 | const char *devnode; | 44 | const char *nodename; |
| 45 | mode_t mode; | ||
| 45 | }; | 46 | }; |
| 46 | 47 | ||
| 47 | extern int misc_register(struct miscdevice * misc); | 48 | extern int misc_register(struct miscdevice * misc); |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 9a72cc78e6b8..24c395694f4d 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
| @@ -25,6 +25,7 @@ extern unsigned long max_mapnr; | |||
| 25 | #endif | 25 | #endif |
| 26 | 26 | ||
| 27 | extern unsigned long num_physpages; | 27 | extern unsigned long num_physpages; |
| 28 | extern unsigned long totalram_pages; | ||
| 28 | extern void * high_memory; | 29 | extern void * high_memory; |
| 29 | extern int page_cluster; | 30 | extern int page_cluster; |
| 30 | 31 | ||
| @@ -103,6 +104,7 @@ extern unsigned int kobjsize(const void *objp); | |||
| 103 | #define VM_MIXEDMAP 0x10000000 /* Can contain "struct page" and pure PFN pages */ | 104 | #define VM_MIXEDMAP 0x10000000 /* Can contain "struct page" and pure PFN pages */ |
| 104 | #define VM_SAO 0x20000000 /* Strong Access Ordering (powerpc) */ | 105 | #define VM_SAO 0x20000000 /* Strong Access Ordering (powerpc) */ |
| 105 | #define VM_PFN_AT_MMAP 0x40000000 /* PFNMAP vma that is fully mapped at mmap time */ | 106 | #define VM_PFN_AT_MMAP 0x40000000 /* PFNMAP vma that is fully mapped at mmap time */ |
| 107 | #define VM_MERGEABLE 0x80000000 /* KSM may merge identical pages */ | ||
| 106 | 108 | ||
| 107 | #ifndef VM_STACK_DEFAULT_FLAGS /* arch can override this */ | 109 | #ifndef VM_STACK_DEFAULT_FLAGS /* arch can override this */ |
| 108 | #define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS | 110 | #define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS |
| @@ -283,6 +285,14 @@ static inline int is_vmalloc_addr(const void *x) | |||
| 283 | return 0; | 285 | return 0; |
| 284 | #endif | 286 | #endif |
| 285 | } | 287 | } |
| 288 | #ifdef CONFIG_MMU | ||
| 289 | extern int is_vmalloc_or_module_addr(const void *x); | ||
| 290 | #else | ||
| 291 | static inline int is_vmalloc_or_module_addr(const void *x) | ||
| 292 | { | ||
| 293 | return 0; | ||
| 294 | } | ||
| 295 | #endif | ||
| 286 | 296 | ||
| 287 | static inline struct page *compound_head(struct page *page) | 297 | static inline struct page *compound_head(struct page *page) |
| 288 | { | 298 | { |
| @@ -685,11 +695,12 @@ static inline int page_mapped(struct page *page) | |||
| 685 | #define VM_FAULT_SIGBUS 0x0002 | 695 | #define VM_FAULT_SIGBUS 0x0002 |
| 686 | #define VM_FAULT_MAJOR 0x0004 | 696 | #define VM_FAULT_MAJOR 0x0004 |
| 687 | #define VM_FAULT_WRITE 0x0008 /* Special case for get_user_pages */ | 697 | #define VM_FAULT_WRITE 0x0008 /* Special case for get_user_pages */ |
| 698 | #define VM_FAULT_HWPOISON 0x0010 /* Hit poisoned page */ | ||
| 688 | 699 | ||
| 689 | #define VM_FAULT_NOPAGE 0x0100 /* ->fault installed the pte, not return page */ | 700 | #define VM_FAULT_NOPAGE 0x0100 /* ->fault installed the pte, not return page */ |
| 690 | #define VM_FAULT_LOCKED 0x0200 /* ->fault locked the returned page */ | 701 | #define VM_FAULT_LOCKED 0x0200 /* ->fault locked the returned page */ |
| 691 | 702 | ||
| 692 | #define VM_FAULT_ERROR (VM_FAULT_OOM | VM_FAULT_SIGBUS) | 703 | #define VM_FAULT_ERROR (VM_FAULT_OOM | VM_FAULT_SIGBUS | VM_FAULT_HWPOISON) |
| 693 | 704 | ||
| 694 | /* | 705 | /* |
| 695 | * Can be called by the pagefault handler when it gets a VM_FAULT_OOM. | 706 | * Can be called by the pagefault handler when it gets a VM_FAULT_OOM. |
| @@ -700,17 +711,8 @@ extern void pagefault_out_of_memory(void); | |||
| 700 | 711 | ||
| 701 | extern void show_free_areas(void); | 712 | extern void show_free_areas(void); |
| 702 | 713 | ||
| 703 | #ifdef CONFIG_SHMEM | 714 | int shmem_lock(struct file *file, int lock, struct user_struct *user); |
| 704 | extern int shmem_lock(struct file *file, int lock, struct user_struct *user); | ||
| 705 | #else | ||
| 706 | static inline int shmem_lock(struct file *file, int lock, | ||
| 707 | struct user_struct *user) | ||
| 708 | { | ||
| 709 | return 0; | ||
| 710 | } | ||
| 711 | #endif | ||
| 712 | struct file *shmem_file_setup(const char *name, loff_t size, unsigned long flags); | 715 | struct file *shmem_file_setup(const char *name, loff_t size, unsigned long flags); |
| 713 | |||
| 714 | int shmem_zero_setup(struct vm_area_struct *); | 716 | int shmem_zero_setup(struct vm_area_struct *); |
| 715 | 717 | ||
| 716 | #ifndef CONFIG_MMU | 718 | #ifndef CONFIG_MMU |
| @@ -790,8 +792,14 @@ static inline void unmap_shared_mapping_range(struct address_space *mapping, | |||
| 790 | unmap_mapping_range(mapping, holebegin, holelen, 0); | 792 | unmap_mapping_range(mapping, holebegin, holelen, 0); |
| 791 | } | 793 | } |
| 792 | 794 | ||
| 793 | extern int vmtruncate(struct inode * inode, loff_t offset); | 795 | extern void truncate_pagecache(struct inode *inode, loff_t old, loff_t new); |
| 794 | extern int vmtruncate_range(struct inode * inode, loff_t offset, loff_t end); | 796 | extern int vmtruncate(struct inode *inode, loff_t offset); |
| 797 | extern int vmtruncate_range(struct inode *inode, loff_t offset, loff_t end); | ||
| 798 | |||
| 799 | int truncate_inode_page(struct address_space *mapping, struct page *page); | ||
| 800 | int generic_error_remove_page(struct address_space *mapping, struct page *page); | ||
| 801 | |||
| 802 | int invalidate_inode_page(struct page *page); | ||
| 795 | 803 | ||
| 796 | #ifdef CONFIG_MMU | 804 | #ifdef CONFIG_MMU |
| 797 | extern int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma, | 805 | extern int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma, |
| @@ -815,6 +823,7 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, | |||
| 815 | struct page **pages, struct vm_area_struct **vmas); | 823 | struct page **pages, struct vm_area_struct **vmas); |
| 816 | int get_user_pages_fast(unsigned long start, int nr_pages, int write, | 824 | int get_user_pages_fast(unsigned long start, int nr_pages, int write, |
| 817 | struct page **pages); | 825 | struct page **pages); |
| 826 | struct page *get_dump_page(unsigned long addr); | ||
| 818 | 827 | ||
| 819 | extern int try_to_release_page(struct page * page, gfp_t gfp_mask); | 828 | extern int try_to_release_page(struct page * page, gfp_t gfp_mask); |
| 820 | extern void do_invalidatepage(struct page *page, unsigned long offset); | 829 | extern void do_invalidatepage(struct page *page, unsigned long offset); |
| @@ -1058,6 +1067,8 @@ extern void setup_per_cpu_pageset(void); | |||
| 1058 | static inline void setup_per_cpu_pageset(void) {} | 1067 | static inline void setup_per_cpu_pageset(void) {} |
| 1059 | #endif | 1068 | #endif |
| 1060 | 1069 | ||
| 1070 | extern void zone_pcp_update(struct zone *zone); | ||
| 1071 | |||
| 1061 | /* nommu.c */ | 1072 | /* nommu.c */ |
| 1062 | extern atomic_long_t mmap_pages_allocated; | 1073 | extern atomic_long_t mmap_pages_allocated; |
| 1063 | 1074 | ||
| @@ -1226,7 +1237,8 @@ struct page *follow_page(struct vm_area_struct *, unsigned long address, | |||
| 1226 | #define FOLL_WRITE 0x01 /* check pte is writable */ | 1237 | #define FOLL_WRITE 0x01 /* check pte is writable */ |
| 1227 | #define FOLL_TOUCH 0x02 /* mark page accessed */ | 1238 | #define FOLL_TOUCH 0x02 /* mark page accessed */ |
| 1228 | #define FOLL_GET 0x04 /* do get_page on page */ | 1239 | #define FOLL_GET 0x04 /* do get_page on page */ |
| 1229 | #define FOLL_ANON 0x08 /* give ZERO_PAGE if no pgtable */ | 1240 | #define FOLL_DUMP 0x08 /* give error on hole if it would be zero */ |
| 1241 | #define FOLL_FORCE 0x10 /* get_user_pages read/write w/o permission */ | ||
| 1230 | 1242 | ||
| 1231 | typedef int (*pte_fn_t)(pte_t *pte, pgtable_t token, unsigned long addr, | 1243 | typedef int (*pte_fn_t)(pte_t *pte, pgtable_t token, unsigned long addr, |
| 1232 | void *data); | 1244 | void *data); |
| @@ -1274,7 +1286,7 @@ int in_gate_area_no_task(unsigned long addr); | |||
| 1274 | #define in_gate_area(task, addr) ({(void)task; in_gate_area_no_task(addr);}) | 1286 | #define in_gate_area(task, addr) ({(void)task; in_gate_area_no_task(addr);}) |
| 1275 | #endif /* __HAVE_ARCH_GATE_AREA */ | 1287 | #endif /* __HAVE_ARCH_GATE_AREA */ |
| 1276 | 1288 | ||
| 1277 | int drop_caches_sysctl_handler(struct ctl_table *, int, struct file *, | 1289 | int drop_caches_sysctl_handler(struct ctl_table *, int, |
| 1278 | void __user *, size_t *, loff_t *); | 1290 | void __user *, size_t *, loff_t *); |
| 1279 | unsigned long shrink_slab(unsigned long scanned, gfp_t gfp_mask, | 1291 | unsigned long shrink_slab(unsigned long scanned, gfp_t gfp_mask, |
| 1280 | unsigned long lru_pages); | 1292 | unsigned long lru_pages); |
| @@ -1303,5 +1315,12 @@ void vmemmap_populate_print_last(void); | |||
| 1303 | extern int account_locked_memory(struct mm_struct *mm, struct rlimit *rlim, | 1315 | extern int account_locked_memory(struct mm_struct *mm, struct rlimit *rlim, |
| 1304 | size_t size); | 1316 | size_t size); |
| 1305 | extern void refund_locked_memory(struct mm_struct *mm, size_t size); | 1317 | extern void refund_locked_memory(struct mm_struct *mm, size_t size); |
| 1318 | |||
| 1319 | extern void memory_failure(unsigned long pfn, int trapno); | ||
| 1320 | extern int __memory_failure(unsigned long pfn, int trapno, int ref); | ||
| 1321 | extern int sysctl_memory_failure_early_kill; | ||
| 1322 | extern int sysctl_memory_failure_recovery; | ||
| 1323 | extern atomic_long_t mce_bad_pages; | ||
| 1324 | |||
| 1306 | #endif /* __KERNEL__ */ | 1325 | #endif /* __KERNEL__ */ |
| 1307 | #endif /* _LINUX_MM_H */ | 1326 | #endif /* _LINUX_MM_H */ |
diff --git a/include/linux/mm_inline.h b/include/linux/mm_inline.h index 7fbb97267556..8835b877b8db 100644 --- a/include/linux/mm_inline.h +++ b/include/linux/mm_inline.h | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | * page_is_file_cache - should the page be on a file LRU or anon LRU? | 5 | * page_is_file_cache - should the page be on a file LRU or anon LRU? |
| 6 | * @page: the page to test | 6 | * @page: the page to test |
| 7 | * | 7 | * |
| 8 | * Returns LRU_FILE if @page is page cache page backed by a regular filesystem, | 8 | * Returns 1 if @page is page cache page backed by a regular filesystem, |
| 9 | * or 0 if @page is anonymous, tmpfs or otherwise ram or swap backed. | 9 | * or 0 if @page is anonymous, tmpfs or otherwise ram or swap backed. |
| 10 | * Used by functions that manipulate the LRU lists, to sort a page | 10 | * Used by functions that manipulate the LRU lists, to sort a page |
| 11 | * onto the right LRU list. | 11 | * onto the right LRU list. |
| @@ -16,11 +16,7 @@ | |||
| 16 | */ | 16 | */ |
| 17 | static inline int page_is_file_cache(struct page *page) | 17 | static inline int page_is_file_cache(struct page *page) |
| 18 | { | 18 | { |
| 19 | if (PageSwapBacked(page)) | 19 | return !PageSwapBacked(page); |
| 20 | return 0; | ||
| 21 | |||
| 22 | /* The page is page cache backed by a normal filesystem. */ | ||
| 23 | return LRU_FILE; | ||
| 24 | } | 20 | } |
| 25 | 21 | ||
| 26 | static inline void | 22 | static inline void |
| @@ -39,21 +35,36 @@ del_page_from_lru_list(struct zone *zone, struct page *page, enum lru_list l) | |||
| 39 | mem_cgroup_del_lru_list(page, l); | 35 | mem_cgroup_del_lru_list(page, l); |
| 40 | } | 36 | } |
| 41 | 37 | ||
| 38 | /** | ||
| 39 | * page_lru_base_type - which LRU list type should a page be on? | ||
| 40 | * @page: the page to test | ||
| 41 | * | ||
| 42 | * Used for LRU list index arithmetic. | ||
| 43 | * | ||
| 44 | * Returns the base LRU type - file or anon - @page should be on. | ||
| 45 | */ | ||
| 46 | static inline enum lru_list page_lru_base_type(struct page *page) | ||
| 47 | { | ||
| 48 | if (page_is_file_cache(page)) | ||
| 49 | return LRU_INACTIVE_FILE; | ||
| 50 | return LRU_INACTIVE_ANON; | ||
| 51 | } | ||
| 52 | |||
| 42 | static inline void | 53 | static inline void |
| 43 | del_page_from_lru(struct zone *zone, struct page *page) | 54 | del_page_from_lru(struct zone *zone, struct page *page) |
| 44 | { | 55 | { |
| 45 | enum lru_list l = LRU_BASE; | 56 | enum lru_list l; |
| 46 | 57 | ||
| 47 | list_del(&page->lru); | 58 | list_del(&page->lru); |
| 48 | if (PageUnevictable(page)) { | 59 | if (PageUnevictable(page)) { |
| 49 | __ClearPageUnevictable(page); | 60 | __ClearPageUnevictable(page); |
| 50 | l = LRU_UNEVICTABLE; | 61 | l = LRU_UNEVICTABLE; |
| 51 | } else { | 62 | } else { |
| 63 | l = page_lru_base_type(page); | ||
| 52 | if (PageActive(page)) { | 64 | if (PageActive(page)) { |
| 53 | __ClearPageActive(page); | 65 | __ClearPageActive(page); |
| 54 | l += LRU_ACTIVE; | 66 | l += LRU_ACTIVE; |
| 55 | } | 67 | } |
| 56 | l += page_is_file_cache(page); | ||
| 57 | } | 68 | } |
| 58 | __dec_zone_state(zone, NR_LRU_BASE + l); | 69 | __dec_zone_state(zone, NR_LRU_BASE + l); |
| 59 | mem_cgroup_del_lru_list(page, l); | 70 | mem_cgroup_del_lru_list(page, l); |
| @@ -68,14 +79,14 @@ del_page_from_lru(struct zone *zone, struct page *page) | |||
| 68 | */ | 79 | */ |
| 69 | static inline enum lru_list page_lru(struct page *page) | 80 | static inline enum lru_list page_lru(struct page *page) |
| 70 | { | 81 | { |
| 71 | enum lru_list lru = LRU_BASE; | 82 | enum lru_list lru; |
| 72 | 83 | ||
| 73 | if (PageUnevictable(page)) | 84 | if (PageUnevictable(page)) |
| 74 | lru = LRU_UNEVICTABLE; | 85 | lru = LRU_UNEVICTABLE; |
| 75 | else { | 86 | else { |
| 87 | lru = page_lru_base_type(page); | ||
| 76 | if (PageActive(page)) | 88 | if (PageActive(page)) |
| 77 | lru += LRU_ACTIVE; | 89 | lru += LRU_ACTIVE; |
| 78 | lru += page_is_file_cache(page); | ||
| 79 | } | 90 | } |
| 80 | 91 | ||
| 81 | return lru; | 92 | return lru; |
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 0042090a4d70..84a524afb3dc 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
| @@ -171,7 +171,7 @@ struct vm_area_struct { | |||
| 171 | struct anon_vma *anon_vma; /* Serialized by page_table_lock */ | 171 | struct anon_vma *anon_vma; /* Serialized by page_table_lock */ |
| 172 | 172 | ||
| 173 | /* Function pointers to deal with this struct. */ | 173 | /* Function pointers to deal with this struct. */ |
| 174 | struct vm_operations_struct * vm_ops; | 174 | const struct vm_operations_struct *vm_ops; |
| 175 | 175 | ||
| 176 | /* Information about our backing store: */ | 176 | /* Information about our backing store: */ |
| 177 | unsigned long vm_pgoff; /* Offset (within vm_file) in PAGE_SIZE | 177 | unsigned long vm_pgoff; /* Offset (within vm_file) in PAGE_SIZE |
| @@ -240,6 +240,8 @@ struct mm_struct { | |||
| 240 | 240 | ||
| 241 | unsigned long saved_auxv[AT_VECTOR_SIZE]; /* for /proc/PID/auxv */ | 241 | unsigned long saved_auxv[AT_VECTOR_SIZE]; /* for /proc/PID/auxv */ |
| 242 | 242 | ||
| 243 | struct linux_binfmt *binfmt; | ||
| 244 | |||
| 243 | cpumask_t cpu_vm_mask; | 245 | cpumask_t cpu_vm_mask; |
| 244 | 246 | ||
| 245 | /* Architecture-specific MM context */ | 247 | /* Architecture-specific MM context */ |
| @@ -259,11 +261,10 @@ struct mm_struct { | |||
| 259 | unsigned long flags; /* Must use atomic bitops to access the bits */ | 261 | unsigned long flags; /* Must use atomic bitops to access the bits */ |
| 260 | 262 | ||
| 261 | struct core_state *core_state; /* coredumping support */ | 263 | struct core_state *core_state; /* coredumping support */ |
| 262 | 264 | #ifdef CONFIG_AIO | |
| 263 | /* aio bits */ | ||
| 264 | spinlock_t ioctx_lock; | 265 | spinlock_t ioctx_lock; |
| 265 | struct hlist_head ioctx_list; | 266 | struct hlist_head ioctx_list; |
| 266 | 267 | #endif | |
| 267 | #ifdef CONFIG_MM_OWNER | 268 | #ifdef CONFIG_MM_OWNER |
| 268 | /* | 269 | /* |
| 269 | * "owner" points to a task that is regarded as the canonical | 270 | * "owner" points to a task that is regarded as the canonical |
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index 403aa505f27e..2ee22e8af110 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h | |||
| @@ -40,6 +40,8 @@ struct mmc_csd { | |||
| 40 | }; | 40 | }; |
| 41 | 41 | ||
| 42 | struct mmc_ext_csd { | 42 | struct mmc_ext_csd { |
| 43 | u8 rev; | ||
| 44 | unsigned int sa_timeout; /* Units: 100ns */ | ||
| 43 | unsigned int hs_max_dtr; | 45 | unsigned int hs_max_dtr; |
| 44 | unsigned int sectors; | 46 | unsigned int sectors; |
| 45 | }; | 47 | }; |
| @@ -62,7 +64,8 @@ struct sdio_cccr { | |||
| 62 | low_speed:1, | 64 | low_speed:1, |
| 63 | wide_bus:1, | 65 | wide_bus:1, |
| 64 | high_power:1, | 66 | high_power:1, |
| 65 | high_speed:1; | 67 | high_speed:1, |
| 68 | disable_cd:1; | ||
| 66 | }; | 69 | }; |
| 67 | 70 | ||
| 68 | struct sdio_cis { | 71 | struct sdio_cis { |
| @@ -94,6 +97,8 @@ struct mmc_card { | |||
| 94 | #define MMC_STATE_READONLY (1<<1) /* card is read-only */ | 97 | #define MMC_STATE_READONLY (1<<1) /* card is read-only */ |
| 95 | #define MMC_STATE_HIGHSPEED (1<<2) /* card is in high speed mode */ | 98 | #define MMC_STATE_HIGHSPEED (1<<2) /* card is in high speed mode */ |
| 96 | #define MMC_STATE_BLOCKADDR (1<<3) /* card uses block-addressing */ | 99 | #define MMC_STATE_BLOCKADDR (1<<3) /* card uses block-addressing */ |
| 100 | unsigned int quirks; /* card quirks */ | ||
| 101 | #define MMC_QUIRK_LENIENT_FN0 (1<<0) /* allow SDIO FN0 writes outside of the VS CCCR range */ | ||
| 97 | 102 | ||
| 98 | u32 raw_cid[4]; /* raw card CID */ | 103 | u32 raw_cid[4]; /* raw card CID */ |
| 99 | u32 raw_csd[4]; /* raw card CSD */ | 104 | u32 raw_csd[4]; /* raw card CSD */ |
| @@ -129,6 +134,11 @@ struct mmc_card { | |||
| 129 | #define mmc_card_set_highspeed(c) ((c)->state |= MMC_STATE_HIGHSPEED) | 134 | #define mmc_card_set_highspeed(c) ((c)->state |= MMC_STATE_HIGHSPEED) |
| 130 | #define mmc_card_set_blockaddr(c) ((c)->state |= MMC_STATE_BLOCKADDR) | 135 | #define mmc_card_set_blockaddr(c) ((c)->state |= MMC_STATE_BLOCKADDR) |
| 131 | 136 | ||
| 137 | static inline int mmc_card_lenient_fn0(const struct mmc_card *c) | ||
| 138 | { | ||
| 139 | return c->quirks & MMC_QUIRK_LENIENT_FN0; | ||
| 140 | } | ||
| 141 | |||
| 132 | #define mmc_card_name(c) ((c)->cid.prod_name) | 142 | #define mmc_card_name(c) ((c)->cid.prod_name) |
| 133 | #define mmc_card_id(c) (dev_name(&(c)->dev)) | 143 | #define mmc_card_id(c) (dev_name(&(c)->dev)) |
| 134 | 144 | ||
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h index 7ac8b500d55c..e4898e9eeb59 100644 --- a/include/linux/mmc/core.h +++ b/include/linux/mmc/core.h | |||
| @@ -139,6 +139,7 @@ extern unsigned int mmc_align_data_size(struct mmc_card *, unsigned int); | |||
| 139 | 139 | ||
| 140 | extern int __mmc_claim_host(struct mmc_host *host, atomic_t *abort); | 140 | extern int __mmc_claim_host(struct mmc_host *host, atomic_t *abort); |
| 141 | extern void mmc_release_host(struct mmc_host *host); | 141 | extern void mmc_release_host(struct mmc_host *host); |
| 142 | extern int mmc_try_claim_host(struct mmc_host *host); | ||
| 142 | 143 | ||
| 143 | /** | 144 | /** |
| 144 | * mmc_claim_host - exclusively claim a host | 145 | * mmc_claim_host - exclusively claim a host |
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 3e7615e9087e..eaf36364b7d4 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | #define LINUX_MMC_HOST_H | 11 | #define LINUX_MMC_HOST_H |
| 12 | 12 | ||
| 13 | #include <linux/leds.h> | 13 | #include <linux/leds.h> |
| 14 | #include <linux/sched.h> | ||
| 14 | 15 | ||
| 15 | #include <linux/mmc/core.h> | 16 | #include <linux/mmc/core.h> |
| 16 | 17 | ||
| @@ -51,6 +52,35 @@ struct mmc_ios { | |||
| 51 | }; | 52 | }; |
| 52 | 53 | ||
| 53 | struct mmc_host_ops { | 54 | struct mmc_host_ops { |
| 55 | /* | ||
| 56 | * Hosts that support power saving can use the 'enable' and 'disable' | ||
| 57 | * methods to exit and enter power saving states. 'enable' is called | ||
| 58 | * when the host is claimed and 'disable' is called (or scheduled with | ||
| 59 | * a delay) when the host is released. The 'disable' is scheduled if | ||
| 60 | * the disable delay set by 'mmc_set_disable_delay()' is non-zero, | ||
| 61 | * otherwise 'disable' is called immediately. 'disable' may be | ||
| 62 | * scheduled repeatedly, to permit ever greater power saving at the | ||
| 63 | * expense of ever greater latency to re-enable. Rescheduling is | ||
| 64 | * determined by the return value of the 'disable' method. A positive | ||
| 65 | * value gives the delay in milliseconds. | ||
| 66 | * | ||
| 67 | * In the case where a host function (like set_ios) may be called | ||
| 68 | * with or without the host claimed, enabling and disabling can be | ||
| 69 | * done directly and will nest correctly. Call 'mmc_host_enable()' and | ||
| 70 | * 'mmc_host_lazy_disable()' for this purpose, but note that these | ||
| 71 | * functions must be paired. | ||
| 72 | * | ||
| 73 | * Alternatively, 'mmc_host_enable()' may be paired with | ||
| 74 | * 'mmc_host_disable()' which calls 'disable' immediately. In this | ||
| 75 | * case the 'disable' method will be called with 'lazy' set to 0. | ||
| 76 | * This is mainly useful for error paths. | ||
| 77 | * | ||
| 78 | * Because lazy disable may be called from a work queue, the 'disable' | ||
| 79 | * method must claim the host when 'lazy' != 0, which will work | ||
| 80 | * correctly because recursion is detected and handled. | ||
| 81 | */ | ||
| 82 | int (*enable)(struct mmc_host *host); | ||
| 83 | int (*disable)(struct mmc_host *host, int lazy); | ||
| 54 | void (*request)(struct mmc_host *host, struct mmc_request *req); | 84 | void (*request)(struct mmc_host *host, struct mmc_request *req); |
| 55 | /* | 85 | /* |
| 56 | * Avoid calling these three functions too often or in a "fast path", | 86 | * Avoid calling these three functions too often or in a "fast path", |
| @@ -118,6 +148,9 @@ struct mmc_host { | |||
| 118 | #define MMC_CAP_SPI (1 << 4) /* Talks only SPI protocols */ | 148 | #define MMC_CAP_SPI (1 << 4) /* Talks only SPI protocols */ |
| 119 | #define MMC_CAP_NEEDS_POLL (1 << 5) /* Needs polling for card-detection */ | 149 | #define MMC_CAP_NEEDS_POLL (1 << 5) /* Needs polling for card-detection */ |
| 120 | #define MMC_CAP_8_BIT_DATA (1 << 6) /* Can the host do 8 bit transfers */ | 150 | #define MMC_CAP_8_BIT_DATA (1 << 6) /* Can the host do 8 bit transfers */ |
| 151 | #define MMC_CAP_DISABLE (1 << 7) /* Can the host be disabled */ | ||
| 152 | #define MMC_CAP_NONREMOVABLE (1 << 8) /* Nonremovable e.g. eMMC */ | ||
| 153 | #define MMC_CAP_WAIT_WHILE_BUSY (1 << 9) /* Waits while card is busy */ | ||
| 121 | 154 | ||
| 122 | /* host specific block data */ | 155 | /* host specific block data */ |
| 123 | unsigned int max_seg_size; /* see blk_queue_max_segment_size */ | 156 | unsigned int max_seg_size; /* see blk_queue_max_segment_size */ |
| @@ -142,9 +175,18 @@ struct mmc_host { | |||
| 142 | unsigned int removed:1; /* host is being removed */ | 175 | unsigned int removed:1; /* host is being removed */ |
| 143 | #endif | 176 | #endif |
| 144 | 177 | ||
| 178 | /* Only used with MMC_CAP_DISABLE */ | ||
| 179 | int enabled; /* host is enabled */ | ||
| 180 | int nesting_cnt; /* "enable" nesting count */ | ||
| 181 | int en_dis_recurs; /* detect recursion */ | ||
| 182 | unsigned int disable_delay; /* disable delay in msecs */ | ||
| 183 | struct delayed_work disable; /* disabling work */ | ||
| 184 | |||
| 145 | struct mmc_card *card; /* device attached to this host */ | 185 | struct mmc_card *card; /* device attached to this host */ |
| 146 | 186 | ||
| 147 | wait_queue_head_t wq; | 187 | wait_queue_head_t wq; |
| 188 | struct task_struct *claimer; /* task that has host claimed */ | ||
| 189 | int claim_cnt; /* "claim" nesting count */ | ||
| 148 | 190 | ||
| 149 | struct delayed_work detect; | 191 | struct delayed_work detect; |
| 150 | 192 | ||
| @@ -183,6 +225,9 @@ static inline void *mmc_priv(struct mmc_host *host) | |||
| 183 | extern int mmc_suspend_host(struct mmc_host *, pm_message_t); | 225 | extern int mmc_suspend_host(struct mmc_host *, pm_message_t); |
| 184 | extern int mmc_resume_host(struct mmc_host *); | 226 | extern int mmc_resume_host(struct mmc_host *); |
| 185 | 227 | ||
| 228 | extern void mmc_power_save_host(struct mmc_host *host); | ||
| 229 | extern void mmc_power_restore_host(struct mmc_host *host); | ||
| 230 | |||
| 186 | extern void mmc_detect_change(struct mmc_host *, unsigned long delay); | 231 | extern void mmc_detect_change(struct mmc_host *, unsigned long delay); |
| 187 | extern void mmc_request_done(struct mmc_host *, struct mmc_request *); | 232 | extern void mmc_request_done(struct mmc_host *, struct mmc_request *); |
| 188 | 233 | ||
| @@ -197,5 +242,19 @@ struct regulator; | |||
| 197 | int mmc_regulator_get_ocrmask(struct regulator *supply); | 242 | int mmc_regulator_get_ocrmask(struct regulator *supply); |
| 198 | int mmc_regulator_set_ocr(struct regulator *supply, unsigned short vdd_bit); | 243 | int mmc_regulator_set_ocr(struct regulator *supply, unsigned short vdd_bit); |
| 199 | 244 | ||
| 245 | int mmc_card_awake(struct mmc_host *host); | ||
| 246 | int mmc_card_sleep(struct mmc_host *host); | ||
| 247 | int mmc_card_can_sleep(struct mmc_host *host); | ||
| 248 | |||
| 249 | int mmc_host_enable(struct mmc_host *host); | ||
| 250 | int mmc_host_disable(struct mmc_host *host); | ||
| 251 | int mmc_host_lazy_disable(struct mmc_host *host); | ||
| 252 | |||
| 253 | static inline void mmc_set_disable_delay(struct mmc_host *host, | ||
| 254 | unsigned int disable_delay) | ||
| 255 | { | ||
| 256 | host->disable_delay = disable_delay; | ||
| 257 | } | ||
| 258 | |||
| 200 | #endif | 259 | #endif |
| 201 | 260 | ||
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h index 14b81f3e5232..c02c8db73701 100644 --- a/include/linux/mmc/mmc.h +++ b/include/linux/mmc/mmc.h | |||
| @@ -31,6 +31,7 @@ | |||
| 31 | #define MMC_ALL_SEND_CID 2 /* bcr R2 */ | 31 | #define MMC_ALL_SEND_CID 2 /* bcr R2 */ |
| 32 | #define MMC_SET_RELATIVE_ADDR 3 /* ac [31:16] RCA R1 */ | 32 | #define MMC_SET_RELATIVE_ADDR 3 /* ac [31:16] RCA R1 */ |
| 33 | #define MMC_SET_DSR 4 /* bc [31:16] RCA */ | 33 | #define MMC_SET_DSR 4 /* bc [31:16] RCA */ |
| 34 | #define MMC_SLEEP_AWAKE 5 /* ac [31:16] RCA 15:flg R1b */ | ||
| 34 | #define MMC_SWITCH 6 /* ac [31:0] See below R1b */ | 35 | #define MMC_SWITCH 6 /* ac [31:0] See below R1b */ |
| 35 | #define MMC_SELECT_CARD 7 /* ac [31:16] RCA R1 */ | 36 | #define MMC_SELECT_CARD 7 /* ac [31:16] RCA R1 */ |
| 36 | #define MMC_SEND_EXT_CSD 8 /* adtc R1 */ | 37 | #define MMC_SEND_EXT_CSD 8 /* adtc R1 */ |
| @@ -127,6 +128,7 @@ | |||
| 127 | #define R1_STATUS(x) (x & 0xFFFFE000) | 128 | #define R1_STATUS(x) (x & 0xFFFFE000) |
| 128 | #define R1_CURRENT_STATE(x) ((x & 0x00001E00) >> 9) /* sx, b (4 bits) */ | 129 | #define R1_CURRENT_STATE(x) ((x & 0x00001E00) >> 9) /* sx, b (4 bits) */ |
| 129 | #define R1_READY_FOR_DATA (1 << 8) /* sx, a */ | 130 | #define R1_READY_FOR_DATA (1 << 8) /* sx, a */ |
| 131 | #define R1_SWITCH_ERROR (1 << 7) /* sx, c */ | ||
| 130 | #define R1_APP_CMD (1 << 5) /* sr, c */ | 132 | #define R1_APP_CMD (1 << 5) /* sr, c */ |
| 131 | 133 | ||
| 132 | /* | 134 | /* |
| @@ -254,6 +256,7 @@ struct _mmc_csd { | |||
| 254 | #define EXT_CSD_CARD_TYPE 196 /* RO */ | 256 | #define EXT_CSD_CARD_TYPE 196 /* RO */ |
| 255 | #define EXT_CSD_REV 192 /* RO */ | 257 | #define EXT_CSD_REV 192 /* RO */ |
| 256 | #define EXT_CSD_SEC_CNT 212 /* RO, 4 bytes */ | 258 | #define EXT_CSD_SEC_CNT 212 /* RO, 4 bytes */ |
| 259 | #define EXT_CSD_S_A_TIMEOUT 217 | ||
| 257 | 260 | ||
| 258 | /* | 261 | /* |
| 259 | * EXT_CSD field definitions | 262 | * EXT_CSD field definitions |
diff --git a/include/linux/mmc/sdio_func.h b/include/linux/mmc/sdio_func.h index 451bdfc85830..ac3ab683fec6 100644 --- a/include/linux/mmc/sdio_func.h +++ b/include/linux/mmc/sdio_func.h | |||
| @@ -67,6 +67,7 @@ struct sdio_func { | |||
| 67 | 67 | ||
| 68 | #define sdio_get_drvdata(f) dev_get_drvdata(&(f)->dev) | 68 | #define sdio_get_drvdata(f) dev_get_drvdata(&(f)->dev) |
| 69 | #define sdio_set_drvdata(f,d) dev_set_drvdata(&(f)->dev, d) | 69 | #define sdio_set_drvdata(f,d) dev_set_drvdata(&(f)->dev, d) |
| 70 | #define dev_to_sdio_func(d) container_of(d, struct sdio_func, dev) | ||
| 70 | 71 | ||
| 71 | /* | 72 | /* |
| 72 | * SDIO function device driver | 73 | * SDIO function device driver |
| @@ -81,6 +82,8 @@ struct sdio_driver { | |||
| 81 | struct device_driver drv; | 82 | struct device_driver drv; |
| 82 | }; | 83 | }; |
| 83 | 84 | ||
| 85 | #define to_sdio_driver(d) container_of(d, struct sdio_driver, drv) | ||
| 86 | |||
| 84 | /** | 87 | /** |
| 85 | * SDIO_DEVICE - macro used to describe a specific SDIO device | 88 | * SDIO_DEVICE - macro used to describe a specific SDIO device |
| 86 | * @vend: the 16 bit manufacturer code | 89 | * @vend: the 16 bit manufacturer code |
diff --git a/include/linux/mmc/sdio_ids.h b/include/linux/mmc/sdio_ids.h index 39751c8cde9c..2dbfb5a05994 100644 --- a/include/linux/mmc/sdio_ids.h +++ b/include/linux/mmc/sdio_ids.h | |||
| @@ -22,6 +22,12 @@ | |||
| 22 | /* | 22 | /* |
| 23 | * Vendors and devices. Sort key: vendor first, device next. | 23 | * Vendors and devices. Sort key: vendor first, device next. |
| 24 | */ | 24 | */ |
| 25 | #define SDIO_VENDOR_ID_INTEL 0x0089 | ||
| 26 | #define SDIO_DEVICE_ID_INTEL_IWMC3200WIMAX 0x1402 | ||
| 27 | #define SDIO_DEVICE_ID_INTEL_IWMC3200WIFI 0x1403 | ||
| 28 | #define SDIO_DEVICE_ID_INTEL_IWMC3200TOP 0x1404 | ||
| 29 | #define SDIO_DEVICE_ID_INTEL_IWMC3200GPS 0x1405 | ||
| 30 | #define SDIO_DEVICE_ID_INTEL_IWMC3200BT 0x1406 | ||
| 25 | 31 | ||
| 26 | #define SDIO_VENDOR_ID_MARVELL 0x02df | 32 | #define SDIO_VENDOR_ID_MARVELL 0x02df |
| 27 | #define SDIO_DEVICE_ID_MARVELL_LIBERTAS 0x9103 | 33 | #define SDIO_DEVICE_ID_MARVELL_LIBERTAS 0x9103 |
diff --git a/include/linux/mmu_context.h b/include/linux/mmu_context.h new file mode 100644 index 000000000000..70fffeba7495 --- /dev/null +++ b/include/linux/mmu_context.h | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | #ifndef _LINUX_MMU_CONTEXT_H | ||
| 2 | #define _LINUX_MMU_CONTEXT_H | ||
| 3 | |||
| 4 | struct mm_struct; | ||
| 5 | |||
| 6 | void use_mm(struct mm_struct *mm); | ||
| 7 | void unuse_mm(struct mm_struct *mm); | ||
| 8 | |||
| 9 | #endif | ||
diff --git a/include/linux/mmu_notifier.h b/include/linux/mmu_notifier.h index b77486d152cd..4e02ee2b071e 100644 --- a/include/linux/mmu_notifier.h +++ b/include/linux/mmu_notifier.h | |||
| @@ -62,6 +62,15 @@ struct mmu_notifier_ops { | |||
| 62 | unsigned long address); | 62 | unsigned long address); |
| 63 | 63 | ||
| 64 | /* | 64 | /* |
| 65 | * change_pte is called in cases that pte mapping to page is changed: | ||
| 66 | * for example, when ksm remaps pte to point to a new shared page. | ||
| 67 | */ | ||
| 68 | void (*change_pte)(struct mmu_notifier *mn, | ||
| 69 | struct mm_struct *mm, | ||
| 70 | unsigned long address, | ||
| 71 | pte_t pte); | ||
| 72 | |||
| 73 | /* | ||
| 65 | * Before this is invoked any secondary MMU is still ok to | 74 | * Before this is invoked any secondary MMU is still ok to |
| 66 | * read/write to the page previously pointed to by the Linux | 75 | * read/write to the page previously pointed to by the Linux |
| 67 | * pte because the page hasn't been freed yet and it won't be | 76 | * pte because the page hasn't been freed yet and it won't be |
| @@ -154,6 +163,8 @@ extern void __mmu_notifier_mm_destroy(struct mm_struct *mm); | |||
| 154 | extern void __mmu_notifier_release(struct mm_struct *mm); | 163 | extern void __mmu_notifier_release(struct mm_struct *mm); |
| 155 | extern int __mmu_notifier_clear_flush_young(struct mm_struct *mm, | 164 | extern int __mmu_notifier_clear_flush_young(struct mm_struct *mm, |
| 156 | unsigned long address); | 165 | unsigned long address); |
| 166 | extern void __mmu_notifier_change_pte(struct mm_struct *mm, | ||
| 167 | unsigned long address, pte_t pte); | ||
| 157 | extern void __mmu_notifier_invalidate_page(struct mm_struct *mm, | 168 | extern void __mmu_notifier_invalidate_page(struct mm_struct *mm, |
| 158 | unsigned long address); | 169 | unsigned long address); |
| 159 | extern void __mmu_notifier_invalidate_range_start(struct mm_struct *mm, | 170 | extern void __mmu_notifier_invalidate_range_start(struct mm_struct *mm, |
| @@ -175,6 +186,13 @@ static inline int mmu_notifier_clear_flush_young(struct mm_struct *mm, | |||
| 175 | return 0; | 186 | return 0; |
| 176 | } | 187 | } |
| 177 | 188 | ||
| 189 | static inline void mmu_notifier_change_pte(struct mm_struct *mm, | ||
| 190 | unsigned long address, pte_t pte) | ||
| 191 | { | ||
| 192 | if (mm_has_notifiers(mm)) | ||
| 193 | __mmu_notifier_change_pte(mm, address, pte); | ||
| 194 | } | ||
| 195 | |||
| 178 | static inline void mmu_notifier_invalidate_page(struct mm_struct *mm, | 196 | static inline void mmu_notifier_invalidate_page(struct mm_struct *mm, |
| 179 | unsigned long address) | 197 | unsigned long address) |
| 180 | { | 198 | { |
| @@ -236,6 +254,16 @@ static inline void mmu_notifier_mm_destroy(struct mm_struct *mm) | |||
| 236 | __young; \ | 254 | __young; \ |
| 237 | }) | 255 | }) |
| 238 | 256 | ||
| 257 | #define set_pte_at_notify(__mm, __address, __ptep, __pte) \ | ||
| 258 | ({ \ | ||
| 259 | struct mm_struct *___mm = __mm; \ | ||
| 260 | unsigned long ___address = __address; \ | ||
| 261 | pte_t ___pte = __pte; \ | ||
| 262 | \ | ||
| 263 | set_pte_at(___mm, ___address, __ptep, ___pte); \ | ||
| 264 | mmu_notifier_change_pte(___mm, ___address, ___pte); \ | ||
| 265 | }) | ||
| 266 | |||
| 239 | #else /* CONFIG_MMU_NOTIFIER */ | 267 | #else /* CONFIG_MMU_NOTIFIER */ |
| 240 | 268 | ||
| 241 | static inline void mmu_notifier_release(struct mm_struct *mm) | 269 | static inline void mmu_notifier_release(struct mm_struct *mm) |
| @@ -248,6 +276,11 @@ static inline int mmu_notifier_clear_flush_young(struct mm_struct *mm, | |||
| 248 | return 0; | 276 | return 0; |
| 249 | } | 277 | } |
| 250 | 278 | ||
| 279 | static inline void mmu_notifier_change_pte(struct mm_struct *mm, | ||
| 280 | unsigned long address, pte_t pte) | ||
| 281 | { | ||
| 282 | } | ||
| 283 | |||
| 251 | static inline void mmu_notifier_invalidate_page(struct mm_struct *mm, | 284 | static inline void mmu_notifier_invalidate_page(struct mm_struct *mm, |
| 252 | unsigned long address) | 285 | unsigned long address) |
| 253 | { | 286 | { |
| @@ -273,6 +306,7 @@ static inline void mmu_notifier_mm_destroy(struct mm_struct *mm) | |||
| 273 | 306 | ||
| 274 | #define ptep_clear_flush_young_notify ptep_clear_flush_young | 307 | #define ptep_clear_flush_young_notify ptep_clear_flush_young |
| 275 | #define ptep_clear_flush_notify ptep_clear_flush | 308 | #define ptep_clear_flush_notify ptep_clear_flush |
| 309 | #define set_pte_at_notify set_pte_at | ||
| 276 | 310 | ||
| 277 | #endif /* CONFIG_MMU_NOTIFIER */ | 311 | #endif /* CONFIG_MMU_NOTIFIER */ |
| 278 | 312 | ||
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 889598537370..6f7561730d88 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
| @@ -38,6 +38,7 @@ | |||
| 38 | #define MIGRATE_UNMOVABLE 0 | 38 | #define MIGRATE_UNMOVABLE 0 |
| 39 | #define MIGRATE_RECLAIMABLE 1 | 39 | #define MIGRATE_RECLAIMABLE 1 |
| 40 | #define MIGRATE_MOVABLE 2 | 40 | #define MIGRATE_MOVABLE 2 |
| 41 | #define MIGRATE_PCPTYPES 3 /* the number of types on the pcp lists */ | ||
| 41 | #define MIGRATE_RESERVE 3 | 42 | #define MIGRATE_RESERVE 3 |
| 42 | #define MIGRATE_ISOLATE 4 /* can't allocate from here */ | 43 | #define MIGRATE_ISOLATE 4 /* can't allocate from here */ |
| 43 | #define MIGRATE_TYPES 5 | 44 | #define MIGRATE_TYPES 5 |
| @@ -94,11 +95,15 @@ enum zone_stat_item { | |||
| 94 | NR_SLAB_RECLAIMABLE, | 95 | NR_SLAB_RECLAIMABLE, |
| 95 | NR_SLAB_UNRECLAIMABLE, | 96 | NR_SLAB_UNRECLAIMABLE, |
| 96 | NR_PAGETABLE, /* used for pagetables */ | 97 | NR_PAGETABLE, /* used for pagetables */ |
| 98 | NR_KERNEL_STACK, | ||
| 99 | /* Second 128 byte cacheline */ | ||
| 97 | NR_UNSTABLE_NFS, /* NFS unstable pages */ | 100 | NR_UNSTABLE_NFS, /* NFS unstable pages */ |
| 98 | NR_BOUNCE, | 101 | NR_BOUNCE, |
| 99 | NR_VMSCAN_WRITE, | 102 | NR_VMSCAN_WRITE, |
| 100 | /* Second 128 byte cacheline */ | ||
| 101 | NR_WRITEBACK_TEMP, /* Writeback using temporary buffers */ | 103 | NR_WRITEBACK_TEMP, /* Writeback using temporary buffers */ |
| 104 | NR_ISOLATED_ANON, /* Temporary isolated pages from anon lru */ | ||
| 105 | NR_ISOLATED_FILE, /* Temporary isolated pages from file lru */ | ||
| 106 | NR_SHMEM, /* shmem pages (included tmpfs/GEM pages) */ | ||
| 102 | #ifdef CONFIG_NUMA | 107 | #ifdef CONFIG_NUMA |
| 103 | NUMA_HIT, /* allocated in intended node */ | 108 | NUMA_HIT, /* allocated in intended node */ |
| 104 | NUMA_MISS, /* allocated in non intended node */ | 109 | NUMA_MISS, /* allocated in non intended node */ |
| @@ -165,7 +170,9 @@ struct per_cpu_pages { | |||
| 165 | int count; /* number of pages in the list */ | 170 | int count; /* number of pages in the list */ |
| 166 | int high; /* high watermark, emptying needed */ | 171 | int high; /* high watermark, emptying needed */ |
| 167 | int batch; /* chunk size for buddy add/remove */ | 172 | int batch; /* chunk size for buddy add/remove */ |
| 168 | struct list_head list; /* the list of pages */ | 173 | |
| 174 | /* Lists of pages, one per migrate type stored on the pcp-lists */ | ||
| 175 | struct list_head lists[MIGRATE_PCPTYPES]; | ||
| 169 | }; | 176 | }; |
| 170 | 177 | ||
| 171 | struct per_cpu_pageset { | 178 | struct per_cpu_pageset { |
| @@ -269,6 +276,11 @@ struct zone_reclaim_stat { | |||
| 269 | */ | 276 | */ |
| 270 | unsigned long recent_rotated[2]; | 277 | unsigned long recent_rotated[2]; |
| 271 | unsigned long recent_scanned[2]; | 278 | unsigned long recent_scanned[2]; |
| 279 | |||
| 280 | /* | ||
| 281 | * accumulated for batching | ||
| 282 | */ | ||
| 283 | unsigned long nr_saved_scan[NR_LRU_LISTS]; | ||
| 272 | }; | 284 | }; |
| 273 | 285 | ||
| 274 | struct zone { | 286 | struct zone { |
| @@ -323,7 +335,6 @@ struct zone { | |||
| 323 | spinlock_t lru_lock; | 335 | spinlock_t lru_lock; |
| 324 | struct zone_lru { | 336 | struct zone_lru { |
| 325 | struct list_head list; | 337 | struct list_head list; |
| 326 | unsigned long nr_saved_scan; /* accumulated for batching */ | ||
| 327 | } lru[NR_LRU_LISTS]; | 338 | } lru[NR_LRU_LISTS]; |
| 328 | 339 | ||
| 329 | struct zone_reclaim_stat reclaim_stat; | 340 | struct zone_reclaim_stat reclaim_stat; |
| @@ -744,21 +755,20 @@ static inline int is_dma(struct zone *zone) | |||
| 744 | 755 | ||
| 745 | /* These two functions are used to setup the per zone pages min values */ | 756 | /* These two functions are used to setup the per zone pages min values */ |
| 746 | struct ctl_table; | 757 | struct ctl_table; |
| 747 | struct file; | 758 | int min_free_kbytes_sysctl_handler(struct ctl_table *, int, |
| 748 | int min_free_kbytes_sysctl_handler(struct ctl_table *, int, struct file *, | ||
| 749 | void __user *, size_t *, loff_t *); | 759 | void __user *, size_t *, loff_t *); |
| 750 | extern int sysctl_lowmem_reserve_ratio[MAX_NR_ZONES-1]; | 760 | extern int sysctl_lowmem_reserve_ratio[MAX_NR_ZONES-1]; |
| 751 | int lowmem_reserve_ratio_sysctl_handler(struct ctl_table *, int, struct file *, | 761 | int lowmem_reserve_ratio_sysctl_handler(struct ctl_table *, int, |
| 752 | void __user *, size_t *, loff_t *); | 762 | void __user *, size_t *, loff_t *); |
| 753 | int percpu_pagelist_fraction_sysctl_handler(struct ctl_table *, int, struct file *, | 763 | int percpu_pagelist_fraction_sysctl_handler(struct ctl_table *, int, |
| 754 | void __user *, size_t *, loff_t *); | 764 | void __user *, size_t *, loff_t *); |
| 755 | int sysctl_min_unmapped_ratio_sysctl_handler(struct ctl_table *, int, | 765 | int sysctl_min_unmapped_ratio_sysctl_handler(struct ctl_table *, int, |
| 756 | struct file *, void __user *, size_t *, loff_t *); | 766 | void __user *, size_t *, loff_t *); |
| 757 | int sysctl_min_slab_ratio_sysctl_handler(struct ctl_table *, int, | 767 | int sysctl_min_slab_ratio_sysctl_handler(struct ctl_table *, int, |
| 758 | struct file *, void __user *, size_t *, loff_t *); | 768 | void __user *, size_t *, loff_t *); |
| 759 | 769 | ||
| 760 | extern int numa_zonelist_order_handler(struct ctl_table *, int, | 770 | extern int numa_zonelist_order_handler(struct ctl_table *, int, |
| 761 | struct file *, void __user *, size_t *, loff_t *); | 771 | void __user *, size_t *, loff_t *); |
| 762 | extern char numa_zonelist_order[]; | 772 | extern char numa_zonelist_order[]; |
| 763 | #define NUMA_ZONELIST_ORDER_LEN 16 /* string buffer size */ | 773 | #define NUMA_ZONELIST_ORDER_LEN 16 /* string buffer size */ |
| 764 | 774 | ||
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index 1bf5900ffe43..f58e9d836f32 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h | |||
| @@ -399,6 +399,17 @@ struct i2c_device_id { | |||
| 399 | __attribute__((aligned(sizeof(kernel_ulong_t)))); | 399 | __attribute__((aligned(sizeof(kernel_ulong_t)))); |
| 400 | }; | 400 | }; |
| 401 | 401 | ||
| 402 | /* spi */ | ||
| 403 | |||
| 404 | #define SPI_NAME_SIZE 32 | ||
| 405 | #define SPI_MODULE_PREFIX "spi:" | ||
| 406 | |||
| 407 | struct spi_device_id { | ||
| 408 | char name[SPI_NAME_SIZE]; | ||
| 409 | kernel_ulong_t driver_data /* Data private to the driver */ | ||
| 410 | __attribute__((aligned(sizeof(kernel_ulong_t)))); | ||
| 411 | }; | ||
| 412 | |||
| 402 | /* dmi */ | 413 | /* dmi */ |
| 403 | enum dmi_field { | 414 | enum dmi_field { |
| 404 | DMI_NONE, | 415 | DMI_NONE, |
diff --git a/include/linux/module.h b/include/linux/module.h index f8f92d015efe..482efc865acf 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
| @@ -15,7 +15,6 @@ | |||
| 15 | #include <linux/stringify.h> | 15 | #include <linux/stringify.h> |
| 16 | #include <linux/kobject.h> | 16 | #include <linux/kobject.h> |
| 17 | #include <linux/moduleparam.h> | 17 | #include <linux/moduleparam.h> |
| 18 | #include <linux/marker.h> | ||
| 19 | #include <linux/tracepoint.h> | 18 | #include <linux/tracepoint.h> |
| 20 | 19 | ||
| 21 | #include <asm/local.h> | 20 | #include <asm/local.h> |
| @@ -129,7 +128,10 @@ extern struct module __this_module; | |||
| 129 | */ | 128 | */ |
| 130 | #define MODULE_LICENSE(_license) MODULE_INFO(license, _license) | 129 | #define MODULE_LICENSE(_license) MODULE_INFO(license, _license) |
| 131 | 130 | ||
| 132 | /* Author, ideally of form NAME[, NAME]*[ and NAME] */ | 131 | /* |
| 132 | * Author(s), use "Name <email>" or just "Name", for multiple | ||
| 133 | * authors use multiple MODULE_AUTHOR() statements/lines. | ||
| 134 | */ | ||
| 133 | #define MODULE_AUTHOR(_author) MODULE_INFO(author, _author) | 135 | #define MODULE_AUTHOR(_author) MODULE_INFO(author, _author) |
| 134 | 136 | ||
| 135 | /* What your module does. */ | 137 | /* What your module does. */ |
| @@ -309,10 +311,14 @@ struct module | |||
| 309 | #endif | 311 | #endif |
| 310 | 312 | ||
| 311 | #ifdef CONFIG_KALLSYMS | 313 | #ifdef CONFIG_KALLSYMS |
| 312 | /* We keep the symbol and string tables for kallsyms. */ | 314 | /* |
| 313 | Elf_Sym *symtab; | 315 | * We keep the symbol and string tables for kallsyms. |
| 314 | unsigned int num_symtab; | 316 | * The core_* fields below are temporary, loader-only (they |
| 315 | char *strtab; | 317 | * could really be discarded after module init). |
| 318 | */ | ||
| 319 | Elf_Sym *symtab, *core_symtab; | ||
| 320 | unsigned int num_symtab, core_num_syms; | ||
| 321 | char *strtab, *core_strtab; | ||
| 316 | 322 | ||
| 317 | /* Section attributes */ | 323 | /* Section attributes */ |
| 318 | struct module_sect_attrs *sect_attrs; | 324 | struct module_sect_attrs *sect_attrs; |
| @@ -327,10 +333,6 @@ struct module | |||
| 327 | /* The command line arguments (may be mangled). People like | 333 | /* The command line arguments (may be mangled). People like |
| 328 | keeping pointers to this stuff */ | 334 | keeping pointers to this stuff */ |
| 329 | char *args; | 335 | char *args; |
| 330 | #ifdef CONFIG_MARKERS | ||
| 331 | struct marker *markers; | ||
| 332 | unsigned int num_markers; | ||
| 333 | #endif | ||
| 334 | #ifdef CONFIG_TRACEPOINTS | 336 | #ifdef CONFIG_TRACEPOINTS |
| 335 | struct tracepoint *tracepoints; | 337 | struct tracepoint *tracepoints; |
| 336 | unsigned int num_tracepoints; | 338 | unsigned int num_tracepoints; |
| @@ -535,8 +537,6 @@ int unregister_module_notifier(struct notifier_block * nb); | |||
| 535 | 537 | ||
| 536 | extern void print_modules(void); | 538 | extern void print_modules(void); |
| 537 | 539 | ||
| 538 | extern void module_update_markers(void); | ||
| 539 | |||
| 540 | extern void module_update_tracepoints(void); | 540 | extern void module_update_tracepoints(void); |
| 541 | extern int module_get_iter_tracepoints(struct tracepoint_iter *iter); | 541 | extern int module_get_iter_tracepoints(struct tracepoint_iter *iter); |
| 542 | 542 | ||
| @@ -651,10 +651,6 @@ static inline void print_modules(void) | |||
| 651 | { | 651 | { |
| 652 | } | 652 | } |
| 653 | 653 | ||
| 654 | static inline void module_update_markers(void) | ||
| 655 | { | ||
| 656 | } | ||
| 657 | |||
| 658 | static inline void module_update_tracepoints(void) | 654 | static inline void module_update_tracepoints(void) |
| 659 | { | 655 | { |
| 660 | } | 656 | } |
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h index 6547c3cdbc4c..82a9124f7d75 100644 --- a/include/linux/moduleparam.h +++ b/include/linux/moduleparam.h | |||
| @@ -37,7 +37,6 @@ typedef int (*param_set_fn)(const char *val, struct kernel_param *kp); | |||
| 37 | typedef int (*param_get_fn)(char *buffer, struct kernel_param *kp); | 37 | typedef int (*param_get_fn)(char *buffer, struct kernel_param *kp); |
| 38 | 38 | ||
| 39 | /* Flag bits for kernel_param.flags */ | 39 | /* Flag bits for kernel_param.flags */ |
| 40 | #define KPARAM_KMALLOCED 1 | ||
| 41 | #define KPARAM_ISBOOL 2 | 40 | #define KPARAM_ISBOOL 2 |
| 42 | 41 | ||
| 43 | struct kernel_param { | 42 | struct kernel_param { |
diff --git a/include/linux/mroute.h b/include/linux/mroute.h index 0d45b4e8d367..08bc776d05e2 100644 --- a/include/linux/mroute.h +++ b/include/linux/mroute.h | |||
| @@ -145,14 +145,14 @@ static inline int ip_mroute_opt(int opt) | |||
| 145 | #endif | 145 | #endif |
| 146 | 146 | ||
| 147 | #ifdef CONFIG_IP_MROUTE | 147 | #ifdef CONFIG_IP_MROUTE |
| 148 | extern int ip_mroute_setsockopt(struct sock *, int, char __user *, int); | 148 | extern int ip_mroute_setsockopt(struct sock *, int, char __user *, unsigned int); |
| 149 | extern int ip_mroute_getsockopt(struct sock *, int, char __user *, int __user *); | 149 | extern int ip_mroute_getsockopt(struct sock *, int, char __user *, int __user *); |
| 150 | extern int ipmr_ioctl(struct sock *sk, int cmd, void __user *arg); | 150 | extern int ipmr_ioctl(struct sock *sk, int cmd, void __user *arg); |
| 151 | extern int ip_mr_init(void); | 151 | extern int ip_mr_init(void); |
| 152 | #else | 152 | #else |
| 153 | static inline | 153 | static inline |
| 154 | int ip_mroute_setsockopt(struct sock *sock, | 154 | int ip_mroute_setsockopt(struct sock *sock, |
| 155 | int optname, char __user *optval, int optlen) | 155 | int optname, char __user *optval, unsigned int optlen) |
| 156 | { | 156 | { |
| 157 | return -ENOPROTOOPT; | 157 | return -ENOPROTOOPT; |
| 158 | } | 158 | } |
diff --git a/include/linux/mroute6.h b/include/linux/mroute6.h index 43dc97e32183..b191865a6ca3 100644 --- a/include/linux/mroute6.h +++ b/include/linux/mroute6.h | |||
| @@ -134,7 +134,7 @@ static inline int ip6_mroute_opt(int opt) | |||
| 134 | struct sock; | 134 | struct sock; |
| 135 | 135 | ||
| 136 | #ifdef CONFIG_IPV6_MROUTE | 136 | #ifdef CONFIG_IPV6_MROUTE |
| 137 | extern int ip6_mroute_setsockopt(struct sock *, int, char __user *, int); | 137 | extern int ip6_mroute_setsockopt(struct sock *, int, char __user *, unsigned int); |
| 138 | extern int ip6_mroute_getsockopt(struct sock *, int, char __user *, int __user *); | 138 | extern int ip6_mroute_getsockopt(struct sock *, int, char __user *, int __user *); |
| 139 | extern int ip6_mr_input(struct sk_buff *skb); | 139 | extern int ip6_mr_input(struct sk_buff *skb); |
| 140 | extern int ip6mr_ioctl(struct sock *sk, int cmd, void __user *arg); | 140 | extern int ip6mr_ioctl(struct sock *sk, int cmd, void __user *arg); |
| @@ -143,7 +143,7 @@ extern void ip6_mr_cleanup(void); | |||
| 143 | #else | 143 | #else |
| 144 | static inline | 144 | static inline |
| 145 | int ip6_mroute_setsockopt(struct sock *sock, | 145 | int ip6_mroute_setsockopt(struct sock *sock, |
| 146 | int optname, char __user *optval, int optlen) | 146 | int optname, char __user *optval, unsigned int optlen) |
| 147 | { | 147 | { |
| 148 | return -ENOPROTOOPT; | 148 | return -ENOPROTOOPT; |
| 149 | } | 149 | } |
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index 4030ebada49e..7a232a9bdd62 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h | |||
| @@ -121,6 +121,7 @@ typedef enum { | |||
| 121 | NAND_ECC_SOFT, | 121 | NAND_ECC_SOFT, |
| 122 | NAND_ECC_HW, | 122 | NAND_ECC_HW, |
| 123 | NAND_ECC_HW_SYNDROME, | 123 | NAND_ECC_HW_SYNDROME, |
| 124 | NAND_ECC_HW_OOB_FIRST, | ||
| 124 | } nand_ecc_modes_t; | 125 | } nand_ecc_modes_t; |
| 125 | 126 | ||
| 126 | /* | 127 | /* |
| @@ -271,13 +272,13 @@ struct nand_ecc_ctrl { | |||
| 271 | uint8_t *calc_ecc); | 272 | uint8_t *calc_ecc); |
| 272 | int (*read_page_raw)(struct mtd_info *mtd, | 273 | int (*read_page_raw)(struct mtd_info *mtd, |
| 273 | struct nand_chip *chip, | 274 | struct nand_chip *chip, |
| 274 | uint8_t *buf); | 275 | uint8_t *buf, int page); |
| 275 | void (*write_page_raw)(struct mtd_info *mtd, | 276 | void (*write_page_raw)(struct mtd_info *mtd, |
| 276 | struct nand_chip *chip, | 277 | struct nand_chip *chip, |
| 277 | const uint8_t *buf); | 278 | const uint8_t *buf); |
| 278 | int (*read_page)(struct mtd_info *mtd, | 279 | int (*read_page)(struct mtd_info *mtd, |
| 279 | struct nand_chip *chip, | 280 | struct nand_chip *chip, |
| 280 | uint8_t *buf); | 281 | uint8_t *buf, int page); |
| 281 | int (*read_subpage)(struct mtd_info *mtd, | 282 | int (*read_subpage)(struct mtd_info *mtd, |
| 282 | struct nand_chip *chip, | 283 | struct nand_chip *chip, |
| 283 | uint32_t offs, uint32_t len, | 284 | uint32_t offs, uint32_t len, |
diff --git a/include/linux/mtd/nand_ecc.h b/include/linux/mtd/nand_ecc.h index 090da505425d..052ea8ca2434 100644 --- a/include/linux/mtd/nand_ecc.h +++ b/include/linux/mtd/nand_ecc.h | |||
| @@ -21,6 +21,12 @@ struct mtd_info; | |||
| 21 | int nand_calculate_ecc(struct mtd_info *mtd, const u_char *dat, u_char *ecc_code); | 21 | int nand_calculate_ecc(struct mtd_info *mtd, const u_char *dat, u_char *ecc_code); |
| 22 | 22 | ||
| 23 | /* | 23 | /* |
| 24 | * Detect and correct a 1 bit error for eccsize byte block | ||
| 25 | */ | ||
| 26 | int __nand_correct_data(u_char *dat, u_char *read_ecc, u_char *calc_ecc, | ||
| 27 | unsigned int eccsize); | ||
| 28 | |||
| 29 | /* | ||
| 24 | * Detect and correct a 1 bit error for 256 byte block | 30 | * Detect and correct a 1 bit error for 256 byte block |
| 25 | */ | 31 | */ |
| 26 | int nand_correct_data(struct mtd_info *mtd, u_char *dat, u_char *read_ecc, u_char *calc_ecc); | 32 | int nand_correct_data(struct mtd_info *mtd, u_char *dat, u_char *read_ecc, u_char *calc_ecc); |
diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h index 8ed873374381..4e49f3350678 100644 --- a/include/linux/mtd/onenand.h +++ b/include/linux/mtd/onenand.h | |||
| @@ -214,4 +214,12 @@ unsigned onenand_block(struct onenand_chip *this, loff_t addr); | |||
| 214 | loff_t onenand_addr(struct onenand_chip *this, int block); | 214 | loff_t onenand_addr(struct onenand_chip *this, int block); |
| 215 | int flexonenand_region(struct mtd_info *mtd, loff_t addr); | 215 | int flexonenand_region(struct mtd_info *mtd, loff_t addr); |
| 216 | 216 | ||
| 217 | struct mtd_partition; | ||
| 218 | |||
| 219 | struct onenand_platform_data { | ||
| 220 | void (*mmcontrol)(struct mtd_info *mtd, int sync_read); | ||
| 221 | struct mtd_partition *parts; | ||
| 222 | unsigned int nr_parts; | ||
| 223 | }; | ||
| 224 | |||
| 217 | #endif /* __LINUX_MTD_ONENAND_H */ | 225 | #endif /* __LINUX_MTD_ONENAND_H */ |
diff --git a/include/linux/mtd/onenand_regs.h b/include/linux/mtd/onenand_regs.h index 86a6bbef6465..acadbf53a69f 100644 --- a/include/linux/mtd/onenand_regs.h +++ b/include/linux/mtd/onenand_regs.h | |||
| @@ -207,6 +207,9 @@ | |||
| 207 | #define ONENAND_ECC_2BIT (1 << 1) | 207 | #define ONENAND_ECC_2BIT (1 << 1) |
| 208 | #define ONENAND_ECC_2BIT_ALL (0xAAAA) | 208 | #define ONENAND_ECC_2BIT_ALL (0xAAAA) |
| 209 | #define FLEXONENAND_UNCORRECTABLE_ERROR (0x1010) | 209 | #define FLEXONENAND_UNCORRECTABLE_ERROR (0x1010) |
| 210 | #define ONENAND_ECC_3BIT (1 << 2) | ||
| 211 | #define ONENAND_ECC_4BIT (1 << 3) | ||
| 212 | #define ONENAND_ECC_4BIT_UNCORRECTABLE (0x1010) | ||
| 210 | 213 | ||
| 211 | /* | 214 | /* |
| 212 | * One-Time Programmable (OTP) | 215 | * One-Time Programmable (OTP) |
diff --git a/include/linux/mtd/partitions.h b/include/linux/mtd/partitions.h index b70313d33ff8..274b6196091d 100644 --- a/include/linux/mtd/partitions.h +++ b/include/linux/mtd/partitions.h | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * MTD partitioning layer definitions | 2 | * MTD partitioning layer definitions |
| 3 | * | 3 | * |
| 4 | * (C) 2000 Nicolas Pitre <nico@cam.org> | 4 | * (C) 2000 Nicolas Pitre <nico@fluxnic.net> |
| 5 | * | 5 | * |
| 6 | * This code is GPL | 6 | * This code is GPL |
| 7 | */ | 7 | */ |
diff --git a/include/linux/namei.h b/include/linux/namei.h index d870ae2faedc..ec0f607b364a 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h | |||
| @@ -40,7 +40,7 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND}; | |||
| 40 | * - follow links at the end | 40 | * - follow links at the end |
| 41 | * - require a directory | 41 | * - require a directory |
| 42 | * - ending slashes ok even for nonexistent files | 42 | * - ending slashes ok even for nonexistent files |
| 43 | * - internal "there are more path compnents" flag | 43 | * - internal "there are more path components" flag |
| 44 | * - locked when lookup done with dcache_lock held | 44 | * - locked when lookup done with dcache_lock held |
| 45 | * - dentry cache is untrusted; force a real lookup | 45 | * - dentry cache is untrusted; force a real lookup |
| 46 | */ | 46 | */ |
diff --git a/include/linux/net.h b/include/linux/net.h index 4fc2ffd527f9..d7e26e30c8c2 100644 --- a/include/linux/net.h +++ b/include/linux/net.h | |||
| @@ -57,6 +57,7 @@ typedef enum { | |||
| 57 | #include <linux/random.h> | 57 | #include <linux/random.h> |
| 58 | #include <linux/wait.h> | 58 | #include <linux/wait.h> |
| 59 | #include <linux/fcntl.h> /* For O_CLOEXEC and O_NONBLOCK */ | 59 | #include <linux/fcntl.h> /* For O_CLOEXEC and O_NONBLOCK */ |
| 60 | #include <linux/kmemcheck.h> | ||
| 60 | 61 | ||
| 61 | struct poll_table_struct; | 62 | struct poll_table_struct; |
| 62 | struct pipe_inode_info; | 63 | struct pipe_inode_info; |
| @@ -127,7 +128,11 @@ enum sock_shutdown_cmd { | |||
| 127 | */ | 128 | */ |
| 128 | struct socket { | 129 | struct socket { |
| 129 | socket_state state; | 130 | socket_state state; |
| 131 | |||
| 132 | kmemcheck_bitfield_begin(type); | ||
| 130 | short type; | 133 | short type; |
| 134 | kmemcheck_bitfield_end(type); | ||
| 135 | |||
| 131 | unsigned long flags; | 136 | unsigned long flags; |
| 132 | /* | 137 | /* |
| 133 | * Please keep fasync_list & wait fields in the same cache line | 138 | * Please keep fasync_list & wait fields in the same cache line |
| @@ -173,11 +178,11 @@ struct proto_ops { | |||
| 173 | int (*listen) (struct socket *sock, int len); | 178 | int (*listen) (struct socket *sock, int len); |
| 174 | int (*shutdown) (struct socket *sock, int flags); | 179 | int (*shutdown) (struct socket *sock, int flags); |
| 175 | int (*setsockopt)(struct socket *sock, int level, | 180 | int (*setsockopt)(struct socket *sock, int level, |
| 176 | int optname, char __user *optval, int optlen); | 181 | int optname, char __user *optval, unsigned int optlen); |
| 177 | int (*getsockopt)(struct socket *sock, int level, | 182 | int (*getsockopt)(struct socket *sock, int level, |
| 178 | int optname, char __user *optval, int __user *optlen); | 183 | int optname, char __user *optval, int __user *optlen); |
| 179 | int (*compat_setsockopt)(struct socket *sock, int level, | 184 | int (*compat_setsockopt)(struct socket *sock, int level, |
| 180 | int optname, char __user *optval, int optlen); | 185 | int optname, char __user *optval, unsigned int optlen); |
| 181 | int (*compat_getsockopt)(struct socket *sock, int level, | 186 | int (*compat_getsockopt)(struct socket *sock, int level, |
| 182 | int optname, char __user *optval, int __user *optlen); | 187 | int optname, char __user *optval, int __user *optlen); |
| 183 | int (*sendmsg) (struct kiocb *iocb, struct socket *sock, | 188 | int (*sendmsg) (struct kiocb *iocb, struct socket *sock, |
| @@ -251,7 +256,7 @@ extern int kernel_getpeername(struct socket *sock, struct sockaddr *addr, | |||
| 251 | extern int kernel_getsockopt(struct socket *sock, int level, int optname, | 256 | extern int kernel_getsockopt(struct socket *sock, int level, int optname, |
| 252 | char *optval, int *optlen); | 257 | char *optval, int *optlen); |
| 253 | extern int kernel_setsockopt(struct socket *sock, int level, int optname, | 258 | extern int kernel_setsockopt(struct socket *sock, int level, int optname, |
| 254 | char *optval, int optlen); | 259 | char *optval, unsigned int optlen); |
| 255 | extern int kernel_sendpage(struct socket *sock, struct page *page, int offset, | 260 | extern int kernel_sendpage(struct socket *sock, struct page *page, int offset, |
| 256 | size_t size, int flags); | 261 | size_t size, int flags); |
| 257 | extern int kernel_sock_ioctl(struct socket *sock, int cmd, unsigned long arg); | 262 | extern int kernel_sock_ioctl(struct socket *sock, int cmd, unsigned long arg); |
| @@ -308,7 +313,7 @@ SOCKCALL_WRAP(name, compat_ioctl, (struct socket *sock, unsigned int cmd, \ | |||
| 308 | SOCKCALL_WRAP(name, listen, (struct socket *sock, int len), (sock, len)) \ | 313 | SOCKCALL_WRAP(name, listen, (struct socket *sock, int len), (sock, len)) \ |
| 309 | SOCKCALL_WRAP(name, shutdown, (struct socket *sock, int flags), (sock, flags)) \ | 314 | SOCKCALL_WRAP(name, shutdown, (struct socket *sock, int flags), (sock, flags)) \ |
| 310 | SOCKCALL_WRAP(name, setsockopt, (struct socket *sock, int level, int optname, \ | 315 | SOCKCALL_WRAP(name, setsockopt, (struct socket *sock, int level, int optname, \ |
| 311 | char __user *optval, int optlen), (sock, level, optname, optval, optlen)) \ | 316 | char __user *optval, unsigned int optlen), (sock, level, optname, optval, optlen)) \ |
| 312 | SOCKCALL_WRAP(name, getsockopt, (struct socket *sock, int level, int optname, \ | 317 | SOCKCALL_WRAP(name, getsockopt, (struct socket *sock, int level, int optname, \ |
| 313 | char __user *optval, int __user *optlen), (sock, level, optname, optval, optlen)) \ | 318 | char __user *optval, int __user *optlen), (sock, level, optname, optval, optlen)) \ |
| 314 | SOCKCALL_WRAP(name, sendmsg, (struct kiocb *iocb, struct socket *sock, struct msghdr *m, size_t len), \ | 319 | SOCKCALL_WRAP(name, sendmsg, (struct kiocb *iocb, struct socket *sock, struct msghdr *m, size_t len), \ |
| @@ -353,6 +358,7 @@ static const struct proto_ops name##_ops = { \ | |||
| 353 | 358 | ||
| 354 | #ifdef CONFIG_SYSCTL | 359 | #ifdef CONFIG_SYSCTL |
| 355 | #include <linux/sysctl.h> | 360 | #include <linux/sysctl.h> |
| 361 | #include <linux/ratelimit.h> | ||
| 356 | extern struct ratelimit_state net_ratelimit_state; | 362 | extern struct ratelimit_state net_ratelimit_state; |
| 357 | #endif | 363 | #endif |
| 358 | 364 | ||
diff --git a/include/linux/net_dropmon.h b/include/linux/net_dropmon.h index 3ceb0cc1bc78..2a739462caeb 100644 --- a/include/linux/net_dropmon.h +++ b/include/linux/net_dropmon.h | |||
| @@ -3,7 +3,6 @@ | |||
| 3 | 3 | ||
| 4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 5 | #include <linux/netlink.h> | 5 | #include <linux/netlink.h> |
| 6 | #include <linux/types.h> | ||
| 7 | 6 | ||
| 8 | struct net_dm_drop_point { | 7 | struct net_dm_drop_point { |
| 9 | __u8 pc[8]; | 8 | __u8 pc[8]; |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index d4a4d9867794..812a5f3c2abe 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
| @@ -72,10 +72,6 @@ struct wireless_dev; | |||
| 72 | /* Backlog congestion levels */ | 72 | /* Backlog congestion levels */ |
| 73 | #define NET_RX_SUCCESS 0 /* keep 'em coming, baby */ | 73 | #define NET_RX_SUCCESS 0 /* keep 'em coming, baby */ |
| 74 | #define NET_RX_DROP 1 /* packet dropped */ | 74 | #define NET_RX_DROP 1 /* packet dropped */ |
| 75 | #define NET_RX_CN_LOW 2 /* storm alert, just in case */ | ||
| 76 | #define NET_RX_CN_MOD 3 /* Storm on its way! */ | ||
| 77 | #define NET_RX_CN_HIGH 4 /* The storm is here */ | ||
| 78 | #define NET_RX_BAD 5 /* packet dropped due to kernel error */ | ||
| 79 | 75 | ||
| 80 | /* NET_XMIT_CN is special. It does not guarantee that this packet is lost. It | 76 | /* NET_XMIT_CN is special. It does not guarantee that this packet is lost. It |
| 81 | * indicates that the device will soon be dropping packets, or already drops | 77 | * indicates that the device will soon be dropping packets, or already drops |
| @@ -83,17 +79,19 @@ struct wireless_dev; | |||
| 83 | #define net_xmit_eval(e) ((e) == NET_XMIT_CN? 0 : (e)) | 79 | #define net_xmit_eval(e) ((e) == NET_XMIT_CN? 0 : (e)) |
| 84 | #define net_xmit_errno(e) ((e) != NET_XMIT_CN ? -ENOBUFS : 0) | 80 | #define net_xmit_errno(e) ((e) != NET_XMIT_CN ? -ENOBUFS : 0) |
| 85 | 81 | ||
| 82 | /* Driver transmit return codes */ | ||
| 83 | enum netdev_tx { | ||
| 84 | NETDEV_TX_OK = 0, /* driver took care of packet */ | ||
| 85 | NETDEV_TX_BUSY, /* driver tx path was busy*/ | ||
| 86 | NETDEV_TX_LOCKED = -1, /* driver tx lock was already taken */ | ||
| 87 | }; | ||
| 88 | typedef enum netdev_tx netdev_tx_t; | ||
| 89 | |||
| 86 | #endif | 90 | #endif |
| 87 | 91 | ||
| 88 | #define MAX_ADDR_LEN 32 /* Largest hardware address length */ | 92 | #define MAX_ADDR_LEN 32 /* Largest hardware address length */ |
| 89 | 93 | ||
| 90 | /* Driver transmit return codes */ | ||
| 91 | #define NETDEV_TX_OK 0 /* driver took care of packet */ | ||
| 92 | #define NETDEV_TX_BUSY 1 /* driver tx path was busy*/ | ||
| 93 | #define NETDEV_TX_LOCKED -1 /* driver tx lock was already taken */ | ||
| 94 | |||
| 95 | #ifdef __KERNEL__ | 94 | #ifdef __KERNEL__ |
| 96 | |||
| 97 | /* | 95 | /* |
| 98 | * Compute the worst case header length according to the protocols | 96 | * Compute the worst case header length according to the protocols |
| 99 | * used. | 97 | * used. |
| @@ -511,9 +509,11 @@ struct netdev_queue { | |||
| 511 | * This function is called when network device transistions to the down | 509 | * This function is called when network device transistions to the down |
| 512 | * state. | 510 | * state. |
| 513 | * | 511 | * |
| 514 | * int (*ndo_start_xmit)(struct sk_buff *skb, struct net_device *dev); | 512 | * netdev_tx_t (*ndo_start_xmit)(struct sk_buff *skb, |
| 513 | * struct net_device *dev); | ||
| 515 | * Called when a packet needs to be transmitted. | 514 | * Called when a packet needs to be transmitted. |
| 516 | * Must return NETDEV_TX_OK , NETDEV_TX_BUSY, or NETDEV_TX_LOCKED, | 515 | * Must return NETDEV_TX_OK , NETDEV_TX_BUSY. |
| 516 | * (can also return NETDEV_TX_LOCKED iff NETIF_F_LLTX) | ||
| 517 | * Required can not be NULL. | 517 | * Required can not be NULL. |
| 518 | * | 518 | * |
| 519 | * u16 (*ndo_select_queue)(struct net_device *dev, struct sk_buff *skb); | 519 | * u16 (*ndo_select_queue)(struct net_device *dev, struct sk_buff *skb); |
| @@ -557,7 +557,7 @@ struct netdev_queue { | |||
| 557 | * Callback uses when the transmitter has not made any progress | 557 | * Callback uses when the transmitter has not made any progress |
| 558 | * for dev->watchdog ticks. | 558 | * for dev->watchdog ticks. |
| 559 | * | 559 | * |
| 560 | * struct net_device_stats* (*get_stats)(struct net_device *dev); | 560 | * struct net_device_stats* (*ndo_get_stats)(struct net_device *dev); |
| 561 | * Called when a user wants to get the network device usage | 561 | * Called when a user wants to get the network device usage |
| 562 | * statistics. If not defined, the counters in dev->stats will | 562 | * statistics. If not defined, the counters in dev->stats will |
| 563 | * be used. | 563 | * be used. |
| @@ -584,7 +584,7 @@ struct net_device_ops { | |||
| 584 | void (*ndo_uninit)(struct net_device *dev); | 584 | void (*ndo_uninit)(struct net_device *dev); |
| 585 | int (*ndo_open)(struct net_device *dev); | 585 | int (*ndo_open)(struct net_device *dev); |
| 586 | int (*ndo_stop)(struct net_device *dev); | 586 | int (*ndo_stop)(struct net_device *dev); |
| 587 | int (*ndo_start_xmit) (struct sk_buff *skb, | 587 | netdev_tx_t (*ndo_start_xmit) (struct sk_buff *skb, |
| 588 | struct net_device *dev); | 588 | struct net_device *dev); |
| 589 | u16 (*ndo_select_queue)(struct net_device *dev, | 589 | u16 (*ndo_select_queue)(struct net_device *dev, |
| 590 | struct sk_buff *skb); | 590 | struct sk_buff *skb); |
| @@ -627,6 +627,8 @@ struct net_device_ops { | |||
| 627 | void (*ndo_poll_controller)(struct net_device *dev); | 627 | void (*ndo_poll_controller)(struct net_device *dev); |
| 628 | #endif | 628 | #endif |
| 629 | #if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE) | 629 | #if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE) |
| 630 | int (*ndo_fcoe_enable)(struct net_device *dev); | ||
| 631 | int (*ndo_fcoe_disable)(struct net_device *dev); | ||
| 630 | int (*ndo_fcoe_ddp_setup)(struct net_device *dev, | 632 | int (*ndo_fcoe_ddp_setup)(struct net_device *dev, |
| 631 | u16 xid, | 633 | u16 xid, |
| 632 | struct scatterlist *sgl, | 634 | struct scatterlist *sgl, |
| @@ -705,6 +707,7 @@ struct net_device | |||
| 705 | /* the GSO_MASK reserves bits 16 through 23 */ | 707 | /* the GSO_MASK reserves bits 16 through 23 */ |
| 706 | #define NETIF_F_FCOE_CRC (1 << 24) /* FCoE CRC32 */ | 708 | #define NETIF_F_FCOE_CRC (1 << 24) /* FCoE CRC32 */ |
| 707 | #define NETIF_F_SCTP_CSUM (1 << 25) /* SCTP checksum offload */ | 709 | #define NETIF_F_SCTP_CSUM (1 << 25) /* SCTP checksum offload */ |
| 710 | #define NETIF_F_FCOE_MTU (1 << 26) /* Supports max FCoE MTU, 2158 bytes*/ | ||
| 708 | 711 | ||
| 709 | /* Segmentation offload features */ | 712 | /* Segmentation offload features */ |
| 710 | #define NETIF_F_GSO_SHIFT 16 | 713 | #define NETIF_F_GSO_SHIFT 16 |
| @@ -829,6 +832,9 @@ struct net_device | |||
| 829 | /* Number of TX queues currently active in device */ | 832 | /* Number of TX queues currently active in device */ |
| 830 | unsigned int real_num_tx_queues; | 833 | unsigned int real_num_tx_queues; |
| 831 | 834 | ||
| 835 | /* root qdisc from userspace point of view */ | ||
| 836 | struct Qdisc *qdisc; | ||
| 837 | |||
| 832 | unsigned long tx_queue_len; /* Max frames per queue allowed */ | 838 | unsigned long tx_queue_len; /* Max frames per queue allowed */ |
| 833 | spinlock_t tx_global_lock; | 839 | spinlock_t tx_global_lock; |
| 834 | /* | 840 | /* |
| @@ -889,7 +895,7 @@ struct net_device | |||
| 889 | /* class/net/name entry */ | 895 | /* class/net/name entry */ |
| 890 | struct device dev; | 896 | struct device dev; |
| 891 | /* space for optional statistics and wireless sysfs groups */ | 897 | /* space for optional statistics and wireless sysfs groups */ |
| 892 | struct attribute_group *sysfs_groups[3]; | 898 | const struct attribute_group *sysfs_groups[3]; |
| 893 | 899 | ||
| 894 | /* rtnetlink link ops */ | 900 | /* rtnetlink link ops */ |
| 895 | const struct rtnl_link_ops *rtnl_link_ops; | 901 | const struct rtnl_link_ops *rtnl_link_ops; |
| @@ -992,6 +998,12 @@ static inline void *netdev_priv(const struct net_device *dev) | |||
| 992 | */ | 998 | */ |
| 993 | #define SET_NETDEV_DEV(net, pdev) ((net)->dev.parent = (pdev)) | 999 | #define SET_NETDEV_DEV(net, pdev) ((net)->dev.parent = (pdev)) |
| 994 | 1000 | ||
| 1001 | /* Set the sysfs device type for the network logical device to allow | ||
| 1002 | * fin grained indentification of different network device types. For | ||
| 1003 | * example Ethernet, Wirelss LAN, Bluetooth, WiMAX etc. | ||
| 1004 | */ | ||
| 1005 | #define SET_NETDEV_DEVTYPE(net, devtype) ((net)->dev.type = (devtype)) | ||
| 1006 | |||
| 995 | /** | 1007 | /** |
| 996 | * netif_napi_add - initialize a napi context | 1008 | * netif_napi_add - initialize a napi context |
| 997 | * @dev: network device | 1009 | * @dev: network device |
| @@ -1260,7 +1272,7 @@ static inline void netif_tx_wake_queue(struct netdev_queue *dev_queue) | |||
| 1260 | { | 1272 | { |
| 1261 | #ifdef CONFIG_NETPOLL_TRAP | 1273 | #ifdef CONFIG_NETPOLL_TRAP |
| 1262 | if (netpoll_trap()) { | 1274 | if (netpoll_trap()) { |
| 1263 | clear_bit(__QUEUE_STATE_XOFF, &dev_queue->state); | 1275 | netif_tx_start_queue(dev_queue); |
| 1264 | return; | 1276 | return; |
| 1265 | } | 1277 | } |
| 1266 | #endif | 1278 | #endif |
| @@ -1366,7 +1378,8 @@ static inline int netif_running(const struct net_device *dev) | |||
| 1366 | static inline void netif_start_subqueue(struct net_device *dev, u16 queue_index) | 1378 | static inline void netif_start_subqueue(struct net_device *dev, u16 queue_index) |
| 1367 | { | 1379 | { |
| 1368 | struct netdev_queue *txq = netdev_get_tx_queue(dev, queue_index); | 1380 | struct netdev_queue *txq = netdev_get_tx_queue(dev, queue_index); |
| 1369 | clear_bit(__QUEUE_STATE_XOFF, &txq->state); | 1381 | |
| 1382 | netif_tx_start_queue(txq); | ||
| 1370 | } | 1383 | } |
| 1371 | 1384 | ||
| 1372 | /** | 1385 | /** |
| @@ -1383,7 +1396,7 @@ static inline void netif_stop_subqueue(struct net_device *dev, u16 queue_index) | |||
| 1383 | if (netpoll_trap()) | 1396 | if (netpoll_trap()) |
| 1384 | return; | 1397 | return; |
| 1385 | #endif | 1398 | #endif |
| 1386 | set_bit(__QUEUE_STATE_XOFF, &txq->state); | 1399 | netif_tx_stop_queue(txq); |
| 1387 | } | 1400 | } |
| 1388 | 1401 | ||
| 1389 | /** | 1402 | /** |
| @@ -1397,7 +1410,8 @@ static inline int __netif_subqueue_stopped(const struct net_device *dev, | |||
| 1397 | u16 queue_index) | 1410 | u16 queue_index) |
| 1398 | { | 1411 | { |
| 1399 | struct netdev_queue *txq = netdev_get_tx_queue(dev, queue_index); | 1412 | struct netdev_queue *txq = netdev_get_tx_queue(dev, queue_index); |
| 1400 | return test_bit(__QUEUE_STATE_XOFF, &txq->state); | 1413 | |
| 1414 | return netif_tx_queue_stopped(txq); | ||
| 1401 | } | 1415 | } |
| 1402 | 1416 | ||
| 1403 | static inline int netif_subqueue_stopped(const struct net_device *dev, | 1417 | static inline int netif_subqueue_stopped(const struct net_device *dev, |
| @@ -1749,8 +1763,7 @@ static inline void netif_tx_unlock(struct net_device *dev) | |||
| 1749 | * force a schedule. | 1763 | * force a schedule. |
| 1750 | */ | 1764 | */ |
| 1751 | clear_bit(__QUEUE_STATE_FROZEN, &txq->state); | 1765 | clear_bit(__QUEUE_STATE_FROZEN, &txq->state); |
| 1752 | if (!test_bit(__QUEUE_STATE_XOFF, &txq->state)) | 1766 | netif_schedule_queue(txq); |
| 1753 | __netif_schedule(txq->qdisc); | ||
| 1754 | } | 1767 | } |
| 1755 | spin_unlock(&dev->tx_global_lock); | 1768 | spin_unlock(&dev->tx_global_lock); |
| 1756 | } | 1769 | } |
| @@ -1860,7 +1873,8 @@ extern void __dev_addr_unsync(struct dev_addr_list **to, int *to_count, struct | |||
| 1860 | extern int dev_set_promiscuity(struct net_device *dev, int inc); | 1873 | extern int dev_set_promiscuity(struct net_device *dev, int inc); |
| 1861 | extern int dev_set_allmulti(struct net_device *dev, int inc); | 1874 | extern int dev_set_allmulti(struct net_device *dev, int inc); |
| 1862 | extern void netdev_state_change(struct net_device *dev); | 1875 | extern void netdev_state_change(struct net_device *dev); |
| 1863 | extern void netdev_bonding_change(struct net_device *dev); | 1876 | extern void netdev_bonding_change(struct net_device *dev, |
| 1877 | unsigned long event); | ||
| 1864 | extern void netdev_features_change(struct net_device *dev); | 1878 | extern void netdev_features_change(struct net_device *dev); |
| 1865 | /* Load a device via the kmod */ | 1879 | /* Load a device via the kmod */ |
| 1866 | extern void dev_load(struct net *net, const char *name); | 1880 | extern void dev_load(struct net *net, const char *name); |
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h index 48cfe51bfddc..6132b5e6d9d3 100644 --- a/include/linux/netfilter.h +++ b/include/linux/netfilter.h | |||
| @@ -221,12 +221,12 @@ __ret;}) | |||
| 221 | 221 | ||
| 222 | /* Call setsockopt() */ | 222 | /* Call setsockopt() */ |
| 223 | int nf_setsockopt(struct sock *sk, u_int8_t pf, int optval, char __user *opt, | 223 | int nf_setsockopt(struct sock *sk, u_int8_t pf, int optval, char __user *opt, |
| 224 | int len); | 224 | unsigned int len); |
| 225 | int nf_getsockopt(struct sock *sk, u_int8_t pf, int optval, char __user *opt, | 225 | int nf_getsockopt(struct sock *sk, u_int8_t pf, int optval, char __user *opt, |
| 226 | int *len); | 226 | int *len); |
| 227 | 227 | ||
| 228 | int compat_nf_setsockopt(struct sock *sk, u_int8_t pf, int optval, | 228 | int compat_nf_setsockopt(struct sock *sk, u_int8_t pf, int optval, |
| 229 | char __user *opt, int len); | 229 | char __user *opt, unsigned int len); |
| 230 | int compat_nf_getsockopt(struct sock *sk, u_int8_t pf, int optval, | 230 | int compat_nf_getsockopt(struct sock *sk, u_int8_t pf, int optval, |
| 231 | char __user *opt, int *len); | 231 | char __user *opt, int *len); |
| 232 | 232 | ||
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h index bff4d5741d98..9f00da287f2c 100644 --- a/include/linux/netfilter/nfnetlink.h +++ b/include/linux/netfilter/nfnetlink.h | |||
| @@ -58,7 +58,8 @@ struct nfgenmsg { | |||
| 58 | struct nfnl_callback | 58 | struct nfnl_callback |
| 59 | { | 59 | { |
| 60 | int (*call)(struct sock *nl, struct sk_buff *skb, | 60 | int (*call)(struct sock *nl, struct sk_buff *skb, |
| 61 | struct nlmsghdr *nlh, struct nlattr *cda[]); | 61 | const struct nlmsghdr *nlh, |
| 62 | const struct nlattr * const cda[]); | ||
| 62 | const struct nla_policy *policy; /* netlink attribute policy */ | 63 | const struct nla_policy *policy; /* netlink attribute policy */ |
| 63 | const u_int16_t attr_count; /* number of nlattr's */ | 64 | const u_int16_t attr_count; /* number of nlattr's */ |
| 64 | }; | 65 | }; |
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h index 1030b7593898..812cb153cabb 100644 --- a/include/linux/netfilter/x_tables.h +++ b/include/linux/netfilter/x_tables.h | |||
| @@ -238,9 +238,9 @@ struct xt_mtdtor_param { | |||
| 238 | */ | 238 | */ |
| 239 | struct xt_target_param { | 239 | struct xt_target_param { |
| 240 | const struct net_device *in, *out; | 240 | const struct net_device *in, *out; |
| 241 | unsigned int hooknum; | ||
| 242 | const struct xt_target *target; | 241 | const struct xt_target *target; |
| 243 | const void *targinfo; | 242 | const void *targinfo; |
| 243 | unsigned int hooknum; | ||
| 244 | u_int8_t family; | 244 | u_int8_t family; |
| 245 | }; | 245 | }; |
| 246 | 246 | ||
| @@ -407,7 +407,7 @@ extern int xt_check_target(struct xt_tgchk_param *, | |||
| 407 | unsigned int size, u_int8_t proto, bool inv_proto); | 407 | unsigned int size, u_int8_t proto, bool inv_proto); |
| 408 | 408 | ||
| 409 | extern struct xt_table *xt_register_table(struct net *net, | 409 | extern struct xt_table *xt_register_table(struct net *net, |
| 410 | struct xt_table *table, | 410 | const struct xt_table *table, |
| 411 | struct xt_table_info *bootstrap, | 411 | struct xt_table_info *bootstrap, |
| 412 | struct xt_table_info *newinfo); | 412 | struct xt_table_info *newinfo); |
| 413 | extern void *xt_unregister_table(struct xt_table *table); | 413 | extern void *xt_unregister_table(struct xt_table *table); |
diff --git a/include/linux/netfilter/xt_CONNMARK.h b/include/linux/netfilter/xt_CONNMARK.h index 7635c8ffdadb..0a8545866752 100644 --- a/include/linux/netfilter/xt_CONNMARK.h +++ b/include/linux/netfilter/xt_CONNMARK.h | |||
| @@ -18,12 +18,6 @@ enum { | |||
| 18 | XT_CONNMARK_RESTORE | 18 | XT_CONNMARK_RESTORE |
| 19 | }; | 19 | }; |
| 20 | 20 | ||
| 21 | struct xt_connmark_target_info { | ||
| 22 | unsigned long mark; | ||
| 23 | unsigned long mask; | ||
| 24 | __u8 mode; | ||
| 25 | }; | ||
| 26 | |||
| 27 | struct xt_connmark_tginfo1 { | 21 | struct xt_connmark_tginfo1 { |
| 28 | __u32 ctmark, ctmask, nfmask; | 22 | __u32 ctmark, ctmask, nfmask; |
| 29 | __u8 mode; | 23 | __u8 mode; |
diff --git a/include/linux/netfilter/xt_MARK.h b/include/linux/netfilter/xt_MARK.h index 028304bcc0b1..bc9561bdef79 100644 --- a/include/linux/netfilter/xt_MARK.h +++ b/include/linux/netfilter/xt_MARK.h | |||
| @@ -3,23 +3,6 @@ | |||
| 3 | 3 | ||
| 4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 5 | 5 | ||
| 6 | /* Version 0 */ | ||
| 7 | struct xt_mark_target_info { | ||
| 8 | unsigned long mark; | ||
| 9 | }; | ||
| 10 | |||
| 11 | /* Version 1 */ | ||
| 12 | enum { | ||
| 13 | XT_MARK_SET=0, | ||
| 14 | XT_MARK_AND, | ||
| 15 | XT_MARK_OR, | ||
| 16 | }; | ||
| 17 | |||
| 18 | struct xt_mark_target_info_v1 { | ||
| 19 | unsigned long mark; | ||
| 20 | __u8 mode; | ||
| 21 | }; | ||
| 22 | |||
| 23 | struct xt_mark_tginfo2 { | 6 | struct xt_mark_tginfo2 { |
| 24 | __u32 mark, mask; | 7 | __u32 mark, mask; |
| 25 | }; | 8 | }; |
diff --git a/include/linux/netfilter/xt_connmark.h b/include/linux/netfilter/xt_connmark.h index 571e266d004c..619e47cde01a 100644 --- a/include/linux/netfilter/xt_connmark.h +++ b/include/linux/netfilter/xt_connmark.h | |||
| @@ -12,11 +12,6 @@ | |||
| 12 | * (at your option) any later version. | 12 | * (at your option) any later version. |
| 13 | */ | 13 | */ |
| 14 | 14 | ||
| 15 | struct xt_connmark_info { | ||
| 16 | unsigned long mark, mask; | ||
| 17 | __u8 invert; | ||
| 18 | }; | ||
| 19 | |||
| 20 | struct xt_connmark_mtinfo1 { | 15 | struct xt_connmark_mtinfo1 { |
| 21 | __u32 mark, mask; | 16 | __u32 mark, mask; |
| 22 | __u8 invert; | 17 | __u8 invert; |
diff --git a/include/linux/netfilter/xt_conntrack.h b/include/linux/netfilter/xt_conntrack.h index 7ae05338e94c..54f47a2f6152 100644 --- a/include/linux/netfilter/xt_conntrack.h +++ b/include/linux/netfilter/xt_conntrack.h | |||
| @@ -32,42 +32,6 @@ enum { | |||
| 32 | XT_CONNTRACK_DIRECTION = 1 << 12, | 32 | XT_CONNTRACK_DIRECTION = 1 << 12, |
| 33 | }; | 33 | }; |
| 34 | 34 | ||
| 35 | /* This is exposed to userspace, so remains frozen in time. */ | ||
| 36 | struct ip_conntrack_old_tuple | ||
| 37 | { | ||
| 38 | struct { | ||
| 39 | __be32 ip; | ||
| 40 | union { | ||
| 41 | __u16 all; | ||
| 42 | } u; | ||
| 43 | } src; | ||
| 44 | |||
| 45 | struct { | ||
| 46 | __be32 ip; | ||
| 47 | union { | ||
| 48 | __u16 all; | ||
| 49 | } u; | ||
| 50 | |||
| 51 | /* The protocol. */ | ||
| 52 | __u16 protonum; | ||
| 53 | } dst; | ||
| 54 | }; | ||
| 55 | |||
| 56 | struct xt_conntrack_info | ||
| 57 | { | ||
| 58 | unsigned int statemask, statusmask; | ||
| 59 | |||
| 60 | struct ip_conntrack_old_tuple tuple[IP_CT_DIR_MAX]; | ||
| 61 | struct in_addr sipmsk[IP_CT_DIR_MAX], dipmsk[IP_CT_DIR_MAX]; | ||
| 62 | |||
| 63 | unsigned long expires_min, expires_max; | ||
| 64 | |||
| 65 | /* Flags word */ | ||
| 66 | __u8 flags; | ||
| 67 | /* Inverse flags */ | ||
| 68 | __u8 invflags; | ||
| 69 | }; | ||
| 70 | |||
| 71 | struct xt_conntrack_mtinfo1 { | 35 | struct xt_conntrack_mtinfo1 { |
| 72 | union nf_inet_addr origsrc_addr, origsrc_mask; | 36 | union nf_inet_addr origsrc_addr, origsrc_mask; |
| 73 | union nf_inet_addr origdst_addr, origdst_mask; | 37 | union nf_inet_addr origdst_addr, origdst_mask; |
diff --git a/include/linux/netfilter/xt_mark.h b/include/linux/netfilter/xt_mark.h index 6fa460a3cc29..6607c8f38ea5 100644 --- a/include/linux/netfilter/xt_mark.h +++ b/include/linux/netfilter/xt_mark.h | |||
| @@ -3,11 +3,6 @@ | |||
| 3 | 3 | ||
| 4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 5 | 5 | ||
| 6 | struct xt_mark_info { | ||
| 7 | unsigned long mark, mask; | ||
| 8 | __u8 invert; | ||
| 9 | }; | ||
| 10 | |||
| 11 | struct xt_mark_mtinfo1 { | 6 | struct xt_mark_mtinfo1 { |
| 12 | __u32 mark, mask; | 7 | __u32 mark, mask; |
| 13 | __u8 invert; | 8 | __u8 invert; |
diff --git a/include/linux/netfilter_arp/arp_tables.h b/include/linux/netfilter_arp/arp_tables.h index 590ac3d6d5d6..6fe3e6aa10db 100644 --- a/include/linux/netfilter_arp/arp_tables.h +++ b/include/linux/netfilter_arp/arp_tables.h | |||
| @@ -265,7 +265,7 @@ struct arpt_error | |||
| 265 | } | 265 | } |
| 266 | 266 | ||
| 267 | extern struct xt_table *arpt_register_table(struct net *net, | 267 | extern struct xt_table *arpt_register_table(struct net *net, |
| 268 | struct xt_table *table, | 268 | const struct xt_table *table, |
| 269 | const struct arpt_replace *repl); | 269 | const struct arpt_replace *repl); |
| 270 | extern void arpt_unregister_table(struct xt_table *table); | 270 | extern void arpt_unregister_table(struct xt_table *table); |
| 271 | extern unsigned int arpt_do_table(struct sk_buff *skb, | 271 | extern unsigned int arpt_do_table(struct sk_buff *skb, |
diff --git a/include/linux/netfilter_bridge/ebtables.h b/include/linux/netfilter_bridge/ebtables.h index e40ddb94b1af..ea281e6a2048 100644 --- a/include/linux/netfilter_bridge/ebtables.h +++ b/include/linux/netfilter_bridge/ebtables.h | |||
| @@ -301,7 +301,7 @@ struct ebt_table | |||
| 301 | #define EBT_ALIGN(s) (((s) + (__alignof__(struct ebt_replace)-1)) & \ | 301 | #define EBT_ALIGN(s) (((s) + (__alignof__(struct ebt_replace)-1)) & \ |
| 302 | ~(__alignof__(struct ebt_replace)-1)) | 302 | ~(__alignof__(struct ebt_replace)-1)) |
| 303 | extern struct ebt_table *ebt_register_table(struct net *net, | 303 | extern struct ebt_table *ebt_register_table(struct net *net, |
| 304 | struct ebt_table *table); | 304 | const struct ebt_table *table); |
| 305 | extern void ebt_unregister_table(struct ebt_table *table); | 305 | extern void ebt_unregister_table(struct ebt_table *table); |
| 306 | extern unsigned int ebt_do_table(unsigned int hook, struct sk_buff *skb, | 306 | extern unsigned int ebt_do_table(unsigned int hook, struct sk_buff *skb, |
| 307 | const struct net_device *in, const struct net_device *out, | 307 | const struct net_device *in, const struct net_device *out, |
diff --git a/include/linux/netfilter_ipv4/Kbuild b/include/linux/netfilter_ipv4/Kbuild index 3a7105bb8f33..431b40761920 100644 --- a/include/linux/netfilter_ipv4/Kbuild +++ b/include/linux/netfilter_ipv4/Kbuild | |||
| @@ -1,46 +1,14 @@ | |||
| 1 | header-y += ipt_CLASSIFY.h | ||
| 2 | header-y += ipt_CLUSTERIP.h | 1 | header-y += ipt_CLUSTERIP.h |
| 3 | header-y += ipt_CONNMARK.h | ||
| 4 | header-y += ipt_DSCP.h | ||
| 5 | header-y += ipt_ECN.h | 2 | header-y += ipt_ECN.h |
| 6 | header-y += ipt_LOG.h | 3 | header-y += ipt_LOG.h |
| 7 | header-y += ipt_MARK.h | ||
| 8 | header-y += ipt_NFQUEUE.h | ||
| 9 | header-y += ipt_REJECT.h | 4 | header-y += ipt_REJECT.h |
| 10 | header-y += ipt_SAME.h | 5 | header-y += ipt_SAME.h |
| 11 | header-y += ipt_TCPMSS.h | ||
| 12 | header-y += ipt_TOS.h | ||
| 13 | header-y += ipt_TTL.h | 6 | header-y += ipt_TTL.h |
| 14 | header-y += ipt_ULOG.h | 7 | header-y += ipt_ULOG.h |
| 15 | header-y += ipt_addrtype.h | 8 | header-y += ipt_addrtype.h |
| 16 | header-y += ipt_ah.h | 9 | header-y += ipt_ah.h |
| 17 | header-y += ipt_comment.h | ||
| 18 | header-y += ipt_connbytes.h | ||
| 19 | header-y += ipt_connmark.h | ||
| 20 | header-y += ipt_conntrack.h | ||
| 21 | header-y += ipt_dccp.h | ||
| 22 | header-y += ipt_dscp.h | ||
| 23 | header-y += ipt_ecn.h | 10 | header-y += ipt_ecn.h |
| 24 | header-y += ipt_esp.h | ||
| 25 | header-y += ipt_hashlimit.h | ||
| 26 | header-y += ipt_helper.h | ||
| 27 | header-y += ipt_iprange.h | ||
| 28 | header-y += ipt_length.h | ||
| 29 | header-y += ipt_limit.h | ||
| 30 | header-y += ipt_mac.h | ||
| 31 | header-y += ipt_mark.h | ||
| 32 | header-y += ipt_multiport.h | ||
| 33 | header-y += ipt_owner.h | ||
| 34 | header-y += ipt_physdev.h | ||
| 35 | header-y += ipt_pkttype.h | ||
| 36 | header-y += ipt_policy.h | ||
| 37 | header-y += ipt_realm.h | 11 | header-y += ipt_realm.h |
| 38 | header-y += ipt_recent.h | ||
| 39 | header-y += ipt_sctp.h | ||
| 40 | header-y += ipt_state.h | ||
| 41 | header-y += ipt_string.h | ||
| 42 | header-y += ipt_tcpmss.h | ||
| 43 | header-y += ipt_tos.h | ||
| 44 | header-y += ipt_ttl.h | 12 | header-y += ipt_ttl.h |
| 45 | 13 | ||
| 46 | unifdef-y += ip_queue.h | 14 | unifdef-y += ip_queue.h |
diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h index 092bd50581a9..61fafc868a7b 100644 --- a/include/linux/netfilter_ipv4/ip_tables.h +++ b/include/linux/netfilter_ipv4/ip_tables.h | |||
| @@ -245,7 +245,7 @@ ipt_get_target(struct ipt_entry *e) | |||
| 245 | extern void ipt_init(void) __init; | 245 | extern void ipt_init(void) __init; |
| 246 | 246 | ||
| 247 | extern struct xt_table *ipt_register_table(struct net *net, | 247 | extern struct xt_table *ipt_register_table(struct net *net, |
| 248 | struct xt_table *table, | 248 | const struct xt_table *table, |
| 249 | const struct ipt_replace *repl); | 249 | const struct ipt_replace *repl); |
| 250 | extern void ipt_unregister_table(struct xt_table *table); | 250 | extern void ipt_unregister_table(struct xt_table *table); |
| 251 | 251 | ||
diff --git a/include/linux/netfilter_ipv4/ipt_CLASSIFY.h b/include/linux/netfilter_ipv4/ipt_CLASSIFY.h deleted file mode 100644 index a46d511b5c36..000000000000 --- a/include/linux/netfilter_ipv4/ipt_CLASSIFY.h +++ /dev/null | |||
| @@ -1,7 +0,0 @@ | |||
| 1 | #ifndef _IPT_CLASSIFY_H | ||
| 2 | #define _IPT_CLASSIFY_H | ||
| 3 | |||
| 4 | #include <linux/netfilter/xt_CLASSIFY.h> | ||
| 5 | #define ipt_classify_target_info xt_classify_target_info | ||
| 6 | |||
| 7 | #endif /*_IPT_CLASSIFY_H */ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_CONNMARK.h b/include/linux/netfilter_ipv4/ipt_CONNMARK.h deleted file mode 100644 index 9ecfee0a9e33..000000000000 --- a/include/linux/netfilter_ipv4/ipt_CONNMARK.h +++ /dev/null | |||
| @@ -1,19 +0,0 @@ | |||
| 1 | #ifndef _IPT_CONNMARK_H_target | ||
| 2 | #define _IPT_CONNMARK_H_target | ||
| 3 | |||
| 4 | /* Copyright (C) 2002,2004 MARA Systems AB <http://www.marasystems.com> | ||
| 5 | * by Henrik Nordstrom <hno@marasystems.com> | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License as published by | ||
| 9 | * the Free Software Foundation; either version 2 of the License, or | ||
| 10 | * (at your option) any later version. | ||
| 11 | */ | ||
| 12 | #include <linux/netfilter/xt_CONNMARK.h> | ||
| 13 | #define IPT_CONNMARK_SET XT_CONNMARK_SET | ||
| 14 | #define IPT_CONNMARK_SAVE XT_CONNMARK_SAVE | ||
| 15 | #define IPT_CONNMARK_RESTORE XT_CONNMARK_RESTORE | ||
| 16 | |||
| 17 | #define ipt_connmark_target_info xt_connmark_target_info | ||
| 18 | |||
| 19 | #endif /*_IPT_CONNMARK_H_target*/ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_DSCP.h b/include/linux/netfilter_ipv4/ipt_DSCP.h deleted file mode 100644 index 3491e524d5ea..000000000000 --- a/include/linux/netfilter_ipv4/ipt_DSCP.h +++ /dev/null | |||
| @@ -1,18 +0,0 @@ | |||
| 1 | /* iptables module for setting the IPv4 DSCP field | ||
| 2 | * | ||
| 3 | * (C) 2002 Harald Welte <laforge@gnumonks.org> | ||
| 4 | * based on ipt_FTOS.c (C) 2000 by Matthew G. Marsh <mgm@paktronix.com> | ||
| 5 | * This software is distributed under GNU GPL v2, 1991 | ||
| 6 | * | ||
| 7 | * See RFC2474 for a description of the DSCP field within the IP Header. | ||
| 8 | * | ||
| 9 | * ipt_DSCP.h,v 1.7 2002/03/14 12:03:13 laforge Exp | ||
| 10 | */ | ||
| 11 | #ifndef _IPT_DSCP_TARGET_H | ||
| 12 | #define _IPT_DSCP_TARGET_H | ||
| 13 | #include <linux/netfilter_ipv4/ipt_dscp.h> | ||
| 14 | #include <linux/netfilter/xt_DSCP.h> | ||
| 15 | |||
| 16 | #define ipt_DSCP_info xt_DSCP_info | ||
| 17 | |||
| 18 | #endif /* _IPT_DSCP_TARGET_H */ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_ECN.h b/include/linux/netfilter_ipv4/ipt_ECN.h index 94e0d9866469..7ca45918ab8e 100644 --- a/include/linux/netfilter_ipv4/ipt_ECN.h +++ b/include/linux/netfilter_ipv4/ipt_ECN.h | |||
| @@ -8,9 +8,9 @@ | |||
| 8 | */ | 8 | */ |
| 9 | #ifndef _IPT_ECN_TARGET_H | 9 | #ifndef _IPT_ECN_TARGET_H |
| 10 | #define _IPT_ECN_TARGET_H | 10 | #define _IPT_ECN_TARGET_H |
| 11 | #include <linux/netfilter_ipv4/ipt_DSCP.h> | 11 | #include <linux/netfilter/xt_DSCP.h> |
| 12 | 12 | ||
| 13 | #define IPT_ECN_IP_MASK (~IPT_DSCP_MASK) | 13 | #define IPT_ECN_IP_MASK (~XT_DSCP_MASK) |
| 14 | 14 | ||
| 15 | #define IPT_ECN_OP_SET_IP 0x01 /* set ECN bits of IPv4 header */ | 15 | #define IPT_ECN_OP_SET_IP 0x01 /* set ECN bits of IPv4 header */ |
| 16 | #define IPT_ECN_OP_SET_ECE 0x10 /* set ECE bit of TCP header */ | 16 | #define IPT_ECN_OP_SET_ECE 0x10 /* set ECE bit of TCP header */ |
diff --git a/include/linux/netfilter_ipv4/ipt_MARK.h b/include/linux/netfilter_ipv4/ipt_MARK.h deleted file mode 100644 index 697a486a96d3..000000000000 --- a/include/linux/netfilter_ipv4/ipt_MARK.h +++ /dev/null | |||
| @@ -1,18 +0,0 @@ | |||
| 1 | #ifndef _IPT_MARK_H_target | ||
| 2 | #define _IPT_MARK_H_target | ||
| 3 | |||
| 4 | /* Backwards compatibility for old userspace */ | ||
| 5 | |||
| 6 | #include <linux/netfilter/xt_MARK.h> | ||
| 7 | |||
| 8 | /* Version 0 */ | ||
| 9 | #define ipt_mark_target_info xt_mark_target_info | ||
| 10 | |||
| 11 | /* Version 1 */ | ||
| 12 | #define IPT_MARK_SET XT_MARK_SET | ||
| 13 | #define IPT_MARK_AND XT_MARK_AND | ||
| 14 | #define IPT_MARK_OR XT_MARK_OR | ||
| 15 | |||
| 16 | #define ipt_mark_target_info_v1 xt_mark_target_info_v1 | ||
| 17 | |||
| 18 | #endif /*_IPT_MARK_H_target*/ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_NFQUEUE.h b/include/linux/netfilter_ipv4/ipt_NFQUEUE.h deleted file mode 100644 index 97a2a7557cb9..000000000000 --- a/include/linux/netfilter_ipv4/ipt_NFQUEUE.h +++ /dev/null | |||
| @@ -1,16 +0,0 @@ | |||
| 1 | /* iptables module for using NFQUEUE mechanism | ||
| 2 | * | ||
| 3 | * (C) 2005 Harald Welte <laforge@netfilter.org> | ||
| 4 | * | ||
| 5 | * This software is distributed under GNU GPL v2, 1991 | ||
| 6 | * | ||
| 7 | */ | ||
| 8 | #ifndef _IPT_NFQ_TARGET_H | ||
| 9 | #define _IPT_NFQ_TARGET_H | ||
| 10 | |||
| 11 | /* Backwards compatibility for old userspace */ | ||
| 12 | #include <linux/netfilter/xt_NFQUEUE.h> | ||
| 13 | |||
| 14 | #define ipt_NFQ_info xt_NFQ_info | ||
| 15 | |||
| 16 | #endif /* _IPT_DSCP_TARGET_H */ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_TCPMSS.h b/include/linux/netfilter_ipv4/ipt_TCPMSS.h deleted file mode 100644 index 7a850f945824..000000000000 --- a/include/linux/netfilter_ipv4/ipt_TCPMSS.h +++ /dev/null | |||
| @@ -1,9 +0,0 @@ | |||
| 1 | #ifndef _IPT_TCPMSS_H | ||
| 2 | #define _IPT_TCPMSS_H | ||
| 3 | |||
| 4 | #include <linux/netfilter/xt_TCPMSS.h> | ||
| 5 | |||
| 6 | #define ipt_tcpmss_info xt_tcpmss_info | ||
| 7 | #define IPT_TCPMSS_CLAMP_PMTU XT_TCPMSS_CLAMP_PMTU | ||
| 8 | |||
| 9 | #endif /*_IPT_TCPMSS_H*/ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_TOS.h b/include/linux/netfilter_ipv4/ipt_TOS.h deleted file mode 100644 index 6bf9e1fdfd88..000000000000 --- a/include/linux/netfilter_ipv4/ipt_TOS.h +++ /dev/null | |||
| @@ -1,12 +0,0 @@ | |||
| 1 | #ifndef _IPT_TOS_H_target | ||
| 2 | #define _IPT_TOS_H_target | ||
| 3 | |||
| 4 | #ifndef IPTOS_NORMALSVC | ||
| 5 | #define IPTOS_NORMALSVC 0 | ||
| 6 | #endif | ||
| 7 | |||
| 8 | struct ipt_tos_target_info { | ||
| 9 | u_int8_t tos; | ||
| 10 | }; | ||
| 11 | |||
| 12 | #endif /*_IPT_TOS_H_target*/ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_comment.h b/include/linux/netfilter_ipv4/ipt_comment.h deleted file mode 100644 index ae2afc2f7481..000000000000 --- a/include/linux/netfilter_ipv4/ipt_comment.h +++ /dev/null | |||
| @@ -1,10 +0,0 @@ | |||
| 1 | #ifndef _IPT_COMMENT_H | ||
| 2 | #define _IPT_COMMENT_H | ||
| 3 | |||
| 4 | #include <linux/netfilter/xt_comment.h> | ||
| 5 | |||
| 6 | #define IPT_MAX_COMMENT_LEN XT_MAX_COMMENT_LEN | ||
| 7 | |||
| 8 | #define ipt_comment_info xt_comment_info | ||
| 9 | |||
| 10 | #endif /* _IPT_COMMENT_H */ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_connbytes.h b/include/linux/netfilter_ipv4/ipt_connbytes.h deleted file mode 100644 index f63e6ee91113..000000000000 --- a/include/linux/netfilter_ipv4/ipt_connbytes.h +++ /dev/null | |||
| @@ -1,18 +0,0 @@ | |||
| 1 | #ifndef _IPT_CONNBYTES_H | ||
| 2 | #define _IPT_CONNBYTES_H | ||
| 3 | |||
| 4 | #include <linux/netfilter/xt_connbytes.h> | ||
| 5 | #define ipt_connbytes_what xt_connbytes_what | ||
| 6 | |||
| 7 | #define IPT_CONNBYTES_PKTS XT_CONNBYTES_PKTS | ||
| 8 | #define IPT_CONNBYTES_BYTES XT_CONNBYTES_BYTES | ||
| 9 | #define IPT_CONNBYTES_AVGPKT XT_CONNBYTES_AVGPKT | ||
| 10 | |||
| 11 | #define ipt_connbytes_direction xt_connbytes_direction | ||
| 12 | #define IPT_CONNBYTES_DIR_ORIGINAL XT_CONNBYTES_DIR_ORIGINAL | ||
| 13 | #define IPT_CONNBYTES_DIR_REPLY XT_CONNBYTES_DIR_REPLY | ||
| 14 | #define IPT_CONNBYTES_DIR_BOTH XT_CONNBYTES_DIR_BOTH | ||
| 15 | |||
| 16 | #define ipt_connbytes_info xt_connbytes_info | ||
| 17 | |||
| 18 | #endif | ||
diff --git a/include/linux/netfilter_ipv4/ipt_connmark.h b/include/linux/netfilter_ipv4/ipt_connmark.h deleted file mode 100644 index c7ba6560d44c..000000000000 --- a/include/linux/netfilter_ipv4/ipt_connmark.h +++ /dev/null | |||
| @@ -1,7 +0,0 @@ | |||
| 1 | #ifndef _IPT_CONNMARK_H | ||
| 2 | #define _IPT_CONNMARK_H | ||
| 3 | |||
| 4 | #include <linux/netfilter/xt_connmark.h> | ||
| 5 | #define ipt_connmark_info xt_connmark_info | ||
| 6 | |||
| 7 | #endif /*_IPT_CONNMARK_H*/ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_conntrack.h b/include/linux/netfilter_ipv4/ipt_conntrack.h deleted file mode 100644 index cde6762949c5..000000000000 --- a/include/linux/netfilter_ipv4/ipt_conntrack.h +++ /dev/null | |||
| @@ -1,28 +0,0 @@ | |||
| 1 | /* Header file for kernel module to match connection tracking information. | ||
| 2 | * GPL (C) 2001 Marc Boucher (marc@mbsi.ca). | ||
| 3 | */ | ||
| 4 | |||
| 5 | #ifndef _IPT_CONNTRACK_H | ||
| 6 | #define _IPT_CONNTRACK_H | ||
| 7 | |||
| 8 | #include <linux/netfilter/xt_conntrack.h> | ||
| 9 | |||
| 10 | #define IPT_CONNTRACK_STATE_BIT(ctinfo) XT_CONNTRACK_STATE_BIT(ctinfo) | ||
| 11 | #define IPT_CONNTRACK_STATE_INVALID XT_CONNTRACK_STATE_INVALID | ||
| 12 | |||
| 13 | #define IPT_CONNTRACK_STATE_SNAT XT_CONNTRACK_STATE_SNAT | ||
| 14 | #define IPT_CONNTRACK_STATE_DNAT XT_CONNTRACK_STATE_DNAT | ||
| 15 | #define IPT_CONNTRACK_STATE_UNTRACKED XT_CONNTRACK_STATE_UNTRACKED | ||
| 16 | |||
| 17 | /* flags, invflags: */ | ||
| 18 | #define IPT_CONNTRACK_STATE XT_CONNTRACK_STATE | ||
| 19 | #define IPT_CONNTRACK_PROTO XT_CONNTRACK_PROTO | ||
| 20 | #define IPT_CONNTRACK_ORIGSRC XT_CONNTRACK_ORIGSRC | ||
| 21 | #define IPT_CONNTRACK_ORIGDST XT_CONNTRACK_ORIGDST | ||
| 22 | #define IPT_CONNTRACK_REPLSRC XT_CONNTRACK_REPLSRC | ||
| 23 | #define IPT_CONNTRACK_REPLDST XT_CONNTRACK_REPLDST | ||
| 24 | #define IPT_CONNTRACK_STATUS XT_CONNTRACK_STATUS | ||
| 25 | #define IPT_CONNTRACK_EXPIRES XT_CONNTRACK_EXPIRES | ||
| 26 | |||
| 27 | #define ipt_conntrack_info xt_conntrack_info | ||
| 28 | #endif /*_IPT_CONNTRACK_H*/ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_dccp.h b/include/linux/netfilter_ipv4/ipt_dccp.h deleted file mode 100644 index e70d11e1f53c..000000000000 --- a/include/linux/netfilter_ipv4/ipt_dccp.h +++ /dev/null | |||
| @@ -1,15 +0,0 @@ | |||
| 1 | #ifndef _IPT_DCCP_H_ | ||
| 2 | #define _IPT_DCCP_H_ | ||
| 3 | |||
| 4 | #include <linux/netfilter/xt_dccp.h> | ||
| 5 | #define IPT_DCCP_SRC_PORTS XT_DCCP_SRC_PORTS | ||
| 6 | #define IPT_DCCP_DEST_PORTS XT_DCCP_DEST_PORTS | ||
| 7 | #define IPT_DCCP_TYPE XT_DCCP_TYPE | ||
| 8 | #define IPT_DCCP_OPTION XT_DCCP_OPTION | ||
| 9 | |||
| 10 | #define IPT_DCCP_VALID_FLAGS XT_DCCP_VALID_FLAGS | ||
| 11 | |||
| 12 | #define ipt_dccp_info xt_dccp_info | ||
| 13 | |||
| 14 | #endif /* _IPT_DCCP_H_ */ | ||
| 15 | |||
diff --git a/include/linux/netfilter_ipv4/ipt_dscp.h b/include/linux/netfilter_ipv4/ipt_dscp.h deleted file mode 100644 index 4b82ca912b0e..000000000000 --- a/include/linux/netfilter_ipv4/ipt_dscp.h +++ /dev/null | |||
| @@ -1,21 +0,0 @@ | |||
| 1 | /* iptables module for matching the IPv4 DSCP field | ||
| 2 | * | ||
| 3 | * (C) 2002 Harald Welte <laforge@gnumonks.org> | ||
| 4 | * This software is distributed under GNU GPL v2, 1991 | ||
| 5 | * | ||
| 6 | * See RFC2474 for a description of the DSCP field within the IP Header. | ||
| 7 | * | ||
| 8 | * ipt_dscp.h,v 1.3 2002/08/05 19:00:21 laforge Exp | ||
| 9 | */ | ||
| 10 | #ifndef _IPT_DSCP_H | ||
| 11 | #define _IPT_DSCP_H | ||
| 12 | |||
| 13 | #include <linux/netfilter/xt_dscp.h> | ||
| 14 | |||
| 15 | #define IPT_DSCP_MASK XT_DSCP_MASK | ||
| 16 | #define IPT_DSCP_SHIFT XT_DSCP_SHIFT | ||
| 17 | #define IPT_DSCP_MAX XT_DSCP_MAX | ||
| 18 | |||
| 19 | #define ipt_dscp_info xt_dscp_info | ||
| 20 | |||
| 21 | #endif /* _IPT_DSCP_H */ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_ecn.h b/include/linux/netfilter_ipv4/ipt_ecn.h index 1f0d9a4d3378..9945baa4ccd7 100644 --- a/include/linux/netfilter_ipv4/ipt_ecn.h +++ b/include/linux/netfilter_ipv4/ipt_ecn.h | |||
| @@ -8,9 +8,9 @@ | |||
| 8 | */ | 8 | */ |
| 9 | #ifndef _IPT_ECN_H | 9 | #ifndef _IPT_ECN_H |
| 10 | #define _IPT_ECN_H | 10 | #define _IPT_ECN_H |
| 11 | #include <linux/netfilter_ipv4/ipt_dscp.h> | 11 | #include <linux/netfilter/xt_dscp.h> |
| 12 | 12 | ||
| 13 | #define IPT_ECN_IP_MASK (~IPT_DSCP_MASK) | 13 | #define IPT_ECN_IP_MASK (~XT_DSCP_MASK) |
| 14 | 14 | ||
| 15 | #define IPT_ECN_OP_MATCH_IP 0x01 | 15 | #define IPT_ECN_OP_MATCH_IP 0x01 |
| 16 | #define IPT_ECN_OP_MATCH_ECE 0x10 | 16 | #define IPT_ECN_OP_MATCH_ECE 0x10 |
diff --git a/include/linux/netfilter_ipv4/ipt_esp.h b/include/linux/netfilter_ipv4/ipt_esp.h deleted file mode 100644 index 78296e7eeff9..000000000000 --- a/include/linux/netfilter_ipv4/ipt_esp.h +++ /dev/null | |||
| @@ -1,10 +0,0 @@ | |||
| 1 | #ifndef _IPT_ESP_H | ||
| 2 | #define _IPT_ESP_H | ||
| 3 | |||
| 4 | #include <linux/netfilter/xt_esp.h> | ||
| 5 | |||
| 6 | #define ipt_esp xt_esp | ||
| 7 | #define IPT_ESP_INV_SPI XT_ESP_INV_SPI | ||
| 8 | #define IPT_ESP_INV_MASK XT_ESP_INV_MASK | ||
| 9 | |||
| 10 | #endif /*_IPT_ESP_H*/ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_hashlimit.h b/include/linux/netfilter_ipv4/ipt_hashlimit.h deleted file mode 100644 index 5662120a3d7b..000000000000 --- a/include/linux/netfilter_ipv4/ipt_hashlimit.h +++ /dev/null | |||
| @@ -1,14 +0,0 @@ | |||
| 1 | #ifndef _IPT_HASHLIMIT_H | ||
| 2 | #define _IPT_HASHLIMIT_H | ||
| 3 | |||
| 4 | #include <linux/netfilter/xt_hashlimit.h> | ||
| 5 | |||
| 6 | #define IPT_HASHLIMIT_SCALE XT_HASHLIMIT_SCALE | ||
| 7 | #define IPT_HASHLIMIT_HASH_DIP XT_HASHLIMIT_HASH_DIP | ||
| 8 | #define IPT_HASHLIMIT_HASH_DPT XT_HASHLIMIT_HASH_DPT | ||
| 9 | #define IPT_HASHLIMIT_HASH_SIP XT_HASHLIMIT_HASH_SIP | ||
| 10 | #define IPT_HASHLIMIT_HASH_SPT XT_HASHLIMIT_HASH_SPT | ||
| 11 | |||
| 12 | #define ipt_hashlimit_info xt_hashlimit_info | ||
| 13 | |||
| 14 | #endif /* _IPT_HASHLIMIT_H */ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_helper.h b/include/linux/netfilter_ipv4/ipt_helper.h deleted file mode 100644 index 80452c218551..000000000000 --- a/include/linux/netfilter_ipv4/ipt_helper.h +++ /dev/null | |||
| @@ -1,7 +0,0 @@ | |||
| 1 | #ifndef _IPT_HELPER_H | ||
| 2 | #define _IPT_HELPER_H | ||
| 3 | |||
| 4 | #include <linux/netfilter/xt_helper.h> | ||
| 5 | #define ipt_helper_info xt_helper_info | ||
| 6 | |||
| 7 | #endif /* _IPT_HELPER_H */ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_iprange.h b/include/linux/netfilter_ipv4/ipt_iprange.h deleted file mode 100644 index 5f1aebde4d2f..000000000000 --- a/include/linux/netfilter_ipv4/ipt_iprange.h +++ /dev/null | |||
| @@ -1,21 +0,0 @@ | |||
| 1 | #ifndef _IPT_IPRANGE_H | ||
| 2 | #define _IPT_IPRANGE_H | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | #include <linux/netfilter/xt_iprange.h> | ||
| 6 | |||
| 7 | struct ipt_iprange { | ||
| 8 | /* Inclusive: network order. */ | ||
| 9 | __be32 min_ip, max_ip; | ||
| 10 | }; | ||
| 11 | |||
| 12 | struct ipt_iprange_info | ||
| 13 | { | ||
| 14 | struct ipt_iprange src; | ||
| 15 | struct ipt_iprange dst; | ||
| 16 | |||
| 17 | /* Flags from above */ | ||
| 18 | u_int8_t flags; | ||
| 19 | }; | ||
| 20 | |||
| 21 | #endif /* _IPT_IPRANGE_H */ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_length.h b/include/linux/netfilter_ipv4/ipt_length.h deleted file mode 100644 index 9b45206ffcef..000000000000 --- a/include/linux/netfilter_ipv4/ipt_length.h +++ /dev/null | |||
| @@ -1,7 +0,0 @@ | |||
| 1 | #ifndef _IPT_LENGTH_H | ||
| 2 | #define _IPT_LENGTH_H | ||
| 3 | |||
| 4 | #include <linux/netfilter/xt_length.h> | ||
| 5 | #define ipt_length_info xt_length_info | ||
| 6 | |||
| 7 | #endif /*_IPT_LENGTH_H*/ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_limit.h b/include/linux/netfilter_ipv4/ipt_limit.h deleted file mode 100644 index 92f5cd07bbc4..000000000000 --- a/include/linux/netfilter_ipv4/ipt_limit.h +++ /dev/null | |||
| @@ -1,8 +0,0 @@ | |||
| 1 | #ifndef _IPT_RATE_H | ||
| 2 | #define _IPT_RATE_H | ||
| 3 | |||
| 4 | #include <linux/netfilter/xt_limit.h> | ||
| 5 | #define IPT_LIMIT_SCALE XT_LIMIT_SCALE | ||
| 6 | #define ipt_rateinfo xt_rateinfo | ||
| 7 | |||
| 8 | #endif /*_IPT_RATE_H*/ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_mac.h b/include/linux/netfilter_ipv4/ipt_mac.h deleted file mode 100644 index b186008a3c47..000000000000 --- a/include/linux/netfilter_ipv4/ipt_mac.h +++ /dev/null | |||
| @@ -1,7 +0,0 @@ | |||
| 1 | #ifndef _IPT_MAC_H | ||
| 2 | #define _IPT_MAC_H | ||
| 3 | |||
| 4 | #include <linux/netfilter/xt_mac.h> | ||
| 5 | #define ipt_mac_info xt_mac_info | ||
| 6 | |||
| 7 | #endif /*_IPT_MAC_H*/ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_mark.h b/include/linux/netfilter_ipv4/ipt_mark.h deleted file mode 100644 index bfde67c61224..000000000000 --- a/include/linux/netfilter_ipv4/ipt_mark.h +++ /dev/null | |||
| @@ -1,9 +0,0 @@ | |||
| 1 | #ifndef _IPT_MARK_H | ||
| 2 | #define _IPT_MARK_H | ||
| 3 | |||
| 4 | /* Backwards compatibility for old userspace */ | ||
| 5 | #include <linux/netfilter/xt_mark.h> | ||
| 6 | |||
| 7 | #define ipt_mark_info xt_mark_info | ||
| 8 | |||
| 9 | #endif /*_IPT_MARK_H*/ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_multiport.h b/include/linux/netfilter_ipv4/ipt_multiport.h deleted file mode 100644 index 55fe85eca88c..000000000000 --- a/include/linux/netfilter_ipv4/ipt_multiport.h +++ /dev/null | |||
| @@ -1,15 +0,0 @@ | |||
| 1 | #ifndef _IPT_MULTIPORT_H | ||
| 2 | #define _IPT_MULTIPORT_H | ||
| 3 | |||
| 4 | #include <linux/netfilter/xt_multiport.h> | ||
| 5 | |||
| 6 | #define IPT_MULTIPORT_SOURCE XT_MULTIPORT_SOURCE | ||
| 7 | #define IPT_MULTIPORT_DESTINATION XT_MULTIPORT_DESTINATION | ||
| 8 | #define IPT_MULTIPORT_EITHER XT_MULTIPORT_EITHER | ||
| 9 | |||
| 10 | #define IPT_MULTI_PORTS XT_MULTI_PORTS | ||
| 11 | |||
| 12 | #define ipt_multiport xt_multiport | ||
| 13 | #define ipt_multiport_v1 xt_multiport_v1 | ||
| 14 | |||
| 15 | #endif /*_IPT_MULTIPORT_H*/ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_owner.h b/include/linux/netfilter_ipv4/ipt_owner.h deleted file mode 100644 index a78445be9992..000000000000 --- a/include/linux/netfilter_ipv4/ipt_owner.h +++ /dev/null | |||
| @@ -1,20 +0,0 @@ | |||
| 1 | #ifndef _IPT_OWNER_H | ||
| 2 | #define _IPT_OWNER_H | ||
| 3 | |||
| 4 | /* match and invert flags */ | ||
| 5 | #define IPT_OWNER_UID 0x01 | ||
| 6 | #define IPT_OWNER_GID 0x02 | ||
| 7 | #define IPT_OWNER_PID 0x04 | ||
| 8 | #define IPT_OWNER_SID 0x08 | ||
| 9 | #define IPT_OWNER_COMM 0x10 | ||
| 10 | |||
| 11 | struct ipt_owner_info { | ||
| 12 | __kernel_uid32_t uid; | ||
| 13 | __kernel_gid32_t gid; | ||
| 14 | __kernel_pid_t pid; | ||
| 15 | __kernel_pid_t sid; | ||
| 16 | char comm[16]; | ||
| 17 | u_int8_t match, invert; /* flags */ | ||
| 18 | }; | ||
| 19 | |||
| 20 | #endif /*_IPT_OWNER_H*/ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_physdev.h b/include/linux/netfilter_ipv4/ipt_physdev.h deleted file mode 100644 index 2400e7140f26..000000000000 --- a/include/linux/netfilter_ipv4/ipt_physdev.h +++ /dev/null | |||
| @@ -1,17 +0,0 @@ | |||
| 1 | #ifndef _IPT_PHYSDEV_H | ||
| 2 | #define _IPT_PHYSDEV_H | ||
| 3 | |||
| 4 | /* Backwards compatibility for old userspace */ | ||
| 5 | |||
| 6 | #include <linux/netfilter/xt_physdev.h> | ||
| 7 | |||
| 8 | #define IPT_PHYSDEV_OP_IN XT_PHYSDEV_OP_IN | ||
| 9 | #define IPT_PHYSDEV_OP_OUT XT_PHYSDEV_OP_OUT | ||
| 10 | #define IPT_PHYSDEV_OP_BRIDGED XT_PHYSDEV_OP_BRIDGED | ||
| 11 | #define IPT_PHYSDEV_OP_ISIN XT_PHYSDEV_OP_ISIN | ||
| 12 | #define IPT_PHYSDEV_OP_ISOUT XT_PHYSDEV_OP_ISOUT | ||
| 13 | #define IPT_PHYSDEV_OP_MASK XT_PHYSDEV_OP_MASK | ||
| 14 | |||
| 15 | #define ipt_physdev_info xt_physdev_info | ||
| 16 | |||
| 17 | #endif /*_IPT_PHYSDEV_H*/ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_pkttype.h b/include/linux/netfilter_ipv4/ipt_pkttype.h deleted file mode 100644 index ff1fbc949a0c..000000000000 --- a/include/linux/netfilter_ipv4/ipt_pkttype.h +++ /dev/null | |||
| @@ -1,7 +0,0 @@ | |||
| 1 | #ifndef _IPT_PKTTYPE_H | ||
| 2 | #define _IPT_PKTTYPE_H | ||
| 3 | |||
| 4 | #include <linux/netfilter/xt_pkttype.h> | ||
| 5 | #define ipt_pkttype_info xt_pkttype_info | ||
| 6 | |||
| 7 | #endif /*_IPT_PKTTYPE_H*/ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_policy.h b/include/linux/netfilter_ipv4/ipt_policy.h deleted file mode 100644 index 1037fb2cd206..000000000000 --- a/include/linux/netfilter_ipv4/ipt_policy.h +++ /dev/null | |||
| @@ -1,23 +0,0 @@ | |||
| 1 | #ifndef _IPT_POLICY_H | ||
| 2 | #define _IPT_POLICY_H | ||
| 3 | |||
| 4 | #include <linux/netfilter/xt_policy.h> | ||
| 5 | |||
| 6 | #define IPT_POLICY_MAX_ELEM XT_POLICY_MAX_ELEM | ||
| 7 | |||
| 8 | /* ipt_policy_flags */ | ||
| 9 | #define IPT_POLICY_MATCH_IN XT_POLICY_MATCH_IN | ||
| 10 | #define IPT_POLICY_MATCH_OUT XT_POLICY_MATCH_OUT | ||
| 11 | #define IPT_POLICY_MATCH_NONE XT_POLICY_MATCH_NONE | ||
| 12 | #define IPT_POLICY_MATCH_STRICT XT_POLICY_MATCH_STRICT | ||
| 13 | |||
| 14 | /* ipt_policy_modes */ | ||
| 15 | #define IPT_POLICY_MODE_TRANSPORT XT_POLICY_MODE_TRANSPORT | ||
| 16 | #define IPT_POLICY_MODE_TUNNEL XT_POLICY_MODE_TUNNEL | ||
| 17 | |||
| 18 | #define ipt_policy_spec xt_policy_spec | ||
| 19 | #define ipt_policy_addr xt_policy_addr | ||
| 20 | #define ipt_policy_elem xt_policy_elem | ||
| 21 | #define ipt_policy_info xt_policy_info | ||
| 22 | |||
| 23 | #endif /* _IPT_POLICY_H */ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_recent.h b/include/linux/netfilter_ipv4/ipt_recent.h deleted file mode 100644 index d636cca133c2..000000000000 --- a/include/linux/netfilter_ipv4/ipt_recent.h +++ /dev/null | |||
| @@ -1,21 +0,0 @@ | |||
| 1 | #ifndef _IPT_RECENT_H | ||
| 2 | #define _IPT_RECENT_H | ||
| 3 | |||
| 4 | #include <linux/netfilter/xt_recent.h> | ||
| 5 | |||
| 6 | #define ipt_recent_info xt_recent_mtinfo | ||
| 7 | |||
| 8 | enum { | ||
| 9 | IPT_RECENT_CHECK = XT_RECENT_CHECK, | ||
| 10 | IPT_RECENT_SET = XT_RECENT_SET, | ||
| 11 | IPT_RECENT_UPDATE = XT_RECENT_UPDATE, | ||
| 12 | IPT_RECENT_REMOVE = XT_RECENT_REMOVE, | ||
| 13 | IPT_RECENT_TTL = XT_RECENT_TTL, | ||
| 14 | |||
| 15 | IPT_RECENT_SOURCE = XT_RECENT_SOURCE, | ||
| 16 | IPT_RECENT_DEST = XT_RECENT_DEST, | ||
| 17 | |||
| 18 | IPT_RECENT_NAME_LEN = XT_RECENT_NAME_LEN, | ||
| 19 | }; | ||
| 20 | |||
| 21 | #endif /*_IPT_RECENT_H*/ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_sctp.h b/include/linux/netfilter_ipv4/ipt_sctp.h deleted file mode 100644 index 80b3dbacd193..000000000000 --- a/include/linux/netfilter_ipv4/ipt_sctp.h +++ /dev/null | |||
| @@ -1,105 +0,0 @@ | |||
| 1 | #ifndef _IPT_SCTP_H_ | ||
| 2 | #define _IPT_SCTP_H_ | ||
| 3 | |||
| 4 | #define IPT_SCTP_SRC_PORTS 0x01 | ||
| 5 | #define IPT_SCTP_DEST_PORTS 0x02 | ||
| 6 | #define IPT_SCTP_CHUNK_TYPES 0x04 | ||
| 7 | |||
| 8 | #define IPT_SCTP_VALID_FLAGS 0x07 | ||
| 9 | |||
| 10 | |||
| 11 | struct ipt_sctp_flag_info { | ||
| 12 | u_int8_t chunktype; | ||
| 13 | u_int8_t flag; | ||
| 14 | u_int8_t flag_mask; | ||
| 15 | }; | ||
| 16 | |||
| 17 | #define IPT_NUM_SCTP_FLAGS 4 | ||
| 18 | |||
| 19 | struct ipt_sctp_info { | ||
| 20 | u_int16_t dpts[2]; /* Min, Max */ | ||
| 21 | u_int16_t spts[2]; /* Min, Max */ | ||
| 22 | |||
| 23 | u_int32_t chunkmap[256 / sizeof (u_int32_t)]; /* Bit mask of chunks to be matched according to RFC 2960 */ | ||
| 24 | |||
| 25 | #define SCTP_CHUNK_MATCH_ANY 0x01 /* Match if any of the chunk types are present */ | ||
| 26 | #define SCTP_CHUNK_MATCH_ALL 0x02 /* Match if all of the chunk types are present */ | ||
| 27 | #define SCTP_CHUNK_MATCH_ONLY 0x04 /* Match if these are the only chunk types present */ | ||
| 28 | |||
| 29 | u_int32_t chunk_match_type; | ||
| 30 | struct ipt_sctp_flag_info flag_info[IPT_NUM_SCTP_FLAGS]; | ||
| 31 | int flag_count; | ||
| 32 | |||
| 33 | u_int32_t flags; | ||
| 34 | u_int32_t invflags; | ||
| 35 | }; | ||
| 36 | |||
| 37 | #define bytes(type) (sizeof(type) * 8) | ||
| 38 | |||
| 39 | #define SCTP_CHUNKMAP_SET(chunkmap, type) \ | ||
| 40 | do { \ | ||
| 41 | chunkmap[type / bytes(u_int32_t)] |= \ | ||
| 42 | 1 << (type % bytes(u_int32_t)); \ | ||
| 43 | } while (0) | ||
| 44 | |||
| 45 | #define SCTP_CHUNKMAP_CLEAR(chunkmap, type) \ | ||
| 46 | do { \ | ||
| 47 | chunkmap[type / bytes(u_int32_t)] &= \ | ||
| 48 | ~(1 << (type % bytes(u_int32_t))); \ | ||
| 49 | } while (0) | ||
| 50 | |||
| 51 | #define SCTP_CHUNKMAP_IS_SET(chunkmap, type) \ | ||
| 52 | ({ \ | ||
| 53 | (chunkmap[type / bytes (u_int32_t)] & \ | ||
| 54 | (1 << (type % bytes (u_int32_t)))) ? 1: 0; \ | ||
| 55 | }) | ||
| 56 | |||
| 57 | #define SCTP_CHUNKMAP_RESET(chunkmap) \ | ||
| 58 | do { \ | ||
| 59 | int i; \ | ||
| 60 | for (i = 0; i < ARRAY_SIZE(chunkmap); i++) \ | ||
| 61 | chunkmap[i] = 0; \ | ||
| 62 | } while (0) | ||
| 63 | |||
| 64 | #define SCTP_CHUNKMAP_SET_ALL(chunkmap) \ | ||
| 65 | do { \ | ||
| 66 | int i; \ | ||
| 67 | for (i = 0; i < ARRAY_SIZE(chunkmap); i++) \ | ||
| 68 | chunkmap[i] = ~0; \ | ||
| 69 | } while (0) | ||
| 70 | |||
| 71 | #define SCTP_CHUNKMAP_COPY(destmap, srcmap) \ | ||
| 72 | do { \ | ||
| 73 | int i; \ | ||
| 74 | for (i = 0; i < ARRAY_SIZE(chunkmap); i++) \ | ||
| 75 | destmap[i] = srcmap[i]; \ | ||
| 76 | } while (0) | ||
| 77 | |||
| 78 | #define SCTP_CHUNKMAP_IS_CLEAR(chunkmap) \ | ||
| 79 | ({ \ | ||
| 80 | int i; \ | ||
| 81 | int flag = 1; \ | ||
| 82 | for (i = 0; i < ARRAY_SIZE(chunkmap); i++) { \ | ||
| 83 | if (chunkmap[i]) { \ | ||
| 84 | flag = 0; \ | ||
| 85 | break; \ | ||
| 86 | } \ | ||
| 87 | } \ | ||
| 88 | flag; \ | ||
| 89 | }) | ||
| 90 | |||
| 91 | #define SCTP_CHUNKMAP_IS_ALL_SET(chunkmap) \ | ||
| 92 | ({ \ | ||
| 93 | int i; \ | ||
| 94 | int flag = 1; \ | ||
| 95 | for (i = 0; i < ARRAY_SIZE(chunkmap); i++) { \ | ||
| 96 | if (chunkmap[i] != ~0) { \ | ||
| 97 | flag = 0; \ | ||
| 98 | break; \ | ||
| 99 | } \ | ||
| 100 | } \ | ||
| 101 | flag; \ | ||
| 102 | }) | ||
| 103 | |||
| 104 | #endif /* _IPT_SCTP_H_ */ | ||
| 105 | |||
diff --git a/include/linux/netfilter_ipv4/ipt_state.h b/include/linux/netfilter_ipv4/ipt_state.h deleted file mode 100644 index a44a99cc28cc..000000000000 --- a/include/linux/netfilter_ipv4/ipt_state.h +++ /dev/null | |||
| @@ -1,15 +0,0 @@ | |||
| 1 | #ifndef _IPT_STATE_H | ||
| 2 | #define _IPT_STATE_H | ||
| 3 | |||
| 4 | /* Backwards compatibility for old userspace */ | ||
| 5 | |||
| 6 | #include <linux/netfilter/xt_state.h> | ||
| 7 | |||
| 8 | #define IPT_STATE_BIT XT_STATE_BIT | ||
| 9 | #define IPT_STATE_INVALID XT_STATE_INVALID | ||
| 10 | |||
| 11 | #define IPT_STATE_UNTRACKED XT_STATE_UNTRACKED | ||
| 12 | |||
| 13 | #define ipt_state_info xt_state_info | ||
| 14 | |||
| 15 | #endif /*_IPT_STATE_H*/ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_string.h b/include/linux/netfilter_ipv4/ipt_string.h deleted file mode 100644 index c26de3059903..000000000000 --- a/include/linux/netfilter_ipv4/ipt_string.h +++ /dev/null | |||
| @@ -1,10 +0,0 @@ | |||
| 1 | #ifndef _IPT_STRING_H | ||
| 2 | #define _IPT_STRING_H | ||
| 3 | |||
| 4 | #include <linux/netfilter/xt_string.h> | ||
| 5 | |||
| 6 | #define IPT_STRING_MAX_PATTERN_SIZE XT_STRING_MAX_PATTERN_SIZE | ||
| 7 | #define IPT_STRING_MAX_ALGO_NAME_SIZE XT_STRING_MAX_ALGO_NAME_SIZE | ||
| 8 | #define ipt_string_info xt_string_info | ||
| 9 | |||
| 10 | #endif /*_IPT_STRING_H*/ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_tcpmss.h b/include/linux/netfilter_ipv4/ipt_tcpmss.h deleted file mode 100644 index 18bbc8e8e009..000000000000 --- a/include/linux/netfilter_ipv4/ipt_tcpmss.h +++ /dev/null | |||
| @@ -1,7 +0,0 @@ | |||
| 1 | #ifndef _IPT_TCPMSS_MATCH_H | ||
| 2 | #define _IPT_TCPMSS_MATCH_H | ||
| 3 | |||
| 4 | #include <linux/netfilter/xt_tcpmss.h> | ||
| 5 | #define ipt_tcpmss_match_info xt_tcpmss_match_info | ||
| 6 | |||
| 7 | #endif /*_IPT_TCPMSS_MATCH_H*/ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_tos.h b/include/linux/netfilter_ipv4/ipt_tos.h deleted file mode 100644 index a21f5df23c50..000000000000 --- a/include/linux/netfilter_ipv4/ipt_tos.h +++ /dev/null | |||
| @@ -1,13 +0,0 @@ | |||
| 1 | #ifndef _IPT_TOS_H | ||
| 2 | #define _IPT_TOS_H | ||
| 3 | |||
| 4 | struct ipt_tos_info { | ||
| 5 | u_int8_t tos; | ||
| 6 | u_int8_t invert; | ||
| 7 | }; | ||
| 8 | |||
| 9 | #ifndef IPTOS_NORMALSVC | ||
| 10 | #define IPTOS_NORMALSVC 0 | ||
| 11 | #endif | ||
| 12 | |||
| 13 | #endif /*_IPT_TOS_H*/ | ||
diff --git a/include/linux/netfilter_ipv6/Kbuild b/include/linux/netfilter_ipv6/Kbuild index aca4bd1f6d7c..e864eaee9e5e 100644 --- a/include/linux/netfilter_ipv6/Kbuild +++ b/include/linux/netfilter_ipv6/Kbuild | |||
| @@ -1,22 +1,12 @@ | |||
| 1 | header-y += ip6t_HL.h | 1 | header-y += ip6t_HL.h |
| 2 | header-y += ip6t_LOG.h | 2 | header-y += ip6t_LOG.h |
| 3 | header-y += ip6t_MARK.h | ||
| 4 | header-y += ip6t_REJECT.h | 3 | header-y += ip6t_REJECT.h |
| 5 | header-y += ip6t_ah.h | 4 | header-y += ip6t_ah.h |
| 6 | header-y += ip6t_esp.h | ||
| 7 | header-y += ip6t_frag.h | 5 | header-y += ip6t_frag.h |
| 8 | header-y += ip6t_hl.h | ||
| 9 | header-y += ip6t_ipv6header.h | 6 | header-y += ip6t_ipv6header.h |
| 10 | header-y += ip6t_length.h | 7 | header-y += ip6t_hl.h |
| 11 | header-y += ip6t_limit.h | ||
| 12 | header-y += ip6t_mac.h | ||
| 13 | header-y += ip6t_mark.h | ||
| 14 | header-y += ip6t_mh.h | 8 | header-y += ip6t_mh.h |
| 15 | header-y += ip6t_multiport.h | ||
| 16 | header-y += ip6t_opts.h | 9 | header-y += ip6t_opts.h |
| 17 | header-y += ip6t_owner.h | ||
| 18 | header-y += ip6t_physdev.h | ||
| 19 | header-y += ip6t_policy.h | ||
| 20 | header-y += ip6t_rt.h | 10 | header-y += ip6t_rt.h |
| 21 | 11 | ||
| 22 | unifdef-y += ip6_tables.h | 12 | unifdef-y += ip6_tables.h |
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h index 1089e33cf633..a64e1451ac38 100644 --- a/include/linux/netfilter_ipv6/ip6_tables.h +++ b/include/linux/netfilter_ipv6/ip6_tables.h | |||
| @@ -306,7 +306,7 @@ ip6t_get_target(struct ip6t_entry *e) | |||
| 306 | extern void ip6t_init(void) __init; | 306 | extern void ip6t_init(void) __init; |
| 307 | 307 | ||
| 308 | extern struct xt_table *ip6t_register_table(struct net *net, | 308 | extern struct xt_table *ip6t_register_table(struct net *net, |
| 309 | struct xt_table *table, | 309 | const struct xt_table *table, |
| 310 | const struct ip6t_replace *repl); | 310 | const struct ip6t_replace *repl); |
| 311 | extern void ip6t_unregister_table(struct xt_table *table); | 311 | extern void ip6t_unregister_table(struct xt_table *table); |
| 312 | extern unsigned int ip6t_do_table(struct sk_buff *skb, | 312 | extern unsigned int ip6t_do_table(struct sk_buff *skb, |
diff --git a/include/linux/netfilter_ipv6/ip6t_MARK.h b/include/linux/netfilter_ipv6/ip6t_MARK.h deleted file mode 100644 index 7cf629a8ab92..000000000000 --- a/include/linux/netfilter_ipv6/ip6t_MARK.h +++ /dev/null | |||
| @@ -1,9 +0,0 @@ | |||
| 1 | #ifndef _IP6T_MARK_H_target | ||
| 2 | #define _IP6T_MARK_H_target | ||
| 3 | |||
| 4 | /* Backwards compatibility for old userspace */ | ||
| 5 | #include <linux/netfilter/xt_MARK.h> | ||
| 6 | |||
| 7 | #define ip6t_mark_target_info xt_mark_target_info | ||
| 8 | |||
| 9 | #endif /*_IP6T_MARK_H_target*/ | ||
diff --git a/include/linux/netfilter_ipv6/ip6t_esp.h b/include/linux/netfilter_ipv6/ip6t_esp.h deleted file mode 100644 index f62eaf53c16c..000000000000 --- a/include/linux/netfilter_ipv6/ip6t_esp.h +++ /dev/null | |||
| @@ -1,10 +0,0 @@ | |||
| 1 | #ifndef _IP6T_ESP_H | ||
| 2 | #define _IP6T_ESP_H | ||
| 3 | |||
| 4 | #include <linux/netfilter/xt_esp.h> | ||
| 5 | |||
| 6 | #define ip6t_esp xt_esp | ||
| 7 | #define IP6T_ESP_INV_SPI XT_ESP_INV_SPI | ||
| 8 | #define IP6T_ESP_INV_MASK XT_ESP_INV_MASK | ||
| 9 | |||
| 10 | #endif /*_IP6T_ESP_H*/ | ||
diff --git a/include/linux/netfilter_ipv6/ip6t_length.h b/include/linux/netfilter_ipv6/ip6t_length.h deleted file mode 100644 index 9e9689d03ed7..000000000000 --- a/include/linux/netfilter_ipv6/ip6t_length.h +++ /dev/null | |||
| @@ -1,8 +0,0 @@ | |||
| 1 | #ifndef _IP6T_LENGTH_H | ||
| 2 | #define _IP6T_LENGTH_H | ||
| 3 | |||
| 4 | #include <linux/netfilter/xt_length.h> | ||
| 5 | #define ip6t_length_info xt_length_info | ||
| 6 | |||
| 7 | #endif /*_IP6T_LENGTH_H*/ | ||
| 8 | |||
diff --git a/include/linux/netfilter_ipv6/ip6t_limit.h b/include/linux/netfilter_ipv6/ip6t_limit.h deleted file mode 100644 index 487e5ea342c6..000000000000 --- a/include/linux/netfilter_ipv6/ip6t_limit.h +++ /dev/null | |||
| @@ -1,8 +0,0 @@ | |||
| 1 | #ifndef _IP6T_RATE_H | ||
| 2 | #define _IP6T_RATE_H | ||
| 3 | |||
| 4 | #include <linux/netfilter/xt_limit.h> | ||
| 5 | #define IP6T_LIMIT_SCALE XT_LIMIT_SCALE | ||
| 6 | #define ip6t_rateinfo xt_rateinfo | ||
| 7 | |||
| 8 | #endif /*_IP6T_RATE_H*/ | ||
diff --git a/include/linux/netfilter_ipv6/ip6t_mac.h b/include/linux/netfilter_ipv6/ip6t_mac.h deleted file mode 100644 index ac58e83e9423..000000000000 --- a/include/linux/netfilter_ipv6/ip6t_mac.h +++ /dev/null | |||
| @@ -1,7 +0,0 @@ | |||
| 1 | #ifndef _IP6T_MAC_H | ||
| 2 | #define _IP6T_MAC_H | ||
| 3 | |||
| 4 | #include <linux/netfilter/xt_mac.h> | ||
| 5 | #define ip6t_mac_info xt_mac_info | ||
| 6 | |||
| 7 | #endif /*_IP6T_MAC_H*/ | ||
diff --git a/include/linux/netfilter_ipv6/ip6t_mark.h b/include/linux/netfilter_ipv6/ip6t_mark.h deleted file mode 100644 index ff204951ddc3..000000000000 --- a/include/linux/netfilter_ipv6/ip6t_mark.h +++ /dev/null | |||
| @@ -1,9 +0,0 @@ | |||
| 1 | #ifndef _IP6T_MARK_H | ||
| 2 | #define _IP6T_MARK_H | ||
| 3 | |||
| 4 | /* Backwards compatibility for old userspace */ | ||
| 5 | #include <linux/netfilter/xt_mark.h> | ||
| 6 | |||
| 7 | #define ip6t_mark_info xt_mark_info | ||
| 8 | |||
| 9 | #endif /*_IPT_MARK_H*/ | ||
diff --git a/include/linux/netfilter_ipv6/ip6t_multiport.h b/include/linux/netfilter_ipv6/ip6t_multiport.h deleted file mode 100644 index 042c92661cee..000000000000 --- a/include/linux/netfilter_ipv6/ip6t_multiport.h +++ /dev/null | |||
| @@ -1,14 +0,0 @@ | |||
| 1 | #ifndef _IP6T_MULTIPORT_H | ||
| 2 | #define _IP6T_MULTIPORT_H | ||
| 3 | |||
| 4 | #include <linux/netfilter/xt_multiport.h> | ||
| 5 | |||
| 6 | #define IP6T_MULTIPORT_SOURCE XT_MULTIPORT_SOURCE | ||
| 7 | #define IP6T_MULTIPORT_DESTINATION XT_MULTIPORT_DESTINATION | ||
| 8 | #define IP6T_MULTIPORT_EITHER XT_MULTIPORT_EITHER | ||
| 9 | |||
| 10 | #define IP6T_MULTI_PORTS XT_MULTI_PORTS | ||
| 11 | |||
| 12 | #define ip6t_multiport xt_multiport | ||
| 13 | |||
| 14 | #endif /*_IP6T_MULTIPORT_H*/ | ||
diff --git a/include/linux/netfilter_ipv6/ip6t_owner.h b/include/linux/netfilter_ipv6/ip6t_owner.h deleted file mode 100644 index ec5cc7a38c42..000000000000 --- a/include/linux/netfilter_ipv6/ip6t_owner.h +++ /dev/null | |||
| @@ -1,18 +0,0 @@ | |||
| 1 | #ifndef _IP6T_OWNER_H | ||
| 2 | #define _IP6T_OWNER_H | ||
| 3 | |||
| 4 | /* match and invert flags */ | ||
| 5 | #define IP6T_OWNER_UID 0x01 | ||
| 6 | #define IP6T_OWNER_GID 0x02 | ||
| 7 | #define IP6T_OWNER_PID 0x04 | ||
| 8 | #define IP6T_OWNER_SID 0x08 | ||
| 9 | |||
| 10 | struct ip6t_owner_info { | ||
| 11 | __kernel_uid32_t uid; | ||
| 12 | __kernel_gid32_t gid; | ||
| 13 | __kernel_pid_t pid; | ||
| 14 | __kernel_pid_t sid; | ||
| 15 | u_int8_t match, invert; /* flags */ | ||
| 16 | }; | ||
| 17 | |||
| 18 | #endif /*_IPT_OWNER_H*/ | ||
diff --git a/include/linux/netfilter_ipv6/ip6t_physdev.h b/include/linux/netfilter_ipv6/ip6t_physdev.h deleted file mode 100644 index c161c0a81b55..000000000000 --- a/include/linux/netfilter_ipv6/ip6t_physdev.h +++ /dev/null | |||
| @@ -1,17 +0,0 @@ | |||
| 1 | #ifndef _IP6T_PHYSDEV_H | ||
| 2 | #define _IP6T_PHYSDEV_H | ||
| 3 | |||
| 4 | /* Backwards compatibility for old userspace */ | ||
| 5 | |||
| 6 | #include <linux/netfilter/xt_physdev.h> | ||
| 7 | |||
| 8 | #define IP6T_PHYSDEV_OP_IN XT_PHYSDEV_OP_IN | ||
| 9 | #define IP6T_PHYSDEV_OP_OUT XT_PHYSDEV_OP_OUT | ||
| 10 | #define IP6T_PHYSDEV_OP_BRIDGED XT_PHYSDEV_OP_BRIDGED | ||
| 11 | #define IP6T_PHYSDEV_OP_ISIN XT_PHYSDEV_OP_ISIN | ||
| 12 | #define IP6T_PHYSDEV_OP_ISOUT XT_PHYSDEV_OP_ISOUT | ||
| 13 | #define IP6T_PHYSDEV_OP_MASK XT_PHYSDEV_OP_MASK | ||
| 14 | |||
| 15 | #define ip6t_physdev_info xt_physdev_info | ||
| 16 | |||
| 17 | #endif /*_IP6T_PHYSDEV_H*/ | ||
diff --git a/include/linux/netfilter_ipv6/ip6t_policy.h b/include/linux/netfilter_ipv6/ip6t_policy.h deleted file mode 100644 index b1c449d7ec89..000000000000 --- a/include/linux/netfilter_ipv6/ip6t_policy.h +++ /dev/null | |||
| @@ -1,23 +0,0 @@ | |||
| 1 | #ifndef _IP6T_POLICY_H | ||
| 2 | #define _IP6T_POLICY_H | ||
| 3 | |||
| 4 | #include <linux/netfilter/xt_policy.h> | ||
| 5 | |||
| 6 | #define IP6T_POLICY_MAX_ELEM XT_POLICY_MAX_ELEM | ||
| 7 | |||
| 8 | /* ip6t_policy_flags */ | ||
| 9 | #define IP6T_POLICY_MATCH_IN XT_POLICY_MATCH_IN | ||
| 10 | #define IP6T_POLICY_MATCH_OUT XT_POLICY_MATCH_OUT | ||
| 11 | #define IP6T_POLICY_MATCH_NONE XT_POLICY_MATCH_NONE | ||
| 12 | #define IP6T_POLICY_MATCH_STRICT XT_POLICY_MATCH_STRICT | ||
| 13 | |||
| 14 | /* ip6t_policy_modes */ | ||
| 15 | #define IP6T_POLICY_MODE_TRANSPORT XT_POLICY_MODE_TRANSPORT | ||
| 16 | #define IP6T_POLICY_MODE_TUNNEL XT_POLICY_MODE_TUNNEL | ||
| 17 | |||
| 18 | #define ip6t_policy_spec xt_policy_spec | ||
| 19 | #define ip6t_policy_addr xt_policy_addr | ||
| 20 | #define ip6t_policy_elem xt_policy_elem | ||
| 21 | #define ip6t_policy_info xt_policy_info | ||
| 22 | |||
| 23 | #endif /* _IP6T_POLICY_H */ | ||
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index 5ba398e90304..ab5d3126831f 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
| @@ -176,13 +176,18 @@ struct netlink_skb_parms | |||
| 176 | #define NETLINK_CREDS(skb) (&NETLINK_CB((skb)).creds) | 176 | #define NETLINK_CREDS(skb) (&NETLINK_CB((skb)).creds) |
| 177 | 177 | ||
| 178 | 178 | ||
| 179 | extern void netlink_table_grab(void); | ||
| 180 | extern void netlink_table_ungrab(void); | ||
| 181 | |||
| 179 | extern struct sock *netlink_kernel_create(struct net *net, | 182 | extern struct sock *netlink_kernel_create(struct net *net, |
| 180 | int unit,unsigned int groups, | 183 | int unit,unsigned int groups, |
| 181 | void (*input)(struct sk_buff *skb), | 184 | void (*input)(struct sk_buff *skb), |
| 182 | struct mutex *cb_mutex, | 185 | struct mutex *cb_mutex, |
| 183 | struct module *module); | 186 | struct module *module); |
| 184 | extern void netlink_kernel_release(struct sock *sk); | 187 | extern void netlink_kernel_release(struct sock *sk); |
| 188 | extern int __netlink_change_ngroups(struct sock *sk, unsigned int groups); | ||
| 185 | extern int netlink_change_ngroups(struct sock *sk, unsigned int groups); | 189 | extern int netlink_change_ngroups(struct sock *sk, unsigned int groups); |
| 190 | extern void __netlink_clear_multicast_users(struct sock *sk, unsigned int group); | ||
| 186 | extern void netlink_clear_multicast_users(struct sock *sk, unsigned int group); | 191 | extern void netlink_clear_multicast_users(struct sock *sk, unsigned int group); |
| 187 | extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err); | 192 | extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err); |
| 188 | extern int netlink_has_listeners(struct sock *sk, unsigned int group); | 193 | extern int netlink_has_listeners(struct sock *sk, unsigned int group); |
| @@ -217,12 +222,13 @@ int netlink_sendskb(struct sock *sk, struct sk_buff *skb); | |||
| 217 | 222 | ||
| 218 | struct netlink_callback | 223 | struct netlink_callback |
| 219 | { | 224 | { |
| 220 | struct sk_buff *skb; | 225 | struct sk_buff *skb; |
| 221 | struct nlmsghdr *nlh; | 226 | const struct nlmsghdr *nlh; |
| 222 | int (*dump)(struct sk_buff * skb, struct netlink_callback *cb); | 227 | int (*dump)(struct sk_buff * skb, |
| 223 | int (*done)(struct netlink_callback *cb); | 228 | struct netlink_callback *cb); |
| 224 | int family; | 229 | int (*done)(struct netlink_callback *cb); |
| 225 | long args[6]; | 230 | int family; |
| 231 | long args[6]; | ||
| 226 | }; | 232 | }; |
| 227 | 233 | ||
| 228 | struct netlink_notify | 234 | struct netlink_notify |
| @@ -258,7 +264,7 @@ __nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len, int flags) | |||
| 258 | NLMSG_NEW(skb, pid, seq, type, len, 0) | 264 | NLMSG_NEW(skb, pid, seq, type, len, 0) |
| 259 | 265 | ||
| 260 | extern int netlink_dump_start(struct sock *ssk, struct sk_buff *skb, | 266 | extern int netlink_dump_start(struct sock *ssk, struct sk_buff *skb, |
| 261 | struct nlmsghdr *nlh, | 267 | const struct nlmsghdr *nlh, |
| 262 | int (*dump)(struct sk_buff *skb, struct netlink_callback*), | 268 | int (*dump)(struct sk_buff *skb, struct netlink_callback*), |
| 263 | int (*done)(struct netlink_callback*)); | 269 | int (*done)(struct netlink_callback*)); |
| 264 | 270 | ||
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index 33b283601f62..c4c060208109 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h | |||
| @@ -234,7 +234,7 @@ enum nfs_opnum4 { | |||
| 234 | Needs to be updated if more operations are defined in future.*/ | 234 | Needs to be updated if more operations are defined in future.*/ |
| 235 | 235 | ||
| 236 | #define FIRST_NFS4_OP OP_ACCESS | 236 | #define FIRST_NFS4_OP OP_ACCESS |
| 237 | #define LAST_NFS4_OP OP_RELEASE_LOCKOWNER | 237 | #define LAST_NFS4_OP OP_RECLAIM_COMPLETE |
| 238 | 238 | ||
| 239 | enum nfsstat4 { | 239 | enum nfsstat4 { |
| 240 | NFS4_OK = 0, | 240 | NFS4_OK = 0, |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index f6b90240dd41..d09db1bc9083 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
| @@ -40,7 +40,6 @@ | |||
| 40 | #ifdef __KERNEL__ | 40 | #ifdef __KERNEL__ |
| 41 | 41 | ||
| 42 | #include <linux/in.h> | 42 | #include <linux/in.h> |
| 43 | #include <linux/kref.h> | ||
| 44 | #include <linux/mm.h> | 43 | #include <linux/mm.h> |
| 45 | #include <linux/pagemap.h> | 44 | #include <linux/pagemap.h> |
| 46 | #include <linux/rbtree.h> | 45 | #include <linux/rbtree.h> |
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h index 2b49d676d0c9..510ffdd5020e 100644 --- a/include/linux/nfsd/nfsd.h +++ b/include/linux/nfsd/nfsd.h | |||
| @@ -56,8 +56,11 @@ extern struct svc_version nfsd_version2, nfsd_version3, | |||
| 56 | extern u32 nfsd_supported_minorversion; | 56 | extern u32 nfsd_supported_minorversion; |
| 57 | extern struct mutex nfsd_mutex; | 57 | extern struct mutex nfsd_mutex; |
| 58 | extern struct svc_serv *nfsd_serv; | 58 | extern struct svc_serv *nfsd_serv; |
| 59 | extern spinlock_t nfsd_drc_lock; | ||
| 60 | extern unsigned int nfsd_drc_max_mem; | ||
| 61 | extern unsigned int nfsd_drc_mem_used; | ||
| 59 | 62 | ||
| 60 | extern struct seq_operations nfs_exports_op; | 63 | extern const struct seq_operations nfs_exports_op; |
| 61 | 64 | ||
| 62 | /* | 65 | /* |
| 63 | * Function prototypes. | 66 | * Function prototypes. |
| @@ -163,7 +166,7 @@ extern int nfsd_max_blksize; | |||
| 163 | extern unsigned int max_delegations; | 166 | extern unsigned int max_delegations; |
| 164 | int nfs4_state_init(void); | 167 | int nfs4_state_init(void); |
| 165 | void nfsd4_free_slabs(void); | 168 | void nfsd4_free_slabs(void); |
| 166 | void nfs4_state_start(void); | 169 | int nfs4_state_start(void); |
| 167 | void nfs4_state_shutdown(void); | 170 | void nfs4_state_shutdown(void); |
| 168 | time_t nfs4_lease_time(void); | 171 | time_t nfs4_lease_time(void); |
| 169 | void nfs4_reset_lease(time_t leasetime); | 172 | void nfs4_reset_lease(time_t leasetime); |
| @@ -171,7 +174,7 @@ int nfs4_reset_recoverydir(char *recdir); | |||
| 171 | #else | 174 | #else |
| 172 | static inline int nfs4_state_init(void) { return 0; } | 175 | static inline int nfs4_state_init(void) { return 0; } |
| 173 | static inline void nfsd4_free_slabs(void) { } | 176 | static inline void nfsd4_free_slabs(void) { } |
| 174 | static inline void nfs4_state_start(void) { } | 177 | static inline int nfs4_state_start(void) { return 0; } |
| 175 | static inline void nfs4_state_shutdown(void) { } | 178 | static inline void nfs4_state_shutdown(void) { } |
| 176 | static inline time_t nfs4_lease_time(void) { return 0; } | 179 | static inline time_t nfs4_lease_time(void) { return 0; } |
| 177 | static inline void nfs4_reset_lease(time_t leasetime) { } | 180 | static inline void nfs4_reset_lease(time_t leasetime) { } |
diff --git a/include/linux/nfsd/state.h b/include/linux/nfsd/state.h index 57ab2ed08459..b38d11324189 100644 --- a/include/linux/nfsd/state.h +++ b/include/linux/nfsd/state.h | |||
| @@ -60,6 +60,12 @@ typedef struct { | |||
| 60 | #define si_stateownerid si_opaque.so_stateownerid | 60 | #define si_stateownerid si_opaque.so_stateownerid |
| 61 | #define si_fileid si_opaque.so_fileid | 61 | #define si_fileid si_opaque.so_fileid |
| 62 | 62 | ||
| 63 | struct nfsd4_cb_sequence { | ||
| 64 | /* args/res */ | ||
| 65 | u32 cbs_minorversion; | ||
| 66 | struct nfs4_client *cbs_clp; | ||
| 67 | }; | ||
| 68 | |||
| 63 | struct nfs4_delegation { | 69 | struct nfs4_delegation { |
| 64 | struct list_head dl_perfile; | 70 | struct list_head dl_perfile; |
| 65 | struct list_head dl_perclnt; | 71 | struct list_head dl_perclnt; |
| @@ -81,38 +87,35 @@ struct nfs4_delegation { | |||
| 81 | /* client delegation callback info */ | 87 | /* client delegation callback info */ |
| 82 | struct nfs4_cb_conn { | 88 | struct nfs4_cb_conn { |
| 83 | /* SETCLIENTID info */ | 89 | /* SETCLIENTID info */ |
| 84 | u32 cb_addr; | 90 | struct sockaddr_storage cb_addr; |
| 85 | unsigned short cb_port; | 91 | size_t cb_addrlen; |
| 86 | u32 cb_prog; | 92 | u32 cb_prog; |
| 87 | u32 cb_minorversion; | 93 | u32 cb_minorversion; |
| 88 | u32 cb_ident; /* minorversion 0 only */ | 94 | u32 cb_ident; /* minorversion 0 only */ |
| 89 | /* RPC client info */ | 95 | /* RPC client info */ |
| 90 | atomic_t cb_set; /* successful CB_NULL call */ | 96 | atomic_t cb_set; /* successful CB_NULL call */ |
| 91 | struct rpc_clnt * cb_client; | 97 | struct rpc_clnt * cb_client; |
| 92 | struct rpc_cred * cb_cred; | ||
| 93 | }; | 98 | }; |
| 94 | 99 | ||
| 95 | /* Maximum number of slots per session. 128 is useful for long haul TCP */ | 100 | /* Maximum number of slots per session. 160 is useful for long haul TCP */ |
| 96 | #define NFSD_MAX_SLOTS_PER_SESSION 128 | 101 | #define NFSD_MAX_SLOTS_PER_SESSION 160 |
| 97 | /* Maximum number of pages per slot cache entry */ | ||
| 98 | #define NFSD_PAGES_PER_SLOT 1 | ||
| 99 | /* Maximum number of operations per session compound */ | 102 | /* Maximum number of operations per session compound */ |
| 100 | #define NFSD_MAX_OPS_PER_COMPOUND 16 | 103 | #define NFSD_MAX_OPS_PER_COMPOUND 16 |
| 101 | 104 | /* Maximum session per slot cache size */ | |
| 102 | struct nfsd4_cache_entry { | 105 | #define NFSD_SLOT_CACHE_SIZE 1024 |
| 103 | __be32 ce_status; | 106 | /* Maximum number of NFSD_SLOT_CACHE_SIZE slots per session */ |
| 104 | struct kvec ce_datav; /* encoded NFSv4.1 data in rq_res.head[0] */ | 107 | #define NFSD_CACHE_SIZE_SLOTS_PER_SESSION 32 |
| 105 | struct page *ce_respages[NFSD_PAGES_PER_SLOT + 1]; | 108 | #define NFSD_MAX_MEM_PER_SESSION \ |
| 106 | int ce_cachethis; | 109 | (NFSD_CACHE_SIZE_SLOTS_PER_SESSION * NFSD_SLOT_CACHE_SIZE) |
| 107 | short ce_resused; | ||
| 108 | int ce_opcnt; | ||
| 109 | int ce_rpchdrlen; | ||
| 110 | }; | ||
| 111 | 110 | ||
| 112 | struct nfsd4_slot { | 111 | struct nfsd4_slot { |
| 113 | bool sl_inuse; | 112 | bool sl_inuse; |
| 114 | u32 sl_seqid; | 113 | bool sl_cachethis; |
| 115 | struct nfsd4_cache_entry sl_cache_entry; | 114 | u16 sl_opcnt; |
| 115 | u32 sl_seqid; | ||
| 116 | __be32 sl_status; | ||
| 117 | u32 sl_datalen; | ||
| 118 | char sl_data[]; | ||
| 116 | }; | 119 | }; |
| 117 | 120 | ||
| 118 | struct nfsd4_channel_attrs { | 121 | struct nfsd4_channel_attrs { |
| @@ -126,6 +129,25 @@ struct nfsd4_channel_attrs { | |||
| 126 | u32 rdma_attrs; | 129 | u32 rdma_attrs; |
| 127 | }; | 130 | }; |
| 128 | 131 | ||
| 132 | struct nfsd4_create_session { | ||
| 133 | clientid_t clientid; | ||
| 134 | struct nfs4_sessionid sessionid; | ||
| 135 | u32 seqid; | ||
| 136 | u32 flags; | ||
| 137 | struct nfsd4_channel_attrs fore_channel; | ||
| 138 | struct nfsd4_channel_attrs back_channel; | ||
| 139 | u32 callback_prog; | ||
| 140 | u32 uid; | ||
| 141 | u32 gid; | ||
| 142 | }; | ||
| 143 | |||
| 144 | /* The single slot clientid cache structure */ | ||
| 145 | struct nfsd4_clid_slot { | ||
| 146 | u32 sl_seqid; | ||
| 147 | __be32 sl_status; | ||
| 148 | struct nfsd4_create_session sl_cr_ses; | ||
| 149 | }; | ||
| 150 | |||
| 129 | struct nfsd4_session { | 151 | struct nfsd4_session { |
| 130 | struct kref se_ref; | 152 | struct kref se_ref; |
| 131 | struct list_head se_hash; /* hash by sessionid */ | 153 | struct list_head se_hash; /* hash by sessionid */ |
| @@ -135,7 +157,7 @@ struct nfsd4_session { | |||
| 135 | struct nfs4_sessionid se_sessionid; | 157 | struct nfs4_sessionid se_sessionid; |
| 136 | struct nfsd4_channel_attrs se_fchannel; | 158 | struct nfsd4_channel_attrs se_fchannel; |
| 137 | struct nfsd4_channel_attrs se_bchannel; | 159 | struct nfsd4_channel_attrs se_bchannel; |
| 138 | struct nfsd4_slot se_slots[]; /* forward channel slots */ | 160 | struct nfsd4_slot *se_slots[]; /* forward channel slots */ |
| 139 | }; | 161 | }; |
| 140 | 162 | ||
| 141 | static inline void | 163 | static inline void |
| @@ -180,7 +202,7 @@ struct nfs4_client { | |||
| 180 | char cl_recdir[HEXDIR_LEN]; /* recovery dir */ | 202 | char cl_recdir[HEXDIR_LEN]; /* recovery dir */ |
| 181 | nfs4_verifier cl_verifier; /* generated by client */ | 203 | nfs4_verifier cl_verifier; /* generated by client */ |
| 182 | time_t cl_time; /* time of last lease renewal */ | 204 | time_t cl_time; /* time of last lease renewal */ |
| 183 | __be32 cl_addr; /* client ipaddress */ | 205 | struct sockaddr_storage cl_addr; /* client ipaddress */ |
| 184 | u32 cl_flavor; /* setclientid pseudoflavor */ | 206 | u32 cl_flavor; /* setclientid pseudoflavor */ |
| 185 | char *cl_principal; /* setclientid principal name */ | 207 | char *cl_principal; /* setclientid principal name */ |
| 186 | struct svc_cred cl_cred; /* setclientid principal */ | 208 | struct svc_cred cl_cred; /* setclientid principal */ |
| @@ -192,9 +214,17 @@ struct nfs4_client { | |||
| 192 | 214 | ||
| 193 | /* for nfs41 */ | 215 | /* for nfs41 */ |
| 194 | struct list_head cl_sessions; | 216 | struct list_head cl_sessions; |
| 195 | struct nfsd4_slot cl_slot; /* create_session slot */ | 217 | struct nfsd4_clid_slot cl_cs_slot; /* create_session slot */ |
| 196 | u32 cl_exchange_flags; | 218 | u32 cl_exchange_flags; |
| 197 | struct nfs4_sessionid cl_sessionid; | 219 | struct nfs4_sessionid cl_sessionid; |
| 220 | |||
| 221 | /* for nfs41 callbacks */ | ||
| 222 | /* We currently support a single back channel with a single slot */ | ||
| 223 | unsigned long cl_cb_slot_busy; | ||
| 224 | u32 cl_cb_seq_nr; | ||
| 225 | struct svc_xprt *cl_cb_xprt; /* 4.1 callback transport */ | ||
| 226 | struct rpc_wait_queue cl_cb_waitq; /* backchannel callers may */ | ||
| 227 | /* wait here for slots */ | ||
| 198 | }; | 228 | }; |
| 199 | 229 | ||
| 200 | /* struct nfs4_client_reset | 230 | /* struct nfs4_client_reset |
| @@ -345,6 +375,7 @@ extern int nfs4_in_grace(void); | |||
| 345 | extern __be32 nfs4_check_open_reclaim(clientid_t *clid); | 375 | extern __be32 nfs4_check_open_reclaim(clientid_t *clid); |
| 346 | extern void put_nfs4_client(struct nfs4_client *clp); | 376 | extern void put_nfs4_client(struct nfs4_client *clp); |
| 347 | extern void nfs4_free_stateowner(struct kref *kref); | 377 | extern void nfs4_free_stateowner(struct kref *kref); |
| 378 | extern int set_callback_cred(void); | ||
| 348 | extern void nfsd4_probe_callback(struct nfs4_client *clp); | 379 | extern void nfsd4_probe_callback(struct nfs4_client *clp); |
| 349 | extern void nfsd4_cb_recall(struct nfs4_delegation *dp); | 380 | extern void nfsd4_cb_recall(struct nfs4_delegation *dp); |
| 350 | extern void nfs4_put_delegation(struct nfs4_delegation *dp); | 381 | extern void nfs4_put_delegation(struct nfs4_delegation *dp); |
diff --git a/include/linux/nfsd/xdr4.h b/include/linux/nfsd/xdr4.h index 2bacf7535069..73164c2b3d29 100644 --- a/include/linux/nfsd/xdr4.h +++ b/include/linux/nfsd/xdr4.h | |||
| @@ -51,7 +51,7 @@ struct nfsd4_compound_state { | |||
| 51 | /* For sessions DRC */ | 51 | /* For sessions DRC */ |
| 52 | struct nfsd4_session *session; | 52 | struct nfsd4_session *session; |
| 53 | struct nfsd4_slot *slot; | 53 | struct nfsd4_slot *slot; |
| 54 | __be32 *statp; | 54 | __be32 *datap; |
| 55 | size_t iovlen; | 55 | size_t iovlen; |
| 56 | u32 minorversion; | 56 | u32 minorversion; |
| 57 | u32 status; | 57 | u32 status; |
| @@ -366,18 +366,6 @@ struct nfsd4_exchange_id { | |||
| 366 | int spa_how; | 366 | int spa_how; |
| 367 | }; | 367 | }; |
| 368 | 368 | ||
| 369 | struct nfsd4_create_session { | ||
| 370 | clientid_t clientid; | ||
| 371 | struct nfs4_sessionid sessionid; | ||
| 372 | u32 seqid; | ||
| 373 | u32 flags; | ||
| 374 | struct nfsd4_channel_attrs fore_channel; | ||
| 375 | struct nfsd4_channel_attrs back_channel; | ||
| 376 | u32 callback_prog; | ||
| 377 | u32 uid; | ||
| 378 | u32 gid; | ||
| 379 | }; | ||
| 380 | |||
| 381 | struct nfsd4_sequence { | 369 | struct nfsd4_sequence { |
| 382 | struct nfs4_sessionid sessionid; /* request/response */ | 370 | struct nfs4_sessionid sessionid; /* request/response */ |
| 383 | u32 seqid; /* request/response */ | 371 | u32 seqid; /* request/response */ |
| @@ -479,13 +467,12 @@ struct nfsd4_compoundres { | |||
| 479 | static inline bool nfsd4_is_solo_sequence(struct nfsd4_compoundres *resp) | 467 | static inline bool nfsd4_is_solo_sequence(struct nfsd4_compoundres *resp) |
| 480 | { | 468 | { |
| 481 | struct nfsd4_compoundargs *args = resp->rqstp->rq_argp; | 469 | struct nfsd4_compoundargs *args = resp->rqstp->rq_argp; |
| 482 | return args->opcnt == 1; | 470 | return resp->opcnt == 1 && args->ops[0].opnum == OP_SEQUENCE; |
| 483 | } | 471 | } |
| 484 | 472 | ||
| 485 | static inline bool nfsd4_not_cached(struct nfsd4_compoundres *resp) | 473 | static inline bool nfsd4_not_cached(struct nfsd4_compoundres *resp) |
| 486 | { | 474 | { |
| 487 | return !resp->cstate.slot->sl_cache_entry.ce_cachethis || | 475 | return !resp->cstate.slot->sl_cachethis || nfsd4_is_solo_sequence(resp); |
| 488 | nfsd4_is_solo_sequence(resp); | ||
| 489 | } | 476 | } |
| 490 | 477 | ||
| 491 | #define NFS4_SVC_XDRSIZE sizeof(struct nfsd4_compoundargs) | 478 | #define NFS4_SVC_XDRSIZE sizeof(struct nfsd4_compoundargs) |
diff --git a/include/linux/nilfs2_fs.h b/include/linux/nilfs2_fs.h index 79fec6af3f9f..ce520402e840 100644 --- a/include/linux/nilfs2_fs.h +++ b/include/linux/nilfs2_fs.h | |||
| @@ -425,15 +425,6 @@ struct nilfs_dat_entry { | |||
| 425 | }; | 425 | }; |
| 426 | 426 | ||
| 427 | /** | 427 | /** |
| 428 | * struct nilfs_dat_group_desc - block group descriptor | ||
| 429 | * @dg_nfrees: number of free virtual block numbers in block group | ||
| 430 | */ | ||
| 431 | struct nilfs_dat_group_desc { | ||
| 432 | __le32 dg_nfrees; | ||
| 433 | }; | ||
| 434 | |||
| 435 | |||
| 436 | /** | ||
| 437 | * struct nilfs_snapshot_list - snapshot list | 428 | * struct nilfs_snapshot_list - snapshot list |
| 438 | * @ssl_next: next checkpoint number on snapshot list | 429 | * @ssl_next: next checkpoint number on snapshot list |
| 439 | * @ssl_prev: previous checkpoint number on snapshot list | 430 | * @ssl_prev: previous checkpoint number on snapshot list |
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h index dbea93b694e5..a8d71ed43a0e 100644 --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h | |||
| @@ -242,6 +242,29 @@ | |||
| 242 | * @NL80211_CMD_LEAVE_IBSS: Leave the IBSS -- no special arguments, the IBSS is | 242 | * @NL80211_CMD_LEAVE_IBSS: Leave the IBSS -- no special arguments, the IBSS is |
| 243 | * determined by the network interface. | 243 | * determined by the network interface. |
| 244 | * | 244 | * |
| 245 | * @NL80211_CMD_TESTMODE: testmode command, takes a wiphy (or ifindex) attribute | ||
| 246 | * to identify the device, and the TESTDATA blob attribute to pass through | ||
| 247 | * to the driver. | ||
| 248 | * | ||
| 249 | * @NL80211_CMD_CONNECT: connection request and notification; this command | ||
| 250 | * requests to connect to a specified network but without separating | ||
| 251 | * auth and assoc steps. For this, you need to specify the SSID in a | ||
| 252 | * %NL80211_ATTR_SSID attribute, and can optionally specify the association | ||
| 253 | * IEs in %NL80211_ATTR_IE, %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_MAC, | ||
| 254 | * %NL80211_ATTR_WIPHY_FREQ and %NL80211_ATTR_CONTROL_PORT. | ||
| 255 | * It is also sent as an event, with the BSSID and response IEs when the | ||
| 256 | * connection is established or failed to be established. This can be | ||
| 257 | * determined by the STATUS_CODE attribute. | ||
| 258 | * @NL80211_CMD_ROAM: request that the card roam (currently not implemented), | ||
| 259 | * sent as an event when the card/driver roamed by itself. | ||
| 260 | * @NL80211_CMD_DISCONNECT: drop a given connection; also used to notify | ||
| 261 | * userspace that a connection was dropped by the AP or due to other | ||
| 262 | * reasons, for this the %NL80211_ATTR_DISCONNECTED_BY_AP and | ||
| 263 | * %NL80211_ATTR_REASON_CODE attributes are used. | ||
| 264 | * | ||
| 265 | * @NL80211_CMD_SET_WIPHY_NETNS: Set a wiphy's netns. Note that all devices | ||
| 266 | * associated with this wiphy must be down and will follow. | ||
| 267 | * | ||
| 245 | * @NL80211_CMD_MAX: highest used command number | 268 | * @NL80211_CMD_MAX: highest used command number |
| 246 | * @__NL80211_CMD_AFTER_LAST: internal use | 269 | * @__NL80211_CMD_AFTER_LAST: internal use |
| 247 | */ | 270 | */ |
| @@ -310,6 +333,14 @@ enum nl80211_commands { | |||
| 310 | NL80211_CMD_JOIN_IBSS, | 333 | NL80211_CMD_JOIN_IBSS, |
| 311 | NL80211_CMD_LEAVE_IBSS, | 334 | NL80211_CMD_LEAVE_IBSS, |
| 312 | 335 | ||
| 336 | NL80211_CMD_TESTMODE, | ||
| 337 | |||
| 338 | NL80211_CMD_CONNECT, | ||
| 339 | NL80211_CMD_ROAM, | ||
| 340 | NL80211_CMD_DISCONNECT, | ||
| 341 | |||
| 342 | NL80211_CMD_SET_WIPHY_NETNS, | ||
| 343 | |||
| 313 | /* add new commands above here */ | 344 | /* add new commands above here */ |
| 314 | 345 | ||
| 315 | /* used to define NL80211_CMD_MAX below */ | 346 | /* used to define NL80211_CMD_MAX below */ |
| @@ -449,10 +480,6 @@ enum nl80211_commands { | |||
| 449 | * @NL80211_ATTR_SCAN_FREQUENCIES: nested attribute with frequencies (in MHz) | 480 | * @NL80211_ATTR_SCAN_FREQUENCIES: nested attribute with frequencies (in MHz) |
| 450 | * @NL80211_ATTR_SCAN_SSIDS: nested attribute with SSIDs, leave out for passive | 481 | * @NL80211_ATTR_SCAN_SSIDS: nested attribute with SSIDs, leave out for passive |
| 451 | * scanning and include a zero-length SSID (wildcard) for wildcard scan | 482 | * scanning and include a zero-length SSID (wildcard) for wildcard scan |
| 452 | * @NL80211_ATTR_SCAN_GENERATION: the scan generation increases whenever the | ||
| 453 | * scan result list changes (BSS expired or added) so that applications | ||
| 454 | * can verify that they got a single, consistent snapshot (when all dump | ||
| 455 | * messages carried the same generation number) | ||
| 456 | * @NL80211_ATTR_BSS: scan result BSS | 483 | * @NL80211_ATTR_BSS: scan result BSS |
| 457 | * | 484 | * |
| 458 | * @NL80211_ATTR_REG_INITIATOR: indicates who requested the regulatory domain | 485 | * @NL80211_ATTR_REG_INITIATOR: indicates who requested the regulatory domain |
| @@ -511,6 +538,52 @@ enum nl80211_commands { | |||
| 511 | * authorized by user space. Otherwise, port is marked authorized by | 538 | * authorized by user space. Otherwise, port is marked authorized by |
| 512 | * default in station mode. | 539 | * default in station mode. |
| 513 | * | 540 | * |
| 541 | * @NL80211_ATTR_TESTDATA: Testmode data blob, passed through to the driver. | ||
| 542 | * We recommend using nested, driver-specific attributes within this. | ||
| 543 | * | ||
| 544 | * @NL80211_ATTR_DISCONNECTED_BY_AP: A flag indicating that the DISCONNECT | ||
| 545 | * event was due to the AP disconnecting the station, and not due to | ||
| 546 | * a local disconnect request. | ||
| 547 | * @NL80211_ATTR_STATUS_CODE: StatusCode for the %NL80211_CMD_CONNECT | ||
| 548 | * event (u16) | ||
| 549 | * @NL80211_ATTR_PRIVACY: Flag attribute, used with connect(), indicating | ||
| 550 | * that protected APs should be used. | ||
| 551 | * | ||
| 552 | * @NL80211_ATTR_CIPHERS_PAIRWISE: Used with CONNECT and ASSOCIATE to | ||
| 553 | * indicate which unicast key ciphers will be used with the connection | ||
| 554 | * (an array of u32). | ||
| 555 | * @NL80211_ATTR_CIPHER_GROUP: Used with CONNECT and ASSOCIATE to indicate | ||
| 556 | * which group key cipher will be used with the connection (a u32). | ||
| 557 | * @NL80211_ATTR_WPA_VERSIONS: Used with CONNECT and ASSOCIATE to indicate | ||
| 558 | * which WPA version(s) the AP we want to associate with is using | ||
| 559 | * (a u32 with flags from &enum nl80211_wpa_versions). | ||
| 560 | * @NL80211_ATTR_AKM_SUITES: Used with CONNECT and ASSOCIATE to indicate | ||
| 561 | * which key management algorithm(s) to use (an array of u32). | ||
| 562 | * | ||
| 563 | * @NL80211_ATTR_REQ_IE: (Re)association request information elements as | ||
| 564 | * sent out by the card, for ROAM and successful CONNECT events. | ||
| 565 | * @NL80211_ATTR_RESP_IE: (Re)association response information elements as | ||
| 566 | * sent by peer, for ROAM and successful CONNECT events. | ||
| 567 | * | ||
| 568 | * @NL80211_ATTR_PREV_BSSID: previous BSSID, to be used by in ASSOCIATE | ||
| 569 | * commands to specify using a reassociate frame | ||
| 570 | * | ||
| 571 | * @NL80211_ATTR_KEY: key information in a nested attribute with | ||
| 572 | * %NL80211_KEY_* sub-attributes | ||
| 573 | * @NL80211_ATTR_KEYS: array of keys for static WEP keys for connect() | ||
| 574 | * and join_ibss(), key information is in a nested attribute each | ||
| 575 | * with %NL80211_KEY_* sub-attributes | ||
| 576 | * | ||
| 577 | * @NL80211_ATTR_PID: Process ID of a network namespace. | ||
| 578 | * | ||
| 579 | * @NL80211_ATTR_GENERATION: Used to indicate consistent snapshots for | ||
| 580 | * dumps. This number increases whenever the object list being | ||
| 581 | * dumped changes, and as such userspace can verify that it has | ||
| 582 | * obtained a complete and consistent snapshot by verifying that | ||
| 583 | * all dump messages contain the same generation number. If it | ||
| 584 | * changed then the list changed and the dump should be repeated | ||
| 585 | * completely from scratch. | ||
| 586 | * | ||
| 514 | * @NL80211_ATTR_MAX: highest attribute number currently defined | 587 | * @NL80211_ATTR_MAX: highest attribute number currently defined |
| 515 | * @__NL80211_ATTR_AFTER_LAST: internal use | 588 | * @__NL80211_ATTR_AFTER_LAST: internal use |
| 516 | */ | 589 | */ |
| @@ -582,7 +655,7 @@ enum nl80211_attrs { | |||
| 582 | 655 | ||
| 583 | NL80211_ATTR_SCAN_FREQUENCIES, | 656 | NL80211_ATTR_SCAN_FREQUENCIES, |
| 584 | NL80211_ATTR_SCAN_SSIDS, | 657 | NL80211_ATTR_SCAN_SSIDS, |
| 585 | NL80211_ATTR_SCAN_GENERATION, | 658 | NL80211_ATTR_GENERATION, /* replaces old SCAN_GENERATION */ |
| 586 | NL80211_ATTR_BSS, | 659 | NL80211_ATTR_BSS, |
| 587 | 660 | ||
| 588 | NL80211_ATTR_REG_INITIATOR, | 661 | NL80211_ATTR_REG_INITIATOR, |
| @@ -619,16 +692,42 @@ enum nl80211_attrs { | |||
| 619 | 692 | ||
| 620 | NL80211_ATTR_CONTROL_PORT, | 693 | NL80211_ATTR_CONTROL_PORT, |
| 621 | 694 | ||
| 695 | NL80211_ATTR_TESTDATA, | ||
| 696 | |||
| 697 | NL80211_ATTR_PRIVACY, | ||
| 698 | |||
| 699 | NL80211_ATTR_DISCONNECTED_BY_AP, | ||
| 700 | NL80211_ATTR_STATUS_CODE, | ||
| 701 | |||
| 702 | NL80211_ATTR_CIPHER_SUITES_PAIRWISE, | ||
| 703 | NL80211_ATTR_CIPHER_SUITE_GROUP, | ||
| 704 | NL80211_ATTR_WPA_VERSIONS, | ||
| 705 | NL80211_ATTR_AKM_SUITES, | ||
| 706 | |||
| 707 | NL80211_ATTR_REQ_IE, | ||
| 708 | NL80211_ATTR_RESP_IE, | ||
| 709 | |||
| 710 | NL80211_ATTR_PREV_BSSID, | ||
| 711 | |||
| 712 | NL80211_ATTR_KEY, | ||
| 713 | NL80211_ATTR_KEYS, | ||
| 714 | |||
| 715 | NL80211_ATTR_PID, | ||
| 716 | |||
| 622 | /* add attributes here, update the policy in nl80211.c */ | 717 | /* add attributes here, update the policy in nl80211.c */ |
| 623 | 718 | ||
| 624 | __NL80211_ATTR_AFTER_LAST, | 719 | __NL80211_ATTR_AFTER_LAST, |
| 625 | NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1 | 720 | NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1 |
| 626 | }; | 721 | }; |
| 627 | 722 | ||
| 723 | /* source-level API compatibility */ | ||
| 724 | #define NL80211_ATTR_SCAN_GENERATION NL80211_ATTR_GENERATION | ||
| 725 | |||
| 628 | /* | 726 | /* |
| 629 | * Allow user space programs to use #ifdef on new attributes by defining them | 727 | * Allow user space programs to use #ifdef on new attributes by defining them |
| 630 | * here | 728 | * here |
| 631 | */ | 729 | */ |
| 730 | #define NL80211_CMD_CONNECT NL80211_CMD_CONNECT | ||
| 632 | #define NL80211_ATTR_HT_CAPABILITY NL80211_ATTR_HT_CAPABILITY | 731 | #define NL80211_ATTR_HT_CAPABILITY NL80211_ATTR_HT_CAPABILITY |
| 633 | #define NL80211_ATTR_BSS_BASIC_RATES NL80211_ATTR_BSS_BASIC_RATES | 732 | #define NL80211_ATTR_BSS_BASIC_RATES NL80211_ATTR_BSS_BASIC_RATES |
| 634 | #define NL80211_ATTR_WIPHY_TXQ_PARAMS NL80211_ATTR_WIPHY_TXQ_PARAMS | 733 | #define NL80211_ATTR_WIPHY_TXQ_PARAMS NL80211_ATTR_WIPHY_TXQ_PARAMS |
| @@ -642,6 +741,12 @@ enum nl80211_attrs { | |||
| 642 | #define NL80211_ATTR_SSID NL80211_ATTR_SSID | 741 | #define NL80211_ATTR_SSID NL80211_ATTR_SSID |
| 643 | #define NL80211_ATTR_AUTH_TYPE NL80211_ATTR_AUTH_TYPE | 742 | #define NL80211_ATTR_AUTH_TYPE NL80211_ATTR_AUTH_TYPE |
| 644 | #define NL80211_ATTR_REASON_CODE NL80211_ATTR_REASON_CODE | 743 | #define NL80211_ATTR_REASON_CODE NL80211_ATTR_REASON_CODE |
| 744 | #define NL80211_ATTR_CIPHER_SUITES_PAIRWISE NL80211_ATTR_CIPHER_SUITES_PAIRWISE | ||
| 745 | #define NL80211_ATTR_CIPHER_SUITE_GROUP NL80211_ATTR_CIPHER_SUITE_GROUP | ||
| 746 | #define NL80211_ATTR_WPA_VERSIONS NL80211_ATTR_WPA_VERSIONS | ||
| 747 | #define NL80211_ATTR_AKM_SUITES NL80211_ATTR_AKM_SUITES | ||
| 748 | #define NL80211_ATTR_KEY NL80211_ATTR_KEY | ||
| 749 | #define NL80211_ATTR_KEYS NL80211_ATTR_KEYS | ||
| 645 | 750 | ||
| 646 | #define NL80211_MAX_SUPP_RATES 32 | 751 | #define NL80211_MAX_SUPP_RATES 32 |
| 647 | #define NL80211_MAX_SUPP_REG_RULES 32 | 752 | #define NL80211_MAX_SUPP_REG_RULES 32 |
| @@ -650,6 +755,9 @@ enum nl80211_attrs { | |||
| 650 | #define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY 24 | 755 | #define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY 24 |
| 651 | #define NL80211_HT_CAPABILITY_LEN 26 | 756 | #define NL80211_HT_CAPABILITY_LEN 26 |
| 652 | 757 | ||
| 758 | #define NL80211_MAX_NR_CIPHER_SUITES 5 | ||
| 759 | #define NL80211_MAX_NR_AKM_SUITES 2 | ||
| 760 | |||
| 653 | /** | 761 | /** |
| 654 | * enum nl80211_iftype - (virtual) interface types | 762 | * enum nl80211_iftype - (virtual) interface types |
| 655 | * | 763 | * |
| @@ -1168,6 +1276,7 @@ enum nl80211_channel_type { | |||
| 1168 | * in mBm (100 * dBm) (s32) | 1276 | * in mBm (100 * dBm) (s32) |
| 1169 | * @NL80211_BSS_SIGNAL_UNSPEC: signal strength of the probe response/beacon | 1277 | * @NL80211_BSS_SIGNAL_UNSPEC: signal strength of the probe response/beacon |
| 1170 | * in unspecified units, scaled to 0..100 (u8) | 1278 | * in unspecified units, scaled to 0..100 (u8) |
| 1279 | * @NL80211_BSS_STATUS: status, if this BSS is "used" | ||
| 1171 | * @__NL80211_BSS_AFTER_LAST: internal | 1280 | * @__NL80211_BSS_AFTER_LAST: internal |
| 1172 | * @NL80211_BSS_MAX: highest BSS attribute | 1281 | * @NL80211_BSS_MAX: highest BSS attribute |
| 1173 | */ | 1282 | */ |
| @@ -1181,6 +1290,7 @@ enum nl80211_bss { | |||
| 1181 | NL80211_BSS_INFORMATION_ELEMENTS, | 1290 | NL80211_BSS_INFORMATION_ELEMENTS, |
| 1182 | NL80211_BSS_SIGNAL_MBM, | 1291 | NL80211_BSS_SIGNAL_MBM, |
| 1183 | NL80211_BSS_SIGNAL_UNSPEC, | 1292 | NL80211_BSS_SIGNAL_UNSPEC, |
| 1293 | NL80211_BSS_STATUS, | ||
| 1184 | 1294 | ||
| 1185 | /* keep last */ | 1295 | /* keep last */ |
| 1186 | __NL80211_BSS_AFTER_LAST, | 1296 | __NL80211_BSS_AFTER_LAST, |
| @@ -1188,18 +1298,37 @@ enum nl80211_bss { | |||
| 1188 | }; | 1298 | }; |
| 1189 | 1299 | ||
| 1190 | /** | 1300 | /** |
| 1301 | * enum nl80211_bss_status - BSS "status" | ||
| 1302 | */ | ||
| 1303 | enum nl80211_bss_status { | ||
| 1304 | NL80211_BSS_STATUS_AUTHENTICATED, | ||
| 1305 | NL80211_BSS_STATUS_ASSOCIATED, | ||
| 1306 | NL80211_BSS_STATUS_IBSS_JOINED, | ||
| 1307 | }; | ||
| 1308 | |||
| 1309 | /** | ||
| 1191 | * enum nl80211_auth_type - AuthenticationType | 1310 | * enum nl80211_auth_type - AuthenticationType |
| 1192 | * | 1311 | * |
| 1193 | * @NL80211_AUTHTYPE_OPEN_SYSTEM: Open System authentication | 1312 | * @NL80211_AUTHTYPE_OPEN_SYSTEM: Open System authentication |
| 1194 | * @NL80211_AUTHTYPE_SHARED_KEY: Shared Key authentication (WEP only) | 1313 | * @NL80211_AUTHTYPE_SHARED_KEY: Shared Key authentication (WEP only) |
| 1195 | * @NL80211_AUTHTYPE_FT: Fast BSS Transition (IEEE 802.11r) | 1314 | * @NL80211_AUTHTYPE_FT: Fast BSS Transition (IEEE 802.11r) |
| 1196 | * @NL80211_AUTHTYPE_NETWORK_EAP: Network EAP (some Cisco APs and mainly LEAP) | 1315 | * @NL80211_AUTHTYPE_NETWORK_EAP: Network EAP (some Cisco APs and mainly LEAP) |
| 1316 | * @__NL80211_AUTHTYPE_NUM: internal | ||
| 1317 | * @NL80211_AUTHTYPE_MAX: maximum valid auth algorithm | ||
| 1318 | * @NL80211_AUTHTYPE_AUTOMATIC: determine automatically (if necessary by | ||
| 1319 | * trying multiple times); this is invalid in netlink -- leave out | ||
| 1320 | * the attribute for this on CONNECT commands. | ||
| 1197 | */ | 1321 | */ |
| 1198 | enum nl80211_auth_type { | 1322 | enum nl80211_auth_type { |
| 1199 | NL80211_AUTHTYPE_OPEN_SYSTEM, | 1323 | NL80211_AUTHTYPE_OPEN_SYSTEM, |
| 1200 | NL80211_AUTHTYPE_SHARED_KEY, | 1324 | NL80211_AUTHTYPE_SHARED_KEY, |
| 1201 | NL80211_AUTHTYPE_FT, | 1325 | NL80211_AUTHTYPE_FT, |
| 1202 | NL80211_AUTHTYPE_NETWORK_EAP, | 1326 | NL80211_AUTHTYPE_NETWORK_EAP, |
| 1327 | |||
| 1328 | /* keep last */ | ||
| 1329 | __NL80211_AUTHTYPE_NUM, | ||
| 1330 | NL80211_AUTHTYPE_MAX = __NL80211_AUTHTYPE_NUM - 1, | ||
| 1331 | NL80211_AUTHTYPE_AUTOMATIC | ||
| 1203 | }; | 1332 | }; |
| 1204 | 1333 | ||
| 1205 | /** | 1334 | /** |
| @@ -1224,4 +1353,39 @@ enum nl80211_mfp { | |||
| 1224 | NL80211_MFP_REQUIRED, | 1353 | NL80211_MFP_REQUIRED, |
| 1225 | }; | 1354 | }; |
| 1226 | 1355 | ||
| 1356 | enum nl80211_wpa_versions { | ||
| 1357 | NL80211_WPA_VERSION_1 = 1 << 0, | ||
| 1358 | NL80211_WPA_VERSION_2 = 1 << 1, | ||
| 1359 | }; | ||
| 1360 | |||
| 1361 | /** | ||
| 1362 | * enum nl80211_key_attributes - key attributes | ||
| 1363 | * @__NL80211_KEY_INVALID: invalid | ||
| 1364 | * @NL80211_KEY_DATA: (temporal) key data; for TKIP this consists of | ||
| 1365 | * 16 bytes encryption key followed by 8 bytes each for TX and RX MIC | ||
| 1366 | * keys | ||
| 1367 | * @NL80211_KEY_IDX: key ID (u8, 0-3) | ||
| 1368 | * @NL80211_KEY_CIPHER: key cipher suite (u32, as defined by IEEE 802.11 | ||
| 1369 | * section 7.3.2.25.1, e.g. 0x000FAC04) | ||
| 1370 | * @NL80211_KEY_SEQ: transmit key sequence number (IV/PN) for TKIP and | ||
| 1371 | * CCMP keys, each six bytes in little endian | ||
| 1372 | * @NL80211_KEY_DEFAULT: flag indicating default key | ||
| 1373 | * @NL80211_KEY_DEFAULT_MGMT: flag indicating default management key | ||
| 1374 | * @__NL80211_KEY_AFTER_LAST: internal | ||
| 1375 | * @NL80211_KEY_MAX: highest key attribute | ||
| 1376 | */ | ||
| 1377 | enum nl80211_key_attributes { | ||
| 1378 | __NL80211_KEY_INVALID, | ||
| 1379 | NL80211_KEY_DATA, | ||
| 1380 | NL80211_KEY_IDX, | ||
| 1381 | NL80211_KEY_CIPHER, | ||
| 1382 | NL80211_KEY_SEQ, | ||
| 1383 | NL80211_KEY_DEFAULT, | ||
| 1384 | NL80211_KEY_DEFAULT_MGMT, | ||
| 1385 | |||
| 1386 | /* keep last */ | ||
| 1387 | __NL80211_KEY_AFTER_LAST, | ||
| 1388 | NL80211_KEY_MAX = __NL80211_KEY_AFTER_LAST - 1 | ||
| 1389 | }; | ||
| 1390 | |||
| 1227 | #endif /* __LINUX_NL80211_H */ | 1391 | #endif /* __LINUX_NL80211_H */ |
diff --git a/include/linux/nl802154.h b/include/linux/nl802154.h index 2cda00ccfcca..b7d9435d5a9f 100644 --- a/include/linux/nl802154.h +++ b/include/linux/nl802154.h | |||
| @@ -64,12 +64,14 @@ enum { | |||
| 64 | IEEE802154_ATTR_COORD_REALIGN, | 64 | IEEE802154_ATTR_COORD_REALIGN, |
| 65 | IEEE802154_ATTR_SEC, | 65 | IEEE802154_ATTR_SEC, |
| 66 | 66 | ||
| 67 | IEEE802154_ATTR_PAGE, | ||
| 68 | |||
| 67 | __IEEE802154_ATTR_MAX, | 69 | __IEEE802154_ATTR_MAX, |
| 68 | }; | 70 | }; |
| 69 | 71 | ||
| 70 | #define IEEE802154_ATTR_MAX (__IEEE802154_ATTR_MAX - 1) | 72 | #define IEEE802154_ATTR_MAX (__IEEE802154_ATTR_MAX - 1) |
| 71 | 73 | ||
| 72 | extern struct nla_policy ieee802154_policy[]; | 74 | extern const struct nla_policy ieee802154_policy[]; |
| 73 | 75 | ||
| 74 | /* commands */ | 76 | /* commands */ |
| 75 | /* REQ should be responded with CONF | 77 | /* REQ should be responded with CONF |
| @@ -111,6 +113,8 @@ enum { | |||
| 111 | IEEE802154_RX_ENABLE_REQ, /* Not supported yet */ | 113 | IEEE802154_RX_ENABLE_REQ, /* Not supported yet */ |
| 112 | IEEE802154_RX_ENABLE_CONF, /* Not supported yet */ | 114 | IEEE802154_RX_ENABLE_CONF, /* Not supported yet */ |
| 113 | 115 | ||
| 116 | IEEE802154_LIST_IFACE, | ||
| 117 | |||
| 114 | __IEEE802154_CMD_MAX, | 118 | __IEEE802154_CMD_MAX, |
| 115 | }; | 119 | }; |
| 116 | 120 | ||
diff --git a/include/linux/notifier.h b/include/linux/notifier.h index 81bc252dc8ac..44428d247dbe 100644 --- a/include/linux/notifier.h +++ b/include/linux/notifier.h | |||
| @@ -199,6 +199,8 @@ static inline int notifier_to_errno(int ret) | |||
| 199 | #define NETDEV_FEAT_CHANGE 0x000B | 199 | #define NETDEV_FEAT_CHANGE 0x000B |
| 200 | #define NETDEV_BONDING_FAILOVER 0x000C | 200 | #define NETDEV_BONDING_FAILOVER 0x000C |
| 201 | #define NETDEV_PRE_UP 0x000D | 201 | #define NETDEV_PRE_UP 0x000D |
| 202 | #define NETDEV_BONDING_OLDTYPE 0x000E | ||
| 203 | #define NETDEV_BONDING_NEWTYPE 0x000F | ||
| 202 | 204 | ||
| 203 | #define SYS_DOWN 0x0001 /* Notify of system down */ | 205 | #define SYS_DOWN 0x0001 /* Notify of system down */ |
| 204 | #define SYS_RESTART SYS_DOWN | 206 | #define SYS_RESTART SYS_DOWN |
diff --git a/include/linux/oom.h b/include/linux/oom.h index a7979baf1e39..6aac5fe4f6f1 100644 --- a/include/linux/oom.h +++ b/include/linux/oom.h | |||
| @@ -30,5 +30,16 @@ extern void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, int order); | |||
| 30 | extern int register_oom_notifier(struct notifier_block *nb); | 30 | extern int register_oom_notifier(struct notifier_block *nb); |
| 31 | extern int unregister_oom_notifier(struct notifier_block *nb); | 31 | extern int unregister_oom_notifier(struct notifier_block *nb); |
| 32 | 32 | ||
| 33 | extern bool oom_killer_disabled; | ||
| 34 | |||
| 35 | static inline void oom_killer_disable(void) | ||
| 36 | { | ||
| 37 | oom_killer_disabled = true; | ||
| 38 | } | ||
| 39 | |||
| 40 | static inline void oom_killer_enable(void) | ||
| 41 | { | ||
| 42 | oom_killer_disabled = false; | ||
| 43 | } | ||
| 33 | #endif /* __KERNEL__*/ | 44 | #endif /* __KERNEL__*/ |
| 34 | #endif /* _INCLUDE_LINUX_OOM_H */ | 45 | #endif /* _INCLUDE_LINUX_OOM_H */ |
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index e2e5ce543595..6b202b173955 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
| @@ -51,6 +51,9 @@ | |||
| 51 | * PG_buddy is set to indicate that the page is free and in the buddy system | 51 | * PG_buddy is set to indicate that the page is free and in the buddy system |
| 52 | * (see mm/page_alloc.c). | 52 | * (see mm/page_alloc.c). |
| 53 | * | 53 | * |
| 54 | * PG_hwpoison indicates that a page got corrupted in hardware and contains | ||
| 55 | * data with incorrect ECC bits that triggered a machine check. Accessing is | ||
| 56 | * not safe since it may cause another machine check. Don't touch! | ||
| 54 | */ | 57 | */ |
| 55 | 58 | ||
| 56 | /* | 59 | /* |
| @@ -99,9 +102,12 @@ enum pageflags { | |||
| 99 | #ifdef CONFIG_HAVE_MLOCKED_PAGE_BIT | 102 | #ifdef CONFIG_HAVE_MLOCKED_PAGE_BIT |
| 100 | PG_mlocked, /* Page is vma mlocked */ | 103 | PG_mlocked, /* Page is vma mlocked */ |
| 101 | #endif | 104 | #endif |
| 102 | #ifdef CONFIG_IA64_UNCACHED_ALLOCATOR | 105 | #ifdef CONFIG_ARCH_USES_PG_UNCACHED |
| 103 | PG_uncached, /* Page has been mapped as uncached */ | 106 | PG_uncached, /* Page has been mapped as uncached */ |
| 104 | #endif | 107 | #endif |
| 108 | #ifdef CONFIG_MEMORY_FAILURE | ||
| 109 | PG_hwpoison, /* hardware poisoned page. Don't touch */ | ||
| 110 | #endif | ||
| 105 | __NR_PAGEFLAGS, | 111 | __NR_PAGEFLAGS, |
| 106 | 112 | ||
| 107 | /* Filesystems */ | 113 | /* Filesystems */ |
| @@ -158,6 +164,9 @@ static inline int TestSetPage##uname(struct page *page) \ | |||
| 158 | static inline int TestClearPage##uname(struct page *page) \ | 164 | static inline int TestClearPage##uname(struct page *page) \ |
| 159 | { return test_and_clear_bit(PG_##lname, &page->flags); } | 165 | { return test_and_clear_bit(PG_##lname, &page->flags); } |
| 160 | 166 | ||
| 167 | #define __TESTCLEARFLAG(uname, lname) \ | ||
| 168 | static inline int __TestClearPage##uname(struct page *page) \ | ||
| 169 | { return __test_and_clear_bit(PG_##lname, &page->flags); } | ||
| 161 | 170 | ||
| 162 | #define PAGEFLAG(uname, lname) TESTPAGEFLAG(uname, lname) \ | 171 | #define PAGEFLAG(uname, lname) TESTPAGEFLAG(uname, lname) \ |
| 163 | SETPAGEFLAG(uname, lname) CLEARPAGEFLAG(uname, lname) | 172 | SETPAGEFLAG(uname, lname) CLEARPAGEFLAG(uname, lname) |
| @@ -184,6 +193,9 @@ static inline void __ClearPage##uname(struct page *page) { } | |||
| 184 | #define TESTCLEARFLAG_FALSE(uname) \ | 193 | #define TESTCLEARFLAG_FALSE(uname) \ |
| 185 | static inline int TestClearPage##uname(struct page *page) { return 0; } | 194 | static inline int TestClearPage##uname(struct page *page) { return 0; } |
| 186 | 195 | ||
| 196 | #define __TESTCLEARFLAG_FALSE(uname) \ | ||
| 197 | static inline int __TestClearPage##uname(struct page *page) { return 0; } | ||
| 198 | |||
| 187 | struct page; /* forward declaration */ | 199 | struct page; /* forward declaration */ |
| 188 | 200 | ||
| 189 | TESTPAGEFLAG(Locked, locked) TESTSETFLAG(Locked, locked) | 201 | TESTPAGEFLAG(Locked, locked) TESTSETFLAG(Locked, locked) |
| @@ -250,19 +262,28 @@ PAGEFLAG(Unevictable, unevictable) __CLEARPAGEFLAG(Unevictable, unevictable) | |||
| 250 | #ifdef CONFIG_HAVE_MLOCKED_PAGE_BIT | 262 | #ifdef CONFIG_HAVE_MLOCKED_PAGE_BIT |
| 251 | #define MLOCK_PAGES 1 | 263 | #define MLOCK_PAGES 1 |
| 252 | PAGEFLAG(Mlocked, mlocked) __CLEARPAGEFLAG(Mlocked, mlocked) | 264 | PAGEFLAG(Mlocked, mlocked) __CLEARPAGEFLAG(Mlocked, mlocked) |
| 253 | TESTSCFLAG(Mlocked, mlocked) | 265 | TESTSCFLAG(Mlocked, mlocked) __TESTCLEARFLAG(Mlocked, mlocked) |
| 254 | #else | 266 | #else |
| 255 | #define MLOCK_PAGES 0 | 267 | #define MLOCK_PAGES 0 |
| 256 | PAGEFLAG_FALSE(Mlocked) | 268 | PAGEFLAG_FALSE(Mlocked) SETPAGEFLAG_NOOP(Mlocked) |
| 257 | SETPAGEFLAG_NOOP(Mlocked) TESTCLEARFLAG_FALSE(Mlocked) | 269 | TESTCLEARFLAG_FALSE(Mlocked) __TESTCLEARFLAG_FALSE(Mlocked) |
| 258 | #endif | 270 | #endif |
| 259 | 271 | ||
| 260 | #ifdef CONFIG_IA64_UNCACHED_ALLOCATOR | 272 | #ifdef CONFIG_ARCH_USES_PG_UNCACHED |
| 261 | PAGEFLAG(Uncached, uncached) | 273 | PAGEFLAG(Uncached, uncached) |
| 262 | #else | 274 | #else |
| 263 | PAGEFLAG_FALSE(Uncached) | 275 | PAGEFLAG_FALSE(Uncached) |
| 264 | #endif | 276 | #endif |
| 265 | 277 | ||
| 278 | #ifdef CONFIG_MEMORY_FAILURE | ||
| 279 | PAGEFLAG(HWPoison, hwpoison) | ||
| 280 | TESTSETFLAG(HWPoison, hwpoison) | ||
| 281 | #define __PG_HWPOISON (1UL << PG_hwpoison) | ||
| 282 | #else | ||
| 283 | PAGEFLAG_FALSE(HWPoison) | ||
| 284 | #define __PG_HWPOISON 0 | ||
| 285 | #endif | ||
| 286 | |||
| 266 | static inline int PageUptodate(struct page *page) | 287 | static inline int PageUptodate(struct page *page) |
| 267 | { | 288 | { |
| 268 | int ret = test_bit(PG_uptodate, &(page)->flags); | 289 | int ret = test_bit(PG_uptodate, &(page)->flags); |
| @@ -387,7 +408,7 @@ static inline void __ClearPageTail(struct page *page) | |||
| 387 | 1 << PG_private | 1 << PG_private_2 | \ | 408 | 1 << PG_private | 1 << PG_private_2 | \ |
| 388 | 1 << PG_buddy | 1 << PG_writeback | 1 << PG_reserved | \ | 409 | 1 << PG_buddy | 1 << PG_writeback | 1 << PG_reserved | \ |
| 389 | 1 << PG_slab | 1 << PG_swapcache | 1 << PG_active | \ | 410 | 1 << PG_slab | 1 << PG_swapcache | 1 << PG_active | \ |
| 390 | 1 << PG_unevictable | __PG_MLOCKED) | 411 | 1 << PG_unevictable | __PG_MLOCKED | __PG_HWPOISON) |
| 391 | 412 | ||
| 392 | /* | 413 | /* |
| 393 | * Flags checked when a page is prepped for return by the page allocator. | 414 | * Flags checked when a page is prepped for return by the page allocator. |
| @@ -396,8 +417,8 @@ static inline void __ClearPageTail(struct page *page) | |||
| 396 | */ | 417 | */ |
| 397 | #define PAGE_FLAGS_CHECK_AT_PREP ((1 << NR_PAGEFLAGS) - 1) | 418 | #define PAGE_FLAGS_CHECK_AT_PREP ((1 << NR_PAGEFLAGS) - 1) |
| 398 | 419 | ||
| 399 | #endif /* !__GENERATING_BOUNDS_H */ | 420 | #define PAGE_FLAGS_PRIVATE \ |
| 400 | 421 | (1 << PG_private | 1 << PG_private_2) | |
| 401 | /** | 422 | /** |
| 402 | * page_has_private - Determine if page has private stuff | 423 | * page_has_private - Determine if page has private stuff |
| 403 | * @page: The page to be checked | 424 | * @page: The page to be checked |
| @@ -405,8 +426,11 @@ static inline void __ClearPageTail(struct page *page) | |||
| 405 | * Determine if a page has private stuff, indicating that release routines | 426 | * Determine if a page has private stuff, indicating that release routines |
| 406 | * should be invoked upon it. | 427 | * should be invoked upon it. |
| 407 | */ | 428 | */ |
| 408 | #define page_has_private(page) \ | 429 | static inline int page_has_private(struct page *page) |
| 409 | ((page)->flags & ((1 << PG_private) | \ | 430 | { |
| 410 | (1 << PG_private_2))) | 431 | return !!(page->flags & PAGE_FLAGS_PRIVATE); |
| 432 | } | ||
| 433 | |||
| 434 | #endif /* !__GENERATING_BOUNDS_H */ | ||
| 411 | 435 | ||
| 412 | #endif /* PAGE_FLAGS_H */ | 436 | #endif /* PAGE_FLAGS_H */ |
diff --git a/include/linux/page_cgroup.h b/include/linux/page_cgroup.h index 13f126c89ae8..4b938d4f3ac2 100644 --- a/include/linux/page_cgroup.h +++ b/include/linux/page_cgroup.h | |||
| @@ -38,6 +38,7 @@ enum { | |||
| 38 | PCG_LOCK, /* page cgroup is locked */ | 38 | PCG_LOCK, /* page cgroup is locked */ |
| 39 | PCG_CACHE, /* charged as cache */ | 39 | PCG_CACHE, /* charged as cache */ |
| 40 | PCG_USED, /* this object is in use. */ | 40 | PCG_USED, /* this object is in use. */ |
| 41 | PCG_ACCT_LRU, /* page has been accounted for */ | ||
| 41 | }; | 42 | }; |
| 42 | 43 | ||
| 43 | #define TESTPCGFLAG(uname, lname) \ | 44 | #define TESTPCGFLAG(uname, lname) \ |
| @@ -52,11 +53,23 @@ static inline void SetPageCgroup##uname(struct page_cgroup *pc)\ | |||
| 52 | static inline void ClearPageCgroup##uname(struct page_cgroup *pc) \ | 53 | static inline void ClearPageCgroup##uname(struct page_cgroup *pc) \ |
| 53 | { clear_bit(PCG_##lname, &pc->flags); } | 54 | { clear_bit(PCG_##lname, &pc->flags); } |
| 54 | 55 | ||
| 56 | #define TESTCLEARPCGFLAG(uname, lname) \ | ||
| 57 | static inline int TestClearPageCgroup##uname(struct page_cgroup *pc) \ | ||
| 58 | { return test_and_clear_bit(PCG_##lname, &pc->flags); } | ||
| 59 | |||
| 55 | /* Cache flag is set only once (at allocation) */ | 60 | /* Cache flag is set only once (at allocation) */ |
| 56 | TESTPCGFLAG(Cache, CACHE) | 61 | TESTPCGFLAG(Cache, CACHE) |
| 62 | CLEARPCGFLAG(Cache, CACHE) | ||
| 63 | SETPCGFLAG(Cache, CACHE) | ||
| 57 | 64 | ||
| 58 | TESTPCGFLAG(Used, USED) | 65 | TESTPCGFLAG(Used, USED) |
| 59 | CLEARPCGFLAG(Used, USED) | 66 | CLEARPCGFLAG(Used, USED) |
| 67 | SETPCGFLAG(Used, USED) | ||
| 68 | |||
| 69 | SETPCGFLAG(AcctLRU, ACCT_LRU) | ||
| 70 | CLEARPCGFLAG(AcctLRU, ACCT_LRU) | ||
| 71 | TESTPCGFLAG(AcctLRU, ACCT_LRU) | ||
| 72 | TESTCLEARPCGFLAG(AcctLRU, ACCT_LRU) | ||
| 60 | 73 | ||
| 61 | static inline int page_cgroup_nid(struct page_cgroup *pc) | 74 | static inline int page_cgroup_nid(struct page_cgroup *pc) |
| 62 | { | 75 | { |
| @@ -105,14 +118,14 @@ static inline void __init page_cgroup_init_flatmem(void) | |||
| 105 | 118 | ||
| 106 | #endif | 119 | #endif |
| 107 | 120 | ||
| 108 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP | ||
| 109 | #include <linux/swap.h> | 121 | #include <linux/swap.h> |
| 122 | |||
| 123 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP | ||
| 110 | extern unsigned short swap_cgroup_record(swp_entry_t ent, unsigned short id); | 124 | extern unsigned short swap_cgroup_record(swp_entry_t ent, unsigned short id); |
| 111 | extern unsigned short lookup_swap_cgroup(swp_entry_t ent); | 125 | extern unsigned short lookup_swap_cgroup(swp_entry_t ent); |
| 112 | extern int swap_cgroup_swapon(int type, unsigned long max_pages); | 126 | extern int swap_cgroup_swapon(int type, unsigned long max_pages); |
| 113 | extern void swap_cgroup_swapoff(int type); | 127 | extern void swap_cgroup_swapoff(int type); |
| 114 | #else | 128 | #else |
| 115 | #include <linux/swap.h> | ||
| 116 | 129 | ||
| 117 | static inline | 130 | static inline |
| 118 | unsigned short swap_cgroup_record(swp_entry_t ent, unsigned short id) | 131 | unsigned short swap_cgroup_record(swp_entry_t ent, unsigned short id) |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 115fb7ba5089..f5c7cd343e56 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
| @@ -241,6 +241,7 @@ struct pci_dev { | |||
| 241 | unsigned int d1_support:1; /* Low power state D1 is supported */ | 241 | unsigned int d1_support:1; /* Low power state D1 is supported */ |
| 242 | unsigned int d2_support:1; /* Low power state D2 is supported */ | 242 | unsigned int d2_support:1; /* Low power state D2 is supported */ |
| 243 | unsigned int no_d1d2:1; /* Only allow D0 and D3 */ | 243 | unsigned int no_d1d2:1; /* Only allow D0 and D3 */ |
| 244 | unsigned int wakeup_prepared:1; | ||
| 244 | 245 | ||
| 245 | #ifdef CONFIG_PCIEASPM | 246 | #ifdef CONFIG_PCIEASPM |
| 246 | struct pcie_link_state *link_state; /* ASPM link state. */ | 247 | struct pcie_link_state *link_state; /* ASPM link state. */ |
| @@ -273,9 +274,12 @@ struct pci_dev { | |||
| 273 | unsigned int ari_enabled:1; /* ARI forwarding */ | 274 | unsigned int ari_enabled:1; /* ARI forwarding */ |
| 274 | unsigned int is_managed:1; | 275 | unsigned int is_managed:1; |
| 275 | unsigned int is_pcie:1; | 276 | unsigned int is_pcie:1; |
| 277 | unsigned int needs_freset:1; /* Dev requires fundamental reset */ | ||
| 276 | unsigned int state_saved:1; | 278 | unsigned int state_saved:1; |
| 277 | unsigned int is_physfn:1; | 279 | unsigned int is_physfn:1; |
| 278 | unsigned int is_virtfn:1; | 280 | unsigned int is_virtfn:1; |
| 281 | unsigned int reset_fn:1; | ||
| 282 | unsigned int is_hotplug_bridge:1; | ||
| 279 | pci_dev_flags_t dev_flags; | 283 | pci_dev_flags_t dev_flags; |
| 280 | atomic_t enable_cnt; /* pci_enable_device has been called */ | 284 | atomic_t enable_cnt; /* pci_enable_device has been called */ |
| 281 | 285 | ||
| @@ -794,6 +798,11 @@ int __must_check __pci_register_driver(struct pci_driver *, struct module *, | |||
| 794 | void pci_unregister_driver(struct pci_driver *dev); | 798 | void pci_unregister_driver(struct pci_driver *dev); |
| 795 | void pci_remove_behind_bridge(struct pci_dev *dev); | 799 | void pci_remove_behind_bridge(struct pci_dev *dev); |
| 796 | struct pci_driver *pci_dev_driver(const struct pci_dev *dev); | 800 | struct pci_driver *pci_dev_driver(const struct pci_dev *dev); |
| 801 | int pci_add_dynid(struct pci_driver *drv, | ||
| 802 | unsigned int vendor, unsigned int device, | ||
| 803 | unsigned int subvendor, unsigned int subdevice, | ||
| 804 | unsigned int class, unsigned int class_mask, | ||
| 805 | unsigned long driver_data); | ||
| 797 | const struct pci_device_id *pci_match_id(const struct pci_device_id *ids, | 806 | const struct pci_device_id *pci_match_id(const struct pci_device_id *ids, |
| 798 | struct pci_dev *dev); | 807 | struct pci_dev *dev); |
| 799 | int pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max, | 808 | int pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max, |
| @@ -805,6 +814,8 @@ int pci_cfg_space_size_ext(struct pci_dev *dev); | |||
| 805 | int pci_cfg_space_size(struct pci_dev *dev); | 814 | int pci_cfg_space_size(struct pci_dev *dev); |
| 806 | unsigned char pci_bus_max_busnr(struct pci_bus *bus); | 815 | unsigned char pci_bus_max_busnr(struct pci_bus *bus); |
| 807 | 816 | ||
| 817 | int pci_set_vga_state(struct pci_dev *pdev, bool decode, | ||
| 818 | unsigned int command_bits, bool change_bridge); | ||
| 808 | /* kmem_cache style wrapper around pci_alloc_consistent() */ | 819 | /* kmem_cache style wrapper around pci_alloc_consistent() */ |
| 809 | 820 | ||
| 810 | #include <linux/dmapool.h> | 821 | #include <linux/dmapool.h> |
| @@ -1236,6 +1247,9 @@ extern int pci_pci_problems; | |||
| 1236 | extern unsigned long pci_cardbus_io_size; | 1247 | extern unsigned long pci_cardbus_io_size; |
| 1237 | extern unsigned long pci_cardbus_mem_size; | 1248 | extern unsigned long pci_cardbus_mem_size; |
| 1238 | 1249 | ||
| 1250 | extern unsigned long pci_hotplug_io_size; | ||
| 1251 | extern unsigned long pci_hotplug_mem_size; | ||
| 1252 | |||
| 1239 | int pcibios_add_platform_entries(struct pci_dev *dev); | 1253 | int pcibios_add_platform_entries(struct pci_dev *dev); |
| 1240 | void pcibios_disable_device(struct pci_dev *dev); | 1254 | void pcibios_disable_device(struct pci_dev *dev); |
| 1241 | int pcibios_set_pcie_reset_state(struct pci_dev *dev, | 1255 | int pcibios_set_pcie_reset_state(struct pci_dev *dev, |
diff --git a/include/linux/pci_hotplug.h b/include/linux/pci_hotplug.h index 4391741b99dc..652ba797696d 100644 --- a/include/linux/pci_hotplug.h +++ b/include/linux/pci_hotplug.h | |||
| @@ -62,7 +62,8 @@ enum pcie_link_width { | |||
| 62 | }; | 62 | }; |
| 63 | 63 | ||
| 64 | enum pcie_link_speed { | 64 | enum pcie_link_speed { |
| 65 | PCIE_2PT5GB = 0x14, | 65 | PCIE_2_5GB = 0x14, |
| 66 | PCIE_5_0GB = 0x15, | ||
| 66 | PCIE_LNK_SPEED_UNKNOWN = 0xFF, | 67 | PCIE_LNK_SPEED_UNKNOWN = 0xFF, |
| 67 | }; | 68 | }; |
| 68 | 69 | ||
| @@ -226,11 +227,18 @@ struct hotplug_params { | |||
| 226 | #ifdef CONFIG_ACPI | 227 | #ifdef CONFIG_ACPI |
| 227 | #include <acpi/acpi.h> | 228 | #include <acpi/acpi.h> |
| 228 | #include <acpi/acpi_bus.h> | 229 | #include <acpi/acpi_bus.h> |
| 229 | extern acpi_status acpi_get_hp_params_from_firmware(struct pci_bus *bus, | 230 | int pci_get_hp_params(struct pci_dev *dev, struct hotplug_params *hpp); |
| 230 | struct hotplug_params *hpp); | ||
| 231 | int acpi_get_hp_hw_control_from_firmware(struct pci_dev *dev, u32 flags); | 231 | int acpi_get_hp_hw_control_from_firmware(struct pci_dev *dev, u32 flags); |
| 232 | int acpi_pci_check_ejectable(struct pci_bus *pbus, acpi_handle handle); | 232 | int acpi_pci_check_ejectable(struct pci_bus *pbus, acpi_handle handle); |
| 233 | int acpi_pci_detect_ejectable(struct pci_bus *pbus); | 233 | int acpi_pci_detect_ejectable(acpi_handle handle); |
| 234 | #else | ||
| 235 | static inline int pci_get_hp_params(struct pci_dev *dev, | ||
| 236 | struct hotplug_params *hpp) | ||
| 237 | { | ||
| 238 | return -ENODEV; | ||
| 239 | } | ||
| 234 | #endif | 240 | #endif |
| 241 | |||
| 242 | void pci_configure_slot(struct pci_dev *dev); | ||
| 235 | #endif | 243 | #endif |
| 236 | 244 | ||
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index c8fdcadce437..daecca3c8300 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
| @@ -2,6 +2,9 @@ | |||
| 2 | * PCI Class, Vendor and Device IDs | 2 | * PCI Class, Vendor and Device IDs |
| 3 | * | 3 | * |
| 4 | * Please keep sorted. | 4 | * Please keep sorted. |
| 5 | * | ||
| 6 | * Do not add new entries to this file unless the definitions | ||
| 7 | * are shared between multiple drivers. | ||
| 5 | */ | 8 | */ |
| 6 | 9 | ||
| 7 | /* Device classes and subclasses */ | 10 | /* Device classes and subclasses */ |
| @@ -376,9 +379,6 @@ | |||
| 376 | #define PCI_DEVICE_ID_ATI_IXP600_IDE 0x438c | 379 | #define PCI_DEVICE_ID_ATI_IXP600_IDE 0x438c |
| 377 | #define PCI_DEVICE_ID_ATI_IXP700_SATA 0x4390 | 380 | #define PCI_DEVICE_ID_ATI_IXP700_SATA 0x4390 |
| 378 | #define PCI_DEVICE_ID_ATI_IXP700_IDE 0x439c | 381 | #define PCI_DEVICE_ID_ATI_IXP700_IDE 0x439c |
| 379 | /* AMD SB Chipset */ | ||
| 380 | #define PCI_DEVICE_ID_AMD_SB900_IDE 0x780c | ||
| 381 | #define PCI_DEVICE_ID_AMD_SB900_SATA_IDE 0x7800 | ||
| 382 | 382 | ||
| 383 | #define PCI_VENDOR_ID_VLSI 0x1004 | 383 | #define PCI_VENDOR_ID_VLSI 0x1004 |
| 384 | #define PCI_DEVICE_ID_VLSI_82C592 0x0005 | 384 | #define PCI_DEVICE_ID_VLSI_82C592 0x0005 |
| @@ -482,6 +482,9 @@ | |||
| 482 | #define PCI_DEVICE_ID_IBM_ICOM_V2_ONE_PORT_RVX_ONE_PORT_MDM_PCIE 0x0361 | 482 | #define PCI_DEVICE_ID_IBM_ICOM_V2_ONE_PORT_RVX_ONE_PORT_MDM_PCIE 0x0361 |
| 483 | #define PCI_DEVICE_ID_IBM_ICOM_FOUR_PORT_MODEL 0x252 | 483 | #define PCI_DEVICE_ID_IBM_ICOM_FOUR_PORT_MODEL 0x252 |
| 484 | 484 | ||
| 485 | #define PCI_SUBVENDOR_ID_IBM 0x1014 | ||
| 486 | #define PCI_SUBDEVICE_ID_IBM_SATURN_SERIAL_ONE_PORT 0x03d4 | ||
| 487 | |||
| 485 | #define PCI_VENDOR_ID_UNISYS 0x1018 | 488 | #define PCI_VENDOR_ID_UNISYS 0x1018 |
| 486 | #define PCI_DEVICE_ID_UNISYS_DMA_DIRECTOR 0x001C | 489 | #define PCI_DEVICE_ID_UNISYS_DMA_DIRECTOR 0x001C |
| 487 | 490 | ||
| @@ -540,6 +543,7 @@ | |||
| 540 | #define PCI_DEVICE_ID_AMD_8131_BRIDGE 0x7450 | 543 | #define PCI_DEVICE_ID_AMD_8131_BRIDGE 0x7450 |
| 541 | #define PCI_DEVICE_ID_AMD_8131_APIC 0x7451 | 544 | #define PCI_DEVICE_ID_AMD_8131_APIC 0x7451 |
| 542 | #define PCI_DEVICE_ID_AMD_8132_BRIDGE 0x7458 | 545 | #define PCI_DEVICE_ID_AMD_8132_BRIDGE 0x7458 |
| 546 | #define PCI_DEVICE_ID_AMD_HUDSON2_SMBUS 0x780b | ||
| 543 | #define PCI_DEVICE_ID_AMD_CS5535_IDE 0x208F | 547 | #define PCI_DEVICE_ID_AMD_CS5535_IDE 0x208F |
| 544 | #define PCI_DEVICE_ID_AMD_CS5536_ISA 0x2090 | 548 | #define PCI_DEVICE_ID_AMD_CS5536_ISA 0x2090 |
| 545 | #define PCI_DEVICE_ID_AMD_CS5536_FLASH 0x2091 | 549 | #define PCI_DEVICE_ID_AMD_CS5536_FLASH 0x2091 |
| @@ -549,9 +553,10 @@ | |||
| 549 | #define PCI_DEVICE_ID_AMD_CS5536_UDC 0x2096 | 553 | #define PCI_DEVICE_ID_AMD_CS5536_UDC 0x2096 |
| 550 | #define PCI_DEVICE_ID_AMD_CS5536_UOC 0x2097 | 554 | #define PCI_DEVICE_ID_AMD_CS5536_UOC 0x2097 |
| 551 | #define PCI_DEVICE_ID_AMD_CS5536_IDE 0x209A | 555 | #define PCI_DEVICE_ID_AMD_CS5536_IDE 0x209A |
| 552 | |||
| 553 | #define PCI_DEVICE_ID_AMD_LX_VIDEO 0x2081 | 556 | #define PCI_DEVICE_ID_AMD_LX_VIDEO 0x2081 |
| 554 | #define PCI_DEVICE_ID_AMD_LX_AES 0x2082 | 557 | #define PCI_DEVICE_ID_AMD_LX_AES 0x2082 |
| 558 | #define PCI_DEVICE_ID_AMD_HUDSON2_IDE 0x780c | ||
| 559 | #define PCI_DEVICE_ID_AMD_HUDSON2_SATA_IDE 0x7800 | ||
| 555 | 560 | ||
| 556 | #define PCI_VENDOR_ID_TRIDENT 0x1023 | 561 | #define PCI_VENDOR_ID_TRIDENT 0x1023 |
| 557 | #define PCI_DEVICE_ID_TRIDENT_4DWAVE_DX 0x2000 | 562 | #define PCI_DEVICE_ID_TRIDENT_4DWAVE_DX 0x2000 |
| @@ -772,6 +777,7 @@ | |||
| 772 | #define PCI_DEVICE_ID_TI_X515 0x8036 | 777 | #define PCI_DEVICE_ID_TI_X515 0x8036 |
| 773 | #define PCI_DEVICE_ID_TI_XX12 0x8039 | 778 | #define PCI_DEVICE_ID_TI_XX12 0x8039 |
| 774 | #define PCI_DEVICE_ID_TI_XX12_FM 0x803b | 779 | #define PCI_DEVICE_ID_TI_XX12_FM 0x803b |
| 780 | #define PCI_DEVICE_ID_TI_XIO2000A 0x8231 | ||
| 775 | #define PCI_DEVICE_ID_TI_1130 0xac12 | 781 | #define PCI_DEVICE_ID_TI_1130 0xac12 |
| 776 | #define PCI_DEVICE_ID_TI_1031 0xac13 | 782 | #define PCI_DEVICE_ID_TI_1031 0xac13 |
| 777 | #define PCI_DEVICE_ID_TI_1131 0xac15 | 783 | #define PCI_DEVICE_ID_TI_1131 0xac15 |
| @@ -881,6 +887,7 @@ | |||
| 881 | #define PCI_DEVICE_ID_APPLE_SH_SUNGEM 0x0051 | 887 | #define PCI_DEVICE_ID_APPLE_SH_SUNGEM 0x0051 |
| 882 | #define PCI_DEVICE_ID_APPLE_U3L_AGP 0x0058 | 888 | #define PCI_DEVICE_ID_APPLE_U3L_AGP 0x0058 |
| 883 | #define PCI_DEVICE_ID_APPLE_U3H_AGP 0x0059 | 889 | #define PCI_DEVICE_ID_APPLE_U3H_AGP 0x0059 |
| 890 | #define PCI_DEVICE_ID_APPLE_U4_PCIE 0x005b | ||
| 884 | #define PCI_DEVICE_ID_APPLE_IPID2_AGP 0x0066 | 891 | #define PCI_DEVICE_ID_APPLE_IPID2_AGP 0x0066 |
| 885 | #define PCI_DEVICE_ID_APPLE_IPID2_ATA 0x0069 | 892 | #define PCI_DEVICE_ID_APPLE_IPID2_ATA 0x0069 |
| 886 | #define PCI_DEVICE_ID_APPLE_IPID2_FW 0x006a | 893 | #define PCI_DEVICE_ID_APPLE_IPID2_FW 0x006a |
| @@ -1525,6 +1532,8 @@ | |||
| 1525 | #define PCI_DEVICE_ID_ARTOP_ATP860R 0x0007 | 1532 | #define PCI_DEVICE_ID_ARTOP_ATP860R 0x0007 |
| 1526 | #define PCI_DEVICE_ID_ARTOP_ATP865 0x0008 | 1533 | #define PCI_DEVICE_ID_ARTOP_ATP865 0x0008 |
| 1527 | #define PCI_DEVICE_ID_ARTOP_ATP865R 0x0009 | 1534 | #define PCI_DEVICE_ID_ARTOP_ATP865R 0x0009 |
| 1535 | #define PCI_DEVICE_ID_ARTOP_ATP867A 0x000A | ||
| 1536 | #define PCI_DEVICE_ID_ARTOP_ATP867B 0x000B | ||
| 1528 | #define PCI_DEVICE_ID_ARTOP_AEC7610 0x8002 | 1537 | #define PCI_DEVICE_ID_ARTOP_AEC7610 0x8002 |
| 1529 | #define PCI_DEVICE_ID_ARTOP_AEC7612UW 0x8010 | 1538 | #define PCI_DEVICE_ID_ARTOP_AEC7612UW 0x8010 |
| 1530 | #define PCI_DEVICE_ID_ARTOP_AEC7612U 0x8020 | 1539 | #define PCI_DEVICE_ID_ARTOP_AEC7612U 0x8020 |
| @@ -1624,6 +1633,8 @@ | |||
| 1624 | #define PCI_DEVICE_ID_O2_6730 0x673a | 1633 | #define PCI_DEVICE_ID_O2_6730 0x673a |
| 1625 | #define PCI_DEVICE_ID_O2_6832 0x6832 | 1634 | #define PCI_DEVICE_ID_O2_6832 0x6832 |
| 1626 | #define PCI_DEVICE_ID_O2_6836 0x6836 | 1635 | #define PCI_DEVICE_ID_O2_6836 0x6836 |
| 1636 | #define PCI_DEVICE_ID_O2_6812 0x6872 | ||
| 1637 | #define PCI_DEVICE_ID_O2_6933 0x6933 | ||
| 1627 | 1638 | ||
| 1628 | #define PCI_VENDOR_ID_3DFX 0x121a | 1639 | #define PCI_VENDOR_ID_3DFX 0x121a |
| 1629 | #define PCI_DEVICE_ID_3DFX_VOODOO 0x0001 | 1640 | #define PCI_DEVICE_ID_3DFX_VOODOO 0x0001 |
| @@ -1947,6 +1958,8 @@ | |||
| 1947 | #define PCI_DEVICE_ID_LAVA_DSERIAL 0x0100 /* 2x 16550 */ | 1958 | #define PCI_DEVICE_ID_LAVA_DSERIAL 0x0100 /* 2x 16550 */ |
| 1948 | #define PCI_DEVICE_ID_LAVA_QUATRO_A 0x0101 /* 2x 16550, half of 4 port */ | 1959 | #define PCI_DEVICE_ID_LAVA_QUATRO_A 0x0101 /* 2x 16550, half of 4 port */ |
| 1949 | #define PCI_DEVICE_ID_LAVA_QUATRO_B 0x0102 /* 2x 16550, half of 4 port */ | 1960 | #define PCI_DEVICE_ID_LAVA_QUATRO_B 0x0102 /* 2x 16550, half of 4 port */ |
| 1961 | #define PCI_DEVICE_ID_LAVA_QUATTRO_A 0x0120 /* 2x 16550A, half of 4 port */ | ||
| 1962 | #define PCI_DEVICE_ID_LAVA_QUATTRO_B 0x0121 /* 2x 16550A, half of 4 port */ | ||
| 1950 | #define PCI_DEVICE_ID_LAVA_OCTO_A 0x0180 /* 4x 16550A, half of 8 port */ | 1963 | #define PCI_DEVICE_ID_LAVA_OCTO_A 0x0180 /* 4x 16550A, half of 8 port */ |
| 1951 | #define PCI_DEVICE_ID_LAVA_OCTO_B 0x0181 /* 4x 16550A, half of 8 port */ | 1964 | #define PCI_DEVICE_ID_LAVA_OCTO_B 0x0181 /* 4x 16550A, half of 8 port */ |
| 1952 | #define PCI_DEVICE_ID_LAVA_PORT_PLUS 0x0200 /* 2x 16650 */ | 1965 | #define PCI_DEVICE_ID_LAVA_PORT_PLUS 0x0200 /* 2x 16650 */ |
| @@ -1988,6 +2001,8 @@ | |||
| 1988 | 2001 | ||
| 1989 | #define PCI_VENDOR_ID_SAMSUNG 0x144d | 2002 | #define PCI_VENDOR_ID_SAMSUNG 0x144d |
| 1990 | 2003 | ||
| 2004 | #define PCI_VENDOR_ID_GIGABYTE 0x1458 | ||
| 2005 | |||
| 1991 | #define PCI_VENDOR_ID_AMBIT 0x1468 | 2006 | #define PCI_VENDOR_ID_AMBIT 0x1468 |
| 1992 | 2007 | ||
| 1993 | #define PCI_VENDOR_ID_MYRICOM 0x14c1 | 2008 | #define PCI_VENDOR_ID_MYRICOM 0x14c1 |
| @@ -2066,7 +2081,6 @@ | |||
| 2066 | #define PCI_DEVICE_ID_TIGON3_5787M 0x1693 | 2081 | #define PCI_DEVICE_ID_TIGON3_5787M 0x1693 |
| 2067 | #define PCI_DEVICE_ID_TIGON3_5782 0x1696 | 2082 | #define PCI_DEVICE_ID_TIGON3_5782 0x1696 |
| 2068 | #define PCI_DEVICE_ID_TIGON3_5784 0x1698 | 2083 | #define PCI_DEVICE_ID_TIGON3_5784 0x1698 |
| 2069 | #define PCI_DEVICE_ID_TIGON3_5785 0x1699 | ||
| 2070 | #define PCI_DEVICE_ID_TIGON3_5786 0x169a | 2084 | #define PCI_DEVICE_ID_TIGON3_5786 0x169a |
| 2071 | #define PCI_DEVICE_ID_TIGON3_5787 0x169b | 2085 | #define PCI_DEVICE_ID_TIGON3_5787 0x169b |
| 2072 | #define PCI_DEVICE_ID_TIGON3_5788 0x169c | 2086 | #define PCI_DEVICE_ID_TIGON3_5788 0x169c |
| @@ -2153,6 +2167,10 @@ | |||
| 2153 | #define PCI_DEVICE_ID_ADDIDATA_APCI7420_3 0x700D | 2167 | #define PCI_DEVICE_ID_ADDIDATA_APCI7420_3 0x700D |
| 2154 | #define PCI_DEVICE_ID_ADDIDATA_APCI7300_3 0x700E | 2168 | #define PCI_DEVICE_ID_ADDIDATA_APCI7300_3 0x700E |
| 2155 | #define PCI_DEVICE_ID_ADDIDATA_APCI7800_3 0x700F | 2169 | #define PCI_DEVICE_ID_ADDIDATA_APCI7800_3 0x700F |
| 2170 | #define PCI_DEVICE_ID_ADDIDATA_APCIe7300 0x7010 | ||
| 2171 | #define PCI_DEVICE_ID_ADDIDATA_APCIe7420 0x7011 | ||
| 2172 | #define PCI_DEVICE_ID_ADDIDATA_APCIe7500 0x7012 | ||
| 2173 | #define PCI_DEVICE_ID_ADDIDATA_APCIe7800 0x7013 | ||
| 2156 | 2174 | ||
| 2157 | #define PCI_VENDOR_ID_PDC 0x15e9 | 2175 | #define PCI_VENDOR_ID_PDC 0x15e9 |
| 2158 | 2176 | ||
| @@ -2519,6 +2537,16 @@ | |||
| 2519 | #define PCI_DEVICE_ID_INTEL_E7525_MCH 0x359e | 2537 | #define PCI_DEVICE_ID_INTEL_E7525_MCH 0x359e |
| 2520 | #define PCI_DEVICE_ID_INTEL_IOAT_CNB 0x360b | 2538 | #define PCI_DEVICE_ID_INTEL_IOAT_CNB 0x360b |
| 2521 | #define PCI_DEVICE_ID_INTEL_FBD_CNB 0x360c | 2539 | #define PCI_DEVICE_ID_INTEL_FBD_CNB 0x360c |
| 2540 | #define PCI_DEVICE_ID_INTEL_IOAT_JSF0 0x3710 | ||
| 2541 | #define PCI_DEVICE_ID_INTEL_IOAT_JSF1 0x3711 | ||
| 2542 | #define PCI_DEVICE_ID_INTEL_IOAT_JSF2 0x3712 | ||
| 2543 | #define PCI_DEVICE_ID_INTEL_IOAT_JSF3 0x3713 | ||
| 2544 | #define PCI_DEVICE_ID_INTEL_IOAT_JSF4 0x3714 | ||
| 2545 | #define PCI_DEVICE_ID_INTEL_IOAT_JSF5 0x3715 | ||
| 2546 | #define PCI_DEVICE_ID_INTEL_IOAT_JSF6 0x3716 | ||
| 2547 | #define PCI_DEVICE_ID_INTEL_IOAT_JSF7 0x3717 | ||
| 2548 | #define PCI_DEVICE_ID_INTEL_IOAT_JSF8 0x3718 | ||
| 2549 | #define PCI_DEVICE_ID_INTEL_IOAT_JSF9 0x3719 | ||
| 2522 | #define PCI_DEVICE_ID_INTEL_ICH10_0 0x3a14 | 2550 | #define PCI_DEVICE_ID_INTEL_ICH10_0 0x3a14 |
| 2523 | #define PCI_DEVICE_ID_INTEL_ICH10_1 0x3a16 | 2551 | #define PCI_DEVICE_ID_INTEL_ICH10_1 0x3a16 |
| 2524 | #define PCI_DEVICE_ID_INTEL_ICH10_2 0x3a18 | 2552 | #define PCI_DEVICE_ID_INTEL_ICH10_2 0x3a18 |
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h index fcaee42c7ac2..dd0bed4f1cf0 100644 --- a/include/linux/pci_regs.h +++ b/include/linux/pci_regs.h | |||
| @@ -42,6 +42,7 @@ | |||
| 42 | #define PCI_COMMAND_INTX_DISABLE 0x400 /* INTx Emulation Disable */ | 42 | #define PCI_COMMAND_INTX_DISABLE 0x400 /* INTx Emulation Disable */ |
| 43 | 43 | ||
| 44 | #define PCI_STATUS 0x06 /* 16 bits */ | 44 | #define PCI_STATUS 0x06 /* 16 bits */ |
| 45 | #define PCI_STATUS_INTERRUPT 0x08 /* Interrupt status */ | ||
| 45 | #define PCI_STATUS_CAP_LIST 0x10 /* Support Capability List */ | 46 | #define PCI_STATUS_CAP_LIST 0x10 /* Support Capability List */ |
| 46 | #define PCI_STATUS_66MHZ 0x20 /* Support 66 Mhz PCI 2.1 bus */ | 47 | #define PCI_STATUS_66MHZ 0x20 /* Support 66 Mhz PCI 2.1 bus */ |
| 47 | #define PCI_STATUS_UDF 0x40 /* Support User Definable Features [obsolete] */ | 48 | #define PCI_STATUS_UDF 0x40 /* Support User Definable Features [obsolete] */ |
diff --git a/include/linux/percpu-defs.h b/include/linux/percpu-defs.h index 0761491b3eec..9bd03193ecd4 100644 --- a/include/linux/percpu-defs.h +++ b/include/linux/percpu-defs.h | |||
| @@ -10,22 +10,70 @@ | |||
| 10 | /* | 10 | /* |
| 11 | * Base implementations of per-CPU variable declarations and definitions, where | 11 | * Base implementations of per-CPU variable declarations and definitions, where |
| 12 | * the section in which the variable is to be placed is provided by the | 12 | * the section in which the variable is to be placed is provided by the |
| 13 | * 'section' argument. This may be used to affect the parameters governing the | 13 | * 'sec' argument. This may be used to affect the parameters governing the |
| 14 | * variable's storage. | 14 | * variable's storage. |
| 15 | * | 15 | * |
| 16 | * NOTE! The sections for the DECLARE and for the DEFINE must match, lest | 16 | * NOTE! The sections for the DECLARE and for the DEFINE must match, lest |
| 17 | * linkage errors occur due the compiler generating the wrong code to access | 17 | * linkage errors occur due the compiler generating the wrong code to access |
| 18 | * that section. | 18 | * that section. |
| 19 | */ | 19 | */ |
| 20 | #define DECLARE_PER_CPU_SECTION(type, name, section) \ | 20 | #define __PCPU_ATTRS(sec) \ |
| 21 | extern \ | 21 | __attribute__((section(PER_CPU_BASE_SECTION sec))) \ |
| 22 | __attribute__((__section__(PER_CPU_BASE_SECTION section))) \ | 22 | PER_CPU_ATTRIBUTES |
| 23 | PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name | 23 | |
| 24 | 24 | #define __PCPU_DUMMY_ATTRS \ | |
| 25 | #define DEFINE_PER_CPU_SECTION(type, name, section) \ | 25 | __attribute__((section(".discard"), unused)) |
| 26 | __attribute__((__section__(PER_CPU_BASE_SECTION section))) \ | 26 | |
| 27 | PER_CPU_ATTRIBUTES PER_CPU_DEF_ATTRIBUTES \ | 27 | /* |
| 28 | * s390 and alpha modules require percpu variables to be defined as | ||
| 29 | * weak to force the compiler to generate GOT based external | ||
| 30 | * references for them. This is necessary because percpu sections | ||
| 31 | * will be located outside of the usually addressable area. | ||
| 32 | * | ||
| 33 | * This definition puts the following two extra restrictions when | ||
| 34 | * defining percpu variables. | ||
| 35 | * | ||
| 36 | * 1. The symbol must be globally unique, even the static ones. | ||
| 37 | * 2. Static percpu variables cannot be defined inside a function. | ||
| 38 | * | ||
| 39 | * Archs which need weak percpu definitions should define | ||
| 40 | * ARCH_NEEDS_WEAK_PER_CPU in asm/percpu.h when necessary. | ||
| 41 | * | ||
| 42 | * To ensure that the generic code observes the above two | ||
| 43 | * restrictions, if CONFIG_DEBUG_FORCE_WEAK_PER_CPU is set weak | ||
| 44 | * definition is used for all cases. | ||
| 45 | */ | ||
| 46 | #if defined(ARCH_NEEDS_WEAK_PER_CPU) || defined(CONFIG_DEBUG_FORCE_WEAK_PER_CPU) | ||
| 47 | /* | ||
| 48 | * __pcpu_scope_* dummy variable is used to enforce scope. It | ||
| 49 | * receives the static modifier when it's used in front of | ||
| 50 | * DEFINE_PER_CPU() and will trigger build failure if | ||
| 51 | * DECLARE_PER_CPU() is used for the same variable. | ||
| 52 | * | ||
| 53 | * __pcpu_unique_* dummy variable is used to enforce symbol uniqueness | ||
| 54 | * such that hidden weak symbol collision, which will cause unrelated | ||
| 55 | * variables to share the same address, can be detected during build. | ||
| 56 | */ | ||
| 57 | #define DECLARE_PER_CPU_SECTION(type, name, sec) \ | ||
| 58 | extern __PCPU_DUMMY_ATTRS char __pcpu_scope_##name; \ | ||
| 59 | extern __PCPU_ATTRS(sec) __typeof__(type) per_cpu__##name | ||
| 60 | |||
| 61 | #define DEFINE_PER_CPU_SECTION(type, name, sec) \ | ||
| 62 | __PCPU_DUMMY_ATTRS char __pcpu_scope_##name; \ | ||
| 63 | __PCPU_DUMMY_ATTRS char __pcpu_unique_##name; \ | ||
| 64 | __PCPU_ATTRS(sec) PER_CPU_DEF_ATTRIBUTES __weak \ | ||
| 65 | __typeof__(type) per_cpu__##name | ||
| 66 | #else | ||
| 67 | /* | ||
| 68 | * Normal declaration and definition macros. | ||
| 69 | */ | ||
| 70 | #define DECLARE_PER_CPU_SECTION(type, name, sec) \ | ||
| 71 | extern __PCPU_ATTRS(sec) __typeof__(type) per_cpu__##name | ||
| 72 | |||
| 73 | #define DEFINE_PER_CPU_SECTION(type, name, sec) \ | ||
| 74 | __PCPU_ATTRS(sec) PER_CPU_DEF_ATTRIBUTES \ | ||
| 28 | __typeof__(type) per_cpu__##name | 75 | __typeof__(type) per_cpu__##name |
| 76 | #endif | ||
| 29 | 77 | ||
| 30 | /* | 78 | /* |
| 31 | * Variant on the per-CPU variable declaration/definition theme used for | 79 | * Variant on the per-CPU variable declaration/definition theme used for |
diff --git a/include/linux/percpu.h b/include/linux/percpu.h index 26fd9d12f050..878836ca999c 100644 --- a/include/linux/percpu.h +++ b/include/linux/percpu.h | |||
| @@ -34,7 +34,7 @@ | |||
| 34 | 34 | ||
| 35 | #ifdef CONFIG_SMP | 35 | #ifdef CONFIG_SMP |
| 36 | 36 | ||
| 37 | #ifdef CONFIG_HAVE_DYNAMIC_PER_CPU_AREA | 37 | #ifndef CONFIG_HAVE_LEGACY_PER_CPU_AREA |
| 38 | 38 | ||
| 39 | /* minimum unit size, also is the maximum supported allocation size */ | 39 | /* minimum unit size, also is the maximum supported allocation size */ |
| 40 | #define PCPU_MIN_UNIT_SIZE PFN_ALIGN(64 << 10) | 40 | #define PCPU_MIN_UNIT_SIZE PFN_ALIGN(64 << 10) |
| @@ -57,19 +57,70 @@ | |||
| 57 | #endif | 57 | #endif |
| 58 | 58 | ||
| 59 | extern void *pcpu_base_addr; | 59 | extern void *pcpu_base_addr; |
| 60 | extern const unsigned long *pcpu_unit_offsets; | ||
| 60 | 61 | ||
| 61 | typedef struct page * (*pcpu_get_page_fn_t)(unsigned int cpu, int pageno); | 62 | struct pcpu_group_info { |
| 62 | typedef void (*pcpu_populate_pte_fn_t)(unsigned long addr); | 63 | int nr_units; /* aligned # of units */ |
| 64 | unsigned long base_offset; /* base address offset */ | ||
| 65 | unsigned int *cpu_map; /* unit->cpu map, empty | ||
| 66 | * entries contain NR_CPUS */ | ||
| 67 | }; | ||
| 68 | |||
| 69 | struct pcpu_alloc_info { | ||
| 70 | size_t static_size; | ||
| 71 | size_t reserved_size; | ||
| 72 | size_t dyn_size; | ||
| 73 | size_t unit_size; | ||
| 74 | size_t atom_size; | ||
| 75 | size_t alloc_size; | ||
| 76 | size_t __ai_size; /* internal, don't use */ | ||
| 77 | int nr_groups; /* 0 if grouping unnecessary */ | ||
| 78 | struct pcpu_group_info groups[]; | ||
| 79 | }; | ||
| 63 | 80 | ||
| 64 | extern size_t __init pcpu_setup_first_chunk(pcpu_get_page_fn_t get_page_fn, | 81 | enum pcpu_fc { |
| 65 | size_t static_size, size_t reserved_size, | 82 | PCPU_FC_AUTO, |
| 66 | ssize_t dyn_size, ssize_t unit_size, | 83 | PCPU_FC_EMBED, |
| 67 | void *base_addr, | 84 | PCPU_FC_PAGE, |
| 68 | pcpu_populate_pte_fn_t populate_pte_fn); | ||
| 69 | 85 | ||
| 70 | extern ssize_t __init pcpu_embed_first_chunk( | 86 | PCPU_FC_NR, |
| 71 | size_t static_size, size_t reserved_size, | 87 | }; |
| 72 | ssize_t dyn_size, ssize_t unit_size); | 88 | extern const char *pcpu_fc_names[PCPU_FC_NR]; |
| 89 | |||
| 90 | extern enum pcpu_fc pcpu_chosen_fc; | ||
| 91 | |||
| 92 | typedef void * (*pcpu_fc_alloc_fn_t)(unsigned int cpu, size_t size, | ||
| 93 | size_t align); | ||
| 94 | typedef void (*pcpu_fc_free_fn_t)(void *ptr, size_t size); | ||
| 95 | typedef void (*pcpu_fc_populate_pte_fn_t)(unsigned long addr); | ||
| 96 | typedef int (pcpu_fc_cpu_distance_fn_t)(unsigned int from, unsigned int to); | ||
| 97 | |||
| 98 | extern struct pcpu_alloc_info * __init pcpu_alloc_alloc_info(int nr_groups, | ||
| 99 | int nr_units); | ||
| 100 | extern void __init pcpu_free_alloc_info(struct pcpu_alloc_info *ai); | ||
| 101 | |||
| 102 | extern struct pcpu_alloc_info * __init pcpu_build_alloc_info( | ||
| 103 | size_t reserved_size, ssize_t dyn_size, | ||
| 104 | size_t atom_size, | ||
| 105 | pcpu_fc_cpu_distance_fn_t cpu_distance_fn); | ||
| 106 | |||
| 107 | extern int __init pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai, | ||
| 108 | void *base_addr); | ||
| 109 | |||
| 110 | #ifdef CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK | ||
| 111 | extern int __init pcpu_embed_first_chunk(size_t reserved_size, ssize_t dyn_size, | ||
| 112 | size_t atom_size, | ||
| 113 | pcpu_fc_cpu_distance_fn_t cpu_distance_fn, | ||
| 114 | pcpu_fc_alloc_fn_t alloc_fn, | ||
| 115 | pcpu_fc_free_fn_t free_fn); | ||
| 116 | #endif | ||
| 117 | |||
| 118 | #ifdef CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK | ||
| 119 | extern int __init pcpu_page_first_chunk(size_t reserved_size, | ||
| 120 | pcpu_fc_alloc_fn_t alloc_fn, | ||
| 121 | pcpu_fc_free_fn_t free_fn, | ||
| 122 | pcpu_fc_populate_pte_fn_t populate_pte_fn); | ||
| 123 | #endif | ||
| 73 | 124 | ||
| 74 | /* | 125 | /* |
| 75 | * Use this to get to a cpu's version of the per-cpu object | 126 | * Use this to get to a cpu's version of the per-cpu object |
| @@ -80,7 +131,7 @@ extern ssize_t __init pcpu_embed_first_chunk( | |||
| 80 | 131 | ||
| 81 | extern void *__alloc_reserved_percpu(size_t size, size_t align); | 132 | extern void *__alloc_reserved_percpu(size_t size, size_t align); |
| 82 | 133 | ||
| 83 | #else /* CONFIG_HAVE_DYNAMIC_PER_CPU_AREA */ | 134 | #else /* CONFIG_HAVE_LEGACY_PER_CPU_AREA */ |
| 84 | 135 | ||
| 85 | struct percpu_data { | 136 | struct percpu_data { |
| 86 | void *ptrs[1]; | 137 | void *ptrs[1]; |
| @@ -99,11 +150,15 @@ struct percpu_data { | |||
| 99 | (__typeof__(ptr))__p->ptrs[(cpu)]; \ | 150 | (__typeof__(ptr))__p->ptrs[(cpu)]; \ |
| 100 | }) | 151 | }) |
| 101 | 152 | ||
| 102 | #endif /* CONFIG_HAVE_DYNAMIC_PER_CPU_AREA */ | 153 | #endif /* CONFIG_HAVE_LEGACY_PER_CPU_AREA */ |
| 103 | 154 | ||
| 104 | extern void *__alloc_percpu(size_t size, size_t align); | 155 | extern void *__alloc_percpu(size_t size, size_t align); |
| 105 | extern void free_percpu(void *__pdata); | 156 | extern void free_percpu(void *__pdata); |
| 106 | 157 | ||
| 158 | #ifndef CONFIG_HAVE_SETUP_PER_CPU_AREA | ||
| 159 | extern void __init setup_per_cpu_areas(void); | ||
| 160 | #endif | ||
| 161 | |||
| 107 | #else /* CONFIG_SMP */ | 162 | #else /* CONFIG_SMP */ |
| 108 | 163 | ||
| 109 | #define per_cpu_ptr(ptr, cpu) ({ (void)(cpu); (ptr); }) | 164 | #define per_cpu_ptr(ptr, cpu) ({ (void)(cpu); (ptr); }) |
| @@ -124,6 +179,13 @@ static inline void free_percpu(void *p) | |||
| 124 | kfree(p); | 179 | kfree(p); |
| 125 | } | 180 | } |
| 126 | 181 | ||
| 182 | static inline void __init setup_per_cpu_areas(void) { } | ||
| 183 | |||
| 184 | static inline void *pcpu_lpage_remapped(void *kaddr) | ||
| 185 | { | ||
| 186 | return NULL; | ||
| 187 | } | ||
| 188 | |||
| 127 | #endif /* CONFIG_SMP */ | 189 | #endif /* CONFIG_SMP */ |
| 128 | 190 | ||
| 129 | #define alloc_percpu(type) (type *)__alloc_percpu(sizeof(type), \ | 191 | #define alloc_percpu(type) (type *)__alloc_percpu(sizeof(type), \ |
diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h index 972f90d7a32f..e3fb25606706 100644 --- a/include/linux/perf_counter.h +++ b/include/linux/perf_counter.h | |||
| @@ -1,5 +1,9 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Performance counters: | 2 | * NOTE: this file will be removed in a future kernel release, it is |
| 3 | * provided as a courtesy copy of user-space code that relies on the | ||
| 4 | * old (pre-rename) symbols and constants. | ||
| 5 | * | ||
| 6 | * Performance events: | ||
| 3 | * | 7 | * |
| 4 | * Copyright (C) 2008-2009, Thomas Gleixner <tglx@linutronix.de> | 8 | * Copyright (C) 2008-2009, Thomas Gleixner <tglx@linutronix.de> |
| 5 | * Copyright (C) 2008-2009, Red Hat, Inc., Ingo Molnar | 9 | * Copyright (C) 2008-2009, Red Hat, Inc., Ingo Molnar |
| @@ -102,6 +106,8 @@ enum perf_sw_ids { | |||
| 102 | PERF_COUNT_SW_CPU_MIGRATIONS = 4, | 106 | PERF_COUNT_SW_CPU_MIGRATIONS = 4, |
| 103 | PERF_COUNT_SW_PAGE_FAULTS_MIN = 5, | 107 | PERF_COUNT_SW_PAGE_FAULTS_MIN = 5, |
| 104 | PERF_COUNT_SW_PAGE_FAULTS_MAJ = 6, | 108 | PERF_COUNT_SW_PAGE_FAULTS_MAJ = 6, |
| 109 | PERF_COUNT_SW_ALIGNMENT_FAULTS = 7, | ||
| 110 | PERF_COUNT_SW_EMULATION_FAULTS = 8, | ||
| 105 | 111 | ||
| 106 | PERF_COUNT_SW_MAX, /* non-ABI */ | 112 | PERF_COUNT_SW_MAX, /* non-ABI */ |
| 107 | }; | 113 | }; |
| @@ -131,19 +137,19 @@ enum perf_counter_sample_format { | |||
| 131 | * as specified by attr.read_format: | 137 | * as specified by attr.read_format: |
| 132 | * | 138 | * |
| 133 | * struct read_format { | 139 | * struct read_format { |
| 134 | * { u64 value; | 140 | * { u64 value; |
| 135 | * { u64 time_enabled; } && PERF_FORMAT_ENABLED | 141 | * { u64 time_enabled; } && PERF_FORMAT_ENABLED |
| 136 | * { u64 time_running; } && PERF_FORMAT_RUNNING | 142 | * { u64 time_running; } && PERF_FORMAT_RUNNING |
| 137 | * { u64 id; } && PERF_FORMAT_ID | 143 | * { u64 id; } && PERF_FORMAT_ID |
| 138 | * } && !PERF_FORMAT_GROUP | 144 | * } && !PERF_FORMAT_GROUP |
| 139 | * | 145 | * |
| 140 | * { u64 nr; | 146 | * { u64 nr; |
| 141 | * { u64 time_enabled; } && PERF_FORMAT_ENABLED | 147 | * { u64 time_enabled; } && PERF_FORMAT_ENABLED |
| 142 | * { u64 time_running; } && PERF_FORMAT_RUNNING | 148 | * { u64 time_running; } && PERF_FORMAT_RUNNING |
| 143 | * { u64 value; | 149 | * { u64 value; |
| 144 | * { u64 id; } && PERF_FORMAT_ID | 150 | * { u64 id; } && PERF_FORMAT_ID |
| 145 | * } cntr[nr]; | 151 | * } cntr[nr]; |
| 146 | * } && PERF_FORMAT_GROUP | 152 | * } && PERF_FORMAT_GROUP |
| 147 | * }; | 153 | * }; |
| 148 | */ | 154 | */ |
| 149 | enum perf_counter_read_format { | 155 | enum perf_counter_read_format { |
| @@ -199,10 +205,14 @@ struct perf_counter_attr { | |||
| 199 | inherit_stat : 1, /* per task counts */ | 205 | inherit_stat : 1, /* per task counts */ |
| 200 | enable_on_exec : 1, /* next exec enables */ | 206 | enable_on_exec : 1, /* next exec enables */ |
| 201 | task : 1, /* trace fork/exit */ | 207 | task : 1, /* trace fork/exit */ |
| 208 | watermark : 1, /* wakeup_watermark */ | ||
| 202 | 209 | ||
| 203 | __reserved_1 : 50; | 210 | __reserved_1 : 49; |
| 204 | 211 | ||
| 205 | __u32 wakeup_events; /* wakeup every n events */ | 212 | union { |
| 213 | __u32 wakeup_events; /* wakeup every n events */ | ||
| 214 | __u32 wakeup_watermark; /* bytes before wakeup */ | ||
| 215 | }; | ||
| 206 | __u32 __reserved_2; | 216 | __u32 __reserved_2; |
| 207 | 217 | ||
| 208 | __u64 __reserved_3; | 218 | __u64 __reserved_3; |
| @@ -217,6 +227,7 @@ struct perf_counter_attr { | |||
| 217 | #define PERF_COUNTER_IOC_RESET _IO ('$', 3) | 227 | #define PERF_COUNTER_IOC_RESET _IO ('$', 3) |
| 218 | #define PERF_COUNTER_IOC_PERIOD _IOW('$', 4, u64) | 228 | #define PERF_COUNTER_IOC_PERIOD _IOW('$', 4, u64) |
| 219 | #define PERF_COUNTER_IOC_SET_OUTPUT _IO ('$', 5) | 229 | #define PERF_COUNTER_IOC_SET_OUTPUT _IO ('$', 5) |
| 230 | #define PERF_COUNTER_IOC_SET_FILTER _IOW('$', 6, char *) | ||
| 220 | 231 | ||
| 221 | enum perf_counter_ioc_flags { | 232 | enum perf_counter_ioc_flags { |
| 222 | PERF_IOC_FLAG_GROUP = 1U << 0, | 233 | PERF_IOC_FLAG_GROUP = 1U << 0, |
| @@ -310,9 +321,9 @@ enum perf_event_type { | |||
| 310 | 321 | ||
| 311 | /* | 322 | /* |
| 312 | * struct { | 323 | * struct { |
| 313 | * struct perf_event_header header; | 324 | * struct perf_event_header header; |
| 314 | * u64 id; | 325 | * u64 id; |
| 315 | * u64 lost; | 326 | * u64 lost; |
| 316 | * }; | 327 | * }; |
| 317 | */ | 328 | */ |
| 318 | PERF_EVENT_LOST = 2, | 329 | PERF_EVENT_LOST = 2, |
| @@ -332,6 +343,7 @@ enum perf_event_type { | |||
| 332 | * struct perf_event_header header; | 343 | * struct perf_event_header header; |
| 333 | * u32 pid, ppid; | 344 | * u32 pid, ppid; |
| 334 | * u32 tid, ptid; | 345 | * u32 tid, ptid; |
| 346 | * u64 time; | ||
| 335 | * }; | 347 | * }; |
| 336 | */ | 348 | */ |
| 337 | PERF_EVENT_EXIT = 4, | 349 | PERF_EVENT_EXIT = 4, |
| @@ -352,16 +364,17 @@ enum perf_event_type { | |||
| 352 | * struct perf_event_header header; | 364 | * struct perf_event_header header; |
| 353 | * u32 pid, ppid; | 365 | * u32 pid, ppid; |
| 354 | * u32 tid, ptid; | 366 | * u32 tid, ptid; |
| 367 | * u64 time; | ||
| 355 | * }; | 368 | * }; |
| 356 | */ | 369 | */ |
| 357 | PERF_EVENT_FORK = 7, | 370 | PERF_EVENT_FORK = 7, |
| 358 | 371 | ||
| 359 | /* | 372 | /* |
| 360 | * struct { | 373 | * struct { |
| 361 | * struct perf_event_header header; | 374 | * struct perf_event_header header; |
| 362 | * u32 pid, tid; | 375 | * u32 pid, tid; |
| 363 | * | 376 | * |
| 364 | * struct read_format values; | 377 | * struct read_format values; |
| 365 | * }; | 378 | * }; |
| 366 | */ | 379 | */ |
| 367 | PERF_EVENT_READ = 8, | 380 | PERF_EVENT_READ = 8, |
| @@ -377,23 +390,23 @@ enum perf_event_type { | |||
| 377 | * { u64 id; } && PERF_SAMPLE_ID | 390 | * { u64 id; } && PERF_SAMPLE_ID |
| 378 | * { u64 stream_id;} && PERF_SAMPLE_STREAM_ID | 391 | * { u64 stream_id;} && PERF_SAMPLE_STREAM_ID |
| 379 | * { u32 cpu, res; } && PERF_SAMPLE_CPU | 392 | * { u32 cpu, res; } && PERF_SAMPLE_CPU |
| 380 | * { u64 period; } && PERF_SAMPLE_PERIOD | 393 | * { u64 period; } && PERF_SAMPLE_PERIOD |
| 381 | * | 394 | * |
| 382 | * { struct read_format values; } && PERF_SAMPLE_READ | 395 | * { struct read_format values; } && PERF_SAMPLE_READ |
| 383 | * | 396 | * |
| 384 | * { u64 nr, | 397 | * { u64 nr, |
| 385 | * u64 ips[nr]; } && PERF_SAMPLE_CALLCHAIN | 398 | * u64 ips[nr]; } && PERF_SAMPLE_CALLCHAIN |
| 386 | * | 399 | * |
| 387 | * # | 400 | * # |
| 388 | * # The RAW record below is opaque data wrt the ABI | 401 | * # The RAW record below is opaque data wrt the ABI |
| 389 | * # | 402 | * # |
| 390 | * # That is, the ABI doesn't make any promises wrt to | 403 | * # That is, the ABI doesn't make any promises wrt to |
| 391 | * # the stability of its content, it may vary depending | 404 | * # the stability of its content, it may vary depending |
| 392 | * # on event, hardware, kernel version and phase of | 405 | * # on event, hardware, kernel version and phase of |
| 393 | * # the moon. | 406 | * # the moon. |
| 394 | * # | 407 | * # |
| 395 | * # In other words, PERF_SAMPLE_RAW contents are not an ABI. | 408 | * # In other words, PERF_SAMPLE_RAW contents are not an ABI. |
| 396 | * # | 409 | * # |
| 397 | * | 410 | * |
| 398 | * { u32 size; | 411 | * { u32 size; |
| 399 | * char data[size];}&& PERF_SAMPLE_RAW | 412 | * char data[size];}&& PERF_SAMPLE_RAW |
| @@ -416,392 +429,16 @@ enum perf_callchain_context { | |||
| 416 | PERF_CONTEXT_MAX = (__u64)-4095, | 429 | PERF_CONTEXT_MAX = (__u64)-4095, |
| 417 | }; | 430 | }; |
| 418 | 431 | ||
| 419 | #define PERF_FLAG_FD_NO_GROUP (1U << 0) | 432 | #define PERF_FLAG_FD_NO_GROUP (1U << 0) |
| 420 | #define PERF_FLAG_FD_OUTPUT (1U << 1) | 433 | #define PERF_FLAG_FD_OUTPUT (1U << 1) |
| 421 | 434 | ||
| 422 | #ifdef __KERNEL__ | ||
| 423 | /* | 435 | /* |
| 424 | * Kernel-internal data types and definitions: | 436 | * In case some app still references the old symbols: |
| 425 | */ | 437 | */ |
| 426 | 438 | ||
| 427 | #ifdef CONFIG_PERF_COUNTERS | 439 | #define __NR_perf_counter_open __NR_perf_event_open |
| 428 | # include <asm/perf_counter.h> | ||
| 429 | #endif | ||
| 430 | |||
| 431 | #include <linux/list.h> | ||
| 432 | #include <linux/mutex.h> | ||
| 433 | #include <linux/rculist.h> | ||
| 434 | #include <linux/rcupdate.h> | ||
| 435 | #include <linux/spinlock.h> | ||
| 436 | #include <linux/hrtimer.h> | ||
| 437 | #include <linux/fs.h> | ||
| 438 | #include <linux/pid_namespace.h> | ||
| 439 | #include <asm/atomic.h> | ||
| 440 | |||
| 441 | #define PERF_MAX_STACK_DEPTH 255 | ||
| 442 | |||
| 443 | struct perf_callchain_entry { | ||
| 444 | __u64 nr; | ||
| 445 | __u64 ip[PERF_MAX_STACK_DEPTH]; | ||
| 446 | }; | ||
| 447 | |||
| 448 | struct perf_raw_record { | ||
| 449 | u32 size; | ||
| 450 | void *data; | ||
| 451 | }; | ||
| 452 | 440 | ||
| 453 | struct task_struct; | 441 | #define PR_TASK_PERF_COUNTERS_DISABLE PR_TASK_PERF_EVENTS_DISABLE |
| 442 | #define PR_TASK_PERF_COUNTERS_ENABLE PR_TASK_PERF_EVENTS_ENABLE | ||
| 454 | 443 | ||
| 455 | /** | ||
| 456 | * struct hw_perf_counter - performance counter hardware details: | ||
| 457 | */ | ||
| 458 | struct hw_perf_counter { | ||
| 459 | #ifdef CONFIG_PERF_COUNTERS | ||
| 460 | union { | ||
| 461 | struct { /* hardware */ | ||
| 462 | u64 config; | ||
| 463 | unsigned long config_base; | ||
| 464 | unsigned long counter_base; | ||
| 465 | int idx; | ||
| 466 | }; | ||
| 467 | union { /* software */ | ||
| 468 | atomic64_t count; | ||
| 469 | struct hrtimer hrtimer; | ||
| 470 | }; | ||
| 471 | }; | ||
| 472 | atomic64_t prev_count; | ||
| 473 | u64 sample_period; | ||
| 474 | u64 last_period; | ||
| 475 | atomic64_t period_left; | ||
| 476 | u64 interrupts; | ||
| 477 | |||
| 478 | u64 freq_count; | ||
| 479 | u64 freq_interrupts; | ||
| 480 | u64 freq_stamp; | ||
| 481 | #endif | ||
| 482 | }; | ||
| 483 | |||
| 484 | struct perf_counter; | ||
| 485 | |||
| 486 | /** | ||
| 487 | * struct pmu - generic performance monitoring unit | ||
| 488 | */ | ||
| 489 | struct pmu { | ||
| 490 | int (*enable) (struct perf_counter *counter); | ||
| 491 | void (*disable) (struct perf_counter *counter); | ||
| 492 | void (*read) (struct perf_counter *counter); | ||
| 493 | void (*unthrottle) (struct perf_counter *counter); | ||
| 494 | }; | ||
| 495 | |||
| 496 | /** | ||
| 497 | * enum perf_counter_active_state - the states of a counter | ||
| 498 | */ | ||
| 499 | enum perf_counter_active_state { | ||
| 500 | PERF_COUNTER_STATE_ERROR = -2, | ||
| 501 | PERF_COUNTER_STATE_OFF = -1, | ||
| 502 | PERF_COUNTER_STATE_INACTIVE = 0, | ||
| 503 | PERF_COUNTER_STATE_ACTIVE = 1, | ||
| 504 | }; | ||
| 505 | |||
| 506 | struct file; | ||
| 507 | |||
| 508 | struct perf_mmap_data { | ||
| 509 | struct rcu_head rcu_head; | ||
| 510 | int nr_pages; /* nr of data pages */ | ||
| 511 | int writable; /* are we writable */ | ||
| 512 | int nr_locked; /* nr pages mlocked */ | ||
| 513 | |||
| 514 | atomic_t poll; /* POLL_ for wakeups */ | ||
| 515 | atomic_t events; /* event limit */ | ||
| 516 | |||
| 517 | atomic_long_t head; /* write position */ | ||
| 518 | atomic_long_t done_head; /* completed head */ | ||
| 519 | |||
| 520 | atomic_t lock; /* concurrent writes */ | ||
| 521 | atomic_t wakeup; /* needs a wakeup */ | ||
| 522 | atomic_t lost; /* nr records lost */ | ||
| 523 | |||
| 524 | struct perf_counter_mmap_page *user_page; | ||
| 525 | void *data_pages[0]; | ||
| 526 | }; | ||
| 527 | |||
| 528 | struct perf_pending_entry { | ||
| 529 | struct perf_pending_entry *next; | ||
| 530 | void (*func)(struct perf_pending_entry *); | ||
| 531 | }; | ||
| 532 | |||
| 533 | /** | ||
| 534 | * struct perf_counter - performance counter kernel representation: | ||
| 535 | */ | ||
| 536 | struct perf_counter { | ||
| 537 | #ifdef CONFIG_PERF_COUNTERS | ||
| 538 | struct list_head list_entry; | ||
| 539 | struct list_head event_entry; | ||
| 540 | struct list_head sibling_list; | ||
| 541 | int nr_siblings; | ||
| 542 | struct perf_counter *group_leader; | ||
| 543 | struct perf_counter *output; | ||
| 544 | const struct pmu *pmu; | ||
| 545 | |||
| 546 | enum perf_counter_active_state state; | ||
| 547 | atomic64_t count; | ||
| 548 | |||
| 549 | /* | ||
| 550 | * These are the total time in nanoseconds that the counter | ||
| 551 | * has been enabled (i.e. eligible to run, and the task has | ||
| 552 | * been scheduled in, if this is a per-task counter) | ||
| 553 | * and running (scheduled onto the CPU), respectively. | ||
| 554 | * | ||
| 555 | * They are computed from tstamp_enabled, tstamp_running and | ||
| 556 | * tstamp_stopped when the counter is in INACTIVE or ACTIVE state. | ||
| 557 | */ | ||
| 558 | u64 total_time_enabled; | ||
| 559 | u64 total_time_running; | ||
| 560 | |||
| 561 | /* | ||
| 562 | * These are timestamps used for computing total_time_enabled | ||
| 563 | * and total_time_running when the counter is in INACTIVE or | ||
| 564 | * ACTIVE state, measured in nanoseconds from an arbitrary point | ||
| 565 | * in time. | ||
| 566 | * tstamp_enabled: the notional time when the counter was enabled | ||
| 567 | * tstamp_running: the notional time when the counter was scheduled on | ||
| 568 | * tstamp_stopped: in INACTIVE state, the notional time when the | ||
| 569 | * counter was scheduled off. | ||
| 570 | */ | ||
| 571 | u64 tstamp_enabled; | ||
| 572 | u64 tstamp_running; | ||
| 573 | u64 tstamp_stopped; | ||
| 574 | |||
| 575 | struct perf_counter_attr attr; | ||
| 576 | struct hw_perf_counter hw; | ||
| 577 | |||
| 578 | struct perf_counter_context *ctx; | ||
| 579 | struct file *filp; | ||
| 580 | |||
| 581 | /* | ||
| 582 | * These accumulate total time (in nanoseconds) that children | ||
| 583 | * counters have been enabled and running, respectively. | ||
| 584 | */ | ||
| 585 | atomic64_t child_total_time_enabled; | ||
| 586 | atomic64_t child_total_time_running; | ||
| 587 | |||
| 588 | /* | ||
| 589 | * Protect attach/detach and child_list: | ||
| 590 | */ | ||
| 591 | struct mutex child_mutex; | ||
| 592 | struct list_head child_list; | ||
| 593 | struct perf_counter *parent; | ||
| 594 | |||
| 595 | int oncpu; | ||
| 596 | int cpu; | ||
| 597 | |||
| 598 | struct list_head owner_entry; | ||
| 599 | struct task_struct *owner; | ||
| 600 | |||
| 601 | /* mmap bits */ | ||
| 602 | struct mutex mmap_mutex; | ||
| 603 | atomic_t mmap_count; | ||
| 604 | struct perf_mmap_data *data; | ||
| 605 | |||
| 606 | /* poll related */ | ||
| 607 | wait_queue_head_t waitq; | ||
| 608 | struct fasync_struct *fasync; | ||
| 609 | |||
| 610 | /* delayed work for NMIs and such */ | ||
| 611 | int pending_wakeup; | ||
| 612 | int pending_kill; | ||
| 613 | int pending_disable; | ||
| 614 | struct perf_pending_entry pending; | ||
| 615 | |||
| 616 | atomic_t event_limit; | ||
| 617 | |||
| 618 | void (*destroy)(struct perf_counter *); | ||
| 619 | struct rcu_head rcu_head; | ||
| 620 | |||
| 621 | struct pid_namespace *ns; | ||
| 622 | u64 id; | ||
| 623 | #endif | ||
| 624 | }; | ||
| 625 | |||
| 626 | /** | ||
| 627 | * struct perf_counter_context - counter context structure | ||
| 628 | * | ||
| 629 | * Used as a container for task counters and CPU counters as well: | ||
| 630 | */ | ||
| 631 | struct perf_counter_context { | ||
| 632 | /* | ||
| 633 | * Protect the states of the counters in the list, | ||
| 634 | * nr_active, and the list: | ||
| 635 | */ | ||
| 636 | spinlock_t lock; | ||
| 637 | /* | ||
| 638 | * Protect the list of counters. Locking either mutex or lock | ||
| 639 | * is sufficient to ensure the list doesn't change; to change | ||
| 640 | * the list you need to lock both the mutex and the spinlock. | ||
| 641 | */ | ||
| 642 | struct mutex mutex; | ||
| 643 | |||
| 644 | struct list_head counter_list; | ||
| 645 | struct list_head event_list; | ||
| 646 | int nr_counters; | ||
| 647 | int nr_active; | ||
| 648 | int is_active; | ||
| 649 | int nr_stat; | ||
| 650 | atomic_t refcount; | ||
| 651 | struct task_struct *task; | ||
| 652 | |||
| 653 | /* | ||
| 654 | * Context clock, runs when context enabled. | ||
| 655 | */ | ||
| 656 | u64 time; | ||
| 657 | u64 timestamp; | ||
| 658 | |||
| 659 | /* | ||
| 660 | * These fields let us detect when two contexts have both | ||
| 661 | * been cloned (inherited) from a common ancestor. | ||
| 662 | */ | ||
| 663 | struct perf_counter_context *parent_ctx; | ||
| 664 | u64 parent_gen; | ||
| 665 | u64 generation; | ||
| 666 | int pin_count; | ||
| 667 | struct rcu_head rcu_head; | ||
| 668 | }; | ||
| 669 | |||
| 670 | /** | ||
| 671 | * struct perf_counter_cpu_context - per cpu counter context structure | ||
| 672 | */ | ||
| 673 | struct perf_cpu_context { | ||
| 674 | struct perf_counter_context ctx; | ||
| 675 | struct perf_counter_context *task_ctx; | ||
| 676 | int active_oncpu; | ||
| 677 | int max_pertask; | ||
| 678 | int exclusive; | ||
| 679 | |||
| 680 | /* | ||
| 681 | * Recursion avoidance: | ||
| 682 | * | ||
| 683 | * task, softirq, irq, nmi context | ||
| 684 | */ | ||
| 685 | int recursion[4]; | ||
| 686 | }; | ||
| 687 | |||
| 688 | #ifdef CONFIG_PERF_COUNTERS | ||
| 689 | |||
| 690 | /* | ||
| 691 | * Set by architecture code: | ||
| 692 | */ | ||
| 693 | extern int perf_max_counters; | ||
| 694 | |||
| 695 | extern const struct pmu *hw_perf_counter_init(struct perf_counter *counter); | ||
| 696 | |||
| 697 | extern void perf_counter_task_sched_in(struct task_struct *task, int cpu); | ||
| 698 | extern void perf_counter_task_sched_out(struct task_struct *task, | ||
| 699 | struct task_struct *next, int cpu); | ||
| 700 | extern void perf_counter_task_tick(struct task_struct *task, int cpu); | ||
| 701 | extern int perf_counter_init_task(struct task_struct *child); | ||
| 702 | extern void perf_counter_exit_task(struct task_struct *child); | ||
| 703 | extern void perf_counter_free_task(struct task_struct *task); | ||
| 704 | extern void set_perf_counter_pending(void); | ||
| 705 | extern void perf_counter_do_pending(void); | ||
| 706 | extern void perf_counter_print_debug(void); | ||
| 707 | extern void __perf_disable(void); | ||
| 708 | extern bool __perf_enable(void); | ||
| 709 | extern void perf_disable(void); | ||
| 710 | extern void perf_enable(void); | ||
| 711 | extern int perf_counter_task_disable(void); | ||
| 712 | extern int perf_counter_task_enable(void); | ||
| 713 | extern int hw_perf_group_sched_in(struct perf_counter *group_leader, | ||
| 714 | struct perf_cpu_context *cpuctx, | ||
| 715 | struct perf_counter_context *ctx, int cpu); | ||
| 716 | extern void perf_counter_update_userpage(struct perf_counter *counter); | ||
| 717 | |||
| 718 | struct perf_sample_data { | ||
| 719 | struct pt_regs *regs; | ||
| 720 | u64 addr; | ||
| 721 | u64 period; | ||
| 722 | struct perf_raw_record *raw; | ||
| 723 | }; | ||
| 724 | |||
| 725 | extern int perf_counter_overflow(struct perf_counter *counter, int nmi, | ||
| 726 | struct perf_sample_data *data); | ||
| 727 | extern void perf_counter_output(struct perf_counter *counter, int nmi, | ||
| 728 | struct perf_sample_data *data); | ||
| 729 | |||
| 730 | /* | ||
| 731 | * Return 1 for a software counter, 0 for a hardware counter | ||
| 732 | */ | ||
| 733 | static inline int is_software_counter(struct perf_counter *counter) | ||
| 734 | { | ||
| 735 | return (counter->attr.type != PERF_TYPE_RAW) && | ||
| 736 | (counter->attr.type != PERF_TYPE_HARDWARE) && | ||
| 737 | (counter->attr.type != PERF_TYPE_HW_CACHE); | ||
| 738 | } | ||
| 739 | |||
| 740 | extern atomic_t perf_swcounter_enabled[PERF_COUNT_SW_MAX]; | ||
| 741 | |||
| 742 | extern void __perf_swcounter_event(u32, u64, int, struct pt_regs *, u64); | ||
| 743 | |||
| 744 | static inline void | ||
| 745 | perf_swcounter_event(u32 event, u64 nr, int nmi, struct pt_regs *regs, u64 addr) | ||
| 746 | { | ||
| 747 | if (atomic_read(&perf_swcounter_enabled[event])) | ||
| 748 | __perf_swcounter_event(event, nr, nmi, regs, addr); | ||
| 749 | } | ||
| 750 | |||
| 751 | extern void __perf_counter_mmap(struct vm_area_struct *vma); | ||
| 752 | |||
| 753 | static inline void perf_counter_mmap(struct vm_area_struct *vma) | ||
| 754 | { | ||
| 755 | if (vma->vm_flags & VM_EXEC) | ||
| 756 | __perf_counter_mmap(vma); | ||
| 757 | } | ||
| 758 | |||
| 759 | extern void perf_counter_comm(struct task_struct *tsk); | ||
| 760 | extern void perf_counter_fork(struct task_struct *tsk); | ||
| 761 | |||
| 762 | extern struct perf_callchain_entry *perf_callchain(struct pt_regs *regs); | ||
| 763 | |||
| 764 | extern int sysctl_perf_counter_paranoid; | ||
| 765 | extern int sysctl_perf_counter_mlock; | ||
| 766 | extern int sysctl_perf_counter_sample_rate; | ||
| 767 | |||
| 768 | extern void perf_counter_init(void); | ||
| 769 | extern void perf_tpcounter_event(int event_id, u64 addr, u64 count, | ||
| 770 | void *record, int entry_size); | ||
| 771 | |||
| 772 | #ifndef perf_misc_flags | ||
| 773 | #define perf_misc_flags(regs) (user_mode(regs) ? PERF_EVENT_MISC_USER : \ | ||
| 774 | PERF_EVENT_MISC_KERNEL) | ||
| 775 | #define perf_instruction_pointer(regs) instruction_pointer(regs) | ||
| 776 | #endif | ||
| 777 | |||
| 778 | #else | ||
| 779 | static inline void | ||
| 780 | perf_counter_task_sched_in(struct task_struct *task, int cpu) { } | ||
| 781 | static inline void | ||
| 782 | perf_counter_task_sched_out(struct task_struct *task, | ||
| 783 | struct task_struct *next, int cpu) { } | ||
| 784 | static inline void | ||
| 785 | perf_counter_task_tick(struct task_struct *task, int cpu) { } | ||
| 786 | static inline int perf_counter_init_task(struct task_struct *child) { return 0; } | ||
| 787 | static inline void perf_counter_exit_task(struct task_struct *child) { } | ||
| 788 | static inline void perf_counter_free_task(struct task_struct *task) { } | ||
| 789 | static inline void perf_counter_do_pending(void) { } | ||
| 790 | static inline void perf_counter_print_debug(void) { } | ||
| 791 | static inline void perf_disable(void) { } | ||
| 792 | static inline void perf_enable(void) { } | ||
| 793 | static inline int perf_counter_task_disable(void) { return -EINVAL; } | ||
| 794 | static inline int perf_counter_task_enable(void) { return -EINVAL; } | ||
| 795 | |||
| 796 | static inline void | ||
| 797 | perf_swcounter_event(u32 event, u64 nr, int nmi, | ||
| 798 | struct pt_regs *regs, u64 addr) { } | ||
| 799 | |||
| 800 | static inline void perf_counter_mmap(struct vm_area_struct *vma) { } | ||
| 801 | static inline void perf_counter_comm(struct task_struct *tsk) { } | ||
| 802 | static inline void perf_counter_fork(struct task_struct *tsk) { } | ||
| 803 | static inline void perf_counter_init(void) { } | ||
| 804 | #endif | ||
| 805 | |||
| 806 | #endif /* __KERNEL__ */ | ||
| 807 | #endif /* _LINUX_PERF_COUNTER_H */ | 444 | #endif /* _LINUX_PERF_COUNTER_H */ |
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h new file mode 100644 index 000000000000..43adbd7f0010 --- /dev/null +++ b/include/linux/perf_event.h | |||
| @@ -0,0 +1,916 @@ | |||
| 1 | /* | ||
| 2 | * Performance events: | ||
| 3 | * | ||
| 4 | * Copyright (C) 2008-2009, Thomas Gleixner <tglx@linutronix.de> | ||
| 5 | * Copyright (C) 2008-2009, Red Hat, Inc., Ingo Molnar | ||
| 6 | * Copyright (C) 2008-2009, Red Hat, Inc., Peter Zijlstra | ||
| 7 | * | ||
| 8 | * Data type definitions, declarations, prototypes. | ||
| 9 | * | ||
| 10 | * Started by: Thomas Gleixner and Ingo Molnar | ||
| 11 | * | ||
| 12 | * For licencing details see kernel-base/COPYING | ||
| 13 | */ | ||
| 14 | #ifndef _LINUX_PERF_EVENT_H | ||
| 15 | #define _LINUX_PERF_EVENT_H | ||
| 16 | |||
| 17 | #include <linux/types.h> | ||
| 18 | #include <linux/ioctl.h> | ||
| 19 | #include <asm/byteorder.h> | ||
| 20 | |||
| 21 | #ifdef CONFIG_HAVE_HW_BREAKPOINT | ||
| 22 | #include <asm/hw_breakpoint.h> | ||
| 23 | #endif | ||
| 24 | |||
| 25 | /* | ||
| 26 | * User-space ABI bits: | ||
| 27 | */ | ||
| 28 | |||
| 29 | /* | ||
| 30 | * attr.type | ||
| 31 | */ | ||
| 32 | enum perf_type_id { | ||
| 33 | PERF_TYPE_HARDWARE = 0, | ||
| 34 | PERF_TYPE_SOFTWARE = 1, | ||
| 35 | PERF_TYPE_TRACEPOINT = 2, | ||
| 36 | PERF_TYPE_HW_CACHE = 3, | ||
| 37 | PERF_TYPE_RAW = 4, | ||
| 38 | PERF_TYPE_BREAKPOINT = 5, | ||
| 39 | |||
| 40 | PERF_TYPE_MAX, /* non-ABI */ | ||
| 41 | }; | ||
| 42 | |||
| 43 | /* | ||
| 44 | * Generalized performance event event_id types, used by the | ||
| 45 | * attr.event_id parameter of the sys_perf_event_open() | ||
| 46 | * syscall: | ||
| 47 | */ | ||
| 48 | enum perf_hw_id { | ||
| 49 | /* | ||
| 50 | * Common hardware events, generalized by the kernel: | ||
| 51 | */ | ||
| 52 | PERF_COUNT_HW_CPU_CYCLES = 0, | ||
| 53 | PERF_COUNT_HW_INSTRUCTIONS = 1, | ||
| 54 | PERF_COUNT_HW_CACHE_REFERENCES = 2, | ||
| 55 | PERF_COUNT_HW_CACHE_MISSES = 3, | ||
| 56 | PERF_COUNT_HW_BRANCH_INSTRUCTIONS = 4, | ||
| 57 | PERF_COUNT_HW_BRANCH_MISSES = 5, | ||
| 58 | PERF_COUNT_HW_BUS_CYCLES = 6, | ||
| 59 | |||
| 60 | PERF_COUNT_HW_MAX, /* non-ABI */ | ||
| 61 | }; | ||
| 62 | |||
| 63 | /* | ||
| 64 | * Generalized hardware cache events: | ||
| 65 | * | ||
| 66 | * { L1-D, L1-I, LLC, ITLB, DTLB, BPU } x | ||
| 67 | * { read, write, prefetch } x | ||
| 68 | * { accesses, misses } | ||
| 69 | */ | ||
| 70 | enum perf_hw_cache_id { | ||
| 71 | PERF_COUNT_HW_CACHE_L1D = 0, | ||
| 72 | PERF_COUNT_HW_CACHE_L1I = 1, | ||
| 73 | PERF_COUNT_HW_CACHE_LL = 2, | ||
| 74 | PERF_COUNT_HW_CACHE_DTLB = 3, | ||
| 75 | PERF_COUNT_HW_CACHE_ITLB = 4, | ||
| 76 | PERF_COUNT_HW_CACHE_BPU = 5, | ||
| 77 | |||
| 78 | PERF_COUNT_HW_CACHE_MAX, /* non-ABI */ | ||
| 79 | }; | ||
| 80 | |||
| 81 | enum perf_hw_cache_op_id { | ||
| 82 | PERF_COUNT_HW_CACHE_OP_READ = 0, | ||
| 83 | PERF_COUNT_HW_CACHE_OP_WRITE = 1, | ||
| 84 | PERF_COUNT_HW_CACHE_OP_PREFETCH = 2, | ||
| 85 | |||
| 86 | PERF_COUNT_HW_CACHE_OP_MAX, /* non-ABI */ | ||
| 87 | }; | ||
| 88 | |||
| 89 | enum perf_hw_cache_op_result_id { | ||
| 90 | PERF_COUNT_HW_CACHE_RESULT_ACCESS = 0, | ||
| 91 | PERF_COUNT_HW_CACHE_RESULT_MISS = 1, | ||
| 92 | |||
| 93 | PERF_COUNT_HW_CACHE_RESULT_MAX, /* non-ABI */ | ||
| 94 | }; | ||
| 95 | |||
| 96 | /* | ||
| 97 | * Special "software" events provided by the kernel, even if the hardware | ||
| 98 | * does not support performance events. These events measure various | ||
| 99 | * physical and sw events of the kernel (and allow the profiling of them as | ||
| 100 | * well): | ||
| 101 | */ | ||
| 102 | enum perf_sw_ids { | ||
| 103 | PERF_COUNT_SW_CPU_CLOCK = 0, | ||
| 104 | PERF_COUNT_SW_TASK_CLOCK = 1, | ||
| 105 | PERF_COUNT_SW_PAGE_FAULTS = 2, | ||
| 106 | PERF_COUNT_SW_CONTEXT_SWITCHES = 3, | ||
| 107 | PERF_COUNT_SW_CPU_MIGRATIONS = 4, | ||
| 108 | PERF_COUNT_SW_PAGE_FAULTS_MIN = 5, | ||
| 109 | PERF_COUNT_SW_PAGE_FAULTS_MAJ = 6, | ||
| 110 | PERF_COUNT_SW_ALIGNMENT_FAULTS = 7, | ||
| 111 | PERF_COUNT_SW_EMULATION_FAULTS = 8, | ||
| 112 | |||
| 113 | PERF_COUNT_SW_MAX, /* non-ABI */ | ||
| 114 | }; | ||
| 115 | |||
| 116 | /* | ||
| 117 | * Bits that can be set in attr.sample_type to request information | ||
| 118 | * in the overflow packets. | ||
| 119 | */ | ||
| 120 | enum perf_event_sample_format { | ||
| 121 | PERF_SAMPLE_IP = 1U << 0, | ||
| 122 | PERF_SAMPLE_TID = 1U << 1, | ||
| 123 | PERF_SAMPLE_TIME = 1U << 2, | ||
| 124 | PERF_SAMPLE_ADDR = 1U << 3, | ||
| 125 | PERF_SAMPLE_READ = 1U << 4, | ||
| 126 | PERF_SAMPLE_CALLCHAIN = 1U << 5, | ||
| 127 | PERF_SAMPLE_ID = 1U << 6, | ||
| 128 | PERF_SAMPLE_CPU = 1U << 7, | ||
| 129 | PERF_SAMPLE_PERIOD = 1U << 8, | ||
| 130 | PERF_SAMPLE_STREAM_ID = 1U << 9, | ||
| 131 | PERF_SAMPLE_RAW = 1U << 10, | ||
| 132 | |||
| 133 | PERF_SAMPLE_MAX = 1U << 11, /* non-ABI */ | ||
| 134 | }; | ||
| 135 | |||
| 136 | /* | ||
| 137 | * The format of the data returned by read() on a perf event fd, | ||
| 138 | * as specified by attr.read_format: | ||
| 139 | * | ||
| 140 | * struct read_format { | ||
| 141 | * { u64 value; | ||
| 142 | * { u64 time_enabled; } && PERF_FORMAT_ENABLED | ||
| 143 | * { u64 time_running; } && PERF_FORMAT_RUNNING | ||
| 144 | * { u64 id; } && PERF_FORMAT_ID | ||
| 145 | * } && !PERF_FORMAT_GROUP | ||
| 146 | * | ||
| 147 | * { u64 nr; | ||
| 148 | * { u64 time_enabled; } && PERF_FORMAT_ENABLED | ||
| 149 | * { u64 time_running; } && PERF_FORMAT_RUNNING | ||
| 150 | * { u64 value; | ||
| 151 | * { u64 id; } && PERF_FORMAT_ID | ||
| 152 | * } cntr[nr]; | ||
| 153 | * } && PERF_FORMAT_GROUP | ||
| 154 | * }; | ||
| 155 | */ | ||
| 156 | enum perf_event_read_format { | ||
| 157 | PERF_FORMAT_TOTAL_TIME_ENABLED = 1U << 0, | ||
| 158 | PERF_FORMAT_TOTAL_TIME_RUNNING = 1U << 1, | ||
| 159 | PERF_FORMAT_ID = 1U << 2, | ||
| 160 | PERF_FORMAT_GROUP = 1U << 3, | ||
| 161 | |||
| 162 | PERF_FORMAT_MAX = 1U << 4, /* non-ABI */ | ||
| 163 | }; | ||
| 164 | |||
| 165 | #define PERF_ATTR_SIZE_VER0 64 /* sizeof first published struct */ | ||
| 166 | |||
| 167 | /* | ||
| 168 | * Hardware event_id to monitor via a performance monitoring event: | ||
| 169 | */ | ||
| 170 | struct perf_event_attr { | ||
| 171 | |||
| 172 | /* | ||
| 173 | * Major type: hardware/software/tracepoint/etc. | ||
| 174 | */ | ||
| 175 | __u32 type; | ||
| 176 | |||
| 177 | /* | ||
| 178 | * Size of the attr structure, for fwd/bwd compat. | ||
| 179 | */ | ||
| 180 | __u32 size; | ||
| 181 | |||
| 182 | /* | ||
| 183 | * Type specific configuration information. | ||
| 184 | */ | ||
| 185 | __u64 config; | ||
| 186 | |||
| 187 | union { | ||
| 188 | __u64 sample_period; | ||
| 189 | __u64 sample_freq; | ||
| 190 | }; | ||
| 191 | |||
| 192 | __u64 sample_type; | ||
| 193 | __u64 read_format; | ||
| 194 | |||
| 195 | __u64 disabled : 1, /* off by default */ | ||
| 196 | inherit : 1, /* children inherit it */ | ||
| 197 | pinned : 1, /* must always be on PMU */ | ||
| 198 | exclusive : 1, /* only group on PMU */ | ||
| 199 | exclude_user : 1, /* don't count user */ | ||
| 200 | exclude_kernel : 1, /* ditto kernel */ | ||
| 201 | exclude_hv : 1, /* ditto hypervisor */ | ||
| 202 | exclude_idle : 1, /* don't count when idle */ | ||
| 203 | mmap : 1, /* include mmap data */ | ||
| 204 | comm : 1, /* include comm data */ | ||
| 205 | freq : 1, /* use freq, not period */ | ||
| 206 | inherit_stat : 1, /* per task counts */ | ||
| 207 | enable_on_exec : 1, /* next exec enables */ | ||
| 208 | task : 1, /* trace fork/exit */ | ||
| 209 | watermark : 1, /* wakeup_watermark */ | ||
| 210 | |||
| 211 | __reserved_1 : 49; | ||
| 212 | |||
| 213 | union { | ||
| 214 | __u32 wakeup_events; /* wakeup every n events */ | ||
| 215 | __u32 wakeup_watermark; /* bytes before wakeup */ | ||
| 216 | }; | ||
| 217 | |||
| 218 | union { | ||
| 219 | struct { /* Hardware breakpoint info */ | ||
| 220 | __u64 bp_addr; | ||
| 221 | __u32 bp_type; | ||
| 222 | __u32 bp_len; | ||
| 223 | }; | ||
| 224 | }; | ||
| 225 | |||
| 226 | __u32 __reserved_2; | ||
| 227 | |||
| 228 | __u64 __reserved_3; | ||
| 229 | }; | ||
| 230 | |||
| 231 | /* | ||
| 232 | * Ioctls that can be done on a perf event fd: | ||
| 233 | */ | ||
| 234 | #define PERF_EVENT_IOC_ENABLE _IO ('$', 0) | ||
| 235 | #define PERF_EVENT_IOC_DISABLE _IO ('$', 1) | ||
| 236 | #define PERF_EVENT_IOC_REFRESH _IO ('$', 2) | ||
| 237 | #define PERF_EVENT_IOC_RESET _IO ('$', 3) | ||
| 238 | #define PERF_EVENT_IOC_PERIOD _IOW('$', 4, __u64) | ||
| 239 | #define PERF_EVENT_IOC_SET_OUTPUT _IO ('$', 5) | ||
| 240 | #define PERF_EVENT_IOC_SET_FILTER _IOW('$', 6, char *) | ||
| 241 | |||
| 242 | enum perf_event_ioc_flags { | ||
| 243 | PERF_IOC_FLAG_GROUP = 1U << 0, | ||
| 244 | }; | ||
| 245 | |||
| 246 | /* | ||
| 247 | * Structure of the page that can be mapped via mmap | ||
| 248 | */ | ||
| 249 | struct perf_event_mmap_page { | ||
| 250 | __u32 version; /* version number of this structure */ | ||
| 251 | __u32 compat_version; /* lowest version this is compat with */ | ||
| 252 | |||
| 253 | /* | ||
| 254 | * Bits needed to read the hw events in user-space. | ||
| 255 | * | ||
| 256 | * u32 seq; | ||
| 257 | * s64 count; | ||
| 258 | * | ||
| 259 | * do { | ||
| 260 | * seq = pc->lock; | ||
| 261 | * | ||
| 262 | * barrier() | ||
| 263 | * if (pc->index) { | ||
| 264 | * count = pmc_read(pc->index - 1); | ||
| 265 | * count += pc->offset; | ||
| 266 | * } else | ||
| 267 | * goto regular_read; | ||
| 268 | * | ||
| 269 | * barrier(); | ||
| 270 | * } while (pc->lock != seq); | ||
| 271 | * | ||
| 272 | * NOTE: for obvious reason this only works on self-monitoring | ||
| 273 | * processes. | ||
| 274 | */ | ||
| 275 | __u32 lock; /* seqlock for synchronization */ | ||
| 276 | __u32 index; /* hardware event identifier */ | ||
| 277 | __s64 offset; /* add to hardware event value */ | ||
| 278 | __u64 time_enabled; /* time event active */ | ||
| 279 | __u64 time_running; /* time event on cpu */ | ||
| 280 | |||
| 281 | /* | ||
| 282 | * Hole for extension of the self monitor capabilities | ||
| 283 | */ | ||
| 284 | |||
| 285 | __u64 __reserved[123]; /* align to 1k */ | ||
| 286 | |||
| 287 | /* | ||
| 288 | * Control data for the mmap() data buffer. | ||
| 289 | * | ||
| 290 | * User-space reading the @data_head value should issue an rmb(), on | ||
| 291 | * SMP capable platforms, after reading this value -- see | ||
| 292 | * perf_event_wakeup(). | ||
| 293 | * | ||
| 294 | * When the mapping is PROT_WRITE the @data_tail value should be | ||
| 295 | * written by userspace to reflect the last read data. In this case | ||
| 296 | * the kernel will not over-write unread data. | ||
| 297 | */ | ||
| 298 | __u64 data_head; /* head in the data section */ | ||
| 299 | __u64 data_tail; /* user-space written tail */ | ||
| 300 | }; | ||
| 301 | |||
| 302 | #define PERF_RECORD_MISC_CPUMODE_MASK (3 << 0) | ||
| 303 | #define PERF_RECORD_MISC_CPUMODE_UNKNOWN (0 << 0) | ||
| 304 | #define PERF_RECORD_MISC_KERNEL (1 << 0) | ||
| 305 | #define PERF_RECORD_MISC_USER (2 << 0) | ||
| 306 | #define PERF_RECORD_MISC_HYPERVISOR (3 << 0) | ||
| 307 | |||
| 308 | struct perf_event_header { | ||
| 309 | __u32 type; | ||
| 310 | __u16 misc; | ||
| 311 | __u16 size; | ||
| 312 | }; | ||
| 313 | |||
| 314 | enum perf_event_type { | ||
| 315 | |||
| 316 | /* | ||
| 317 | * The MMAP events record the PROT_EXEC mappings so that we can | ||
| 318 | * correlate userspace IPs to code. They have the following structure: | ||
| 319 | * | ||
| 320 | * struct { | ||
| 321 | * struct perf_event_header header; | ||
| 322 | * | ||
| 323 | * u32 pid, tid; | ||
| 324 | * u64 addr; | ||
| 325 | * u64 len; | ||
| 326 | * u64 pgoff; | ||
| 327 | * char filename[]; | ||
| 328 | * }; | ||
| 329 | */ | ||
| 330 | PERF_RECORD_MMAP = 1, | ||
| 331 | |||
| 332 | /* | ||
| 333 | * struct { | ||
| 334 | * struct perf_event_header header; | ||
| 335 | * u64 id; | ||
| 336 | * u64 lost; | ||
| 337 | * }; | ||
| 338 | */ | ||
| 339 | PERF_RECORD_LOST = 2, | ||
| 340 | |||
| 341 | /* | ||
| 342 | * struct { | ||
| 343 | * struct perf_event_header header; | ||
| 344 | * | ||
| 345 | * u32 pid, tid; | ||
| 346 | * char comm[]; | ||
| 347 | * }; | ||
| 348 | */ | ||
| 349 | PERF_RECORD_COMM = 3, | ||
| 350 | |||
| 351 | /* | ||
| 352 | * struct { | ||
| 353 | * struct perf_event_header header; | ||
| 354 | * u32 pid, ppid; | ||
| 355 | * u32 tid, ptid; | ||
| 356 | * u64 time; | ||
| 357 | * }; | ||
| 358 | */ | ||
| 359 | PERF_RECORD_EXIT = 4, | ||
| 360 | |||
| 361 | /* | ||
| 362 | * struct { | ||
| 363 | * struct perf_event_header header; | ||
| 364 | * u64 time; | ||
| 365 | * u64 id; | ||
| 366 | * u64 stream_id; | ||
| 367 | * }; | ||
| 368 | */ | ||
| 369 | PERF_RECORD_THROTTLE = 5, | ||
| 370 | PERF_RECORD_UNTHROTTLE = 6, | ||
| 371 | |||
| 372 | /* | ||
| 373 | * struct { | ||
| 374 | * struct perf_event_header header; | ||
| 375 | * u32 pid, ppid; | ||
| 376 | * u32 tid, ptid; | ||
| 377 | * u64 time; | ||
| 378 | * }; | ||
| 379 | */ | ||
| 380 | PERF_RECORD_FORK = 7, | ||
| 381 | |||
| 382 | /* | ||
| 383 | * struct { | ||
| 384 | * struct perf_event_header header; | ||
| 385 | * u32 pid, tid; | ||
| 386 | * | ||
| 387 | * struct read_format values; | ||
| 388 | * }; | ||
| 389 | */ | ||
| 390 | PERF_RECORD_READ = 8, | ||
| 391 | |||
| 392 | /* | ||
| 393 | * struct { | ||
| 394 | * struct perf_event_header header; | ||
| 395 | * | ||
| 396 | * { u64 ip; } && PERF_SAMPLE_IP | ||
| 397 | * { u32 pid, tid; } && PERF_SAMPLE_TID | ||
| 398 | * { u64 time; } && PERF_SAMPLE_TIME | ||
| 399 | * { u64 addr; } && PERF_SAMPLE_ADDR | ||
| 400 | * { u64 id; } && PERF_SAMPLE_ID | ||
| 401 | * { u64 stream_id;} && PERF_SAMPLE_STREAM_ID | ||
| 402 | * { u32 cpu, res; } && PERF_SAMPLE_CPU | ||
| 403 | * { u64 period; } && PERF_SAMPLE_PERIOD | ||
| 404 | * | ||
| 405 | * { struct read_format values; } && PERF_SAMPLE_READ | ||
| 406 | * | ||
| 407 | * { u64 nr, | ||
| 408 | * u64 ips[nr]; } && PERF_SAMPLE_CALLCHAIN | ||
| 409 | * | ||
| 410 | * # | ||
| 411 | * # The RAW record below is opaque data wrt the ABI | ||
| 412 | * # | ||
| 413 | * # That is, the ABI doesn't make any promises wrt to | ||
| 414 | * # the stability of its content, it may vary depending | ||
| 415 | * # on event, hardware, kernel version and phase of | ||
| 416 | * # the moon. | ||
| 417 | * # | ||
| 418 | * # In other words, PERF_SAMPLE_RAW contents are not an ABI. | ||
| 419 | * # | ||
| 420 | * | ||
| 421 | * { u32 size; | ||
| 422 | * char data[size];}&& PERF_SAMPLE_RAW | ||
| 423 | * }; | ||
| 424 | */ | ||
| 425 | PERF_RECORD_SAMPLE = 9, | ||
| 426 | |||
| 427 | PERF_RECORD_MAX, /* non-ABI */ | ||
| 428 | }; | ||
| 429 | |||
| 430 | enum perf_callchain_context { | ||
| 431 | PERF_CONTEXT_HV = (__u64)-32, | ||
| 432 | PERF_CONTEXT_KERNEL = (__u64)-128, | ||
| 433 | PERF_CONTEXT_USER = (__u64)-512, | ||
| 434 | |||
| 435 | PERF_CONTEXT_GUEST = (__u64)-2048, | ||
| 436 | PERF_CONTEXT_GUEST_KERNEL = (__u64)-2176, | ||
| 437 | PERF_CONTEXT_GUEST_USER = (__u64)-2560, | ||
| 438 | |||
| 439 | PERF_CONTEXT_MAX = (__u64)-4095, | ||
| 440 | }; | ||
| 441 | |||
| 442 | #define PERF_FLAG_FD_NO_GROUP (1U << 0) | ||
| 443 | #define PERF_FLAG_FD_OUTPUT (1U << 1) | ||
| 444 | |||
| 445 | #ifdef __KERNEL__ | ||
| 446 | /* | ||
| 447 | * Kernel-internal data types and definitions: | ||
| 448 | */ | ||
| 449 | |||
| 450 | #ifdef CONFIG_PERF_EVENTS | ||
| 451 | # include <asm/perf_event.h> | ||
| 452 | #endif | ||
| 453 | |||
| 454 | #include <linux/list.h> | ||
| 455 | #include <linux/mutex.h> | ||
| 456 | #include <linux/rculist.h> | ||
| 457 | #include <linux/rcupdate.h> | ||
| 458 | #include <linux/spinlock.h> | ||
| 459 | #include <linux/hrtimer.h> | ||
| 460 | #include <linux/fs.h> | ||
| 461 | #include <linux/pid_namespace.h> | ||
| 462 | #include <linux/workqueue.h> | ||
| 463 | #include <asm/atomic.h> | ||
| 464 | |||
| 465 | #define PERF_MAX_STACK_DEPTH 255 | ||
| 466 | |||
| 467 | struct perf_callchain_entry { | ||
| 468 | __u64 nr; | ||
| 469 | __u64 ip[PERF_MAX_STACK_DEPTH]; | ||
| 470 | }; | ||
| 471 | |||
| 472 | struct perf_raw_record { | ||
| 473 | u32 size; | ||
| 474 | void *data; | ||
| 475 | }; | ||
| 476 | |||
| 477 | struct task_struct; | ||
| 478 | |||
| 479 | /** | ||
| 480 | * struct hw_perf_event - performance event hardware details: | ||
| 481 | */ | ||
| 482 | struct hw_perf_event { | ||
| 483 | #ifdef CONFIG_PERF_EVENTS | ||
| 484 | union { | ||
| 485 | struct { /* hardware */ | ||
| 486 | u64 config; | ||
| 487 | unsigned long config_base; | ||
| 488 | unsigned long event_base; | ||
| 489 | int idx; | ||
| 490 | }; | ||
| 491 | struct { /* software */ | ||
| 492 | s64 remaining; | ||
| 493 | struct hrtimer hrtimer; | ||
| 494 | }; | ||
| 495 | #ifdef CONFIG_HAVE_HW_BREAKPOINT | ||
| 496 | union { /* breakpoint */ | ||
| 497 | struct arch_hw_breakpoint info; | ||
| 498 | }; | ||
| 499 | #endif | ||
| 500 | }; | ||
| 501 | atomic64_t prev_count; | ||
| 502 | u64 sample_period; | ||
| 503 | u64 last_period; | ||
| 504 | atomic64_t period_left; | ||
| 505 | u64 interrupts; | ||
| 506 | |||
| 507 | u64 freq_count; | ||
| 508 | u64 freq_interrupts; | ||
| 509 | u64 freq_stamp; | ||
| 510 | #endif | ||
| 511 | }; | ||
| 512 | |||
| 513 | struct perf_event; | ||
| 514 | |||
| 515 | /** | ||
| 516 | * struct pmu - generic performance monitoring unit | ||
| 517 | */ | ||
| 518 | struct pmu { | ||
| 519 | int (*enable) (struct perf_event *event); | ||
| 520 | void (*disable) (struct perf_event *event); | ||
| 521 | void (*read) (struct perf_event *event); | ||
| 522 | void (*unthrottle) (struct perf_event *event); | ||
| 523 | }; | ||
| 524 | |||
| 525 | /** | ||
| 526 | * enum perf_event_active_state - the states of a event | ||
| 527 | */ | ||
| 528 | enum perf_event_active_state { | ||
| 529 | PERF_EVENT_STATE_ERROR = -2, | ||
| 530 | PERF_EVENT_STATE_OFF = -1, | ||
| 531 | PERF_EVENT_STATE_INACTIVE = 0, | ||
| 532 | PERF_EVENT_STATE_ACTIVE = 1, | ||
| 533 | }; | ||
| 534 | |||
| 535 | struct file; | ||
| 536 | |||
| 537 | struct perf_mmap_data { | ||
| 538 | struct rcu_head rcu_head; | ||
| 539 | #ifdef CONFIG_PERF_USE_VMALLOC | ||
| 540 | struct work_struct work; | ||
| 541 | #endif | ||
| 542 | int data_order; | ||
| 543 | int nr_pages; /* nr of data pages */ | ||
| 544 | int writable; /* are we writable */ | ||
| 545 | int nr_locked; /* nr pages mlocked */ | ||
| 546 | |||
| 547 | atomic_t poll; /* POLL_ for wakeups */ | ||
| 548 | atomic_t events; /* event_id limit */ | ||
| 549 | |||
| 550 | atomic_long_t head; /* write position */ | ||
| 551 | atomic_long_t done_head; /* completed head */ | ||
| 552 | |||
| 553 | atomic_t lock; /* concurrent writes */ | ||
| 554 | atomic_t wakeup; /* needs a wakeup */ | ||
| 555 | atomic_t lost; /* nr records lost */ | ||
| 556 | |||
| 557 | long watermark; /* wakeup watermark */ | ||
| 558 | |||
| 559 | struct perf_event_mmap_page *user_page; | ||
| 560 | void *data_pages[0]; | ||
| 561 | }; | ||
| 562 | |||
| 563 | struct perf_pending_entry { | ||
| 564 | struct perf_pending_entry *next; | ||
| 565 | void (*func)(struct perf_pending_entry *); | ||
| 566 | }; | ||
| 567 | |||
| 568 | typedef void (*perf_callback_t)(struct perf_event *, void *); | ||
| 569 | |||
| 570 | struct perf_sample_data; | ||
| 571 | |||
| 572 | /** | ||
| 573 | * struct perf_event - performance event kernel representation: | ||
| 574 | */ | ||
| 575 | struct perf_event { | ||
| 576 | #ifdef CONFIG_PERF_EVENTS | ||
| 577 | struct list_head group_entry; | ||
| 578 | struct list_head event_entry; | ||
| 579 | struct list_head sibling_list; | ||
| 580 | int nr_siblings; | ||
| 581 | struct perf_event *group_leader; | ||
| 582 | struct perf_event *output; | ||
| 583 | const struct pmu *pmu; | ||
| 584 | |||
| 585 | enum perf_event_active_state state; | ||
| 586 | atomic64_t count; | ||
| 587 | |||
| 588 | /* | ||
| 589 | * These are the total time in nanoseconds that the event | ||
| 590 | * has been enabled (i.e. eligible to run, and the task has | ||
| 591 | * been scheduled in, if this is a per-task event) | ||
| 592 | * and running (scheduled onto the CPU), respectively. | ||
| 593 | * | ||
| 594 | * They are computed from tstamp_enabled, tstamp_running and | ||
| 595 | * tstamp_stopped when the event is in INACTIVE or ACTIVE state. | ||
| 596 | */ | ||
| 597 | u64 total_time_enabled; | ||
| 598 | u64 total_time_running; | ||
| 599 | |||
| 600 | /* | ||
| 601 | * These are timestamps used for computing total_time_enabled | ||
| 602 | * and total_time_running when the event is in INACTIVE or | ||
| 603 | * ACTIVE state, measured in nanoseconds from an arbitrary point | ||
| 604 | * in time. | ||
| 605 | * tstamp_enabled: the notional time when the event was enabled | ||
| 606 | * tstamp_running: the notional time when the event was scheduled on | ||
| 607 | * tstamp_stopped: in INACTIVE state, the notional time when the | ||
| 608 | * event was scheduled off. | ||
| 609 | */ | ||
| 610 | u64 tstamp_enabled; | ||
| 611 | u64 tstamp_running; | ||
| 612 | u64 tstamp_stopped; | ||
| 613 | |||
| 614 | struct perf_event_attr attr; | ||
| 615 | struct hw_perf_event hw; | ||
| 616 | |||
| 617 | struct perf_event_context *ctx; | ||
| 618 | struct file *filp; | ||
| 619 | |||
| 620 | /* | ||
| 621 | * These accumulate total time (in nanoseconds) that children | ||
| 622 | * events have been enabled and running, respectively. | ||
| 623 | */ | ||
| 624 | atomic64_t child_total_time_enabled; | ||
| 625 | atomic64_t child_total_time_running; | ||
| 626 | |||
| 627 | /* | ||
| 628 | * Protect attach/detach and child_list: | ||
| 629 | */ | ||
| 630 | struct mutex child_mutex; | ||
| 631 | struct list_head child_list; | ||
| 632 | struct perf_event *parent; | ||
| 633 | |||
| 634 | int oncpu; | ||
| 635 | int cpu; | ||
| 636 | |||
| 637 | struct list_head owner_entry; | ||
| 638 | struct task_struct *owner; | ||
| 639 | |||
| 640 | /* mmap bits */ | ||
| 641 | struct mutex mmap_mutex; | ||
| 642 | atomic_t mmap_count; | ||
| 643 | struct perf_mmap_data *data; | ||
| 644 | |||
| 645 | /* poll related */ | ||
| 646 | wait_queue_head_t waitq; | ||
| 647 | struct fasync_struct *fasync; | ||
| 648 | |||
| 649 | /* delayed work for NMIs and such */ | ||
| 650 | int pending_wakeup; | ||
| 651 | int pending_kill; | ||
| 652 | int pending_disable; | ||
| 653 | struct perf_pending_entry pending; | ||
| 654 | |||
| 655 | atomic_t event_limit; | ||
| 656 | |||
| 657 | void (*destroy)(struct perf_event *); | ||
| 658 | struct rcu_head rcu_head; | ||
| 659 | |||
| 660 | struct pid_namespace *ns; | ||
| 661 | u64 id; | ||
| 662 | |||
| 663 | void (*overflow_handler)(struct perf_event *event, | ||
| 664 | int nmi, struct perf_sample_data *data, | ||
| 665 | struct pt_regs *regs); | ||
| 666 | |||
| 667 | #ifdef CONFIG_EVENT_PROFILE | ||
| 668 | struct event_filter *filter; | ||
| 669 | #endif | ||
| 670 | |||
| 671 | perf_callback_t callback; | ||
| 672 | |||
| 673 | perf_callback_t event_callback; | ||
| 674 | |||
| 675 | #endif /* CONFIG_PERF_EVENTS */ | ||
| 676 | }; | ||
| 677 | |||
| 678 | /** | ||
| 679 | * struct perf_event_context - event context structure | ||
| 680 | * | ||
| 681 | * Used as a container for task events and CPU events as well: | ||
| 682 | */ | ||
| 683 | struct perf_event_context { | ||
| 684 | /* | ||
| 685 | * Protect the states of the events in the list, | ||
| 686 | * nr_active, and the list: | ||
| 687 | */ | ||
| 688 | spinlock_t lock; | ||
| 689 | /* | ||
| 690 | * Protect the list of events. Locking either mutex or lock | ||
| 691 | * is sufficient to ensure the list doesn't change; to change | ||
| 692 | * the list you need to lock both the mutex and the spinlock. | ||
| 693 | */ | ||
| 694 | struct mutex mutex; | ||
| 695 | |||
| 696 | struct list_head group_list; | ||
| 697 | struct list_head event_list; | ||
| 698 | int nr_events; | ||
| 699 | int nr_active; | ||
| 700 | int is_active; | ||
| 701 | int nr_stat; | ||
| 702 | atomic_t refcount; | ||
| 703 | struct task_struct *task; | ||
| 704 | |||
| 705 | /* | ||
| 706 | * Context clock, runs when context enabled. | ||
| 707 | */ | ||
| 708 | u64 time; | ||
| 709 | u64 timestamp; | ||
| 710 | |||
| 711 | /* | ||
| 712 | * These fields let us detect when two contexts have both | ||
| 713 | * been cloned (inherited) from a common ancestor. | ||
| 714 | */ | ||
| 715 | struct perf_event_context *parent_ctx; | ||
| 716 | u64 parent_gen; | ||
| 717 | u64 generation; | ||
| 718 | int pin_count; | ||
| 719 | struct rcu_head rcu_head; | ||
| 720 | }; | ||
| 721 | |||
| 722 | /** | ||
| 723 | * struct perf_event_cpu_context - per cpu event context structure | ||
| 724 | */ | ||
| 725 | struct perf_cpu_context { | ||
| 726 | struct perf_event_context ctx; | ||
| 727 | struct perf_event_context *task_ctx; | ||
| 728 | int active_oncpu; | ||
| 729 | int max_pertask; | ||
| 730 | int exclusive; | ||
| 731 | |||
| 732 | /* | ||
| 733 | * Recursion avoidance: | ||
| 734 | * | ||
| 735 | * task, softirq, irq, nmi context | ||
| 736 | */ | ||
| 737 | int recursion[4]; | ||
| 738 | }; | ||
| 739 | |||
| 740 | struct perf_output_handle { | ||
| 741 | struct perf_event *event; | ||
| 742 | struct perf_mmap_data *data; | ||
| 743 | unsigned long head; | ||
| 744 | unsigned long offset; | ||
| 745 | int nmi; | ||
| 746 | int sample; | ||
| 747 | int locked; | ||
| 748 | }; | ||
| 749 | |||
| 750 | #ifdef CONFIG_PERF_EVENTS | ||
| 751 | |||
| 752 | /* | ||
| 753 | * Set by architecture code: | ||
| 754 | */ | ||
| 755 | extern int perf_max_events; | ||
| 756 | |||
| 757 | extern const struct pmu *hw_perf_event_init(struct perf_event *event); | ||
| 758 | |||
| 759 | extern void perf_event_task_sched_in(struct task_struct *task, int cpu); | ||
| 760 | extern void perf_event_task_sched_out(struct task_struct *task, | ||
| 761 | struct task_struct *next, int cpu); | ||
| 762 | extern void perf_event_task_tick(struct task_struct *task, int cpu); | ||
| 763 | extern int perf_event_init_task(struct task_struct *child); | ||
| 764 | extern void perf_event_exit_task(struct task_struct *child); | ||
| 765 | extern void perf_event_free_task(struct task_struct *task); | ||
| 766 | extern void set_perf_event_pending(void); | ||
| 767 | extern void perf_event_do_pending(void); | ||
| 768 | extern void perf_event_print_debug(void); | ||
| 769 | extern void __perf_disable(void); | ||
| 770 | extern bool __perf_enable(void); | ||
| 771 | extern void perf_disable(void); | ||
| 772 | extern void perf_enable(void); | ||
| 773 | extern int perf_event_task_disable(void); | ||
| 774 | extern int perf_event_task_enable(void); | ||
| 775 | extern int hw_perf_group_sched_in(struct perf_event *group_leader, | ||
| 776 | struct perf_cpu_context *cpuctx, | ||
| 777 | struct perf_event_context *ctx, int cpu); | ||
| 778 | extern void perf_event_update_userpage(struct perf_event *event); | ||
| 779 | extern int perf_event_release_kernel(struct perf_event *event); | ||
| 780 | extern struct perf_event * | ||
| 781 | perf_event_create_kernel_counter(struct perf_event_attr *attr, | ||
| 782 | int cpu, | ||
| 783 | pid_t pid, | ||
| 784 | perf_callback_t callback); | ||
| 785 | extern u64 perf_event_read_value(struct perf_event *event, | ||
| 786 | u64 *enabled, u64 *running); | ||
| 787 | |||
| 788 | struct perf_sample_data { | ||
| 789 | u64 type; | ||
| 790 | |||
| 791 | u64 ip; | ||
| 792 | struct { | ||
| 793 | u32 pid; | ||
| 794 | u32 tid; | ||
| 795 | } tid_entry; | ||
| 796 | u64 time; | ||
| 797 | u64 addr; | ||
| 798 | u64 id; | ||
| 799 | u64 stream_id; | ||
| 800 | struct { | ||
| 801 | u32 cpu; | ||
| 802 | u32 reserved; | ||
| 803 | } cpu_entry; | ||
| 804 | u64 period; | ||
| 805 | struct perf_callchain_entry *callchain; | ||
| 806 | struct perf_raw_record *raw; | ||
| 807 | }; | ||
| 808 | |||
| 809 | extern void perf_output_sample(struct perf_output_handle *handle, | ||
| 810 | struct perf_event_header *header, | ||
| 811 | struct perf_sample_data *data, | ||
| 812 | struct perf_event *event); | ||
| 813 | extern void perf_prepare_sample(struct perf_event_header *header, | ||
| 814 | struct perf_sample_data *data, | ||
| 815 | struct perf_event *event, | ||
| 816 | struct pt_regs *regs); | ||
| 817 | |||
| 818 | extern int perf_event_overflow(struct perf_event *event, int nmi, | ||
| 819 | struct perf_sample_data *data, | ||
| 820 | struct pt_regs *regs); | ||
| 821 | |||
| 822 | /* | ||
| 823 | * Return 1 for a software event, 0 for a hardware event | ||
| 824 | */ | ||
| 825 | static inline int is_software_event(struct perf_event *event) | ||
| 826 | { | ||
| 827 | return (event->attr.type != PERF_TYPE_RAW) && | ||
| 828 | (event->attr.type != PERF_TYPE_HARDWARE) && | ||
| 829 | (event->attr.type != PERF_TYPE_HW_CACHE); | ||
| 830 | } | ||
| 831 | |||
| 832 | extern atomic_t perf_swevent_enabled[PERF_COUNT_SW_MAX]; | ||
| 833 | |||
| 834 | extern void __perf_sw_event(u32, u64, int, struct pt_regs *, u64); | ||
| 835 | |||
| 836 | static inline void | ||
| 837 | perf_sw_event(u32 event_id, u64 nr, int nmi, struct pt_regs *regs, u64 addr) | ||
| 838 | { | ||
| 839 | if (atomic_read(&perf_swevent_enabled[event_id])) | ||
| 840 | __perf_sw_event(event_id, nr, nmi, regs, addr); | ||
| 841 | } | ||
| 842 | |||
| 843 | extern void __perf_event_mmap(struct vm_area_struct *vma); | ||
| 844 | |||
| 845 | static inline void perf_event_mmap(struct vm_area_struct *vma) | ||
| 846 | { | ||
| 847 | if (vma->vm_flags & VM_EXEC) | ||
| 848 | __perf_event_mmap(vma); | ||
| 849 | } | ||
| 850 | |||
| 851 | extern void perf_event_comm(struct task_struct *tsk); | ||
| 852 | extern void perf_event_fork(struct task_struct *tsk); | ||
| 853 | |||
| 854 | extern struct perf_callchain_entry *perf_callchain(struct pt_regs *regs); | ||
| 855 | |||
| 856 | extern int sysctl_perf_event_paranoid; | ||
| 857 | extern int sysctl_perf_event_mlock; | ||
| 858 | extern int sysctl_perf_event_sample_rate; | ||
| 859 | |||
| 860 | extern void perf_event_init(void); | ||
| 861 | extern void perf_tp_event(int event_id, u64 addr, u64 count, | ||
| 862 | void *record, int entry_size); | ||
| 863 | extern void perf_bp_event(struct perf_event *event, void *data); | ||
| 864 | |||
| 865 | #ifndef perf_misc_flags | ||
| 866 | #define perf_misc_flags(regs) (user_mode(regs) ? PERF_RECORD_MISC_USER : \ | ||
| 867 | PERF_RECORD_MISC_KERNEL) | ||
| 868 | #define perf_instruction_pointer(regs) instruction_pointer(regs) | ||
| 869 | #endif | ||
| 870 | |||
| 871 | extern int perf_output_begin(struct perf_output_handle *handle, | ||
| 872 | struct perf_event *event, unsigned int size, | ||
| 873 | int nmi, int sample); | ||
| 874 | extern void perf_output_end(struct perf_output_handle *handle); | ||
| 875 | extern void perf_output_copy(struct perf_output_handle *handle, | ||
| 876 | const void *buf, unsigned int len); | ||
| 877 | extern int perf_swevent_get_recursion_context(void); | ||
| 878 | extern void perf_swevent_put_recursion_context(int rctx); | ||
| 879 | #else | ||
| 880 | static inline void | ||
| 881 | perf_event_task_sched_in(struct task_struct *task, int cpu) { } | ||
| 882 | static inline void | ||
| 883 | perf_event_task_sched_out(struct task_struct *task, | ||
| 884 | struct task_struct *next, int cpu) { } | ||
| 885 | static inline void | ||
| 886 | perf_event_task_tick(struct task_struct *task, int cpu) { } | ||
| 887 | static inline int perf_event_init_task(struct task_struct *child) { return 0; } | ||
| 888 | static inline void perf_event_exit_task(struct task_struct *child) { } | ||
| 889 | static inline void perf_event_free_task(struct task_struct *task) { } | ||
| 890 | static inline void perf_event_do_pending(void) { } | ||
| 891 | static inline void perf_event_print_debug(void) { } | ||
| 892 | static inline void perf_disable(void) { } | ||
| 893 | static inline void perf_enable(void) { } | ||
| 894 | static inline int perf_event_task_disable(void) { return -EINVAL; } | ||
| 895 | static inline int perf_event_task_enable(void) { return -EINVAL; } | ||
| 896 | |||
| 897 | static inline void | ||
| 898 | perf_sw_event(u32 event_id, u64 nr, int nmi, | ||
| 899 | struct pt_regs *regs, u64 addr) { } | ||
| 900 | static inline void | ||
| 901 | perf_bp_event(struct perf_event *event, void *data) { } | ||
| 902 | |||
| 903 | static inline void perf_event_mmap(struct vm_area_struct *vma) { } | ||
| 904 | static inline void perf_event_comm(struct task_struct *tsk) { } | ||
| 905 | static inline void perf_event_fork(struct task_struct *tsk) { } | ||
| 906 | static inline void perf_event_init(void) { } | ||
| 907 | static inline int perf_swevent_get_recursion_context(void) { return -1; } | ||
| 908 | static inline void perf_swevent_put_recursion_context(int rctx) { } | ||
| 909 | |||
| 910 | #endif | ||
| 911 | |||
| 912 | #define perf_output_put(handle, x) \ | ||
| 913 | perf_output_copy((handle), &(x), sizeof(x)) | ||
| 914 | |||
| 915 | #endif /* __KERNEL__ */ | ||
| 916 | #endif /* _LINUX_PERF_EVENT_H */ | ||
diff --git a/include/linux/phonet.h b/include/linux/phonet.h index ee5e3c9e2bca..e5126cff9b2a 100644 --- a/include/linux/phonet.h +++ b/include/linux/phonet.h | |||
| @@ -38,6 +38,7 @@ | |||
| 38 | #define PNPIPE_IFINDEX 2 | 38 | #define PNPIPE_IFINDEX 2 |
| 39 | 39 | ||
| 40 | #define PNADDR_ANY 0 | 40 | #define PNADDR_ANY 0 |
| 41 | #define PNADDR_BROADCAST 0xFC | ||
| 41 | #define PNPORT_RESOURCE_ROUTING 0 | 42 | #define PNPORT_RESOURCE_ROUTING 0 |
| 42 | 43 | ||
| 43 | /* Values for PNPIPE_ENCAP option */ | 44 | /* Values for PNPIPE_ENCAP option */ |
| @@ -99,6 +100,9 @@ struct sockaddr_pn { | |||
| 99 | __u8 spn_zero[sizeof(struct sockaddr) - sizeof(sa_family_t) - 3]; | 100 | __u8 spn_zero[sizeof(struct sockaddr) - sizeof(sa_family_t) - 3]; |
| 100 | } __attribute__ ((packed)); | 101 | } __attribute__ ((packed)); |
| 101 | 102 | ||
| 103 | /* Well known address */ | ||
| 104 | #define PN_DEV_PC 0x10 | ||
| 105 | |||
| 102 | static inline __u16 pn_object(__u8 addr, __u16 port) | 106 | static inline __u16 pn_object(__u8 addr, __u16 port) |
| 103 | { | 107 | { |
| 104 | return (addr << 8) | (port & 0x3ff); | 108 | return (addr << 8) | (port & 0x3ff); |
| @@ -170,4 +174,21 @@ static inline __u8 pn_sockaddr_get_resource(const struct sockaddr_pn *spn) | |||
| 170 | return spn->spn_resource; | 174 | return spn->spn_resource; |
| 171 | } | 175 | } |
| 172 | 176 | ||
| 177 | /* Phonet device ioctl requests */ | ||
| 178 | #ifdef __KERNEL__ | ||
| 179 | #define SIOCPNGAUTOCONF (SIOCDEVPRIVATE + 0) | ||
| 180 | |||
| 181 | struct if_phonet_autoconf { | ||
| 182 | uint8_t device; | ||
| 183 | }; | ||
| 184 | |||
| 185 | struct if_phonet_req { | ||
| 186 | char ifr_phonet_name[16]; | ||
| 187 | union { | ||
| 188 | struct if_phonet_autoconf ifru_phonet_autoconf; | ||
| 189 | } ifr_ifru; | ||
| 190 | }; | ||
| 191 | #define ifr_phonet_autoconf ifr_ifru.ifru_phonet_autoconf | ||
| 192 | #endif /* __KERNEL__ */ | ||
| 193 | |||
| 173 | #endif | 194 | #endif |
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index 8dc5123b6305..3c6675c2444b 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h | |||
| @@ -22,6 +22,9 @@ struct platform_device { | |||
| 22 | struct resource * resource; | 22 | struct resource * resource; |
| 23 | 23 | ||
| 24 | struct platform_device_id *id_entry; | 24 | struct platform_device_id *id_entry; |
| 25 | |||
| 26 | /* arch specific additions */ | ||
| 27 | struct pdev_archdata archdata; | ||
| 25 | }; | 28 | }; |
| 26 | 29 | ||
| 27 | #define platform_get_device_id(pdev) ((pdev)->id_entry) | 30 | #define platform_get_device_id(pdev) ((pdev)->id_entry) |
| @@ -57,8 +60,6 @@ struct platform_driver { | |||
| 57 | int (*remove)(struct platform_device *); | 60 | int (*remove)(struct platform_device *); |
| 58 | void (*shutdown)(struct platform_device *); | 61 | void (*shutdown)(struct platform_device *); |
| 59 | int (*suspend)(struct platform_device *, pm_message_t state); | 62 | int (*suspend)(struct platform_device *, pm_message_t state); |
| 60 | int (*suspend_late)(struct platform_device *, pm_message_t state); | ||
| 61 | int (*resume_early)(struct platform_device *); | ||
| 62 | int (*resume)(struct platform_device *); | 63 | int (*resume)(struct platform_device *); |
| 63 | struct device_driver driver; | 64 | struct device_driver driver; |
| 64 | struct platform_device_id *id_table; | 65 | struct platform_device_id *id_table; |
diff --git a/include/linux/pm.h b/include/linux/pm.h index b3f74764a586..3b7e04b95bd2 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
| @@ -22,6 +22,10 @@ | |||
| 22 | #define _LINUX_PM_H | 22 | #define _LINUX_PM_H |
| 23 | 23 | ||
| 24 | #include <linux/list.h> | 24 | #include <linux/list.h> |
| 25 | #include <linux/workqueue.h> | ||
| 26 | #include <linux/spinlock.h> | ||
| 27 | #include <linux/wait.h> | ||
| 28 | #include <linux/timer.h> | ||
| 25 | 29 | ||
| 26 | /* | 30 | /* |
| 27 | * Callbacks for platform drivers to implement. | 31 | * Callbacks for platform drivers to implement. |
| @@ -165,6 +169,28 @@ typedef struct pm_message { | |||
| 165 | * It is allowed to unregister devices while the above callbacks are being | 169 | * 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 | 170 | * executed. However, it is not allowed to unregister a device from within any |
| 167 | * of its own callbacks. | 171 | * of its own callbacks. |
| 172 | * | ||
| 173 | * There also are the following callbacks related to run-time power management | ||
| 174 | * of devices: | ||
| 175 | * | ||
| 176 | * @runtime_suspend: Prepare the device for a condition in which it won't be | ||
| 177 | * able to communicate with the CPU(s) and RAM due to power management. | ||
| 178 | * This need not mean that the device should be put into a low power state. | ||
| 179 | * For example, if the device is behind a link which is about to be turned | ||
| 180 | * off, the device may remain at full power. If the device does go to low | ||
| 181 | * power and if device_may_wakeup(dev) is true, remote wake-up (i.e., a | ||
| 182 | * hardware mechanism allowing the device to request a change of its power | ||
| 183 | * state, such as PCI PME) should be enabled for it. | ||
| 184 | * | ||
| 185 | * @runtime_resume: Put the device into the fully active state in response to a | ||
| 186 | * wake-up event generated by hardware or at the request of software. If | ||
| 187 | * necessary, put the device into the full power state and restore its | ||
| 188 | * registers, so that it is fully operational. | ||
| 189 | * | ||
| 190 | * @runtime_idle: Device appears to be inactive and it might be put into a low | ||
| 191 | * power state if all of the necessary conditions are satisfied. Check | ||
| 192 | * these conditions and handle the device as appropriate, possibly queueing | ||
| 193 | * a suspend request for it. The return value is ignored by the PM core. | ||
| 168 | */ | 194 | */ |
| 169 | 195 | ||
| 170 | struct dev_pm_ops { | 196 | struct dev_pm_ops { |
| @@ -182,8 +208,25 @@ struct dev_pm_ops { | |||
| 182 | int (*thaw_noirq)(struct device *dev); | 208 | int (*thaw_noirq)(struct device *dev); |
| 183 | int (*poweroff_noirq)(struct device *dev); | 209 | int (*poweroff_noirq)(struct device *dev); |
| 184 | int (*restore_noirq)(struct device *dev); | 210 | int (*restore_noirq)(struct device *dev); |
| 211 | int (*runtime_suspend)(struct device *dev); | ||
| 212 | int (*runtime_resume)(struct device *dev); | ||
| 213 | int (*runtime_idle)(struct device *dev); | ||
| 185 | }; | 214 | }; |
| 186 | 215 | ||
| 216 | /* | ||
| 217 | * Use this if you want to use the same suspend and resume callbacks for suspend | ||
| 218 | * to RAM and hibernation. | ||
| 219 | */ | ||
| 220 | #define SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn) \ | ||
| 221 | struct dev_pm_ops name = { \ | ||
| 222 | .suspend = suspend_fn, \ | ||
| 223 | .resume = resume_fn, \ | ||
| 224 | .freeze = suspend_fn, \ | ||
| 225 | .thaw = resume_fn, \ | ||
| 226 | .poweroff = suspend_fn, \ | ||
| 227 | .restore = resume_fn, \ | ||
| 228 | } | ||
| 229 | |||
| 187 | /** | 230 | /** |
| 188 | * PM_EVENT_ messages | 231 | * PM_EVENT_ messages |
| 189 | * | 232 | * |
| @@ -315,14 +358,80 @@ enum dpm_state { | |||
| 315 | DPM_OFF_IRQ, | 358 | DPM_OFF_IRQ, |
| 316 | }; | 359 | }; |
| 317 | 360 | ||
| 361 | /** | ||
| 362 | * Device run-time power management status. | ||
| 363 | * | ||
| 364 | * These status labels are used internally by the PM core to indicate the | ||
| 365 | * current status of a device with respect to the PM core operations. They do | ||
| 366 | * not reflect the actual power state of the device or its status as seen by the | ||
| 367 | * driver. | ||
| 368 | * | ||
| 369 | * RPM_ACTIVE Device is fully operational. Indicates that the device | ||
| 370 | * bus type's ->runtime_resume() callback has completed | ||
| 371 | * successfully. | ||
| 372 | * | ||
| 373 | * RPM_SUSPENDED Device bus type's ->runtime_suspend() callback has | ||
| 374 | * completed successfully. The device is regarded as | ||
| 375 | * suspended. | ||
| 376 | * | ||
| 377 | * RPM_RESUMING Device bus type's ->runtime_resume() callback is being | ||
| 378 | * executed. | ||
| 379 | * | ||
| 380 | * RPM_SUSPENDING Device bus type's ->runtime_suspend() callback is being | ||
| 381 | * executed. | ||
| 382 | */ | ||
| 383 | |||
| 384 | enum rpm_status { | ||
| 385 | RPM_ACTIVE = 0, | ||
| 386 | RPM_RESUMING, | ||
| 387 | RPM_SUSPENDED, | ||
| 388 | RPM_SUSPENDING, | ||
| 389 | }; | ||
| 390 | |||
| 391 | /** | ||
| 392 | * Device run-time power management request types. | ||
| 393 | * | ||
| 394 | * RPM_REQ_NONE Do nothing. | ||
| 395 | * | ||
| 396 | * RPM_REQ_IDLE Run the device bus type's ->runtime_idle() callback | ||
| 397 | * | ||
| 398 | * RPM_REQ_SUSPEND Run the device bus type's ->runtime_suspend() callback | ||
| 399 | * | ||
| 400 | * RPM_REQ_RESUME Run the device bus type's ->runtime_resume() callback | ||
| 401 | */ | ||
| 402 | |||
| 403 | enum rpm_request { | ||
| 404 | RPM_REQ_NONE = 0, | ||
| 405 | RPM_REQ_IDLE, | ||
| 406 | RPM_REQ_SUSPEND, | ||
| 407 | RPM_REQ_RESUME, | ||
| 408 | }; | ||
| 409 | |||
| 318 | struct dev_pm_info { | 410 | struct dev_pm_info { |
| 319 | pm_message_t power_state; | 411 | pm_message_t power_state; |
| 320 | unsigned can_wakeup:1; | 412 | unsigned int can_wakeup:1; |
| 321 | unsigned should_wakeup:1; | 413 | unsigned int should_wakeup:1; |
| 322 | enum dpm_state status; /* Owned by the PM core */ | 414 | enum dpm_state status; /* Owned by the PM core */ |
| 323 | #ifdef CONFIG_PM_SLEEP | 415 | #ifdef CONFIG_PM_SLEEP |
| 324 | struct list_head entry; | 416 | struct list_head entry; |
| 325 | #endif | 417 | #endif |
| 418 | #ifdef CONFIG_PM_RUNTIME | ||
| 419 | struct timer_list suspend_timer; | ||
| 420 | unsigned long timer_expires; | ||
| 421 | struct work_struct work; | ||
| 422 | wait_queue_head_t wait_queue; | ||
| 423 | spinlock_t lock; | ||
| 424 | atomic_t usage_count; | ||
| 425 | atomic_t child_count; | ||
| 426 | unsigned int disable_depth:3; | ||
| 427 | unsigned int ignore_children:1; | ||
| 428 | unsigned int idle_notification:1; | ||
| 429 | unsigned int request_pending:1; | ||
| 430 | unsigned int deferred_resume:1; | ||
| 431 | enum rpm_request request; | ||
| 432 | enum rpm_status runtime_status; | ||
| 433 | int runtime_error; | ||
| 434 | #endif | ||
| 326 | }; | 435 | }; |
| 327 | 436 | ||
| 328 | /* | 437 | /* |
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h new file mode 100644 index 000000000000..44087044910f --- /dev/null +++ b/include/linux/pm_runtime.h | |||
| @@ -0,0 +1,114 @@ | |||
| 1 | /* | ||
| 2 | * pm_runtime.h - Device run-time power management helper functions. | ||
| 3 | * | ||
| 4 | * Copyright (C) 2009 Rafael J. Wysocki <rjw@sisk.pl> | ||
| 5 | * | ||
| 6 | * This file is released under the GPLv2. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #ifndef _LINUX_PM_RUNTIME_H | ||
| 10 | #define _LINUX_PM_RUNTIME_H | ||
| 11 | |||
| 12 | #include <linux/device.h> | ||
| 13 | #include <linux/pm.h> | ||
| 14 | |||
| 15 | #ifdef CONFIG_PM_RUNTIME | ||
| 16 | |||
| 17 | extern struct workqueue_struct *pm_wq; | ||
| 18 | |||
| 19 | extern int pm_runtime_idle(struct device *dev); | ||
| 20 | extern int pm_runtime_suspend(struct device *dev); | ||
| 21 | extern int pm_runtime_resume(struct device *dev); | ||
| 22 | extern int pm_request_idle(struct device *dev); | ||
| 23 | extern int pm_schedule_suspend(struct device *dev, unsigned int delay); | ||
| 24 | extern int pm_request_resume(struct device *dev); | ||
| 25 | extern int __pm_runtime_get(struct device *dev, bool sync); | ||
| 26 | extern int __pm_runtime_put(struct device *dev, bool sync); | ||
| 27 | extern int __pm_runtime_set_status(struct device *dev, unsigned int status); | ||
| 28 | extern int pm_runtime_barrier(struct device *dev); | ||
| 29 | extern void pm_runtime_enable(struct device *dev); | ||
| 30 | extern void __pm_runtime_disable(struct device *dev, bool check_resume); | ||
| 31 | |||
| 32 | static inline bool pm_children_suspended(struct device *dev) | ||
| 33 | { | ||
| 34 | return dev->power.ignore_children | ||
| 35 | || !atomic_read(&dev->power.child_count); | ||
| 36 | } | ||
| 37 | |||
| 38 | static inline void pm_suspend_ignore_children(struct device *dev, bool enable) | ||
| 39 | { | ||
| 40 | dev->power.ignore_children = enable; | ||
| 41 | } | ||
| 42 | |||
| 43 | static inline void pm_runtime_get_noresume(struct device *dev) | ||
| 44 | { | ||
| 45 | atomic_inc(&dev->power.usage_count); | ||
| 46 | } | ||
| 47 | |||
| 48 | static inline void pm_runtime_put_noidle(struct device *dev) | ||
| 49 | { | ||
| 50 | atomic_add_unless(&dev->power.usage_count, -1, 0); | ||
| 51 | } | ||
| 52 | |||
| 53 | #else /* !CONFIG_PM_RUNTIME */ | ||
| 54 | |||
| 55 | static inline int pm_runtime_idle(struct device *dev) { return -ENOSYS; } | ||
| 56 | static inline int pm_runtime_suspend(struct device *dev) { return -ENOSYS; } | ||
| 57 | static inline int pm_runtime_resume(struct device *dev) { return 0; } | ||
| 58 | static inline int pm_request_idle(struct device *dev) { return -ENOSYS; } | ||
| 59 | static inline int pm_schedule_suspend(struct device *dev, unsigned int delay) | ||
| 60 | { | ||
| 61 | return -ENOSYS; | ||
| 62 | } | ||
| 63 | static inline int pm_request_resume(struct device *dev) { return 0; } | ||
| 64 | static inline int __pm_runtime_get(struct device *dev, bool sync) { return 1; } | ||
| 65 | static inline int __pm_runtime_put(struct device *dev, bool sync) { return 0; } | ||
| 66 | static inline int __pm_runtime_set_status(struct device *dev, | ||
| 67 | unsigned int status) { return 0; } | ||
| 68 | static inline int pm_runtime_barrier(struct device *dev) { return 0; } | ||
| 69 | static inline void pm_runtime_enable(struct device *dev) {} | ||
| 70 | static inline void __pm_runtime_disable(struct device *dev, bool c) {} | ||
| 71 | |||
| 72 | static inline bool pm_children_suspended(struct device *dev) { return false; } | ||
| 73 | static inline void pm_suspend_ignore_children(struct device *dev, bool en) {} | ||
| 74 | static inline void pm_runtime_get_noresume(struct device *dev) {} | ||
| 75 | static inline void pm_runtime_put_noidle(struct device *dev) {} | ||
| 76 | |||
| 77 | #endif /* !CONFIG_PM_RUNTIME */ | ||
| 78 | |||
| 79 | static inline int pm_runtime_get(struct device *dev) | ||
| 80 | { | ||
| 81 | return __pm_runtime_get(dev, false); | ||
| 82 | } | ||
| 83 | |||
| 84 | static inline int pm_runtime_get_sync(struct device *dev) | ||
| 85 | { | ||
| 86 | return __pm_runtime_get(dev, true); | ||
| 87 | } | ||
| 88 | |||
| 89 | static inline int pm_runtime_put(struct device *dev) | ||
| 90 | { | ||
| 91 | return __pm_runtime_put(dev, false); | ||
| 92 | } | ||
| 93 | |||
| 94 | static inline int pm_runtime_put_sync(struct device *dev) | ||
| 95 | { | ||
| 96 | return __pm_runtime_put(dev, true); | ||
| 97 | } | ||
| 98 | |||
| 99 | static inline int pm_runtime_set_active(struct device *dev) | ||
| 100 | { | ||
| 101 | return __pm_runtime_set_status(dev, RPM_ACTIVE); | ||
| 102 | } | ||
| 103 | |||
| 104 | static inline void pm_runtime_set_suspended(struct device *dev) | ||
| 105 | { | ||
| 106 | __pm_runtime_set_status(dev, RPM_SUSPENDED); | ||
| 107 | } | ||
| 108 | |||
| 109 | static inline void pm_runtime_disable(struct device *dev) | ||
| 110 | { | ||
| 111 | __pm_runtime_disable(dev, true); | ||
| 112 | } | ||
| 113 | |||
| 114 | #endif | ||
diff --git a/include/linux/pnp.h b/include/linux/pnp.h index b063c7328ba5..fddfafaed024 100644 --- a/include/linux/pnp.h +++ b/include/linux/pnp.h | |||
| @@ -360,6 +360,7 @@ struct pnp_driver { | |||
| 360 | unsigned int flags; | 360 | unsigned int flags; |
| 361 | int (*probe) (struct pnp_dev *dev, const struct pnp_device_id *dev_id); | 361 | int (*probe) (struct pnp_dev *dev, const struct pnp_device_id *dev_id); |
| 362 | void (*remove) (struct pnp_dev *dev); | 362 | void (*remove) (struct pnp_dev *dev); |
| 363 | void (*shutdown) (struct pnp_dev *dev); | ||
| 363 | int (*suspend) (struct pnp_dev *dev, pm_message_t state); | 364 | int (*suspend) (struct pnp_dev *dev, pm_message_t state); |
| 364 | int (*resume) (struct pnp_dev *dev); | 365 | int (*resume) (struct pnp_dev *dev); |
| 365 | struct device_driver driver; | 366 | struct device_driver driver; |
diff --git a/include/linux/poison.h b/include/linux/poison.h index 6729f7dcd60e..7fc194aef8c2 100644 --- a/include/linux/poison.h +++ b/include/linux/poison.h | |||
| @@ -65,6 +65,9 @@ | |||
| 65 | #define MUTEX_DEBUG_INIT 0x11 | 65 | #define MUTEX_DEBUG_INIT 0x11 |
| 66 | #define MUTEX_DEBUG_FREE 0x22 | 66 | #define MUTEX_DEBUG_FREE 0x22 |
| 67 | 67 | ||
| 68 | /********** lib/flex_array.c **********/ | ||
| 69 | #define FLEX_ARRAY_FREE 0x6c /* for use-after-free poisoning */ | ||
| 70 | |||
| 68 | /********** security/ **********/ | 71 | /********** security/ **********/ |
| 69 | #define KEY_DESTROY 0xbd | 72 | #define KEY_DESTROY 0xbd |
| 70 | 73 | ||
diff --git a/include/linux/poll.h b/include/linux/poll.h index fa287f25138d..6673743946f7 100644 --- a/include/linux/poll.h +++ b/include/linux/poll.h | |||
| @@ -6,10 +6,10 @@ | |||
| 6 | #ifdef __KERNEL__ | 6 | #ifdef __KERNEL__ |
| 7 | 7 | ||
| 8 | #include <linux/compiler.h> | 8 | #include <linux/compiler.h> |
| 9 | #include <linux/ktime.h> | ||
| 9 | #include <linux/wait.h> | 10 | #include <linux/wait.h> |
| 10 | #include <linux/string.h> | 11 | #include <linux/string.h> |
| 11 | #include <linux/fs.h> | 12 | #include <linux/fs.h> |
| 12 | #include <linux/sched.h> | ||
| 13 | #include <asm/uaccess.h> | 13 | #include <asm/uaccess.h> |
| 14 | 14 | ||
| 15 | /* ~832 bytes of stack space used max in sys_select/sys_poll before allocating | 15 | /* ~832 bytes of stack space used max in sys_select/sys_poll before allocating |
diff --git a/include/linux/posix_acl.h b/include/linux/posix_acl.h index 065a3652a3ea..67608161df6b 100644 --- a/include/linux/posix_acl.h +++ b/include/linux/posix_acl.h | |||
| @@ -147,6 +147,20 @@ static inline void forget_cached_acl(struct inode *inode, int type) | |||
| 147 | if (old != ACL_NOT_CACHED) | 147 | if (old != ACL_NOT_CACHED) |
| 148 | posix_acl_release(old); | 148 | posix_acl_release(old); |
| 149 | } | 149 | } |
| 150 | |||
| 151 | static inline void forget_all_cached_acls(struct inode *inode) | ||
| 152 | { | ||
| 153 | struct posix_acl *old_access, *old_default; | ||
| 154 | spin_lock(&inode->i_lock); | ||
| 155 | old_access = inode->i_acl; | ||
| 156 | old_default = inode->i_default_acl; | ||
| 157 | inode->i_acl = inode->i_default_acl = ACL_NOT_CACHED; | ||
| 158 | spin_unlock(&inode->i_lock); | ||
| 159 | if (old_access != ACL_NOT_CACHED) | ||
| 160 | posix_acl_release(old_access); | ||
| 161 | if (old_default != ACL_NOT_CACHED) | ||
| 162 | posix_acl_release(old_default); | ||
| 163 | } | ||
| 150 | #endif | 164 | #endif |
| 151 | 165 | ||
| 152 | static inline void cache_no_acl(struct inode *inode) | 166 | static inline void cache_no_acl(struct inode *inode) |
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index 594c494ac3f0..b5d096d3a9be 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h | |||
| @@ -39,6 +39,13 @@ enum { | |||
| 39 | }; | 39 | }; |
| 40 | 40 | ||
| 41 | enum { | 41 | enum { |
| 42 | POWER_SUPPLY_CHARGE_TYPE_UNKNOWN = 0, | ||
| 43 | POWER_SUPPLY_CHARGE_TYPE_NONE, | ||
| 44 | POWER_SUPPLY_CHARGE_TYPE_TRICKLE, | ||
| 45 | POWER_SUPPLY_CHARGE_TYPE_FAST, | ||
| 46 | }; | ||
| 47 | |||
| 48 | enum { | ||
| 42 | POWER_SUPPLY_HEALTH_UNKNOWN = 0, | 49 | POWER_SUPPLY_HEALTH_UNKNOWN = 0, |
| 43 | POWER_SUPPLY_HEALTH_GOOD, | 50 | POWER_SUPPLY_HEALTH_GOOD, |
| 44 | POWER_SUPPLY_HEALTH_OVERHEAT, | 51 | POWER_SUPPLY_HEALTH_OVERHEAT, |
| @@ -58,9 +65,19 @@ enum { | |||
| 58 | POWER_SUPPLY_TECHNOLOGY_LiMn, | 65 | POWER_SUPPLY_TECHNOLOGY_LiMn, |
| 59 | }; | 66 | }; |
| 60 | 67 | ||
| 68 | enum { | ||
| 69 | POWER_SUPPLY_CAPACITY_LEVEL_UNKNOWN = 0, | ||
| 70 | POWER_SUPPLY_CAPACITY_LEVEL_CRITICAL, | ||
| 71 | POWER_SUPPLY_CAPACITY_LEVEL_LOW, | ||
| 72 | POWER_SUPPLY_CAPACITY_LEVEL_NORMAL, | ||
| 73 | POWER_SUPPLY_CAPACITY_LEVEL_HIGH, | ||
| 74 | POWER_SUPPLY_CAPACITY_LEVEL_FULL, | ||
| 75 | }; | ||
| 76 | |||
| 61 | enum power_supply_property { | 77 | enum power_supply_property { |
| 62 | /* Properties of type `int' */ | 78 | /* Properties of type `int' */ |
| 63 | POWER_SUPPLY_PROP_STATUS = 0, | 79 | POWER_SUPPLY_PROP_STATUS = 0, |
| 80 | POWER_SUPPLY_PROP_CHARGE_TYPE, | ||
| 64 | POWER_SUPPLY_PROP_HEALTH, | 81 | POWER_SUPPLY_PROP_HEALTH, |
| 65 | POWER_SUPPLY_PROP_PRESENT, | 82 | POWER_SUPPLY_PROP_PRESENT, |
| 66 | POWER_SUPPLY_PROP_ONLINE, | 83 | POWER_SUPPLY_PROP_ONLINE, |
| @@ -89,6 +106,7 @@ enum power_supply_property { | |||
| 89 | POWER_SUPPLY_PROP_ENERGY_NOW, | 106 | POWER_SUPPLY_PROP_ENERGY_NOW, |
| 90 | POWER_SUPPLY_PROP_ENERGY_AVG, | 107 | POWER_SUPPLY_PROP_ENERGY_AVG, |
| 91 | POWER_SUPPLY_PROP_CAPACITY, /* in percents! */ | 108 | POWER_SUPPLY_PROP_CAPACITY, /* in percents! */ |
| 109 | POWER_SUPPLY_PROP_CAPACITY_LEVEL, | ||
| 92 | POWER_SUPPLY_PROP_TEMP, | 110 | POWER_SUPPLY_PROP_TEMP, |
| 93 | POWER_SUPPLY_PROP_TEMP_AMBIENT, | 111 | POWER_SUPPLY_PROP_TEMP_AMBIENT, |
| 94 | POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW, | 112 | POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW, |
| @@ -126,6 +144,7 @@ struct power_supply { | |||
| 126 | enum power_supply_property psp, | 144 | enum power_supply_property psp, |
| 127 | union power_supply_propval *val); | 145 | union power_supply_propval *val); |
| 128 | void (*external_power_changed)(struct power_supply *psy); | 146 | void (*external_power_changed)(struct power_supply *psy); |
| 147 | void (*set_charged)(struct power_supply *psy); | ||
| 129 | 148 | ||
| 130 | /* For APM emulation, think legacy userspace. */ | 149 | /* For APM emulation, think legacy userspace. */ |
| 131 | int use_for_apm; | 150 | int use_for_apm; |
| @@ -165,8 +184,10 @@ struct power_supply_info { | |||
| 165 | int use_for_apm; | 184 | int use_for_apm; |
| 166 | }; | 185 | }; |
| 167 | 186 | ||
| 187 | extern struct power_supply *power_supply_get_by_name(char *name); | ||
| 168 | extern void power_supply_changed(struct power_supply *psy); | 188 | extern void power_supply_changed(struct power_supply *psy); |
| 169 | extern int power_supply_am_i_supplied(struct power_supply *psy); | 189 | extern int power_supply_am_i_supplied(struct power_supply *psy); |
| 190 | extern int power_supply_set_battery_charged(struct power_supply *psy); | ||
| 170 | 191 | ||
| 171 | #if defined(CONFIG_POWER_SUPPLY) || defined(CONFIG_POWER_SUPPLY_MODULE) | 192 | #if defined(CONFIG_POWER_SUPPLY) || defined(CONFIG_POWER_SUPPLY_MODULE) |
| 172 | extern int power_supply_is_system_supplied(void); | 193 | extern int power_supply_is_system_supplied(void); |
diff --git a/include/linux/prctl.h b/include/linux/prctl.h index b00df4c79c63..a3baeb2c2161 100644 --- a/include/linux/prctl.h +++ b/include/linux/prctl.h | |||
| @@ -85,7 +85,21 @@ | |||
| 85 | #define PR_SET_TIMERSLACK 29 | 85 | #define PR_SET_TIMERSLACK 29 |
| 86 | #define PR_GET_TIMERSLACK 30 | 86 | #define PR_GET_TIMERSLACK 30 |
| 87 | 87 | ||
| 88 | #define PR_TASK_PERF_COUNTERS_DISABLE 31 | 88 | #define PR_TASK_PERF_EVENTS_DISABLE 31 |
| 89 | #define PR_TASK_PERF_COUNTERS_ENABLE 32 | 89 | #define PR_TASK_PERF_EVENTS_ENABLE 32 |
| 90 | |||
| 91 | /* | ||
| 92 | * Set early/late kill mode for hwpoison memory corruption. | ||
| 93 | * This influences when the process gets killed on a memory corruption. | ||
| 94 | */ | ||
| 95 | #define PR_MCE_KILL 33 | ||
| 96 | # define PR_MCE_KILL_CLEAR 0 | ||
| 97 | # define PR_MCE_KILL_SET 1 | ||
| 98 | |||
| 99 | # define PR_MCE_KILL_LATE 0 | ||
| 100 | # define PR_MCE_KILL_EARLY 1 | ||
| 101 | # define PR_MCE_KILL_DEFAULT 2 | ||
| 102 | |||
| 103 | #define PR_MCE_KILL_GET 34 | ||
| 90 | 104 | ||
| 91 | #endif /* _LINUX_PRCTL_H */ | 105 | #endif /* _LINUX_PRCTL_H */ |
diff --git a/include/linux/preempt.h b/include/linux/preempt.h index 72b1a10a59b6..2e681d9555bd 100644 --- a/include/linux/preempt.h +++ b/include/linux/preempt.h | |||
| @@ -105,6 +105,11 @@ struct preempt_notifier; | |||
| 105 | * @sched_out: we've just been preempted | 105 | * @sched_out: we've just been preempted |
| 106 | * notifier: struct preempt_notifier for the task being preempted | 106 | * notifier: struct preempt_notifier for the task being preempted |
| 107 | * next: the task that's kicking us out | 107 | * next: the task that's kicking us out |
| 108 | * | ||
| 109 | * Please note that sched_in and out are called under different | ||
| 110 | * contexts. sched_out is called with rq lock held and irq disabled | ||
| 111 | * while sched_in is called without rq lock and irq enabled. This | ||
| 112 | * difference is intentional and depended upon by its users. | ||
| 108 | */ | 113 | */ |
| 109 | struct preempt_ops { | 114 | struct preempt_ops { |
| 110 | void (*sched_in)(struct preempt_notifier *notifier, int cpu); | 115 | void (*sched_in)(struct preempt_notifier *notifier, int cpu); |
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index e6e77d31c418..379eaed72d4b 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h | |||
| @@ -78,10 +78,19 @@ struct proc_dir_entry { | |||
| 78 | struct list_head pde_openers; /* who did ->open, but not ->release */ | 78 | struct list_head pde_openers; /* who did ->open, but not ->release */ |
| 79 | }; | 79 | }; |
| 80 | 80 | ||
| 81 | enum kcore_type { | ||
| 82 | KCORE_TEXT, | ||
| 83 | KCORE_VMALLOC, | ||
| 84 | KCORE_RAM, | ||
| 85 | KCORE_VMEMMAP, | ||
| 86 | KCORE_OTHER, | ||
| 87 | }; | ||
| 88 | |||
| 81 | struct kcore_list { | 89 | struct kcore_list { |
| 82 | struct kcore_list *next; | 90 | struct list_head list; |
| 83 | unsigned long addr; | 91 | unsigned long addr; |
| 84 | size_t size; | 92 | size_t size; |
| 93 | int type; | ||
| 85 | }; | 94 | }; |
| 86 | 95 | ||
| 87 | struct vmcore { | 96 | struct vmcore { |
| @@ -233,11 +242,12 @@ static inline void dup_mm_exe_file(struct mm_struct *oldmm, | |||
| 233 | #endif /* CONFIG_PROC_FS */ | 242 | #endif /* CONFIG_PROC_FS */ |
| 234 | 243 | ||
| 235 | #if !defined(CONFIG_PROC_KCORE) | 244 | #if !defined(CONFIG_PROC_KCORE) |
| 236 | static inline void kclist_add(struct kcore_list *new, void *addr, size_t size) | 245 | static inline void |
| 246 | kclist_add(struct kcore_list *new, void *addr, size_t size, int type) | ||
| 237 | { | 247 | { |
| 238 | } | 248 | } |
| 239 | #else | 249 | #else |
| 240 | extern void kclist_add(struct kcore_list *, void *, size_t); | 250 | extern void kclist_add(struct kcore_list *, void *, size_t, int type); |
| 241 | #endif | 251 | #endif |
| 242 | 252 | ||
| 243 | union proc_op { | 253 | union proc_op { |
diff --git a/include/linux/quota.h b/include/linux/quota.h index 78c48895b12a..ce9a9b2e5cd4 100644 --- a/include/linux/quota.h +++ b/include/linux/quota.h | |||
| @@ -376,6 +376,17 @@ static inline unsigned int dquot_generic_flag(unsigned int flags, int type) | |||
| 376 | return flags >> _DQUOT_STATE_FLAGS; | 376 | return flags >> _DQUOT_STATE_FLAGS; |
| 377 | } | 377 | } |
| 378 | 378 | ||
| 379 | #ifdef CONFIG_QUOTA_NETLINK_INTERFACE | ||
| 380 | extern void quota_send_warning(short type, unsigned int id, dev_t dev, | ||
| 381 | const char warntype); | ||
| 382 | #else | ||
| 383 | static inline void quota_send_warning(short type, unsigned int id, dev_t dev, | ||
| 384 | const char warntype) | ||
| 385 | { | ||
| 386 | return; | ||
| 387 | } | ||
| 388 | #endif /* CONFIG_QUOTA_NETLINK_INTERFACE */ | ||
| 389 | |||
| 379 | struct quota_info { | 390 | struct quota_info { |
| 380 | unsigned int flags; /* Flags for diskquotas on this device */ | 391 | unsigned int flags; /* Flags for diskquotas on this device */ |
| 381 | struct mutex dqio_mutex; /* lock device while I/O in progress */ | 392 | struct mutex dqio_mutex; /* lock device while I/O in progress */ |
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h index 26361c4c037a..3ebb23153640 100644 --- a/include/linux/quotaops.h +++ b/include/linux/quotaops.h | |||
| @@ -135,8 +135,8 @@ static inline int sb_any_quota_active(struct super_block *sb) | |||
| 135 | /* | 135 | /* |
| 136 | * Operations supported for diskquotas. | 136 | * Operations supported for diskquotas. |
| 137 | */ | 137 | */ |
| 138 | extern struct dquot_operations dquot_operations; | 138 | extern const struct dquot_operations dquot_operations; |
| 139 | extern struct quotactl_ops vfs_quotactl_ops; | 139 | extern const struct quotactl_ops vfs_quotactl_ops; |
| 140 | 140 | ||
| 141 | #define sb_dquot_ops (&dquot_operations) | 141 | #define sb_dquot_ops (&dquot_operations) |
| 142 | #define sb_quotactl_ops (&vfs_quotactl_ops) | 142 | #define sb_quotactl_ops (&vfs_quotactl_ops) |
diff --git a/include/linux/ramfs.h b/include/linux/ramfs.h index 37aaf2b39863..4e768dda87b0 100644 --- a/include/linux/ramfs.h +++ b/include/linux/ramfs.h | |||
| @@ -17,7 +17,7 @@ extern int ramfs_nommu_mmap(struct file *file, struct vm_area_struct *vma); | |||
| 17 | #endif | 17 | #endif |
| 18 | 18 | ||
| 19 | extern const struct file_operations ramfs_file_operations; | 19 | extern const struct file_operations ramfs_file_operations; |
| 20 | extern struct vm_operations_struct generic_file_vm_ops; | 20 | extern const struct vm_operations_struct generic_file_vm_ops; |
| 21 | extern int __init init_rootfs(void); | 21 | extern int __init init_rootfs(void); |
| 22 | 22 | ||
| 23 | #endif | 23 | #endif |
diff --git a/include/linux/ratelimit.h b/include/linux/ratelimit.h index 00044b856453..668cf1bef030 100644 --- a/include/linux/ratelimit.h +++ b/include/linux/ratelimit.h | |||
| @@ -1,20 +1,31 @@ | |||
| 1 | #ifndef _LINUX_RATELIMIT_H | 1 | #ifndef _LINUX_RATELIMIT_H |
| 2 | #define _LINUX_RATELIMIT_H | 2 | #define _LINUX_RATELIMIT_H |
| 3 | |||
| 3 | #include <linux/param.h> | 4 | #include <linux/param.h> |
| 5 | #include <linux/spinlock_types.h> | ||
| 4 | 6 | ||
| 5 | #define DEFAULT_RATELIMIT_INTERVAL (5 * HZ) | 7 | #define DEFAULT_RATELIMIT_INTERVAL (5 * HZ) |
| 6 | #define DEFAULT_RATELIMIT_BURST 10 | 8 | #define DEFAULT_RATELIMIT_BURST 10 |
| 7 | 9 | ||
| 8 | struct ratelimit_state { | 10 | struct ratelimit_state { |
| 9 | int interval; | 11 | spinlock_t lock; /* protect the state */ |
| 10 | int burst; | 12 | |
| 11 | int printed; | 13 | int interval; |
| 12 | int missed; | 14 | int burst; |
| 13 | unsigned long begin; | 15 | int printed; |
| 16 | int missed; | ||
| 17 | unsigned long begin; | ||
| 14 | }; | 18 | }; |
| 15 | 19 | ||
| 16 | #define DEFINE_RATELIMIT_STATE(name, interval, burst) \ | 20 | #define DEFINE_RATELIMIT_STATE(name, interval_init, burst_init) \ |
| 17 | struct ratelimit_state name = {interval, burst,} | 21 | \ |
| 22 | struct ratelimit_state name = { \ | ||
| 23 | .lock = __SPIN_LOCK_UNLOCKED(name.lock), \ | ||
| 24 | .interval = interval_init, \ | ||
| 25 | .burst = burst_init, \ | ||
| 26 | } | ||
| 27 | |||
| 28 | extern int ___ratelimit(struct ratelimit_state *rs, const char *func); | ||
| 29 | #define __ratelimit(state) ___ratelimit(state, __func__) | ||
| 18 | 30 | ||
| 19 | extern int __ratelimit(struct ratelimit_state *rs); | 31 | #endif /* _LINUX_RATELIMIT_H */ |
| 20 | #endif | ||
diff --git a/include/linux/rculist_nulls.h b/include/linux/rculist_nulls.h index f9ddd03961a8..589a40919f01 100644 --- a/include/linux/rculist_nulls.h +++ b/include/linux/rculist_nulls.h | |||
| @@ -102,7 +102,7 @@ static inline void hlist_nulls_add_head_rcu(struct hlist_nulls_node *n, | |||
| 102 | */ | 102 | */ |
| 103 | #define hlist_nulls_for_each_entry_rcu(tpos, pos, head, member) \ | 103 | #define hlist_nulls_for_each_entry_rcu(tpos, pos, head, member) \ |
| 104 | for (pos = rcu_dereference((head)->first); \ | 104 | for (pos = rcu_dereference((head)->first); \ |
| 105 | (!is_a_nulls(pos)) && \ | 105 | (!is_a_nulls(pos)) && \ |
| 106 | ({ tpos = hlist_nulls_entry(pos, typeof(*tpos), member); 1; }); \ | 106 | ({ tpos = hlist_nulls_entry(pos, typeof(*tpos), member); 1; }); \ |
| 107 | pos = rcu_dereference(pos->next)) | 107 | pos = rcu_dereference(pos->next)) |
| 108 | 108 | ||
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 95e0615f4d75..24440f4bf476 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Read-Copy Update mechanism for mutual exclusion | 2 | * Read-Copy Update mechanism for mutual exclusion |
| 3 | * | 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify | 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License as published by | 5 | * it under the terms of the GNU General Public License as published by |
| @@ -18,7 +18,7 @@ | |||
| 18 | * Copyright IBM Corporation, 2001 | 18 | * Copyright IBM Corporation, 2001 |
| 19 | * | 19 | * |
| 20 | * Author: Dipankar Sarma <dipankar@in.ibm.com> | 20 | * Author: Dipankar Sarma <dipankar@in.ibm.com> |
| 21 | * | 21 | * |
| 22 | * Based on the original work by Paul McKenney <paulmck@us.ibm.com> | 22 | * Based on the original work by Paul McKenney <paulmck@us.ibm.com> |
| 23 | * and inputs from Rusty Russell, Andrea Arcangeli and Andi Kleen. | 23 | * and inputs from Rusty Russell, Andrea Arcangeli and Andi Kleen. |
| 24 | * Papers: | 24 | * Papers: |
| @@ -26,7 +26,7 @@ | |||
| 26 | * http://lse.sourceforge.net/locking/rclock_OLS.2001.05.01c.sc.pdf (OLS2001) | 26 | * http://lse.sourceforge.net/locking/rclock_OLS.2001.05.01c.sc.pdf (OLS2001) |
| 27 | * | 27 | * |
| 28 | * For detailed explanation of Read-Copy Update mechanism see - | 28 | * For detailed explanation of Read-Copy Update mechanism see - |
| 29 | * http://lse.sourceforge.net/locking/rcupdate.html | 29 | * http://lse.sourceforge.net/locking/rcupdate.html |
| 30 | * | 30 | * |
| 31 | */ | 31 | */ |
| 32 | 32 | ||
| @@ -52,8 +52,8 @@ struct rcu_head { | |||
| 52 | }; | 52 | }; |
| 53 | 53 | ||
| 54 | /* Exported common interfaces */ | 54 | /* Exported common interfaces */ |
| 55 | extern void synchronize_rcu(void); | ||
| 56 | extern void synchronize_rcu_bh(void); | 55 | extern void synchronize_rcu_bh(void); |
| 56 | extern void synchronize_sched(void); | ||
| 57 | extern void rcu_barrier(void); | 57 | extern void rcu_barrier(void); |
| 58 | extern void rcu_barrier_bh(void); | 58 | extern void rcu_barrier_bh(void); |
| 59 | extern void rcu_barrier_sched(void); | 59 | extern void rcu_barrier_sched(void); |
| @@ -62,17 +62,16 @@ extern int sched_expedited_torture_stats(char *page); | |||
| 62 | 62 | ||
| 63 | /* Internal to kernel */ | 63 | /* Internal to kernel */ |
| 64 | extern void rcu_init(void); | 64 | extern void rcu_init(void); |
| 65 | extern void rcu_scheduler_starting(void); | ||
| 66 | extern int rcu_needs_cpu(int cpu); | ||
| 67 | extern int rcu_scheduler_active; | ||
| 68 | 65 | ||
| 69 | #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) | 66 | #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) |
| 70 | #include <linux/rcutree.h> | 67 | #include <linux/rcutree.h> |
| 68 | #elif defined(CONFIG_TINY_RCU) | ||
| 69 | #include <linux/rcutiny.h> | ||
| 71 | #else | 70 | #else |
| 72 | #error "Unknown RCU implementation specified to kernel configuration" | 71 | #error "Unknown RCU implementation specified to kernel configuration" |
| 73 | #endif | 72 | #endif |
| 74 | 73 | ||
| 75 | #define RCU_HEAD_INIT { .next = NULL, .func = NULL } | 74 | #define RCU_HEAD_INIT { .next = NULL, .func = NULL } |
| 76 | #define RCU_HEAD(head) struct rcu_head head = RCU_HEAD_INIT | 75 | #define RCU_HEAD(head) struct rcu_head head = RCU_HEAD_INIT |
| 77 | #define INIT_RCU_HEAD(ptr) do { \ | 76 | #define INIT_RCU_HEAD(ptr) do { \ |
| 78 | (ptr)->next = NULL; (ptr)->func = NULL; \ | 77 | (ptr)->next = NULL; (ptr)->func = NULL; \ |
| @@ -124,12 +123,6 @@ static inline void rcu_read_lock(void) | |||
| 124 | rcu_read_acquire(); | 123 | rcu_read_acquire(); |
| 125 | } | 124 | } |
| 126 | 125 | ||
| 127 | /** | ||
| 128 | * rcu_read_unlock - marks the end of an RCU read-side critical section. | ||
| 129 | * | ||
| 130 | * See rcu_read_lock() for more information. | ||
| 131 | */ | ||
| 132 | |||
| 133 | /* | 126 | /* |
| 134 | * So where is rcu_write_lock()? It does not exist, as there is no | 127 | * So where is rcu_write_lock()? It does not exist, as there is no |
| 135 | * way for writers to lock out RCU readers. This is a feature, not | 128 | * way for writers to lock out RCU readers. This is a feature, not |
| @@ -139,6 +132,12 @@ static inline void rcu_read_lock(void) | |||
| 139 | * used as well. RCU does not care how the writers keep out of each | 132 | * used as well. RCU does not care how the writers keep out of each |
| 140 | * others' way, as long as they do so. | 133 | * others' way, as long as they do so. |
| 141 | */ | 134 | */ |
| 135 | |||
| 136 | /** | ||
| 137 | * rcu_read_unlock - marks the end of an RCU read-side critical section. | ||
| 138 | * | ||
| 139 | * See rcu_read_lock() for more information. | ||
| 140 | */ | ||
| 142 | static inline void rcu_read_unlock(void) | 141 | static inline void rcu_read_unlock(void) |
| 143 | { | 142 | { |
| 144 | rcu_read_release(); | 143 | rcu_read_release(); |
| @@ -191,6 +190,8 @@ static inline void rcu_read_lock_sched(void) | |||
| 191 | __acquire(RCU_SCHED); | 190 | __acquire(RCU_SCHED); |
| 192 | rcu_read_acquire(); | 191 | rcu_read_acquire(); |
| 193 | } | 192 | } |
| 193 | |||
| 194 | /* Used by lockdep and tracing: cannot be traced, cannot call lockdep. */ | ||
| 194 | static inline notrace void rcu_read_lock_sched_notrace(void) | 195 | static inline notrace void rcu_read_lock_sched_notrace(void) |
| 195 | { | 196 | { |
| 196 | preempt_disable_notrace(); | 197 | preempt_disable_notrace(); |
| @@ -208,6 +209,8 @@ static inline void rcu_read_unlock_sched(void) | |||
| 208 | __release(RCU_SCHED); | 209 | __release(RCU_SCHED); |
| 209 | preempt_enable(); | 210 | preempt_enable(); |
| 210 | } | 211 | } |
| 212 | |||
| 213 | /* Used by lockdep and tracing: cannot be traced, cannot call lockdep. */ | ||
| 211 | static inline notrace void rcu_read_unlock_sched_notrace(void) | 214 | static inline notrace void rcu_read_unlock_sched_notrace(void) |
| 212 | { | 215 | { |
| 213 | __release(RCU_SCHED); | 216 | __release(RCU_SCHED); |
| @@ -262,24 +265,6 @@ struct rcu_synchronize { | |||
| 262 | extern void wakeme_after_rcu(struct rcu_head *head); | 265 | extern void wakeme_after_rcu(struct rcu_head *head); |
| 263 | 266 | ||
| 264 | /** | 267 | /** |
| 265 | * synchronize_sched - block until all CPUs have exited any non-preemptive | ||
| 266 | * kernel code sequences. | ||
| 267 | * | ||
| 268 | * This means that all preempt_disable code sequences, including NMI and | ||
| 269 | * hardware-interrupt handlers, in progress on entry will have completed | ||
| 270 | * before this primitive returns. However, this does not guarantee that | ||
| 271 | * softirq handlers will have completed, since in some kernels, these | ||
| 272 | * handlers can run in process context, and can block. | ||
| 273 | * | ||
| 274 | * This primitive provides the guarantees made by the (now removed) | ||
| 275 | * synchronize_kernel() API. In contrast, synchronize_rcu() only | ||
| 276 | * guarantees that rcu_read_lock() sections will have completed. | ||
| 277 | * In "classic RCU", these two guarantees happen to be one and | ||
| 278 | * the same, but can differ in realtime RCU implementations. | ||
| 279 | */ | ||
| 280 | #define synchronize_sched() __synchronize_sched() | ||
| 281 | |||
| 282 | /** | ||
| 283 | * call_rcu - Queue an RCU callback for invocation after a grace period. | 268 | * call_rcu - Queue an RCU callback for invocation after a grace period. |
| 284 | * @head: structure to be used for queueing the RCU updates. | 269 | * @head: structure to be used for queueing the RCU updates. |
| 285 | * @func: actual update function to be invoked after the grace period | 270 | * @func: actual update function to be invoked after the grace period |
diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h new file mode 100644 index 000000000000..c4ba9a78721e --- /dev/null +++ b/include/linux/rcutiny.h | |||
| @@ -0,0 +1,104 @@ | |||
| 1 | /* | ||
| 2 | * Read-Copy Update mechanism for mutual exclusion, the Bloatwatch edition. | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify | ||
| 5 | * it under the terms of the GNU General Public License as published by | ||
| 6 | * the Free Software Foundation; either version 2 of the License, or | ||
| 7 | * (at your option) any later version. | ||
| 8 | * | ||
| 9 | * This program is distributed in the hope that it will be useful, | ||
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | * GNU General Public License for more details. | ||
| 13 | * | ||
| 14 | * You should have received a copy of the GNU General Public License | ||
| 15 | * along with this program; if not, write to the Free Software | ||
| 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
| 17 | * | ||
| 18 | * Copyright IBM Corporation, 2008 | ||
| 19 | * | ||
| 20 | * Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com> | ||
| 21 | * | ||
| 22 | * For detailed explanation of Read-Copy Update mechanism see - | ||
| 23 | * Documentation/RCU | ||
| 24 | */ | ||
| 25 | #ifndef __LINUX_TINY_H | ||
| 26 | #define __LINUX_TINY_H | ||
| 27 | |||
| 28 | #include <linux/cache.h> | ||
| 29 | |||
| 30 | void rcu_sched_qs(int cpu); | ||
| 31 | void rcu_bh_qs(int cpu); | ||
| 32 | |||
| 33 | #define __rcu_read_lock() preempt_disable() | ||
| 34 | #define __rcu_read_unlock() preempt_enable() | ||
| 35 | #define __rcu_read_lock_bh() local_bh_disable() | ||
| 36 | #define __rcu_read_unlock_bh() local_bh_enable() | ||
| 37 | #define call_rcu_sched call_rcu | ||
| 38 | |||
| 39 | #define rcu_init_sched() do { } while (0) | ||
| 40 | extern void rcu_check_callbacks(int cpu, int user); | ||
| 41 | |||
| 42 | static inline int rcu_needs_cpu(int cpu) | ||
| 43 | { | ||
| 44 | return 0; | ||
| 45 | } | ||
| 46 | |||
| 47 | /* | ||
| 48 | * Return the number of grace periods. | ||
| 49 | */ | ||
| 50 | static inline long rcu_batches_completed(void) | ||
| 51 | { | ||
| 52 | return 0; | ||
| 53 | } | ||
| 54 | |||
| 55 | /* | ||
| 56 | * Return the number of bottom-half grace periods. | ||
| 57 | */ | ||
| 58 | static inline long rcu_batches_completed_bh(void) | ||
| 59 | { | ||
| 60 | return 0; | ||
| 61 | } | ||
| 62 | |||
| 63 | extern int rcu_expedited_torture_stats(char *page); | ||
| 64 | |||
| 65 | #define synchronize_rcu synchronize_sched | ||
| 66 | |||
| 67 | static inline void synchronize_rcu_expedited(void) | ||
| 68 | { | ||
| 69 | synchronize_sched(); | ||
| 70 | } | ||
| 71 | |||
| 72 | static inline void synchronize_rcu_bh_expedited(void) | ||
| 73 | { | ||
| 74 | synchronize_sched(); | ||
| 75 | } | ||
| 76 | |||
| 77 | struct notifier_block; | ||
| 78 | |||
| 79 | #ifdef CONFIG_NO_HZ | ||
| 80 | |||
| 81 | extern void rcu_enter_nohz(void); | ||
| 82 | extern void rcu_exit_nohz(void); | ||
| 83 | |||
| 84 | #else /* #ifdef CONFIG_NO_HZ */ | ||
| 85 | |||
| 86 | static inline void rcu_enter_nohz(void) | ||
| 87 | { | ||
| 88 | } | ||
| 89 | |||
| 90 | static inline void rcu_exit_nohz(void) | ||
| 91 | { | ||
| 92 | } | ||
| 93 | |||
| 94 | #endif /* #else #ifdef CONFIG_NO_HZ */ | ||
| 95 | |||
| 96 | static inline void rcu_scheduler_starting(void) | ||
| 97 | { | ||
| 98 | } | ||
| 99 | |||
| 100 | static inline void exit_rcu(void) | ||
| 101 | { | ||
| 102 | } | ||
| 103 | |||
| 104 | #endif /* __LINUX_RCUTINY_H */ | ||
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h index a89307717825..c93eee5911b0 100644 --- a/include/linux/rcutree.h +++ b/include/linux/rcutree.h | |||
| @@ -24,21 +24,25 @@ | |||
| 24 | * and inputs from Rusty Russell, Andrea Arcangeli and Andi Kleen. | 24 | * and inputs from Rusty Russell, Andrea Arcangeli and Andi Kleen. |
| 25 | * | 25 | * |
| 26 | * For detailed explanation of Read-Copy Update mechanism see - | 26 | * For detailed explanation of Read-Copy Update mechanism see - |
| 27 | * Documentation/RCU | 27 | * Documentation/RCU |
| 28 | */ | 28 | */ |
| 29 | 29 | ||
| 30 | #ifndef __LINUX_RCUTREE_H | 30 | #ifndef __LINUX_RCUTREE_H |
| 31 | #define __LINUX_RCUTREE_H | 31 | #define __LINUX_RCUTREE_H |
| 32 | 32 | ||
| 33 | struct notifier_block; | ||
| 34 | |||
| 33 | extern void rcu_sched_qs(int cpu); | 35 | extern void rcu_sched_qs(int cpu); |
| 34 | extern void rcu_bh_qs(int cpu); | 36 | extern void rcu_bh_qs(int cpu); |
| 35 | |||
| 36 | extern int rcu_needs_cpu(int cpu); | 37 | extern int rcu_needs_cpu(int cpu); |
| 38 | extern void rcu_scheduler_starting(void); | ||
| 39 | extern int rcu_expedited_torture_stats(char *page); | ||
| 37 | 40 | ||
| 38 | #ifdef CONFIG_TREE_PREEMPT_RCU | 41 | #ifdef CONFIG_TREE_PREEMPT_RCU |
| 39 | 42 | ||
| 40 | extern void __rcu_read_lock(void); | 43 | extern void __rcu_read_lock(void); |
| 41 | extern void __rcu_read_unlock(void); | 44 | extern void __rcu_read_unlock(void); |
| 45 | extern void synchronize_rcu(void); | ||
| 42 | extern void exit_rcu(void); | 46 | extern void exit_rcu(void); |
| 43 | 47 | ||
| 44 | #else /* #ifdef CONFIG_TREE_PREEMPT_RCU */ | 48 | #else /* #ifdef CONFIG_TREE_PREEMPT_RCU */ |
| @@ -53,6 +57,8 @@ static inline void __rcu_read_unlock(void) | |||
| 53 | preempt_enable(); | 57 | preempt_enable(); |
| 54 | } | 58 | } |
| 55 | 59 | ||
| 60 | #define synchronize_rcu synchronize_sched | ||
| 61 | |||
| 56 | static inline void exit_rcu(void) | 62 | static inline void exit_rcu(void) |
| 57 | { | 63 | { |
| 58 | } | 64 | } |
| @@ -68,33 +74,21 @@ static inline void __rcu_read_unlock_bh(void) | |||
| 68 | local_bh_enable(); | 74 | local_bh_enable(); |
| 69 | } | 75 | } |
| 70 | 76 | ||
| 71 | #define __synchronize_sched() synchronize_rcu() | ||
| 72 | |||
| 73 | extern void call_rcu_sched(struct rcu_head *head, | 77 | extern void call_rcu_sched(struct rcu_head *head, |
| 74 | void (*func)(struct rcu_head *rcu)); | 78 | void (*func)(struct rcu_head *rcu)); |
| 75 | 79 | extern void synchronize_rcu_expedited(void); | |
| 76 | static inline void synchronize_rcu_expedited(void) | ||
| 77 | { | ||
| 78 | synchronize_sched_expedited(); | ||
| 79 | } | ||
| 80 | 80 | ||
| 81 | static inline void synchronize_rcu_bh_expedited(void) | 81 | static inline void synchronize_rcu_bh_expedited(void) |
| 82 | { | 82 | { |
| 83 | synchronize_sched_expedited(); | 83 | synchronize_sched_expedited(); |
| 84 | } | 84 | } |
| 85 | 85 | ||
| 86 | extern void __rcu_init(void); | ||
| 87 | extern void rcu_check_callbacks(int cpu, int user); | 86 | extern void rcu_check_callbacks(int cpu, int user); |
| 88 | extern void rcu_restart_cpu(int cpu); | ||
| 89 | 87 | ||
| 90 | extern long rcu_batches_completed(void); | 88 | extern long rcu_batches_completed(void); |
| 91 | extern long rcu_batches_completed_bh(void); | 89 | extern long rcu_batches_completed_bh(void); |
| 92 | extern long rcu_batches_completed_sched(void); | 90 | extern long rcu_batches_completed_sched(void); |
| 93 | 91 | ||
| 94 | static inline void rcu_init_sched(void) | ||
| 95 | { | ||
| 96 | } | ||
| 97 | |||
| 98 | #ifdef CONFIG_NO_HZ | 92 | #ifdef CONFIG_NO_HZ |
| 99 | void rcu_enter_nohz(void); | 93 | void rcu_enter_nohz(void); |
| 100 | void rcu_exit_nohz(void); | 94 | void rcu_exit_nohz(void); |
| @@ -107,7 +101,7 @@ static inline void rcu_exit_nohz(void) | |||
| 107 | } | 101 | } |
| 108 | #endif /* CONFIG_NO_HZ */ | 102 | #endif /* CONFIG_NO_HZ */ |
| 109 | 103 | ||
| 110 | /* A context switch is a grace period for rcutree. */ | 104 | /* A context switch is a grace period for RCU-sched and RCU-bh. */ |
| 111 | static inline int rcu_blocking_is_gp(void) | 105 | static inline int rcu_blocking_is_gp(void) |
| 112 | { | 106 | { |
| 113 | return num_online_cpus() == 1; | 107 | return num_online_cpus() == 1; |
diff --git a/include/linux/rds.h b/include/linux/rds.h index d91dc91f5443..89d46e1afbb1 100644 --- a/include/linux/rds.h +++ b/include/linux/rds.h | |||
| @@ -147,6 +147,18 @@ struct rds_info_socket { | |||
| 147 | u_int64_t inum; | 147 | u_int64_t inum; |
| 148 | } __attribute__((packed)); | 148 | } __attribute__((packed)); |
| 149 | 149 | ||
| 150 | struct rds_info_tcp_socket { | ||
| 151 | __be32 local_addr; | ||
| 152 | __be16 local_port; | ||
| 153 | __be32 peer_addr; | ||
| 154 | __be16 peer_port; | ||
| 155 | u_int64_t hdr_rem; | ||
| 156 | u_int64_t data_rem; | ||
| 157 | u_int32_t last_sent_nxt; | ||
| 158 | u_int32_t last_expected_una; | ||
| 159 | u_int32_t last_seen_una; | ||
| 160 | } __attribute__((packed)); | ||
| 161 | |||
| 150 | #define RDS_IB_GID_LEN 16 | 162 | #define RDS_IB_GID_LEN 16 |
| 151 | struct rds_info_rdma_connection { | 163 | struct rds_info_rdma_connection { |
| 152 | __be32 src_addr; | 164 | __be32 src_addr; |
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h index 277f4b964df5..490c5b37b6d7 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h | |||
| @@ -125,6 +125,8 @@ struct regulator_bulk_data { | |||
| 125 | /* regulator get and put */ | 125 | /* regulator get and put */ |
| 126 | struct regulator *__must_check regulator_get(struct device *dev, | 126 | struct regulator *__must_check regulator_get(struct device *dev, |
| 127 | const char *id); | 127 | const char *id); |
| 128 | struct regulator *__must_check regulator_get_exclusive(struct device *dev, | ||
| 129 | const char *id); | ||
| 128 | void regulator_put(struct regulator *regulator); | 130 | void regulator_put(struct regulator *regulator); |
| 129 | 131 | ||
| 130 | /* regulator output control and status */ | 132 | /* regulator output control and status */ |
| @@ -144,6 +146,8 @@ void regulator_bulk_free(int num_consumers, | |||
| 144 | 146 | ||
| 145 | int regulator_count_voltages(struct regulator *regulator); | 147 | int regulator_count_voltages(struct regulator *regulator); |
| 146 | int regulator_list_voltage(struct regulator *regulator, unsigned selector); | 148 | int regulator_list_voltage(struct regulator *regulator, unsigned selector); |
| 149 | int regulator_is_supported_voltage(struct regulator *regulator, | ||
| 150 | int min_uV, int max_uV); | ||
| 147 | int regulator_set_voltage(struct regulator *regulator, int min_uV, int max_uV); | 151 | int regulator_set_voltage(struct regulator *regulator, int min_uV, int max_uV); |
| 148 | int regulator_get_voltage(struct regulator *regulator); | 152 | int regulator_get_voltage(struct regulator *regulator); |
| 149 | int regulator_set_current_limit(struct regulator *regulator, | 153 | int regulator_set_current_limit(struct regulator *regulator, |
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h index 225f733e7533..31f2055eae28 100644 --- a/include/linux/regulator/driver.h +++ b/include/linux/regulator/driver.h | |||
| @@ -37,7 +37,8 @@ enum regulator_status { | |||
| 37 | * | 37 | * |
| 38 | * @enable: Configure the regulator as enabled. | 38 | * @enable: Configure the regulator as enabled. |
| 39 | * @disable: Configure the regulator as disabled. | 39 | * @disable: Configure the regulator as disabled. |
| 40 | * @is_enabled: Return 1 if the regulator is enabled, 0 otherwise. | 40 | * @is_enabled: Return 1 if the regulator is enabled, 0 if not. |
| 41 | * May also return negative errno. | ||
| 41 | * | 42 | * |
| 42 | * @set_voltage: Set the voltage for the regulator within the range specified. | 43 | * @set_voltage: Set the voltage for the regulator within the range specified. |
| 43 | * The driver should select the voltage closest to min_uV. | 44 | * The driver should select the voltage closest to min_uV. |
| @@ -162,6 +163,8 @@ struct regulator_desc { | |||
| 162 | struct regulator_dev { | 163 | struct regulator_dev { |
| 163 | struct regulator_desc *desc; | 164 | struct regulator_desc *desc; |
| 164 | int use_count; | 165 | int use_count; |
| 166 | int open_count; | ||
| 167 | int exclusive; | ||
| 165 | 168 | ||
| 166 | /* lists we belong to */ | 169 | /* lists we belong to */ |
| 167 | struct list_head list; /* list of all regulators */ | 170 | struct list_head list; /* list of all regulators */ |
| @@ -193,6 +196,8 @@ void *rdev_get_drvdata(struct regulator_dev *rdev); | |||
| 193 | struct device *rdev_get_dev(struct regulator_dev *rdev); | 196 | struct device *rdev_get_dev(struct regulator_dev *rdev); |
| 194 | int rdev_get_id(struct regulator_dev *rdev); | 197 | int rdev_get_id(struct regulator_dev *rdev); |
| 195 | 198 | ||
| 199 | int regulator_mode_to_status(unsigned int); | ||
| 200 | |||
| 196 | void *regulator_get_init_drvdata(struct regulator_init_data *reg_init_data); | 201 | void *regulator_get_init_drvdata(struct regulator_init_data *reg_init_data); |
| 197 | 202 | ||
| 198 | #endif | 203 | #endif |
diff --git a/include/linux/regulator/fixed.h b/include/linux/regulator/fixed.h index 91b4da31f1b5..e94a4a1c7c8a 100644 --- a/include/linux/regulator/fixed.h +++ b/include/linux/regulator/fixed.h | |||
| @@ -5,6 +5,9 @@ | |||
| 5 | * | 5 | * |
| 6 | * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> | 6 | * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> |
| 7 | * | 7 | * |
| 8 | * Copyright (c) 2009 Nokia Corporation | ||
| 9 | * Roger Quadros <ext-roger.quadros@nokia.com> | ||
| 10 | * | ||
| 8 | * This program is free software; you can redistribute it and/or | 11 | * This program is free software; you can redistribute it and/or |
| 9 | * modify it under the terms of the GNU General Public License as | 12 | * modify it under the terms of the GNU General Public License as |
| 10 | * published by the Free Software Foundation; either version 2 of the | 13 | * published by the Free Software Foundation; either version 2 of the |
| @@ -16,9 +19,30 @@ | |||
| 16 | 19 | ||
| 17 | struct regulator_init_data; | 20 | struct regulator_init_data; |
| 18 | 21 | ||
| 22 | /** | ||
| 23 | * struct fixed_voltage_config - fixed_voltage_config structure | ||
| 24 | * @supply_name: Name of the regulator supply | ||
| 25 | * @microvolts: Output voltage of regulator | ||
| 26 | * @gpio: GPIO to use for enable control | ||
| 27 | * set to -EINVAL if not used | ||
| 28 | * @enable_high: Polarity of enable GPIO | ||
| 29 | * 1 = Active high, 0 = Active low | ||
| 30 | * @enabled_at_boot: Whether regulator has been enabled at | ||
| 31 | * boot or not. 1 = Yes, 0 = No | ||
| 32 | * This is used to keep the regulator at | ||
| 33 | * the default state | ||
| 34 | * @init_data: regulator_init_data | ||
| 35 | * | ||
| 36 | * This structure contains fixed voltage regulator configuration | ||
| 37 | * information that must be passed by platform code to the fixed | ||
| 38 | * voltage regulator driver. | ||
| 39 | */ | ||
| 19 | struct fixed_voltage_config { | 40 | struct fixed_voltage_config { |
| 20 | const char *supply_name; | 41 | const char *supply_name; |
| 21 | int microvolts; | 42 | int microvolts; |
| 43 | int gpio; | ||
| 44 | unsigned enable_high:1; | ||
| 45 | unsigned enabled_at_boot:1; | ||
| 22 | struct regulator_init_data *init_data; | 46 | struct regulator_init_data *init_data; |
| 23 | }; | 47 | }; |
| 24 | 48 | ||
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h index bac64fa390f2..87f5f176d4ef 100644 --- a/include/linux/regulator/machine.h +++ b/include/linux/regulator/machine.h | |||
| @@ -41,7 +41,7 @@ struct regulator; | |||
| 41 | #define REGULATOR_CHANGE_DRMS 0x10 | 41 | #define REGULATOR_CHANGE_DRMS 0x10 |
| 42 | 42 | ||
| 43 | /** | 43 | /** |
| 44 | * struct regulator_state - regulator state during low power syatem states | 44 | * struct regulator_state - regulator state during low power system 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 | * | 47 | * |
| @@ -117,25 +117,37 @@ struct regulation_constraints { | |||
| 117 | /* mode to set on startup */ | 117 | /* mode to set on startup */ |
| 118 | unsigned int initial_mode; | 118 | unsigned int initial_mode; |
| 119 | 119 | ||
| 120 | /* constriant flags */ | 120 | /* constraint flags */ |
| 121 | unsigned always_on:1; /* regulator never off when system is on */ | 121 | unsigned always_on:1; /* regulator never off when system is on */ |
| 122 | unsigned boot_on:1; /* bootloader/firmware enabled regulator */ | 122 | unsigned boot_on:1; /* bootloader/firmware enabled regulator */ |
| 123 | unsigned apply_uV:1; /* apply uV constraint iff min == max */ | 123 | unsigned apply_uV:1; /* apply uV constraint if min == max */ |
| 124 | }; | 124 | }; |
| 125 | 125 | ||
| 126 | /** | 126 | /** |
| 127 | * struct regulator_consumer_supply - supply -> device mapping | 127 | * struct regulator_consumer_supply - supply -> device mapping |
| 128 | * | 128 | * |
| 129 | * This maps a supply name to a device. | 129 | * This maps a supply name to a device. Only one of dev or dev_name |
| 130 | * can be specified. Use of dev_name allows support for buses which | ||
| 131 | * make struct device available late such as I2C and is the preferred | ||
| 132 | * form. | ||
| 130 | * | 133 | * |
| 131 | * @dev: Device structure for the consumer. | 134 | * @dev: Device structure for the consumer. |
| 135 | * @dev_name: Result of dev_name() for the consumer. | ||
| 132 | * @supply: Name for the supply. | 136 | * @supply: Name for the supply. |
| 133 | */ | 137 | */ |
| 134 | struct regulator_consumer_supply { | 138 | struct regulator_consumer_supply { |
| 135 | struct device *dev; /* consumer */ | 139 | struct device *dev; /* consumer */ |
| 140 | const char *dev_name; /* dev_name() for consumer */ | ||
| 136 | const char *supply; /* consumer supply - e.g. "vcc" */ | 141 | const char *supply; /* consumer supply - e.g. "vcc" */ |
| 137 | }; | 142 | }; |
| 138 | 143 | ||
| 144 | /* Initialize struct regulator_consumer_supply */ | ||
| 145 | #define REGULATOR_SUPPLY(_name, _dev_name) \ | ||
| 146 | { \ | ||
| 147 | .supply = _name, \ | ||
| 148 | .dev_name = _dev_name, \ | ||
| 149 | } | ||
| 150 | |||
| 139 | /** | 151 | /** |
| 140 | * struct regulator_init_data - regulator platform initialisation data. | 152 | * struct regulator_init_data - regulator platform initialisation data. |
| 141 | * | 153 | * |
| @@ -166,6 +178,12 @@ struct regulator_init_data { | |||
| 166 | 178 | ||
| 167 | int regulator_suspend_prepare(suspend_state_t state); | 179 | int regulator_suspend_prepare(suspend_state_t state); |
| 168 | 180 | ||
| 181 | #ifdef CONFIG_REGULATOR | ||
| 169 | void regulator_has_full_constraints(void); | 182 | void regulator_has_full_constraints(void); |
| 183 | #else | ||
| 184 | static inline void regulator_has_full_constraints(void) | ||
| 185 | { | ||
| 186 | } | ||
| 187 | #endif | ||
| 170 | 188 | ||
| 171 | #endif | 189 | #endif |
diff --git a/include/linux/regulator/max1586.h b/include/linux/regulator/max1586.h index 44563192bf16..de9a7fae20be 100644 --- a/include/linux/regulator/max1586.h +++ b/include/linux/regulator/max1586.h | |||
| @@ -36,7 +36,7 @@ | |||
| 36 | * max1586_subdev_data - regulator data | 36 | * max1586_subdev_data - regulator data |
| 37 | * @id: regulator Id (either MAX1586_V3 or MAX1586_V6) | 37 | * @id: regulator Id (either MAX1586_V3 or MAX1586_V6) |
| 38 | * @name: regulator cute name (example for V3: "vcc_core") | 38 | * @name: regulator cute name (example for V3: "vcc_core") |
| 39 | * @platform_data: regulator init data (contraints, supplies, ...) | 39 | * @platform_data: regulator init data (constraints, supplies, ...) |
| 40 | */ | 40 | */ |
| 41 | struct max1586_subdev_data { | 41 | struct max1586_subdev_data { |
| 42 | int id; | 42 | int id; |
| @@ -46,7 +46,7 @@ struct max1586_subdev_data { | |||
| 46 | 46 | ||
| 47 | /** | 47 | /** |
| 48 | * max1586_platform_data - platform data for max1586 | 48 | * max1586_platform_data - platform data for max1586 |
| 49 | * @num_subdevs: number of regultors used (may be 1 or 2) | 49 | * @num_subdevs: number of regulators used (may be 1 or 2) |
| 50 | * @subdevs: regulator used | 50 | * @subdevs: regulator used |
| 51 | * At most, there will be a regulator for V3 and one for V6 voltages. | 51 | * At most, there will be a regulator for V3 and one for V6 voltages. |
| 52 | * @v3_gain: gain on the V3 voltage output multiplied by 1e6. | 52 | * @v3_gain: gain on the V3 voltage output multiplied by 1e6. |
diff --git a/include/linux/relay.h b/include/linux/relay.h index 953fc055e875..14a86bc7102b 100644 --- a/include/linux/relay.h +++ b/include/linux/relay.h | |||
| @@ -140,7 +140,7 @@ struct rchan_callbacks | |||
| 140 | * cause relay_open() to create a single global buffer rather | 140 | * cause relay_open() to create a single global buffer rather |
| 141 | * than the default set of per-cpu buffers. | 141 | * than the default set of per-cpu buffers. |
| 142 | * | 142 | * |
| 143 | * See Documentation/filesystems/relayfs.txt for more info. | 143 | * See Documentation/filesystems/relay.txt for more info. |
| 144 | */ | 144 | */ |
| 145 | struct dentry *(*create_buf_file)(const char *filename, | 145 | struct dentry *(*create_buf_file)(const char *filename, |
| 146 | struct dentry *parent, | 146 | struct dentry *parent, |
diff --git a/include/linux/res_counter.h b/include/linux/res_counter.h index 511f42fc6816..fcb9884df618 100644 --- a/include/linux/res_counter.h +++ b/include/linux/res_counter.h | |||
| @@ -35,6 +35,10 @@ struct res_counter { | |||
| 35 | */ | 35 | */ |
| 36 | unsigned long long limit; | 36 | unsigned long long limit; |
| 37 | /* | 37 | /* |
| 38 | * the limit that usage can be exceed | ||
| 39 | */ | ||
| 40 | unsigned long long soft_limit; | ||
| 41 | /* | ||
| 38 | * the number of unsuccessful attempts to consume the resource | 42 | * the number of unsuccessful attempts to consume the resource |
| 39 | */ | 43 | */ |
| 40 | unsigned long long failcnt; | 44 | unsigned long long failcnt; |
| @@ -87,6 +91,7 @@ enum { | |||
| 87 | RES_MAX_USAGE, | 91 | RES_MAX_USAGE, |
| 88 | RES_LIMIT, | 92 | RES_LIMIT, |
| 89 | RES_FAILCNT, | 93 | RES_FAILCNT, |
| 94 | RES_SOFT_LIMIT, | ||
| 90 | }; | 95 | }; |
| 91 | 96 | ||
| 92 | /* | 97 | /* |
| @@ -132,6 +137,36 @@ static inline bool res_counter_limit_check_locked(struct res_counter *cnt) | |||
| 132 | return false; | 137 | return false; |
| 133 | } | 138 | } |
| 134 | 139 | ||
| 140 | static inline bool res_counter_soft_limit_check_locked(struct res_counter *cnt) | ||
| 141 | { | ||
| 142 | if (cnt->usage < cnt->soft_limit) | ||
| 143 | return true; | ||
| 144 | |||
| 145 | return false; | ||
| 146 | } | ||
| 147 | |||
| 148 | /** | ||
| 149 | * Get the difference between the usage and the soft limit | ||
| 150 | * @cnt: The counter | ||
| 151 | * | ||
| 152 | * Returns 0 if usage is less than or equal to soft limit | ||
| 153 | * The difference between usage and soft limit, otherwise. | ||
| 154 | */ | ||
| 155 | static inline unsigned long long | ||
| 156 | res_counter_soft_limit_excess(struct res_counter *cnt) | ||
| 157 | { | ||
| 158 | unsigned long long excess; | ||
| 159 | unsigned long flags; | ||
| 160 | |||
| 161 | spin_lock_irqsave(&cnt->lock, flags); | ||
| 162 | if (cnt->usage <= cnt->soft_limit) | ||
| 163 | excess = 0; | ||
| 164 | else | ||
| 165 | excess = cnt->usage - cnt->soft_limit; | ||
| 166 | spin_unlock_irqrestore(&cnt->lock, flags); | ||
| 167 | return excess; | ||
| 168 | } | ||
| 169 | |||
| 135 | /* | 170 | /* |
| 136 | * Helper function to detect if the cgroup is within it's limit or | 171 | * Helper function to detect if the cgroup is within it's limit or |
| 137 | * not. It's currently called from cgroup_rss_prepare() | 172 | * not. It's currently called from cgroup_rss_prepare() |
| @@ -147,6 +182,17 @@ static inline bool res_counter_check_under_limit(struct res_counter *cnt) | |||
| 147 | return ret; | 182 | return ret; |
| 148 | } | 183 | } |
| 149 | 184 | ||
| 185 | static inline bool res_counter_check_under_soft_limit(struct res_counter *cnt) | ||
| 186 | { | ||
| 187 | bool ret; | ||
| 188 | unsigned long flags; | ||
| 189 | |||
| 190 | spin_lock_irqsave(&cnt->lock, flags); | ||
| 191 | ret = res_counter_soft_limit_check_locked(cnt); | ||
| 192 | spin_unlock_irqrestore(&cnt->lock, flags); | ||
| 193 | return ret; | ||
| 194 | } | ||
| 195 | |||
| 150 | static inline void res_counter_reset_max(struct res_counter *cnt) | 196 | static inline void res_counter_reset_max(struct res_counter *cnt) |
| 151 | { | 197 | { |
| 152 | unsigned long flags; | 198 | unsigned long flags; |
| @@ -180,4 +226,16 @@ static inline int res_counter_set_limit(struct res_counter *cnt, | |||
| 180 | return ret; | 226 | return ret; |
| 181 | } | 227 | } |
| 182 | 228 | ||
| 229 | static inline int | ||
| 230 | res_counter_set_soft_limit(struct res_counter *cnt, | ||
| 231 | unsigned long long soft_limit) | ||
| 232 | { | ||
| 233 | unsigned long flags; | ||
| 234 | |||
| 235 | spin_lock_irqsave(&cnt->lock, flags); | ||
| 236 | cnt->soft_limit = soft_limit; | ||
| 237 | spin_unlock_irqrestore(&cnt->lock, flags); | ||
| 238 | return 0; | ||
| 239 | } | ||
| 240 | |||
| 183 | #endif | 241 | #endif |
diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h index 278777fa8a3a..3392c59d2706 100644 --- a/include/linux/rfkill.h +++ b/include/linux/rfkill.h | |||
| @@ -6,20 +6,17 @@ | |||
| 6 | * Copyright (C) 2007 Dmitry Torokhov | 6 | * Copyright (C) 2007 Dmitry Torokhov |
| 7 | * Copyright 2009 Johannes Berg <johannes@sipsolutions.net> | 7 | * Copyright 2009 Johannes Berg <johannes@sipsolutions.net> |
| 8 | * | 8 | * |
| 9 | * This program is free software; you can redistribute it and/or modify | 9 | * Permission to use, copy, modify, and/or distribute this software for any |
| 10 | * it under the terms of the GNU General Public License as published by | 10 | * purpose with or without fee is hereby granted, provided that the above |
| 11 | * the Free Software Foundation; either version 2 of the License, or | 11 | * copyright notice and this permission notice appear in all copies. |
| 12 | * (at your option) any later version. | ||
| 13 | * | 12 | * |
| 14 | * This program is distributed in the hope that it will be useful, | 13 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 15 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
| 17 | * GNU General Public License for more details. | 16 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| 18 | * | 17 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| 19 | * You should have received a copy of the GNU General Public License | 18 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 20 | * along with this program; if not, write to the | 19 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 21 | * Free Software Foundation, Inc., | ||
| 22 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
| 23 | */ | 20 | */ |
| 24 | 21 | ||
| 25 | #include <linux/types.h> | 22 | #include <linux/types.h> |
| @@ -47,6 +44,7 @@ enum rfkill_type { | |||
| 47 | RFKILL_TYPE_UWB, | 44 | RFKILL_TYPE_UWB, |
| 48 | RFKILL_TYPE_WIMAX, | 45 | RFKILL_TYPE_WIMAX, |
| 49 | RFKILL_TYPE_WWAN, | 46 | RFKILL_TYPE_WWAN, |
| 47 | RFKILL_TYPE_GPS, | ||
| 50 | NUM_RFKILL_TYPES, | 48 | NUM_RFKILL_TYPES, |
| 51 | }; | 49 | }; |
| 52 | 50 | ||
| @@ -82,6 +80,20 @@ struct rfkill_event { | |||
| 82 | __u8 soft, hard; | 80 | __u8 soft, hard; |
| 83 | } __packed; | 81 | } __packed; |
| 84 | 82 | ||
| 83 | /* | ||
| 84 | * We are planning to be backward and forward compatible with changes | ||
| 85 | * to the event struct, by adding new, optional, members at the end. | ||
| 86 | * When reading an event (whether the kernel from userspace or vice | ||
| 87 | * versa) we need to accept anything that's at least as large as the | ||
| 88 | * version 1 event size, but might be able to accept other sizes in | ||
| 89 | * the future. | ||
| 90 | * | ||
| 91 | * One exception is the kernel -- we already have two event sizes in | ||
| 92 | * that we've made the 'hard' member optional since our only option | ||
| 93 | * is to ignore it anyway. | ||
| 94 | */ | ||
| 95 | #define RFKILL_EVENT_SIZE_V1 8 | ||
| 96 | |||
| 85 | /* ioctl for turning off rfkill-input (if present) */ | 97 | /* ioctl for turning off rfkill-input (if present) */ |
| 86 | #define RFKILL_IOC_MAGIC 'R' | 98 | #define RFKILL_IOC_MAGIC 'R' |
| 87 | #define RFKILL_IOC_NOINPUT 1 | 99 | #define RFKILL_IOC_NOINPUT 1 |
diff --git a/include/linux/rmap.h b/include/linux/rmap.h index bf116d0dbf23..cb0ba7032609 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h | |||
| @@ -71,21 +71,29 @@ void page_add_new_anon_rmap(struct page *, struct vm_area_struct *, unsigned lon | |||
| 71 | void page_add_file_rmap(struct page *); | 71 | void page_add_file_rmap(struct page *); |
| 72 | void page_remove_rmap(struct page *); | 72 | void page_remove_rmap(struct page *); |
| 73 | 73 | ||
| 74 | #ifdef CONFIG_DEBUG_VM | 74 | static inline void page_dup_rmap(struct page *page) |
| 75 | void page_dup_rmap(struct page *page, struct vm_area_struct *vma, unsigned long address); | ||
| 76 | #else | ||
| 77 | static inline void page_dup_rmap(struct page *page, struct vm_area_struct *vma, unsigned long address) | ||
| 78 | { | 75 | { |
| 79 | atomic_inc(&page->_mapcount); | 76 | atomic_inc(&page->_mapcount); |
| 80 | } | 77 | } |
| 81 | #endif | ||
| 82 | 78 | ||
| 83 | /* | 79 | /* |
| 84 | * Called from mm/vmscan.c to handle paging out | 80 | * Called from mm/vmscan.c to handle paging out |
| 85 | */ | 81 | */ |
| 86 | int page_referenced(struct page *, int is_locked, | 82 | int page_referenced(struct page *, int is_locked, |
| 87 | struct mem_cgroup *cnt, unsigned long *vm_flags); | 83 | struct mem_cgroup *cnt, unsigned long *vm_flags); |
| 88 | int try_to_unmap(struct page *, int ignore_refs); | 84 | enum ttu_flags { |
| 85 | TTU_UNMAP = 0, /* unmap mode */ | ||
| 86 | TTU_MIGRATION = 1, /* migration mode */ | ||
| 87 | TTU_MUNLOCK = 2, /* munlock mode */ | ||
| 88 | TTU_ACTION_MASK = 0xff, | ||
| 89 | |||
| 90 | TTU_IGNORE_MLOCK = (1 << 8), /* ignore mlock */ | ||
| 91 | TTU_IGNORE_ACCESS = (1 << 9), /* don't age */ | ||
| 92 | TTU_IGNORE_HWPOISON = (1 << 10),/* corrupted page is recoverable */ | ||
| 93 | }; | ||
| 94 | #define TTU_ACTION(x) ((x) & TTU_ACTION_MASK) | ||
| 95 | |||
| 96 | int try_to_unmap(struct page *, enum ttu_flags flags); | ||
| 89 | 97 | ||
| 90 | /* | 98 | /* |
| 91 | * Called from mm/filemap_xip.c to unmap empty zero page | 99 | * Called from mm/filemap_xip.c to unmap empty zero page |
| @@ -112,6 +120,13 @@ int page_mkclean(struct page *); | |||
| 112 | */ | 120 | */ |
| 113 | int try_to_munlock(struct page *); | 121 | int try_to_munlock(struct page *); |
| 114 | 122 | ||
| 123 | /* | ||
| 124 | * Called by memory-failure.c to kill processes. | ||
| 125 | */ | ||
| 126 | struct anon_vma *page_lock_anon_vma(struct page *page); | ||
| 127 | void page_unlock_anon_vma(struct anon_vma *anon_vma); | ||
| 128 | int page_mapped_in_vma(struct page *page, struct vm_area_struct *vma); | ||
| 129 | |||
| 115 | #else /* !CONFIG_MMU */ | 130 | #else /* !CONFIG_MMU */ |
| 116 | 131 | ||
| 117 | #define anon_vma_init() do {} while (0) | 132 | #define anon_vma_init() do {} while (0) |
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index ba3254ecf7fb..adf2068d12b5 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
| @@ -104,7 +104,7 @@ enum { | |||
| 104 | RTM_NEWADDRLABEL = 72, | 104 | RTM_NEWADDRLABEL = 72, |
| 105 | #define RTM_NEWADDRLABEL RTM_NEWADDRLABEL | 105 | #define RTM_NEWADDRLABEL RTM_NEWADDRLABEL |
| 106 | RTM_DELADDRLABEL, | 106 | RTM_DELADDRLABEL, |
| 107 | #define RTM_NEWADDRLABEL RTM_NEWADDRLABEL | 107 | #define RTM_DELADDRLABEL RTM_DELADDRLABEL |
| 108 | RTM_GETADDRLABEL, | 108 | RTM_GETADDRLABEL, |
| 109 | #define RTM_GETADDRLABEL RTM_GETADDRLABEL | 109 | #define RTM_GETADDRLABEL RTM_GETADDRLABEL |
| 110 | 110 | ||
diff --git a/include/linux/rxrpc.h b/include/linux/rxrpc.h index f7b826b565c7..a53915cd5581 100644 --- a/include/linux/rxrpc.h +++ b/include/linux/rxrpc.h | |||
| @@ -58,5 +58,12 @@ struct sockaddr_rxrpc { | |||
| 58 | #define RXRPC_SECURITY_AUTH 1 /* authenticated packets */ | 58 | #define RXRPC_SECURITY_AUTH 1 /* authenticated packets */ |
| 59 | #define RXRPC_SECURITY_ENCRYPT 2 /* encrypted packets */ | 59 | #define RXRPC_SECURITY_ENCRYPT 2 /* encrypted packets */ |
| 60 | 60 | ||
| 61 | /* | ||
| 62 | * RxRPC security indices | ||
| 63 | */ | ||
| 64 | #define RXRPC_SECURITY_NONE 0 /* no security protocol */ | ||
| 65 | #define RXRPC_SECURITY_RXKAD 2 /* kaserver or kerberos 4 */ | ||
| 66 | #define RXRPC_SECURITY_RXGK 4 /* gssapi-based */ | ||
| 67 | #define RXRPC_SECURITY_RXK5 5 /* kerberos 5 */ | ||
| 61 | 68 | ||
| 62 | #endif /* _LINUX_RXRPC_H */ | 69 | #endif /* _LINUX_RXRPC_H */ |
diff --git a/include/linux/sched.h b/include/linux/sched.h index f3d74bd04d18..89115ec7d43f 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -100,7 +100,7 @@ struct robust_list_head; | |||
| 100 | struct bio; | 100 | struct bio; |
| 101 | struct fs_struct; | 101 | struct fs_struct; |
| 102 | struct bts_context; | 102 | struct bts_context; |
| 103 | struct perf_counter_context; | 103 | struct perf_event_context; |
| 104 | 104 | ||
| 105 | /* | 105 | /* |
| 106 | * List of flags we want to share for kernel threads, | 106 | * List of flags we want to share for kernel threads, |
| @@ -140,8 +140,11 @@ extern int nr_processes(void); | |||
| 140 | extern unsigned long nr_running(void); | 140 | extern unsigned long nr_running(void); |
| 141 | extern unsigned long nr_uninterruptible(void); | 141 | extern unsigned long nr_uninterruptible(void); |
| 142 | extern unsigned long nr_iowait(void); | 142 | extern unsigned long nr_iowait(void); |
| 143 | extern unsigned long nr_iowait_cpu(void); | ||
| 144 | extern unsigned long this_cpu_load(void); | ||
| 145 | |||
| 146 | |||
| 143 | extern void calc_global_load(void); | 147 | extern void calc_global_load(void); |
| 144 | extern u64 cpu_nr_migrations(int cpu); | ||
| 145 | 148 | ||
| 146 | extern unsigned long get_parent_ip(unsigned long addr); | 149 | extern unsigned long get_parent_ip(unsigned long addr); |
| 147 | 150 | ||
| @@ -167,8 +170,6 @@ print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq) | |||
| 167 | } | 170 | } |
| 168 | #endif | 171 | #endif |
| 169 | 172 | ||
| 170 | extern unsigned long long time_sync_thresh; | ||
| 171 | |||
| 172 | /* | 173 | /* |
| 173 | * Task state bitmask. NOTE! These bits are also | 174 | * Task state bitmask. NOTE! These bits are also |
| 174 | * encoded in fs/proc/array.c: get_task_state(). | 175 | * encoded in fs/proc/array.c: get_task_state(). |
| @@ -190,6 +191,7 @@ extern unsigned long long time_sync_thresh; | |||
| 190 | /* in tsk->state again */ | 191 | /* in tsk->state again */ |
| 191 | #define TASK_DEAD 64 | 192 | #define TASK_DEAD 64 |
| 192 | #define TASK_WAKEKILL 128 | 193 | #define TASK_WAKEKILL 128 |
| 194 | #define TASK_WAKING 256 | ||
| 193 | 195 | ||
| 194 | /* Convenience macros for the sake of set_task_state */ | 196 | /* Convenience macros for the sake of set_task_state */ |
| 195 | #define TASK_KILLABLE (TASK_WAKEKILL | TASK_UNINTERRUPTIBLE) | 197 | #define TASK_KILLABLE (TASK_WAKEKILL | TASK_UNINTERRUPTIBLE) |
| @@ -256,7 +258,7 @@ extern asmlinkage void schedule_tail(struct task_struct *prev); | |||
| 256 | extern void init_idle(struct task_struct *idle, int cpu); | 258 | extern void init_idle(struct task_struct *idle, int cpu); |
| 257 | extern void init_idle_bootup_task(struct task_struct *idle); | 259 | extern void init_idle_bootup_task(struct task_struct *idle); |
| 258 | 260 | ||
| 259 | extern int runqueue_is_locked(void); | 261 | extern int runqueue_is_locked(int cpu); |
| 260 | extern void task_rq_unlock_wait(struct task_struct *p); | 262 | extern void task_rq_unlock_wait(struct task_struct *p); |
| 261 | 263 | ||
| 262 | extern cpumask_var_t nohz_cpu_mask; | 264 | extern cpumask_var_t nohz_cpu_mask; |
| @@ -304,7 +306,7 @@ extern void softlockup_tick(void); | |||
| 304 | extern void touch_softlockup_watchdog(void); | 306 | extern void touch_softlockup_watchdog(void); |
| 305 | extern void touch_all_softlockup_watchdogs(void); | 307 | extern void touch_all_softlockup_watchdogs(void); |
| 306 | extern int proc_dosoftlockup_thresh(struct ctl_table *table, int write, | 308 | extern int proc_dosoftlockup_thresh(struct ctl_table *table, int write, |
| 307 | struct file *filp, void __user *buffer, | 309 | void __user *buffer, |
| 308 | size_t *lenp, loff_t *ppos); | 310 | size_t *lenp, loff_t *ppos); |
| 309 | extern unsigned int softlockup_panic; | 311 | extern unsigned int softlockup_panic; |
| 310 | extern int softlockup_thresh; | 312 | extern int softlockup_thresh; |
| @@ -326,7 +328,7 @@ extern unsigned long sysctl_hung_task_check_count; | |||
| 326 | extern unsigned long sysctl_hung_task_timeout_secs; | 328 | extern unsigned long sysctl_hung_task_timeout_secs; |
| 327 | extern unsigned long sysctl_hung_task_warnings; | 329 | extern unsigned long sysctl_hung_task_warnings; |
| 328 | extern int proc_dohung_task_timeout_secs(struct ctl_table *table, int write, | 330 | extern int proc_dohung_task_timeout_secs(struct ctl_table *table, int write, |
| 329 | struct file *filp, void __user *buffer, | 331 | void __user *buffer, |
| 330 | size_t *lenp, loff_t *ppos); | 332 | size_t *lenp, loff_t *ppos); |
| 331 | #endif | 333 | #endif |
| 332 | 334 | ||
| @@ -344,7 +346,6 @@ extern signed long schedule_timeout(signed long timeout); | |||
| 344 | extern signed long schedule_timeout_interruptible(signed long timeout); | 346 | extern signed long schedule_timeout_interruptible(signed long timeout); |
| 345 | extern signed long schedule_timeout_killable(signed long timeout); | 347 | extern signed long schedule_timeout_killable(signed long timeout); |
| 346 | extern signed long schedule_timeout_uninterruptible(signed long timeout); | 348 | extern signed long schedule_timeout_uninterruptible(signed long timeout); |
| 347 | asmlinkage void __schedule(void); | ||
| 348 | asmlinkage void schedule(void); | 349 | asmlinkage void schedule(void); |
| 349 | extern int mutex_spin_on_owner(struct mutex *lock, struct thread_info *owner); | 350 | extern int mutex_spin_on_owner(struct mutex *lock, struct thread_info *owner); |
| 350 | 351 | ||
| @@ -421,6 +422,15 @@ static inline unsigned long get_mm_hiwater_rss(struct mm_struct *mm) | |||
| 421 | return max(mm->hiwater_rss, get_mm_rss(mm)); | 422 | return max(mm->hiwater_rss, get_mm_rss(mm)); |
| 422 | } | 423 | } |
| 423 | 424 | ||
| 425 | static inline void setmax_mm_hiwater_rss(unsigned long *maxrss, | ||
| 426 | struct mm_struct *mm) | ||
| 427 | { | ||
| 428 | unsigned long hiwater_rss = get_mm_hiwater_rss(mm); | ||
| 429 | |||
| 430 | if (*maxrss < hiwater_rss) | ||
| 431 | *maxrss = hiwater_rss; | ||
| 432 | } | ||
| 433 | |||
| 424 | static inline unsigned long get_mm_hiwater_vm(struct mm_struct *mm) | 434 | static inline unsigned long get_mm_hiwater_vm(struct mm_struct *mm) |
| 425 | { | 435 | { |
| 426 | return max(mm->hiwater_vm, mm->total_vm); | 436 | return max(mm->hiwater_vm, mm->total_vm); |
| @@ -433,7 +443,9 @@ extern int get_dumpable(struct mm_struct *mm); | |||
| 433 | /* dumpable bits */ | 443 | /* dumpable bits */ |
| 434 | #define MMF_DUMPABLE 0 /* core dump is permitted */ | 444 | #define MMF_DUMPABLE 0 /* core dump is permitted */ |
| 435 | #define MMF_DUMP_SECURELY 1 /* core file is readable only by root */ | 445 | #define MMF_DUMP_SECURELY 1 /* core file is readable only by root */ |
| 446 | |||
| 436 | #define MMF_DUMPABLE_BITS 2 | 447 | #define MMF_DUMPABLE_BITS 2 |
| 448 | #define MMF_DUMPABLE_MASK ((1 << MMF_DUMPABLE_BITS) - 1) | ||
| 437 | 449 | ||
| 438 | /* coredump filter bits */ | 450 | /* coredump filter bits */ |
| 439 | #define MMF_DUMP_ANON_PRIVATE 2 | 451 | #define MMF_DUMP_ANON_PRIVATE 2 |
| @@ -443,6 +455,7 @@ extern int get_dumpable(struct mm_struct *mm); | |||
| 443 | #define MMF_DUMP_ELF_HEADERS 6 | 455 | #define MMF_DUMP_ELF_HEADERS 6 |
| 444 | #define MMF_DUMP_HUGETLB_PRIVATE 7 | 456 | #define MMF_DUMP_HUGETLB_PRIVATE 7 |
| 445 | #define MMF_DUMP_HUGETLB_SHARED 8 | 457 | #define MMF_DUMP_HUGETLB_SHARED 8 |
| 458 | |||
| 446 | #define MMF_DUMP_FILTER_SHIFT MMF_DUMPABLE_BITS | 459 | #define MMF_DUMP_FILTER_SHIFT MMF_DUMPABLE_BITS |
| 447 | #define MMF_DUMP_FILTER_BITS 7 | 460 | #define MMF_DUMP_FILTER_BITS 7 |
| 448 | #define MMF_DUMP_FILTER_MASK \ | 461 | #define MMF_DUMP_FILTER_MASK \ |
| @@ -456,6 +469,10 @@ extern int get_dumpable(struct mm_struct *mm); | |||
| 456 | #else | 469 | #else |
| 457 | # define MMF_DUMP_MASK_DEFAULT_ELF 0 | 470 | # define MMF_DUMP_MASK_DEFAULT_ELF 0 |
| 458 | #endif | 471 | #endif |
| 472 | /* leave room for more dump flags */ | ||
| 473 | #define MMF_VM_MERGEABLE 16 /* KSM may merge identical pages */ | ||
| 474 | |||
| 475 | #define MMF_INIT_MASK (MMF_DUMPABLE_MASK | MMF_DUMP_FILTER_MASK) | ||
| 459 | 476 | ||
| 460 | struct sighand_struct { | 477 | struct sighand_struct { |
| 461 | atomic_t count; | 478 | atomic_t count; |
| @@ -472,6 +489,13 @@ struct pacct_struct { | |||
| 472 | unsigned long ac_minflt, ac_majflt; | 489 | unsigned long ac_minflt, ac_majflt; |
| 473 | }; | 490 | }; |
| 474 | 491 | ||
| 492 | struct cpu_itimer { | ||
| 493 | cputime_t expires; | ||
| 494 | cputime_t incr; | ||
| 495 | u32 error; | ||
| 496 | u32 incr_error; | ||
| 497 | }; | ||
| 498 | |||
| 475 | /** | 499 | /** |
| 476 | * struct task_cputime - collected CPU time counts | 500 | * struct task_cputime - collected CPU time counts |
| 477 | * @utime: time spent in user mode, in &cputime_t units | 501 | * @utime: time spent in user mode, in &cputime_t units |
| @@ -566,9 +590,12 @@ struct signal_struct { | |||
| 566 | struct pid *leader_pid; | 590 | struct pid *leader_pid; |
| 567 | ktime_t it_real_incr; | 591 | ktime_t it_real_incr; |
| 568 | 592 | ||
| 569 | /* ITIMER_PROF and ITIMER_VIRTUAL timers for the process */ | 593 | /* |
| 570 | cputime_t it_prof_expires, it_virt_expires; | 594 | * ITIMER_PROF and ITIMER_VIRTUAL timers for the process, we use |
| 571 | cputime_t it_prof_incr, it_virt_incr; | 595 | * CPUCLOCK_PROF and CPUCLOCK_VIRT for indexing array as these |
| 596 | * values are defined to 0 and 1 respectively | ||
| 597 | */ | ||
| 598 | struct cpu_itimer it[2]; | ||
| 572 | 599 | ||
| 573 | /* | 600 | /* |
| 574 | * Thread group totals for process CPU timers. | 601 | * Thread group totals for process CPU timers. |
| @@ -597,9 +624,13 @@ struct signal_struct { | |||
| 597 | cputime_t utime, stime, cutime, cstime; | 624 | cputime_t utime, stime, cutime, cstime; |
| 598 | cputime_t gtime; | 625 | cputime_t gtime; |
| 599 | cputime_t cgtime; | 626 | cputime_t cgtime; |
| 627 | #ifndef CONFIG_VIRT_CPU_ACCOUNTING | ||
| 628 | cputime_t prev_utime, prev_stime; | ||
| 629 | #endif | ||
| 600 | unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw; | 630 | unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw; |
| 601 | unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt; | 631 | unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt; |
| 602 | unsigned long inblock, oublock, cinblock, coublock; | 632 | unsigned long inblock, oublock, cinblock, coublock; |
| 633 | unsigned long maxrss, cmaxrss; | ||
| 603 | struct task_io_accounting ioac; | 634 | struct task_io_accounting ioac; |
| 604 | 635 | ||
| 605 | /* | 636 | /* |
| @@ -631,6 +662,8 @@ struct signal_struct { | |||
| 631 | unsigned audit_tty; | 662 | unsigned audit_tty; |
| 632 | struct tty_audit_buf *tty_audit_buf; | 663 | struct tty_audit_buf *tty_audit_buf; |
| 633 | #endif | 664 | #endif |
| 665 | |||
| 666 | int oom_adj; /* OOM kill score adjustment (bit shift) */ | ||
| 634 | }; | 667 | }; |
| 635 | 668 | ||
| 636 | /* Context switch must be unlocked if interrupts are to be enabled */ | 669 | /* Context switch must be unlocked if interrupts are to be enabled */ |
| @@ -700,7 +733,7 @@ struct user_struct { | |||
| 700 | #endif | 733 | #endif |
| 701 | #endif | 734 | #endif |
| 702 | 735 | ||
| 703 | #ifdef CONFIG_PERF_COUNTERS | 736 | #ifdef CONFIG_PERF_EVENTS |
| 704 | atomic_long_t locked_vm; | 737 | atomic_long_t locked_vm; |
| 705 | #endif | 738 | #endif |
| 706 | }; | 739 | }; |
| @@ -802,14 +835,14 @@ enum cpu_idle_type { | |||
| 802 | #define SD_BALANCE_NEWIDLE 0x0002 /* Balance when about to become idle */ | 835 | #define SD_BALANCE_NEWIDLE 0x0002 /* Balance when about to become idle */ |
| 803 | #define SD_BALANCE_EXEC 0x0004 /* Balance on exec */ | 836 | #define SD_BALANCE_EXEC 0x0004 /* Balance on exec */ |
| 804 | #define SD_BALANCE_FORK 0x0008 /* Balance on fork, clone */ | 837 | #define SD_BALANCE_FORK 0x0008 /* Balance on fork, clone */ |
| 805 | #define SD_WAKE_IDLE 0x0010 /* Wake to idle CPU on task wakeup */ | 838 | #define SD_BALANCE_WAKE 0x0010 /* Balance on wakeup */ |
| 806 | #define SD_WAKE_AFFINE 0x0020 /* Wake task to waking CPU */ | 839 | #define SD_WAKE_AFFINE 0x0020 /* Wake task to waking CPU */ |
| 807 | #define SD_WAKE_BALANCE 0x0040 /* Perform balancing at task wakeup */ | 840 | #define SD_PREFER_LOCAL 0x0040 /* Prefer to keep tasks local to this domain */ |
| 808 | #define SD_SHARE_CPUPOWER 0x0080 /* Domain members share cpu power */ | 841 | #define SD_SHARE_CPUPOWER 0x0080 /* Domain members share cpu power */ |
| 809 | #define SD_POWERSAVINGS_BALANCE 0x0100 /* Balance for power savings */ | 842 | #define SD_POWERSAVINGS_BALANCE 0x0100 /* Balance for power savings */ |
| 810 | #define SD_SHARE_PKG_RESOURCES 0x0200 /* Domain members share cpu pkg resources */ | 843 | #define SD_SHARE_PKG_RESOURCES 0x0200 /* Domain members share cpu pkg resources */ |
| 811 | #define SD_SERIALIZE 0x0400 /* Only a single load balancing instance */ | 844 | #define SD_SERIALIZE 0x0400 /* Only a single load balancing instance */ |
| 812 | #define SD_WAKE_IDLE_FAR 0x0800 /* Gain latency sacrificing cache hit */ | 845 | |
| 813 | #define SD_PREFER_SIBLING 0x1000 /* Prefer to place tasks in a sibling domain */ | 846 | #define SD_PREFER_SIBLING 0x1000 /* Prefer to place tasks in a sibling domain */ |
| 814 | 847 | ||
| 815 | enum powersavings_balance_level { | 848 | enum powersavings_balance_level { |
| @@ -979,9 +1012,13 @@ static inline struct cpumask *sched_domain_span(struct sched_domain *sd) | |||
| 979 | return to_cpumask(sd->span); | 1012 | return to_cpumask(sd->span); |
| 980 | } | 1013 | } |
| 981 | 1014 | ||
| 982 | extern void partition_sched_domains(int ndoms_new, struct cpumask *doms_new, | 1015 | extern void partition_sched_domains(int ndoms_new, cpumask_var_t doms_new[], |
| 983 | struct sched_domain_attr *dattr_new); | 1016 | struct sched_domain_attr *dattr_new); |
| 984 | 1017 | ||
| 1018 | /* Allocate an array of sched domains, for partition_sched_domains(). */ | ||
| 1019 | cpumask_var_t *alloc_sched_domains(unsigned int ndoms); | ||
| 1020 | void free_sched_domains(cpumask_var_t doms[], unsigned int ndoms); | ||
| 1021 | |||
| 985 | /* Test a flag in parent sched domain */ | 1022 | /* Test a flag in parent sched domain */ |
| 986 | static inline int test_sd_parent(struct sched_domain *sd, int flag) | 1023 | static inline int test_sd_parent(struct sched_domain *sd, int flag) |
| 987 | { | 1024 | { |
| @@ -991,17 +1028,21 @@ static inline int test_sd_parent(struct sched_domain *sd, int flag) | |||
| 991 | return 0; | 1028 | return 0; |
| 992 | } | 1029 | } |
| 993 | 1030 | ||
| 1031 | unsigned long default_scale_freq_power(struct sched_domain *sd, int cpu); | ||
| 1032 | unsigned long default_scale_smt_power(struct sched_domain *sd, int cpu); | ||
| 1033 | |||
| 994 | #else /* CONFIG_SMP */ | 1034 | #else /* CONFIG_SMP */ |
| 995 | 1035 | ||
| 996 | struct sched_domain_attr; | 1036 | struct sched_domain_attr; |
| 997 | 1037 | ||
| 998 | static inline void | 1038 | static inline void |
| 999 | partition_sched_domains(int ndoms_new, struct cpumask *doms_new, | 1039 | partition_sched_domains(int ndoms_new, cpumask_var_t doms_new[], |
| 1000 | struct sched_domain_attr *dattr_new) | 1040 | struct sched_domain_attr *dattr_new) |
| 1001 | { | 1041 | { |
| 1002 | } | 1042 | } |
| 1003 | #endif /* !CONFIG_SMP */ | 1043 | #endif /* !CONFIG_SMP */ |
| 1004 | 1044 | ||
| 1045 | |||
| 1005 | struct io_context; /* See blkdev.h */ | 1046 | struct io_context; /* See blkdev.h */ |
| 1006 | 1047 | ||
| 1007 | 1048 | ||
| @@ -1019,6 +1060,12 @@ struct uts_namespace; | |||
| 1019 | struct rq; | 1060 | struct rq; |
| 1020 | struct sched_domain; | 1061 | struct sched_domain; |
| 1021 | 1062 | ||
| 1063 | /* | ||
| 1064 | * wake flags | ||
| 1065 | */ | ||
| 1066 | #define WF_SYNC 0x01 /* waker goes to sleep after wakup */ | ||
| 1067 | #define WF_FORK 0x02 /* child wakeup after fork */ | ||
| 1068 | |||
| 1022 | struct sched_class { | 1069 | struct sched_class { |
| 1023 | const struct sched_class *next; | 1070 | const struct sched_class *next; |
| 1024 | 1071 | ||
| @@ -1026,13 +1073,13 @@ struct sched_class { | |||
| 1026 | void (*dequeue_task) (struct rq *rq, struct task_struct *p, int sleep); | 1073 | void (*dequeue_task) (struct rq *rq, struct task_struct *p, int sleep); |
| 1027 | void (*yield_task) (struct rq *rq); | 1074 | void (*yield_task) (struct rq *rq); |
| 1028 | 1075 | ||
| 1029 | void (*check_preempt_curr) (struct rq *rq, struct task_struct *p, int sync); | 1076 | void (*check_preempt_curr) (struct rq *rq, struct task_struct *p, int flags); |
| 1030 | 1077 | ||
| 1031 | struct task_struct * (*pick_next_task) (struct rq *rq); | 1078 | struct task_struct * (*pick_next_task) (struct rq *rq); |
| 1032 | void (*put_prev_task) (struct rq *rq, struct task_struct *p); | 1079 | void (*put_prev_task) (struct rq *rq, struct task_struct *p); |
| 1033 | 1080 | ||
| 1034 | #ifdef CONFIG_SMP | 1081 | #ifdef CONFIG_SMP |
| 1035 | int (*select_task_rq)(struct task_struct *p, int sync); | 1082 | int (*select_task_rq)(struct task_struct *p, int sd_flag, int flags); |
| 1036 | 1083 | ||
| 1037 | unsigned long (*load_balance) (struct rq *this_rq, int this_cpu, | 1084 | unsigned long (*load_balance) (struct rq *this_rq, int this_cpu, |
| 1038 | struct rq *busiest, unsigned long max_load_move, | 1085 | struct rq *busiest, unsigned long max_load_move, |
| @@ -1064,6 +1111,8 @@ struct sched_class { | |||
| 1064 | void (*prio_changed) (struct rq *this_rq, struct task_struct *task, | 1111 | void (*prio_changed) (struct rq *this_rq, struct task_struct *task, |
| 1065 | int oldprio, int running); | 1112 | int oldprio, int running); |
| 1066 | 1113 | ||
| 1114 | unsigned int (*get_rr_interval) (struct task_struct *task); | ||
| 1115 | |||
| 1067 | #ifdef CONFIG_FAIR_GROUP_SCHED | 1116 | #ifdef CONFIG_FAIR_GROUP_SCHED |
| 1068 | void (*moved_group) (struct task_struct *p); | 1117 | void (*moved_group) (struct task_struct *p); |
| 1069 | #endif | 1118 | #endif |
| @@ -1102,6 +1151,8 @@ struct sched_entity { | |||
| 1102 | u64 start_runtime; | 1151 | u64 start_runtime; |
| 1103 | u64 avg_wakeup; | 1152 | u64 avg_wakeup; |
| 1104 | 1153 | ||
| 1154 | u64 avg_running; | ||
| 1155 | |||
| 1105 | #ifdef CONFIG_SCHEDSTATS | 1156 | #ifdef CONFIG_SCHEDSTATS |
| 1106 | u64 wait_start; | 1157 | u64 wait_start; |
| 1107 | u64 wait_max; | 1158 | u64 wait_max; |
| @@ -1199,7 +1250,6 @@ struct task_struct { | |||
| 1199 | * a short time | 1250 | * a short time |
| 1200 | */ | 1251 | */ |
| 1201 | unsigned char fpu_counter; | 1252 | unsigned char fpu_counter; |
| 1202 | s8 oomkilladj; /* OOM kill score adjustment (bit shift). */ | ||
| 1203 | #ifdef CONFIG_BLK_DEV_IO_TRACE | 1253 | #ifdef CONFIG_BLK_DEV_IO_TRACE |
| 1204 | unsigned int btrace_seq; | 1254 | unsigned int btrace_seq; |
| 1205 | #endif | 1255 | #endif |
| @@ -1224,7 +1274,6 @@ struct task_struct { | |||
| 1224 | struct mm_struct *mm, *active_mm; | 1274 | struct mm_struct *mm, *active_mm; |
| 1225 | 1275 | ||
| 1226 | /* task state */ | 1276 | /* task state */ |
| 1227 | struct linux_binfmt *binfmt; | ||
| 1228 | int exit_state; | 1277 | int exit_state; |
| 1229 | int exit_code, exit_signal; | 1278 | int exit_code, exit_signal; |
| 1230 | int pdeath_signal; /* The signal sent when the parent dies */ | 1279 | int pdeath_signal; /* The signal sent when the parent dies */ |
| @@ -1285,7 +1334,9 @@ struct task_struct { | |||
| 1285 | 1334 | ||
| 1286 | cputime_t utime, stime, utimescaled, stimescaled; | 1335 | cputime_t utime, stime, utimescaled, stimescaled; |
| 1287 | cputime_t gtime; | 1336 | cputime_t gtime; |
| 1337 | #ifndef CONFIG_VIRT_CPU_ACCOUNTING | ||
| 1288 | cputime_t prev_utime, prev_stime; | 1338 | cputime_t prev_utime, prev_stime; |
| 1339 | #endif | ||
| 1289 | unsigned long nvcsw, nivcsw; /* context switch counts */ | 1340 | unsigned long nvcsw, nivcsw; /* context switch counts */ |
| 1290 | struct timespec start_time; /* monotonic time */ | 1341 | struct timespec start_time; /* monotonic time */ |
| 1291 | struct timespec real_start_time; /* boot based time */ | 1342 | struct timespec real_start_time; /* boot based time */ |
| @@ -1375,17 +1426,17 @@ struct task_struct { | |||
| 1375 | #endif | 1426 | #endif |
| 1376 | #ifdef CONFIG_TRACE_IRQFLAGS | 1427 | #ifdef CONFIG_TRACE_IRQFLAGS |
| 1377 | unsigned int irq_events; | 1428 | unsigned int irq_events; |
| 1378 | int hardirqs_enabled; | ||
| 1379 | unsigned long hardirq_enable_ip; | 1429 | unsigned long hardirq_enable_ip; |
| 1380 | unsigned int hardirq_enable_event; | ||
| 1381 | unsigned long hardirq_disable_ip; | 1430 | unsigned long hardirq_disable_ip; |
| 1431 | unsigned int hardirq_enable_event; | ||
| 1382 | unsigned int hardirq_disable_event; | 1432 | unsigned int hardirq_disable_event; |
| 1383 | int softirqs_enabled; | 1433 | int hardirqs_enabled; |
| 1434 | int hardirq_context; | ||
| 1384 | unsigned long softirq_disable_ip; | 1435 | unsigned long softirq_disable_ip; |
| 1385 | unsigned int softirq_disable_event; | ||
| 1386 | unsigned long softirq_enable_ip; | 1436 | unsigned long softirq_enable_ip; |
| 1437 | unsigned int softirq_disable_event; | ||
| 1387 | unsigned int softirq_enable_event; | 1438 | unsigned int softirq_enable_event; |
| 1388 | int hardirq_context; | 1439 | int softirqs_enabled; |
| 1389 | int softirq_context; | 1440 | int softirq_context; |
| 1390 | #endif | 1441 | #endif |
| 1391 | #ifdef CONFIG_LOCKDEP | 1442 | #ifdef CONFIG_LOCKDEP |
| @@ -1436,10 +1487,10 @@ struct task_struct { | |||
| 1436 | struct list_head pi_state_list; | 1487 | struct list_head pi_state_list; |
| 1437 | struct futex_pi_state *pi_state_cache; | 1488 | struct futex_pi_state *pi_state_cache; |
| 1438 | #endif | 1489 | #endif |
| 1439 | #ifdef CONFIG_PERF_COUNTERS | 1490 | #ifdef CONFIG_PERF_EVENTS |
| 1440 | struct perf_counter_context *perf_counter_ctxp; | 1491 | struct perf_event_context *perf_event_ctxp; |
| 1441 | struct mutex perf_counter_mutex; | 1492 | struct mutex perf_event_mutex; |
| 1442 | struct list_head perf_counter_list; | 1493 | struct list_head perf_event_list; |
| 1443 | #endif | 1494 | #endif |
| 1444 | #ifdef CONFIG_NUMA | 1495 | #ifdef CONFIG_NUMA |
| 1445 | struct mempolicy *mempolicy; /* Protected by alloc_lock */ | 1496 | struct mempolicy *mempolicy; /* Protected by alloc_lock */ |
| @@ -1492,6 +1543,7 @@ struct task_struct { | |||
| 1492 | /* bitmask of trace recursion */ | 1543 | /* bitmask of trace recursion */ |
| 1493 | unsigned long trace_recursion; | 1544 | unsigned long trace_recursion; |
| 1494 | #endif /* CONFIG_TRACING */ | 1545 | #endif /* CONFIG_TRACING */ |
| 1546 | unsigned long stack_start; | ||
| 1495 | }; | 1547 | }; |
| 1496 | 1548 | ||
| 1497 | /* Future-safe accessor for struct task_struct's cpus_allowed. */ | 1549 | /* Future-safe accessor for struct task_struct's cpus_allowed. */ |
| @@ -1673,9 +1725,8 @@ static inline void put_task_struct(struct task_struct *t) | |||
| 1673 | __put_task_struct(t); | 1725 | __put_task_struct(t); |
| 1674 | } | 1726 | } |
| 1675 | 1727 | ||
| 1676 | extern cputime_t task_utime(struct task_struct *p); | 1728 | extern void task_times(struct task_struct *p, cputime_t *ut, cputime_t *st); |
| 1677 | extern cputime_t task_stime(struct task_struct *p); | 1729 | extern void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t *st); |
| 1678 | extern cputime_t task_gtime(struct task_struct *p); | ||
| 1679 | 1730 | ||
| 1680 | /* | 1731 | /* |
| 1681 | * Per process flags | 1732 | * Per process flags |
| @@ -1687,6 +1738,7 @@ extern cputime_t task_gtime(struct task_struct *p); | |||
| 1687 | #define PF_EXITPIDONE 0x00000008 /* pi exit done on shut down */ | 1738 | #define PF_EXITPIDONE 0x00000008 /* pi exit done on shut down */ |
| 1688 | #define PF_VCPU 0x00000010 /* I'm a virtual CPU */ | 1739 | #define PF_VCPU 0x00000010 /* I'm a virtual CPU */ |
| 1689 | #define PF_FORKNOEXEC 0x00000040 /* forked but didn't exec */ | 1740 | #define PF_FORKNOEXEC 0x00000040 /* forked but didn't exec */ |
| 1741 | #define PF_MCE_PROCESS 0x00000080 /* process policy on mce errors */ | ||
| 1690 | #define PF_SUPERPRIV 0x00000100 /* used super-user privileges */ | 1742 | #define PF_SUPERPRIV 0x00000100 /* used super-user privileges */ |
| 1691 | #define PF_DUMPCORE 0x00000200 /* dumped core */ | 1743 | #define PF_DUMPCORE 0x00000200 /* dumped core */ |
| 1692 | #define PF_SIGNALED 0x00000400 /* killed by a signal */ | 1744 | #define PF_SIGNALED 0x00000400 /* killed by a signal */ |
| @@ -1698,7 +1750,7 @@ extern cputime_t task_gtime(struct task_struct *p); | |||
| 1698 | #define PF_FROZEN 0x00010000 /* frozen for system suspend */ | 1750 | #define PF_FROZEN 0x00010000 /* frozen for system suspend */ |
| 1699 | #define PF_FSTRANS 0x00020000 /* inside a filesystem transaction */ | 1751 | #define PF_FSTRANS 0x00020000 /* inside a filesystem transaction */ |
| 1700 | #define PF_KSWAPD 0x00040000 /* I am kswapd */ | 1752 | #define PF_KSWAPD 0x00040000 /* I am kswapd */ |
| 1701 | #define PF_SWAPOFF 0x00080000 /* I am in swapoff */ | 1753 | #define PF_OOM_ORIGIN 0x00080000 /* Allocating much memory to others */ |
| 1702 | #define PF_LESS_THROTTLE 0x00100000 /* Throttle me less: I clean memory */ | 1754 | #define PF_LESS_THROTTLE 0x00100000 /* Throttle me less: I clean memory */ |
| 1703 | #define PF_KTHREAD 0x00200000 /* I am a kernel thread */ | 1755 | #define PF_KTHREAD 0x00200000 /* I am a kernel thread */ |
| 1704 | #define PF_RANDOMIZE 0x00400000 /* randomize virtual address space */ | 1756 | #define PF_RANDOMIZE 0x00400000 /* randomize virtual address space */ |
| @@ -1706,6 +1758,7 @@ extern cputime_t task_gtime(struct task_struct *p); | |||
| 1706 | #define PF_SPREAD_PAGE 0x01000000 /* Spread page cache over cpuset */ | 1758 | #define PF_SPREAD_PAGE 0x01000000 /* Spread page cache over cpuset */ |
| 1707 | #define PF_SPREAD_SLAB 0x02000000 /* Spread some slab caches over cpuset */ | 1759 | #define PF_SPREAD_SLAB 0x02000000 /* Spread some slab caches over cpuset */ |
| 1708 | #define PF_THREAD_BOUND 0x04000000 /* Thread bound to specific cpu */ | 1760 | #define PF_THREAD_BOUND 0x04000000 /* Thread bound to specific cpu */ |
| 1761 | #define PF_MCE_EARLY 0x08000000 /* Early kill for mce process policy */ | ||
| 1709 | #define PF_MEMPOLICY 0x10000000 /* Non-default NUMA mempolicy */ | 1762 | #define PF_MEMPOLICY 0x10000000 /* Non-default NUMA mempolicy */ |
| 1710 | #define PF_MUTEX_TESTER 0x20000000 /* Thread belongs to the rt mutex tester */ | 1763 | #define PF_MUTEX_TESTER 0x20000000 /* Thread belongs to the rt mutex tester */ |
| 1711 | #define PF_FREEZER_SKIP 0x40000000 /* Freezer should not count it as freezeable */ | 1764 | #define PF_FREEZER_SKIP 0x40000000 /* Freezer should not count it as freezeable */ |
| @@ -1740,7 +1793,6 @@ extern cputime_t task_gtime(struct task_struct *p); | |||
| 1740 | 1793 | ||
| 1741 | #define RCU_READ_UNLOCK_BLOCKED (1 << 0) /* blocked while in RCU read-side. */ | 1794 | #define RCU_READ_UNLOCK_BLOCKED (1 << 0) /* blocked while in RCU read-side. */ |
| 1742 | #define RCU_READ_UNLOCK_NEED_QS (1 << 1) /* RCU core needs CPU response. */ | 1795 | #define RCU_READ_UNLOCK_NEED_QS (1 << 1) /* RCU core needs CPU response. */ |
| 1743 | #define RCU_READ_UNLOCK_GOT_QS (1 << 2) /* CPU has responded to RCU core. */ | ||
| 1744 | 1796 | ||
| 1745 | static inline void rcu_copy_process(struct task_struct *p) | 1797 | static inline void rcu_copy_process(struct task_struct *p) |
| 1746 | { | 1798 | { |
| @@ -1770,10 +1822,13 @@ static inline int set_cpus_allowed_ptr(struct task_struct *p, | |||
| 1770 | return 0; | 1822 | return 0; |
| 1771 | } | 1823 | } |
| 1772 | #endif | 1824 | #endif |
| 1825 | |||
| 1826 | #ifndef CONFIG_CPUMASK_OFFSTACK | ||
| 1773 | static inline int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask) | 1827 | static inline int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask) |
| 1774 | { | 1828 | { |
| 1775 | return set_cpus_allowed_ptr(p, &new_mask); | 1829 | return set_cpus_allowed_ptr(p, &new_mask); |
| 1776 | } | 1830 | } |
| 1831 | #endif | ||
| 1777 | 1832 | ||
| 1778 | /* | 1833 | /* |
| 1779 | * Architectures can set this to 1 if they have specified | 1834 | * Architectures can set this to 1 if they have specified |
| @@ -1856,7 +1911,7 @@ extern unsigned int sysctl_sched_time_avg; | |||
| 1856 | extern unsigned int sysctl_timer_migration; | 1911 | extern unsigned int sysctl_timer_migration; |
| 1857 | 1912 | ||
| 1858 | int sched_nr_latency_handler(struct ctl_table *table, int write, | 1913 | int sched_nr_latency_handler(struct ctl_table *table, int write, |
| 1859 | struct file *file, void __user *buffer, size_t *length, | 1914 | void __user *buffer, size_t *length, |
| 1860 | loff_t *ppos); | 1915 | loff_t *ppos); |
| 1861 | #endif | 1916 | #endif |
| 1862 | #ifdef CONFIG_SCHED_DEBUG | 1917 | #ifdef CONFIG_SCHED_DEBUG |
| @@ -1874,7 +1929,7 @@ extern unsigned int sysctl_sched_rt_period; | |||
| 1874 | extern int sysctl_sched_rt_runtime; | 1929 | extern int sysctl_sched_rt_runtime; |
| 1875 | 1930 | ||
| 1876 | int sched_rt_handler(struct ctl_table *table, int write, | 1931 | int sched_rt_handler(struct ctl_table *table, int write, |
| 1877 | struct file *filp, void __user *buffer, size_t *lenp, | 1932 | void __user *buffer, size_t *lenp, |
| 1878 | loff_t *ppos); | 1933 | loff_t *ppos); |
| 1879 | 1934 | ||
| 1880 | extern unsigned int sysctl_sched_compat_yield; | 1935 | extern unsigned int sysctl_sched_compat_yield; |
| @@ -2009,6 +2064,7 @@ extern int kill_pgrp(struct pid *pid, int sig, int priv); | |||
| 2009 | extern int kill_pid(struct pid *pid, int sig, int priv); | 2064 | extern int kill_pid(struct pid *pid, int sig, int priv); |
| 2010 | extern int kill_proc_info(int, struct siginfo *, pid_t); | 2065 | extern int kill_proc_info(int, struct siginfo *, pid_t); |
| 2011 | extern int do_notify_parent(struct task_struct *, int); | 2066 | extern int do_notify_parent(struct task_struct *, int); |
| 2067 | extern void __wake_up_parent(struct task_struct *p, struct task_struct *parent); | ||
| 2012 | extern void force_sig(int, struct task_struct *); | 2068 | extern void force_sig(int, struct task_struct *); |
| 2013 | extern void force_sig_specific(int, struct task_struct *); | 2069 | extern void force_sig_specific(int, struct task_struct *); |
| 2014 | extern int send_sig(int, struct task_struct *, int); | 2070 | extern int send_sig(int, struct task_struct *, int); |
| @@ -2034,11 +2090,18 @@ static inline int is_si_special(const struct siginfo *info) | |||
| 2034 | return info <= SEND_SIG_FORCED; | 2090 | return info <= SEND_SIG_FORCED; |
| 2035 | } | 2091 | } |
| 2036 | 2092 | ||
| 2037 | /* True if we are on the alternate signal stack. */ | 2093 | /* |
| 2038 | 2094 | * True if we are on the alternate signal stack. | |
| 2095 | */ | ||
| 2039 | static inline int on_sig_stack(unsigned long sp) | 2096 | static inline int on_sig_stack(unsigned long sp) |
| 2040 | { | 2097 | { |
| 2041 | return (sp - current->sas_ss_sp < current->sas_ss_size); | 2098 | #ifdef CONFIG_STACK_GROWSUP |
| 2099 | return sp >= current->sas_ss_sp && | ||
| 2100 | sp - current->sas_ss_sp < current->sas_ss_size; | ||
| 2101 | #else | ||
| 2102 | return sp > current->sas_ss_sp && | ||
| 2103 | sp - current->sas_ss_sp <= current->sas_ss_size; | ||
| 2104 | #endif | ||
| 2042 | } | 2105 | } |
| 2043 | 2106 | ||
| 2044 | static inline int sas_ss_flags(unsigned long sp) | 2107 | static inline int sas_ss_flags(unsigned long sp) |
| @@ -2286,7 +2349,10 @@ static inline int signal_pending(struct task_struct *p) | |||
| 2286 | return unlikely(test_tsk_thread_flag(p,TIF_SIGPENDING)); | 2349 | return unlikely(test_tsk_thread_flag(p,TIF_SIGPENDING)); |
| 2287 | } | 2350 | } |
| 2288 | 2351 | ||
| 2289 | extern int __fatal_signal_pending(struct task_struct *p); | 2352 | static inline int __fatal_signal_pending(struct task_struct *p) |
| 2353 | { | ||
| 2354 | return unlikely(sigismember(&p->pending.signal, SIGKILL)); | ||
| 2355 | } | ||
| 2290 | 2356 | ||
| 2291 | static inline int fatal_signal_pending(struct task_struct *p) | 2357 | static inline int fatal_signal_pending(struct task_struct *p) |
| 2292 | { | 2358 | { |
diff --git a/include/linux/securebits.h b/include/linux/securebits.h index d2c5ed845bcc..33406174cbe8 100644 --- a/include/linux/securebits.h +++ b/include/linux/securebits.h | |||
| @@ -1,6 +1,15 @@ | |||
| 1 | #ifndef _LINUX_SECUREBITS_H | 1 | #ifndef _LINUX_SECUREBITS_H |
| 2 | #define _LINUX_SECUREBITS_H 1 | 2 | #define _LINUX_SECUREBITS_H 1 |
| 3 | 3 | ||
| 4 | /* Each securesetting is implemented using two bits. One bit specifies | ||
| 5 | whether the setting is on or off. The other bit specify whether the | ||
| 6 | setting is locked or not. A setting which is locked cannot be | ||
| 7 | changed from user-level. */ | ||
| 8 | #define issecure_mask(X) (1 << (X)) | ||
| 9 | #ifdef __KERNEL__ | ||
| 10 | #define issecure(X) (issecure_mask(X) & current_cred_xxx(securebits)) | ||
| 11 | #endif | ||
| 12 | |||
| 4 | #define SECUREBITS_DEFAULT 0x00000000 | 13 | #define SECUREBITS_DEFAULT 0x00000000 |
| 5 | 14 | ||
| 6 | /* When set UID 0 has no special privileges. When unset, we support | 15 | /* When set UID 0 has no special privileges. When unset, we support |
| @@ -12,6 +21,9 @@ | |||
| 12 | #define SECURE_NOROOT 0 | 21 | #define SECURE_NOROOT 0 |
| 13 | #define SECURE_NOROOT_LOCKED 1 /* make bit-0 immutable */ | 22 | #define SECURE_NOROOT_LOCKED 1 /* make bit-0 immutable */ |
| 14 | 23 | ||
| 24 | #define SECBIT_NOROOT (issecure_mask(SECURE_NOROOT)) | ||
| 25 | #define SECBIT_NOROOT_LOCKED (issecure_mask(SECURE_NOROOT_LOCKED)) | ||
| 26 | |||
| 15 | /* When set, setuid to/from uid 0 does not trigger capability-"fixup". | 27 | /* When set, setuid to/from uid 0 does not trigger capability-"fixup". |
| 16 | When unset, to provide compatiblility with old programs relying on | 28 | When unset, to provide compatiblility with old programs relying on |
| 17 | set*uid to gain/lose privilege, transitions to/from uid 0 cause | 29 | set*uid to gain/lose privilege, transitions to/from uid 0 cause |
| @@ -19,6 +31,10 @@ | |||
| 19 | #define SECURE_NO_SETUID_FIXUP 2 | 31 | #define SECURE_NO_SETUID_FIXUP 2 |
| 20 | #define SECURE_NO_SETUID_FIXUP_LOCKED 3 /* make bit-2 immutable */ | 32 | #define SECURE_NO_SETUID_FIXUP_LOCKED 3 /* make bit-2 immutable */ |
| 21 | 33 | ||
| 34 | #define SECBIT_NO_SETUID_FIXUP (issecure_mask(SECURE_NO_SETUID_FIXUP)) | ||
| 35 | #define SECBIT_NO_SETUID_FIXUP_LOCKED \ | ||
| 36 | (issecure_mask(SECURE_NO_SETUID_FIXUP_LOCKED)) | ||
| 37 | |||
| 22 | /* When set, a process can retain its capabilities even after | 38 | /* When set, a process can retain its capabilities even after |
| 23 | transitioning to a non-root user (the set-uid fixup suppressed by | 39 | transitioning to a non-root user (the set-uid fixup suppressed by |
| 24 | bit 2). Bit-4 is cleared when a process calls exec(); setting both | 40 | bit 2). Bit-4 is cleared when a process calls exec(); setting both |
| @@ -27,12 +43,8 @@ | |||
| 27 | #define SECURE_KEEP_CAPS 4 | 43 | #define SECURE_KEEP_CAPS 4 |
| 28 | #define SECURE_KEEP_CAPS_LOCKED 5 /* make bit-4 immutable */ | 44 | #define SECURE_KEEP_CAPS_LOCKED 5 /* make bit-4 immutable */ |
| 29 | 45 | ||
| 30 | /* Each securesetting is implemented using two bits. One bit specifies | 46 | #define SECBIT_KEEP_CAPS (issecure_mask(SECURE_KEEP_CAPS)) |
| 31 | whether the setting is on or off. The other bit specify whether the | 47 | #define SECBIT_KEEP_CAPS_LOCKED (issecure_mask(SECURE_KEEP_CAPS_LOCKED)) |
| 32 | setting is locked or not. A setting which is locked cannot be | ||
| 33 | changed from user-level. */ | ||
| 34 | #define issecure_mask(X) (1 << (X)) | ||
| 35 | #define issecure(X) (issecure_mask(X) & current_cred_xxx(securebits)) | ||
| 36 | 48 | ||
| 37 | #define SECURE_ALL_BITS (issecure_mask(SECURE_NOROOT) | \ | 49 | #define SECURE_ALL_BITS (issecure_mask(SECURE_NOROOT) | \ |
| 38 | issecure_mask(SECURE_NO_SETUID_FIXUP) | \ | 50 | issecure_mask(SECURE_NO_SETUID_FIXUP) | \ |
diff --git a/include/linux/security.h b/include/linux/security.h index d050b66ab9ef..466cbadbd1ef 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
| @@ -133,7 +133,7 @@ static inline unsigned long round_hint_to_min(unsigned long hint) | |||
| 133 | return PAGE_ALIGN(mmap_min_addr); | 133 | return PAGE_ALIGN(mmap_min_addr); |
| 134 | return hint; | 134 | return hint; |
| 135 | } | 135 | } |
| 136 | extern int mmap_min_addr_handler(struct ctl_table *table, int write, struct file *filp, | 136 | extern int mmap_min_addr_handler(struct ctl_table *table, int write, |
| 137 | void __user *buffer, size_t *lenp, loff_t *ppos); | 137 | void __user *buffer, size_t *lenp, loff_t *ppos); |
| 138 | 138 | ||
| 139 | #ifdef CONFIG_SECURITY | 139 | #ifdef CONFIG_SECURITY |
| @@ -447,6 +447,22 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
| 447 | * @new_dir contains the path structure for parent of the new link. | 447 | * @new_dir contains the path structure for parent of the new link. |
| 448 | * @new_dentry contains the dentry structure of the new link. | 448 | * @new_dentry contains the dentry structure of the new link. |
| 449 | * Return 0 if permission is granted. | 449 | * Return 0 if permission is granted. |
| 450 | * @path_chmod: | ||
| 451 | * Check for permission to change DAC's permission of a file or directory. | ||
| 452 | * @dentry contains the dentry structure. | ||
| 453 | * @mnt contains the vfsmnt structure. | ||
| 454 | * @mode contains DAC's mode. | ||
| 455 | * Return 0 if permission is granted. | ||
| 456 | * @path_chown: | ||
| 457 | * Check for permission to change owner/group of a file or directory. | ||
| 458 | * @path contains the path structure. | ||
| 459 | * @uid contains new owner's ID. | ||
| 460 | * @gid contains new group's ID. | ||
| 461 | * Return 0 if permission is granted. | ||
| 462 | * @path_chroot: | ||
| 463 | * Check for permission to change root directory. | ||
| 464 | * @path contains the path structure. | ||
| 465 | * Return 0 if permission is granted. | ||
| 450 | * @inode_readlink: | 466 | * @inode_readlink: |
| 451 | * Check the permission to read the symbolic link. | 467 | * Check the permission to read the symbolic link. |
| 452 | * @dentry contains the dentry structure for the file link. | 468 | * @dentry contains the dentry structure for the file link. |
| @@ -690,6 +706,7 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
| 690 | * @kernel_module_request: | 706 | * @kernel_module_request: |
| 691 | * Ability to trigger the kernel to automatically upcall to userspace for | 707 | * Ability to trigger the kernel to automatically upcall to userspace for |
| 692 | * userspace to load a kernel module with the given name. | 708 | * userspace to load a kernel module with the given name. |
| 709 | * @kmod_name name of the module requested by the kernel | ||
| 693 | * Return 0 if successful. | 710 | * Return 0 if successful. |
| 694 | * @task_setuid: | 711 | * @task_setuid: |
| 695 | * Check permission before setting one or more of the user identity | 712 | * Check permission before setting one or more of the user identity |
| @@ -1488,6 +1505,10 @@ struct security_operations { | |||
| 1488 | struct dentry *new_dentry); | 1505 | struct dentry *new_dentry); |
| 1489 | int (*path_rename) (struct path *old_dir, struct dentry *old_dentry, | 1506 | int (*path_rename) (struct path *old_dir, struct dentry *old_dentry, |
| 1490 | struct path *new_dir, struct dentry *new_dentry); | 1507 | struct path *new_dir, struct dentry *new_dentry); |
| 1508 | int (*path_chmod) (struct dentry *dentry, struct vfsmount *mnt, | ||
| 1509 | mode_t mode); | ||
| 1510 | int (*path_chown) (struct path *path, uid_t uid, gid_t gid); | ||
| 1511 | int (*path_chroot) (struct path *path); | ||
| 1491 | #endif | 1512 | #endif |
| 1492 | 1513 | ||
| 1493 | int (*inode_alloc_security) (struct inode *inode); | 1514 | int (*inode_alloc_security) (struct inode *inode); |
| @@ -1557,7 +1578,7 @@ struct security_operations { | |||
| 1557 | void (*cred_transfer)(struct cred *new, const struct cred *old); | 1578 | void (*cred_transfer)(struct cred *new, const struct cred *old); |
| 1558 | int (*kernel_act_as)(struct cred *new, u32 secid); | 1579 | int (*kernel_act_as)(struct cred *new, u32 secid); |
| 1559 | int (*kernel_create_files_as)(struct cred *new, struct inode *inode); | 1580 | int (*kernel_create_files_as)(struct cred *new, struct inode *inode); |
| 1560 | int (*kernel_module_request)(void); | 1581 | int (*kernel_module_request)(char *kmod_name); |
| 1561 | int (*task_setuid) (uid_t id0, uid_t id1, uid_t id2, int flags); | 1582 | int (*task_setuid) (uid_t id0, uid_t id1, uid_t id2, int flags); |
| 1562 | int (*task_fix_setuid) (struct cred *new, const struct cred *old, | 1583 | int (*task_fix_setuid) (struct cred *new, const struct cred *old, |
| 1563 | int flags); | 1584 | int flags); |
| @@ -1822,7 +1843,7 @@ void security_commit_creds(struct cred *new, const struct cred *old); | |||
| 1822 | void security_transfer_creds(struct cred *new, const struct cred *old); | 1843 | void security_transfer_creds(struct cred *new, const struct cred *old); |
| 1823 | int security_kernel_act_as(struct cred *new, u32 secid); | 1844 | int security_kernel_act_as(struct cred *new, u32 secid); |
| 1824 | int security_kernel_create_files_as(struct cred *new, struct inode *inode); | 1845 | int security_kernel_create_files_as(struct cred *new, struct inode *inode); |
| 1825 | int security_kernel_module_request(void); | 1846 | int security_kernel_module_request(char *kmod_name); |
| 1826 | int security_task_setuid(uid_t id0, uid_t id1, uid_t id2, int flags); | 1847 | int security_task_setuid(uid_t id0, uid_t id1, uid_t id2, int flags); |
| 1827 | int security_task_fix_setuid(struct cred *new, const struct cred *old, | 1848 | int security_task_fix_setuid(struct cred *new, const struct cred *old, |
| 1828 | int flags); | 1849 | int flags); |
| @@ -2387,7 +2408,7 @@ static inline int security_kernel_create_files_as(struct cred *cred, | |||
| 2387 | return 0; | 2408 | return 0; |
| 2388 | } | 2409 | } |
| 2389 | 2410 | ||
| 2390 | static inline int security_kernel_module_request(void) | 2411 | static inline int security_kernel_module_request(char *kmod_name) |
| 2391 | { | 2412 | { |
| 2392 | return 0; | 2413 | return 0; |
| 2393 | } | 2414 | } |
| @@ -2952,6 +2973,10 @@ int security_path_link(struct dentry *old_dentry, struct path *new_dir, | |||
| 2952 | struct dentry *new_dentry); | 2973 | struct dentry *new_dentry); |
| 2953 | int security_path_rename(struct path *old_dir, struct dentry *old_dentry, | 2974 | int security_path_rename(struct path *old_dir, struct dentry *old_dentry, |
| 2954 | struct path *new_dir, struct dentry *new_dentry); | 2975 | struct path *new_dir, struct dentry *new_dentry); |
| 2976 | int security_path_chmod(struct dentry *dentry, struct vfsmount *mnt, | ||
| 2977 | mode_t mode); | ||
| 2978 | int security_path_chown(struct path *path, uid_t uid, gid_t gid); | ||
| 2979 | int security_path_chroot(struct path *path); | ||
| 2955 | #else /* CONFIG_SECURITY_PATH */ | 2980 | #else /* CONFIG_SECURITY_PATH */ |
| 2956 | static inline int security_path_unlink(struct path *dir, struct dentry *dentry) | 2981 | static inline int security_path_unlink(struct path *dir, struct dentry *dentry) |
| 2957 | { | 2982 | { |
| @@ -3001,6 +3026,23 @@ static inline int security_path_rename(struct path *old_dir, | |||
| 3001 | { | 3026 | { |
| 3002 | return 0; | 3027 | return 0; |
| 3003 | } | 3028 | } |
| 3029 | |||
| 3030 | static inline int security_path_chmod(struct dentry *dentry, | ||
| 3031 | struct vfsmount *mnt, | ||
| 3032 | mode_t mode) | ||
| 3033 | { | ||
| 3034 | return 0; | ||
| 3035 | } | ||
| 3036 | |||
| 3037 | static inline int security_path_chown(struct path *path, uid_t uid, gid_t gid) | ||
| 3038 | { | ||
| 3039 | return 0; | ||
| 3040 | } | ||
| 3041 | |||
| 3042 | static inline int security_path_chroot(struct path *path) | ||
| 3043 | { | ||
| 3044 | return 0; | ||
| 3045 | } | ||
| 3004 | #endif /* CONFIG_SECURITY_PATH */ | 3046 | #endif /* CONFIG_SECURITY_PATH */ |
| 3005 | 3047 | ||
| 3006 | #ifdef CONFIG_KEYS | 3048 | #ifdef CONFIG_KEYS |
diff --git a/include/linux/selinux.h b/include/linux/selinux.h index 20f965d4b041..82e0f26a1299 100644 --- a/include/linux/selinux.h +++ b/include/linux/selinux.h | |||
| @@ -61,6 +61,11 @@ void selinux_secmark_refcount_inc(void); | |||
| 61 | * existing SECMARK targets has been removed/flushed. | 61 | * existing SECMARK targets has been removed/flushed. |
| 62 | */ | 62 | */ |
| 63 | void selinux_secmark_refcount_dec(void); | 63 | void selinux_secmark_refcount_dec(void); |
| 64 | |||
| 65 | /** | ||
| 66 | * selinux_is_enabled - is SELinux enabled? | ||
| 67 | */ | ||
| 68 | bool selinux_is_enabled(void); | ||
| 64 | #else | 69 | #else |
| 65 | 70 | ||
| 66 | static inline int selinux_string_to_sid(const char *str, u32 *sid) | 71 | static inline int selinux_string_to_sid(const char *str, u32 *sid) |
| @@ -84,6 +89,10 @@ static inline void selinux_secmark_refcount_dec(void) | |||
| 84 | return; | 89 | return; |
| 85 | } | 90 | } |
| 86 | 91 | ||
| 92 | static inline bool selinux_is_enabled(void) | ||
| 93 | { | ||
| 94 | return false; | ||
| 95 | } | ||
| 87 | #endif /* CONFIG_SECURITY_SELINUX */ | 96 | #endif /* CONFIG_SECURITY_SELINUX */ |
| 88 | 97 | ||
| 89 | #endif /* _LINUX_SELINUX_H */ | 98 | #endif /* _LINUX_SELINUX_H */ |
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h index 0c6a86b79596..8366d8f12e53 100644 --- a/include/linux/seq_file.h +++ b/include/linux/seq_file.h | |||
| @@ -35,6 +35,44 @@ struct seq_operations { | |||
| 35 | 35 | ||
| 36 | #define SEQ_SKIP 1 | 36 | #define SEQ_SKIP 1 |
| 37 | 37 | ||
| 38 | /** | ||
| 39 | * seq_get_buf - get buffer to write arbitrary data to | ||
| 40 | * @m: the seq_file handle | ||
| 41 | * @bufp: the beginning of the buffer is stored here | ||
| 42 | * | ||
| 43 | * Return the number of bytes available in the buffer, or zero if | ||
| 44 | * there's no space. | ||
| 45 | */ | ||
| 46 | static inline size_t seq_get_buf(struct seq_file *m, char **bufp) | ||
| 47 | { | ||
| 48 | BUG_ON(m->count > m->size); | ||
| 49 | if (m->count < m->size) | ||
| 50 | *bufp = m->buf + m->count; | ||
| 51 | else | ||
| 52 | *bufp = NULL; | ||
| 53 | |||
| 54 | return m->size - m->count; | ||
| 55 | } | ||
| 56 | |||
| 57 | /** | ||
| 58 | * seq_commit - commit data to the buffer | ||
| 59 | * @m: the seq_file handle | ||
| 60 | * @num: the number of bytes to commit | ||
| 61 | * | ||
| 62 | * Commit @num bytes of data written to a buffer previously acquired | ||
| 63 | * by seq_buf_get. To signal an error condition, or that the data | ||
| 64 | * didn't fit in the available space, pass a negative @num value. | ||
| 65 | */ | ||
| 66 | static inline void seq_commit(struct seq_file *m, int num) | ||
| 67 | { | ||
| 68 | if (num < 0) { | ||
| 69 | m->count = m->size; | ||
| 70 | } else { | ||
| 71 | BUG_ON(m->count + num > m->size); | ||
| 72 | m->count += num; | ||
| 73 | } | ||
| 74 | } | ||
| 75 | |||
| 38 | char *mangle_path(char *s, char *p, char *esc); | 76 | char *mangle_path(char *s, char *p, char *esc); |
| 39 | int seq_open(struct file *, const struct seq_operations *); | 77 | int seq_open(struct file *, const struct seq_operations *); |
| 40 | ssize_t seq_read(struct file *, char __user *, size_t, loff_t *); | 78 | ssize_t seq_read(struct file *, char __user *, size_t, loff_t *); |
diff --git a/include/linux/serial.h b/include/linux/serial.h index e5bb75a63802..c8613c3ff9d3 100644 --- a/include/linux/serial.h +++ b/include/linux/serial.h | |||
| @@ -122,6 +122,7 @@ struct serial_uart_config { | |||
| 122 | 122 | ||
| 123 | /* Internal flags used only by kernel */ | 123 | /* Internal flags used only by kernel */ |
| 124 | #define ASYNCB_INITIALIZED 31 /* Serial port was initialized */ | 124 | #define ASYNCB_INITIALIZED 31 /* Serial port was initialized */ |
| 125 | #define ASYNCB_SUSPENDED 30 /* Serial port is suspended */ | ||
| 125 | #define ASYNCB_NORMAL_ACTIVE 29 /* Normal device is active */ | 126 | #define ASYNCB_NORMAL_ACTIVE 29 /* Normal device is active */ |
| 126 | #define ASYNCB_BOOT_AUTOCONF 28 /* Autoconfigure port on bootup */ | 127 | #define ASYNCB_BOOT_AUTOCONF 28 /* Autoconfigure port on bootup */ |
| 127 | #define ASYNCB_CLOSING 27 /* Serial port is closing */ | 128 | #define ASYNCB_CLOSING 27 /* Serial port is closing */ |
| @@ -133,6 +134,7 @@ struct serial_uart_config { | |||
| 133 | #define ASYNCB_FIRST_KERNEL 22 | 134 | #define ASYNCB_FIRST_KERNEL 22 |
| 134 | 135 | ||
| 135 | #define ASYNC_HUP_NOTIFY (1U << ASYNCB_HUP_NOTIFY) | 136 | #define ASYNC_HUP_NOTIFY (1U << ASYNCB_HUP_NOTIFY) |
| 137 | #define ASYNC_SUSPENDED (1U << ASYNCB_SUSPENDED) | ||
| 136 | #define ASYNC_FOURPORT (1U << ASYNCB_FOURPORT) | 138 | #define ASYNC_FOURPORT (1U << ASYNCB_FOURPORT) |
| 137 | #define ASYNC_SAK (1U << ASYNCB_SAK) | 139 | #define ASYNC_SAK (1U << ASYNCB_SAK) |
| 138 | #define ASYNC_SPLIT_TERMIOS (1U << ASYNCB_SPLIT_TERMIOS) | 140 | #define ASYNC_SPLIT_TERMIOS (1U << ASYNCB_SPLIT_TERMIOS) |
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h index d4d2a78ad43e..fb46aba11fb5 100644 --- a/include/linux/serial_8250.h +++ b/include/linux/serial_8250.h | |||
| @@ -22,6 +22,7 @@ struct plat_serial8250_port { | |||
| 22 | void __iomem *membase; /* ioremap cookie or NULL */ | 22 | void __iomem *membase; /* ioremap cookie or NULL */ |
| 23 | resource_size_t mapbase; /* resource base */ | 23 | resource_size_t mapbase; /* resource base */ |
| 24 | unsigned int irq; /* interrupt number */ | 24 | unsigned int irq; /* interrupt number */ |
| 25 | unsigned long irqflags; /* request_irq flags */ | ||
| 25 | unsigned int uartclk; /* UART clock rate */ | 26 | unsigned int uartclk; /* UART clock rate */ |
| 26 | void *private_data; | 27 | void *private_data; |
| 27 | unsigned char regshift; /* register shift */ | 28 | unsigned char regshift; /* register shift */ |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 23d2fb051f97..db532ce288be 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
| @@ -20,6 +20,8 @@ | |||
| 20 | #ifndef LINUX_SERIAL_CORE_H | 20 | #ifndef LINUX_SERIAL_CORE_H |
| 21 | #define LINUX_SERIAL_CORE_H | 21 | #define LINUX_SERIAL_CORE_H |
| 22 | 22 | ||
| 23 | #include <linux/serial.h> | ||
| 24 | |||
| 23 | /* | 25 | /* |
| 24 | * The type definitions. These are from Ted Ts'o's serial.h | 26 | * The type definitions. These are from Ted Ts'o's serial.h |
| 25 | */ | 27 | */ |
| @@ -174,6 +176,9 @@ | |||
| 174 | /* Qualcomm MSM SoCs */ | 176 | /* Qualcomm MSM SoCs */ |
| 175 | #define PORT_MSM 88 | 177 | #define PORT_MSM 88 |
| 176 | 178 | ||
| 179 | /* BCM63xx family SoCs */ | ||
| 180 | #define PORT_BCM63XX 89 | ||
| 181 | |||
| 177 | #ifdef __KERNEL__ | 182 | #ifdef __KERNEL__ |
| 178 | 183 | ||
| 179 | #include <linux/compiler.h> | 184 | #include <linux/compiler.h> |
| @@ -186,7 +191,6 @@ | |||
| 186 | #include <linux/sysrq.h> | 191 | #include <linux/sysrq.h> |
| 187 | 192 | ||
| 188 | struct uart_port; | 193 | struct uart_port; |
| 189 | struct uart_info; | ||
| 190 | struct serial_struct; | 194 | struct serial_struct; |
| 191 | struct device; | 195 | struct device; |
| 192 | 196 | ||
| @@ -265,6 +269,7 @@ struct uart_port { | |||
| 265 | unsigned int (*serial_in)(struct uart_port *, int); | 269 | unsigned int (*serial_in)(struct uart_port *, int); |
| 266 | void (*serial_out)(struct uart_port *, int, int); | 270 | void (*serial_out)(struct uart_port *, int, int); |
| 267 | unsigned int irq; /* irq number */ | 271 | unsigned int irq; /* irq number */ |
| 272 | unsigned long irqflags; /* irq flags */ | ||
| 268 | unsigned int uartclk; /* base uart clock */ | 273 | unsigned int uartclk; /* base uart clock */ |
| 269 | unsigned int fifosize; /* tx fifo size */ | 274 | unsigned int fifosize; /* tx fifo size */ |
| 270 | unsigned char x_char; /* xon/xoff char */ | 275 | unsigned char x_char; /* xon/xoff char */ |
| @@ -283,7 +288,7 @@ struct uart_port { | |||
| 283 | 288 | ||
| 284 | unsigned int read_status_mask; /* driver specific */ | 289 | unsigned int read_status_mask; /* driver specific */ |
| 285 | unsigned int ignore_status_mask; /* driver specific */ | 290 | unsigned int ignore_status_mask; /* driver specific */ |
| 286 | struct uart_info *info; /* pointer to parent info */ | 291 | struct uart_state *state; /* pointer to parent state */ |
| 287 | struct uart_icount icount; /* statistics */ | 292 | struct uart_icount icount; /* statistics */ |
| 288 | 293 | ||
| 289 | struct console *cons; /* struct console, if any */ | 294 | struct console *cons; /* struct console, if any */ |
| @@ -335,52 +340,16 @@ struct uart_port { | |||
| 335 | }; | 340 | }; |
| 336 | 341 | ||
| 337 | /* | 342 | /* |
| 338 | * This is the state information which is only valid when the port | ||
| 339 | * is open; it may be cleared the core driver once the device has | ||
| 340 | * been closed. Either the low level driver or the core can modify | ||
| 341 | * stuff here. | ||
| 342 | */ | ||
| 343 | typedef unsigned int __bitwise__ uif_t; | ||
| 344 | |||
| 345 | struct uart_info { | ||
| 346 | struct tty_port port; | ||
| 347 | struct circ_buf xmit; | ||
| 348 | uif_t flags; | ||
| 349 | |||
| 350 | /* | ||
| 351 | * Definitions for info->flags. These are _private_ to serial_core, and | ||
| 352 | * are specific to this structure. They may be queried by low level drivers. | ||
| 353 | * | ||
| 354 | * FIXME: use the ASY_ definitions | ||
| 355 | */ | ||
| 356 | #define UIF_CHECK_CD ((__force uif_t) (1 << 25)) | ||
| 357 | #define UIF_CTS_FLOW ((__force uif_t) (1 << 26)) | ||
| 358 | #define UIF_NORMAL_ACTIVE ((__force uif_t) (1 << 29)) | ||
| 359 | #define UIF_INITIALIZED ((__force uif_t) (1 << 31)) | ||
| 360 | #define UIF_SUSPENDED ((__force uif_t) (1 << 30)) | ||
| 361 | |||
| 362 | struct tasklet_struct tlet; | ||
| 363 | wait_queue_head_t delta_msr_wait; | ||
| 364 | }; | ||
| 365 | |||
| 366 | /* | ||
| 367 | * This is the state information which is persistent across opens. | 343 | * This is the state information which is persistent across opens. |
| 368 | * The low level driver must not to touch any elements contained | ||
| 369 | * within. | ||
| 370 | */ | 344 | */ |
| 371 | struct uart_state { | 345 | struct uart_state { |
| 372 | unsigned int close_delay; /* msec */ | 346 | struct tty_port port; |
| 373 | unsigned int closing_wait; /* msec */ | ||
| 374 | |||
| 375 | #define USF_CLOSING_WAIT_INF (0) | ||
| 376 | #define USF_CLOSING_WAIT_NONE (~0U) | ||
| 377 | 347 | ||
| 378 | int count; | ||
| 379 | int pm_state; | 348 | int pm_state; |
| 380 | struct uart_info info; | 349 | struct circ_buf xmit; |
| 381 | struct uart_port *port; | ||
| 382 | 350 | ||
| 383 | struct mutex mutex; | 351 | struct tasklet_struct tlet; |
| 352 | struct uart_port *uart_port; | ||
| 384 | }; | 353 | }; |
| 385 | 354 | ||
| 386 | #define UART_XMIT_SIZE PAGE_SIZE | 355 | #define UART_XMIT_SIZE PAGE_SIZE |
| @@ -461,7 +430,7 @@ int uart_resume_port(struct uart_driver *reg, struct uart_port *port); | |||
| 461 | 430 | ||
| 462 | static inline int uart_tx_stopped(struct uart_port *port) | 431 | static inline int uart_tx_stopped(struct uart_port *port) |
| 463 | { | 432 | { |
| 464 | struct tty_struct *tty = port->info->port.tty; | 433 | struct tty_struct *tty = port->state->port.tty; |
| 465 | if(tty->stopped || tty->hw_stopped) | 434 | if(tty->stopped || tty->hw_stopped) |
| 466 | return 1; | 435 | return 1; |
| 467 | return 0; | 436 | return 0; |
| @@ -476,7 +445,7 @@ uart_handle_sysrq_char(struct uart_port *port, unsigned int ch) | |||
| 476 | #ifdef SUPPORT_SYSRQ | 445 | #ifdef SUPPORT_SYSRQ |
| 477 | if (port->sysrq) { | 446 | if (port->sysrq) { |
| 478 | if (ch && time_before(jiffies, port->sysrq)) { | 447 | if (ch && time_before(jiffies, port->sysrq)) { |
| 479 | handle_sysrq(ch, port->info->port.tty); | 448 | handle_sysrq(ch, port->state->port.tty); |
| 480 | port->sysrq = 0; | 449 | port->sysrq = 0; |
| 481 | return 1; | 450 | return 1; |
| 482 | } | 451 | } |
| @@ -494,7 +463,7 @@ uart_handle_sysrq_char(struct uart_port *port, unsigned int ch) | |||
| 494 | */ | 463 | */ |
| 495 | static inline int uart_handle_break(struct uart_port *port) | 464 | static inline int uart_handle_break(struct uart_port *port) |
| 496 | { | 465 | { |
| 497 | struct uart_info *info = port->info; | 466 | struct uart_state *state = port->state; |
| 498 | #ifdef SUPPORT_SYSRQ | 467 | #ifdef SUPPORT_SYSRQ |
| 499 | if (port->cons && port->cons->index == port->line) { | 468 | if (port->cons && port->cons->index == port->line) { |
| 500 | if (!port->sysrq) { | 469 | if (!port->sysrq) { |
| @@ -505,59 +474,60 @@ static inline int uart_handle_break(struct uart_port *port) | |||
| 505 | } | 474 | } |
| 506 | #endif | 475 | #endif |
| 507 | if (port->flags & UPF_SAK) | 476 | if (port->flags & UPF_SAK) |
| 508 | do_SAK(info->port.tty); | 477 | do_SAK(state->port.tty); |
| 509 | return 0; | 478 | return 0; |
| 510 | } | 479 | } |
| 511 | 480 | ||
| 512 | /** | 481 | /** |
| 513 | * uart_handle_dcd_change - handle a change of carrier detect state | 482 | * uart_handle_dcd_change - handle a change of carrier detect state |
| 514 | * @port: uart_port structure for the open port | 483 | * @uport: uart_port structure for the open port |
| 515 | * @status: new carrier detect status, nonzero if active | 484 | * @status: new carrier detect status, nonzero if active |
| 516 | */ | 485 | */ |
| 517 | static inline void | 486 | static inline void |
| 518 | uart_handle_dcd_change(struct uart_port *port, unsigned int status) | 487 | uart_handle_dcd_change(struct uart_port *uport, unsigned int status) |
| 519 | { | 488 | { |
| 520 | struct uart_info *info = port->info; | 489 | struct uart_state *state = uport->state; |
| 490 | struct tty_port *port = &state->port; | ||
| 521 | 491 | ||
| 522 | port->icount.dcd++; | 492 | uport->icount.dcd++; |
| 523 | 493 | ||
| 524 | #ifdef CONFIG_HARD_PPS | 494 | #ifdef CONFIG_HARD_PPS |
| 525 | if ((port->flags & UPF_HARDPPS_CD) && status) | 495 | if ((uport->flags & UPF_HARDPPS_CD) && status) |
| 526 | hardpps(); | 496 | hardpps(); |
| 527 | #endif | 497 | #endif |
| 528 | 498 | ||
| 529 | if (info->flags & UIF_CHECK_CD) { | 499 | if (port->flags & ASYNC_CHECK_CD) { |
| 530 | if (status) | 500 | if (status) |
| 531 | wake_up_interruptible(&info->port.open_wait); | 501 | wake_up_interruptible(&port->open_wait); |
| 532 | else if (info->port.tty) | 502 | else if (port->tty) |
| 533 | tty_hangup(info->port.tty); | 503 | tty_hangup(port->tty); |
| 534 | } | 504 | } |
| 535 | } | 505 | } |
| 536 | 506 | ||
| 537 | /** | 507 | /** |
| 538 | * uart_handle_cts_change - handle a change of clear-to-send state | 508 | * uart_handle_cts_change - handle a change of clear-to-send state |
| 539 | * @port: uart_port structure for the open port | 509 | * @uport: uart_port structure for the open port |
| 540 | * @status: new clear to send status, nonzero if active | 510 | * @status: new clear to send status, nonzero if active |
| 541 | */ | 511 | */ |
| 542 | static inline void | 512 | static inline void |
| 543 | uart_handle_cts_change(struct uart_port *port, unsigned int status) | 513 | uart_handle_cts_change(struct uart_port *uport, unsigned int status) |
| 544 | { | 514 | { |
| 545 | struct uart_info *info = port->info; | 515 | struct tty_port *port = &uport->state->port; |
| 546 | struct tty_struct *tty = info->port.tty; | 516 | struct tty_struct *tty = port->tty; |
| 547 | 517 | ||
| 548 | port->icount.cts++; | 518 | uport->icount.cts++; |
| 549 | 519 | ||
| 550 | if (info->flags & UIF_CTS_FLOW) { | 520 | if (port->flags & ASYNC_CTS_FLOW) { |
| 551 | if (tty->hw_stopped) { | 521 | if (tty->hw_stopped) { |
| 552 | if (status) { | 522 | if (status) { |
| 553 | tty->hw_stopped = 0; | 523 | tty->hw_stopped = 0; |
| 554 | port->ops->start_tx(port); | 524 | uport->ops->start_tx(uport); |
| 555 | uart_write_wakeup(port); | 525 | uart_write_wakeup(uport); |
| 556 | } | 526 | } |
| 557 | } else { | 527 | } else { |
| 558 | if (!status) { | 528 | if (!status) { |
| 559 | tty->hw_stopped = 1; | 529 | tty->hw_stopped = 1; |
| 560 | port->ops->stop_tx(port); | 530 | uport->ops->stop_tx(uport); |
| 561 | } | 531 | } |
| 562 | } | 532 | } |
| 563 | } | 533 | } |
| @@ -569,7 +539,7 @@ static inline void | |||
| 569 | uart_insert_char(struct uart_port *port, unsigned int status, | 539 | uart_insert_char(struct uart_port *port, unsigned int status, |
| 570 | unsigned int overrun, unsigned int ch, unsigned int flag) | 540 | unsigned int overrun, unsigned int ch, unsigned int flag) |
| 571 | { | 541 | { |
| 572 | struct tty_struct *tty = port->info->port.tty; | 542 | struct tty_struct *tty = port->state->port.tty; |
| 573 | 543 | ||
| 574 | if ((status & port->ignore_status_mask & ~overrun) == 0) | 544 | if ((status & port->ignore_status_mask & ~overrun) == 0) |
| 575 | tty_insert_flip_char(tty, ch, flag); | 545 | tty_insert_flip_char(tty, ch, flag); |
diff --git a/include/linux/serio.h b/include/linux/serio.h index 126d24c9eaa8..a640bc2afe76 100644 --- a/include/linux/serio.h +++ b/include/linux/serio.h | |||
| @@ -31,8 +31,6 @@ struct serio { | |||
| 31 | 31 | ||
| 32 | bool manual_bind; | 32 | bool manual_bind; |
| 33 | bool registered; /* port has been fully registered with driver core */ | 33 | bool registered; /* port has been fully registered with driver core */ |
| 34 | bool suspended; /* port is suspended */ | ||
| 35 | |||
| 36 | 34 | ||
| 37 | struct serio_device_id id; | 35 | struct serio_device_id id; |
| 38 | 36 | ||
diff --git a/include/linux/sfi.h b/include/linux/sfi.h new file mode 100644 index 000000000000..9a6f7607174e --- /dev/null +++ b/include/linux/sfi.h | |||
| @@ -0,0 +1,206 @@ | |||
| 1 | /* sfi.h Simple Firmware Interface */ | ||
| 2 | |||
| 3 | /* | ||
| 4 | |||
| 5 | This file is provided under a dual BSD/GPLv2 license. When using or | ||
| 6 | redistributing this file, you may do so under either license. | ||
| 7 | |||
| 8 | GPL LICENSE SUMMARY | ||
| 9 | |||
| 10 | Copyright(c) 2009 Intel Corporation. All rights reserved. | ||
| 11 | |||
| 12 | This program is free software; you can redistribute it and/or modify | ||
| 13 | it under the terms of version 2 of the GNU General Public License as | ||
| 14 | published by the Free Software Foundation. | ||
| 15 | |||
| 16 | This program is distributed in the hope that it will be useful, but | ||
| 17 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 19 | General Public License for more details. | ||
| 20 | |||
| 21 | You should have received a copy of the GNU General Public License | ||
| 22 | along with this program; if not, write to the Free Software | ||
| 23 | Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 24 | The full GNU General Public License is included in this distribution | ||
| 25 | in the file called LICENSE.GPL. | ||
| 26 | |||
| 27 | BSD LICENSE | ||
| 28 | |||
| 29 | Copyright(c) 2009 Intel Corporation. All rights reserved. | ||
| 30 | |||
| 31 | Redistribution and use in source and binary forms, with or without | ||
| 32 | modification, are permitted provided that the following conditions | ||
| 33 | are met: | ||
| 34 | |||
| 35 | * Redistributions of source code must retain the above copyright | ||
| 36 | notice, this list of conditions and the following disclaimer. | ||
| 37 | * Redistributions in binary form must reproduce the above copyright | ||
| 38 | notice, this list of conditions and the following disclaimer in | ||
| 39 | the documentation and/or other materials provided with the | ||
| 40 | distribution. | ||
| 41 | * Neither the name of Intel Corporation nor the names of its | ||
| 42 | contributors may be used to endorse or promote products derived | ||
| 43 | from this software without specific prior written permission. | ||
| 44 | |||
| 45 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
| 46 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
| 47 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
| 48 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
| 49 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| 50 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
| 51 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
| 52 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
| 53 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| 54 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
| 55 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 56 | |||
| 57 | */ | ||
| 58 | |||
| 59 | #ifndef _LINUX_SFI_H | ||
| 60 | #define _LINUX_SFI_H | ||
| 61 | |||
| 62 | /* Table signatures reserved by the SFI specification */ | ||
| 63 | #define SFI_SIG_SYST "SYST" | ||
| 64 | #define SFI_SIG_FREQ "FREQ" | ||
| 65 | #define SFI_SIG_IDLE "IDLE" | ||
| 66 | #define SFI_SIG_CPUS "CPUS" | ||
| 67 | #define SFI_SIG_MTMR "MTMR" | ||
| 68 | #define SFI_SIG_MRTC "MRTC" | ||
| 69 | #define SFI_SIG_MMAP "MMAP" | ||
| 70 | #define SFI_SIG_APIC "APIC" | ||
| 71 | #define SFI_SIG_XSDT "XSDT" | ||
| 72 | #define SFI_SIG_WAKE "WAKE" | ||
| 73 | #define SFI_SIG_SPIB "SPIB" | ||
| 74 | #define SFI_SIG_I2CB "I2CB" | ||
| 75 | #define SFI_SIG_GPEM "GPEM" | ||
| 76 | |||
| 77 | #define SFI_SIGNATURE_SIZE 4 | ||
| 78 | #define SFI_OEM_ID_SIZE 6 | ||
| 79 | #define SFI_OEM_TABLE_ID_SIZE 8 | ||
| 80 | |||
| 81 | #define SFI_SYST_SEARCH_BEGIN 0x000E0000 | ||
| 82 | #define SFI_SYST_SEARCH_END 0x000FFFFF | ||
| 83 | |||
| 84 | #define SFI_GET_NUM_ENTRIES(ptable, entry_type) \ | ||
| 85 | ((ptable->header.len - sizeof(struct sfi_table_header)) / \ | ||
| 86 | (sizeof(entry_type))) | ||
| 87 | /* | ||
| 88 | * Table structures must be byte-packed to match the SFI specification, | ||
| 89 | * as they are provided by the BIOS. | ||
| 90 | */ | ||
| 91 | struct sfi_table_header { | ||
| 92 | char sig[SFI_SIGNATURE_SIZE]; | ||
| 93 | u32 len; | ||
| 94 | u8 rev; | ||
| 95 | u8 csum; | ||
| 96 | char oem_id[SFI_OEM_ID_SIZE]; | ||
| 97 | char oem_table_id[SFI_OEM_TABLE_ID_SIZE]; | ||
| 98 | } __packed; | ||
| 99 | |||
| 100 | struct sfi_table_simple { | ||
| 101 | struct sfi_table_header header; | ||
| 102 | u64 pentry[1]; | ||
| 103 | } __packed; | ||
| 104 | |||
| 105 | /* Comply with UEFI spec 2.1 */ | ||
| 106 | struct sfi_mem_entry { | ||
| 107 | u32 type; | ||
| 108 | u64 phys_start; | ||
| 109 | u64 virt_start; | ||
| 110 | u64 pages; | ||
| 111 | u64 attrib; | ||
| 112 | } __packed; | ||
| 113 | |||
| 114 | struct sfi_cpu_table_entry { | ||
| 115 | u32 apic_id; | ||
| 116 | } __packed; | ||
| 117 | |||
| 118 | struct sfi_cstate_table_entry { | ||
| 119 | u32 hint; /* MWAIT hint */ | ||
| 120 | u32 latency; /* latency in ms */ | ||
| 121 | } __packed; | ||
| 122 | |||
| 123 | struct sfi_apic_table_entry { | ||
| 124 | u64 phys_addr; /* phy base addr for APIC reg */ | ||
| 125 | } __packed; | ||
| 126 | |||
| 127 | struct sfi_freq_table_entry { | ||
| 128 | u32 freq_mhz; /* in MHZ */ | ||
| 129 | u32 latency; /* transition latency in ms */ | ||
| 130 | u32 ctrl_val; /* value to write to PERF_CTL */ | ||
| 131 | } __packed; | ||
| 132 | |||
| 133 | struct sfi_wake_table_entry { | ||
| 134 | u64 phys_addr; /* pointer to where the wake vector locates */ | ||
| 135 | } __packed; | ||
| 136 | |||
| 137 | struct sfi_timer_table_entry { | ||
| 138 | u64 phys_addr; /* phy base addr for the timer */ | ||
| 139 | u32 freq_hz; /* in HZ */ | ||
| 140 | u32 irq; | ||
| 141 | } __packed; | ||
| 142 | |||
| 143 | struct sfi_rtc_table_entry { | ||
| 144 | u64 phys_addr; /* phy base addr for the RTC */ | ||
| 145 | u32 irq; | ||
| 146 | } __packed; | ||
| 147 | |||
| 148 | struct sfi_spi_table_entry { | ||
| 149 | u16 host_num; /* attached to host 0, 1...*/ | ||
| 150 | u16 cs; /* chip select */ | ||
| 151 | u16 irq_info; | ||
| 152 | char name[16]; | ||
| 153 | u8 dev_info[10]; | ||
| 154 | } __packed; | ||
| 155 | |||
| 156 | struct sfi_i2c_table_entry { | ||
| 157 | u16 host_num; | ||
| 158 | u16 addr; /* slave addr */ | ||
| 159 | u16 irq_info; | ||
| 160 | char name[16]; | ||
| 161 | u8 dev_info[10]; | ||
| 162 | } __packed; | ||
| 163 | |||
| 164 | struct sfi_gpe_table_entry { | ||
| 165 | u16 logical_id; /* logical id */ | ||
| 166 | u16 phys_id; /* physical GPE id */ | ||
| 167 | } __packed; | ||
| 168 | |||
| 169 | |||
| 170 | typedef int (*sfi_table_handler) (struct sfi_table_header *table); | ||
| 171 | |||
| 172 | #ifdef CONFIG_SFI | ||
| 173 | extern void __init sfi_init(void); | ||
| 174 | extern int __init sfi_platform_init(void); | ||
| 175 | extern void __init sfi_init_late(void); | ||
| 176 | extern int sfi_table_parse(char *signature, char *oem_id, char *oem_table_id, | ||
| 177 | sfi_table_handler handler); | ||
| 178 | |||
| 179 | extern int sfi_disabled; | ||
| 180 | static inline void disable_sfi(void) | ||
| 181 | { | ||
| 182 | sfi_disabled = 1; | ||
| 183 | } | ||
| 184 | |||
| 185 | #else /* !CONFIG_SFI */ | ||
| 186 | |||
| 187 | static inline void sfi_init(void) | ||
| 188 | { | ||
| 189 | } | ||
| 190 | |||
| 191 | static inline void sfi_init_late(void) | ||
| 192 | { | ||
| 193 | } | ||
| 194 | |||
| 195 | #define sfi_disabled 0 | ||
| 196 | |||
| 197 | static inline int sfi_table_parse(char *signature, char *oem_id, | ||
| 198 | char *oem_table_id, | ||
| 199 | sfi_table_handler handler) | ||
| 200 | { | ||
| 201 | return -1; | ||
| 202 | } | ||
| 203 | |||
| 204 | #endif /* !CONFIG_SFI */ | ||
| 205 | |||
| 206 | #endif /*_LINUX_SFI_H*/ | ||
diff --git a/include/linux/sfi_acpi.h b/include/linux/sfi_acpi.h new file mode 100644 index 000000000000..c4a5a8cd4469 --- /dev/null +++ b/include/linux/sfi_acpi.h | |||
| @@ -0,0 +1,93 @@ | |||
| 1 | /* sfi.h Simple Firmware Interface */ | ||
| 2 | |||
| 3 | /* | ||
| 4 | |||
| 5 | This file is provided under a dual BSD/GPLv2 license. When using or | ||
| 6 | redistributing this file, you may do so under either license. | ||
| 7 | |||
| 8 | GPL LICENSE SUMMARY | ||
| 9 | |||
| 10 | Copyright(c) 2009 Intel Corporation. All rights reserved. | ||
| 11 | |||
| 12 | This program is free software; you can redistribute it and/or modify | ||
| 13 | it under the terms of version 2 of the GNU General Public License as | ||
| 14 | published by the Free Software Foundation. | ||
| 15 | |||
| 16 | This program is distributed in the hope that it will be useful, but | ||
| 17 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 19 | General Public License for more details. | ||
| 20 | |||
| 21 | You should have received a copy of the GNU General Public License | ||
| 22 | along with this program; if not, write to the Free Software | ||
| 23 | Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 24 | The full GNU General Public License is included in this distribution | ||
| 25 | in the file called LICENSE.GPL. | ||
| 26 | |||
| 27 | BSD LICENSE | ||
| 28 | |||
| 29 | Copyright(c) 2009 Intel Corporation. All rights reserved. | ||
| 30 | |||
| 31 | Redistribution and use in source and binary forms, with or without | ||
| 32 | modification, are permitted provided that the following conditions | ||
| 33 | are met: | ||
| 34 | |||
| 35 | * Redistributions of source code must retain the above copyright | ||
| 36 | notice, this list of conditions and the following disclaimer. | ||
| 37 | * Redistributions in binary form must reproduce the above copyright | ||
| 38 | notice, this list of conditions and the following disclaimer in | ||
| 39 | the documentation and/or other materials provided with the | ||
| 40 | distribution. | ||
| 41 | * Neither the name of Intel Corporation nor the names of its | ||
| 42 | contributors may be used to endorse or promote products derived | ||
| 43 | from this software without specific prior written permission. | ||
| 44 | |||
| 45 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
| 46 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
| 47 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
| 48 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
| 49 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| 50 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
| 51 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
| 52 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
| 53 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| 54 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
| 55 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 56 | |||
| 57 | */ | ||
| 58 | |||
| 59 | #ifndef _LINUX_SFI_ACPI_H | ||
| 60 | #define _LINUX_SFI_ACPI_H | ||
| 61 | |||
| 62 | #ifdef CONFIG_SFI | ||
| 63 | #include <acpi/acpi.h> /* struct acpi_table_header */ | ||
| 64 | |||
| 65 | extern int sfi_acpi_table_parse(char *signature, char *oem_id, | ||
| 66 | char *oem_table_id, | ||
| 67 | int (*handler)(struct acpi_table_header *)); | ||
| 68 | |||
| 69 | static inline int acpi_sfi_table_parse(char *signature, | ||
| 70 | int (*handler)(struct acpi_table_header *)) | ||
| 71 | { | ||
| 72 | if (!acpi_table_parse(signature, handler)) | ||
| 73 | return 0; | ||
| 74 | |||
| 75 | return sfi_acpi_table_parse(signature, NULL, NULL, handler); | ||
| 76 | } | ||
| 77 | #else /* !CONFIG_SFI */ | ||
| 78 | |||
| 79 | static inline int sfi_acpi_table_parse(char *signature, char *oem_id, | ||
| 80 | char *oem_table_id, | ||
| 81 | int (*handler)(struct acpi_table_header *)) | ||
| 82 | { | ||
| 83 | return -1; | ||
| 84 | } | ||
| 85 | |||
| 86 | static inline int acpi_sfi_table_parse(char *signature, | ||
| 87 | int (*handler)(struct acpi_table_header *)) | ||
| 88 | { | ||
| 89 | return acpi_table_parse(signature, handler); | ||
| 90 | } | ||
| 91 | #endif /* !CONFIG_SFI */ | ||
| 92 | |||
| 93 | #endif /*_LINUX_SFI_ACPI_H*/ | ||
diff --git a/include/linux/sh_intc.h b/include/linux/sh_intc.h index eb1423a0078d..68e212ff9dde 100644 --- a/include/linux/sh_intc.h +++ b/include/linux/sh_intc.h | |||
| @@ -85,7 +85,6 @@ struct intc_desc symbol __initdata = { \ | |||
| 85 | } | 85 | } |
| 86 | #endif | 86 | #endif |
| 87 | 87 | ||
| 88 | unsigned int intc_evt2irq(unsigned int vector); | ||
| 89 | void __init register_intc_controller(struct intc_desc *desc); | 88 | void __init register_intc_controller(struct intc_desc *desc); |
| 90 | int intc_set_priority(unsigned int irq, unsigned int prio); | 89 | int intc_set_priority(unsigned int irq, unsigned int prio); |
| 91 | 90 | ||
diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h index 6d3f2f449ead..deee7afd8d66 100644 --- a/include/linux/shmem_fs.h +++ b/include/linux/shmem_fs.h | |||
| @@ -38,6 +38,9 @@ static inline struct shmem_inode_info *SHMEM_I(struct inode *inode) | |||
| 38 | return container_of(inode, struct shmem_inode_info, vfs_inode); | 38 | return container_of(inode, struct shmem_inode_info, vfs_inode); |
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | extern int init_tmpfs(void); | ||
| 42 | extern int shmem_fill_super(struct super_block *sb, void *data, int silent); | ||
| 43 | |||
| 41 | #ifdef CONFIG_TMPFS_POSIX_ACL | 44 | #ifdef CONFIG_TMPFS_POSIX_ACL |
| 42 | int shmem_check_acl(struct inode *, int); | 45 | int shmem_check_acl(struct inode *, int); |
| 43 | int shmem_acl_init(struct inode *, struct inode *); | 46 | int shmem_acl_init(struct inode *, struct inode *); |
diff --git a/include/linux/signal.h b/include/linux/signal.h index c7552836bd95..ab9272cc270c 100644 --- a/include/linux/signal.h +++ b/include/linux/signal.h | |||
| @@ -233,6 +233,8 @@ static inline int valid_signal(unsigned long sig) | |||
| 233 | } | 233 | } |
| 234 | 234 | ||
| 235 | extern int next_signal(struct sigpending *pending, sigset_t *mask); | 235 | extern int next_signal(struct sigpending *pending, sigset_t *mask); |
| 236 | extern int do_send_sig_info(int sig, struct siginfo *info, | ||
| 237 | struct task_struct *p, bool group); | ||
| 236 | extern int group_send_sig_info(int sig, struct siginfo *info, struct task_struct *p); | 238 | extern int group_send_sig_info(int sig, struct siginfo *info, struct task_struct *p); |
| 237 | extern int __group_send_sig_info(int, struct siginfo *, struct task_struct *); | 239 | extern int __group_send_sig_info(int, struct siginfo *, struct task_struct *); |
| 238 | extern long do_rt_tgsigqueueinfo(pid_t tgid, pid_t pid, int sig, | 240 | extern long do_rt_tgsigqueueinfo(pid_t tgid, pid_t pid, int sig, |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index f2c69a2cca17..bcdd6606f468 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
| @@ -304,7 +304,6 @@ typedef unsigned char *sk_buff_data_t; | |||
| 304 | * @tc_index: Traffic control index | 304 | * @tc_index: Traffic control index |
| 305 | * @tc_verd: traffic control verdict | 305 | * @tc_verd: traffic control verdict |
| 306 | * @ndisc_nodetype: router type (from link layer) | 306 | * @ndisc_nodetype: router type (from link layer) |
| 307 | * @do_not_encrypt: set to prevent encryption of this frame | ||
| 308 | * @dma_cookie: a cookie to one of several possible DMA operations | 307 | * @dma_cookie: a cookie to one of several possible DMA operations |
| 309 | * done by skb DMA functions | 308 | * done by skb DMA functions |
| 310 | * @secmark: security marking | 309 | * @secmark: security marking |
| @@ -355,8 +354,8 @@ struct sk_buff { | |||
| 355 | ipvs_property:1, | 354 | ipvs_property:1, |
| 356 | peeked:1, | 355 | peeked:1, |
| 357 | nf_trace:1; | 356 | nf_trace:1; |
| 357 | __be16 protocol:16; | ||
| 358 | kmemcheck_bitfield_end(flags1); | 358 | kmemcheck_bitfield_end(flags1); |
| 359 | __be16 protocol; | ||
| 360 | 359 | ||
| 361 | void (*destructor)(struct sk_buff *skb); | 360 | void (*destructor)(struct sk_buff *skb); |
| 362 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | 361 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) |
| @@ -368,7 +367,6 @@ struct sk_buff { | |||
| 368 | #endif | 367 | #endif |
| 369 | 368 | ||
| 370 | int iif; | 369 | int iif; |
| 371 | __u16 queue_mapping; | ||
| 372 | #ifdef CONFIG_NET_SCHED | 370 | #ifdef CONFIG_NET_SCHED |
| 373 | __u16 tc_index; /* traffic control index */ | 371 | __u16 tc_index; /* traffic control index */ |
| 374 | #ifdef CONFIG_NET_CLS_ACT | 372 | #ifdef CONFIG_NET_CLS_ACT |
| @@ -377,15 +375,13 @@ struct sk_buff { | |||
| 377 | #endif | 375 | #endif |
| 378 | 376 | ||
| 379 | kmemcheck_bitfield_begin(flags2); | 377 | kmemcheck_bitfield_begin(flags2); |
| 378 | __u16 queue_mapping:16; | ||
| 380 | #ifdef CONFIG_IPV6_NDISC_NODETYPE | 379 | #ifdef CONFIG_IPV6_NDISC_NODETYPE |
| 381 | __u8 ndisc_nodetype:2; | 380 | __u8 ndisc_nodetype:2; |
| 382 | #endif | 381 | #endif |
| 383 | #if defined(CONFIG_MAC80211) || defined(CONFIG_MAC80211_MODULE) | ||
| 384 | __u8 do_not_encrypt:1; | ||
| 385 | #endif | ||
| 386 | kmemcheck_bitfield_end(flags2); | 382 | kmemcheck_bitfield_end(flags2); |
| 387 | 383 | ||
| 388 | /* 0/13/14 bit hole */ | 384 | /* 0/14 bit hole */ |
| 389 | 385 | ||
| 390 | #ifdef CONFIG_NET_DMA | 386 | #ifdef CONFIG_NET_DMA |
| 391 | dma_cookie_t dma_cookie; | 387 | dma_cookie_t dma_cookie; |
| @@ -1761,6 +1757,8 @@ extern int skb_copy_datagram_const_iovec(const struct sk_buff *from, | |||
| 1761 | int to_offset, | 1757 | int to_offset, |
| 1762 | int size); | 1758 | int size); |
| 1763 | extern void skb_free_datagram(struct sock *sk, struct sk_buff *skb); | 1759 | extern void skb_free_datagram(struct sock *sk, struct sk_buff *skb); |
| 1760 | extern void skb_free_datagram_locked(struct sock *sk, | ||
| 1761 | struct sk_buff *skb); | ||
| 1764 | extern int skb_kill_datagram(struct sock *sk, struct sk_buff *skb, | 1762 | extern int skb_kill_datagram(struct sock *sk, struct sk_buff *skb, |
| 1765 | unsigned int flags); | 1763 | unsigned int flags); |
| 1766 | extern __wsum skb_checksum(const struct sk_buff *skb, int offset, | 1764 | extern __wsum skb_checksum(const struct sk_buff *skb, int offset, |
diff --git a/include/linux/slob_def.h b/include/linux/slob_def.h index bb5368df4be8..0ec00b39d006 100644 --- a/include/linux/slob_def.h +++ b/include/linux/slob_def.h | |||
| @@ -34,9 +34,4 @@ static __always_inline void *__kmalloc(size_t size, gfp_t flags) | |||
| 34 | return kmalloc(size, flags); | 34 | return kmalloc(size, flags); |
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | static inline void kmem_cache_init_late(void) | ||
| 38 | { | ||
| 39 | /* Nothing to do */ | ||
| 40 | } | ||
| 41 | |||
| 42 | #endif /* __LINUX_SLOB_DEF_H */ | 37 | #endif /* __LINUX_SLOB_DEF_H */ |
diff --git a/include/linux/slow-work.h b/include/linux/slow-work.h index b65c8881f07a..13337bf6c3f5 100644 --- a/include/linux/slow-work.h +++ b/include/linux/slow-work.h | |||
| @@ -17,13 +17,20 @@ | |||
| 17 | #ifdef CONFIG_SLOW_WORK | 17 | #ifdef CONFIG_SLOW_WORK |
| 18 | 18 | ||
| 19 | #include <linux/sysctl.h> | 19 | #include <linux/sysctl.h> |
| 20 | #include <linux/timer.h> | ||
| 20 | 21 | ||
| 21 | struct slow_work; | 22 | struct slow_work; |
| 23 | #ifdef CONFIG_SLOW_WORK_DEBUG | ||
| 24 | struct seq_file; | ||
| 25 | #endif | ||
| 22 | 26 | ||
| 23 | /* | 27 | /* |
| 24 | * The operations used to support slow work items | 28 | * The operations used to support slow work items |
| 25 | */ | 29 | */ |
| 26 | struct slow_work_ops { | 30 | struct slow_work_ops { |
| 31 | /* owner */ | ||
| 32 | struct module *owner; | ||
| 33 | |||
| 27 | /* get a ref on a work item | 34 | /* get a ref on a work item |
| 28 | * - return 0 if successful, -ve if not | 35 | * - return 0 if successful, -ve if not |
| 29 | */ | 36 | */ |
| @@ -34,6 +41,11 @@ struct slow_work_ops { | |||
| 34 | 41 | ||
| 35 | /* execute a work item */ | 42 | /* execute a work item */ |
| 36 | void (*execute)(struct slow_work *work); | 43 | void (*execute)(struct slow_work *work); |
| 44 | |||
| 45 | #ifdef CONFIG_SLOW_WORK_DEBUG | ||
| 46 | /* describe a work item for debugfs */ | ||
| 47 | void (*desc)(struct slow_work *work, struct seq_file *m); | ||
| 48 | #endif | ||
| 37 | }; | 49 | }; |
| 38 | 50 | ||
| 39 | /* | 51 | /* |
| @@ -42,13 +54,24 @@ struct slow_work_ops { | |||
| 42 | * queued | 54 | * queued |
| 43 | */ | 55 | */ |
| 44 | struct slow_work { | 56 | struct slow_work { |
| 57 | struct module *owner; /* the owning module */ | ||
| 45 | unsigned long flags; | 58 | unsigned long flags; |
| 46 | #define SLOW_WORK_PENDING 0 /* item pending (further) execution */ | 59 | #define SLOW_WORK_PENDING 0 /* item pending (further) execution */ |
| 47 | #define SLOW_WORK_EXECUTING 1 /* item currently executing */ | 60 | #define SLOW_WORK_EXECUTING 1 /* item currently executing */ |
| 48 | #define SLOW_WORK_ENQ_DEFERRED 2 /* item enqueue deferred */ | 61 | #define SLOW_WORK_ENQ_DEFERRED 2 /* item enqueue deferred */ |
| 49 | #define SLOW_WORK_VERY_SLOW 3 /* item is very slow */ | 62 | #define SLOW_WORK_VERY_SLOW 3 /* item is very slow */ |
| 63 | #define SLOW_WORK_CANCELLING 4 /* item is being cancelled, don't enqueue */ | ||
| 64 | #define SLOW_WORK_DELAYED 5 /* item is struct delayed_slow_work with active timer */ | ||
| 50 | const struct slow_work_ops *ops; /* operations table for this item */ | 65 | const struct slow_work_ops *ops; /* operations table for this item */ |
| 51 | struct list_head link; /* link in queue */ | 66 | struct list_head link; /* link in queue */ |
| 67 | #ifdef CONFIG_SLOW_WORK_DEBUG | ||
| 68 | struct timespec mark; /* jiffies at which queued or exec begun */ | ||
| 69 | #endif | ||
| 70 | }; | ||
| 71 | |||
| 72 | struct delayed_slow_work { | ||
| 73 | struct slow_work work; | ||
| 74 | struct timer_list timer; | ||
| 52 | }; | 75 | }; |
| 53 | 76 | ||
| 54 | /** | 77 | /** |
| @@ -67,6 +90,20 @@ static inline void slow_work_init(struct slow_work *work, | |||
| 67 | } | 90 | } |
| 68 | 91 | ||
| 69 | /** | 92 | /** |
| 93 | * slow_work_init - Initialise a delayed slow work item | ||
| 94 | * @work: The work item to initialise | ||
| 95 | * @ops: The operations to use to handle the slow work item | ||
| 96 | * | ||
| 97 | * Initialise a delayed slow work item. | ||
| 98 | */ | ||
| 99 | static inline void delayed_slow_work_init(struct delayed_slow_work *dwork, | ||
| 100 | const struct slow_work_ops *ops) | ||
| 101 | { | ||
| 102 | init_timer(&dwork->timer); | ||
| 103 | slow_work_init(&dwork->work, ops); | ||
| 104 | } | ||
| 105 | |||
| 106 | /** | ||
| 70 | * vslow_work_init - Initialise a very slow work item | 107 | * vslow_work_init - Initialise a very slow work item |
| 71 | * @work: The work item to initialise | 108 | * @work: The work item to initialise |
| 72 | * @ops: The operations to use to handle the slow work item | 109 | * @ops: The operations to use to handle the slow work item |
| @@ -83,9 +120,40 @@ static inline void vslow_work_init(struct slow_work *work, | |||
| 83 | INIT_LIST_HEAD(&work->link); | 120 | INIT_LIST_HEAD(&work->link); |
| 84 | } | 121 | } |
| 85 | 122 | ||
| 123 | /** | ||
| 124 | * slow_work_is_queued - Determine if a slow work item is on the work queue | ||
| 125 | * work: The work item to test | ||
| 126 | * | ||
| 127 | * Determine if the specified slow-work item is on the work queue. This | ||
| 128 | * returns true if it is actually on the queue. | ||
| 129 | * | ||
| 130 | * If the item is executing and has been marked for requeue when execution | ||
| 131 | * finishes, then false will be returned. | ||
| 132 | * | ||
| 133 | * Anyone wishing to wait for completion of execution can wait on the | ||
| 134 | * SLOW_WORK_EXECUTING bit. | ||
| 135 | */ | ||
| 136 | static inline bool slow_work_is_queued(struct slow_work *work) | ||
| 137 | { | ||
| 138 | unsigned long flags = work->flags; | ||
| 139 | return flags & SLOW_WORK_PENDING && !(flags & SLOW_WORK_EXECUTING); | ||
| 140 | } | ||
| 141 | |||
| 86 | extern int slow_work_enqueue(struct slow_work *work); | 142 | extern int slow_work_enqueue(struct slow_work *work); |
| 87 | extern int slow_work_register_user(void); | 143 | extern void slow_work_cancel(struct slow_work *work); |
| 88 | extern void slow_work_unregister_user(void); | 144 | extern int slow_work_register_user(struct module *owner); |
| 145 | extern void slow_work_unregister_user(struct module *owner); | ||
| 146 | |||
| 147 | extern int delayed_slow_work_enqueue(struct delayed_slow_work *dwork, | ||
| 148 | unsigned long delay); | ||
| 149 | |||
| 150 | static inline void delayed_slow_work_cancel(struct delayed_slow_work *dwork) | ||
| 151 | { | ||
| 152 | slow_work_cancel(&dwork->work); | ||
| 153 | } | ||
| 154 | |||
| 155 | extern bool slow_work_sleep_till_thread_needed(struct slow_work *work, | ||
| 156 | signed long *_timeout); | ||
| 89 | 157 | ||
| 90 | #ifdef CONFIG_SYSCTL | 158 | #ifdef CONFIG_SYSCTL |
| 91 | extern ctl_table slow_work_sysctls[]; | 159 | extern ctl_table slow_work_sysctls[]; |
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h index c1c862b1d01a..5ad70a60fd74 100644 --- a/include/linux/slub_def.h +++ b/include/linux/slub_def.h | |||
| @@ -153,12 +153,10 @@ static __always_inline int kmalloc_index(size_t size) | |||
| 153 | if (size <= KMALLOC_MIN_SIZE) | 153 | if (size <= KMALLOC_MIN_SIZE) |
| 154 | return KMALLOC_SHIFT_LOW; | 154 | return KMALLOC_SHIFT_LOW; |
| 155 | 155 | ||
| 156 | #if KMALLOC_MIN_SIZE <= 64 | 156 | if (KMALLOC_MIN_SIZE <= 32 && size > 64 && size <= 96) |
| 157 | if (size > 64 && size <= 96) | ||
| 158 | return 1; | 157 | return 1; |
| 159 | if (size > 128 && size <= 192) | 158 | if (KMALLOC_MIN_SIZE <= 64 && size > 128 && size <= 192) |
| 160 | return 2; | 159 | return 2; |
| 161 | #endif | ||
| 162 | if (size <= 8) return 3; | 160 | if (size <= 8) return 3; |
| 163 | if (size <= 16) return 4; | 161 | if (size <= 16) return 4; |
| 164 | if (size <= 32) return 5; | 162 | if (size <= 32) return 5; |
| @@ -304,6 +302,4 @@ static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node) | |||
| 304 | } | 302 | } |
| 305 | #endif | 303 | #endif |
| 306 | 304 | ||
| 307 | void __init kmem_cache_init_late(void); | ||
| 308 | |||
| 309 | #endif /* _LINUX_SLUB_DEF_H */ | 305 | #endif /* _LINUX_SLUB_DEF_H */ |
diff --git a/include/linux/smp.h b/include/linux/smp.h index 9e3d8af09207..7a0570e6a596 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h | |||
| @@ -73,18 +73,12 @@ int smp_call_function(void(*func)(void *info), void *info, int wait); | |||
| 73 | void smp_call_function_many(const struct cpumask *mask, | 73 | void smp_call_function_many(const struct cpumask *mask, |
| 74 | void (*func)(void *info), void *info, bool wait); | 74 | void (*func)(void *info), void *info, bool wait); |
| 75 | 75 | ||
| 76 | /* Deprecated: Use smp_call_function_many which takes a pointer to the mask. */ | ||
| 77 | static inline int | ||
| 78 | smp_call_function_mask(cpumask_t mask, void(*func)(void *info), void *info, | ||
| 79 | int wait) | ||
| 80 | { | ||
| 81 | smp_call_function_many(&mask, func, info, wait); | ||
| 82 | return 0; | ||
| 83 | } | ||
| 84 | |||
| 85 | void __smp_call_function_single(int cpuid, struct call_single_data *data, | 76 | void __smp_call_function_single(int cpuid, struct call_single_data *data, |
| 86 | int wait); | 77 | int wait); |
| 87 | 78 | ||
| 79 | int smp_call_function_any(const struct cpumask *mask, | ||
| 80 | void (*func)(void *info), void *info, int wait); | ||
| 81 | |||
| 88 | /* | 82 | /* |
| 89 | * Generic and arch helpers | 83 | * Generic and arch helpers |
| 90 | */ | 84 | */ |
| @@ -144,13 +138,17 @@ static inline int up_smp_call_function(void (*func)(void *), void *info) | |||
| 144 | static inline void smp_send_reschedule(int cpu) { } | 138 | static inline void smp_send_reschedule(int cpu) { } |
| 145 | #define num_booting_cpus() 1 | 139 | #define num_booting_cpus() 1 |
| 146 | #define smp_prepare_boot_cpu() do {} while (0) | 140 | #define smp_prepare_boot_cpu() do {} while (0) |
| 147 | #define smp_call_function_mask(mask, func, info, wait) \ | ||
| 148 | (up_smp_call_function(func, info)) | ||
| 149 | #define smp_call_function_many(mask, func, info, wait) \ | 141 | #define smp_call_function_many(mask, func, info, wait) \ |
| 150 | (up_smp_call_function(func, info)) | 142 | (up_smp_call_function(func, info)) |
| 151 | static inline void init_call_single_data(void) | 143 | static inline void init_call_single_data(void) { } |
| 144 | |||
| 145 | static inline int | ||
| 146 | smp_call_function_any(const struct cpumask *mask, void (*func)(void *info), | ||
| 147 | void *info, int wait) | ||
| 152 | { | 148 | { |
| 149 | return smp_call_function_single(0, func, info, wait); | ||
| 153 | } | 150 | } |
| 151 | |||
| 154 | #endif /* !SMP */ | 152 | #endif /* !SMP */ |
| 155 | 153 | ||
| 156 | /* | 154 | /* |
diff --git a/include/linux/smp_lock.h b/include/linux/smp_lock.h index 813be59bf345..2ea1dd1ba21c 100644 --- a/include/linux/smp_lock.h +++ b/include/linux/smp_lock.h | |||
| @@ -24,8 +24,21 @@ static inline int reacquire_kernel_lock(struct task_struct *task) | |||
| 24 | return 0; | 24 | return 0; |
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | extern void __lockfunc lock_kernel(void) __acquires(kernel_lock); | 27 | extern void __lockfunc |
| 28 | extern void __lockfunc unlock_kernel(void) __releases(kernel_lock); | 28 | _lock_kernel(const char *func, const char *file, int line) |
| 29 | __acquires(kernel_lock); | ||
| 30 | |||
| 31 | extern void __lockfunc | ||
| 32 | _unlock_kernel(const char *func, const char *file, int line) | ||
| 33 | __releases(kernel_lock); | ||
| 34 | |||
| 35 | #define lock_kernel() do { \ | ||
| 36 | _lock_kernel(__func__, __FILE__, __LINE__); \ | ||
| 37 | } while (0) | ||
| 38 | |||
| 39 | #define unlock_kernel() do { \ | ||
| 40 | _unlock_kernel(__func__, __FILE__, __LINE__); \ | ||
| 41 | } while (0) | ||
| 29 | 42 | ||
| 30 | /* | 43 | /* |
| 31 | * Various legacy drivers don't really need the BKL in a specific | 44 | * Various legacy drivers don't really need the BKL in a specific |
| @@ -41,8 +54,8 @@ static inline void cycle_kernel_lock(void) | |||
| 41 | 54 | ||
| 42 | #else | 55 | #else |
| 43 | 56 | ||
| 44 | #define lock_kernel() do { } while(0) | 57 | #define lock_kernel() |
| 45 | #define unlock_kernel() do { } while(0) | 58 | #define unlock_kernel() |
| 46 | #define release_kernel_lock(task) do { } while(0) | 59 | #define release_kernel_lock(task) do { } while(0) |
| 47 | #define cycle_kernel_lock() do { } while(0) | 60 | #define cycle_kernel_lock() do { } while(0) |
| 48 | #define reacquire_kernel_lock(task) 0 | 61 | #define reacquire_kernel_lock(task) 0 |
diff --git a/include/linux/socket.h b/include/linux/socket.h index 3b461dffe244..3273a0c5043b 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h | |||
| @@ -16,7 +16,7 @@ struct __kernel_sockaddr_storage { | |||
| 16 | /* _SS_MAXSIZE value minus size of ss_family */ | 16 | /* _SS_MAXSIZE value minus size of ss_family */ |
| 17 | } __attribute__ ((aligned(_K_SS_ALIGNSIZE))); /* force desired alignment */ | 17 | } __attribute__ ((aligned(_K_SS_ALIGNSIZE))); /* force desired alignment */ |
| 18 | 18 | ||
| 19 | #if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) | 19 | #ifdef __KERNEL__ |
| 20 | 20 | ||
| 21 | #include <asm/socket.h> /* arch-dependent defines */ | 21 | #include <asm/socket.h> /* arch-dependent defines */ |
| 22 | #include <linux/sockios.h> /* the SIOCxxx I/O controls */ | 22 | #include <linux/sockios.h> /* the SIOCxxx I/O controls */ |
| @@ -101,21 +101,6 @@ struct cmsghdr { | |||
| 101 | ((char *)(cmsg) - (char *)(mhdr)->msg_control))) | 101 | ((char *)(cmsg) - (char *)(mhdr)->msg_control))) |
| 102 | 102 | ||
| 103 | /* | 103 | /* |
| 104 | * This mess will go away with glibc | ||
| 105 | */ | ||
| 106 | |||
| 107 | #ifdef __KERNEL__ | ||
| 108 | #define __KINLINE static inline | ||
| 109 | #elif defined(__GNUC__) | ||
| 110 | #define __KINLINE static __inline__ | ||
| 111 | #elif defined(__cplusplus) | ||
| 112 | #define __KINLINE static inline | ||
| 113 | #else | ||
| 114 | #define __KINLINE static | ||
| 115 | #endif | ||
| 116 | |||
| 117 | |||
| 118 | /* | ||
| 119 | * Get the next cmsg header | 104 | * Get the next cmsg header |
| 120 | * | 105 | * |
| 121 | * PLEASE, do not touch this function. If you think, that it is | 106 | * PLEASE, do not touch this function. If you think, that it is |
| @@ -128,7 +113,7 @@ struct cmsghdr { | |||
| 128 | * ancillary object DATA. --ANK (980731) | 113 | * ancillary object DATA. --ANK (980731) |
| 129 | */ | 114 | */ |
| 130 | 115 | ||
| 131 | __KINLINE struct cmsghdr * __cmsg_nxthdr(void *__ctl, __kernel_size_t __size, | 116 | static inline struct cmsghdr * __cmsg_nxthdr(void *__ctl, __kernel_size_t __size, |
| 132 | struct cmsghdr *__cmsg) | 117 | struct cmsghdr *__cmsg) |
| 133 | { | 118 | { |
| 134 | struct cmsghdr * __ptr; | 119 | struct cmsghdr * __ptr; |
| @@ -140,7 +125,7 @@ __KINLINE struct cmsghdr * __cmsg_nxthdr(void *__ctl, __kernel_size_t __size, | |||
| 140 | return __ptr; | 125 | return __ptr; |
| 141 | } | 126 | } |
| 142 | 127 | ||
| 143 | __KINLINE struct cmsghdr * cmsg_nxthdr (struct msghdr *__msg, struct cmsghdr *__cmsg) | 128 | static inline struct cmsghdr * cmsg_nxthdr (struct msghdr *__msg, struct cmsghdr *__cmsg) |
| 144 | { | 129 | { |
| 145 | return __cmsg_nxthdr(__msg->msg_control, __msg->msg_controllen, __cmsg); | 130 | return __cmsg_nxthdr(__msg->msg_control, __msg->msg_controllen, __cmsg); |
| 146 | } | 131 | } |
diff --git a/include/linux/spi/lms283gf05.h b/include/linux/spi/lms283gf05.h new file mode 100644 index 000000000000..555d254e6606 --- /dev/null +++ b/include/linux/spi/lms283gf05.h | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | /* | ||
| 2 | * lms283gf05.h - Platform glue for Samsung LMS283GF05 LCD | ||
| 3 | * | ||
| 4 | * Copyright (C) 2009 Marek Vasut <marek.vasut@gmail.com> | ||
| 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 | * This program is distributed in the hope that it will be useful, | ||
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | * GNU General Public License for more details. | ||
| 14 | * | ||
| 15 | * You should have received a copy of the GNU General Public License | ||
| 16 | * along with this program; if not, write to the Free Software | ||
| 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 18 | */ | ||
| 19 | |||
| 20 | #ifndef _INCLUDE_LINUX_SPI_LMS283GF05_H_ | ||
| 21 | #define _INCLUDE_LINUX_SPI_LMS283GF05_H_ | ||
| 22 | |||
| 23 | struct lms283gf05_pdata { | ||
| 24 | unsigned long reset_gpio; | ||
| 25 | bool reset_inverted; | ||
| 26 | }; | ||
| 27 | |||
| 28 | #endif /* _INCLUDE_LINUX_SPI_LMS283GF05_H_ */ | ||
diff --git a/include/linux/spi/mc33880.h b/include/linux/spi/mc33880.h new file mode 100644 index 000000000000..82ffccd6fbe5 --- /dev/null +++ b/include/linux/spi/mc33880.h | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | #ifndef LINUX_SPI_MC33880_H | ||
| 2 | #define LINUX_SPI_MC33880_H | ||
| 3 | |||
| 4 | struct mc33880_platform_data { | ||
| 5 | /* number assigned to the first GPIO */ | ||
| 6 | unsigned base; | ||
| 7 | }; | ||
| 8 | |||
| 9 | #endif | ||
| 10 | |||
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index c47c4b4da97e..97b60b37f445 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | #define __LINUX_SPI_H | 20 | #define __LINUX_SPI_H |
| 21 | 21 | ||
| 22 | #include <linux/device.h> | 22 | #include <linux/device.h> |
| 23 | #include <linux/mod_devicetable.h> | ||
| 23 | 24 | ||
| 24 | /* | 25 | /* |
| 25 | * INTERFACES between SPI master-side drivers and SPI infrastructure. | 26 | * INTERFACES between SPI master-side drivers and SPI infrastructure. |
| @@ -86,7 +87,7 @@ struct spi_device { | |||
| 86 | int irq; | 87 | int irq; |
| 87 | void *controller_state; | 88 | void *controller_state; |
| 88 | void *controller_data; | 89 | void *controller_data; |
| 89 | char modalias[32]; | 90 | char modalias[SPI_NAME_SIZE]; |
| 90 | 91 | ||
| 91 | /* | 92 | /* |
| 92 | * likely need more hooks for more protocol options affecting how | 93 | * likely need more hooks for more protocol options affecting how |
| @@ -145,6 +146,7 @@ struct spi_message; | |||
| 145 | 146 | ||
| 146 | /** | 147 | /** |
| 147 | * struct spi_driver - Host side "protocol" driver | 148 | * struct spi_driver - Host side "protocol" driver |
| 149 | * @id_table: List of SPI devices supported by this driver | ||
| 148 | * @probe: Binds this driver to the spi device. Drivers can verify | 150 | * @probe: Binds this driver to the spi device. Drivers can verify |
| 149 | * that the device is actually present, and may need to configure | 151 | * that the device is actually present, and may need to configure |
| 150 | * characteristics (such as bits_per_word) which weren't needed for | 152 | * characteristics (such as bits_per_word) which weren't needed for |
| @@ -170,6 +172,7 @@ struct spi_message; | |||
| 170 | * MMC, RTC, filesystem character device nodes, and hardware monitoring. | 172 | * MMC, RTC, filesystem character device nodes, and hardware monitoring. |
| 171 | */ | 173 | */ |
| 172 | struct spi_driver { | 174 | struct spi_driver { |
| 175 | const struct spi_device_id *id_table; | ||
| 173 | int (*probe)(struct spi_device *spi); | 176 | int (*probe)(struct spi_device *spi); |
| 174 | int (*remove)(struct spi_device *spi); | 177 | int (*remove)(struct spi_device *spi); |
| 175 | void (*shutdown)(struct spi_device *spi); | 178 | void (*shutdown)(struct spi_device *spi); |
| @@ -207,6 +210,8 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv) | |||
| 207 | * each slave has a chipselect signal, but it's common that not | 210 | * each slave has a chipselect signal, but it's common that not |
| 208 | * every chipselect is connected to a slave. | 211 | * every chipselect is connected to a slave. |
| 209 | * @dma_alignment: SPI controller constraint on DMA buffers alignment. | 212 | * @dma_alignment: SPI controller constraint on DMA buffers alignment. |
| 213 | * @mode_bits: flags understood by this controller driver | ||
| 214 | * @flags: other constraints relevant to this driver | ||
| 210 | * @setup: updates the device mode and clocking records used by a | 215 | * @setup: updates the device mode and clocking records used by a |
| 211 | * device's SPI controller; protocol code may call this. This | 216 | * device's SPI controller; protocol code may call this. This |
| 212 | * must fail if an unrecognized or unsupported mode is requested. | 217 | * must fail if an unrecognized or unsupported mode is requested. |
| @@ -253,6 +258,8 @@ struct spi_master { | |||
| 253 | /* other constraints relevant to this driver */ | 258 | /* other constraints relevant to this driver */ |
| 254 | u16 flags; | 259 | u16 flags; |
| 255 | #define SPI_MASTER_HALF_DUPLEX BIT(0) /* can't do full duplex */ | 260 | #define SPI_MASTER_HALF_DUPLEX BIT(0) /* can't do full duplex */ |
| 261 | #define SPI_MASTER_NO_RX BIT(1) /* can't do buffer read */ | ||
| 262 | #define SPI_MASTER_NO_TX BIT(2) /* can't do buffer write */ | ||
| 256 | 263 | ||
| 257 | /* Setup mode and clock, etc (spi driver may call many times). | 264 | /* Setup mode and clock, etc (spi driver may call many times). |
| 258 | * | 265 | * |
| @@ -533,42 +540,7 @@ static inline void spi_message_free(struct spi_message *m) | |||
| 533 | } | 540 | } |
| 534 | 541 | ||
| 535 | extern int spi_setup(struct spi_device *spi); | 542 | extern int spi_setup(struct spi_device *spi); |
| 536 | 543 | extern int spi_async(struct spi_device *spi, struct spi_message *message); | |
| 537 | /** | ||
| 538 | * spi_async - asynchronous SPI transfer | ||
| 539 | * @spi: device with which data will be exchanged | ||
| 540 | * @message: describes the data transfers, including completion callback | ||
| 541 | * Context: any (irqs may be blocked, etc) | ||
| 542 | * | ||
| 543 | * This call may be used in_irq and other contexts which can't sleep, | ||
| 544 | * as well as from task contexts which can sleep. | ||
| 545 | * | ||
| 546 | * The completion callback is invoked in a context which can't sleep. | ||
| 547 | * Before that invocation, the value of message->status is undefined. | ||
| 548 | * When the callback is issued, message->status holds either zero (to | ||
| 549 | * indicate complete success) or a negative error code. After that | ||
| 550 | * callback returns, the driver which issued the transfer request may | ||
| 551 | * deallocate the associated memory; it's no longer in use by any SPI | ||
| 552 | * core or controller driver code. | ||
| 553 | * | ||
| 554 | * Note that although all messages to a spi_device are handled in | ||
| 555 | * FIFO order, messages may go to different devices in other orders. | ||
| 556 | * Some device might be higher priority, or have various "hard" access | ||
| 557 | * time requirements, for example. | ||
| 558 | * | ||
| 559 | * On detection of any fault during the transfer, processing of | ||
| 560 | * the entire message is aborted, and the device is deselected. | ||
| 561 | * Until returning from the associated message completion callback, | ||
| 562 | * no other spi_message queued to that device will be processed. | ||
| 563 | * (This rule applies equally to all the synchronous transfer calls, | ||
| 564 | * which are wrappers around this core asynchronous primitive.) | ||
| 565 | */ | ||
| 566 | static inline int | ||
| 567 | spi_async(struct spi_device *spi, struct spi_message *message) | ||
| 568 | { | ||
| 569 | message->spi = spi; | ||
| 570 | return spi->master->transfer(spi, message); | ||
| 571 | } | ||
| 572 | 544 | ||
| 573 | /*---------------------------------------------------------------------------*/ | 545 | /*---------------------------------------------------------------------------*/ |
| 574 | 546 | ||
| @@ -732,7 +704,7 @@ struct spi_board_info { | |||
| 732 | * controller_data goes to spi_device.controller_data, | 704 | * controller_data goes to spi_device.controller_data, |
| 733 | * irq is copied too | 705 | * irq is copied too |
| 734 | */ | 706 | */ |
| 735 | char modalias[32]; | 707 | char modalias[SPI_NAME_SIZE]; |
| 736 | const void *platform_data; | 708 | const void *platform_data; |
| 737 | void *controller_data; | 709 | void *controller_data; |
| 738 | int irq; | 710 | int irq; |
| @@ -800,4 +772,7 @@ spi_unregister_device(struct spi_device *spi) | |||
| 800 | device_unregister(&spi->dev); | 772 | device_unregister(&spi->dev); |
| 801 | } | 773 | } |
| 802 | 774 | ||
| 775 | extern const struct spi_device_id * | ||
| 776 | spi_get_device_id(const struct spi_device *sdev); | ||
| 777 | |||
| 803 | #endif /* __LINUX_SPI_H */ | 778 | #endif /* __LINUX_SPI_H */ |
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index f0ca7a7a1757..71dccfeb0d88 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h | |||
| @@ -79,8 +79,6 @@ | |||
| 79 | */ | 79 | */ |
| 80 | #include <linux/spinlock_types.h> | 80 | #include <linux/spinlock_types.h> |
| 81 | 81 | ||
| 82 | extern int __lockfunc generic__raw_read_trylock(raw_rwlock_t *lock); | ||
| 83 | |||
| 84 | /* | 82 | /* |
| 85 | * Pull the __raw*() functions/declarations (UP-nondebug doesnt need them): | 83 | * Pull the __raw*() functions/declarations (UP-nondebug doesnt need them): |
| 86 | */ | 84 | */ |
| @@ -102,7 +100,7 @@ do { \ | |||
| 102 | 100 | ||
| 103 | #else | 101 | #else |
| 104 | # define spin_lock_init(lock) \ | 102 | # define spin_lock_init(lock) \ |
| 105 | do { *(lock) = SPIN_LOCK_UNLOCKED; } while (0) | 103 | do { *(lock) = __SPIN_LOCK_UNLOCKED(lock); } while (0) |
| 106 | #endif | 104 | #endif |
| 107 | 105 | ||
| 108 | #ifdef CONFIG_DEBUG_SPINLOCK | 106 | #ifdef CONFIG_DEBUG_SPINLOCK |
| @@ -116,7 +114,7 @@ do { \ | |||
| 116 | } while (0) | 114 | } while (0) |
| 117 | #else | 115 | #else |
| 118 | # define rwlock_init(lock) \ | 116 | # define rwlock_init(lock) \ |
| 119 | do { *(lock) = RW_LOCK_UNLOCKED; } while (0) | 117 | do { *(lock) = __RW_LOCK_UNLOCKED(lock); } while (0) |
| 120 | #endif | 118 | #endif |
| 121 | 119 | ||
| 122 | #define spin_is_locked(lock) __raw_spin_is_locked(&(lock)->raw_lock) | 120 | #define spin_is_locked(lock) __raw_spin_is_locked(&(lock)->raw_lock) |
diff --git a/include/linux/spinlock_api_smp.h b/include/linux/spinlock_api_smp.h index 7a7e18fc2415..8264a7f459bc 100644 --- a/include/linux/spinlock_api_smp.h +++ b/include/linux/spinlock_api_smp.h | |||
| @@ -60,137 +60,118 @@ void __lockfunc _read_unlock_irqrestore(rwlock_t *lock, unsigned long flags) | |||
| 60 | void __lockfunc _write_unlock_irqrestore(rwlock_t *lock, unsigned long flags) | 60 | void __lockfunc _write_unlock_irqrestore(rwlock_t *lock, unsigned long flags) |
| 61 | __releases(lock); | 61 | __releases(lock); |
| 62 | 62 | ||
| 63 | /* | 63 | #ifdef CONFIG_INLINE_SPIN_LOCK |
| 64 | * We inline the unlock functions in the nondebug case: | ||
| 65 | */ | ||
| 66 | #if !defined(CONFIG_DEBUG_SPINLOCK) && !defined(CONFIG_PREEMPT) | ||
| 67 | #define __always_inline__spin_unlock | ||
| 68 | #define __always_inline__read_unlock | ||
| 69 | #define __always_inline__write_unlock | ||
| 70 | #define __always_inline__spin_unlock_irq | ||
| 71 | #define __always_inline__read_unlock_irq | ||
| 72 | #define __always_inline__write_unlock_irq | ||
| 73 | #endif | ||
| 74 | |||
| 75 | #ifndef CONFIG_DEBUG_SPINLOCK | ||
| 76 | #ifndef CONFIG_GENERIC_LOCKBREAK | ||
| 77 | |||
| 78 | #ifdef __always_inline__spin_lock | ||
| 79 | #define _spin_lock(lock) __spin_lock(lock) | 64 | #define _spin_lock(lock) __spin_lock(lock) |
| 80 | #endif | 65 | #endif |
| 81 | 66 | ||
| 82 | #ifdef __always_inline__read_lock | 67 | #ifdef CONFIG_INLINE_READ_LOCK |
| 83 | #define _read_lock(lock) __read_lock(lock) | 68 | #define _read_lock(lock) __read_lock(lock) |
| 84 | #endif | 69 | #endif |
| 85 | 70 | ||
| 86 | #ifdef __always_inline__write_lock | 71 | #ifdef CONFIG_INLINE_WRITE_LOCK |
| 87 | #define _write_lock(lock) __write_lock(lock) | 72 | #define _write_lock(lock) __write_lock(lock) |
| 88 | #endif | 73 | #endif |
| 89 | 74 | ||
| 90 | #ifdef __always_inline__spin_lock_bh | 75 | #ifdef CONFIG_INLINE_SPIN_LOCK_BH |
| 91 | #define _spin_lock_bh(lock) __spin_lock_bh(lock) | 76 | #define _spin_lock_bh(lock) __spin_lock_bh(lock) |
| 92 | #endif | 77 | #endif |
| 93 | 78 | ||
| 94 | #ifdef __always_inline__read_lock_bh | 79 | #ifdef CONFIG_INLINE_READ_LOCK_BH |
| 95 | #define _read_lock_bh(lock) __read_lock_bh(lock) | 80 | #define _read_lock_bh(lock) __read_lock_bh(lock) |
| 96 | #endif | 81 | #endif |
| 97 | 82 | ||
| 98 | #ifdef __always_inline__write_lock_bh | 83 | #ifdef CONFIG_INLINE_WRITE_LOCK_BH |
| 99 | #define _write_lock_bh(lock) __write_lock_bh(lock) | 84 | #define _write_lock_bh(lock) __write_lock_bh(lock) |
| 100 | #endif | 85 | #endif |
| 101 | 86 | ||
| 102 | #ifdef __always_inline__spin_lock_irq | 87 | #ifdef CONFIG_INLINE_SPIN_LOCK_IRQ |
| 103 | #define _spin_lock_irq(lock) __spin_lock_irq(lock) | 88 | #define _spin_lock_irq(lock) __spin_lock_irq(lock) |
| 104 | #endif | 89 | #endif |
| 105 | 90 | ||
| 106 | #ifdef __always_inline__read_lock_irq | 91 | #ifdef CONFIG_INLINE_READ_LOCK_IRQ |
| 107 | #define _read_lock_irq(lock) __read_lock_irq(lock) | 92 | #define _read_lock_irq(lock) __read_lock_irq(lock) |
| 108 | #endif | 93 | #endif |
| 109 | 94 | ||
| 110 | #ifdef __always_inline__write_lock_irq | 95 | #ifdef CONFIG_INLINE_WRITE_LOCK_IRQ |
| 111 | #define _write_lock_irq(lock) __write_lock_irq(lock) | 96 | #define _write_lock_irq(lock) __write_lock_irq(lock) |
| 112 | #endif | 97 | #endif |
| 113 | 98 | ||
| 114 | #ifdef __always_inline__spin_lock_irqsave | 99 | #ifdef CONFIG_INLINE_SPIN_LOCK_IRQSAVE |
| 115 | #define _spin_lock_irqsave(lock) __spin_lock_irqsave(lock) | 100 | #define _spin_lock_irqsave(lock) __spin_lock_irqsave(lock) |
| 116 | #endif | 101 | #endif |
| 117 | 102 | ||
| 118 | #ifdef __always_inline__read_lock_irqsave | 103 | #ifdef CONFIG_INLINE_READ_LOCK_IRQSAVE |
| 119 | #define _read_lock_irqsave(lock) __read_lock_irqsave(lock) | 104 | #define _read_lock_irqsave(lock) __read_lock_irqsave(lock) |
| 120 | #endif | 105 | #endif |
| 121 | 106 | ||
| 122 | #ifdef __always_inline__write_lock_irqsave | 107 | #ifdef CONFIG_INLINE_WRITE_LOCK_IRQSAVE |
| 123 | #define _write_lock_irqsave(lock) __write_lock_irqsave(lock) | 108 | #define _write_lock_irqsave(lock) __write_lock_irqsave(lock) |
| 124 | #endif | 109 | #endif |
| 125 | 110 | ||
| 126 | #endif /* !CONFIG_GENERIC_LOCKBREAK */ | 111 | #ifdef CONFIG_INLINE_SPIN_TRYLOCK |
| 127 | |||
| 128 | #ifdef __always_inline__spin_trylock | ||
| 129 | #define _spin_trylock(lock) __spin_trylock(lock) | 112 | #define _spin_trylock(lock) __spin_trylock(lock) |
| 130 | #endif | 113 | #endif |
| 131 | 114 | ||
| 132 | #ifdef __always_inline__read_trylock | 115 | #ifdef CONFIG_INLINE_READ_TRYLOCK |
| 133 | #define _read_trylock(lock) __read_trylock(lock) | 116 | #define _read_trylock(lock) __read_trylock(lock) |
| 134 | #endif | 117 | #endif |
| 135 | 118 | ||
| 136 | #ifdef __always_inline__write_trylock | 119 | #ifdef CONFIG_INLINE_WRITE_TRYLOCK |
| 137 | #define _write_trylock(lock) __write_trylock(lock) | 120 | #define _write_trylock(lock) __write_trylock(lock) |
| 138 | #endif | 121 | #endif |
| 139 | 122 | ||
| 140 | #ifdef __always_inline__spin_trylock_bh | 123 | #ifdef CONFIG_INLINE_SPIN_TRYLOCK_BH |
| 141 | #define _spin_trylock_bh(lock) __spin_trylock_bh(lock) | 124 | #define _spin_trylock_bh(lock) __spin_trylock_bh(lock) |
| 142 | #endif | 125 | #endif |
| 143 | 126 | ||
| 144 | #ifdef __always_inline__spin_unlock | 127 | #ifdef CONFIG_INLINE_SPIN_UNLOCK |
| 145 | #define _spin_unlock(lock) __spin_unlock(lock) | 128 | #define _spin_unlock(lock) __spin_unlock(lock) |
| 146 | #endif | 129 | #endif |
| 147 | 130 | ||
| 148 | #ifdef __always_inline__read_unlock | 131 | #ifdef CONFIG_INLINE_READ_UNLOCK |
| 149 | #define _read_unlock(lock) __read_unlock(lock) | 132 | #define _read_unlock(lock) __read_unlock(lock) |
| 150 | #endif | 133 | #endif |
| 151 | 134 | ||
| 152 | #ifdef __always_inline__write_unlock | 135 | #ifdef CONFIG_INLINE_WRITE_UNLOCK |
| 153 | #define _write_unlock(lock) __write_unlock(lock) | 136 | #define _write_unlock(lock) __write_unlock(lock) |
| 154 | #endif | 137 | #endif |
| 155 | 138 | ||
| 156 | #ifdef __always_inline__spin_unlock_bh | 139 | #ifdef CONFIG_INLINE_SPIN_UNLOCK_BH |
| 157 | #define _spin_unlock_bh(lock) __spin_unlock_bh(lock) | 140 | #define _spin_unlock_bh(lock) __spin_unlock_bh(lock) |
| 158 | #endif | 141 | #endif |
| 159 | 142 | ||
| 160 | #ifdef __always_inline__read_unlock_bh | 143 | #ifdef CONFIG_INLINE_READ_UNLOCK_BH |
| 161 | #define _read_unlock_bh(lock) __read_unlock_bh(lock) | 144 | #define _read_unlock_bh(lock) __read_unlock_bh(lock) |
| 162 | #endif | 145 | #endif |
| 163 | 146 | ||
| 164 | #ifdef __always_inline__write_unlock_bh | 147 | #ifdef CONFIG_INLINE_WRITE_UNLOCK_BH |
| 165 | #define _write_unlock_bh(lock) __write_unlock_bh(lock) | 148 | #define _write_unlock_bh(lock) __write_unlock_bh(lock) |
| 166 | #endif | 149 | #endif |
| 167 | 150 | ||
| 168 | #ifdef __always_inline__spin_unlock_irq | 151 | #ifdef CONFIG_INLINE_SPIN_UNLOCK_IRQ |
| 169 | #define _spin_unlock_irq(lock) __spin_unlock_irq(lock) | 152 | #define _spin_unlock_irq(lock) __spin_unlock_irq(lock) |
| 170 | #endif | 153 | #endif |
| 171 | 154 | ||
| 172 | #ifdef __always_inline__read_unlock_irq | 155 | #ifdef CONFIG_INLINE_READ_UNLOCK_IRQ |
| 173 | #define _read_unlock_irq(lock) __read_unlock_irq(lock) | 156 | #define _read_unlock_irq(lock) __read_unlock_irq(lock) |
| 174 | #endif | 157 | #endif |
| 175 | 158 | ||
| 176 | #ifdef __always_inline__write_unlock_irq | 159 | #ifdef CONFIG_INLINE_WRITE_UNLOCK_IRQ |
| 177 | #define _write_unlock_irq(lock) __write_unlock_irq(lock) | 160 | #define _write_unlock_irq(lock) __write_unlock_irq(lock) |
| 178 | #endif | 161 | #endif |
| 179 | 162 | ||
| 180 | #ifdef __always_inline__spin_unlock_irqrestore | 163 | #ifdef CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE |
| 181 | #define _spin_unlock_irqrestore(lock, flags) __spin_unlock_irqrestore(lock, flags) | 164 | #define _spin_unlock_irqrestore(lock, flags) __spin_unlock_irqrestore(lock, flags) |
| 182 | #endif | 165 | #endif |
| 183 | 166 | ||
| 184 | #ifdef __always_inline__read_unlock_irqrestore | 167 | #ifdef CONFIG_INLINE_READ_UNLOCK_IRQRESTORE |
| 185 | #define _read_unlock_irqrestore(lock, flags) __read_unlock_irqrestore(lock, flags) | 168 | #define _read_unlock_irqrestore(lock, flags) __read_unlock_irqrestore(lock, flags) |
| 186 | #endif | 169 | #endif |
| 187 | 170 | ||
| 188 | #ifdef __always_inline__write_unlock_irqrestore | 171 | #ifdef CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE |
| 189 | #define _write_unlock_irqrestore(lock, flags) __write_unlock_irqrestore(lock, flags) | 172 | #define _write_unlock_irqrestore(lock, flags) __write_unlock_irqrestore(lock, flags) |
| 190 | #endif | 173 | #endif |
| 191 | 174 | ||
| 192 | #endif /* CONFIG_DEBUG_SPINLOCK */ | ||
| 193 | |||
| 194 | static inline int __spin_trylock(spinlock_t *lock) | 175 | static inline int __spin_trylock(spinlock_t *lock) |
| 195 | { | 176 | { |
| 196 | preempt_disable(); | 177 | preempt_disable(); |
diff --git a/include/linux/srcu.h b/include/linux/srcu.h index aca0eee53930..4765d97dcafb 100644 --- a/include/linux/srcu.h +++ b/include/linux/srcu.h | |||
| @@ -48,6 +48,7 @@ void cleanup_srcu_struct(struct srcu_struct *sp); | |||
| 48 | int srcu_read_lock(struct srcu_struct *sp) __acquires(sp); | 48 | int srcu_read_lock(struct srcu_struct *sp) __acquires(sp); |
| 49 | void srcu_read_unlock(struct srcu_struct *sp, int idx) __releases(sp); | 49 | void srcu_read_unlock(struct srcu_struct *sp, int idx) __releases(sp); |
| 50 | void synchronize_srcu(struct srcu_struct *sp); | 50 | void synchronize_srcu(struct srcu_struct *sp); |
| 51 | void synchronize_srcu_expedited(struct srcu_struct *sp); | ||
| 51 | long srcu_batches_completed(struct srcu_struct *sp); | 52 | long srcu_batches_completed(struct srcu_struct *sp); |
| 52 | 53 | ||
| 53 | #endif | 54 | #endif |
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h index 5ae8fa22d331..3d0a9ff24f01 100644 --- a/include/linux/ssb/ssb.h +++ b/include/linux/ssb/ssb.h | |||
| @@ -27,24 +27,54 @@ struct ssb_sprom { | |||
| 27 | u8 et1mdcport; /* MDIO for enet1 */ | 27 | u8 et1mdcport; /* MDIO for enet1 */ |
| 28 | u8 board_rev; /* Board revision number from SPROM. */ | 28 | u8 board_rev; /* Board revision number from SPROM. */ |
| 29 | u8 country_code; /* Country Code */ | 29 | u8 country_code; /* Country Code */ |
| 30 | u8 ant_available_a; /* A-PHY antenna available bits (up to 4) */ | 30 | u8 ant_available_a; /* 2GHz antenna available bits (up to 4) */ |
| 31 | u8 ant_available_bg; /* B/G-PHY antenna available bits (up to 4) */ | 31 | u8 ant_available_bg; /* 5GHz antenna available bits (up to 4) */ |
| 32 | u16 pa0b0; | 32 | u16 pa0b0; |
| 33 | u16 pa0b1; | 33 | u16 pa0b1; |
| 34 | u16 pa0b2; | 34 | u16 pa0b2; |
| 35 | u16 pa1b0; | 35 | u16 pa1b0; |
| 36 | u16 pa1b1; | 36 | u16 pa1b1; |
| 37 | u16 pa1b2; | 37 | u16 pa1b2; |
| 38 | u16 pa1lob0; | ||
| 39 | u16 pa1lob1; | ||
| 40 | u16 pa1lob2; | ||
| 41 | u16 pa1hib0; | ||
| 42 | u16 pa1hib1; | ||
| 43 | u16 pa1hib2; | ||
| 38 | u8 gpio0; /* GPIO pin 0 */ | 44 | u8 gpio0; /* GPIO pin 0 */ |
| 39 | u8 gpio1; /* GPIO pin 1 */ | 45 | u8 gpio1; /* GPIO pin 1 */ |
| 40 | u8 gpio2; /* GPIO pin 2 */ | 46 | u8 gpio2; /* GPIO pin 2 */ |
| 41 | u8 gpio3; /* GPIO pin 3 */ | 47 | u8 gpio3; /* GPIO pin 3 */ |
| 42 | u16 maxpwr_a; /* A-PHY Amplifier Max Power (in dBm Q5.2) */ | 48 | u16 maxpwr_bg; /* 2.4GHz Amplifier Max Power (in dBm Q5.2) */ |
| 43 | u16 maxpwr_bg; /* B/G-PHY Amplifier Max Power (in dBm Q5.2) */ | 49 | u16 maxpwr_al; /* 5.2GHz Amplifier Max Power (in dBm Q5.2) */ |
| 50 | u16 maxpwr_a; /* 5.3GHz Amplifier Max Power (in dBm Q5.2) */ | ||
| 51 | u16 maxpwr_ah; /* 5.8GHz Amplifier Max Power (in dBm Q5.2) */ | ||
| 44 | u8 itssi_a; /* Idle TSSI Target for A-PHY */ | 52 | u8 itssi_a; /* Idle TSSI Target for A-PHY */ |
| 45 | u8 itssi_bg; /* Idle TSSI Target for B/G-PHY */ | 53 | u8 itssi_bg; /* Idle TSSI Target for B/G-PHY */ |
| 46 | u16 boardflags_lo; /* Boardflags (low 16 bits) */ | 54 | u8 tri2g; /* 2.4GHz TX isolation */ |
| 47 | u16 boardflags_hi; /* Boardflags (high 16 bits) */ | 55 | u8 tri5gl; /* 5.2GHz TX isolation */ |
| 56 | u8 tri5g; /* 5.3GHz TX isolation */ | ||
| 57 | u8 tri5gh; /* 5.8GHz TX isolation */ | ||
| 58 | u8 rxpo2g; /* 2GHz RX power offset */ | ||
| 59 | u8 rxpo5g; /* 5GHz RX power offset */ | ||
| 60 | u8 rssisav2g; /* 2GHz RSSI params */ | ||
| 61 | u8 rssismc2g; | ||
| 62 | u8 rssismf2g; | ||
| 63 | u8 bxa2g; /* 2GHz BX arch */ | ||
| 64 | u8 rssisav5g; /* 5GHz RSSI params */ | ||
| 65 | u8 rssismc5g; | ||
| 66 | u8 rssismf5g; | ||
| 67 | u8 bxa5g; /* 5GHz BX arch */ | ||
| 68 | u16 cck2gpo; /* CCK power offset */ | ||
| 69 | u32 ofdm2gpo; /* 2.4GHz OFDM power offset */ | ||
| 70 | u32 ofdm5glpo; /* 5.2GHz OFDM power offset */ | ||
| 71 | u32 ofdm5gpo; /* 5.3GHz OFDM power offset */ | ||
| 72 | u32 ofdm5ghpo; /* 5.8GHz OFDM power offset */ | ||
| 73 | u16 boardflags_lo; /* Board flags (bits 0-15) */ | ||
| 74 | u16 boardflags_hi; /* Board flags (bits 16-31) */ | ||
| 75 | u16 boardflags2_lo; /* Board flags (bits 32-47) */ | ||
| 76 | u16 boardflags2_hi; /* Board flags (bits 48-63) */ | ||
| 77 | /* TODO store board flags in a single u64 */ | ||
| 48 | 78 | ||
| 49 | /* Antenna gain values for up to 4 antennas | 79 | /* Antenna gain values for up to 4 antennas |
| 50 | * on each band. Values in dBm/4 (Q5.2). Negative gain means the | 80 | * on each band. Values in dBm/4 (Q5.2). Negative gain means the |
| @@ -58,7 +88,7 @@ struct ssb_sprom { | |||
| 58 | } ghz5; /* 5GHz band */ | 88 | } ghz5; /* 5GHz band */ |
| 59 | } antenna_gain; | 89 | } antenna_gain; |
| 60 | 90 | ||
| 61 | /* TODO - add any parameters needed from rev 2, 3, or 4 SPROMs */ | 91 | /* TODO - add any parameters needed from rev 2, 3, 4, 5 or 8 SPROMs */ |
| 62 | }; | 92 | }; |
| 63 | 93 | ||
| 64 | /* Information about the PCB the circuitry is soldered on. */ | 94 | /* Information about the PCB the circuitry is soldered on. */ |
| @@ -208,6 +238,7 @@ enum ssb_bustype { | |||
| 208 | SSB_BUSTYPE_SSB, /* This SSB bus is the system bus */ | 238 | SSB_BUSTYPE_SSB, /* This SSB bus is the system bus */ |
| 209 | SSB_BUSTYPE_PCI, /* SSB is connected to PCI bus */ | 239 | SSB_BUSTYPE_PCI, /* SSB is connected to PCI bus */ |
| 210 | SSB_BUSTYPE_PCMCIA, /* SSB is connected to PCMCIA bus */ | 240 | SSB_BUSTYPE_PCMCIA, /* SSB is connected to PCMCIA bus */ |
| 241 | SSB_BUSTYPE_SDIO, /* SSB is connected to SDIO bus */ | ||
| 211 | }; | 242 | }; |
| 212 | 243 | ||
| 213 | /* board_vendor */ | 244 | /* board_vendor */ |
| @@ -240,8 +271,12 @@ struct ssb_bus { | |||
| 240 | 271 | ||
| 241 | /* The core in the basic address register window. (PCI bus only) */ | 272 | /* The core in the basic address register window. (PCI bus only) */ |
| 242 | struct ssb_device *mapped_device; | 273 | struct ssb_device *mapped_device; |
| 243 | /* Currently mapped PCMCIA segment. (bustype == SSB_BUSTYPE_PCMCIA only) */ | 274 | union { |
| 244 | u8 mapped_pcmcia_seg; | 275 | /* Currently mapped PCMCIA segment. (bustype == SSB_BUSTYPE_PCMCIA only) */ |
| 276 | u8 mapped_pcmcia_seg; | ||
| 277 | /* Current SSB base address window for SDIO. */ | ||
| 278 | u32 sdio_sbaddr; | ||
| 279 | }; | ||
| 245 | /* Lock for core and segment switching. | 280 | /* Lock for core and segment switching. |
| 246 | * On PCMCIA-host busses this is used to protect the whole MMIO access. */ | 281 | * On PCMCIA-host busses this is used to protect the whole MMIO access. */ |
| 247 | spinlock_t bar_lock; | 282 | spinlock_t bar_lock; |
| @@ -252,6 +287,11 @@ struct ssb_bus { | |||
| 252 | struct pci_dev *host_pci; | 287 | struct pci_dev *host_pci; |
| 253 | /* Pointer to the PCMCIA device (only if bustype == SSB_BUSTYPE_PCMCIA). */ | 288 | /* Pointer to the PCMCIA device (only if bustype == SSB_BUSTYPE_PCMCIA). */ |
| 254 | struct pcmcia_device *host_pcmcia; | 289 | struct pcmcia_device *host_pcmcia; |
| 290 | /* Pointer to the SDIO device (only if bustype == SSB_BUSTYPE_SDIO). */ | ||
| 291 | struct sdio_func *host_sdio; | ||
| 292 | |||
| 293 | /* See enum ssb_quirks */ | ||
| 294 | unsigned int quirks; | ||
| 255 | 295 | ||
| 256 | #ifdef CONFIG_SSB_SPROM | 296 | #ifdef CONFIG_SSB_SPROM |
| 257 | /* Mutex to protect the SPROM writing. */ | 297 | /* Mutex to protect the SPROM writing. */ |
| @@ -306,6 +346,11 @@ struct ssb_bus { | |||
| 306 | #endif /* DEBUG */ | 346 | #endif /* DEBUG */ |
| 307 | }; | 347 | }; |
| 308 | 348 | ||
| 349 | enum ssb_quirks { | ||
| 350 | /* SDIO connected card requires performing a read after writing a 32-bit value */ | ||
| 351 | SSB_QUIRK_SDIO_READ_AFTER_WRITE32 = (1 << 0), | ||
| 352 | }; | ||
| 353 | |||
| 309 | /* The initialization-invariants. */ | 354 | /* The initialization-invariants. */ |
| 310 | struct ssb_init_invariants { | 355 | struct ssb_init_invariants { |
| 311 | /* Versioning information about the PCB. */ | 356 | /* Versioning information about the PCB. */ |
| @@ -336,6 +381,12 @@ extern int ssb_bus_pcmciabus_register(struct ssb_bus *bus, | |||
| 336 | struct pcmcia_device *pcmcia_dev, | 381 | struct pcmcia_device *pcmcia_dev, |
| 337 | unsigned long baseaddr); | 382 | unsigned long baseaddr); |
| 338 | #endif /* CONFIG_SSB_PCMCIAHOST */ | 383 | #endif /* CONFIG_SSB_PCMCIAHOST */ |
| 384 | #ifdef CONFIG_SSB_SDIOHOST | ||
| 385 | extern int ssb_bus_sdiobus_register(struct ssb_bus *bus, | ||
| 386 | struct sdio_func *sdio_func, | ||
| 387 | unsigned int quirks); | ||
| 388 | #endif /* CONFIG_SSB_SDIOHOST */ | ||
| 389 | |||
| 339 | 390 | ||
| 340 | extern void ssb_bus_unregister(struct ssb_bus *bus); | 391 | extern void ssb_bus_unregister(struct ssb_bus *bus); |
| 341 | 392 | ||
diff --git a/include/linux/ssb/ssb_driver_chipcommon.h b/include/linux/ssb/ssb_driver_chipcommon.h index d3b1d18922f2..4e27acf0a92f 100644 --- a/include/linux/ssb/ssb_driver_chipcommon.h +++ b/include/linux/ssb/ssb_driver_chipcommon.h | |||
| @@ -629,5 +629,15 @@ extern int ssb_chipco_serial_init(struct ssb_chipcommon *cc, | |||
| 629 | /* PMU support */ | 629 | /* PMU support */ |
| 630 | extern void ssb_pmu_init(struct ssb_chipcommon *cc); | 630 | extern void ssb_pmu_init(struct ssb_chipcommon *cc); |
| 631 | 631 | ||
| 632 | enum ssb_pmu_ldo_volt_id { | ||
| 633 | LDO_PAREF = 0, | ||
| 634 | LDO_VOLT1, | ||
| 635 | LDO_VOLT2, | ||
| 636 | LDO_VOLT3, | ||
| 637 | }; | ||
| 638 | |||
| 639 | void ssb_pmu_set_ldo_voltage(struct ssb_chipcommon *cc, | ||
| 640 | enum ssb_pmu_ldo_volt_id id, u32 voltage); | ||
| 641 | void ssb_pmu_set_ldo_paref(struct ssb_chipcommon *cc, bool on); | ||
| 632 | 642 | ||
| 633 | #endif /* LINUX_SSB_CHIPCO_H_ */ | 643 | #endif /* LINUX_SSB_CHIPCO_H_ */ |
diff --git a/include/linux/ssb/ssb_regs.h b/include/linux/ssb/ssb_regs.h index a01b982b5783..9ae9082eaeb4 100644 --- a/include/linux/ssb/ssb_regs.h +++ b/include/linux/ssb/ssb_regs.h | |||
| @@ -162,7 +162,7 @@ | |||
| 162 | 162 | ||
| 163 | /* SPROM shadow area. If not otherwise noted, fields are | 163 | /* SPROM shadow area. If not otherwise noted, fields are |
| 164 | * two bytes wide. Note that the SPROM can _only_ be read | 164 | * two bytes wide. Note that the SPROM can _only_ be read |
| 165 | * in two-byte quantinies. | 165 | * in two-byte quantities. |
| 166 | */ | 166 | */ |
| 167 | #define SSB_SPROMSIZE_WORDS 64 | 167 | #define SSB_SPROMSIZE_WORDS 64 |
| 168 | #define SSB_SPROMSIZE_BYTES (SSB_SPROMSIZE_WORDS * sizeof(u16)) | 168 | #define SSB_SPROMSIZE_BYTES (SSB_SPROMSIZE_WORDS * sizeof(u16)) |
| @@ -327,8 +327,11 @@ | |||
| 327 | #define SSB_SPROM5_GPIOB_P3_SHIFT 8 | 327 | #define SSB_SPROM5_GPIOB_P3_SHIFT 8 |
| 328 | 328 | ||
| 329 | /* SPROM Revision 8 */ | 329 | /* SPROM Revision 8 */ |
| 330 | #define SSB_SPROM8_BFLLO 0x1084 /* Boardflags (low 16 bits) */ | 330 | #define SSB_SPROM8_BOARDREV 0x1082 /* Board revision */ |
| 331 | #define SSB_SPROM8_BFLHI 0x1086 /* Boardflags Hi */ | 331 | #define SSB_SPROM8_BFLLO 0x1084 /* Board flags (bits 0-15) */ |
| 332 | #define SSB_SPROM8_BFLHI 0x1086 /* Board flags (bits 16-31) */ | ||
| 333 | #define SSB_SPROM8_BFL2LO 0x1088 /* Board flags (bits 32-47) */ | ||
| 334 | #define SSB_SPROM8_BFL2HI 0x108A /* Board flags (bits 48-63) */ | ||
| 332 | #define SSB_SPROM8_IL0MAC 0x108C /* 6 byte MAC address */ | 335 | #define SSB_SPROM8_IL0MAC 0x108C /* 6 byte MAC address */ |
| 333 | #define SSB_SPROM8_CCODE 0x1092 /* 2 byte country code */ | 336 | #define SSB_SPROM8_CCODE 0x1092 /* 2 byte country code */ |
| 334 | #define SSB_SPROM8_ANTAVAIL 0x109C /* Antenna available bitfields*/ | 337 | #define SSB_SPROM8_ANTAVAIL 0x109C /* Antenna available bitfields*/ |
| @@ -354,14 +357,63 @@ | |||
| 354 | #define SSB_SPROM8_GPIOB_P2 0x00FF /* Pin 2 */ | 357 | #define SSB_SPROM8_GPIOB_P2 0x00FF /* Pin 2 */ |
| 355 | #define SSB_SPROM8_GPIOB_P3 0xFF00 /* Pin 3 */ | 358 | #define SSB_SPROM8_GPIOB_P3 0xFF00 /* Pin 3 */ |
| 356 | #define SSB_SPROM8_GPIOB_P3_SHIFT 8 | 359 | #define SSB_SPROM8_GPIOB_P3_SHIFT 8 |
| 357 | #define SSB_SPROM8_MAXP_BG 0x10C0 /* Max Power BG in path 1 */ | 360 | #define SSB_SPROM8_RSSIPARM2G 0x10A4 /* RSSI params for 2GHz */ |
| 358 | #define SSB_SPROM8_MAXP_BG_MASK 0x00FF /* Mask for Max Power BG */ | 361 | #define SSB_SPROM8_RSSISMF2G 0x000F |
| 362 | #define SSB_SPROM8_RSSISMC2G 0x00F0 | ||
| 363 | #define SSB_SPROM8_RSSISMC2G_SHIFT 4 | ||
| 364 | #define SSB_SPROM8_RSSISAV2G 0x0700 | ||
| 365 | #define SSB_SPROM8_RSSISAV2G_SHIFT 8 | ||
| 366 | #define SSB_SPROM8_BXA2G 0x1800 | ||
| 367 | #define SSB_SPROM8_BXA2G_SHIFT 11 | ||
| 368 | #define SSB_SPROM8_RSSIPARM5G 0x10A6 /* RSSI params for 5GHz */ | ||
| 369 | #define SSB_SPROM8_RSSISMF5G 0x000F | ||
| 370 | #define SSB_SPROM8_RSSISMC5G 0x00F0 | ||
| 371 | #define SSB_SPROM8_RSSISMC5G_SHIFT 4 | ||
| 372 | #define SSB_SPROM8_RSSISAV5G 0x0700 | ||
| 373 | #define SSB_SPROM8_RSSISAV5G_SHIFT 8 | ||
| 374 | #define SSB_SPROM8_BXA5G 0x1800 | ||
| 375 | #define SSB_SPROM8_BXA5G_SHIFT 11 | ||
| 376 | #define SSB_SPROM8_TRI25G 0x10A8 /* TX isolation 2.4&5.3GHz */ | ||
| 377 | #define SSB_SPROM8_TRI2G 0x00FF /* TX isolation 2.4GHz */ | ||
| 378 | #define SSB_SPROM8_TRI5G 0xFF00 /* TX isolation 5.3GHz */ | ||
| 379 | #define SSB_SPROM8_TRI5G_SHIFT 8 | ||
| 380 | #define SSB_SPROM8_TRI5GHL 0x10AA /* TX isolation 5.2/5.8GHz */ | ||
| 381 | #define SSB_SPROM8_TRI5GL 0x00FF /* TX isolation 5.2GHz */ | ||
| 382 | #define SSB_SPROM8_TRI5GH 0xFF00 /* TX isolation 5.8GHz */ | ||
| 383 | #define SSB_SPROM8_TRI5GH_SHIFT 8 | ||
| 384 | #define SSB_SPROM8_RXPO 0x10AC /* RX power offsets */ | ||
| 385 | #define SSB_SPROM8_RXPO2G 0x00FF /* 2GHz RX power offset */ | ||
| 386 | #define SSB_SPROM8_RXPO5G 0xFF00 /* 5GHz RX power offset */ | ||
| 387 | #define SSB_SPROM8_RXPO5G_SHIFT 8 | ||
| 388 | #define SSB_SPROM8_MAXP_BG 0x10C0 /* Max Power 2GHz in path 1 */ | ||
| 389 | #define SSB_SPROM8_MAXP_BG_MASK 0x00FF /* Mask for Max Power 2GHz */ | ||
| 359 | #define SSB_SPROM8_ITSSI_BG 0xFF00 /* Mask for path 1 itssi_bg */ | 390 | #define SSB_SPROM8_ITSSI_BG 0xFF00 /* Mask for path 1 itssi_bg */ |
| 360 | #define SSB_SPROM8_ITSSI_BG_SHIFT 8 | 391 | #define SSB_SPROM8_ITSSI_BG_SHIFT 8 |
| 361 | #define SSB_SPROM8_MAXP_A 0x10C8 /* Max Power A in path 1 */ | 392 | #define SSB_SPROM8_PA0B0 0x10C2 /* 2GHz power amp settings */ |
| 362 | #define SSB_SPROM8_MAXP_A_MASK 0x00FF /* Mask for Max Power A */ | 393 | #define SSB_SPROM8_PA0B1 0x10C4 |
| 394 | #define SSB_SPROM8_PA0B2 0x10C6 | ||
| 395 | #define SSB_SPROM8_MAXP_A 0x10C8 /* Max Power 5.3GHz */ | ||
| 396 | #define SSB_SPROM8_MAXP_A_MASK 0x00FF /* Mask for Max Power 5.3GHz */ | ||
| 363 | #define SSB_SPROM8_ITSSI_A 0xFF00 /* Mask for path 1 itssi_a */ | 397 | #define SSB_SPROM8_ITSSI_A 0xFF00 /* Mask for path 1 itssi_a */ |
| 364 | #define SSB_SPROM8_ITSSI_A_SHIFT 8 | 398 | #define SSB_SPROM8_ITSSI_A_SHIFT 8 |
| 399 | #define SSB_SPROM8_MAXP_AHL 0x10CA /* Max Power 5.2/5.8GHz */ | ||
| 400 | #define SSB_SPROM8_MAXP_AH_MASK 0x00FF /* Mask for Max Power 5.8GHz */ | ||
| 401 | #define SSB_SPROM8_MAXP_AL_MASK 0xFF00 /* Mask for Max Power 5.2GHz */ | ||
| 402 | #define SSB_SPROM8_MAXP_AL_SHIFT 8 | ||
| 403 | #define SSB_SPROM8_PA1B0 0x10CC /* 5.3GHz power amp settings */ | ||
| 404 | #define SSB_SPROM8_PA1B1 0x10CE | ||
| 405 | #define SSB_SPROM8_PA1B2 0x10D0 | ||
| 406 | #define SSB_SPROM8_PA1LOB0 0x10D2 /* 5.2GHz power amp settings */ | ||
| 407 | #define SSB_SPROM8_PA1LOB1 0x10D4 | ||
| 408 | #define SSB_SPROM8_PA1LOB2 0x10D6 | ||
| 409 | #define SSB_SPROM8_PA1HIB0 0x10D8 /* 5.8GHz power amp settings */ | ||
| 410 | #define SSB_SPROM8_PA1HIB1 0x10DA | ||
| 411 | #define SSB_SPROM8_PA1HIB2 0x10DC | ||
| 412 | #define SSB_SPROM8_CCK2GPO 0x1140 /* CCK power offset */ | ||
| 413 | #define SSB_SPROM8_OFDM2GPO 0x1142 /* 2.4GHz OFDM power offset */ | ||
| 414 | #define SSB_SPROM8_OFDM5GPO 0x1146 /* 5.3GHz OFDM power offset */ | ||
| 415 | #define SSB_SPROM8_OFDM5GLPO 0x114A /* 5.2GHz OFDM power offset */ | ||
| 416 | #define SSB_SPROM8_OFDM5GHPO 0x114E /* 5.8GHz OFDM power offset */ | ||
| 365 | 417 | ||
| 366 | /* Values for SSB_SPROM1_BINF_CCODE */ | 418 | /* Values for SSB_SPROM1_BINF_CCODE */ |
| 367 | enum { | 419 | enum { |
diff --git a/include/linux/string.h b/include/linux/string.h index 489019ef1694..b8508868d5ad 100644 --- a/include/linux/string.h +++ b/include/linux/string.h | |||
| @@ -62,7 +62,7 @@ extern char * strnchr(const char *, size_t, int); | |||
| 62 | #ifndef __HAVE_ARCH_STRRCHR | 62 | #ifndef __HAVE_ARCH_STRRCHR |
| 63 | extern char * strrchr(const char *,int); | 63 | extern char * strrchr(const char *,int); |
| 64 | #endif | 64 | #endif |
| 65 | extern char * strstrip(char *); | 65 | extern char * __must_check strstrip(char *); |
| 66 | #ifndef __HAVE_ARCH_STRSTR | 66 | #ifndef __HAVE_ARCH_STRSTR |
| 67 | extern char * strstr(const char *,const char *); | 67 | extern char * strstr(const char *,const char *); |
| 68 | #endif | 68 | #endif |
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h index 3f632182d8eb..996df4dac7d4 100644 --- a/include/linux/sunrpc/auth.h +++ b/include/linux/sunrpc/auth.h | |||
| @@ -111,7 +111,7 @@ struct rpc_credops { | |||
| 111 | void (*crdestroy)(struct rpc_cred *); | 111 | void (*crdestroy)(struct rpc_cred *); |
| 112 | 112 | ||
| 113 | int (*crmatch)(struct auth_cred *, struct rpc_cred *, int); | 113 | int (*crmatch)(struct auth_cred *, struct rpc_cred *, int); |
| 114 | void (*crbind)(struct rpc_task *, struct rpc_cred *); | 114 | void (*crbind)(struct rpc_task *, struct rpc_cred *, int); |
| 115 | __be32 * (*crmarshal)(struct rpc_task *, __be32 *); | 115 | __be32 * (*crmarshal)(struct rpc_task *, __be32 *); |
| 116 | int (*crrefresh)(struct rpc_task *); | 116 | int (*crrefresh)(struct rpc_task *); |
| 117 | __be32 * (*crvalidate)(struct rpc_task *, __be32 *); | 117 | __be32 * (*crvalidate)(struct rpc_task *, __be32 *); |
| @@ -140,7 +140,7 @@ struct rpc_cred * rpcauth_lookup_credcache(struct rpc_auth *, struct auth_cred * | |||
| 140 | void rpcauth_init_cred(struct rpc_cred *, const struct auth_cred *, struct rpc_auth *, const struct rpc_credops *); | 140 | void rpcauth_init_cred(struct rpc_cred *, const struct auth_cred *, struct rpc_auth *, const struct rpc_credops *); |
| 141 | struct rpc_cred * rpcauth_lookupcred(struct rpc_auth *, int); | 141 | struct rpc_cred * rpcauth_lookupcred(struct rpc_auth *, int); |
| 142 | void rpcauth_bindcred(struct rpc_task *, struct rpc_cred *, int); | 142 | void rpcauth_bindcred(struct rpc_task *, struct rpc_cred *, int); |
| 143 | void rpcauth_generic_bind_cred(struct rpc_task *, struct rpc_cred *); | 143 | void rpcauth_generic_bind_cred(struct rpc_task *, struct rpc_cred *, int); |
| 144 | void put_rpccred(struct rpc_cred *); | 144 | void put_rpccred(struct rpc_cred *); |
| 145 | void rpcauth_unbindcred(struct rpc_task *); | 145 | void rpcauth_unbindcred(struct rpc_task *); |
| 146 | __be32 * rpcauth_marshcred(struct rpc_task *, __be32 *); | 146 | __be32 * rpcauth_marshcred(struct rpc_task *, __be32 *); |
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index ab3f6e90caa5..8ed9642a5a76 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | #include <linux/sunrpc/timer.h> | 22 | #include <linux/sunrpc/timer.h> |
| 23 | #include <asm/signal.h> | 23 | #include <asm/signal.h> |
| 24 | #include <linux/path.h> | 24 | #include <linux/path.h> |
| 25 | #include <net/ipv6.h> | ||
| 25 | 26 | ||
| 26 | struct rpc_inode; | 27 | struct rpc_inode; |
| 27 | 28 | ||
| @@ -113,6 +114,7 @@ struct rpc_create_args { | |||
| 113 | rpc_authflavor_t authflavor; | 114 | rpc_authflavor_t authflavor; |
| 114 | unsigned long flags; | 115 | unsigned long flags; |
| 115 | char *client_name; | 116 | char *client_name; |
| 117 | struct svc_xprt *bc_xprt; /* NFSv4.1 backchannel */ | ||
| 116 | }; | 118 | }; |
| 117 | 119 | ||
| 118 | /* Values for "flags" field */ | 120 | /* Values for "flags" field */ |
| @@ -188,5 +190,117 @@ static inline void rpc_set_port(struct sockaddr *sap, | |||
| 188 | #define IPV6_SCOPE_DELIMITER '%' | 190 | #define IPV6_SCOPE_DELIMITER '%' |
| 189 | #define IPV6_SCOPE_ID_LEN sizeof("%nnnnnnnnnn") | 191 | #define IPV6_SCOPE_ID_LEN sizeof("%nnnnnnnnnn") |
| 190 | 192 | ||
| 193 | static inline bool __rpc_cmp_addr4(const struct sockaddr *sap1, | ||
| 194 | const struct sockaddr *sap2) | ||
| 195 | { | ||
| 196 | const struct sockaddr_in *sin1 = (const struct sockaddr_in *)sap1; | ||
| 197 | const struct sockaddr_in *sin2 = (const struct sockaddr_in *)sap2; | ||
| 198 | |||
| 199 | return sin1->sin_addr.s_addr == sin2->sin_addr.s_addr; | ||
| 200 | } | ||
| 201 | |||
| 202 | static inline bool __rpc_copy_addr4(struct sockaddr *dst, | ||
| 203 | const struct sockaddr *src) | ||
| 204 | { | ||
| 205 | const struct sockaddr_in *ssin = (struct sockaddr_in *) src; | ||
| 206 | struct sockaddr_in *dsin = (struct sockaddr_in *) dst; | ||
| 207 | |||
| 208 | dsin->sin_family = ssin->sin_family; | ||
| 209 | dsin->sin_addr.s_addr = ssin->sin_addr.s_addr; | ||
| 210 | return true; | ||
| 211 | } | ||
| 212 | |||
| 213 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | ||
| 214 | static inline bool __rpc_cmp_addr6(const struct sockaddr *sap1, | ||
| 215 | const struct sockaddr *sap2) | ||
| 216 | { | ||
| 217 | const struct sockaddr_in6 *sin1 = (const struct sockaddr_in6 *)sap1; | ||
| 218 | const struct sockaddr_in6 *sin2 = (const struct sockaddr_in6 *)sap2; | ||
| 219 | return ipv6_addr_equal(&sin1->sin6_addr, &sin2->sin6_addr); | ||
| 220 | } | ||
| 221 | |||
| 222 | static inline bool __rpc_copy_addr6(struct sockaddr *dst, | ||
| 223 | const struct sockaddr *src) | ||
| 224 | { | ||
| 225 | const struct sockaddr_in6 *ssin6 = (const struct sockaddr_in6 *) src; | ||
| 226 | struct sockaddr_in6 *dsin6 = (struct sockaddr_in6 *) dst; | ||
| 227 | |||
| 228 | dsin6->sin6_family = ssin6->sin6_family; | ||
| 229 | ipv6_addr_copy(&dsin6->sin6_addr, &ssin6->sin6_addr); | ||
| 230 | return true; | ||
| 231 | } | ||
| 232 | #else /* !(CONFIG_IPV6 || CONFIG_IPV6_MODULE) */ | ||
| 233 | static inline bool __rpc_cmp_addr6(const struct sockaddr *sap1, | ||
| 234 | const struct sockaddr *sap2) | ||
| 235 | { | ||
| 236 | return false; | ||
| 237 | } | ||
| 238 | |||
| 239 | static inline bool __rpc_copy_addr6(struct sockaddr *dst, | ||
| 240 | const struct sockaddr *src) | ||
| 241 | { | ||
| 242 | return false; | ||
| 243 | } | ||
| 244 | #endif /* !(CONFIG_IPV6 || CONFIG_IPV6_MODULE) */ | ||
| 245 | |||
| 246 | /** | ||
| 247 | * rpc_cmp_addr - compare the address portion of two sockaddrs. | ||
| 248 | * @sap1: first sockaddr | ||
| 249 | * @sap2: second sockaddr | ||
| 250 | * | ||
| 251 | * Just compares the family and address portion. Ignores port, scope, etc. | ||
| 252 | * Returns true if the addrs are equal, false if they aren't. | ||
| 253 | */ | ||
| 254 | static inline bool rpc_cmp_addr(const struct sockaddr *sap1, | ||
| 255 | const struct sockaddr *sap2) | ||
| 256 | { | ||
| 257 | if (sap1->sa_family == sap2->sa_family) { | ||
| 258 | switch (sap1->sa_family) { | ||
| 259 | case AF_INET: | ||
| 260 | return __rpc_cmp_addr4(sap1, sap2); | ||
| 261 | case AF_INET6: | ||
| 262 | return __rpc_cmp_addr6(sap1, sap2); | ||
| 263 | } | ||
| 264 | } | ||
| 265 | return false; | ||
| 266 | } | ||
| 267 | |||
| 268 | /** | ||
| 269 | * rpc_copy_addr - copy the address portion of one sockaddr to another | ||
| 270 | * @dst: destination sockaddr | ||
| 271 | * @src: source sockaddr | ||
| 272 | * | ||
| 273 | * Just copies the address portion and family. Ignores port, scope, etc. | ||
| 274 | * Caller is responsible for making certain that dst is large enough to hold | ||
| 275 | * the address in src. Returns true if address family is supported. Returns | ||
| 276 | * false otherwise. | ||
| 277 | */ | ||
| 278 | static inline bool rpc_copy_addr(struct sockaddr *dst, | ||
| 279 | const struct sockaddr *src) | ||
| 280 | { | ||
| 281 | switch (src->sa_family) { | ||
| 282 | case AF_INET: | ||
| 283 | return __rpc_copy_addr4(dst, src); | ||
| 284 | case AF_INET6: | ||
| 285 | return __rpc_copy_addr6(dst, src); | ||
| 286 | } | ||
| 287 | return false; | ||
| 288 | } | ||
| 289 | |||
| 290 | /** | ||
| 291 | * rpc_get_scope_id - return scopeid for a given sockaddr | ||
| 292 | * @sa: sockaddr to get scopeid from | ||
| 293 | * | ||
| 294 | * Returns the value of the sin6_scope_id for AF_INET6 addrs, or 0 if | ||
| 295 | * not an AF_INET6 address. | ||
| 296 | */ | ||
| 297 | static inline u32 rpc_get_scope_id(const struct sockaddr *sa) | ||
| 298 | { | ||
| 299 | if (sa->sa_family != AF_INET6) | ||
| 300 | return 0; | ||
| 301 | |||
| 302 | return ((struct sockaddr_in6 *) sa)->sin6_scope_id; | ||
| 303 | } | ||
| 304 | |||
| 191 | #endif /* __KERNEL__ */ | 305 | #endif /* __KERNEL__ */ |
| 192 | #endif /* _LINUX_SUNRPC_CLNT_H */ | 306 | #endif /* _LINUX_SUNRPC_CLNT_H */ |
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index ea8009695c69..52e8cb0a7569 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
| @@ -94,8 +94,6 @@ struct svc_serv { | |||
| 94 | struct module * sv_module; /* optional module to count when | 94 | struct module * sv_module; /* optional module to count when |
| 95 | * adding threads */ | 95 | * adding threads */ |
| 96 | svc_thread_fn sv_function; /* main function for threads */ | 96 | svc_thread_fn sv_function; /* main function for threads */ |
| 97 | unsigned int sv_drc_max_pages; /* Total pages for DRC */ | ||
| 98 | unsigned int sv_drc_pages_used;/* DRC pages used */ | ||
| 99 | #if defined(CONFIG_NFS_V4_1) | 97 | #if defined(CONFIG_NFS_V4_1) |
| 100 | struct list_head sv_cb_list; /* queue for callback requests | 98 | struct list_head sv_cb_list; /* queue for callback requests |
| 101 | * that arrive over the same | 99 | * that arrive over the same |
diff --git a/include/linux/sunrpc/svc_xprt.h b/include/linux/sunrpc/svc_xprt.h index 2223ae0b5ed5..5f4e18b3ce73 100644 --- a/include/linux/sunrpc/svc_xprt.h +++ b/include/linux/sunrpc/svc_xprt.h | |||
| @@ -65,6 +65,7 @@ struct svc_xprt { | |||
| 65 | size_t xpt_locallen; /* length of address */ | 65 | size_t xpt_locallen; /* length of address */ |
| 66 | struct sockaddr_storage xpt_remote; /* remote peer's address */ | 66 | struct sockaddr_storage xpt_remote; /* remote peer's address */ |
| 67 | size_t xpt_remotelen; /* length of address */ | 67 | size_t xpt_remotelen; /* length of address */ |
| 68 | struct rpc_wait_queue xpt_bc_pending; /* backchannel wait queue */ | ||
| 68 | }; | 69 | }; |
| 69 | 70 | ||
| 70 | int svc_reg_xprt_class(struct svc_xprt_class *); | 71 | int svc_reg_xprt_class(struct svc_xprt_class *); |
diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/svcsock.h index 04dba23c59f2..1b353a76c304 100644 --- a/include/linux/sunrpc/svcsock.h +++ b/include/linux/sunrpc/svcsock.h | |||
| @@ -28,6 +28,7 @@ struct svc_sock { | |||
| 28 | /* private TCP part */ | 28 | /* private TCP part */ |
| 29 | u32 sk_reclen; /* length of record */ | 29 | u32 sk_reclen; /* length of record */ |
| 30 | u32 sk_tcplen; /* current read length */ | 30 | u32 sk_tcplen; /* current read length */ |
| 31 | struct rpc_xprt *sk_bc_xprt; /* NFSv4.1 backchannel xprt */ | ||
| 31 | }; | 32 | }; |
| 32 | 33 | ||
| 33 | /* | 34 | /* |
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h index 7da466ba4b0d..f5cc0898bc53 100644 --- a/include/linux/sunrpc/xdr.h +++ b/include/linux/sunrpc/xdr.h | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | 11 | ||
| 12 | #include <linux/uio.h> | 12 | #include <linux/uio.h> |
| 13 | #include <asm/byteorder.h> | 13 | #include <asm/byteorder.h> |
| 14 | #include <asm/unaligned.h> | ||
| 14 | #include <linux/scatterlist.h> | 15 | #include <linux/scatterlist.h> |
| 15 | 16 | ||
| 16 | /* | 17 | /* |
| @@ -117,14 +118,14 @@ static inline __be32 *xdr_encode_array(__be32 *p, const void *s, unsigned int le | |||
| 117 | static inline __be32 * | 118 | static inline __be32 * |
| 118 | xdr_encode_hyper(__be32 *p, __u64 val) | 119 | xdr_encode_hyper(__be32 *p, __u64 val) |
| 119 | { | 120 | { |
| 120 | *(__be64 *)p = cpu_to_be64(val); | 121 | put_unaligned_be64(val, p); |
| 121 | return p + 2; | 122 | return p + 2; |
| 122 | } | 123 | } |
| 123 | 124 | ||
| 124 | static inline __be32 * | 125 | static inline __be32 * |
| 125 | xdr_decode_hyper(__be32 *p, __u64 *valp) | 126 | xdr_decode_hyper(__be32 *p, __u64 *valp) |
| 126 | { | 127 | { |
| 127 | *valp = be64_to_cpup((__be64 *)p); | 128 | *valp = get_unaligned_be64(p); |
| 128 | return p + 2; | 129 | return p + 2; |
| 129 | } | 130 | } |
| 130 | 131 | ||
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index c090df442572..6f9457a75b8f 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h | |||
| @@ -124,6 +124,23 @@ struct rpc_xprt_ops { | |||
| 124 | void (*print_stats)(struct rpc_xprt *xprt, struct seq_file *seq); | 124 | void (*print_stats)(struct rpc_xprt *xprt, struct seq_file *seq); |
| 125 | }; | 125 | }; |
| 126 | 126 | ||
| 127 | /* | ||
| 128 | * RPC transport identifiers | ||
| 129 | * | ||
| 130 | * To preserve compatibility with the historical use of raw IP protocol | ||
| 131 | * id's for transport selection, UDP and TCP identifiers are specified | ||
| 132 | * with the previous values. No such restriction exists for new transports, | ||
| 133 | * except that they may not collide with these values (17 and 6, | ||
| 134 | * respectively). | ||
| 135 | */ | ||
| 136 | #define XPRT_TRANSPORT_BC (1 << 31) | ||
| 137 | enum xprt_transports { | ||
| 138 | XPRT_TRANSPORT_UDP = IPPROTO_UDP, | ||
| 139 | XPRT_TRANSPORT_TCP = IPPROTO_TCP, | ||
| 140 | XPRT_TRANSPORT_BC_TCP = IPPROTO_TCP | XPRT_TRANSPORT_BC, | ||
| 141 | XPRT_TRANSPORT_RDMA = 256 | ||
| 142 | }; | ||
| 143 | |||
| 127 | struct rpc_xprt { | 144 | struct rpc_xprt { |
| 128 | struct kref kref; /* Reference count */ | 145 | struct kref kref; /* Reference count */ |
| 129 | struct rpc_xprt_ops * ops; /* transport methods */ | 146 | struct rpc_xprt_ops * ops; /* transport methods */ |
| @@ -179,6 +196,7 @@ struct rpc_xprt { | |||
| 179 | spinlock_t reserve_lock; /* lock slot table */ | 196 | spinlock_t reserve_lock; /* lock slot table */ |
| 180 | u32 xid; /* Next XID value to use */ | 197 | u32 xid; /* Next XID value to use */ |
| 181 | struct rpc_task * snd_task; /* Task blocked in send */ | 198 | struct rpc_task * snd_task; /* Task blocked in send */ |
| 199 | struct svc_xprt *bc_xprt; /* NFSv4.1 backchannel */ | ||
| 182 | #if defined(CONFIG_NFS_V4_1) | 200 | #if defined(CONFIG_NFS_V4_1) |
| 183 | struct svc_serv *bc_serv; /* The RPC service which will */ | 201 | struct svc_serv *bc_serv; /* The RPC service which will */ |
| 184 | /* process the callback */ | 202 | /* process the callback */ |
| @@ -231,6 +249,7 @@ struct xprt_create { | |||
| 231 | struct sockaddr * srcaddr; /* optional local address */ | 249 | struct sockaddr * srcaddr; /* optional local address */ |
| 232 | struct sockaddr * dstaddr; /* remote peer address */ | 250 | struct sockaddr * dstaddr; /* remote peer address */ |
| 233 | size_t addrlen; | 251 | size_t addrlen; |
| 252 | struct svc_xprt *bc_xprt; /* NFSv4.1 backchannel */ | ||
| 234 | }; | 253 | }; |
| 235 | 254 | ||
| 236 | struct xprt_class { | 255 | struct xprt_class { |
diff --git a/include/linux/sunrpc/xprtrdma.h b/include/linux/sunrpc/xprtrdma.h index 54a379c9e8eb..c2f04e1ae159 100644 --- a/include/linux/sunrpc/xprtrdma.h +++ b/include/linux/sunrpc/xprtrdma.h | |||
| @@ -41,11 +41,6 @@ | |||
| 41 | #define _LINUX_SUNRPC_XPRTRDMA_H | 41 | #define _LINUX_SUNRPC_XPRTRDMA_H |
| 42 | 42 | ||
| 43 | /* | 43 | /* |
| 44 | * RPC transport identifier for RDMA | ||
| 45 | */ | ||
| 46 | #define XPRT_TRANSPORT_RDMA 256 | ||
| 47 | |||
| 48 | /* | ||
| 49 | * rpcbind (v3+) RDMA netid. | 44 | * rpcbind (v3+) RDMA netid. |
| 50 | */ | 45 | */ |
| 51 | #define RPCBIND_NETID_RDMA "rdma" | 46 | #define RPCBIND_NETID_RDMA "rdma" |
diff --git a/include/linux/sunrpc/xprtsock.h b/include/linux/sunrpc/xprtsock.h index c2a46c45c8f7..3f14a02e9cc0 100644 --- a/include/linux/sunrpc/xprtsock.h +++ b/include/linux/sunrpc/xprtsock.h | |||
| @@ -13,17 +13,6 @@ int init_socket_xprt(void); | |||
| 13 | void cleanup_socket_xprt(void); | 13 | void cleanup_socket_xprt(void); |
| 14 | 14 | ||
| 15 | /* | 15 | /* |
| 16 | * RPC transport identifiers for UDP, TCP | ||
| 17 | * | ||
| 18 | * To preserve compatibility with the historical use of raw IP protocol | ||
| 19 | * id's for transport selection, these are specified with the previous | ||
| 20 | * values. No such restriction exists for new transports, except that | ||
| 21 | * they may not collide with these values (17 and 6, respectively). | ||
| 22 | */ | ||
| 23 | #define XPRT_TRANSPORT_UDP IPPROTO_UDP | ||
| 24 | #define XPRT_TRANSPORT_TCP IPPROTO_TCP | ||
| 25 | |||
| 26 | /* | ||
| 27 | * RPC slot table sizes for UDP, TCP transports | 16 | * RPC slot table sizes for UDP, TCP transports |
| 28 | */ | 17 | */ |
| 29 | extern unsigned int xprt_udp_slot_table_entries; | 18 | extern unsigned int xprt_udp_slot_table_entries; |
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index cd15df6c63cd..5e781d824e6d 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h | |||
| @@ -301,6 +301,8 @@ static inline int unregister_pm_notifier(struct notifier_block *nb) | |||
| 301 | #define pm_notifier(fn, pri) do { (void)(fn); } while (0) | 301 | #define pm_notifier(fn, pri) do { (void)(fn); } while (0) |
| 302 | #endif /* !CONFIG_PM_SLEEP */ | 302 | #endif /* !CONFIG_PM_SLEEP */ |
| 303 | 303 | ||
| 304 | extern struct mutex pm_mutex; | ||
| 305 | |||
| 304 | #ifndef CONFIG_HIBERNATION | 306 | #ifndef CONFIG_HIBERNATION |
| 305 | static inline void register_nosave_region(unsigned long b, unsigned long e) | 307 | static inline void register_nosave_region(unsigned long b, unsigned long e) |
| 306 | { | 308 | { |
| @@ -308,8 +310,23 @@ static inline void register_nosave_region(unsigned long b, unsigned long e) | |||
| 308 | static inline void register_nosave_region_late(unsigned long b, unsigned long e) | 310 | static inline void register_nosave_region_late(unsigned long b, unsigned long e) |
| 309 | { | 311 | { |
| 310 | } | 312 | } |
| 311 | #endif | ||
| 312 | 313 | ||
| 313 | extern struct mutex pm_mutex; | 314 | static inline void lock_system_sleep(void) {} |
| 315 | static inline void unlock_system_sleep(void) {} | ||
| 316 | |||
| 317 | #else | ||
| 318 | |||
| 319 | /* Let some subsystems like memory hotadd exclude hibernation */ | ||
| 320 | |||
| 321 | static inline void lock_system_sleep(void) | ||
| 322 | { | ||
| 323 | mutex_lock(&pm_mutex); | ||
| 324 | } | ||
| 325 | |||
| 326 | static inline void unlock_system_sleep(void) | ||
| 327 | { | ||
| 328 | mutex_unlock(&pm_mutex); | ||
| 329 | } | ||
| 330 | #endif | ||
| 314 | 331 | ||
| 315 | #endif /* _LINUX_SUSPEND_H */ | 332 | #endif /* _LINUX_SUSPEND_H */ |
diff --git a/include/linux/swap.h b/include/linux/swap.h index 7c15334f3ff2..4ec90019c1a4 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
| @@ -34,15 +34,37 @@ static inline int current_is_kswapd(void) | |||
| 34 | * the type/offset into the pte as 5/27 as well. | 34 | * the type/offset into the pte as 5/27 as well. |
| 35 | */ | 35 | */ |
| 36 | #define MAX_SWAPFILES_SHIFT 5 | 36 | #define MAX_SWAPFILES_SHIFT 5 |
| 37 | #ifndef CONFIG_MIGRATION | 37 | |
| 38 | #define MAX_SWAPFILES (1 << MAX_SWAPFILES_SHIFT) | 38 | /* |
| 39 | * Use some of the swap files numbers for other purposes. This | ||
| 40 | * is a convenient way to hook into the VM to trigger special | ||
| 41 | * actions on faults. | ||
| 42 | */ | ||
| 43 | |||
| 44 | /* | ||
| 45 | * NUMA node memory migration support | ||
| 46 | */ | ||
| 47 | #ifdef CONFIG_MIGRATION | ||
| 48 | #define SWP_MIGRATION_NUM 2 | ||
| 49 | #define SWP_MIGRATION_READ (MAX_SWAPFILES + SWP_HWPOISON_NUM) | ||
| 50 | #define SWP_MIGRATION_WRITE (MAX_SWAPFILES + SWP_HWPOISON_NUM + 1) | ||
| 51 | #else | ||
| 52 | #define SWP_MIGRATION_NUM 0 | ||
| 53 | #endif | ||
| 54 | |||
| 55 | /* | ||
| 56 | * Handling of hardware poisoned pages with memory corruption. | ||
| 57 | */ | ||
| 58 | #ifdef CONFIG_MEMORY_FAILURE | ||
| 59 | #define SWP_HWPOISON_NUM 1 | ||
| 60 | #define SWP_HWPOISON MAX_SWAPFILES | ||
| 39 | #else | 61 | #else |
| 40 | /* Use last two entries for page migration swap entries */ | 62 | #define SWP_HWPOISON_NUM 0 |
| 41 | #define MAX_SWAPFILES ((1 << MAX_SWAPFILES_SHIFT)-2) | ||
| 42 | #define SWP_MIGRATION_READ MAX_SWAPFILES | ||
| 43 | #define SWP_MIGRATION_WRITE (MAX_SWAPFILES + 1) | ||
| 44 | #endif | 63 | #endif |
| 45 | 64 | ||
| 65 | #define MAX_SWAPFILES \ | ||
| 66 | ((1 << MAX_SWAPFILES_SHIFT) - SWP_MIGRATION_NUM - SWP_HWPOISON_NUM) | ||
| 67 | |||
| 46 | /* | 68 | /* |
| 47 | * Magic header for a swap area. The first part of the union is | 69 | * Magic header for a swap area. The first part of the union is |
| 48 | * what the swap magic looks like for the old (limited to 128MB) | 70 | * what the swap magic looks like for the old (limited to 128MB) |
| @@ -217,6 +239,11 @@ extern unsigned long try_to_free_pages(struct zonelist *zonelist, int order, | |||
| 217 | extern unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem, | 239 | extern unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem, |
| 218 | gfp_t gfp_mask, bool noswap, | 240 | gfp_t gfp_mask, bool noswap, |
| 219 | unsigned int swappiness); | 241 | unsigned int swappiness); |
| 242 | extern unsigned long mem_cgroup_shrink_node_zone(struct mem_cgroup *mem, | ||
| 243 | gfp_t gfp_mask, bool noswap, | ||
| 244 | unsigned int swappiness, | ||
| 245 | struct zone *zone, | ||
| 246 | int nid); | ||
| 220 | extern int __isolate_lru_page(struct page *page, int mode, int file); | 247 | extern int __isolate_lru_page(struct page *page, int mode, int file); |
| 221 | extern unsigned long shrink_all_memory(unsigned long nr_pages); | 248 | extern unsigned long shrink_all_memory(unsigned long nr_pages); |
| 222 | extern int vm_swappiness; | 249 | extern int vm_swappiness; |
| @@ -240,7 +267,7 @@ extern int page_evictable(struct page *page, struct vm_area_struct *vma); | |||
| 240 | extern void scan_mapping_unevictable_pages(struct address_space *); | 267 | extern void scan_mapping_unevictable_pages(struct address_space *); |
| 241 | 268 | ||
| 242 | extern unsigned long scan_unevictable_pages; | 269 | extern unsigned long scan_unevictable_pages; |
| 243 | extern int scan_unevictable_handler(struct ctl_table *, int, struct file *, | 270 | extern int scan_unevictable_handler(struct ctl_table *, int, |
| 244 | void __user *, size_t *, loff_t *); | 271 | void __user *, size_t *, loff_t *); |
| 245 | extern int scan_unevictable_register_node(struct node *node); | 272 | extern int scan_unevictable_register_node(struct node *node); |
| 246 | extern void scan_unevictable_unregister_node(struct node *node); | 273 | extern void scan_unevictable_unregister_node(struct node *node); |
| @@ -419,10 +446,22 @@ static inline swp_entry_t get_swap_page(void) | |||
| 419 | } | 446 | } |
| 420 | 447 | ||
| 421 | /* linux/mm/thrash.c */ | 448 | /* linux/mm/thrash.c */ |
| 422 | #define put_swap_token(mm) do { } while (0) | 449 | static inline void put_swap_token(struct mm_struct *mm) |
| 423 | #define grab_swap_token(mm) do { } while (0) | 450 | { |
| 424 | #define has_swap_token(mm) 0 | 451 | } |
| 425 | #define disable_swap_token() do { } while (0) | 452 | |
| 453 | static inline void grab_swap_token(struct mm_struct *mm) | ||
| 454 | { | ||
| 455 | } | ||
| 456 | |||
| 457 | static inline int has_swap_token(struct mm_struct *mm) | ||
| 458 | { | ||
| 459 | return 0; | ||
| 460 | } | ||
| 461 | |||
| 462 | static inline void disable_swap_token(void) | ||
| 463 | { | ||
| 464 | } | ||
| 426 | 465 | ||
| 427 | static inline void | 466 | static inline void |
| 428 | mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent) | 467 | mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent) |
diff --git a/include/linux/swapops.h b/include/linux/swapops.h index 6ec39ab27b4b..cd42e30b7c6e 100644 --- a/include/linux/swapops.h +++ b/include/linux/swapops.h | |||
| @@ -131,3 +131,41 @@ static inline int is_write_migration_entry(swp_entry_t entry) | |||
| 131 | 131 | ||
| 132 | #endif | 132 | #endif |
| 133 | 133 | ||
| 134 | #ifdef CONFIG_MEMORY_FAILURE | ||
| 135 | /* | ||
| 136 | * Support for hardware poisoned pages | ||
| 137 | */ | ||
| 138 | static inline swp_entry_t make_hwpoison_entry(struct page *page) | ||
| 139 | { | ||
| 140 | BUG_ON(!PageLocked(page)); | ||
| 141 | return swp_entry(SWP_HWPOISON, page_to_pfn(page)); | ||
| 142 | } | ||
| 143 | |||
| 144 | static inline int is_hwpoison_entry(swp_entry_t entry) | ||
| 145 | { | ||
| 146 | return swp_type(entry) == SWP_HWPOISON; | ||
| 147 | } | ||
| 148 | #else | ||
| 149 | |||
| 150 | static inline swp_entry_t make_hwpoison_entry(struct page *page) | ||
| 151 | { | ||
| 152 | return swp_entry(0, 0); | ||
| 153 | } | ||
| 154 | |||
| 155 | static inline int is_hwpoison_entry(swp_entry_t swp) | ||
| 156 | { | ||
| 157 | return 0; | ||
| 158 | } | ||
| 159 | #endif | ||
| 160 | |||
| 161 | #if defined(CONFIG_MEMORY_FAILURE) || defined(CONFIG_MIGRATION) | ||
| 162 | static inline int non_swap_entry(swp_entry_t entry) | ||
| 163 | { | ||
| 164 | return swp_type(entry) >= MAX_SWAPFILES; | ||
| 165 | } | ||
| 166 | #else | ||
| 167 | static inline int non_swap_entry(swp_entry_t entry) | ||
| 168 | { | ||
| 169 | return 0; | ||
| 170 | } | ||
| 171 | #endif | ||
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h index 73b1f1cec423..febedcf67c7e 100644 --- a/include/linux/swiotlb.h +++ b/include/linux/swiotlb.h | |||
| @@ -7,6 +7,8 @@ struct device; | |||
| 7 | struct dma_attrs; | 7 | struct dma_attrs; |
| 8 | struct scatterlist; | 8 | struct scatterlist; |
| 9 | 9 | ||
| 10 | extern int swiotlb_force; | ||
| 11 | |||
| 10 | /* | 12 | /* |
| 11 | * Maximum allowable number of contiguous slabs to map, | 13 | * Maximum allowable number of contiguous slabs to map, |
| 12 | * must be a power of 2. What is the appropriate value ? | 14 | * must be a power of 2. What is the appropriate value ? |
| @@ -20,8 +22,7 @@ struct scatterlist; | |||
| 20 | */ | 22 | */ |
| 21 | #define IO_TLB_SHIFT 11 | 23 | #define IO_TLB_SHIFT 11 |
| 22 | 24 | ||
| 23 | extern void | 25 | extern void swiotlb_init(int verbose); |
| 24 | swiotlb_init(void); | ||
| 25 | 26 | ||
| 26 | extern void | 27 | extern void |
| 27 | *swiotlb_alloc_coherent(struct device *hwdev, size_t size, | 28 | *swiotlb_alloc_coherent(struct device *hwdev, size_t size, |
| @@ -88,4 +89,11 @@ swiotlb_dma_mapping_error(struct device *hwdev, dma_addr_t dma_addr); | |||
| 88 | extern int | 89 | extern int |
| 89 | swiotlb_dma_supported(struct device *hwdev, u64 mask); | 90 | swiotlb_dma_supported(struct device *hwdev, u64 mask); |
| 90 | 91 | ||
| 92 | #ifdef CONFIG_SWIOTLB | ||
| 93 | extern void __init swiotlb_free(void); | ||
| 94 | #else | ||
| 95 | static inline void swiotlb_free(void) { } | ||
| 96 | #endif | ||
| 97 | |||
| 98 | extern void swiotlb_print_info(void); | ||
| 91 | #endif /* __LINUX_SWIOTLB_H */ | 99 | #endif /* __LINUX_SWIOTLB_H */ |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index a8e37821cc60..e79e2f3ccc51 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
| @@ -55,7 +55,7 @@ struct compat_timeval; | |||
| 55 | struct robust_list_head; | 55 | struct robust_list_head; |
| 56 | struct getcpu_cache; | 56 | struct getcpu_cache; |
| 57 | struct old_linux_dirent; | 57 | struct old_linux_dirent; |
| 58 | struct perf_counter_attr; | 58 | struct perf_event_attr; |
| 59 | 59 | ||
| 60 | #include <linux/types.h> | 60 | #include <linux/types.h> |
| 61 | #include <linux/aio_abi.h> | 61 | #include <linux/aio_abi.h> |
| @@ -99,45 +99,16 @@ struct perf_counter_attr; | |||
| 99 | #define __SC_TEST6(t6, a6, ...) __SC_TEST(t6); __SC_TEST5(__VA_ARGS__) | 99 | #define __SC_TEST6(t6, a6, ...) __SC_TEST(t6); __SC_TEST5(__VA_ARGS__) |
| 100 | 100 | ||
| 101 | #ifdef CONFIG_EVENT_PROFILE | 101 | #ifdef CONFIG_EVENT_PROFILE |
| 102 | #define TRACE_SYS_ENTER_PROFILE(sname) \ | ||
| 103 | static int prof_sysenter_enable_##sname(struct ftrace_event_call *event_call) \ | ||
| 104 | { \ | ||
| 105 | int ret = 0; \ | ||
| 106 | if (!atomic_inc_return(&event_enter_##sname.profile_count)) \ | ||
| 107 | ret = reg_prof_syscall_enter("sys"#sname); \ | ||
| 108 | return ret; \ | ||
| 109 | } \ | ||
| 110 | \ | ||
| 111 | static void prof_sysenter_disable_##sname(struct ftrace_event_call *event_call)\ | ||
| 112 | { \ | ||
| 113 | if (atomic_add_negative(-1, &event_enter_##sname.profile_count)) \ | ||
| 114 | unreg_prof_syscall_enter("sys"#sname); \ | ||
| 115 | } | ||
| 116 | |||
| 117 | #define TRACE_SYS_EXIT_PROFILE(sname) \ | ||
| 118 | static int prof_sysexit_enable_##sname(struct ftrace_event_call *event_call) \ | ||
| 119 | { \ | ||
| 120 | int ret = 0; \ | ||
| 121 | if (!atomic_inc_return(&event_exit_##sname.profile_count)) \ | ||
| 122 | ret = reg_prof_syscall_exit("sys"#sname); \ | ||
| 123 | return ret; \ | ||
| 124 | } \ | ||
| 125 | \ | ||
| 126 | static void prof_sysexit_disable_##sname(struct ftrace_event_call *event_call) \ | ||
| 127 | { \ | ||
| 128 | if (atomic_add_negative(-1, &event_exit_##sname.profile_count)) \ | ||
| 129 | unreg_prof_syscall_exit("sys"#sname); \ | ||
| 130 | } | ||
| 131 | 102 | ||
| 132 | #define TRACE_SYS_ENTER_PROFILE_INIT(sname) \ | 103 | #define TRACE_SYS_ENTER_PROFILE_INIT(sname) \ |
| 133 | .profile_count = ATOMIC_INIT(-1), \ | 104 | .profile_count = ATOMIC_INIT(-1), \ |
| 134 | .profile_enable = prof_sysenter_enable_##sname, \ | 105 | .profile_enable = prof_sysenter_enable, \ |
| 135 | .profile_disable = prof_sysenter_disable_##sname, | 106 | .profile_disable = prof_sysenter_disable, |
| 136 | 107 | ||
| 137 | #define TRACE_SYS_EXIT_PROFILE_INIT(sname) \ | 108 | #define TRACE_SYS_EXIT_PROFILE_INIT(sname) \ |
| 138 | .profile_count = ATOMIC_INIT(-1), \ | 109 | .profile_count = ATOMIC_INIT(-1), \ |
| 139 | .profile_enable = prof_sysexit_enable_##sname, \ | 110 | .profile_enable = prof_sysexit_enable, \ |
| 140 | .profile_disable = prof_sysexit_disable_##sname, | 111 | .profile_disable = prof_sysexit_disable, |
| 141 | #else | 112 | #else |
| 142 | #define TRACE_SYS_ENTER_PROFILE(sname) | 113 | #define TRACE_SYS_ENTER_PROFILE(sname) |
| 143 | #define TRACE_SYS_ENTER_PROFILE_INIT(sname) | 114 | #define TRACE_SYS_ENTER_PROFILE_INIT(sname) |
| @@ -161,74 +132,46 @@ static void prof_sysexit_disable_##sname(struct ftrace_event_call *event_call) \ | |||
| 161 | #define __SC_STR_TDECL6(t, a, ...) #t, __SC_STR_TDECL5(__VA_ARGS__) | 132 | #define __SC_STR_TDECL6(t, a, ...) #t, __SC_STR_TDECL5(__VA_ARGS__) |
| 162 | 133 | ||
| 163 | #define SYSCALL_TRACE_ENTER_EVENT(sname) \ | 134 | #define SYSCALL_TRACE_ENTER_EVENT(sname) \ |
| 135 | static const struct syscall_metadata __syscall_meta_##sname; \ | ||
| 164 | static struct ftrace_event_call event_enter_##sname; \ | 136 | static struct ftrace_event_call event_enter_##sname; \ |
| 165 | struct trace_event enter_syscall_print_##sname = { \ | 137 | static struct trace_event enter_syscall_print_##sname = { \ |
| 166 | .trace = print_syscall_enter, \ | 138 | .trace = print_syscall_enter, \ |
| 167 | }; \ | 139 | }; \ |
| 168 | static int init_enter_##sname(void) \ | ||
| 169 | { \ | ||
| 170 | int num, id; \ | ||
| 171 | num = syscall_name_to_nr("sys"#sname); \ | ||
| 172 | if (num < 0) \ | ||
| 173 | return -ENOSYS; \ | ||
| 174 | id = register_ftrace_event(&enter_syscall_print_##sname);\ | ||
| 175 | if (!id) \ | ||
| 176 | return -ENODEV; \ | ||
| 177 | event_enter_##sname.id = id; \ | ||
| 178 | set_syscall_enter_id(num, id); \ | ||
| 179 | INIT_LIST_HEAD(&event_enter_##sname.fields); \ | ||
| 180 | return 0; \ | ||
| 181 | } \ | ||
| 182 | TRACE_SYS_ENTER_PROFILE(sname); \ | ||
| 183 | static struct ftrace_event_call __used \ | 140 | static struct ftrace_event_call __used \ |
| 184 | __attribute__((__aligned__(4))) \ | 141 | __attribute__((__aligned__(4))) \ |
| 185 | __attribute__((section("_ftrace_events"))) \ | 142 | __attribute__((section("_ftrace_events"))) \ |
| 186 | event_enter_##sname = { \ | 143 | event_enter_##sname = { \ |
| 187 | .name = "sys_enter"#sname, \ | 144 | .name = "sys_enter"#sname, \ |
| 188 | .system = "syscalls", \ | 145 | .system = "syscalls", \ |
| 189 | .event = &event_syscall_enter, \ | 146 | .event = &enter_syscall_print_##sname, \ |
| 190 | .raw_init = init_enter_##sname, \ | 147 | .raw_init = init_syscall_trace, \ |
| 191 | .show_format = syscall_enter_format, \ | 148 | .show_format = syscall_enter_format, \ |
| 192 | .define_fields = syscall_enter_define_fields, \ | 149 | .define_fields = syscall_enter_define_fields, \ |
| 193 | .regfunc = reg_event_syscall_enter, \ | 150 | .regfunc = reg_event_syscall_enter, \ |
| 194 | .unregfunc = unreg_event_syscall_enter, \ | 151 | .unregfunc = unreg_event_syscall_enter, \ |
| 195 | .data = "sys"#sname, \ | 152 | .data = (void *)&__syscall_meta_##sname,\ |
| 196 | TRACE_SYS_ENTER_PROFILE_INIT(sname) \ | 153 | TRACE_SYS_ENTER_PROFILE_INIT(sname) \ |
| 197 | } | 154 | } |
| 198 | 155 | ||
| 199 | #define SYSCALL_TRACE_EXIT_EVENT(sname) \ | 156 | #define SYSCALL_TRACE_EXIT_EVENT(sname) \ |
| 157 | static const struct syscall_metadata __syscall_meta_##sname; \ | ||
| 200 | static struct ftrace_event_call event_exit_##sname; \ | 158 | static struct ftrace_event_call event_exit_##sname; \ |
| 201 | struct trace_event exit_syscall_print_##sname = { \ | 159 | static struct trace_event exit_syscall_print_##sname = { \ |
| 202 | .trace = print_syscall_exit, \ | 160 | .trace = print_syscall_exit, \ |
| 203 | }; \ | 161 | }; \ |
| 204 | static int init_exit_##sname(void) \ | ||
| 205 | { \ | ||
| 206 | int num, id; \ | ||
| 207 | num = syscall_name_to_nr("sys"#sname); \ | ||
| 208 | if (num < 0) \ | ||
| 209 | return -ENOSYS; \ | ||
| 210 | id = register_ftrace_event(&exit_syscall_print_##sname);\ | ||
| 211 | if (!id) \ | ||
| 212 | return -ENODEV; \ | ||
| 213 | event_exit_##sname.id = id; \ | ||
| 214 | set_syscall_exit_id(num, id); \ | ||
| 215 | INIT_LIST_HEAD(&event_exit_##sname.fields); \ | ||
| 216 | return 0; \ | ||
| 217 | } \ | ||
| 218 | TRACE_SYS_EXIT_PROFILE(sname); \ | ||
| 219 | static struct ftrace_event_call __used \ | 162 | static struct ftrace_event_call __used \ |
| 220 | __attribute__((__aligned__(4))) \ | 163 | __attribute__((__aligned__(4))) \ |
| 221 | __attribute__((section("_ftrace_events"))) \ | 164 | __attribute__((section("_ftrace_events"))) \ |
| 222 | event_exit_##sname = { \ | 165 | event_exit_##sname = { \ |
| 223 | .name = "sys_exit"#sname, \ | 166 | .name = "sys_exit"#sname, \ |
| 224 | .system = "syscalls", \ | 167 | .system = "syscalls", \ |
| 225 | .event = &event_syscall_exit, \ | 168 | .event = &exit_syscall_print_##sname, \ |
| 226 | .raw_init = init_exit_##sname, \ | 169 | .raw_init = init_syscall_trace, \ |
| 227 | .show_format = syscall_exit_format, \ | 170 | .show_format = syscall_exit_format, \ |
| 228 | .define_fields = syscall_exit_define_fields, \ | 171 | .define_fields = syscall_exit_define_fields, \ |
| 229 | .regfunc = reg_event_syscall_exit, \ | 172 | .regfunc = reg_event_syscall_exit, \ |
| 230 | .unregfunc = unreg_event_syscall_exit, \ | 173 | .unregfunc = unreg_event_syscall_exit, \ |
| 231 | .data = "sys"#sname, \ | 174 | .data = (void *)&__syscall_meta_##sname,\ |
| 232 | TRACE_SYS_EXIT_PROFILE_INIT(sname) \ | 175 | TRACE_SYS_EXIT_PROFILE_INIT(sname) \ |
| 233 | } | 176 | } |
| 234 | 177 | ||
| @@ -468,8 +411,7 @@ asmlinkage long sys_mount(char __user *dev_name, char __user *dir_name, | |||
| 468 | void __user *data); | 411 | void __user *data); |
| 469 | asmlinkage long sys_umount(char __user *name, int flags); | 412 | asmlinkage long sys_umount(char __user *name, int flags); |
| 470 | asmlinkage long sys_oldumount(char __user *name); | 413 | asmlinkage long sys_oldumount(char __user *name); |
| 471 | asmlinkage long sys_truncate(const char __user *path, | 414 | asmlinkage long sys_truncate(const char __user *path, long length); |
| 472 | unsigned long length); | ||
| 473 | asmlinkage long sys_ftruncate(unsigned int fd, unsigned long length); | 415 | asmlinkage long sys_ftruncate(unsigned int fd, unsigned long length); |
| 474 | asmlinkage long sys_stat(char __user *filename, | 416 | asmlinkage long sys_stat(char __user *filename, |
| 475 | struct __old_kernel_stat __user *statbuf); | 417 | struct __old_kernel_stat __user *statbuf); |
| @@ -885,7 +827,7 @@ asmlinkage long sys_ppoll(struct pollfd __user *, unsigned int, | |||
| 885 | int kernel_execve(const char *filename, char *const argv[], char *const envp[]); | 827 | int kernel_execve(const char *filename, char *const argv[], char *const envp[]); |
| 886 | 828 | ||
| 887 | 829 | ||
| 888 | asmlinkage long sys_perf_counter_open( | 830 | asmlinkage long sys_perf_event_open( |
| 889 | struct perf_counter_attr __user *attr_uptr, | 831 | struct perf_event_attr __user *attr_uptr, |
| 890 | pid_t pid, int cpu, int group_fd, unsigned long flags); | 832 | pid_t pid, int cpu, int group_fd, unsigned long flags); |
| 891 | #endif | 833 | #endif |
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index e76d3b22a466..1e4743ee6831 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h | |||
| @@ -29,7 +29,6 @@ | |||
| 29 | #include <linux/types.h> | 29 | #include <linux/types.h> |
| 30 | #include <linux/compiler.h> | 30 | #include <linux/compiler.h> |
| 31 | 31 | ||
| 32 | struct file; | ||
| 33 | struct completion; | 32 | struct completion; |
| 34 | 33 | ||
| 35 | #define CTL_MAXNAME 10 /* how many path components do we allow in a | 34 | #define CTL_MAXNAME 10 /* how many path components do we allow in a |
| @@ -977,25 +976,25 @@ typedef int ctl_handler (struct ctl_table *table, | |||
| 977 | void __user *oldval, size_t __user *oldlenp, | 976 | void __user *oldval, size_t __user *oldlenp, |
| 978 | void __user *newval, size_t newlen); | 977 | void __user *newval, size_t newlen); |
| 979 | 978 | ||
| 980 | typedef int proc_handler (struct ctl_table *ctl, int write, struct file * filp, | 979 | typedef int proc_handler (struct ctl_table *ctl, int write, |
| 981 | void __user *buffer, size_t *lenp, loff_t *ppos); | 980 | void __user *buffer, size_t *lenp, loff_t *ppos); |
| 982 | 981 | ||
| 983 | extern int proc_dostring(struct ctl_table *, int, struct file *, | 982 | extern int proc_dostring(struct ctl_table *, int, |
| 984 | void __user *, size_t *, loff_t *); | 983 | void __user *, size_t *, loff_t *); |
| 985 | extern int proc_dointvec(struct ctl_table *, int, struct file *, | 984 | extern int proc_dointvec(struct ctl_table *, int, |
| 986 | void __user *, size_t *, loff_t *); | 985 | void __user *, size_t *, loff_t *); |
| 987 | extern int proc_dointvec_minmax(struct ctl_table *, int, struct file *, | 986 | extern int proc_dointvec_minmax(struct ctl_table *, int, |
| 988 | void __user *, size_t *, loff_t *); | 987 | void __user *, size_t *, loff_t *); |
| 989 | extern int proc_dointvec_jiffies(struct ctl_table *, int, struct file *, | 988 | extern int proc_dointvec_jiffies(struct ctl_table *, int, |
| 990 | void __user *, size_t *, loff_t *); | 989 | void __user *, size_t *, loff_t *); |
| 991 | extern int proc_dointvec_userhz_jiffies(struct ctl_table *, int, struct file *, | 990 | extern int proc_dointvec_userhz_jiffies(struct ctl_table *, int, |
| 992 | void __user *, size_t *, loff_t *); | 991 | void __user *, size_t *, loff_t *); |
| 993 | extern int proc_dointvec_ms_jiffies(struct ctl_table *, int, struct file *, | 992 | extern int proc_dointvec_ms_jiffies(struct ctl_table *, int, |
| 994 | void __user *, size_t *, loff_t *); | 993 | void __user *, size_t *, loff_t *); |
| 995 | extern int proc_doulongvec_minmax(struct ctl_table *, int, struct file *, | 994 | extern int proc_doulongvec_minmax(struct ctl_table *, int, |
| 996 | void __user *, size_t *, loff_t *); | 995 | void __user *, size_t *, loff_t *); |
| 997 | extern int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int, | 996 | extern int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int, |
| 998 | struct file *, void __user *, size_t *, loff_t *); | 997 | void __user *, size_t *, loff_t *); |
| 999 | 998 | ||
| 1000 | extern int do_sysctl (int __user *name, int nlen, | 999 | extern int do_sysctl (int __user *name, int nlen, |
| 1001 | void __user *oldval, size_t __user *oldlenp, | 1000 | void __user *oldval, size_t __user *oldlenp, |
diff --git a/include/linux/taskstats_kern.h b/include/linux/taskstats_kern.h index 7e9680f4afdd..3398f4553269 100644 --- a/include/linux/taskstats_kern.h +++ b/include/linux/taskstats_kern.h | |||
| @@ -9,7 +9,6 @@ | |||
| 9 | 9 | ||
| 10 | #include <linux/taskstats.h> | 10 | #include <linux/taskstats.h> |
| 11 | #include <linux/sched.h> | 11 | #include <linux/sched.h> |
| 12 | #include <net/genetlink.h> | ||
| 13 | 12 | ||
| 14 | #ifdef CONFIG_TASKSTATS | 13 | #ifdef CONFIG_TASKSTATS |
| 15 | extern struct kmem_cache *taskstats_cache; | 14 | extern struct kmem_cache *taskstats_cache; |
diff --git a/include/linux/tboot.h b/include/linux/tboot.h new file mode 100644 index 000000000000..bf2a0c748878 --- /dev/null +++ b/include/linux/tboot.h | |||
| @@ -0,0 +1,162 @@ | |||
| 1 | /* | ||
| 2 | * tboot.h: shared data structure with tboot and kernel and functions | ||
| 3 | * used by kernel for runtime support of Intel(R) Trusted | ||
| 4 | * Execution Technology | ||
| 5 | * | ||
| 6 | * Copyright (c) 2006-2009, Intel Corporation | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify it | ||
| 9 | * under the terms and conditions of the GNU General Public License, | ||
| 10 | * version 2, as published by the Free Software Foundation. | ||
| 11 | * | ||
| 12 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
| 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 14 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| 15 | * more details. | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License along with | ||
| 18 | * this program; if not, write to the Free Software Foundation, Inc., | ||
| 19 | * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 20 | * | ||
| 21 | */ | ||
| 22 | |||
| 23 | #ifndef _LINUX_TBOOT_H | ||
| 24 | #define _LINUX_TBOOT_H | ||
| 25 | |||
| 26 | /* these must have the values from 0-5 in this order */ | ||
| 27 | enum { | ||
| 28 | TB_SHUTDOWN_REBOOT = 0, | ||
| 29 | TB_SHUTDOWN_S5, | ||
| 30 | TB_SHUTDOWN_S4, | ||
| 31 | TB_SHUTDOWN_S3, | ||
| 32 | TB_SHUTDOWN_HALT, | ||
| 33 | TB_SHUTDOWN_WFS | ||
| 34 | }; | ||
| 35 | |||
| 36 | #ifdef CONFIG_INTEL_TXT | ||
| 37 | #include <acpi/acpi.h> | ||
| 38 | /* used to communicate between tboot and the launched kernel */ | ||
| 39 | |||
| 40 | #define TB_KEY_SIZE 64 /* 512 bits */ | ||
| 41 | |||
| 42 | #define MAX_TB_MAC_REGIONS 32 | ||
| 43 | |||
| 44 | struct tboot_mac_region { | ||
| 45 | u64 start; /* must be 64 byte -aligned */ | ||
| 46 | u32 size; /* must be 64 byte -granular */ | ||
| 47 | } __packed; | ||
| 48 | |||
| 49 | /* GAS - Generic Address Structure (ACPI 2.0+) */ | ||
| 50 | struct tboot_acpi_generic_address { | ||
| 51 | u8 space_id; | ||
| 52 | u8 bit_width; | ||
| 53 | u8 bit_offset; | ||
| 54 | u8 access_width; | ||
| 55 | u64 address; | ||
| 56 | } __packed; | ||
| 57 | |||
| 58 | /* | ||
| 59 | * combines Sx info from FADT and FACS tables per ACPI 2.0+ spec | ||
| 60 | * (http://www.acpi.info/) | ||
| 61 | */ | ||
| 62 | struct tboot_acpi_sleep_info { | ||
| 63 | struct tboot_acpi_generic_address pm1a_cnt_blk; | ||
| 64 | struct tboot_acpi_generic_address pm1b_cnt_blk; | ||
| 65 | struct tboot_acpi_generic_address pm1a_evt_blk; | ||
| 66 | struct tboot_acpi_generic_address pm1b_evt_blk; | ||
| 67 | u16 pm1a_cnt_val; | ||
| 68 | u16 pm1b_cnt_val; | ||
| 69 | u64 wakeup_vector; | ||
| 70 | u32 vector_width; | ||
| 71 | u64 kernel_s3_resume_vector; | ||
| 72 | } __packed; | ||
| 73 | |||
| 74 | /* | ||
| 75 | * shared memory page used for communication between tboot and kernel | ||
| 76 | */ | ||
| 77 | struct tboot { | ||
| 78 | /* | ||
| 79 | * version 3+ fields: | ||
| 80 | */ | ||
| 81 | |||
| 82 | /* TBOOT_UUID */ | ||
| 83 | u8 uuid[16]; | ||
| 84 | |||
| 85 | /* version number: 5 is current */ | ||
| 86 | u32 version; | ||
| 87 | |||
| 88 | /* physical addr of tb_log_t log */ | ||
| 89 | u32 log_addr; | ||
| 90 | |||
| 91 | /* | ||
| 92 | * physical addr of entry point for tboot shutdown and | ||
| 93 | * type of shutdown (TB_SHUTDOWN_*) being requested | ||
| 94 | */ | ||
| 95 | u32 shutdown_entry; | ||
| 96 | u32 shutdown_type; | ||
| 97 | |||
| 98 | /* kernel-specified ACPI info for Sx shutdown */ | ||
| 99 | struct tboot_acpi_sleep_info acpi_sinfo; | ||
| 100 | |||
| 101 | /* tboot location in memory (physical) */ | ||
| 102 | u32 tboot_base; | ||
| 103 | u32 tboot_size; | ||
| 104 | |||
| 105 | /* memory regions (phys addrs) for tboot to MAC on S3 */ | ||
| 106 | u8 num_mac_regions; | ||
| 107 | struct tboot_mac_region mac_regions[MAX_TB_MAC_REGIONS]; | ||
| 108 | |||
| 109 | |||
| 110 | /* | ||
| 111 | * version 4+ fields: | ||
| 112 | */ | ||
| 113 | |||
| 114 | /* symmetric key for use by kernel; will be encrypted on S3 */ | ||
| 115 | u8 s3_key[TB_KEY_SIZE]; | ||
| 116 | |||
| 117 | |||
| 118 | /* | ||
| 119 | * version 5+ fields: | ||
| 120 | */ | ||
| 121 | |||
| 122 | /* used to 4byte-align num_in_wfs */ | ||
| 123 | u8 reserved_align[3]; | ||
| 124 | |||
| 125 | /* number of processors in wait-for-SIPI */ | ||
| 126 | u32 num_in_wfs; | ||
| 127 | } __packed; | ||
| 128 | |||
| 129 | /* | ||
| 130 | * UUID for tboot data struct to facilitate matching | ||
| 131 | * defined as {663C8DFF-E8B3-4b82-AABF-19EA4D057A08} by tboot, which is | ||
| 132 | * represented as {} in the char array used here | ||
| 133 | */ | ||
| 134 | #define TBOOT_UUID {0xff, 0x8d, 0x3c, 0x66, 0xb3, 0xe8, 0x82, 0x4b, 0xbf,\ | ||
| 135 | 0xaa, 0x19, 0xea, 0x4d, 0x5, 0x7a, 0x8} | ||
| 136 | |||
| 137 | extern struct tboot *tboot; | ||
| 138 | |||
| 139 | static inline int tboot_enabled(void) | ||
| 140 | { | ||
| 141 | return tboot != NULL; | ||
| 142 | } | ||
| 143 | |||
| 144 | extern void tboot_probe(void); | ||
| 145 | extern void tboot_shutdown(u32 shutdown_type); | ||
| 146 | extern void tboot_sleep(u8 sleep_state, u32 pm1a_control, u32 pm1b_control); | ||
| 147 | extern struct acpi_table_header *tboot_get_dmar_table( | ||
| 148 | struct acpi_table_header *dmar_tbl); | ||
| 149 | extern int tboot_force_iommu(void); | ||
| 150 | |||
| 151 | #else | ||
| 152 | |||
| 153 | #define tboot_probe() do { } while (0) | ||
| 154 | #define tboot_shutdown(shutdown_type) do { } while (0) | ||
| 155 | #define tboot_sleep(sleep_state, pm1a_control, pm1b_control) \ | ||
| 156 | do { } while (0) | ||
| 157 | #define tboot_get_dmar_table(dmar_tbl) (dmar_tbl) | ||
| 158 | #define tboot_force_iommu() 0 | ||
| 159 | |||
| 160 | #endif /* !CONFIG_INTEL_TXT */ | ||
| 161 | |||
| 162 | #endif /* _LINUX_TBOOT_H */ | ||
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 8afac76cd748..61723a7c21fe 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h | |||
| @@ -233,7 +233,7 @@ struct tcp_request_sock { | |||
| 233 | struct inet_request_sock req; | 233 | struct inet_request_sock req; |
| 234 | #ifdef CONFIG_TCP_MD5SIG | 234 | #ifdef CONFIG_TCP_MD5SIG |
| 235 | /* Only used by TCP MD5 Signature so far. */ | 235 | /* Only used by TCP MD5 Signature so far. */ |
| 236 | struct tcp_request_sock_ops *af_specific; | 236 | const struct tcp_request_sock_ops *af_specific; |
| 237 | #endif | 237 | #endif |
| 238 | u32 rcv_isn; | 238 | u32 rcv_isn; |
| 239 | u32 snt_isn; | 239 | u32 snt_isn; |
| @@ -401,9 +401,9 @@ struct tcp_sock { | |||
| 401 | 401 | ||
| 402 | #ifdef CONFIG_TCP_MD5SIG | 402 | #ifdef CONFIG_TCP_MD5SIG |
| 403 | /* TCP AF-Specific parts; only used by MD5 Signature support so far */ | 403 | /* TCP AF-Specific parts; only used by MD5 Signature support so far */ |
| 404 | struct tcp_sock_af_ops *af_specific; | 404 | const struct tcp_sock_af_ops *af_specific; |
| 405 | 405 | ||
| 406 | /* TCP MD5 Signagure Option information */ | 406 | /* TCP MD5 Signature Option information */ |
| 407 | struct tcp_md5sig_info *md5sig_info; | 407 | struct tcp_md5sig_info *md5sig_info; |
| 408 | #endif | 408 | #endif |
| 409 | }; | 409 | }; |
diff --git a/include/linux/time.h b/include/linux/time.h index ea16c1a01d51..fe04e5ef6a59 100644 --- a/include/linux/time.h +++ b/include/linux/time.h | |||
| @@ -75,7 +75,7 @@ extern unsigned long mktime(const unsigned int year, const unsigned int mon, | |||
| 75 | const unsigned int day, const unsigned int hour, | 75 | const unsigned int day, const unsigned int hour, |
| 76 | const unsigned int min, const unsigned int sec); | 76 | const unsigned int min, const unsigned int sec); |
| 77 | 77 | ||
| 78 | extern void set_normalized_timespec(struct timespec *ts, time_t sec, long nsec); | 78 | extern void set_normalized_timespec(struct timespec *ts, time_t sec, s64 nsec); |
| 79 | extern struct timespec timespec_add_safe(const struct timespec lhs, | 79 | extern struct timespec timespec_add_safe(const struct timespec lhs, |
| 80 | const struct timespec rhs); | 80 | const struct timespec rhs); |
| 81 | 81 | ||
| @@ -101,7 +101,8 @@ extern struct timespec xtime; | |||
| 101 | extern struct timespec wall_to_monotonic; | 101 | extern struct timespec wall_to_monotonic; |
| 102 | extern seqlock_t xtime_lock; | 102 | extern seqlock_t xtime_lock; |
| 103 | 103 | ||
| 104 | extern unsigned long read_persistent_clock(void); | 104 | extern void read_persistent_clock(struct timespec *ts); |
| 105 | extern void read_boot_clock(struct timespec *ts); | ||
| 105 | extern int update_persistent_clock(struct timespec now); | 106 | extern int update_persistent_clock(struct timespec now); |
| 106 | extern int no_sync_cmos_clock __read_mostly; | 107 | extern int no_sync_cmos_clock __read_mostly; |
| 107 | void timekeeping_init(void); | 108 | void timekeeping_init(void); |
| @@ -109,6 +110,8 @@ extern int timekeeping_suspended; | |||
| 109 | 110 | ||
| 110 | unsigned long get_seconds(void); | 111 | unsigned long get_seconds(void); |
| 111 | struct timespec current_kernel_time(void); | 112 | struct timespec current_kernel_time(void); |
| 113 | struct timespec __current_kernel_time(void); /* does not hold xtime_lock */ | ||
| 114 | struct timespec get_monotonic_coarse(void); | ||
| 112 | 115 | ||
| 113 | #define CURRENT_TIME (current_kernel_time()) | 116 | #define CURRENT_TIME (current_kernel_time()) |
| 114 | #define CURRENT_TIME_SEC ((struct timespec) { get_seconds(), 0 }) | 117 | #define CURRENT_TIME_SEC ((struct timespec) { get_seconds(), 0 }) |
| @@ -147,10 +150,39 @@ extern struct timespec timespec_trunc(struct timespec t, unsigned gran); | |||
| 147 | extern int timekeeping_valid_for_hres(void); | 150 | extern int timekeeping_valid_for_hres(void); |
| 148 | extern void update_wall_time(void); | 151 | extern void update_wall_time(void); |
| 149 | extern void update_xtime_cache(u64 nsec); | 152 | extern void update_xtime_cache(u64 nsec); |
| 153 | extern void timekeeping_leap_insert(int leapsecond); | ||
| 150 | 154 | ||
| 151 | struct tms; | 155 | struct tms; |
| 152 | extern void do_sys_times(struct tms *); | 156 | extern void do_sys_times(struct tms *); |
| 153 | 157 | ||
| 158 | /* | ||
| 159 | * Similar to the struct tm in userspace <time.h>, but it needs to be here so | ||
| 160 | * that the kernel source is self contained. | ||
| 161 | */ | ||
| 162 | struct tm { | ||
| 163 | /* | ||
| 164 | * the number of seconds after the minute, normally in the range | ||
| 165 | * 0 to 59, but can be up to 60 to allow for leap seconds | ||
| 166 | */ | ||
| 167 | int tm_sec; | ||
| 168 | /* the number of minutes after the hour, in the range 0 to 59*/ | ||
| 169 | int tm_min; | ||
| 170 | /* the number of hours past midnight, in the range 0 to 23 */ | ||
| 171 | int tm_hour; | ||
| 172 | /* the day of the month, in the range 1 to 31 */ | ||
| 173 | int tm_mday; | ||
| 174 | /* the number of months since January, in the range 0 to 11 */ | ||
| 175 | int tm_mon; | ||
| 176 | /* the number of years since 1900 */ | ||
| 177 | long tm_year; | ||
| 178 | /* the number of days since Sunday, in the range 0 to 6 */ | ||
| 179 | int tm_wday; | ||
| 180 | /* the number of days since January 1, in the range 0 to 365 */ | ||
| 181 | int tm_yday; | ||
| 182 | }; | ||
| 183 | |||
| 184 | void time_to_tm(time_t totalsecs, int offset, struct tm *result); | ||
| 185 | |||
| 154 | /** | 186 | /** |
| 155 | * timespec_to_ns - Convert timespec to nanoseconds | 187 | * timespec_to_ns - Convert timespec to nanoseconds |
| 156 | * @ts: pointer to the timespec variable to be converted | 188 | * @ts: pointer to the timespec variable to be converted |
| @@ -241,6 +273,8 @@ struct itimerval { | |||
| 241 | #define CLOCK_PROCESS_CPUTIME_ID 2 | 273 | #define CLOCK_PROCESS_CPUTIME_ID 2 |
| 242 | #define CLOCK_THREAD_CPUTIME_ID 3 | 274 | #define CLOCK_THREAD_CPUTIME_ID 3 |
| 243 | #define CLOCK_MONOTONIC_RAW 4 | 275 | #define CLOCK_MONOTONIC_RAW 4 |
| 276 | #define CLOCK_REALTIME_COARSE 5 | ||
| 277 | #define CLOCK_MONOTONIC_COARSE 6 | ||
| 244 | 278 | ||
| 245 | /* | 279 | /* |
| 246 | * The IDs of various hardware clocks: | 280 | * The IDs of various hardware clocks: |
diff --git a/include/linux/timer.h b/include/linux/timer.h index be62ec2ebea5..a2d1eb6cb3f0 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h | |||
| @@ -175,11 +175,6 @@ extern int mod_timer_pinned(struct timer_list *timer, unsigned long expires); | |||
| 175 | 175 | ||
| 176 | /* | 176 | /* |
| 177 | * Return when the next timer-wheel timeout occurs (in absolute jiffies), | 177 | * Return when the next timer-wheel timeout occurs (in absolute jiffies), |
| 178 | * locks the timer base: | ||
| 179 | */ | ||
| 180 | extern unsigned long next_timer_interrupt(void); | ||
| 181 | /* | ||
| 182 | * Return when the next timer-wheel timeout occurs (in absolute jiffies), | ||
| 183 | * locks the timer base and does the comparison against the given | 178 | * locks the timer base and does the comparison against the given |
| 184 | * jiffie. | 179 | * jiffie. |
| 185 | */ | 180 | */ |
diff --git a/include/linux/tipc.h b/include/linux/tipc.h index bea469455a0c..3d92396639de 100644 --- a/include/linux/tipc.h +++ b/include/linux/tipc.h | |||
| @@ -209,5 +209,7 @@ struct sockaddr_tipc { | |||
| 209 | #define TIPC_SRC_DROPPABLE 128 /* Default: 0 (resend congested msg) */ | 209 | #define TIPC_SRC_DROPPABLE 128 /* Default: 0 (resend congested msg) */ |
| 210 | #define TIPC_DEST_DROPPABLE 129 /* Default: based on socket type */ | 210 | #define TIPC_DEST_DROPPABLE 129 /* Default: based on socket type */ |
| 211 | #define TIPC_CONN_TIMEOUT 130 /* Default: 8000 (ms) */ | 211 | #define TIPC_CONN_TIMEOUT 130 /* Default: 8000 (ms) */ |
| 212 | #define TIPC_NODE_RECVQ_DEPTH 131 /* Default: none (read only) */ | ||
| 213 | #define TIPC_SOCK_RECVQ_DEPTH 132 /* Default: none (read only) */ | ||
| 212 | 214 | ||
| 213 | #endif | 215 | #endif |
diff --git a/include/linux/topology.h b/include/linux/topology.h index 85e8cf7d393c..57e63579bfdd 100644 --- a/include/linux/topology.h +++ b/include/linux/topology.h | |||
| @@ -95,14 +95,12 @@ int arch_update_cpu_topology(void); | |||
| 95 | | 1*SD_BALANCE_NEWIDLE \ | 95 | | 1*SD_BALANCE_NEWIDLE \ |
| 96 | | 1*SD_BALANCE_EXEC \ | 96 | | 1*SD_BALANCE_EXEC \ |
| 97 | | 1*SD_BALANCE_FORK \ | 97 | | 1*SD_BALANCE_FORK \ |
| 98 | | 0*SD_WAKE_IDLE \ | 98 | | 0*SD_BALANCE_WAKE \ |
| 99 | | 1*SD_WAKE_AFFINE \ | 99 | | 1*SD_WAKE_AFFINE \ |
| 100 | | 1*SD_WAKE_BALANCE \ | ||
| 101 | | 1*SD_SHARE_CPUPOWER \ | 100 | | 1*SD_SHARE_CPUPOWER \ |
| 102 | | 0*SD_POWERSAVINGS_BALANCE \ | 101 | | 0*SD_POWERSAVINGS_BALANCE \ |
| 103 | | 0*SD_SHARE_PKG_RESOURCES \ | 102 | | 0*SD_SHARE_PKG_RESOURCES \ |
| 104 | | 0*SD_SERIALIZE \ | 103 | | 0*SD_SERIALIZE \ |
| 105 | | 0*SD_WAKE_IDLE_FAR \ | ||
| 106 | | 0*SD_PREFER_SIBLING \ | 104 | | 0*SD_PREFER_SIBLING \ |
| 107 | , \ | 105 | , \ |
| 108 | .last_balance = jiffies, \ | 106 | .last_balance = jiffies, \ |
| @@ -122,20 +120,19 @@ int arch_update_cpu_topology(void); | |||
| 122 | .imbalance_pct = 125, \ | 120 | .imbalance_pct = 125, \ |
| 123 | .cache_nice_tries = 1, \ | 121 | .cache_nice_tries = 1, \ |
| 124 | .busy_idx = 2, \ | 122 | .busy_idx = 2, \ |
| 125 | .wake_idx = 1, \ | 123 | .wake_idx = 0, \ |
| 126 | .forkexec_idx = 1, \ | 124 | .forkexec_idx = 0, \ |
| 127 | \ | 125 | \ |
| 128 | .flags = 1*SD_LOAD_BALANCE \ | 126 | .flags = 1*SD_LOAD_BALANCE \ |
| 129 | | 1*SD_BALANCE_NEWIDLE \ | 127 | | 1*SD_BALANCE_NEWIDLE \ |
| 130 | | 1*SD_BALANCE_EXEC \ | 128 | | 1*SD_BALANCE_EXEC \ |
| 131 | | 1*SD_BALANCE_FORK \ | 129 | | 1*SD_BALANCE_FORK \ |
| 132 | | 1*SD_WAKE_IDLE \ | 130 | | 0*SD_BALANCE_WAKE \ |
| 133 | | 1*SD_WAKE_AFFINE \ | 131 | | 1*SD_WAKE_AFFINE \ |
| 134 | | 1*SD_WAKE_BALANCE \ | 132 | | 0*SD_PREFER_LOCAL \ |
| 135 | | 0*SD_SHARE_CPUPOWER \ | 133 | | 0*SD_SHARE_CPUPOWER \ |
| 136 | | 1*SD_SHARE_PKG_RESOURCES \ | 134 | | 1*SD_SHARE_PKG_RESOURCES \ |
| 137 | | 0*SD_SERIALIZE \ | 135 | | 0*SD_SERIALIZE \ |
| 138 | | 0*SD_WAKE_IDLE_FAR \ | ||
| 139 | | sd_balance_for_mc_power() \ | 136 | | sd_balance_for_mc_power() \ |
| 140 | | sd_power_saving_flags() \ | 137 | | sd_power_saving_flags() \ |
| 141 | , \ | 138 | , \ |
| @@ -155,21 +152,20 @@ int arch_update_cpu_topology(void); | |||
| 155 | .cache_nice_tries = 1, \ | 152 | .cache_nice_tries = 1, \ |
| 156 | .busy_idx = 2, \ | 153 | .busy_idx = 2, \ |
| 157 | .idle_idx = 1, \ | 154 | .idle_idx = 1, \ |
| 158 | .newidle_idx = 2, \ | 155 | .newidle_idx = 0, \ |
| 159 | .wake_idx = 1, \ | 156 | .wake_idx = 0, \ |
| 160 | .forkexec_idx = 1, \ | 157 | .forkexec_idx = 0, \ |
| 161 | \ | 158 | \ |
| 162 | .flags = 1*SD_LOAD_BALANCE \ | 159 | .flags = 1*SD_LOAD_BALANCE \ |
| 163 | | 1*SD_BALANCE_NEWIDLE \ | 160 | | 1*SD_BALANCE_NEWIDLE \ |
| 164 | | 1*SD_BALANCE_EXEC \ | 161 | | 1*SD_BALANCE_EXEC \ |
| 165 | | 1*SD_BALANCE_FORK \ | 162 | | 1*SD_BALANCE_FORK \ |
| 166 | | 1*SD_WAKE_IDLE \ | 163 | | 0*SD_BALANCE_WAKE \ |
| 167 | | 0*SD_WAKE_AFFINE \ | 164 | | 1*SD_WAKE_AFFINE \ |
| 168 | | 1*SD_WAKE_BALANCE \ | 165 | | 0*SD_PREFER_LOCAL \ |
| 169 | | 0*SD_SHARE_CPUPOWER \ | 166 | | 0*SD_SHARE_CPUPOWER \ |
| 170 | | 0*SD_SHARE_PKG_RESOURCES \ | 167 | | 0*SD_SHARE_PKG_RESOURCES \ |
| 171 | | 0*SD_SERIALIZE \ | 168 | | 0*SD_SERIALIZE \ |
| 172 | | 0*SD_WAKE_IDLE_FAR \ | ||
| 173 | | sd_balance_for_package_power() \ | 169 | | sd_balance_for_package_power() \ |
| 174 | | sd_power_saving_flags() \ | 170 | | sd_power_saving_flags() \ |
| 175 | , \ | 171 | , \ |
| @@ -191,14 +187,12 @@ int arch_update_cpu_topology(void); | |||
| 191 | | 1*SD_BALANCE_NEWIDLE \ | 187 | | 1*SD_BALANCE_NEWIDLE \ |
| 192 | | 0*SD_BALANCE_EXEC \ | 188 | | 0*SD_BALANCE_EXEC \ |
| 193 | | 0*SD_BALANCE_FORK \ | 189 | | 0*SD_BALANCE_FORK \ |
| 194 | | 0*SD_WAKE_IDLE \ | 190 | | 0*SD_BALANCE_WAKE \ |
| 195 | | 1*SD_WAKE_AFFINE \ | 191 | | 0*SD_WAKE_AFFINE \ |
| 196 | | 0*SD_WAKE_BALANCE \ | ||
| 197 | | 0*SD_SHARE_CPUPOWER \ | 192 | | 0*SD_SHARE_CPUPOWER \ |
| 198 | | 0*SD_POWERSAVINGS_BALANCE \ | 193 | | 0*SD_POWERSAVINGS_BALANCE \ |
| 199 | | 0*SD_SHARE_PKG_RESOURCES \ | 194 | | 0*SD_SHARE_PKG_RESOURCES \ |
| 200 | | 1*SD_SERIALIZE \ | 195 | | 1*SD_SERIALIZE \ |
| 201 | | 1*SD_WAKE_IDLE_FAR \ | ||
| 202 | | 0*SD_PREFER_SIBLING \ | 196 | | 0*SD_PREFER_SIBLING \ |
| 203 | , \ | 197 | , \ |
| 204 | .last_balance = jiffies, \ | 198 | .last_balance = jiffies, \ |
| @@ -217,12 +211,6 @@ int arch_update_cpu_topology(void); | |||
| 217 | #ifndef topology_core_id | 211 | #ifndef topology_core_id |
| 218 | #define topology_core_id(cpu) ((void)(cpu), 0) | 212 | #define topology_core_id(cpu) ((void)(cpu), 0) |
| 219 | #endif | 213 | #endif |
| 220 | #ifndef topology_thread_siblings | ||
| 221 | #define topology_thread_siblings(cpu) cpumask_of_cpu(cpu) | ||
| 222 | #endif | ||
| 223 | #ifndef topology_core_siblings | ||
| 224 | #define topology_core_siblings(cpu) cpumask_of_cpu(cpu) | ||
| 225 | #endif | ||
| 226 | #ifndef topology_thread_cpumask | 214 | #ifndef topology_thread_cpumask |
| 227 | #define topology_thread_cpumask(cpu) cpumask_of(cpu) | 215 | #define topology_thread_cpumask(cpu) cpumask_of(cpu) |
| 228 | #endif | 216 | #endif |
diff --git a/include/linux/tpm.h b/include/linux/tpm.h index 3338b3f5c21a..ac5d1c1285d9 100644 --- a/include/linux/tpm.h +++ b/include/linux/tpm.h | |||
| @@ -27,9 +27,16 @@ | |||
| 27 | */ | 27 | */ |
| 28 | #define TPM_ANY_NUM 0xFFFF | 28 | #define TPM_ANY_NUM 0xFFFF |
| 29 | 29 | ||
| 30 | #if defined(CONFIG_TCG_TPM) | 30 | #if defined(CONFIG_TCG_TPM) || defined(CONFIG_TCG_TPM_MODULE) |
| 31 | 31 | ||
| 32 | extern int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf); | 32 | extern int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf); |
| 33 | extern int tpm_pcr_extend(u32 chip_num, int pcr_idx, const u8 *hash); | 33 | extern int tpm_pcr_extend(u32 chip_num, int pcr_idx, const u8 *hash); |
| 34 | #else | ||
| 35 | static inline int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf) { | ||
| 36 | return -ENODEV; | ||
| 37 | } | ||
| 38 | static inline int tpm_pcr_extend(u32 chip_num, int pcr_idx, const u8 *hash) { | ||
| 39 | return -ENODEV; | ||
| 40 | } | ||
| 34 | #endif | 41 | #endif |
| 35 | #endif | 42 | #endif |
diff --git a/include/linux/trace_seq.h b/include/linux/trace_seq.h index c134dd1fe6b6..09077f6ed128 100644 --- a/include/linux/trace_seq.h +++ b/include/linux/trace_seq.h | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | 7 | ||
| 8 | /* | 8 | /* |
| 9 | * Trace sequences are used to allow a function to call several other functions | 9 | * Trace sequences are used to allow a function to call several other functions |
| 10 | * to create a string of data to use (up to a max of PAGE_SIZE. | 10 | * to create a string of data to use (up to a max of PAGE_SIZE). |
| 11 | */ | 11 | */ |
| 12 | 12 | ||
| 13 | struct trace_seq { | 13 | struct trace_seq { |
diff --git a/include/linux/tracehook.h b/include/linux/tracehook.h index 17ba82efa483..1eb44a924e56 100644 --- a/include/linux/tracehook.h +++ b/include/linux/tracehook.h | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Tracing hooks | 2 | * Tracing hooks |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2008 Red Hat, Inc. All rights reserved. | 4 | * Copyright (C) 2008-2009 Red Hat, Inc. All rights reserved. |
| 5 | * | 5 | * |
| 6 | * This copyrighted material is made available to anyone wishing to use, | 6 | * This copyrighted material is made available to anyone wishing to use, |
| 7 | * modify, copy, or redistribute it subject to the terms and conditions | 7 | * modify, copy, or redistribute it subject to the terms and conditions |
| @@ -463,22 +463,38 @@ static inline int tracehook_get_signal(struct task_struct *task, | |||
| 463 | 463 | ||
| 464 | /** | 464 | /** |
| 465 | * tracehook_notify_jctl - report about job control stop/continue | 465 | * tracehook_notify_jctl - report about job control stop/continue |
| 466 | * @notify: nonzero if this is the last thread in the group to stop | 466 | * @notify: zero, %CLD_STOPPED or %CLD_CONTINUED |
| 467 | * @why: %CLD_STOPPED or %CLD_CONTINUED | 467 | * @why: %CLD_STOPPED or %CLD_CONTINUED |
| 468 | * | 468 | * |
| 469 | * This is called when we might call do_notify_parent_cldstop(). | 469 | * This is called when we might call do_notify_parent_cldstop(). |
| 470 | * It's called when about to stop for job control; we are already in | ||
| 471 | * %TASK_STOPPED state, about to call schedule(). It's also called when | ||
| 472 | * a delayed %CLD_STOPPED or %CLD_CONTINUED report is ready to be made. | ||
| 473 | * | 470 | * |
| 474 | * Return nonzero to generate a %SIGCHLD with @why, which is | 471 | * @notify is zero if we would not ordinarily send a %SIGCHLD, |
| 475 | * normal if @notify is nonzero. | 472 | * or is the %CLD_STOPPED or %CLD_CONTINUED .si_code for %SIGCHLD. |
| 476 | * | 473 | * |
| 477 | * Called with no locks held. | 474 | * @why is %CLD_STOPPED when about to stop for job control; |
| 475 | * we are already in %TASK_STOPPED state, about to call schedule(). | ||
| 476 | * It might also be that we have just exited (check %PF_EXITING), | ||
| 477 | * but need to report that a group-wide stop is complete. | ||
| 478 | * | ||
| 479 | * @why is %CLD_CONTINUED when waking up after job control stop and | ||
| 480 | * ready to make a delayed @notify report. | ||
| 481 | * | ||
| 482 | * Return the %CLD_* value for %SIGCHLD, or zero to generate no signal. | ||
| 483 | * | ||
| 484 | * Called with the siglock held. | ||
| 478 | */ | 485 | */ |
| 479 | static inline int tracehook_notify_jctl(int notify, int why) | 486 | static inline int tracehook_notify_jctl(int notify, int why) |
| 480 | { | 487 | { |
| 481 | return notify || (current->ptrace & PT_PTRACED); | 488 | return notify ?: (current->ptrace & PT_PTRACED) ? why : 0; |
| 489 | } | ||
| 490 | |||
| 491 | /** | ||
| 492 | * tracehook_finish_jctl - report about return from job control stop | ||
| 493 | * | ||
| 494 | * This is called by do_signal_stop() after wakeup. | ||
| 495 | */ | ||
| 496 | static inline void tracehook_finish_jctl(void) | ||
| 497 | { | ||
| 482 | } | 498 | } |
| 483 | 499 | ||
| 484 | #define DEATH_REAP -1 | 500 | #define DEATH_REAP -1 |
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index 63a3f7a80580..f59604ed0ec6 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | /* | 4 | /* |
| 5 | * Kernel Tracepoint API. | 5 | * Kernel Tracepoint API. |
| 6 | * | 6 | * |
| 7 | * See Documentation/tracepoint.txt. | 7 | * See Documentation/trace/tracepoints.txt. |
| 8 | * | 8 | * |
| 9 | * (C) Copyright 2008 Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> | 9 | * (C) Copyright 2008 Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> |
| 10 | * | 10 | * |
| @@ -36,7 +36,7 @@ struct tracepoint { | |||
| 36 | #ifndef DECLARE_TRACE | 36 | #ifndef DECLARE_TRACE |
| 37 | 37 | ||
| 38 | #define TP_PROTO(args...) args | 38 | #define TP_PROTO(args...) args |
| 39 | #define TP_ARGS(args...) args | 39 | #define TP_ARGS(args...) args |
| 40 | 40 | ||
| 41 | #ifdef CONFIG_TRACEPOINTS | 41 | #ifdef CONFIG_TRACEPOINTS |
| 42 | 42 | ||
| @@ -280,6 +280,12 @@ static inline void tracepoint_synchronize_unregister(void) | |||
| 280 | * TRACE_EVENT_FN to perform any (un)registration work. | 280 | * TRACE_EVENT_FN to perform any (un)registration work. |
| 281 | */ | 281 | */ |
| 282 | 282 | ||
| 283 | #define DECLARE_EVENT_CLASS(name, proto, args, tstruct, assign, print) | ||
| 284 | #define DEFINE_EVENT(template, name, proto, args) \ | ||
| 285 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) | ||
| 286 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ | ||
| 287 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) | ||
| 288 | |||
| 283 | #define TRACE_EVENT(name, proto, args, struct, assign, print) \ | 289 | #define TRACE_EVENT(name, proto, args, struct, assign, print) \ |
| 284 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) | 290 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) |
| 285 | #define TRACE_EVENT_FN(name, proto, args, struct, \ | 291 | #define TRACE_EVENT_FN(name, proto, args, struct, \ |
diff --git a/include/linux/transport_class.h b/include/linux/transport_class.h index eaec1ea9558e..9ae8da3e6407 100644 --- a/include/linux/transport_class.h +++ b/include/linux/transport_class.h | |||
| @@ -55,7 +55,7 @@ struct anon_transport_class cls = { \ | |||
| 55 | 55 | ||
| 56 | struct transport_container { | 56 | struct transport_container { |
| 57 | struct attribute_container ac; | 57 | struct attribute_container ac; |
| 58 | struct attribute_group *statistics; | 58 | const struct attribute_group *statistics; |
| 59 | }; | 59 | }; |
| 60 | 60 | ||
| 61 | #define attribute_container_to_transport_container(x) \ | 61 | #define attribute_container_to_transport_container(x) \ |
diff --git a/include/linux/tty.h b/include/linux/tty.h index 0d3974f59c53..f0f43d08d8b8 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
| @@ -187,7 +187,12 @@ struct tty_port; | |||
| 187 | struct tty_port_operations { | 187 | struct tty_port_operations { |
| 188 | /* Return 1 if the carrier is raised */ | 188 | /* Return 1 if the carrier is raised */ |
| 189 | int (*carrier_raised)(struct tty_port *port); | 189 | int (*carrier_raised)(struct tty_port *port); |
| 190 | /* Control the DTR line */ | ||
| 190 | void (*dtr_rts)(struct tty_port *port, int raise); | 191 | void (*dtr_rts)(struct tty_port *port, int raise); |
| 192 | /* Called when the last close completes or a hangup finishes | ||
| 193 | IFF the port was initialized. Do not use to free resources */ | ||
| 194 | void (*shutdown)(struct tty_port *port); | ||
| 195 | void (*drop)(struct tty_port *port); | ||
| 191 | }; | 196 | }; |
| 192 | 197 | ||
| 193 | struct tty_port { | 198 | struct tty_port { |
| @@ -198,11 +203,12 @@ struct tty_port { | |||
| 198 | int count; /* Usage count */ | 203 | int count; /* Usage count */ |
| 199 | wait_queue_head_t open_wait; /* Open waiters */ | 204 | wait_queue_head_t open_wait; /* Open waiters */ |
| 200 | wait_queue_head_t close_wait; /* Close waiters */ | 205 | wait_queue_head_t close_wait; /* Close waiters */ |
| 206 | wait_queue_head_t delta_msr_wait; /* Modem status change */ | ||
| 201 | unsigned long flags; /* TTY flags ASY_*/ | 207 | unsigned long flags; /* TTY flags ASY_*/ |
| 202 | struct mutex mutex; /* Locking */ | 208 | struct mutex mutex; /* Locking */ |
| 203 | unsigned char *xmit_buf; /* Optional buffer */ | 209 | unsigned char *xmit_buf; /* Optional buffer */ |
| 204 | int close_delay; /* Close port delay */ | 210 | unsigned int close_delay; /* Close port delay */ |
| 205 | int closing_wait; /* Delay for output */ | 211 | unsigned int closing_wait; /* Delay for output */ |
| 206 | int drain_delay; /* Set to zero if no pure time | 212 | int drain_delay; /* Set to zero if no pure time |
| 207 | based drain is needed else | 213 | based drain is needed else |
| 208 | set to size of fifo */ | 214 | set to size of fifo */ |
| @@ -459,6 +465,12 @@ extern int tty_port_block_til_ready(struct tty_port *port, | |||
| 459 | extern int tty_port_close_start(struct tty_port *port, | 465 | extern int tty_port_close_start(struct tty_port *port, |
| 460 | struct tty_struct *tty, struct file *filp); | 466 | struct tty_struct *tty, struct file *filp); |
| 461 | extern void tty_port_close_end(struct tty_port *port, struct tty_struct *tty); | 467 | extern void tty_port_close_end(struct tty_port *port, struct tty_struct *tty); |
| 468 | extern void tty_port_close(struct tty_port *port, | ||
| 469 | struct tty_struct *tty, struct file *filp); | ||
| 470 | extern inline int tty_port_users(struct tty_port *port) | ||
| 471 | { | ||
| 472 | return port->count + port->blocked_open; | ||
| 473 | } | ||
| 462 | 474 | ||
| 463 | extern int tty_register_ldisc(int disc, struct tty_ldisc_ops *new_ldisc); | 475 | extern int tty_register_ldisc(int disc, struct tty_ldisc_ops *new_ldisc); |
| 464 | extern int tty_unregister_ldisc(int disc); | 476 | extern int tty_unregister_ldisc(int disc); |
| @@ -519,14 +531,13 @@ extern void serial_console_init(void); | |||
| 519 | 531 | ||
| 520 | extern int pcxe_open(struct tty_struct *tty, struct file *filp); | 532 | extern int pcxe_open(struct tty_struct *tty, struct file *filp); |
| 521 | 533 | ||
| 522 | /* printk.c */ | ||
| 523 | |||
| 524 | extern void console_print(const char *); | ||
| 525 | |||
| 526 | /* vt.c */ | 534 | /* vt.c */ |
| 527 | 535 | ||
| 528 | extern int vt_ioctl(struct tty_struct *tty, struct file *file, | 536 | extern int vt_ioctl(struct tty_struct *tty, struct file *file, |
| 529 | unsigned int cmd, unsigned long arg); | 537 | unsigned int cmd, unsigned long arg); |
| 530 | 538 | ||
| 539 | extern long vt_compat_ioctl(struct tty_struct *tty, struct file * file, | ||
| 540 | unsigned int cmd, unsigned long arg); | ||
| 541 | |||
| 531 | #endif /* __KERNEL__ */ | 542 | #endif /* __KERNEL__ */ |
| 532 | #endif | 543 | #endif |
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h index 3566129384a4..b08677982525 100644 --- a/include/linux/tty_driver.h +++ b/include/linux/tty_driver.h | |||
| @@ -45,8 +45,16 @@ | |||
| 45 | * | 45 | * |
| 46 | * void (*shutdown)(struct tty_struct * tty); | 46 | * void (*shutdown)(struct tty_struct * tty); |
| 47 | * | 47 | * |
| 48 | * This routine is called when a particular tty device is closed for | 48 | * This routine is called synchronously when a particular tty device |
| 49 | * the last time freeing up the resources. | 49 | * is closed for the last time freeing up the resources. |
| 50 | * | ||
| 51 | * | ||
| 52 | * void (*cleanup)(struct tty_struct * tty); | ||
| 53 | * | ||
| 54 | * This routine is called asynchronously when a particular tty device | ||
| 55 | * is closed for the last time freeing up the resources. This is | ||
| 56 | * actually the second part of shutdown for routines that might sleep. | ||
| 57 | * | ||
| 50 | * | 58 | * |
| 51 | * int (*write)(struct tty_struct * tty, | 59 | * int (*write)(struct tty_struct * tty, |
| 52 | * const unsigned char *buf, int count); | 60 | * const unsigned char *buf, int count); |
| @@ -233,6 +241,7 @@ struct tty_operations { | |||
| 233 | int (*open)(struct tty_struct * tty, struct file * filp); | 241 | int (*open)(struct tty_struct * tty, struct file * filp); |
| 234 | void (*close)(struct tty_struct * tty, struct file * filp); | 242 | void (*close)(struct tty_struct * tty, struct file * filp); |
| 235 | void (*shutdown)(struct tty_struct *tty); | 243 | void (*shutdown)(struct tty_struct *tty); |
| 244 | void (*cleanup)(struct tty_struct *tty); | ||
| 236 | int (*write)(struct tty_struct * tty, | 245 | int (*write)(struct tty_struct * tty, |
| 237 | const unsigned char *buf, int count); | 246 | const unsigned char *buf, int count); |
| 238 | int (*put_char)(struct tty_struct *tty, unsigned char ch); | 247 | int (*put_char)(struct tty_struct *tty, unsigned char ch); |
diff --git a/include/linux/ucb1400.h b/include/linux/ucb1400.h index ae779bb8cc0f..adb44066680c 100644 --- a/include/linux/ucb1400.h +++ b/include/linux/ucb1400.h | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | #include <sound/ac97_codec.h> | 26 | #include <sound/ac97_codec.h> |
| 27 | #include <linux/mutex.h> | 27 | #include <linux/mutex.h> |
| 28 | #include <linux/platform_device.h> | 28 | #include <linux/platform_device.h> |
| 29 | #include <linux/gpio.h> | ||
| 29 | 30 | ||
| 30 | /* | 31 | /* |
| 31 | * UCB1400 AC-link registers | 32 | * UCB1400 AC-link registers |
| @@ -82,6 +83,17 @@ | |||
| 82 | #define UCB_ID 0x7e | 83 | #define UCB_ID 0x7e |
| 83 | #define UCB_ID_1400 0x4304 | 84 | #define UCB_ID_1400 0x4304 |
| 84 | 85 | ||
| 86 | struct ucb1400_gpio_data { | ||
| 87 | int gpio_offset; | ||
| 88 | int (*gpio_setup)(struct device *dev, int ngpio); | ||
| 89 | int (*gpio_teardown)(struct device *dev, int ngpio); | ||
| 90 | }; | ||
| 91 | |||
| 92 | struct ucb1400_gpio { | ||
| 93 | struct gpio_chip gc; | ||
| 94 | struct snd_ac97 *ac97; | ||
| 95 | }; | ||
| 96 | |||
| 85 | struct ucb1400_ts { | 97 | struct ucb1400_ts { |
| 86 | struct input_dev *ts_idev; | 98 | struct input_dev *ts_idev; |
| 87 | struct task_struct *ts_task; | 99 | struct task_struct *ts_task; |
| @@ -95,6 +107,7 @@ struct ucb1400_ts { | |||
| 95 | 107 | ||
| 96 | struct ucb1400 { | 108 | struct ucb1400 { |
| 97 | struct platform_device *ucb1400_ts; | 109 | struct platform_device *ucb1400_ts; |
| 110 | struct platform_device *ucb1400_gpio; | ||
| 98 | }; | 111 | }; |
| 99 | 112 | ||
| 100 | static inline u16 ucb1400_reg_read(struct snd_ac97 *ac97, u16 reg) | 113 | static inline u16 ucb1400_reg_read(struct snd_ac97 *ac97, u16 reg) |
| @@ -147,4 +160,10 @@ static inline void ucb1400_adc_disable(struct snd_ac97 *ac97) | |||
| 147 | unsigned int ucb1400_adc_read(struct snd_ac97 *ac97, u16 adc_channel, | 160 | unsigned int ucb1400_adc_read(struct snd_ac97 *ac97, u16 adc_channel, |
| 148 | int adcsync); | 161 | int adcsync); |
| 149 | 162 | ||
| 163 | #ifdef CONFIG_GPIO_UCB1400 | ||
| 164 | void __init ucb1400_gpio_set_data(struct ucb1400_gpio_data *data); | ||
| 165 | #else | ||
| 166 | static inline void ucb1400_gpio_set_data(struct ucb1400_gpio_data *data) {} | ||
| 167 | #endif | ||
| 168 | |||
| 150 | #endif | 169 | #endif |
diff --git a/include/linux/unaligned/be_byteshift.h b/include/linux/unaligned/be_byteshift.h index 46dd12c5709e..9356b24223ac 100644 --- a/include/linux/unaligned/be_byteshift.h +++ b/include/linux/unaligned/be_byteshift.h | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | #ifndef _LINUX_UNALIGNED_BE_BYTESHIFT_H | 1 | #ifndef _LINUX_UNALIGNED_BE_BYTESHIFT_H |
| 2 | #define _LINUX_UNALIGNED_BE_BYTESHIFT_H | 2 | #define _LINUX_UNALIGNED_BE_BYTESHIFT_H |
| 3 | 3 | ||
| 4 | #include <linux/kernel.h> | 4 | #include <linux/types.h> |
| 5 | 5 | ||
| 6 | static inline u16 __get_unaligned_be16(const u8 *p) | 6 | static inline u16 __get_unaligned_be16(const u8 *p) |
| 7 | { | 7 | { |
diff --git a/include/linux/unaligned/le_byteshift.h b/include/linux/unaligned/le_byteshift.h index 59777e951baf..be376fb79b64 100644 --- a/include/linux/unaligned/le_byteshift.h +++ b/include/linux/unaligned/le_byteshift.h | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | #ifndef _LINUX_UNALIGNED_LE_BYTESHIFT_H | 1 | #ifndef _LINUX_UNALIGNED_LE_BYTESHIFT_H |
| 2 | #define _LINUX_UNALIGNED_LE_BYTESHIFT_H | 2 | #define _LINUX_UNALIGNED_LE_BYTESHIFT_H |
| 3 | 3 | ||
| 4 | #include <linux/kernel.h> | 4 | #include <linux/types.h> |
| 5 | 5 | ||
| 6 | static inline u16 __get_unaligned_le16(const u8 *p) | 6 | static inline u16 __get_unaligned_le16(const u8 *p) |
| 7 | { | 7 | { |
diff --git a/include/linux/usb.h b/include/linux/usb.h index b1e3c2fbfe11..a34fa89f1474 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
| @@ -195,7 +195,7 @@ struct usb_interface { | |||
| 195 | 195 | ||
| 196 | struct device dev; /* interface specific device info */ | 196 | struct device dev; /* interface specific device info */ |
| 197 | struct device *usb_dev; | 197 | struct device *usb_dev; |
| 198 | int pm_usage_cnt; /* usage counter for autosuspend */ | 198 | atomic_t pm_usage_cnt; /* usage counter for autosuspend */ |
| 199 | struct work_struct reset_ws; /* for resets in atomic context */ | 199 | struct work_struct reset_ws; /* for resets in atomic context */ |
| 200 | }; | 200 | }; |
| 201 | #define to_usb_interface(d) container_of(d, struct usb_interface, dev) | 201 | #define to_usb_interface(d) container_of(d, struct usb_interface, dev) |
| @@ -551,13 +551,13 @@ extern void usb_autopm_put_interface_async(struct usb_interface *intf); | |||
| 551 | 551 | ||
| 552 | static inline void usb_autopm_enable(struct usb_interface *intf) | 552 | static inline void usb_autopm_enable(struct usb_interface *intf) |
| 553 | { | 553 | { |
| 554 | intf->pm_usage_cnt = 0; | 554 | atomic_set(&intf->pm_usage_cnt, 0); |
| 555 | usb_autopm_set_interface(intf); | 555 | usb_autopm_set_interface(intf); |
| 556 | } | 556 | } |
| 557 | 557 | ||
| 558 | static inline void usb_autopm_disable(struct usb_interface *intf) | 558 | static inline void usb_autopm_disable(struct usb_interface *intf) |
| 559 | { | 559 | { |
| 560 | intf->pm_usage_cnt = 1; | 560 | atomic_set(&intf->pm_usage_cnt, 1); |
| 561 | usb_autopm_set_interface(intf); | 561 | usb_autopm_set_interface(intf); |
| 562 | } | 562 | } |
| 563 | 563 | ||
| @@ -922,7 +922,7 @@ extern struct bus_type usb_bus_type; | |||
| 922 | /** | 922 | /** |
| 923 | * struct usb_class_driver - identifies a USB driver that wants to use the USB major number | 923 | * struct usb_class_driver - identifies a USB driver that wants to use the USB major number |
| 924 | * @name: the usb class device name for this driver. Will show up in sysfs. | 924 | * @name: the usb class device name for this driver. Will show up in sysfs. |
| 925 | * @nodename: Callback to provide a naming hint for a possible | 925 | * @devnode: Callback to provide a naming hint for a possible |
| 926 | * device node to create. | 926 | * device node to create. |
| 927 | * @fops: pointer to the struct file_operations of this driver. | 927 | * @fops: pointer to the struct file_operations of this driver. |
| 928 | * @minor_base: the start of the minor range for this driver. | 928 | * @minor_base: the start of the minor range for this driver. |
| @@ -933,7 +933,7 @@ extern struct bus_type usb_bus_type; | |||
| 933 | */ | 933 | */ |
| 934 | struct usb_class_driver { | 934 | struct usb_class_driver { |
| 935 | char *name; | 935 | char *name; |
| 936 | char *(*nodename)(struct device *dev); | 936 | char *(*devnode)(struct device *dev, mode_t *mode); |
| 937 | const struct file_operations *fops; | 937 | const struct file_operations *fops; |
| 938 | int minor_base; | 938 | int minor_base; |
| 939 | }; | 939 | }; |
| @@ -1036,9 +1036,10 @@ typedef void (*usb_complete_t)(struct urb *); | |||
| 1036 | * @transfer_flags: A variety of flags may be used to affect how URB | 1036 | * @transfer_flags: A variety of flags may be used to affect how URB |
| 1037 | * submission, unlinking, or operation are handled. Different | 1037 | * submission, unlinking, or operation are handled. Different |
| 1038 | * kinds of URB can use different flags. | 1038 | * kinds of URB can use different flags. |
| 1039 | * @transfer_buffer: This identifies the buffer to (or from) which | 1039 | * @transfer_buffer: This identifies the buffer to (or from) which the I/O |
| 1040 | * the I/O request will be performed (unless URB_NO_TRANSFER_DMA_MAP | 1040 | * request will be performed unless URB_NO_TRANSFER_DMA_MAP is set |
| 1041 | * is set). This buffer must be suitable for DMA; allocate it with | 1041 | * (however, do not leave garbage in transfer_buffer even then). |
| 1042 | * This buffer must be suitable for DMA; allocate it with | ||
| 1042 | * kmalloc() or equivalent. For transfers to "in" endpoints, contents | 1043 | * kmalloc() or equivalent. For transfers to "in" endpoints, contents |
| 1043 | * of this buffer will be modified. This buffer is used for the data | 1044 | * of this buffer will be modified. This buffer is used for the data |
| 1044 | * stage of control transfers. | 1045 | * stage of control transfers. |
| @@ -1071,7 +1072,7 @@ typedef void (*usb_complete_t)(struct urb *); | |||
| 1071 | * @start_frame: Returns the initial frame for isochronous transfers. | 1072 | * @start_frame: Returns the initial frame for isochronous transfers. |
| 1072 | * @number_of_packets: Lists the number of ISO transfer buffers. | 1073 | * @number_of_packets: Lists the number of ISO transfer buffers. |
| 1073 | * @interval: Specifies the polling interval for interrupt or isochronous | 1074 | * @interval: Specifies the polling interval for interrupt or isochronous |
| 1074 | * transfers. The units are frames (milliseconds) for for full and low | 1075 | * transfers. The units are frames (milliseconds) for full and low |
| 1075 | * speed devices, and microframes (1/8 millisecond) for highspeed ones. | 1076 | * speed devices, and microframes (1/8 millisecond) for highspeed ones. |
| 1076 | * @error_count: Returns the number of ISO transfers that reported errors. | 1077 | * @error_count: Returns the number of ISO transfers that reported errors. |
| 1077 | * @context: For use in completion functions. This normally points to | 1078 | * @context: For use in completion functions. This normally points to |
| @@ -1104,9 +1105,15 @@ typedef void (*usb_complete_t)(struct urb *); | |||
| 1104 | * allocate a DMA buffer with usb_buffer_alloc() or call usb_buffer_map(). | 1105 | * allocate a DMA buffer with usb_buffer_alloc() or call usb_buffer_map(). |
| 1105 | * When these transfer flags are provided, host controller drivers will | 1106 | * When these transfer flags are provided, host controller drivers will |
| 1106 | * attempt to use the dma addresses found in the transfer_dma and/or | 1107 | * attempt to use the dma addresses found in the transfer_dma and/or |
| 1107 | * setup_dma fields rather than determining a dma address themselves. (Note | 1108 | * setup_dma fields rather than determining a dma address themselves. |
| 1108 | * that transfer_buffer and setup_packet must still be set because not all | 1109 | * |
| 1109 | * host controllers use DMA, nor do virtual root hubs). | 1110 | * Note that transfer_buffer must still be set if the controller |
| 1111 | * does not support DMA (as indicated by bus.uses_dma) and when talking | ||
| 1112 | * to root hub. If you have to trasfer between highmem zone and the device | ||
| 1113 | * on such controller, create a bounce buffer or bail out with an error. | ||
| 1114 | * If transfer_buffer cannot be set (is in highmem) and the controller is DMA | ||
| 1115 | * capable, assign NULL to it, so that usbmon knows not to use the value. | ||
| 1116 | * The setup_packet must always be set, so it cannot be located in highmem. | ||
| 1110 | * | 1117 | * |
| 1111 | * Initialization: | 1118 | * Initialization: |
| 1112 | * | 1119 | * |
diff --git a/include/linux/usb/audio.h b/include/linux/usb/audio.h index b5744bc218ab..eaf9dffe0a01 100644 --- a/include/linux/usb/audio.h +++ b/include/linux/usb/audio.h | |||
| @@ -24,88 +24,78 @@ | |||
| 24 | #define USB_SUBCLASS_AUDIOCONTROL 0x01 | 24 | #define USB_SUBCLASS_AUDIOCONTROL 0x01 |
| 25 | #define USB_SUBCLASS_AUDIOSTREAMING 0x02 | 25 | #define USB_SUBCLASS_AUDIOSTREAMING 0x02 |
| 26 | #define USB_SUBCLASS_MIDISTREAMING 0x03 | 26 | #define USB_SUBCLASS_MIDISTREAMING 0x03 |
| 27 | #define USB_SUBCLASS_VENDOR_SPEC 0xff | 27 | |
| 28 | 28 | /* A.5 Audio Class-Specific AC Interface Descriptor Subtypes */ | |
| 29 | /* A.5 Audio Class-Specific AC interface Descriptor Subtypes*/ | 29 | #define UAC_HEADER 0x01 |
| 30 | #define HEADER 0x01 | 30 | #define UAC_INPUT_TERMINAL 0x02 |
| 31 | #define INPUT_TERMINAL 0x02 | 31 | #define UAC_OUTPUT_TERMINAL 0x03 |
| 32 | #define OUTPUT_TERMINAL 0x03 | 32 | #define UAC_MIXER_UNIT 0x04 |
| 33 | #define MIXER_UNIT 0x04 | 33 | #define UAC_SELECTOR_UNIT 0x05 |
| 34 | #define SELECTOR_UNIT 0x05 | 34 | #define UAC_FEATURE_UNIT 0x06 |
| 35 | #define FEATURE_UNIT 0x06 | 35 | #define UAC_PROCESSING_UNIT 0x07 |
| 36 | #define PROCESSING_UNIT 0x07 | 36 | #define UAC_EXTENSION_UNIT 0x08 |
| 37 | #define EXTENSION_UNIT 0x08 | 37 | |
| 38 | 38 | /* A.6 Audio Class-Specific AS Interface Descriptor Subtypes */ | |
| 39 | #define AS_GENERAL 0x01 | 39 | #define UAC_AS_GENERAL 0x01 |
| 40 | #define FORMAT_TYPE 0x02 | 40 | #define UAC_FORMAT_TYPE 0x02 |
| 41 | #define FORMAT_SPECIFIC 0x03 | 41 | #define UAC_FORMAT_SPECIFIC 0x03 |
| 42 | 42 | ||
| 43 | #define EP_GENERAL 0x01 | 43 | /* A.8 Audio Class-Specific Endpoint Descriptor Subtypes */ |
| 44 | 44 | #define UAC_EP_GENERAL 0x01 | |
| 45 | #define MS_GENERAL 0x01 | 45 | |
| 46 | #define MIDI_IN_JACK 0x02 | 46 | /* A.9 Audio Class-Specific Request Codes */ |
| 47 | #define MIDI_OUT_JACK 0x03 | 47 | #define UAC_SET_ 0x00 |
| 48 | 48 | #define UAC_GET_ 0x80 | |
| 49 | /* endpoint attributes */ | 49 | |
| 50 | #define EP_ATTR_MASK 0x0c | 50 | #define UAC__CUR 0x1 |
| 51 | #define EP_ATTR_ASYNC 0x04 | 51 | #define UAC__MIN 0x2 |
| 52 | #define EP_ATTR_ADAPTIVE 0x08 | 52 | #define UAC__MAX 0x3 |
| 53 | #define EP_ATTR_SYNC 0x0c | 53 | #define UAC__RES 0x4 |
| 54 | 54 | #define UAC__MEM 0x5 | |
| 55 | /* cs endpoint attributes */ | 55 | |
| 56 | #define EP_CS_ATTR_SAMPLE_RATE 0x01 | 56 | #define UAC_SET_CUR (UAC_SET_ | UAC__CUR) |
| 57 | #define EP_CS_ATTR_PITCH_CONTROL 0x02 | 57 | #define UAC_GET_CUR (UAC_GET_ | UAC__CUR) |
| 58 | #define EP_CS_ATTR_FILL_MAX 0x80 | 58 | #define UAC_SET_MIN (UAC_SET_ | UAC__MIN) |
| 59 | 59 | #define UAC_GET_MIN (UAC_GET_ | UAC__MIN) | |
| 60 | /* Audio Class specific Request Codes */ | 60 | #define UAC_SET_MAX (UAC_SET_ | UAC__MAX) |
| 61 | #define USB_AUDIO_SET_INTF 0x21 | 61 | #define UAC_GET_MAX (UAC_GET_ | UAC__MAX) |
| 62 | #define USB_AUDIO_SET_ENDPOINT 0x22 | 62 | #define UAC_SET_RES (UAC_SET_ | UAC__RES) |
| 63 | #define USB_AUDIO_GET_INTF 0xa1 | 63 | #define UAC_GET_RES (UAC_GET_ | UAC__RES) |
| 64 | #define USB_AUDIO_GET_ENDPOINT 0xa2 | 64 | #define UAC_SET_MEM (UAC_SET_ | UAC__MEM) |
| 65 | 65 | #define UAC_GET_MEM (UAC_GET_ | UAC__MEM) | |
| 66 | #define SET_ 0x00 | 66 | |
| 67 | #define GET_ 0x80 | 67 | #define UAC_GET_STAT 0xff |
| 68 | 68 | ||
| 69 | #define _CUR 0x1 | 69 | /* MIDI - A.1 MS Class-Specific Interface Descriptor Subtypes */ |
| 70 | #define _MIN 0x2 | 70 | #define UAC_MS_HEADER 0x01 |
| 71 | #define _MAX 0x3 | 71 | #define UAC_MIDI_IN_JACK 0x02 |
| 72 | #define _RES 0x4 | 72 | #define UAC_MIDI_OUT_JACK 0x03 |
| 73 | #define _MEM 0x5 | 73 | |
| 74 | 74 | /* MIDI - A.1 MS Class-Specific Endpoint Descriptor Subtypes */ | |
| 75 | #define SET_CUR (SET_ | _CUR) | 75 | #define UAC_MS_GENERAL 0x01 |
| 76 | #define GET_CUR (GET_ | _CUR) | 76 | |
| 77 | #define SET_MIN (SET_ | _MIN) | 77 | /* Terminals - 2.1 USB Terminal Types */ |
| 78 | #define GET_MIN (GET_ | _MIN) | 78 | #define UAC_TERMINAL_UNDEFINED 0x100 |
| 79 | #define SET_MAX (SET_ | _MAX) | 79 | #define UAC_TERMINAL_STREAMING 0x101 |
| 80 | #define GET_MAX (GET_ | _MAX) | 80 | #define UAC_TERMINAL_VENDOR_SPEC 0x1FF |
| 81 | #define SET_RES (SET_ | _RES) | ||
| 82 | #define GET_RES (GET_ | _RES) | ||
| 83 | #define SET_MEM (SET_ | _MEM) | ||
| 84 | #define GET_MEM (GET_ | _MEM) | ||
| 85 | |||
| 86 | #define GET_STAT 0xff | ||
| 87 | |||
| 88 | #define USB_AC_TERMINAL_UNDEFINED 0x100 | ||
| 89 | #define USB_AC_TERMINAL_STREAMING 0x101 | ||
| 90 | #define USB_AC_TERMINAL_VENDOR_SPEC 0x1FF | ||
| 91 | 81 | ||
| 92 | /* Terminal Control Selectors */ | 82 | /* Terminal Control Selectors */ |
| 93 | /* 4.3.2 Class-Specific AC Interface Descriptor */ | 83 | /* 4.3.2 Class-Specific AC Interface Descriptor */ |
| 94 | struct usb_ac_header_descriptor { | 84 | struct uac_ac_header_descriptor { |
| 95 | __u8 bLength; /* 8 + n */ | 85 | __u8 bLength; /* 8 + n */ |
| 96 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ | 86 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ |
| 97 | __u8 bDescriptorSubtype; /* USB_MS_HEADER */ | 87 | __u8 bDescriptorSubtype; /* UAC_MS_HEADER */ |
| 98 | __le16 bcdADC; /* 0x0100 */ | 88 | __le16 bcdADC; /* 0x0100 */ |
| 99 | __le16 wTotalLength; /* includes Unit and Terminal desc. */ | 89 | __le16 wTotalLength; /* includes Unit and Terminal desc. */ |
| 100 | __u8 bInCollection; /* n */ | 90 | __u8 bInCollection; /* n */ |
| 101 | __u8 baInterfaceNr[]; /* [n] */ | 91 | __u8 baInterfaceNr[]; /* [n] */ |
| 102 | } __attribute__ ((packed)); | 92 | } __attribute__ ((packed)); |
| 103 | 93 | ||
| 104 | #define USB_DT_AC_HEADER_SIZE(n) (8 + (n)) | 94 | #define UAC_DT_AC_HEADER_SIZE(n) (8 + (n)) |
| 105 | 95 | ||
| 106 | /* As above, but more useful for defining your own descriptors: */ | 96 | /* As above, but more useful for defining your own descriptors: */ |
| 107 | #define DECLARE_USB_AC_HEADER_DESCRIPTOR(n) \ | 97 | #define DECLARE_UAC_AC_HEADER_DESCRIPTOR(n) \ |
| 108 | struct usb_ac_header_descriptor_##n { \ | 98 | struct uac_ac_header_descriptor_##n { \ |
| 109 | __u8 bLength; \ | 99 | __u8 bLength; \ |
| 110 | __u8 bDescriptorType; \ | 100 | __u8 bDescriptorType; \ |
| 111 | __u8 bDescriptorSubtype; \ | 101 | __u8 bDescriptorSubtype; \ |
| @@ -116,7 +106,7 @@ struct usb_ac_header_descriptor_##n { \ | |||
| 116 | } __attribute__ ((packed)) | 106 | } __attribute__ ((packed)) |
| 117 | 107 | ||
| 118 | /* 4.3.2.1 Input Terminal Descriptor */ | 108 | /* 4.3.2.1 Input Terminal Descriptor */ |
| 119 | struct usb_input_terminal_descriptor { | 109 | struct uac_input_terminal_descriptor { |
| 120 | __u8 bLength; /* in bytes: 12 */ | 110 | __u8 bLength; /* in bytes: 12 */ |
| 121 | __u8 bDescriptorType; /* CS_INTERFACE descriptor type */ | 111 | __u8 bDescriptorType; /* CS_INTERFACE descriptor type */ |
| 122 | __u8 bDescriptorSubtype; /* INPUT_TERMINAL descriptor subtype */ | 112 | __u8 bDescriptorSubtype; /* INPUT_TERMINAL descriptor subtype */ |
| @@ -129,18 +119,19 @@ struct usb_input_terminal_descriptor { | |||
| 129 | __u8 iTerminal; | 119 | __u8 iTerminal; |
| 130 | } __attribute__ ((packed)); | 120 | } __attribute__ ((packed)); |
| 131 | 121 | ||
| 132 | #define USB_DT_AC_INPUT_TERMINAL_SIZE 12 | 122 | #define UAC_DT_INPUT_TERMINAL_SIZE 12 |
| 133 | 123 | ||
| 134 | #define USB_AC_INPUT_TERMINAL_UNDEFINED 0x200 | 124 | /* Terminals - 2.2 Input Terminal Types */ |
| 135 | #define USB_AC_INPUT_TERMINAL_MICROPHONE 0x201 | 125 | #define UAC_INPUT_TERMINAL_UNDEFINED 0x200 |
| 136 | #define USB_AC_INPUT_TERMINAL_DESKTOP_MICROPHONE 0x202 | 126 | #define UAC_INPUT_TERMINAL_MICROPHONE 0x201 |
| 137 | #define USB_AC_INPUT_TERMINAL_PERSONAL_MICROPHONE 0x203 | 127 | #define UAC_INPUT_TERMINAL_DESKTOP_MICROPHONE 0x202 |
| 138 | #define USB_AC_INPUT_TERMINAL_OMNI_DIR_MICROPHONE 0x204 | 128 | #define UAC_INPUT_TERMINAL_PERSONAL_MICROPHONE 0x203 |
| 139 | #define USB_AC_INPUT_TERMINAL_MICROPHONE_ARRAY 0x205 | 129 | #define UAC_INPUT_TERMINAL_OMNI_DIR_MICROPHONE 0x204 |
| 140 | #define USB_AC_INPUT_TERMINAL_PROC_MICROPHONE_ARRAY 0x206 | 130 | #define UAC_INPUT_TERMINAL_MICROPHONE_ARRAY 0x205 |
| 131 | #define UAC_INPUT_TERMINAL_PROC_MICROPHONE_ARRAY 0x206 | ||
| 141 | 132 | ||
| 142 | /* 4.3.2.2 Output Terminal Descriptor */ | 133 | /* 4.3.2.2 Output Terminal Descriptor */ |
| 143 | struct usb_output_terminal_descriptor { | 134 | struct uac_output_terminal_descriptor { |
| 144 | __u8 bLength; /* in bytes: 9 */ | 135 | __u8 bLength; /* in bytes: 9 */ |
| 145 | __u8 bDescriptorType; /* CS_INTERFACE descriptor type */ | 136 | __u8 bDescriptorType; /* CS_INTERFACE descriptor type */ |
| 146 | __u8 bDescriptorSubtype; /* OUTPUT_TERMINAL descriptor subtype */ | 137 | __u8 bDescriptorSubtype; /* OUTPUT_TERMINAL descriptor subtype */ |
| @@ -151,23 +142,24 @@ struct usb_output_terminal_descriptor { | |||
| 151 | __u8 iTerminal; | 142 | __u8 iTerminal; |
| 152 | } __attribute__ ((packed)); | 143 | } __attribute__ ((packed)); |
| 153 | 144 | ||
| 154 | #define USB_DT_AC_OUTPUT_TERMINAL_SIZE 9 | 145 | #define UAC_DT_OUTPUT_TERMINAL_SIZE 9 |
| 155 | 146 | ||
| 156 | #define USB_AC_OUTPUT_TERMINAL_UNDEFINED 0x300 | 147 | /* Terminals - 2.3 Output Terminal Types */ |
| 157 | #define USB_AC_OUTPUT_TERMINAL_SPEAKER 0x301 | 148 | #define UAC_OUTPUT_TERMINAL_UNDEFINED 0x300 |
| 158 | #define USB_AC_OUTPUT_TERMINAL_HEADPHONES 0x302 | 149 | #define UAC_OUTPUT_TERMINAL_SPEAKER 0x301 |
| 159 | #define USB_AC_OUTPUT_TERMINAL_HEAD_MOUNTED_DISPLAY_AUDIO 0x303 | 150 | #define UAC_OUTPUT_TERMINAL_HEADPHONES 0x302 |
| 160 | #define USB_AC_OUTPUT_TERMINAL_DESKTOP_SPEAKER 0x304 | 151 | #define UAC_OUTPUT_TERMINAL_HEAD_MOUNTED_DISPLAY_AUDIO 0x303 |
| 161 | #define USB_AC_OUTPUT_TERMINAL_ROOM_SPEAKER 0x305 | 152 | #define UAC_OUTPUT_TERMINAL_DESKTOP_SPEAKER 0x304 |
| 162 | #define USB_AC_OUTPUT_TERMINAL_COMMUNICATION_SPEAKER 0x306 | 153 | #define UAC_OUTPUT_TERMINAL_ROOM_SPEAKER 0x305 |
| 163 | #define USB_AC_OUTPUT_TERMINAL_LOW_FREQ_EFFECTS_SPEAKER 0x307 | 154 | #define UAC_OUTPUT_TERMINAL_COMMUNICATION_SPEAKER 0x306 |
| 155 | #define UAC_OUTPUT_TERMINAL_LOW_FREQ_EFFECTS_SPEAKER 0x307 | ||
| 164 | 156 | ||
| 165 | /* Set bControlSize = 2 as default setting */ | 157 | /* Set bControlSize = 2 as default setting */ |
| 166 | #define USB_DT_AC_FEATURE_UNIT_SIZE(ch) (7 + ((ch) + 1) * 2) | 158 | #define UAC_DT_FEATURE_UNIT_SIZE(ch) (7 + ((ch) + 1) * 2) |
| 167 | 159 | ||
| 168 | /* As above, but more useful for defining your own descriptors: */ | 160 | /* As above, but more useful for defining your own descriptors: */ |
| 169 | #define DECLARE_USB_AC_FEATURE_UNIT_DESCRIPTOR(ch) \ | 161 | #define DECLARE_UAC_FEATURE_UNIT_DESCRIPTOR(ch) \ |
| 170 | struct usb_ac_feature_unit_descriptor_##ch { \ | 162 | struct uac_feature_unit_descriptor_##ch { \ |
| 171 | __u8 bLength; \ | 163 | __u8 bLength; \ |
| 172 | __u8 bDescriptorType; \ | 164 | __u8 bDescriptorType; \ |
| 173 | __u8 bDescriptorSubtype; \ | 165 | __u8 bDescriptorSubtype; \ |
| @@ -179,7 +171,7 @@ struct usb_ac_feature_unit_descriptor_##ch { \ | |||
| 179 | } __attribute__ ((packed)) | 171 | } __attribute__ ((packed)) |
| 180 | 172 | ||
| 181 | /* 4.5.2 Class-Specific AS Interface Descriptor */ | 173 | /* 4.5.2 Class-Specific AS Interface Descriptor */ |
| 182 | struct usb_as_header_descriptor { | 174 | struct uac_as_header_descriptor { |
| 183 | __u8 bLength; /* in bytes: 7 */ | 175 | __u8 bLength; /* in bytes: 7 */ |
| 184 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ | 176 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ |
| 185 | __u8 bDescriptorSubtype; /* AS_GENERAL */ | 177 | __u8 bDescriptorSubtype; /* AS_GENERAL */ |
| @@ -188,16 +180,17 @@ struct usb_as_header_descriptor { | |||
| 188 | __le16 wFormatTag; /* The Audio Data Format */ | 180 | __le16 wFormatTag; /* The Audio Data Format */ |
| 189 | } __attribute__ ((packed)); | 181 | } __attribute__ ((packed)); |
| 190 | 182 | ||
| 191 | #define USB_DT_AS_HEADER_SIZE 7 | 183 | #define UAC_DT_AS_HEADER_SIZE 7 |
| 192 | 184 | ||
| 193 | #define USB_AS_AUDIO_FORMAT_TYPE_I_UNDEFINED 0x0 | 185 | /* Formats - A.1.1 Audio Data Format Type I Codes */ |
| 194 | #define USB_AS_AUDIO_FORMAT_TYPE_I_PCM 0x1 | 186 | #define UAC_FORMAT_TYPE_I_UNDEFINED 0x0 |
| 195 | #define USB_AS_AUDIO_FORMAT_TYPE_I_PCM8 0x2 | 187 | #define UAC_FORMAT_TYPE_I_PCM 0x1 |
| 196 | #define USB_AS_AUDIO_FORMAT_TYPE_I_IEEE_FLOAT 0x3 | 188 | #define UAC_FORMAT_TYPE_I_PCM8 0x2 |
| 197 | #define USB_AS_AUDIO_FORMAT_TYPE_I_ALAW 0x4 | 189 | #define UAC_FORMAT_TYPE_I_IEEE_FLOAT 0x3 |
| 198 | #define USB_AS_AUDIO_FORMAT_TYPE_I_MULAW 0x5 | 190 | #define UAC_FORMAT_TYPE_I_ALAW 0x4 |
| 191 | #define UAC_FORMAT_TYPE_I_MULAW 0x5 | ||
| 199 | 192 | ||
| 200 | struct usb_as_format_type_i_continuous_descriptor { | 193 | struct uac_format_type_i_continuous_descriptor { |
| 201 | __u8 bLength; /* in bytes: 8 + (ns * 3) */ | 194 | __u8 bLength; /* in bytes: 8 + (ns * 3) */ |
| 202 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ | 195 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ |
| 203 | __u8 bDescriptorSubtype; /* FORMAT_TYPE */ | 196 | __u8 bDescriptorSubtype; /* FORMAT_TYPE */ |
| @@ -210,9 +203,9 @@ struct usb_as_format_type_i_continuous_descriptor { | |||
| 210 | __u8 tUpperSamFreq[3]; | 203 | __u8 tUpperSamFreq[3]; |
| 211 | } __attribute__ ((packed)); | 204 | } __attribute__ ((packed)); |
| 212 | 205 | ||
| 213 | #define USB_AS_FORMAT_TYPE_I_CONTINUOUS_DESC_SIZE 14 | 206 | #define UAC_FORMAT_TYPE_I_CONTINUOUS_DESC_SIZE 14 |
| 214 | 207 | ||
| 215 | struct usb_as_formate_type_i_discrete_descriptor { | 208 | struct uac_format_type_i_discrete_descriptor { |
| 216 | __u8 bLength; /* in bytes: 8 + (ns * 3) */ | 209 | __u8 bLength; /* in bytes: 8 + (ns * 3) */ |
| 217 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ | 210 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ |
| 218 | __u8 bDescriptorSubtype; /* FORMAT_TYPE */ | 211 | __u8 bDescriptorSubtype; /* FORMAT_TYPE */ |
| @@ -224,8 +217,8 @@ struct usb_as_formate_type_i_discrete_descriptor { | |||
| 224 | __u8 tSamFreq[][3]; | 217 | __u8 tSamFreq[][3]; |
| 225 | } __attribute__ ((packed)); | 218 | } __attribute__ ((packed)); |
| 226 | 219 | ||
| 227 | #define DECLARE_USB_AS_FORMAT_TYPE_I_DISCRETE_DESC(n) \ | 220 | #define DECLARE_UAC_FORMAT_TYPE_I_DISCRETE_DESC(n) \ |
| 228 | struct usb_as_formate_type_i_discrete_descriptor_##n { \ | 221 | struct uac_format_type_i_discrete_descriptor_##n { \ |
| 229 | __u8 bLength; \ | 222 | __u8 bLength; \ |
| 230 | __u8 bDescriptorType; \ | 223 | __u8 bDescriptorType; \ |
| 231 | __u8 bDescriptorSubtype; \ | 224 | __u8 bDescriptorSubtype; \ |
| @@ -237,18 +230,15 @@ struct usb_as_formate_type_i_discrete_descriptor_##n { \ | |||
| 237 | __u8 tSamFreq[n][3]; \ | 230 | __u8 tSamFreq[n][3]; \ |
| 238 | } __attribute__ ((packed)) | 231 | } __attribute__ ((packed)) |
| 239 | 232 | ||
| 240 | #define USB_AS_FORMAT_TYPE_I_DISCRETE_DESC_SIZE(n) (8 + (n * 3)) | 233 | #define UAC_FORMAT_TYPE_I_DISCRETE_DESC_SIZE(n) (8 + (n * 3)) |
| 241 | |||
| 242 | #define USB_AS_FORMAT_TYPE_UNDEFINED 0x0 | ||
| 243 | #define USB_AS_FORMAT_TYPE_I 0x1 | ||
| 244 | #define USB_AS_FORMAT_TYPE_II 0x2 | ||
| 245 | #define USB_AS_FORMAT_TYPE_III 0x3 | ||
| 246 | 234 | ||
| 247 | #define USB_AS_ENDPOINT_ASYNC (1 << 2) | 235 | /* Formats - A.2 Format Type Codes */ |
| 248 | #define USB_AS_ENDPOINT_ADAPTIVE (2 << 2) | 236 | #define UAC_FORMAT_TYPE_UNDEFINED 0x0 |
| 249 | #define USB_AS_ENDPOINT_SYNC (3 << 2) | 237 | #define UAC_FORMAT_TYPE_I 0x1 |
| 238 | #define UAC_FORMAT_TYPE_II 0x2 | ||
| 239 | #define UAC_FORMAT_TYPE_III 0x3 | ||
| 250 | 240 | ||
| 251 | struct usb_as_iso_endpoint_descriptor { | 241 | struct uac_iso_endpoint_descriptor { |
| 252 | __u8 bLength; /* in bytes: 7 */ | 242 | __u8 bLength; /* in bytes: 7 */ |
| 253 | __u8 bDescriptorType; /* USB_DT_CS_ENDPOINT */ | 243 | __u8 bDescriptorType; /* USB_DT_CS_ENDPOINT */ |
| 254 | __u8 bDescriptorSubtype; /* EP_GENERAL */ | 244 | __u8 bDescriptorSubtype; /* EP_GENERAL */ |
| @@ -256,30 +246,37 @@ struct usb_as_iso_endpoint_descriptor { | |||
| 256 | __u8 bLockDelayUnits; | 246 | __u8 bLockDelayUnits; |
| 257 | __le16 wLockDelay; | 247 | __le16 wLockDelay; |
| 258 | }; | 248 | }; |
| 259 | #define USB_AS_ISO_ENDPOINT_DESC_SIZE 7 | 249 | #define UAC_ISO_ENDPOINT_DESC_SIZE 7 |
| 260 | 250 | ||
| 261 | #define FU_CONTROL_UNDEFINED 0x00 | 251 | #define UAC_EP_CS_ATTR_SAMPLE_RATE 0x01 |
| 262 | #define MUTE_CONTROL 0x01 | 252 | #define UAC_EP_CS_ATTR_PITCH_CONTROL 0x02 |
| 263 | #define VOLUME_CONTROL 0x02 | 253 | #define UAC_EP_CS_ATTR_FILL_MAX 0x80 |
| 264 | #define BASS_CONTROL 0x03 | 254 | |
| 265 | #define MID_CONTROL 0x04 | 255 | /* A.10.2 Feature Unit Control Selectors */ |
| 266 | #define TREBLE_CONTROL 0x05 | 256 | #define UAC_FU_CONTROL_UNDEFINED 0x00 |
| 267 | #define GRAPHIC_EQUALIZER_CONTROL 0x06 | 257 | #define UAC_MUTE_CONTROL 0x01 |
| 268 | #define AUTOMATIC_GAIN_CONTROL 0x07 | 258 | #define UAC_VOLUME_CONTROL 0x02 |
| 269 | #define DELAY_CONTROL 0x08 | 259 | #define UAC_BASS_CONTROL 0x03 |
| 270 | #define BASS_BOOST_CONTROL 0x09 | 260 | #define UAC_MID_CONTROL 0x04 |
| 271 | #define LOUDNESS_CONTROL 0x0a | 261 | #define UAC_TREBLE_CONTROL 0x05 |
| 272 | 262 | #define UAC_GRAPHIC_EQUALIZER_CONTROL 0x06 | |
| 273 | #define FU_MUTE (1 << (MUTE_CONTROL - 1)) | 263 | #define UAC_AUTOMATIC_GAIN_CONTROL 0x07 |
| 274 | #define FU_VOLUME (1 << (VOLUME_CONTROL - 1)) | 264 | #define UAC_DELAY_CONTROL 0x08 |
| 275 | #define FU_BASS (1 << (BASS_CONTROL - 1)) | 265 | #define UAC_BASS_BOOST_CONTROL 0x09 |
| 276 | #define FU_MID (1 << (MID_CONTROL - 1)) | 266 | #define UAC_LOUDNESS_CONTROL 0x0a |
| 277 | #define FU_TREBLE (1 << (TREBLE_CONTROL - 1)) | 267 | |
| 278 | #define FU_GRAPHIC_EQ (1 << (GRAPHIC_EQUALIZER_CONTROL - 1)) | 268 | #define UAC_FU_MUTE (1 << (UAC_MUTE_CONTROL - 1)) |
| 279 | #define FU_AUTO_GAIN (1 << (AUTOMATIC_GAIN_CONTROL - 1)) | 269 | #define UAC_FU_VOLUME (1 << (UAC_VOLUME_CONTROL - 1)) |
| 280 | #define FU_DELAY (1 << (DELAY_CONTROL - 1)) | 270 | #define UAC_FU_BASS (1 << (UAC_BASS_CONTROL - 1)) |
| 281 | #define FU_BASS_BOOST (1 << (BASS_BOOST_CONTROL - 1)) | 271 | #define UAC_FU_MID (1 << (UAC_MID_CONTROL - 1)) |
| 282 | #define FU_LOUDNESS (1 << (LOUDNESS_CONTROL - 1)) | 272 | #define UAC_FU_TREBLE (1 << (UAC_TREBLE_CONTROL - 1)) |
| 273 | #define UAC_FU_GRAPHIC_EQ (1 << (UAC_GRAPHIC_EQUALIZER_CONTROL - 1)) | ||
| 274 | #define UAC_FU_AUTO_GAIN (1 << (UAC_AUTOMATIC_GAIN_CONTROL - 1)) | ||
| 275 | #define UAC_FU_DELAY (1 << (UAC_DELAY_CONTROL - 1)) | ||
| 276 | #define UAC_FU_BASS_BOOST (1 << (UAC_BASS_BOOST_CONTROL - 1)) | ||
| 277 | #define UAC_FU_LOUDNESS (1 << (UAC_LOUDNESS_CONTROL - 1)) | ||
| 278 | |||
| 279 | #ifdef __KERNEL__ | ||
| 283 | 280 | ||
| 284 | struct usb_audio_control { | 281 | struct usb_audio_control { |
| 285 | struct list_head list; | 282 | struct list_head list; |
| @@ -290,18 +287,6 @@ struct usb_audio_control { | |||
| 290 | int (*get)(struct usb_audio_control *con, u8 cmd); | 287 | int (*get)(struct usb_audio_control *con, u8 cmd); |
| 291 | }; | 288 | }; |
| 292 | 289 | ||
| 293 | static inline int generic_set_cmd(struct usb_audio_control *con, u8 cmd, int value) | ||
| 294 | { | ||
| 295 | con->data[cmd] = value; | ||
| 296 | |||
| 297 | return 0; | ||
| 298 | } | ||
| 299 | |||
| 300 | static inline int generic_get_cmd(struct usb_audio_control *con, u8 cmd) | ||
| 301 | { | ||
| 302 | return con->data[cmd]; | ||
| 303 | } | ||
| 304 | |||
| 305 | struct usb_audio_control_selector { | 290 | struct usb_audio_control_selector { |
| 306 | struct list_head list; | 291 | struct list_head list; |
| 307 | struct list_head control; | 292 | struct list_head control; |
| @@ -311,4 +296,6 @@ struct usb_audio_control_selector { | |||
| 311 | struct usb_descriptor_header *desc; | 296 | struct usb_descriptor_header *desc; |
| 312 | }; | 297 | }; |
| 313 | 298 | ||
| 299 | #endif /* __KERNEL__ */ | ||
| 300 | |||
| 314 | #endif /* __LINUX_USB_AUDIO_H */ | 301 | #endif /* __LINUX_USB_AUDIO_H */ |
diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h index 93223638f702..94012e649d86 100644 --- a/include/linux/usb/ch9.h +++ b/include/linux/usb/ch9.h | |||
| @@ -258,6 +258,8 @@ struct usb_device_descriptor { | |||
| 258 | #define USB_CLASS_APP_SPEC 0xfe | 258 | #define USB_CLASS_APP_SPEC 0xfe |
| 259 | #define USB_CLASS_VENDOR_SPEC 0xff | 259 | #define USB_CLASS_VENDOR_SPEC 0xff |
| 260 | 260 | ||
| 261 | #define USB_SUBCLASS_VENDOR_SPEC 0xff | ||
| 262 | |||
| 261 | /*-------------------------------------------------------------------------*/ | 263 | /*-------------------------------------------------------------------------*/ |
| 262 | 264 | ||
| 263 | /* USB_DT_CONFIG: Configuration descriptor information. | 265 | /* USB_DT_CONFIG: Configuration descriptor information. |
| @@ -348,6 +350,12 @@ struct usb_endpoint_descriptor { | |||
| 348 | #define USB_ENDPOINT_NUMBER_MASK 0x0f /* in bEndpointAddress */ | 350 | #define USB_ENDPOINT_NUMBER_MASK 0x0f /* in bEndpointAddress */ |
| 349 | #define USB_ENDPOINT_DIR_MASK 0x80 | 351 | #define USB_ENDPOINT_DIR_MASK 0x80 |
| 350 | 352 | ||
| 353 | #define USB_ENDPOINT_SYNCTYPE 0x0c | ||
| 354 | #define USB_ENDPOINT_SYNC_NONE (0 << 2) | ||
| 355 | #define USB_ENDPOINT_SYNC_ASYNC (1 << 2) | ||
| 356 | #define USB_ENDPOINT_SYNC_ADAPTIVE (2 << 2) | ||
| 357 | #define USB_ENDPOINT_SYNC_SYNC (3 << 2) | ||
| 358 | |||
| 351 | #define USB_ENDPOINT_XFERTYPE_MASK 0x03 /* in bmAttributes */ | 359 | #define USB_ENDPOINT_XFERTYPE_MASK 0x03 /* in bmAttributes */ |
| 352 | #define USB_ENDPOINT_XFER_CONTROL 0 | 360 | #define USB_ENDPOINT_XFER_CONTROL 0 |
| 353 | #define USB_ENDPOINT_XFER_ISOC 1 | 361 | #define USB_ENDPOINT_XFER_ISOC 1 |
diff --git a/include/linux/usb/ehci_def.h b/include/linux/usb/ehci_def.h index 5b88e36c9103..af4b86f3aca3 100644 --- a/include/linux/usb/ehci_def.h +++ b/include/linux/usb/ehci_def.h | |||
| @@ -105,6 +105,7 @@ struct ehci_regs { | |||
| 105 | #define PORT_WKDISC_E (1<<21) /* wake on disconnect (enable) */ | 105 | #define PORT_WKDISC_E (1<<21) /* wake on disconnect (enable) */ |
| 106 | #define PORT_WKCONN_E (1<<20) /* wake on connect (enable) */ | 106 | #define PORT_WKCONN_E (1<<20) /* wake on connect (enable) */ |
| 107 | /* 19:16 for port testing */ | 107 | /* 19:16 for port testing */ |
| 108 | #define PORT_TEST_PKT (0x4<<16) /* Port Test Control - packet test */ | ||
| 108 | #define PORT_LED_OFF (0<<14) | 109 | #define PORT_LED_OFF (0<<14) |
| 109 | #define PORT_LED_AMBER (1<<14) | 110 | #define PORT_LED_AMBER (1<<14) |
| 110 | #define PORT_LED_GREEN (2<<14) | 111 | #define PORT_LED_GREEN (2<<14) |
| @@ -132,6 +133,19 @@ struct ehci_regs { | |||
| 132 | #define USBMODE_CM_HC (3<<0) /* host controller mode */ | 133 | #define USBMODE_CM_HC (3<<0) /* host controller mode */ |
| 133 | #define USBMODE_CM_IDLE (0<<0) /* idle state */ | 134 | #define USBMODE_CM_IDLE (0<<0) /* idle state */ |
| 134 | 135 | ||
| 136 | /* Moorestown has some non-standard registers, partially due to the fact that | ||
| 137 | * its EHCI controller has both TT and LPM support. HOSTPCx are extentions to | ||
| 138 | * PORTSCx | ||
| 139 | */ | ||
| 140 | #define HOSTPC0 0x84 /* HOSTPC extension */ | ||
| 141 | #define HOSTPC_PHCD (1<<22) /* Phy clock disable */ | ||
| 142 | #define HOSTPC_PSPD (3<<25) /* Port speed detection */ | ||
| 143 | #define USBMODE_EX 0xc8 /* USB Device mode extension */ | ||
| 144 | #define USBMODE_EX_VBPS (1<<5) /* VBus Power Select On */ | ||
| 145 | #define USBMODE_EX_HC (3<<0) /* host controller mode */ | ||
| 146 | #define TXFILLTUNING 0x24 /* TX FIFO Tuning register */ | ||
| 147 | #define TXFIFO_DEFAULT (8<<16) /* FIFO burst threshold 8 */ | ||
| 148 | |||
| 135 | /* Appendix C, Debug port ... intended for use with special "debug devices" | 149 | /* Appendix C, Debug port ... intended for use with special "debug devices" |
| 136 | * that can help if there's no serial console. (nonstandard enumeration.) | 150 | * that can help if there's no serial console. (nonstandard enumeration.) |
| 137 | */ | 151 | */ |
| @@ -157,4 +171,25 @@ struct ehci_dbg_port { | |||
| 157 | #define DBGP_EPADDR(dev, ep) (((dev)<<8)|(ep)) | 171 | #define DBGP_EPADDR(dev, ep) (((dev)<<8)|(ep)) |
| 158 | } __attribute__ ((packed)); | 172 | } __attribute__ ((packed)); |
| 159 | 173 | ||
| 174 | #ifdef CONFIG_EARLY_PRINTK_DBGP | ||
| 175 | #include <linux/init.h> | ||
| 176 | extern int __init early_dbgp_init(char *s); | ||
| 177 | extern struct console early_dbgp_console; | ||
| 178 | #endif /* CONFIG_EARLY_PRINTK_DBGP */ | ||
| 179 | |||
| 180 | #ifdef CONFIG_EARLY_PRINTK_DBGP | ||
| 181 | /* Call backs from ehci host driver to ehci debug driver */ | ||
| 182 | extern int dbgp_external_startup(void); | ||
| 183 | extern int dbgp_reset_prep(void); | ||
| 184 | #else | ||
| 185 | static inline int dbgp_reset_prep(void) | ||
| 186 | { | ||
| 187 | return 1; | ||
| 188 | } | ||
| 189 | static inline int dbgp_external_startup(void) | ||
| 190 | { | ||
| 191 | return -1; | ||
| 192 | } | ||
| 193 | #endif | ||
| 194 | |||
| 160 | #endif /* __LINUX_USB_EHCI_DEF_H */ | 195 | #endif /* __LINUX_USB_EHCI_DEF_H */ |
diff --git a/include/linux/usb/isp1362.h b/include/linux/usb/isp1362.h new file mode 100644 index 000000000000..642684bb9292 --- /dev/null +++ b/include/linux/usb/isp1362.h | |||
| @@ -0,0 +1,46 @@ | |||
| 1 | /* | ||
| 2 | * board initialization code should put one of these into dev->platform_data | ||
| 3 | * and place the isp1362 onto platform_bus. | ||
| 4 | */ | ||
| 5 | |||
| 6 | #ifndef __LINUX_USB_ISP1362_H__ | ||
| 7 | #define __LINUX_USB_ISP1362_H__ | ||
| 8 | |||
| 9 | struct isp1362_platform_data { | ||
| 10 | /* Enable internal pulldown resistors on downstream ports */ | ||
| 11 | unsigned sel15Kres:1; | ||
| 12 | /* Clock cannot be stopped */ | ||
| 13 | unsigned clknotstop:1; | ||
| 14 | /* On-chip overcurrent protection */ | ||
| 15 | unsigned oc_enable:1; | ||
| 16 | /* INT output polarity */ | ||
| 17 | unsigned int_act_high:1; | ||
| 18 | /* INT edge or level triggered */ | ||
| 19 | unsigned int_edge_triggered:1; | ||
| 20 | /* DREQ output polarity */ | ||
| 21 | unsigned dreq_act_high:1; | ||
| 22 | /* DACK input polarity */ | ||
| 23 | unsigned dack_act_high:1; | ||
| 24 | /* chip can be resumed via H_WAKEUP pin */ | ||
| 25 | unsigned remote_wakeup_connected:1; | ||
| 26 | /* Switch or not to switch (keep always powered) */ | ||
| 27 | unsigned no_power_switching:1; | ||
| 28 | /* Ganged port power switching (0) or individual port power switching (1) */ | ||
| 29 | unsigned power_switching_mode:1; | ||
| 30 | /* Given port_power, msec/2 after power on till power good */ | ||
| 31 | u8 potpg; | ||
| 32 | /* Hardware reset set/clear */ | ||
| 33 | void (*reset) (struct device *dev, int set); | ||
| 34 | /* Clock start/stop */ | ||
| 35 | void (*clock) (struct device *dev, int start); | ||
| 36 | /* Inter-io delay (ns). The chip is picky about access timings; it | ||
| 37 | * expects at least: | ||
| 38 | * 110ns delay between consecutive accesses to DATA_REG, | ||
| 39 | * 300ns delay between access to ADDR_REG and DATA_REG (registers) | ||
| 40 | * 462ns delay between access to ADDR_REG and DATA_REG (buffer memory) | ||
| 41 | * WE MUST NOT be activated during these intervals (even without CS!) | ||
| 42 | */ | ||
| 43 | void (*delay) (struct device *dev, unsigned int delay); | ||
| 44 | }; | ||
| 45 | |||
| 46 | #endif | ||
diff --git a/include/linux/usb/isp1760.h b/include/linux/usb/isp1760.h new file mode 100644 index 000000000000..de7de53c5531 --- /dev/null +++ b/include/linux/usb/isp1760.h | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | /* | ||
| 2 | * board initialization should put one of these into dev->platform_data | ||
| 3 | * and place the isp1760 onto platform_bus named "isp1760-hcd". | ||
| 4 | */ | ||
| 5 | |||
| 6 | #ifndef __LINUX_USB_ISP1760_H | ||
| 7 | #define __LINUX_USB_ISP1760_H | ||
| 8 | |||
| 9 | struct isp1760_platform_data { | ||
| 10 | unsigned is_isp1761:1; /* Chip is ISP1761 */ | ||
| 11 | unsigned bus_width_16:1; /* 16/32-bit data bus width */ | ||
| 12 | unsigned port1_otg:1; /* Port 1 supports OTG */ | ||
| 13 | unsigned analog_oc:1; /* Analog overcurrent */ | ||
| 14 | unsigned dack_polarity_high:1; /* DACK active high */ | ||
| 15 | unsigned dreq_polarity_high:1; /* DREQ active high */ | ||
| 16 | }; | ||
| 17 | |||
| 18 | #endif /* __LINUX_USB_ISP1760_H */ | ||
diff --git a/include/linux/usb/m66592.h b/include/linux/usb/m66592.h new file mode 100644 index 000000000000..cda9625e7df0 --- /dev/null +++ b/include/linux/usb/m66592.h | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | /* | ||
| 2 | * M66592 driver platform data | ||
| 3 | * | ||
| 4 | * Copyright (C) 2009 Renesas Solutions Corp. | ||
| 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 as published by | ||
| 8 | * the Free Software Foundation; version 2 of the License. | ||
| 9 | * | ||
| 10 | * This program is distributed in the hope that it will be useful, | ||
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | * GNU General Public License for more details. | ||
| 14 | * | ||
| 15 | * You should have received a copy of the GNU General Public License | ||
| 16 | * along with this program; if not, write to the Free Software | ||
| 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 18 | * | ||
| 19 | */ | ||
| 20 | |||
| 21 | #ifndef __LINUX_USB_M66592_H | ||
| 22 | #define __LINUX_USB_M66592_H | ||
| 23 | |||
| 24 | #define M66592_PLATDATA_XTAL_12MHZ 0x01 | ||
| 25 | #define M66592_PLATDATA_XTAL_24MHZ 0x02 | ||
| 26 | #define M66592_PLATDATA_XTAL_48MHZ 0x03 | ||
| 27 | |||
| 28 | struct m66592_platdata { | ||
| 29 | /* one = on chip controller, zero = external controller */ | ||
| 30 | unsigned on_chip:1; | ||
| 31 | |||
| 32 | /* one = big endian, zero = little endian */ | ||
| 33 | unsigned endian:1; | ||
| 34 | |||
| 35 | /* (external controller only) M66592_PLATDATA_XTAL_nnMHZ */ | ||
| 36 | unsigned xtal:2; | ||
| 37 | |||
| 38 | /* (external controller only) one = 3.3V, zero = 1.5V */ | ||
| 39 | unsigned vif:1; | ||
| 40 | |||
| 41 | }; | ||
| 42 | |||
| 43 | #endif /* __LINUX_USB_M66592_H */ | ||
| 44 | |||
diff --git a/include/linux/usb/r8a66597.h b/include/linux/usb/r8a66597.h index e9f0384fa20c..26d216734057 100644 --- a/include/linux/usb/r8a66597.h +++ b/include/linux/usb/r8a66597.h | |||
| @@ -28,9 +28,12 @@ | |||
| 28 | #define R8A66597_PLATDATA_XTAL_48MHZ 0x03 | 28 | #define R8A66597_PLATDATA_XTAL_48MHZ 0x03 |
| 29 | 29 | ||
| 30 | struct r8a66597_platdata { | 30 | struct r8a66597_platdata { |
| 31 | /* This ops can controll port power instead of DVSTCTR register. */ | 31 | /* This callback can control port power instead of DVSTCTR register. */ |
| 32 | void (*port_power)(int port, int power); | 32 | void (*port_power)(int port, int power); |
| 33 | 33 | ||
| 34 | /* set one = on chip controller, set zero = external controller */ | ||
| 35 | unsigned on_chip:1; | ||
| 36 | |||
| 34 | /* (external controller only) set R8A66597_PLATDATA_XTAL_nnMHZ */ | 37 | /* (external controller only) set R8A66597_PLATDATA_XTAL_nnMHZ */ |
| 35 | unsigned xtal:2; | 38 | unsigned xtal:2; |
| 36 | 39 | ||
| @@ -40,5 +43,373 @@ struct r8a66597_platdata { | |||
| 40 | /* set one = big endian, set zero = little endian */ | 43 | /* set one = big endian, set zero = little endian */ |
| 41 | unsigned endian:1; | 44 | unsigned endian:1; |
| 42 | }; | 45 | }; |
| 43 | #endif | 46 | |
| 47 | /* Register definitions */ | ||
| 48 | #define SYSCFG0 0x00 | ||
| 49 | #define SYSCFG1 0x02 | ||
| 50 | #define SYSSTS0 0x04 | ||
| 51 | #define SYSSTS1 0x06 | ||
| 52 | #define DVSTCTR0 0x08 | ||
| 53 | #define DVSTCTR1 0x0A | ||
| 54 | #define TESTMODE 0x0C | ||
| 55 | #define PINCFG 0x0E | ||
| 56 | #define DMA0CFG 0x10 | ||
| 57 | #define DMA1CFG 0x12 | ||
| 58 | #define CFIFO 0x14 | ||
| 59 | #define D0FIFO 0x18 | ||
| 60 | #define D1FIFO 0x1C | ||
| 61 | #define CFIFOSEL 0x20 | ||
| 62 | #define CFIFOCTR 0x22 | ||
| 63 | #define CFIFOSIE 0x24 | ||
| 64 | #define D0FIFOSEL 0x28 | ||
| 65 | #define D0FIFOCTR 0x2A | ||
| 66 | #define D1FIFOSEL 0x2C | ||
| 67 | #define D1FIFOCTR 0x2E | ||
| 68 | #define INTENB0 0x30 | ||
| 69 | #define INTENB1 0x32 | ||
| 70 | #define INTENB2 0x34 | ||
| 71 | #define BRDYENB 0x36 | ||
| 72 | #define NRDYENB 0x38 | ||
| 73 | #define BEMPENB 0x3A | ||
| 74 | #define SOFCFG 0x3C | ||
| 75 | #define INTSTS0 0x40 | ||
| 76 | #define INTSTS1 0x42 | ||
| 77 | #define INTSTS2 0x44 | ||
| 78 | #define BRDYSTS 0x46 | ||
| 79 | #define NRDYSTS 0x48 | ||
| 80 | #define BEMPSTS 0x4A | ||
| 81 | #define FRMNUM 0x4C | ||
| 82 | #define UFRMNUM 0x4E | ||
| 83 | #define USBADDR 0x50 | ||
| 84 | #define USBREQ 0x54 | ||
| 85 | #define USBVAL 0x56 | ||
| 86 | #define USBINDX 0x58 | ||
| 87 | #define USBLENG 0x5A | ||
| 88 | #define DCPCFG 0x5C | ||
| 89 | #define DCPMAXP 0x5E | ||
| 90 | #define DCPCTR 0x60 | ||
| 91 | #define PIPESEL 0x64 | ||
| 92 | #define PIPECFG 0x68 | ||
| 93 | #define PIPEBUF 0x6A | ||
| 94 | #define PIPEMAXP 0x6C | ||
| 95 | #define PIPEPERI 0x6E | ||
| 96 | #define PIPE1CTR 0x70 | ||
| 97 | #define PIPE2CTR 0x72 | ||
| 98 | #define PIPE3CTR 0x74 | ||
| 99 | #define PIPE4CTR 0x76 | ||
| 100 | #define PIPE5CTR 0x78 | ||
| 101 | #define PIPE6CTR 0x7A | ||
| 102 | #define PIPE7CTR 0x7C | ||
| 103 | #define PIPE8CTR 0x7E | ||
| 104 | #define PIPE9CTR 0x80 | ||
| 105 | #define PIPE1TRE 0x90 | ||
| 106 | #define PIPE1TRN 0x92 | ||
| 107 | #define PIPE2TRE 0x94 | ||
| 108 | #define PIPE2TRN 0x96 | ||
| 109 | #define PIPE3TRE 0x98 | ||
| 110 | #define PIPE3TRN 0x9A | ||
| 111 | #define PIPE4TRE 0x9C | ||
| 112 | #define PIPE4TRN 0x9E | ||
| 113 | #define PIPE5TRE 0xA0 | ||
| 114 | #define PIPE5TRN 0xA2 | ||
| 115 | #define DEVADD0 0xD0 | ||
| 116 | #define DEVADD1 0xD2 | ||
| 117 | #define DEVADD2 0xD4 | ||
| 118 | #define DEVADD3 0xD6 | ||
| 119 | #define DEVADD4 0xD8 | ||
| 120 | #define DEVADD5 0xDA | ||
| 121 | #define DEVADD6 0xDC | ||
| 122 | #define DEVADD7 0xDE | ||
| 123 | #define DEVADD8 0xE0 | ||
| 124 | #define DEVADD9 0xE2 | ||
| 125 | #define DEVADDA 0xE4 | ||
| 126 | |||
| 127 | /* System Configuration Control Register */ | ||
| 128 | #define XTAL 0xC000 /* b15-14: Crystal selection */ | ||
| 129 | #define XTAL48 0x8000 /* 48MHz */ | ||
| 130 | #define XTAL24 0x4000 /* 24MHz */ | ||
| 131 | #define XTAL12 0x0000 /* 12MHz */ | ||
| 132 | #define XCKE 0x2000 /* b13: External clock enable */ | ||
| 133 | #define PLLC 0x0800 /* b11: PLL control */ | ||
| 134 | #define SCKE 0x0400 /* b10: USB clock enable */ | ||
| 135 | #define PCSDIS 0x0200 /* b9: not CS wakeup */ | ||
| 136 | #define LPSME 0x0100 /* b8: Low power sleep mode */ | ||
| 137 | #define HSE 0x0080 /* b7: Hi-speed enable */ | ||
| 138 | #define DCFM 0x0040 /* b6: Controller function select */ | ||
| 139 | #define DRPD 0x0020 /* b5: D+/- pull down control */ | ||
| 140 | #define DPRPU 0x0010 /* b4: D+ pull up control */ | ||
| 141 | #define USBE 0x0001 /* b0: USB module operation enable */ | ||
| 142 | |||
| 143 | /* System Configuration Status Register */ | ||
| 144 | #define OVCBIT 0x8000 /* b15-14: Over-current bit */ | ||
| 145 | #define OVCMON 0xC000 /* b15-14: Over-current monitor */ | ||
| 146 | #define SOFEA 0x0020 /* b5: SOF monitor */ | ||
| 147 | #define IDMON 0x0004 /* b3: ID-pin monitor */ | ||
| 148 | #define LNST 0x0003 /* b1-0: D+, D- line status */ | ||
| 149 | #define SE1 0x0003 /* SE1 */ | ||
| 150 | #define FS_KSTS 0x0002 /* Full-Speed K State */ | ||
| 151 | #define FS_JSTS 0x0001 /* Full-Speed J State */ | ||
| 152 | #define LS_JSTS 0x0002 /* Low-Speed J State */ | ||
| 153 | #define LS_KSTS 0x0001 /* Low-Speed K State */ | ||
| 154 | #define SE0 0x0000 /* SE0 */ | ||
| 155 | |||
| 156 | /* Device State Control Register */ | ||
| 157 | #define EXTLP0 0x0400 /* b10: External port */ | ||
| 158 | #define VBOUT 0x0200 /* b9: VBUS output */ | ||
| 159 | #define WKUP 0x0100 /* b8: Remote wakeup */ | ||
| 160 | #define RWUPE 0x0080 /* b7: Remote wakeup sense */ | ||
| 161 | #define USBRST 0x0040 /* b6: USB reset enable */ | ||
| 162 | #define RESUME 0x0020 /* b5: Resume enable */ | ||
| 163 | #define UACT 0x0010 /* b4: USB bus enable */ | ||
| 164 | #define RHST 0x0007 /* b1-0: Reset handshake status */ | ||
| 165 | #define HSPROC 0x0004 /* HS handshake is processing */ | ||
| 166 | #define HSMODE 0x0003 /* Hi-Speed mode */ | ||
| 167 | #define FSMODE 0x0002 /* Full-Speed mode */ | ||
| 168 | #define LSMODE 0x0001 /* Low-Speed mode */ | ||
| 169 | #define UNDECID 0x0000 /* Undecided */ | ||
| 170 | |||
| 171 | /* Test Mode Register */ | ||
| 172 | #define UTST 0x000F /* b3-0: Test select */ | ||
| 173 | #define H_TST_PACKET 0x000C /* HOST TEST Packet */ | ||
| 174 | #define H_TST_SE0_NAK 0x000B /* HOST TEST SE0 NAK */ | ||
| 175 | #define H_TST_K 0x000A /* HOST TEST K */ | ||
| 176 | #define H_TST_J 0x0009 /* HOST TEST J */ | ||
| 177 | #define H_TST_NORMAL 0x0000 /* HOST Normal Mode */ | ||
| 178 | #define P_TST_PACKET 0x0004 /* PERI TEST Packet */ | ||
| 179 | #define P_TST_SE0_NAK 0x0003 /* PERI TEST SE0 NAK */ | ||
| 180 | #define P_TST_K 0x0002 /* PERI TEST K */ | ||
| 181 | #define P_TST_J 0x0001 /* PERI TEST J */ | ||
| 182 | #define P_TST_NORMAL 0x0000 /* PERI Normal Mode */ | ||
| 183 | |||
| 184 | /* Data Pin Configuration Register */ | ||
| 185 | #define LDRV 0x8000 /* b15: Drive Current Adjust */ | ||
| 186 | #define VIF1 0x0000 /* VIF = 1.8V */ | ||
| 187 | #define VIF3 0x8000 /* VIF = 3.3V */ | ||
| 188 | #define INTA 0x0001 /* b1: USB INT-pin active */ | ||
| 189 | |||
| 190 | /* DMAx Pin Configuration Register */ | ||
| 191 | #define DREQA 0x4000 /* b14: Dreq active select */ | ||
| 192 | #define BURST 0x2000 /* b13: Burst mode */ | ||
| 193 | #define DACKA 0x0400 /* b10: Dack active select */ | ||
| 194 | #define DFORM 0x0380 /* b9-7: DMA mode select */ | ||
| 195 | #define CPU_ADR_RD_WR 0x0000 /* Address + RD/WR mode (CPU bus) */ | ||
| 196 | #define CPU_DACK_RD_WR 0x0100 /* DACK + RD/WR mode (CPU bus) */ | ||
| 197 | #define CPU_DACK_ONLY 0x0180 /* DACK only mode (CPU bus) */ | ||
| 198 | #define SPLIT_DACK_ONLY 0x0200 /* DACK only mode (SPLIT bus) */ | ||
| 199 | #define DENDA 0x0040 /* b6: Dend active select */ | ||
| 200 | #define PKTM 0x0020 /* b5: Packet mode */ | ||
| 201 | #define DENDE 0x0010 /* b4: Dend enable */ | ||
| 202 | #define OBUS 0x0004 /* b2: OUTbus mode */ | ||
| 203 | |||
| 204 | /* CFIFO/DxFIFO Port Select Register */ | ||
| 205 | #define RCNT 0x8000 /* b15: Read count mode */ | ||
| 206 | #define REW 0x4000 /* b14: Buffer rewind */ | ||
| 207 | #define DCLRM 0x2000 /* b13: DMA buffer clear mode */ | ||
| 208 | #define DREQE 0x1000 /* b12: DREQ output enable */ | ||
| 209 | #define MBW_8 0x0000 /* 8bit */ | ||
| 210 | #define MBW_16 0x0400 /* 16bit */ | ||
| 211 | #define MBW_32 0x0800 /* 32bit */ | ||
| 212 | #define BIGEND 0x0100 /* b8: Big endian mode */ | ||
| 213 | #define BYTE_LITTLE 0x0000 /* little dendian */ | ||
| 214 | #define BYTE_BIG 0x0100 /* big endifan */ | ||
| 215 | #define ISEL 0x0020 /* b5: DCP FIFO port direction select */ | ||
| 216 | #define CURPIPE 0x000F /* b2-0: PIPE select */ | ||
| 217 | |||
| 218 | /* CFIFO/DxFIFO Port Control Register */ | ||
| 219 | #define BVAL 0x8000 /* b15: Buffer valid flag */ | ||
| 220 | #define BCLR 0x4000 /* b14: Buffer clear */ | ||
| 221 | #define FRDY 0x2000 /* b13: FIFO ready */ | ||
| 222 | #define DTLN 0x0FFF /* b11-0: FIFO received data length */ | ||
| 223 | |||
| 224 | /* Interrupt Enable Register 0 */ | ||
| 225 | #define VBSE 0x8000 /* b15: VBUS interrupt */ | ||
| 226 | #define RSME 0x4000 /* b14: Resume interrupt */ | ||
| 227 | #define SOFE 0x2000 /* b13: Frame update interrupt */ | ||
| 228 | #define DVSE 0x1000 /* b12: Device state transition interrupt */ | ||
| 229 | #define CTRE 0x0800 /* b11: Control transfer stage transition interrupt */ | ||
| 230 | #define BEMPE 0x0400 /* b10: Buffer empty interrupt */ | ||
| 231 | #define NRDYE 0x0200 /* b9: Buffer not ready interrupt */ | ||
| 232 | #define BRDYE 0x0100 /* b8: Buffer ready interrupt */ | ||
| 233 | |||
| 234 | /* Interrupt Enable Register 1 */ | ||
| 235 | #define OVRCRE 0x8000 /* b15: Over-current interrupt */ | ||
| 236 | #define BCHGE 0x4000 /* b14: USB us chenge interrupt */ | ||
| 237 | #define DTCHE 0x1000 /* b12: Detach sense interrupt */ | ||
| 238 | #define ATTCHE 0x0800 /* b11: Attach sense interrupt */ | ||
| 239 | #define EOFERRE 0x0040 /* b6: EOF error interrupt */ | ||
| 240 | #define SIGNE 0x0020 /* b5: SETUP IGNORE interrupt */ | ||
| 241 | #define SACKE 0x0010 /* b4: SETUP ACK interrupt */ | ||
| 242 | |||
| 243 | /* BRDY Interrupt Enable/Status Register */ | ||
| 244 | #define BRDY9 0x0200 /* b9: PIPE9 */ | ||
| 245 | #define BRDY8 0x0100 /* b8: PIPE8 */ | ||
| 246 | #define BRDY7 0x0080 /* b7: PIPE7 */ | ||
| 247 | #define BRDY6 0x0040 /* b6: PIPE6 */ | ||
| 248 | #define BRDY5 0x0020 /* b5: PIPE5 */ | ||
| 249 | #define BRDY4 0x0010 /* b4: PIPE4 */ | ||
| 250 | #define BRDY3 0x0008 /* b3: PIPE3 */ | ||
| 251 | #define BRDY2 0x0004 /* b2: PIPE2 */ | ||
| 252 | #define BRDY1 0x0002 /* b1: PIPE1 */ | ||
| 253 | #define BRDY0 0x0001 /* b1: PIPE0 */ | ||
| 254 | |||
| 255 | /* NRDY Interrupt Enable/Status Register */ | ||
| 256 | #define NRDY9 0x0200 /* b9: PIPE9 */ | ||
| 257 | #define NRDY8 0x0100 /* b8: PIPE8 */ | ||
| 258 | #define NRDY7 0x0080 /* b7: PIPE7 */ | ||
| 259 | #define NRDY6 0x0040 /* b6: PIPE6 */ | ||
| 260 | #define NRDY5 0x0020 /* b5: PIPE5 */ | ||
| 261 | #define NRDY4 0x0010 /* b4: PIPE4 */ | ||
| 262 | #define NRDY3 0x0008 /* b3: PIPE3 */ | ||
| 263 | #define NRDY2 0x0004 /* b2: PIPE2 */ | ||
| 264 | #define NRDY1 0x0002 /* b1: PIPE1 */ | ||
| 265 | #define NRDY0 0x0001 /* b1: PIPE0 */ | ||
| 266 | |||
| 267 | /* BEMP Interrupt Enable/Status Register */ | ||
| 268 | #define BEMP9 0x0200 /* b9: PIPE9 */ | ||
| 269 | #define BEMP8 0x0100 /* b8: PIPE8 */ | ||
| 270 | #define BEMP7 0x0080 /* b7: PIPE7 */ | ||
| 271 | #define BEMP6 0x0040 /* b6: PIPE6 */ | ||
| 272 | #define BEMP5 0x0020 /* b5: PIPE5 */ | ||
| 273 | #define BEMP4 0x0010 /* b4: PIPE4 */ | ||
| 274 | #define BEMP3 0x0008 /* b3: PIPE3 */ | ||
| 275 | #define BEMP2 0x0004 /* b2: PIPE2 */ | ||
| 276 | #define BEMP1 0x0002 /* b1: PIPE1 */ | ||
| 277 | #define BEMP0 0x0001 /* b0: PIPE0 */ | ||
| 278 | |||
| 279 | /* SOF Pin Configuration Register */ | ||
| 280 | #define TRNENSEL 0x0100 /* b8: Select transaction enable period */ | ||
| 281 | #define BRDYM 0x0040 /* b6: BRDY clear timing */ | ||
| 282 | #define INTL 0x0020 /* b5: Interrupt sense select */ | ||
| 283 | #define EDGESTS 0x0010 /* b4: */ | ||
| 284 | #define SOFMODE 0x000C /* b3-2: SOF pin select */ | ||
| 285 | #define SOF_125US 0x0008 /* SOF OUT 125us Frame Signal */ | ||
| 286 | #define SOF_1MS 0x0004 /* SOF OUT 1ms Frame Signal */ | ||
| 287 | #define SOF_DISABLE 0x0000 /* SOF OUT Disable */ | ||
| 288 | |||
| 289 | /* Interrupt Status Register 0 */ | ||
| 290 | #define VBINT 0x8000 /* b15: VBUS interrupt */ | ||
| 291 | #define RESM 0x4000 /* b14: Resume interrupt */ | ||
| 292 | #define SOFR 0x2000 /* b13: SOF frame update interrupt */ | ||
| 293 | #define DVST 0x1000 /* b12: Device state transition interrupt */ | ||
| 294 | #define CTRT 0x0800 /* b11: Control transfer stage transition interrupt */ | ||
| 295 | #define BEMP 0x0400 /* b10: Buffer empty interrupt */ | ||
| 296 | #define NRDY 0x0200 /* b9: Buffer not ready interrupt */ | ||
| 297 | #define BRDY 0x0100 /* b8: Buffer ready interrupt */ | ||
| 298 | #define VBSTS 0x0080 /* b7: VBUS input port */ | ||
| 299 | #define DVSQ 0x0070 /* b6-4: Device state */ | ||
| 300 | #define DS_SPD_CNFG 0x0070 /* Suspend Configured */ | ||
| 301 | #define DS_SPD_ADDR 0x0060 /* Suspend Address */ | ||
| 302 | #define DS_SPD_DFLT 0x0050 /* Suspend Default */ | ||
| 303 | #define DS_SPD_POWR 0x0040 /* Suspend Powered */ | ||
| 304 | #define DS_SUSP 0x0040 /* Suspend */ | ||
| 305 | #define DS_CNFG 0x0030 /* Configured */ | ||
| 306 | #define DS_ADDS 0x0020 /* Address */ | ||
| 307 | #define DS_DFLT 0x0010 /* Default */ | ||
| 308 | #define DS_POWR 0x0000 /* Powered */ | ||
| 309 | #define DVSQS 0x0030 /* b5-4: Device state */ | ||
| 310 | #define VALID 0x0008 /* b3: Setup packet detected flag */ | ||
| 311 | #define CTSQ 0x0007 /* b2-0: Control transfer stage */ | ||
| 312 | #define CS_SQER 0x0006 /* Sequence error */ | ||
| 313 | #define CS_WRND 0x0005 /* Control write nodata status stage */ | ||
| 314 | #define CS_WRSS 0x0004 /* Control write status stage */ | ||
| 315 | #define CS_WRDS 0x0003 /* Control write data stage */ | ||
| 316 | #define CS_RDSS 0x0002 /* Control read status stage */ | ||
| 317 | #define CS_RDDS 0x0001 /* Control read data stage */ | ||
| 318 | #define CS_IDST 0x0000 /* Idle or setup stage */ | ||
| 319 | |||
| 320 | /* Interrupt Status Register 1 */ | ||
| 321 | #define OVRCR 0x8000 /* b15: Over-current interrupt */ | ||
| 322 | #define BCHG 0x4000 /* b14: USB bus chenge interrupt */ | ||
| 323 | #define DTCH 0x1000 /* b12: Detach sense interrupt */ | ||
| 324 | #define ATTCH 0x0800 /* b11: Attach sense interrupt */ | ||
| 325 | #define EOFERR 0x0040 /* b6: EOF-error interrupt */ | ||
| 326 | #define SIGN 0x0020 /* b5: Setup ignore interrupt */ | ||
| 327 | #define SACK 0x0010 /* b4: Setup acknowledge interrupt */ | ||
| 328 | |||
| 329 | /* Frame Number Register */ | ||
| 330 | #define OVRN 0x8000 /* b15: Overrun error */ | ||
| 331 | #define CRCE 0x4000 /* b14: Received data error */ | ||
| 332 | #define FRNM 0x07FF /* b10-0: Frame number */ | ||
| 333 | |||
| 334 | /* Micro Frame Number Register */ | ||
| 335 | #define UFRNM 0x0007 /* b2-0: Micro frame number */ | ||
| 336 | |||
| 337 | /* Default Control Pipe Maxpacket Size Register */ | ||
| 338 | /* Pipe Maxpacket Size Register */ | ||
| 339 | #define DEVSEL 0xF000 /* b15-14: Device address select */ | ||
| 340 | #define MAXP 0x007F /* b6-0: Maxpacket size of default control pipe */ | ||
| 341 | |||
| 342 | /* Default Control Pipe Control Register */ | ||
| 343 | #define BSTS 0x8000 /* b15: Buffer status */ | ||
| 344 | #define SUREQ 0x4000 /* b14: Send USB request */ | ||
| 345 | #define CSCLR 0x2000 /* b13: complete-split status clear */ | ||
| 346 | #define CSSTS 0x1000 /* b12: complete-split status */ | ||
| 347 | #define SUREQCLR 0x0800 /* b11: stop setup request */ | ||
| 348 | #define SQCLR 0x0100 /* b8: Sequence toggle bit clear */ | ||
| 349 | #define SQSET 0x0080 /* b7: Sequence toggle bit set */ | ||
| 350 | #define SQMON 0x0040 /* b6: Sequence toggle bit monitor */ | ||
| 351 | #define PBUSY 0x0020 /* b5: pipe busy */ | ||
| 352 | #define PINGE 0x0010 /* b4: ping enable */ | ||
| 353 | #define CCPL 0x0004 /* b2: Enable control transfer complete */ | ||
| 354 | #define PID 0x0003 /* b1-0: Response PID */ | ||
| 355 | #define PID_STALL11 0x0003 /* STALL */ | ||
| 356 | #define PID_STALL 0x0002 /* STALL */ | ||
| 357 | #define PID_BUF 0x0001 /* BUF */ | ||
| 358 | #define PID_NAK 0x0000 /* NAK */ | ||
| 359 | |||
| 360 | /* Pipe Window Select Register */ | ||
| 361 | #define PIPENM 0x0007 /* b2-0: Pipe select */ | ||
| 362 | |||
| 363 | /* Pipe Configuration Register */ | ||
| 364 | #define R8A66597_TYP 0xC000 /* b15-14: Transfer type */ | ||
| 365 | #define R8A66597_ISO 0xC000 /* Isochronous */ | ||
| 366 | #define R8A66597_INT 0x8000 /* Interrupt */ | ||
| 367 | #define R8A66597_BULK 0x4000 /* Bulk */ | ||
| 368 | #define R8A66597_BFRE 0x0400 /* b10: Buffer ready interrupt mode select */ | ||
| 369 | #define R8A66597_DBLB 0x0200 /* b9: Double buffer mode select */ | ||
| 370 | #define R8A66597_CNTMD 0x0100 /* b8: Continuous transfer mode select */ | ||
| 371 | #define R8A66597_SHTNAK 0x0080 /* b7: Transfer end NAK */ | ||
| 372 | #define R8A66597_DIR 0x0010 /* b4: Transfer direction select */ | ||
| 373 | #define R8A66597_EPNUM 0x000F /* b3-0: Eendpoint number select */ | ||
| 374 | |||
| 375 | /* Pipe Buffer Configuration Register */ | ||
| 376 | #define BUFSIZE 0x7C00 /* b14-10: Pipe buffer size */ | ||
| 377 | #define BUFNMB 0x007F /* b6-0: Pipe buffer number */ | ||
| 378 | #define PIPE0BUF 256 | ||
| 379 | #define PIPExBUF 64 | ||
| 380 | |||
| 381 | /* Pipe Maxpacket Size Register */ | ||
| 382 | #define MXPS 0x07FF /* b10-0: Maxpacket size */ | ||
| 383 | |||
| 384 | /* Pipe Cycle Configuration Register */ | ||
| 385 | #define IFIS 0x1000 /* b12: Isochronous in-buffer flush mode select */ | ||
| 386 | #define IITV 0x0007 /* b2-0: Isochronous interval */ | ||
| 387 | |||
| 388 | /* Pipex Control Register */ | ||
| 389 | #define BSTS 0x8000 /* b15: Buffer status */ | ||
| 390 | #define INBUFM 0x4000 /* b14: IN buffer monitor (Only for PIPE1 to 5) */ | ||
| 391 | #define CSCLR 0x2000 /* b13: complete-split status clear */ | ||
| 392 | #define CSSTS 0x1000 /* b12: complete-split status */ | ||
| 393 | #define ATREPM 0x0400 /* b10: Auto repeat mode */ | ||
| 394 | #define ACLRM 0x0200 /* b9: Out buffer auto clear mode */ | ||
| 395 | #define SQCLR 0x0100 /* b8: Sequence toggle bit clear */ | ||
| 396 | #define SQSET 0x0080 /* b7: Sequence toggle bit set */ | ||
| 397 | #define SQMON 0x0040 /* b6: Sequence toggle bit monitor */ | ||
| 398 | #define PBUSY 0x0020 /* b5: pipe busy */ | ||
| 399 | #define PID 0x0003 /* b1-0: Response PID */ | ||
| 400 | |||
| 401 | /* PIPExTRE */ | ||
| 402 | #define TRENB 0x0200 /* b9: Transaction counter enable */ | ||
| 403 | #define TRCLR 0x0100 /* b8: Transaction counter clear */ | ||
| 404 | |||
| 405 | /* PIPExTRN */ | ||
| 406 | #define TRNCNT 0xFFFF /* b15-0: Transaction counter */ | ||
| 407 | |||
| 408 | /* DEVADDx */ | ||
| 409 | #define UPPHUB 0x7800 | ||
| 410 | #define HUBPORT 0x0700 | ||
| 411 | #define USBSPD 0x00C0 | ||
| 412 | #define RTPORT 0x0001 | ||
| 413 | |||
| 414 | #endif /* __LINUX_USB_R8A66597_H */ | ||
| 44 | 415 | ||
diff --git a/include/linux/usb/rndis_host.h b/include/linux/usb/rndis_host.h index 37836b937d97..1ef1ebc2b04f 100644 --- a/include/linux/usb/rndis_host.h +++ b/include/linux/usb/rndis_host.h | |||
| @@ -70,12 +70,13 @@ struct rndis_msg_hdr { | |||
| 70 | #define RNDIS_MSG_KEEPALIVE_C (RNDIS_MSG_KEEPALIVE|RNDIS_MSG_COMPLETION) | 70 | #define RNDIS_MSG_KEEPALIVE_C (RNDIS_MSG_KEEPALIVE|RNDIS_MSG_COMPLETION) |
| 71 | 71 | ||
| 72 | /* codes for "status" field of completion messages */ | 72 | /* codes for "status" field of completion messages */ |
| 73 | #define RNDIS_STATUS_SUCCESS cpu_to_le32(0x00000000) | 73 | #define RNDIS_STATUS_SUCCESS cpu_to_le32(0x00000000) |
| 74 | #define RNDIS_STATUS_FAILURE cpu_to_le32(0xc0000001) | 74 | #define RNDIS_STATUS_FAILURE cpu_to_le32(0xc0000001) |
| 75 | #define RNDIS_STATUS_INVALID_DATA cpu_to_le32(0xc0010015) | 75 | #define RNDIS_STATUS_INVALID_DATA cpu_to_le32(0xc0010015) |
| 76 | #define RNDIS_STATUS_NOT_SUPPORTED cpu_to_le32(0xc00000bb) | 76 | #define RNDIS_STATUS_NOT_SUPPORTED cpu_to_le32(0xc00000bb) |
| 77 | #define RNDIS_STATUS_MEDIA_CONNECT cpu_to_le32(0x4001000b) | 77 | #define RNDIS_STATUS_MEDIA_CONNECT cpu_to_le32(0x4001000b) |
| 78 | #define RNDIS_STATUS_MEDIA_DISCONNECT cpu_to_le32(0x4001000c) | 78 | #define RNDIS_STATUS_MEDIA_DISCONNECT cpu_to_le32(0x4001000c) |
| 79 | #define RNDIS_STATUS_MEDIA_SPECIFIC_INDICATION cpu_to_le32(0x40010012) | ||
| 79 | 80 | ||
| 80 | /* codes for OID_GEN_PHYSICAL_MEDIUM */ | 81 | /* codes for OID_GEN_PHYSICAL_MEDIUM */ |
| 81 | #define RNDIS_PHYSICAL_MEDIUM_UNSPECIFIED cpu_to_le32(0x00000000) | 82 | #define RNDIS_PHYSICAL_MEDIUM_UNSPECIFIED cpu_to_le32(0x00000000) |
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index 0ec50ba62139..ce911ebf91e8 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h | |||
| @@ -59,6 +59,7 @@ enum port_dev_state { | |||
| 59 | * @bulk_out_buffer: pointer to the bulk out buffer for this port. | 59 | * @bulk_out_buffer: pointer to the bulk out buffer for this port. |
| 60 | * @bulk_out_size: the size of the bulk_out_buffer, in bytes. | 60 | * @bulk_out_size: the size of the bulk_out_buffer, in bytes. |
| 61 | * @write_urb: pointer to the bulk out struct urb for this port. | 61 | * @write_urb: pointer to the bulk out struct urb for this port. |
| 62 | * @write_fifo: kfifo used to buffer outgoing data | ||
| 62 | * @write_urb_busy: port`s writing status | 63 | * @write_urb_busy: port`s writing status |
| 63 | * @bulk_out_endpointAddress: endpoint address for the bulk out pipe for this | 64 | * @bulk_out_endpointAddress: endpoint address for the bulk out pipe for this |
| 64 | * port. | 65 | * port. |
| @@ -96,6 +97,7 @@ struct usb_serial_port { | |||
| 96 | unsigned char *bulk_out_buffer; | 97 | unsigned char *bulk_out_buffer; |
| 97 | int bulk_out_size; | 98 | int bulk_out_size; |
| 98 | struct urb *write_urb; | 99 | struct urb *write_urb; |
| 100 | struct kfifo *write_fifo; | ||
| 99 | int write_urb_busy; | 101 | int write_urb_busy; |
| 100 | __u8 bulk_out_endpointAddress; | 102 | __u8 bulk_out_endpointAddress; |
| 101 | 103 | ||
| @@ -148,6 +150,7 @@ struct usb_serial { | |||
| 148 | struct usb_interface *interface; | 150 | struct usb_interface *interface; |
| 149 | unsigned char disconnected:1; | 151 | unsigned char disconnected:1; |
| 150 | unsigned char suspending:1; | 152 | unsigned char suspending:1; |
| 153 | unsigned char attached:1; | ||
| 151 | unsigned char minor; | 154 | unsigned char minor; |
| 152 | unsigned char num_ports; | 155 | unsigned char num_ports; |
| 153 | unsigned char num_port_pointers; | 156 | unsigned char num_port_pointers; |
| @@ -238,9 +241,8 @@ struct usb_serial_driver { | |||
| 238 | int (*resume)(struct usb_serial *serial); | 241 | int (*resume)(struct usb_serial *serial); |
| 239 | 242 | ||
| 240 | /* serial function calls */ | 243 | /* serial function calls */ |
| 241 | /* Called by console with tty = NULL and by tty */ | 244 | /* Called by console and by the tty layer */ |
| 242 | int (*open)(struct tty_struct *tty, | 245 | int (*open)(struct tty_struct *tty, struct usb_serial_port *port); |
| 243 | struct usb_serial_port *port, struct file *filp); | ||
| 244 | void (*close)(struct usb_serial_port *port); | 246 | void (*close)(struct usb_serial_port *port); |
| 245 | int (*write)(struct tty_struct *tty, struct usb_serial_port *port, | 247 | int (*write)(struct tty_struct *tty, struct usb_serial_port *port, |
| 246 | const unsigned char *buf, int count); | 248 | const unsigned char *buf, int count); |
| @@ -261,6 +263,9 @@ struct usb_serial_driver { | |||
| 261 | be an attached tty at this point */ | 263 | be an attached tty at this point */ |
| 262 | void (*dtr_rts)(struct usb_serial_port *port, int on); | 264 | void (*dtr_rts)(struct usb_serial_port *port, int on); |
| 263 | int (*carrier_raised)(struct usb_serial_port *port); | 265 | int (*carrier_raised)(struct usb_serial_port *port); |
| 266 | /* Called by the usb serial hooks to allow the user to rework the | ||
| 267 | termios state */ | ||
| 268 | void (*init_termios)(struct tty_struct *tty); | ||
| 264 | /* USB events */ | 269 | /* USB events */ |
| 265 | void (*read_int_callback)(struct urb *urb); | 270 | void (*read_int_callback)(struct urb *urb); |
| 266 | void (*write_int_callback)(struct urb *urb); | 271 | void (*write_int_callback)(struct urb *urb); |
| @@ -300,7 +305,7 @@ static inline void usb_serial_console_disconnect(struct usb_serial *serial) {} | |||
| 300 | extern struct usb_serial *usb_serial_get_by_index(unsigned int minor); | 305 | extern struct usb_serial *usb_serial_get_by_index(unsigned int minor); |
| 301 | extern void usb_serial_put(struct usb_serial *serial); | 306 | extern void usb_serial_put(struct usb_serial *serial); |
| 302 | extern int usb_serial_generic_open(struct tty_struct *tty, | 307 | extern int usb_serial_generic_open(struct tty_struct *tty, |
| 303 | struct usb_serial_port *port, struct file *filp); | 308 | struct usb_serial_port *port); |
| 304 | extern int usb_serial_generic_write(struct tty_struct *tty, | 309 | extern int usb_serial_generic_write(struct tty_struct *tty, |
| 305 | struct usb_serial_port *port, const unsigned char *buf, int count); | 310 | struct usb_serial_port *port, const unsigned char *buf, int count); |
| 306 | extern void usb_serial_generic_close(struct usb_serial_port *port); | 311 | extern void usb_serial_generic_close(struct usb_serial_port *port); |
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h index 310e18a880ff..f81473052059 100644 --- a/include/linux/usb/usbnet.h +++ b/include/linux/usb/usbnet.h | |||
| @@ -53,6 +53,7 @@ struct usbnet { | |||
| 53 | struct sk_buff_head rxq; | 53 | struct sk_buff_head rxq; |
| 54 | struct sk_buff_head txq; | 54 | struct sk_buff_head txq; |
| 55 | struct sk_buff_head done; | 55 | struct sk_buff_head done; |
| 56 | struct sk_buff_head rxq_pause; | ||
| 56 | struct urb *interrupt; | 57 | struct urb *interrupt; |
| 57 | struct tasklet_struct bh; | 58 | struct tasklet_struct bh; |
| 58 | 59 | ||
| @@ -63,6 +64,7 @@ struct usbnet { | |||
| 63 | # define EVENT_RX_MEMORY 2 | 64 | # define EVENT_RX_MEMORY 2 |
| 64 | # define EVENT_STS_SPLIT 3 | 65 | # define EVENT_STS_SPLIT 3 |
| 65 | # define EVENT_LINK_RESET 4 | 66 | # define EVENT_LINK_RESET 4 |
| 67 | # define EVENT_RX_PAUSED 5 | ||
| 66 | }; | 68 | }; |
| 67 | 69 | ||
| 68 | static inline struct usb_driver *driver_of(struct usb_interface *intf) | 70 | static inline struct usb_driver *driver_of(struct usb_interface *intf) |
| @@ -86,6 +88,8 @@ struct driver_info { | |||
| 86 | 88 | ||
| 87 | #define FLAG_FRAMING_AX 0x0040 /* AX88772/178 packets */ | 89 | #define FLAG_FRAMING_AX 0x0040 /* AX88772/178 packets */ |
| 88 | #define FLAG_WLAN 0x0080 /* use "wlan%d" names */ | 90 | #define FLAG_WLAN 0x0080 /* use "wlan%d" names */ |
| 91 | #define FLAG_AVOID_UNLINK_URBS 0x0100 /* don't unlink urbs at usbnet_stop() */ | ||
| 92 | #define FLAG_SEND_ZLP 0x0200 /* hw requires ZLPs are sent */ | ||
| 89 | 93 | ||
| 90 | 94 | ||
| 91 | /* init device ... can sleep, or cause probe() failure */ | 95 | /* init device ... can sleep, or cause probe() failure */ |
| @@ -97,6 +101,9 @@ struct driver_info { | |||
| 97 | /* reset device ... can sleep */ | 101 | /* reset device ... can sleep */ |
| 98 | int (*reset)(struct usbnet *); | 102 | int (*reset)(struct usbnet *); |
| 99 | 103 | ||
| 104 | /* stop device ... can sleep */ | ||
| 105 | int (*stop)(struct usbnet *); | ||
| 106 | |||
| 100 | /* see if peer is connected ... can sleep */ | 107 | /* see if peer is connected ... can sleep */ |
| 101 | int (*check_connect)(struct usbnet *); | 108 | int (*check_connect)(struct usbnet *); |
| 102 | 109 | ||
| @@ -118,9 +125,8 @@ struct driver_info { | |||
| 118 | * right after minidriver have initialized hardware. */ | 125 | * right after minidriver have initialized hardware. */ |
| 119 | int (*early_init)(struct usbnet *dev); | 126 | int (*early_init)(struct usbnet *dev); |
| 120 | 127 | ||
| 121 | /* called by minidriver when link state changes, state: 0=disconnect, | 128 | /* called by minidriver when receiving indication */ |
| 122 | * 1=connect */ | 129 | void (*indication)(struct usbnet *dev, void *ind, int indlen); |
| 123 | void (*link_change)(struct usbnet *dev, int state); | ||
| 124 | 130 | ||
| 125 | /* for new devices, use the descriptor-reading code instead */ | 131 | /* for new devices, use the descriptor-reading code instead */ |
| 126 | int in; /* rx endpoint */ | 132 | int in; /* rx endpoint */ |
| @@ -177,7 +183,8 @@ struct skb_data { /* skb->cb is one of these */ | |||
| 177 | 183 | ||
| 178 | extern int usbnet_open (struct net_device *net); | 184 | extern int usbnet_open (struct net_device *net); |
| 179 | extern int usbnet_stop (struct net_device *net); | 185 | extern int usbnet_stop (struct net_device *net); |
| 180 | extern int usbnet_start_xmit (struct sk_buff *skb, struct net_device *net); | 186 | extern netdev_tx_t usbnet_start_xmit (struct sk_buff *skb, |
| 187 | struct net_device *net); | ||
| 181 | extern void usbnet_tx_timeout (struct net_device *net); | 188 | extern void usbnet_tx_timeout (struct net_device *net); |
| 182 | extern int usbnet_change_mtu (struct net_device *net, int new_mtu); | 189 | extern int usbnet_change_mtu (struct net_device *net, int new_mtu); |
| 183 | 190 | ||
| @@ -187,6 +194,10 @@ extern void usbnet_defer_kevent (struct usbnet *, int); | |||
| 187 | extern void usbnet_skb_return (struct usbnet *, struct sk_buff *); | 194 | extern void usbnet_skb_return (struct usbnet *, struct sk_buff *); |
| 188 | extern void usbnet_unlink_rx_urbs(struct usbnet *); | 195 | extern void usbnet_unlink_rx_urbs(struct usbnet *); |
| 189 | 196 | ||
| 197 | extern void usbnet_pause_rx(struct usbnet *); | ||
| 198 | extern void usbnet_resume_rx(struct usbnet *); | ||
| 199 | extern void usbnet_purge_paused_rxq(struct usbnet *); | ||
| 200 | |||
| 190 | extern int usbnet_get_settings (struct net_device *net, struct ethtool_cmd *cmd); | 201 | extern int usbnet_get_settings (struct net_device *net, struct ethtool_cmd *cmd); |
| 191 | extern int usbnet_set_settings (struct net_device *net, struct ethtool_cmd *cmd); | 202 | extern int usbnet_set_settings (struct net_device *net, struct ethtool_cmd *cmd); |
| 192 | extern u32 usbnet_get_link (struct net_device *net); | 203 | extern u32 usbnet_get_link (struct net_device *net); |
diff --git a/include/linux/usb/video.h b/include/linux/usb/video.h new file mode 100644 index 000000000000..be436d9ee479 --- /dev/null +++ b/include/linux/usb/video.h | |||
| @@ -0,0 +1,164 @@ | |||
| 1 | /* | ||
| 2 | * USB Video Class definitions. | ||
| 3 | * | ||
| 4 | * Copyright (C) 2009 Laurent Pinchart <laurent.pinchart@skynet.be> | ||
| 5 | * | ||
| 6 | * This file holds USB constants and structures defined by the USB Device | ||
| 7 | * Class Definition for Video Devices. Unless otherwise stated, comments | ||
| 8 | * below reference relevant sections of the USB Video Class 1.1 specification | ||
| 9 | * available at | ||
| 10 | * | ||
| 11 | * http://www.usb.org/developers/devclass_docs/USB_Video_Class_1_1.zip | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __LINUX_USB_VIDEO_H | ||
| 15 | #define __LINUX_USB_VIDEO_H | ||
| 16 | |||
| 17 | #include <linux/types.h> | ||
| 18 | |||
| 19 | /* -------------------------------------------------------------------------- | ||
| 20 | * UVC constants | ||
| 21 | */ | ||
| 22 | |||
| 23 | /* A.2. Video Interface Subclass Codes */ | ||
| 24 | #define UVC_SC_UNDEFINED 0x00 | ||
| 25 | #define UVC_SC_VIDEOCONTROL 0x01 | ||
| 26 | #define UVC_SC_VIDEOSTREAMING 0x02 | ||
| 27 | #define UVC_SC_VIDEO_INTERFACE_COLLECTION 0x03 | ||
| 28 | |||
| 29 | /* A.3. Video Interface Protocol Codes */ | ||
| 30 | #define UVC_PC_PROTOCOL_UNDEFINED 0x00 | ||
| 31 | |||
| 32 | /* A.5. Video Class-Specific VC Interface Descriptor Subtypes */ | ||
| 33 | #define UVC_VC_DESCRIPTOR_UNDEFINED 0x00 | ||
| 34 | #define UVC_VC_HEADER 0x01 | ||
| 35 | #define UVC_VC_INPUT_TERMINAL 0x02 | ||
| 36 | #define UVC_VC_OUTPUT_TERMINAL 0x03 | ||
| 37 | #define UVC_VC_SELECTOR_UNIT 0x04 | ||
| 38 | #define UVC_VC_PROCESSING_UNIT 0x05 | ||
| 39 | #define UVC_VC_EXTENSION_UNIT 0x06 | ||
| 40 | |||
| 41 | /* A.6. Video Class-Specific VS Interface Descriptor Subtypes */ | ||
| 42 | #define UVC_VS_UNDEFINED 0x00 | ||
| 43 | #define UVC_VS_INPUT_HEADER 0x01 | ||
| 44 | #define UVC_VS_OUTPUT_HEADER 0x02 | ||
| 45 | #define UVC_VS_STILL_IMAGE_FRAME 0x03 | ||
| 46 | #define UVC_VS_FORMAT_UNCOMPRESSED 0x04 | ||
| 47 | #define UVC_VS_FRAME_UNCOMPRESSED 0x05 | ||
| 48 | #define UVC_VS_FORMAT_MJPEG 0x06 | ||
| 49 | #define UVC_VS_FRAME_MJPEG 0x07 | ||
| 50 | #define UVC_VS_FORMAT_MPEG2TS 0x0a | ||
| 51 | #define UVC_VS_FORMAT_DV 0x0c | ||
| 52 | #define UVC_VS_COLORFORMAT 0x0d | ||
| 53 | #define UVC_VS_FORMAT_FRAME_BASED 0x10 | ||
| 54 | #define UVC_VS_FRAME_FRAME_BASED 0x11 | ||
| 55 | #define UVC_VS_FORMAT_STREAM_BASED 0x12 | ||
| 56 | |||
| 57 | /* A.7. Video Class-Specific Endpoint Descriptor Subtypes */ | ||
| 58 | #define UVC_EP_UNDEFINED 0x00 | ||
| 59 | #define UVC_EP_GENERAL 0x01 | ||
| 60 | #define UVC_EP_ENDPOINT 0x02 | ||
| 61 | #define UVC_EP_INTERRUPT 0x03 | ||
| 62 | |||
| 63 | /* A.8. Video Class-Specific Request Codes */ | ||
| 64 | #define UVC_RC_UNDEFINED 0x00 | ||
| 65 | #define UVC_SET_CUR 0x01 | ||
| 66 | #define UVC_GET_CUR 0x81 | ||
| 67 | #define UVC_GET_MIN 0x82 | ||
| 68 | #define UVC_GET_MAX 0x83 | ||
| 69 | #define UVC_GET_RES 0x84 | ||
| 70 | #define UVC_GET_LEN 0x85 | ||
| 71 | #define UVC_GET_INFO 0x86 | ||
| 72 | #define UVC_GET_DEF 0x87 | ||
| 73 | |||
| 74 | /* A.9.1. VideoControl Interface Control Selectors */ | ||
| 75 | #define UVC_VC_CONTROL_UNDEFINED 0x00 | ||
| 76 | #define UVC_VC_VIDEO_POWER_MODE_CONTROL 0x01 | ||
| 77 | #define UVC_VC_REQUEST_ERROR_CODE_CONTROL 0x02 | ||
| 78 | |||
| 79 | /* A.9.2. Terminal Control Selectors */ | ||
| 80 | #define UVC_TE_CONTROL_UNDEFINED 0x00 | ||
| 81 | |||
| 82 | /* A.9.3. Selector Unit Control Selectors */ | ||
| 83 | #define UVC_SU_CONTROL_UNDEFINED 0x00 | ||
| 84 | #define UVC_SU_INPUT_SELECT_CONTROL 0x01 | ||
| 85 | |||
| 86 | /* A.9.4. Camera Terminal Control Selectors */ | ||
| 87 | #define UVC_CT_CONTROL_UNDEFINED 0x00 | ||
| 88 | #define UVC_CT_SCANNING_MODE_CONTROL 0x01 | ||
| 89 | #define UVC_CT_AE_MODE_CONTROL 0x02 | ||
| 90 | #define UVC_CT_AE_PRIORITY_CONTROL 0x03 | ||
| 91 | #define UVC_CT_EXPOSURE_TIME_ABSOLUTE_CONTROL 0x04 | ||
| 92 | #define UVC_CT_EXPOSURE_TIME_RELATIVE_CONTROL 0x05 | ||
| 93 | #define UVC_CT_FOCUS_ABSOLUTE_CONTROL 0x06 | ||
| 94 | #define UVC_CT_FOCUS_RELATIVE_CONTROL 0x07 | ||
| 95 | #define UVC_CT_FOCUS_AUTO_CONTROL 0x08 | ||
| 96 | #define UVC_CT_IRIS_ABSOLUTE_CONTROL 0x09 | ||
| 97 | #define UVC_CT_IRIS_RELATIVE_CONTROL 0x0a | ||
| 98 | #define UVC_CT_ZOOM_ABSOLUTE_CONTROL 0x0b | ||
| 99 | #define UVC_CT_ZOOM_RELATIVE_CONTROL 0x0c | ||
| 100 | #define UVC_CT_PANTILT_ABSOLUTE_CONTROL 0x0d | ||
| 101 | #define UVC_CT_PANTILT_RELATIVE_CONTROL 0x0e | ||
| 102 | #define UVC_CT_ROLL_ABSOLUTE_CONTROL 0x0f | ||
| 103 | #define UVC_CT_ROLL_RELATIVE_CONTROL 0x10 | ||
| 104 | #define UVC_CT_PRIVACY_CONTROL 0x11 | ||
| 105 | |||
| 106 | /* A.9.5. Processing Unit Control Selectors */ | ||
| 107 | #define UVC_PU_CONTROL_UNDEFINED 0x00 | ||
| 108 | #define UVC_PU_BACKLIGHT_COMPENSATION_CONTROL 0x01 | ||
| 109 | #define UVC_PU_BRIGHTNESS_CONTROL 0x02 | ||
| 110 | #define UVC_PU_CONTRAST_CONTROL 0x03 | ||
| 111 | #define UVC_PU_GAIN_CONTROL 0x04 | ||
| 112 | #define UVC_PU_POWER_LINE_FREQUENCY_CONTROL 0x05 | ||
| 113 | #define UVC_PU_HUE_CONTROL 0x06 | ||
| 114 | #define UVC_PU_SATURATION_CONTROL 0x07 | ||
| 115 | #define UVC_PU_SHARPNESS_CONTROL 0x08 | ||
| 116 | #define UVC_PU_GAMMA_CONTROL 0x09 | ||
| 117 | #define UVC_PU_WHITE_BALANCE_TEMPERATURE_CONTROL 0x0a | ||
| 118 | #define UVC_PU_WHITE_BALANCE_TEMPERATURE_AUTO_CONTROL 0x0b | ||
| 119 | #define UVC_PU_WHITE_BALANCE_COMPONENT_CONTROL 0x0c | ||
| 120 | #define UVC_PU_WHITE_BALANCE_COMPONENT_AUTO_CONTROL 0x0d | ||
| 121 | #define UVC_PU_DIGITAL_MULTIPLIER_CONTROL 0x0e | ||
| 122 | #define UVC_PU_DIGITAL_MULTIPLIER_LIMIT_CONTROL 0x0f | ||
| 123 | #define UVC_PU_HUE_AUTO_CONTROL 0x10 | ||
| 124 | #define UVC_PU_ANALOG_VIDEO_STANDARD_CONTROL 0x11 | ||
| 125 | #define UVC_PU_ANALOG_LOCK_STATUS_CONTROL 0x12 | ||
| 126 | |||
| 127 | /* A.9.7. VideoStreaming Interface Control Selectors */ | ||
| 128 | #define UVC_VS_CONTROL_UNDEFINED 0x00 | ||
| 129 | #define UVC_VS_PROBE_CONTROL 0x01 | ||
| 130 | #define UVC_VS_COMMIT_CONTROL 0x02 | ||
| 131 | #define UVC_VS_STILL_PROBE_CONTROL 0x03 | ||
| 132 | #define UVC_VS_STILL_COMMIT_CONTROL 0x04 | ||
| 133 | #define UVC_VS_STILL_IMAGE_TRIGGER_CONTROL 0x05 | ||
| 134 | #define UVC_VS_STREAM_ERROR_CODE_CONTROL 0x06 | ||
| 135 | #define UVC_VS_GENERATE_KEY_FRAME_CONTROL 0x07 | ||
| 136 | #define UVC_VS_UPDATE_FRAME_SEGMENT_CONTROL 0x08 | ||
| 137 | #define UVC_VS_SYNC_DELAY_CONTROL 0x09 | ||
| 138 | |||
| 139 | /* B.1. USB Terminal Types */ | ||
| 140 | #define UVC_TT_VENDOR_SPECIFIC 0x0100 | ||
| 141 | #define UVC_TT_STREAMING 0x0101 | ||
| 142 | |||
| 143 | /* B.2. Input Terminal Types */ | ||
| 144 | #define UVC_ITT_VENDOR_SPECIFIC 0x0200 | ||
| 145 | #define UVC_ITT_CAMERA 0x0201 | ||
| 146 | #define UVC_ITT_MEDIA_TRANSPORT_INPUT 0x0202 | ||
| 147 | |||
| 148 | /* B.3. Output Terminal Types */ | ||
| 149 | #define UVC_OTT_VENDOR_SPECIFIC 0x0300 | ||
| 150 | #define UVC_OTT_DISPLAY 0x0301 | ||
| 151 | #define UVC_OTT_MEDIA_TRANSPORT_OUTPUT 0x0302 | ||
| 152 | |||
| 153 | /* B.4. External Terminal Types */ | ||
| 154 | #define UVC_EXTERNAL_VENDOR_SPECIFIC 0x0400 | ||
| 155 | #define UVC_COMPOSITE_CONNECTOR 0x0401 | ||
| 156 | #define UVC_SVIDEO_CONNECTOR 0x0402 | ||
| 157 | #define UVC_COMPONENT_CONNECTOR 0x0403 | ||
| 158 | |||
| 159 | /* 2.4.2.2. Status Packet Type */ | ||
| 160 | #define UVC_STATUS_TYPE_CONTROL 1 | ||
| 161 | #define UVC_STATUS_TYPE_STREAMING 2 | ||
| 162 | |||
| 163 | #endif /* __LINUX_USB_VIDEO_H */ | ||
| 164 | |||
diff --git a/include/linux/usbdevice_fs.h b/include/linux/usbdevice_fs.h index 0044d9b4cb85..b2a7d8ba6ee3 100644 --- a/include/linux/usbdevice_fs.h +++ b/include/linux/usbdevice_fs.h | |||
| @@ -77,6 +77,7 @@ struct usbdevfs_connectinfo { | |||
| 77 | 77 | ||
| 78 | #define USBDEVFS_URB_SHORT_NOT_OK 0x01 | 78 | #define USBDEVFS_URB_SHORT_NOT_OK 0x01 |
| 79 | #define USBDEVFS_URB_ISO_ASAP 0x02 | 79 | #define USBDEVFS_URB_ISO_ASAP 0x02 |
| 80 | #define USBDEVFS_URB_BULK_CONTINUATION 0x04 | ||
| 80 | #define USBDEVFS_URB_NO_FSBR 0x20 | 81 | #define USBDEVFS_URB_NO_FSBR 0x20 |
| 81 | #define USBDEVFS_URB_ZERO_PACKET 0x40 | 82 | #define USBDEVFS_URB_ZERO_PACKET 0x40 |
| 82 | #define USBDEVFS_URB_NO_INTERRUPT 0x80 | 83 | #define USBDEVFS_URB_NO_INTERRUPT 0x80 |
| @@ -175,4 +176,6 @@ struct usbdevfs_ioctl32 { | |||
| 175 | #define USBDEVFS_CLEAR_HALT _IOR('U', 21, unsigned int) | 176 | #define USBDEVFS_CLEAR_HALT _IOR('U', 21, unsigned int) |
| 176 | #define USBDEVFS_DISCONNECT _IO('U', 22) | 177 | #define USBDEVFS_DISCONNECT _IO('U', 22) |
| 177 | #define USBDEVFS_CONNECT _IO('U', 23) | 178 | #define USBDEVFS_CONNECT _IO('U', 23) |
| 179 | #define USBDEVFS_CLAIM_PORT _IOR('U', 24, unsigned int) | ||
| 180 | #define USBDEVFS_RELEASE_PORT _IOR('U', 25, unsigned int) | ||
| 178 | #endif /* _LINUX_USBDEVICE_FS_H */ | 181 | #endif /* _LINUX_USBDEVICE_FS_H */ |
diff --git a/include/linux/utsname.h b/include/linux/utsname.h index 3656b300de3a..69f39974c041 100644 --- a/include/linux/utsname.h +++ b/include/linux/utsname.h | |||
| @@ -36,7 +36,6 @@ struct new_utsname { | |||
| 36 | #include <linux/kref.h> | 36 | #include <linux/kref.h> |
| 37 | #include <linux/nsproxy.h> | 37 | #include <linux/nsproxy.h> |
| 38 | #include <linux/err.h> | 38 | #include <linux/err.h> |
| 39 | #include <asm/atomic.h> | ||
| 40 | 39 | ||
| 41 | struct uts_namespace { | 40 | struct uts_namespace { |
| 42 | struct kref kref; | 41 | struct kref kref; |
diff --git a/include/linux/uwb.h b/include/linux/uwb.h index c02128991ff7..7fc9746f22cd 100644 --- a/include/linux/uwb.h +++ b/include/linux/uwb.h | |||
| @@ -597,7 +597,7 @@ void uwb_rc_neh_grok(struct uwb_rc *, void *, size_t); | |||
| 597 | void uwb_rc_neh_error(struct uwb_rc *, int); | 597 | void uwb_rc_neh_error(struct uwb_rc *, int); |
| 598 | void uwb_rc_reset_all(struct uwb_rc *rc); | 598 | void uwb_rc_reset_all(struct uwb_rc *rc); |
| 599 | void uwb_rc_pre_reset(struct uwb_rc *rc); | 599 | void uwb_rc_pre_reset(struct uwb_rc *rc); |
| 600 | void uwb_rc_post_reset(struct uwb_rc *rc); | 600 | int uwb_rc_post_reset(struct uwb_rc *rc); |
| 601 | 601 | ||
| 602 | /** | 602 | /** |
| 603 | * uwb_rsv_is_owner - is the owner of this reservation the RC? | 603 | * uwb_rsv_is_owner - is the owner of this reservation the RC? |
diff --git a/include/linux/vgaarb.h b/include/linux/vgaarb.h new file mode 100644 index 000000000000..2dfaa293ae8c --- /dev/null +++ b/include/linux/vgaarb.h | |||
| @@ -0,0 +1,210 @@ | |||
| 1 | /* | ||
| 2 | * The VGA aribiter manages VGA space routing and VGA resource decode to | ||
| 3 | * allow multiple VGA devices to be used in a system in a safe way. | ||
| 4 | * | ||
| 5 | * (C) Copyright 2005 Benjamin Herrenschmidt <benh@kernel.crashing.org> | ||
| 6 | * (C) Copyright 2007 Paulo R. Zanoni <przanoni@gmail.com> | ||
| 7 | * (C) Copyright 2007, 2009 Tiago Vignatti <vignatti@freedesktop.org> | ||
| 8 | */ | ||
| 9 | |||
| 10 | #ifndef LINUX_VGA_H | ||
| 11 | |||
| 12 | #include <asm/vga.h> | ||
| 13 | |||
| 14 | /* Legacy VGA regions */ | ||
| 15 | #define VGA_RSRC_NONE 0x00 | ||
| 16 | #define VGA_RSRC_LEGACY_IO 0x01 | ||
| 17 | #define VGA_RSRC_LEGACY_MEM 0x02 | ||
| 18 | #define VGA_RSRC_LEGACY_MASK (VGA_RSRC_LEGACY_IO | VGA_RSRC_LEGACY_MEM) | ||
| 19 | /* Non-legacy access */ | ||
| 20 | #define VGA_RSRC_NORMAL_IO 0x04 | ||
| 21 | #define VGA_RSRC_NORMAL_MEM 0x08 | ||
| 22 | |||
| 23 | /* Passing that instead of a pci_dev to use the system "default" | ||
| 24 | * device, that is the one used by vgacon. Archs will probably | ||
| 25 | * have to provide their own vga_default_device(); | ||
| 26 | */ | ||
| 27 | #define VGA_DEFAULT_DEVICE (NULL) | ||
| 28 | |||
| 29 | /* For use by clients */ | ||
| 30 | |||
| 31 | /** | ||
| 32 | * vga_set_legacy_decoding | ||
| 33 | * | ||
| 34 | * @pdev: pci device of the VGA card | ||
| 35 | * @decodes: bit mask of what legacy regions the card decodes | ||
| 36 | * | ||
| 37 | * Indicates to the arbiter if the card decodes legacy VGA IOs, | ||
| 38 | * legacy VGA Memory, both, or none. All cards default to both, | ||
| 39 | * the card driver (fbdev for example) should tell the arbiter | ||
| 40 | * if it has disabled legacy decoding, so the card can be left | ||
| 41 | * out of the arbitration process (and can be safe to take | ||
| 42 | * interrupts at any time. | ||
| 43 | */ | ||
| 44 | extern void vga_set_legacy_decoding(struct pci_dev *pdev, | ||
| 45 | unsigned int decodes); | ||
| 46 | |||
| 47 | /** | ||
| 48 | * vga_get - acquire & locks VGA resources | ||
| 49 | * | ||
| 50 | * @pdev: pci device of the VGA card or NULL for the system default | ||
| 51 | * @rsrc: bit mask of resources to acquire and lock | ||
| 52 | * @interruptible: blocking should be interruptible by signals ? | ||
| 53 | * | ||
| 54 | * This function acquires VGA resources for the given | ||
| 55 | * card and mark those resources locked. If the resource requested | ||
| 56 | * are "normal" (and not legacy) resources, the arbiter will first check | ||
| 57 | * wether the card is doing legacy decoding for that type of resource. If | ||
| 58 | * yes, the lock is "converted" into a legacy resource lock. | ||
| 59 | * The arbiter will first look for all VGA cards that might conflict | ||
| 60 | * and disable their IOs and/or Memory access, inlcuding VGA forwarding | ||
| 61 | * on P2P bridges if necessary, so that the requested resources can | ||
| 62 | * be used. Then, the card is marked as locking these resources and | ||
| 63 | * the IO and/or Memory accesse are enabled on the card (including | ||
| 64 | * VGA forwarding on parent P2P bridges if any). | ||
| 65 | * This function will block if some conflicting card is already locking | ||
| 66 | * one of the required resources (or any resource on a different bus | ||
| 67 | * segment, since P2P bridges don't differenciate VGA memory and IO | ||
| 68 | * afaik). You can indicate wether this blocking should be interruptible | ||
| 69 | * by a signal (for userland interface) or not. | ||
| 70 | * Must not be called at interrupt time or in atomic context. | ||
| 71 | * If the card already owns the resources, the function succeeds. | ||
| 72 | * Nested calls are supported (a per-resource counter is maintained) | ||
| 73 | */ | ||
| 74 | |||
| 75 | extern int vga_get(struct pci_dev *pdev, unsigned int rsrc, | ||
| 76 | int interruptible); | ||
| 77 | |||
| 78 | /** | ||
| 79 | * vga_get_interruptible | ||
| 80 | * | ||
| 81 | * Shortcut to vga_get | ||
| 82 | */ | ||
| 83 | |||
| 84 | static inline int vga_get_interruptible(struct pci_dev *pdev, | ||
| 85 | unsigned int rsrc) | ||
| 86 | { | ||
| 87 | return vga_get(pdev, rsrc, 1); | ||
| 88 | } | ||
| 89 | |||
| 90 | /** | ||
| 91 | * vga_get_uninterruptible | ||
| 92 | * | ||
| 93 | * Shortcut to vga_get | ||
| 94 | */ | ||
| 95 | |||
| 96 | static inline int vga_get_uninterruptible(struct pci_dev *pdev, | ||
| 97 | unsigned int rsrc) | ||
| 98 | { | ||
| 99 | return vga_get(pdev, rsrc, 0); | ||
| 100 | } | ||
| 101 | |||
| 102 | /** | ||
| 103 | * vga_tryget - try to acquire & lock legacy VGA resources | ||
| 104 | * | ||
| 105 | * @pdev: pci devivce of VGA card or NULL for system default | ||
| 106 | * @rsrc: bit mask of resources to acquire and lock | ||
| 107 | * | ||
| 108 | * This function performs the same operation as vga_get(), but | ||
| 109 | * will return an error (-EBUSY) instead of blocking if the resources | ||
| 110 | * are already locked by another card. It can be called in any context | ||
| 111 | */ | ||
| 112 | |||
| 113 | extern int vga_tryget(struct pci_dev *pdev, unsigned int rsrc); | ||
| 114 | |||
| 115 | /** | ||
| 116 | * vga_put - release lock on legacy VGA resources | ||
| 117 | * | ||
| 118 | * @pdev: pci device of VGA card or NULL for system default | ||
| 119 | * @rsrc: but mask of resource to release | ||
| 120 | * | ||
| 121 | * This function releases resources previously locked by vga_get() | ||
| 122 | * or vga_tryget(). The resources aren't disabled right away, so | ||
| 123 | * that a subsequence vga_get() on the same card will succeed | ||
| 124 | * immediately. Resources have a counter, so locks are only | ||
| 125 | * released if the counter reaches 0. | ||
| 126 | */ | ||
| 127 | |||
| 128 | extern void vga_put(struct pci_dev *pdev, unsigned int rsrc); | ||
| 129 | |||
| 130 | |||
| 131 | /** | ||
| 132 | * vga_default_device | ||
| 133 | * | ||
| 134 | * This can be defined by the platform. The default implementation | ||
| 135 | * is rather dumb and will probably only work properly on single | ||
| 136 | * vga card setups and/or x86 platforms. | ||
| 137 | * | ||
| 138 | * If your VGA default device is not PCI, you'll have to return | ||
| 139 | * NULL here. In this case, I assume it will not conflict with | ||
| 140 | * any PCI card. If this is not true, I'll have to define two archs | ||
| 141 | * hooks for enabling/disabling the VGA default device if that is | ||
| 142 | * possible. This may be a problem with real _ISA_ VGA cards, in | ||
| 143 | * addition to a PCI one. I don't know at this point how to deal | ||
| 144 | * with that card. Can theirs IOs be disabled at all ? If not, then | ||
| 145 | * I suppose it's a matter of having the proper arch hook telling | ||
| 146 | * us about it, so we basically never allow anybody to succeed a | ||
| 147 | * vga_get()... | ||
| 148 | */ | ||
| 149 | |||
| 150 | #ifndef __ARCH_HAS_VGA_DEFAULT_DEVICE | ||
| 151 | extern struct pci_dev *vga_default_device(void); | ||
| 152 | #endif | ||
| 153 | |||
| 154 | /** | ||
| 155 | * vga_conflicts | ||
| 156 | * | ||
| 157 | * Architectures should define this if they have several | ||
| 158 | * independant PCI domains that can afford concurrent VGA | ||
| 159 | * decoding | ||
| 160 | */ | ||
| 161 | |||
| 162 | #ifndef __ARCH_HAS_VGA_CONFLICT | ||
| 163 | static inline int vga_conflicts(struct pci_dev *p1, struct pci_dev *p2) | ||
| 164 | { | ||
| 165 | return 1; | ||
| 166 | } | ||
| 167 | #endif | ||
| 168 | |||
| 169 | /** | ||
| 170 | * vga_client_register | ||
| 171 | * | ||
| 172 | * @pdev: pci device of the VGA client | ||
| 173 | * @cookie: client cookie to be used in callbacks | ||
| 174 | * @irq_set_state: irq state change callback | ||
| 175 | * @set_vga_decode: vga decode change callback | ||
| 176 | * | ||
| 177 | * return value: 0 on success, -1 on failure | ||
| 178 | * Register a client with the VGA arbitration logic | ||
| 179 | * | ||
| 180 | * Clients have two callback mechanisms they can use. | ||
| 181 | * irq enable/disable callback - | ||
| 182 | * If a client can't disable its GPUs VGA resources, then we | ||
| 183 | * need to be able to ask it to turn off its irqs when we | ||
| 184 | * turn off its mem and io decoding. | ||
| 185 | * set_vga_decode | ||
| 186 | * If a client can disable its GPU VGA resource, it will | ||
| 187 | * get a callback from this to set the encode/decode state | ||
| 188 | * | ||
| 189 | * Rationale: we cannot disable VGA decode resources unconditionally | ||
| 190 | * some single GPU laptops seem to require ACPI or BIOS access to the | ||
| 191 | * VGA registers to control things like backlights etc. | ||
| 192 | * Hopefully newer multi-GPU laptops do something saner, and desktops | ||
| 193 | * won't have any special ACPI for this. | ||
| 194 | * They driver will get a callback when VGA arbitration is first used | ||
| 195 | * by userspace since we some older X servers have issues. | ||
| 196 | */ | ||
| 197 | #if defined(CONFIG_VGA_ARB) | ||
| 198 | int vga_client_register(struct pci_dev *pdev, void *cookie, | ||
| 199 | void (*irq_set_state)(void *cookie, bool state), | ||
| 200 | unsigned int (*set_vga_decode)(void *cookie, bool state)); | ||
| 201 | #else | ||
| 202 | static inline int vga_client_register(struct pci_dev *pdev, void *cookie, | ||
| 203 | void (*irq_set_state)(void *cookie, bool state), | ||
| 204 | unsigned int (*set_vga_decode)(void *cookie, bool state)) | ||
| 205 | { | ||
| 206 | return 0; | ||
| 207 | } | ||
| 208 | #endif | ||
| 209 | |||
| 210 | #endif /* LINUX_VGA_H */ | ||
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index 74f16876f38d..b59e78c57161 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
| @@ -167,6 +167,7 @@ enum v4l2_ctrl_type { | |||
| 167 | V4L2_CTRL_TYPE_BUTTON = 4, | 167 | V4L2_CTRL_TYPE_BUTTON = 4, |
| 168 | V4L2_CTRL_TYPE_INTEGER64 = 5, | 168 | V4L2_CTRL_TYPE_INTEGER64 = 5, |
| 169 | V4L2_CTRL_TYPE_CTRL_CLASS = 6, | 169 | V4L2_CTRL_TYPE_CTRL_CLASS = 6, |
| 170 | V4L2_CTRL_TYPE_STRING = 7, | ||
| 170 | }; | 171 | }; |
| 171 | 172 | ||
| 172 | enum v4l2_tuner_type { | 173 | enum v4l2_tuner_type { |
| @@ -252,10 +253,12 @@ struct v4l2_capability { | |||
| 252 | #define V4L2_CAP_RDS_CAPTURE 0x00000100 /* RDS data capture */ | 253 | #define V4L2_CAP_RDS_CAPTURE 0x00000100 /* RDS data capture */ |
| 253 | #define V4L2_CAP_VIDEO_OUTPUT_OVERLAY 0x00000200 /* Can do video output overlay */ | 254 | #define V4L2_CAP_VIDEO_OUTPUT_OVERLAY 0x00000200 /* Can do video output overlay */ |
| 254 | #define V4L2_CAP_HW_FREQ_SEEK 0x00000400 /* Can do hardware frequency seek */ | 255 | #define V4L2_CAP_HW_FREQ_SEEK 0x00000400 /* Can do hardware frequency seek */ |
| 256 | #define V4L2_CAP_RDS_OUTPUT 0x00000800 /* Is an RDS encoder */ | ||
| 255 | 257 | ||
| 256 | #define V4L2_CAP_TUNER 0x00010000 /* has a tuner */ | 258 | #define V4L2_CAP_TUNER 0x00010000 /* has a tuner */ |
| 257 | #define V4L2_CAP_AUDIO 0x00020000 /* has audio support */ | 259 | #define V4L2_CAP_AUDIO 0x00020000 /* has audio support */ |
| 258 | #define V4L2_CAP_RADIO 0x00040000 /* is a radio device */ | 260 | #define V4L2_CAP_RADIO 0x00040000 /* is a radio device */ |
| 261 | #define V4L2_CAP_MODULATOR 0x00080000 /* has a modulator */ | ||
| 259 | 262 | ||
| 260 | #define V4L2_CAP_READWRITE 0x01000000 /* read/write systemcalls */ | 263 | #define V4L2_CAP_READWRITE 0x01000000 /* read/write systemcalls */ |
| 261 | #define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */ | 264 | #define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */ |
| @@ -275,7 +278,9 @@ struct v4l2_pix_format { | |||
| 275 | __u32 priv; /* private data, depends on pixelformat */ | 278 | __u32 priv; /* private data, depends on pixelformat */ |
| 276 | }; | 279 | }; |
| 277 | 280 | ||
| 278 | /* Pixel format FOURCC depth Description */ | 281 | /* Pixel format FOURCC depth Description */ |
| 282 | |||
| 283 | /* RGB formats */ | ||
| 279 | #define V4L2_PIX_FMT_RGB332 v4l2_fourcc('R', 'G', 'B', '1') /* 8 RGB-3-3-2 */ | 284 | #define V4L2_PIX_FMT_RGB332 v4l2_fourcc('R', 'G', 'B', '1') /* 8 RGB-3-3-2 */ |
| 280 | #define V4L2_PIX_FMT_RGB444 v4l2_fourcc('R', '4', '4', '4') /* 16 xxxxrrrr ggggbbbb */ | 285 | #define V4L2_PIX_FMT_RGB444 v4l2_fourcc('R', '4', '4', '4') /* 16 xxxxrrrr ggggbbbb */ |
| 281 | #define V4L2_PIX_FMT_RGB555 v4l2_fourcc('R', 'G', 'B', 'O') /* 16 RGB-5-5-5 */ | 286 | #define V4L2_PIX_FMT_RGB555 v4l2_fourcc('R', 'G', 'B', 'O') /* 16 RGB-5-5-5 */ |
| @@ -286,12 +291,20 @@ struct v4l2_pix_format { | |||
| 286 | #define V4L2_PIX_FMT_RGB24 v4l2_fourcc('R', 'G', 'B', '3') /* 24 RGB-8-8-8 */ | 291 | #define V4L2_PIX_FMT_RGB24 v4l2_fourcc('R', 'G', 'B', '3') /* 24 RGB-8-8-8 */ |
| 287 | #define V4L2_PIX_FMT_BGR32 v4l2_fourcc('B', 'G', 'R', '4') /* 32 BGR-8-8-8-8 */ | 292 | #define V4L2_PIX_FMT_BGR32 v4l2_fourcc('B', 'G', 'R', '4') /* 32 BGR-8-8-8-8 */ |
| 288 | #define V4L2_PIX_FMT_RGB32 v4l2_fourcc('R', 'G', 'B', '4') /* 32 RGB-8-8-8-8 */ | 293 | #define V4L2_PIX_FMT_RGB32 v4l2_fourcc('R', 'G', 'B', '4') /* 32 RGB-8-8-8-8 */ |
| 294 | |||
| 295 | /* Grey formats */ | ||
| 289 | #define V4L2_PIX_FMT_GREY v4l2_fourcc('G', 'R', 'E', 'Y') /* 8 Greyscale */ | 296 | #define V4L2_PIX_FMT_GREY v4l2_fourcc('G', 'R', 'E', 'Y') /* 8 Greyscale */ |
| 290 | #define V4L2_PIX_FMT_Y16 v4l2_fourcc('Y', '1', '6', ' ') /* 16 Greyscale */ | 297 | #define V4L2_PIX_FMT_Y16 v4l2_fourcc('Y', '1', '6', ' ') /* 16 Greyscale */ |
| 298 | |||
| 299 | /* Palette formats */ | ||
| 291 | #define V4L2_PIX_FMT_PAL8 v4l2_fourcc('P', 'A', 'L', '8') /* 8 8-bit palette */ | 300 | #define V4L2_PIX_FMT_PAL8 v4l2_fourcc('P', 'A', 'L', '8') /* 8 8-bit palette */ |
| 301 | |||
| 302 | /* Luminance+Chrominance formats */ | ||
| 292 | #define V4L2_PIX_FMT_YVU410 v4l2_fourcc('Y', 'V', 'U', '9') /* 9 YVU 4:1:0 */ | 303 | #define V4L2_PIX_FMT_YVU410 v4l2_fourcc('Y', 'V', 'U', '9') /* 9 YVU 4:1:0 */ |
| 293 | #define V4L2_PIX_FMT_YVU420 v4l2_fourcc('Y', 'V', '1', '2') /* 12 YVU 4:2:0 */ | 304 | #define V4L2_PIX_FMT_YVU420 v4l2_fourcc('Y', 'V', '1', '2') /* 12 YVU 4:2:0 */ |
| 294 | #define V4L2_PIX_FMT_YUYV v4l2_fourcc('Y', 'U', 'Y', 'V') /* 16 YUV 4:2:2 */ | 305 | #define V4L2_PIX_FMT_YUYV v4l2_fourcc('Y', 'U', 'Y', 'V') /* 16 YUV 4:2:2 */ |
| 306 | #define V4L2_PIX_FMT_YYUV v4l2_fourcc('Y', 'Y', 'U', 'V') /* 16 YUV 4:2:2 */ | ||
| 307 | #define V4L2_PIX_FMT_YVYU v4l2_fourcc('Y', 'V', 'Y', 'U') /* 16 YVU 4:2:2 */ | ||
| 295 | #define V4L2_PIX_FMT_UYVY v4l2_fourcc('U', 'Y', 'V', 'Y') /* 16 YUV 4:2:2 */ | 308 | #define V4L2_PIX_FMT_UYVY v4l2_fourcc('U', 'Y', 'V', 'Y') /* 16 YUV 4:2:2 */ |
| 296 | #define V4L2_PIX_FMT_VYUY v4l2_fourcc('V', 'Y', 'U', 'Y') /* 16 YUV 4:2:2 */ | 309 | #define V4L2_PIX_FMT_VYUY v4l2_fourcc('V', 'Y', 'U', 'Y') /* 16 YUV 4:2:2 */ |
| 297 | #define V4L2_PIX_FMT_YUV422P v4l2_fourcc('4', '2', '2', 'P') /* 16 YVU422 planar */ | 310 | #define V4L2_PIX_FMT_YUV422P v4l2_fourcc('4', '2', '2', 'P') /* 16 YVU422 planar */ |
| @@ -301,6 +314,10 @@ struct v4l2_pix_format { | |||
| 301 | #define V4L2_PIX_FMT_YUV555 v4l2_fourcc('Y', 'U', 'V', 'O') /* 16 YUV-5-5-5 */ | 314 | #define V4L2_PIX_FMT_YUV555 v4l2_fourcc('Y', 'U', 'V', 'O') /* 16 YUV-5-5-5 */ |
| 302 | #define V4L2_PIX_FMT_YUV565 v4l2_fourcc('Y', 'U', 'V', 'P') /* 16 YUV-5-6-5 */ | 315 | #define V4L2_PIX_FMT_YUV565 v4l2_fourcc('Y', 'U', 'V', 'P') /* 16 YUV-5-6-5 */ |
| 303 | #define V4L2_PIX_FMT_YUV32 v4l2_fourcc('Y', 'U', 'V', '4') /* 32 YUV-8-8-8-8 */ | 316 | #define V4L2_PIX_FMT_YUV32 v4l2_fourcc('Y', 'U', 'V', '4') /* 32 YUV-8-8-8-8 */ |
| 317 | #define V4L2_PIX_FMT_YUV410 v4l2_fourcc('Y', 'U', 'V', '9') /* 9 YUV 4:1:0 */ | ||
| 318 | #define V4L2_PIX_FMT_YUV420 v4l2_fourcc('Y', 'U', '1', '2') /* 12 YUV 4:2:0 */ | ||
| 319 | #define V4L2_PIX_FMT_HI240 v4l2_fourcc('H', 'I', '2', '4') /* 8 8-bit color */ | ||
| 320 | #define V4L2_PIX_FMT_HM12 v4l2_fourcc('H', 'M', '1', '2') /* 8 YUV 4:2:0 16x16 macroblocks */ | ||
| 304 | 321 | ||
| 305 | /* two planes -- one Y, one Cr + Cb interleaved */ | 322 | /* two planes -- one Y, one Cr + Cb interleaved */ |
| 306 | #define V4L2_PIX_FMT_NV12 v4l2_fourcc('N', 'V', '1', '2') /* 12 Y/CbCr 4:2:0 */ | 323 | #define V4L2_PIX_FMT_NV12 v4l2_fourcc('N', 'V', '1', '2') /* 12 Y/CbCr 4:2:0 */ |
| @@ -308,25 +325,17 @@ struct v4l2_pix_format { | |||
| 308 | #define V4L2_PIX_FMT_NV16 v4l2_fourcc('N', 'V', '1', '6') /* 16 Y/CbCr 4:2:2 */ | 325 | #define V4L2_PIX_FMT_NV16 v4l2_fourcc('N', 'V', '1', '6') /* 16 Y/CbCr 4:2:2 */ |
| 309 | #define V4L2_PIX_FMT_NV61 v4l2_fourcc('N', 'V', '6', '1') /* 16 Y/CrCb 4:2:2 */ | 326 | #define V4L2_PIX_FMT_NV61 v4l2_fourcc('N', 'V', '6', '1') /* 16 Y/CrCb 4:2:2 */ |
| 310 | 327 | ||
| 311 | /* The following formats are not defined in the V4L2 specification */ | 328 | /* Bayer formats - see http://www.siliconimaging.com/RGB%20Bayer.htm */ |
| 312 | #define V4L2_PIX_FMT_YUV410 v4l2_fourcc('Y', 'U', 'V', '9') /* 9 YUV 4:1:0 */ | ||
| 313 | #define V4L2_PIX_FMT_YUV420 v4l2_fourcc('Y', 'U', '1', '2') /* 12 YUV 4:2:0 */ | ||
| 314 | #define V4L2_PIX_FMT_YYUV v4l2_fourcc('Y', 'Y', 'U', 'V') /* 16 YUV 4:2:2 */ | ||
| 315 | #define V4L2_PIX_FMT_HI240 v4l2_fourcc('H', 'I', '2', '4') /* 8 8-bit color */ | ||
| 316 | #define V4L2_PIX_FMT_HM12 v4l2_fourcc('H', 'M', '1', '2') /* 8 YUV 4:2:0 16x16 macroblocks */ | ||
| 317 | |||
| 318 | /* see http://www.siliconimaging.com/RGB%20Bayer.htm */ | ||
| 319 | #define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */ | 329 | #define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */ |
| 320 | #define V4L2_PIX_FMT_SGBRG8 v4l2_fourcc('G', 'B', 'R', 'G') /* 8 GBGB.. RGRG.. */ | 330 | #define V4L2_PIX_FMT_SGBRG8 v4l2_fourcc('G', 'B', 'R', 'G') /* 8 GBGB.. RGRG.. */ |
| 321 | #define V4L2_PIX_FMT_SGRBG8 v4l2_fourcc('G', 'R', 'B', 'G') /* 8 GRGR.. BGBG.. */ | 331 | #define V4L2_PIX_FMT_SGRBG8 v4l2_fourcc('G', 'R', 'B', 'G') /* 8 GRGR.. BGBG.. */ |
| 322 | 332 | #define V4L2_PIX_FMT_SGRBG10 v4l2_fourcc('B', 'A', '1', '0') /* 10bit raw bayer */ | |
| 323 | /* | 333 | /* 10bit raw bayer DPCM compressed to 8 bits */ |
| 324 | * 10bit raw bayer, expanded to 16 bits | ||
| 325 | * xxxxrrrrrrrrrrxxxxgggggggggg xxxxggggggggggxxxxbbbbbbbbbb... | ||
| 326 | */ | ||
| 327 | #define V4L2_PIX_FMT_SGRBG10 v4l2_fourcc('B', 'A', '1', '0') | ||
| 328 | /* 10bit raw bayer DPCM compressed to 8 bits */ | ||
| 329 | #define V4L2_PIX_FMT_SGRBG10DPCM8 v4l2_fourcc('B', 'D', '1', '0') | 334 | #define V4L2_PIX_FMT_SGRBG10DPCM8 v4l2_fourcc('B', 'D', '1', '0') |
| 335 | /* | ||
| 336 | * 10bit raw bayer, expanded to 16 bits | ||
| 337 | * xxxxrrrrrrrrrrxxxxgggggggggg xxxxggggggggggxxxxbbbbbbbbbb... | ||
| 338 | */ | ||
| 330 | #define V4L2_PIX_FMT_SBGGR16 v4l2_fourcc('B', 'Y', 'R', '2') /* 16 BGBG.. GRGR.. */ | 339 | #define V4L2_PIX_FMT_SBGGR16 v4l2_fourcc('B', 'Y', 'R', '2') /* 16 BGBG.. GRGR.. */ |
| 331 | 340 | ||
| 332 | /* compressed formats */ | 341 | /* compressed formats */ |
| @@ -350,7 +359,6 @@ struct v4l2_pix_format { | |||
| 350 | #define V4L2_PIX_FMT_MR97310A v4l2_fourcc('M', '3', '1', '0') /* compressed BGGR bayer */ | 359 | #define V4L2_PIX_FMT_MR97310A v4l2_fourcc('M', '3', '1', '0') /* compressed BGGR bayer */ |
| 351 | #define V4L2_PIX_FMT_SQ905C v4l2_fourcc('9', '0', '5', 'C') /* compressed RGGB bayer */ | 360 | #define V4L2_PIX_FMT_SQ905C v4l2_fourcc('9', '0', '5', 'C') /* compressed RGGB bayer */ |
| 352 | #define V4L2_PIX_FMT_PJPG v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */ | 361 | #define V4L2_PIX_FMT_PJPG v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */ |
| 353 | #define V4L2_PIX_FMT_YVYU v4l2_fourcc('Y', 'V', 'Y', 'U') /* 16 YVU 4:2:2 */ | ||
| 354 | #define V4L2_PIX_FMT_OV511 v4l2_fourcc('O', '5', '1', '1') /* ov511 JPEG */ | 362 | #define V4L2_PIX_FMT_OV511 v4l2_fourcc('O', '5', '1', '1') /* ov511 JPEG */ |
| 355 | #define V4L2_PIX_FMT_OV518 v4l2_fourcc('O', '5', '1', '8') /* ov518 JPEG */ | 363 | #define V4L2_PIX_FMT_OV518 v4l2_fourcc('O', '5', '1', '8') /* ov518 JPEG */ |
| 356 | 364 | ||
| @@ -367,6 +375,7 @@ struct v4l2_fmtdesc { | |||
| 367 | }; | 375 | }; |
| 368 | 376 | ||
| 369 | #define V4L2_FMT_FLAG_COMPRESSED 0x0001 | 377 | #define V4L2_FMT_FLAG_COMPRESSED 0x0001 |
| 378 | #define V4L2_FMT_FLAG_EMULATED 0x0002 | ||
| 370 | 379 | ||
| 371 | #if 1 | 380 | #if 1 |
| 372 | /* Experimental Frame Size and frame rate enumeration */ | 381 | /* Experimental Frame Size and frame rate enumeration */ |
| @@ -788,11 +797,12 @@ struct v4l2_control { | |||
| 788 | 797 | ||
| 789 | struct v4l2_ext_control { | 798 | struct v4l2_ext_control { |
| 790 | __u32 id; | 799 | __u32 id; |
| 791 | __u32 reserved2[2]; | 800 | __u32 size; |
| 801 | __u32 reserved2[1]; | ||
| 792 | union { | 802 | union { |
| 793 | __s32 value; | 803 | __s32 value; |
| 794 | __s64 value64; | 804 | __s64 value64; |
| 795 | void *reserved; | 805 | char *string; |
| 796 | }; | 806 | }; |
| 797 | } __attribute__ ((packed)); | 807 | } __attribute__ ((packed)); |
| 798 | 808 | ||
| @@ -808,6 +818,7 @@ struct v4l2_ext_controls { | |||
| 808 | #define V4L2_CTRL_CLASS_USER 0x00980000 /* Old-style 'user' controls */ | 818 | #define V4L2_CTRL_CLASS_USER 0x00980000 /* Old-style 'user' controls */ |
| 809 | #define V4L2_CTRL_CLASS_MPEG 0x00990000 /* MPEG-compression controls */ | 819 | #define V4L2_CTRL_CLASS_MPEG 0x00990000 /* MPEG-compression controls */ |
| 810 | #define V4L2_CTRL_CLASS_CAMERA 0x009a0000 /* Camera class controls */ | 820 | #define V4L2_CTRL_CLASS_CAMERA 0x009a0000 /* Camera class controls */ |
| 821 | #define V4L2_CTRL_CLASS_FM_TX 0x009b0000 /* FM Modulator control class */ | ||
| 811 | 822 | ||
| 812 | #define V4L2_CTRL_ID_MASK (0x0fffffff) | 823 | #define V4L2_CTRL_ID_MASK (0x0fffffff) |
| 813 | #define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL) | 824 | #define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL) |
| @@ -899,9 +910,10 @@ enum v4l2_colorfx { | |||
| 899 | V4L2_COLORFX_SEPIA = 2, | 910 | V4L2_COLORFX_SEPIA = 2, |
| 900 | }; | 911 | }; |
| 901 | #define V4L2_CID_AUTOBRIGHTNESS (V4L2_CID_BASE+32) | 912 | #define V4L2_CID_AUTOBRIGHTNESS (V4L2_CID_BASE+32) |
| 913 | #define V4L2_CID_BAND_STOP_FILTER (V4L2_CID_BASE+33) | ||
| 902 | 914 | ||
| 903 | /* last CID + 1 */ | 915 | /* last CID + 1 */ |
| 904 | #define V4L2_CID_LASTP1 (V4L2_CID_BASE+33) | 916 | #define V4L2_CID_LASTP1 (V4L2_CID_BASE+34) |
| 905 | 917 | ||
| 906 | /* MPEG-class control IDs defined by V4L2 */ | 918 | /* MPEG-class control IDs defined by V4L2 */ |
| 907 | #define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900) | 919 | #define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900) |
| @@ -1147,6 +1159,39 @@ enum v4l2_exposure_auto_type { | |||
| 1147 | 1159 | ||
| 1148 | #define V4L2_CID_PRIVACY (V4L2_CID_CAMERA_CLASS_BASE+16) | 1160 | #define V4L2_CID_PRIVACY (V4L2_CID_CAMERA_CLASS_BASE+16) |
| 1149 | 1161 | ||
| 1162 | /* FM Modulator class control IDs */ | ||
| 1163 | #define V4L2_CID_FM_TX_CLASS_BASE (V4L2_CTRL_CLASS_FM_TX | 0x900) | ||
| 1164 | #define V4L2_CID_FM_TX_CLASS (V4L2_CTRL_CLASS_FM_TX | 1) | ||
| 1165 | |||
| 1166 | #define V4L2_CID_RDS_TX_DEVIATION (V4L2_CID_FM_TX_CLASS_BASE + 1) | ||
| 1167 | #define V4L2_CID_RDS_TX_PI (V4L2_CID_FM_TX_CLASS_BASE + 2) | ||
| 1168 | #define V4L2_CID_RDS_TX_PTY (V4L2_CID_FM_TX_CLASS_BASE + 3) | ||
| 1169 | #define V4L2_CID_RDS_TX_PS_NAME (V4L2_CID_FM_TX_CLASS_BASE + 5) | ||
| 1170 | #define V4L2_CID_RDS_TX_RADIO_TEXT (V4L2_CID_FM_TX_CLASS_BASE + 6) | ||
| 1171 | |||
| 1172 | #define V4L2_CID_AUDIO_LIMITER_ENABLED (V4L2_CID_FM_TX_CLASS_BASE + 64) | ||
| 1173 | #define V4L2_CID_AUDIO_LIMITER_RELEASE_TIME (V4L2_CID_FM_TX_CLASS_BASE + 65) | ||
| 1174 | #define V4L2_CID_AUDIO_LIMITER_DEVIATION (V4L2_CID_FM_TX_CLASS_BASE + 66) | ||
| 1175 | |||
| 1176 | #define V4L2_CID_AUDIO_COMPRESSION_ENABLED (V4L2_CID_FM_TX_CLASS_BASE + 80) | ||
| 1177 | #define V4L2_CID_AUDIO_COMPRESSION_GAIN (V4L2_CID_FM_TX_CLASS_BASE + 81) | ||
| 1178 | #define V4L2_CID_AUDIO_COMPRESSION_THRESHOLD (V4L2_CID_FM_TX_CLASS_BASE + 82) | ||
| 1179 | #define V4L2_CID_AUDIO_COMPRESSION_ATTACK_TIME (V4L2_CID_FM_TX_CLASS_BASE + 83) | ||
| 1180 | #define V4L2_CID_AUDIO_COMPRESSION_RELEASE_TIME (V4L2_CID_FM_TX_CLASS_BASE + 84) | ||
| 1181 | |||
| 1182 | #define V4L2_CID_PILOT_TONE_ENABLED (V4L2_CID_FM_TX_CLASS_BASE + 96) | ||
| 1183 | #define V4L2_CID_PILOT_TONE_DEVIATION (V4L2_CID_FM_TX_CLASS_BASE + 97) | ||
| 1184 | #define V4L2_CID_PILOT_TONE_FREQUENCY (V4L2_CID_FM_TX_CLASS_BASE + 98) | ||
| 1185 | |||
| 1186 | #define V4L2_CID_TUNE_PREEMPHASIS (V4L2_CID_FM_TX_CLASS_BASE + 112) | ||
| 1187 | enum v4l2_preemphasis { | ||
| 1188 | V4L2_PREEMPHASIS_DISABLED = 0, | ||
| 1189 | V4L2_PREEMPHASIS_50_uS = 1, | ||
| 1190 | V4L2_PREEMPHASIS_75_uS = 2, | ||
| 1191 | }; | ||
| 1192 | #define V4L2_CID_TUNE_POWER_LEVEL (V4L2_CID_FM_TX_CLASS_BASE + 113) | ||
| 1193 | #define V4L2_CID_TUNE_ANTENNA_CAPACITOR (V4L2_CID_FM_TX_CLASS_BASE + 114) | ||
| 1194 | |||
| 1150 | /* | 1195 | /* |
| 1151 | * T U N I N G | 1196 | * T U N I N G |
| 1152 | */ | 1197 | */ |
| @@ -1181,6 +1226,7 @@ struct v4l2_modulator { | |||
| 1181 | #define V4L2_TUNER_CAP_LANG2 0x0020 | 1226 | #define V4L2_TUNER_CAP_LANG2 0x0020 |
| 1182 | #define V4L2_TUNER_CAP_SAP 0x0020 | 1227 | #define V4L2_TUNER_CAP_SAP 0x0020 |
| 1183 | #define V4L2_TUNER_CAP_LANG1 0x0040 | 1228 | #define V4L2_TUNER_CAP_LANG1 0x0040 |
| 1229 | #define V4L2_TUNER_CAP_RDS 0x0080 | ||
| 1184 | 1230 | ||
| 1185 | /* Flags for the 'rxsubchans' field */ | 1231 | /* Flags for the 'rxsubchans' field */ |
| 1186 | #define V4L2_TUNER_SUB_MONO 0x0001 | 1232 | #define V4L2_TUNER_SUB_MONO 0x0001 |
| @@ -1188,6 +1234,7 @@ struct v4l2_modulator { | |||
| 1188 | #define V4L2_TUNER_SUB_LANG2 0x0004 | 1234 | #define V4L2_TUNER_SUB_LANG2 0x0004 |
| 1189 | #define V4L2_TUNER_SUB_SAP 0x0004 | 1235 | #define V4L2_TUNER_SUB_SAP 0x0004 |
| 1190 | #define V4L2_TUNER_SUB_LANG1 0x0008 | 1236 | #define V4L2_TUNER_SUB_LANG1 0x0008 |
| 1237 | #define V4L2_TUNER_SUB_RDS 0x0010 | ||
| 1191 | 1238 | ||
| 1192 | /* Values for the 'audmode' field */ | 1239 | /* Values for the 'audmode' field */ |
| 1193 | #define V4L2_TUNER_MODE_MONO 0x0000 | 1240 | #define V4L2_TUNER_MODE_MONO 0x0000 |
| @@ -1213,6 +1260,27 @@ struct v4l2_hw_freq_seek { | |||
| 1213 | }; | 1260 | }; |
| 1214 | 1261 | ||
| 1215 | /* | 1262 | /* |
| 1263 | * R D S | ||
| 1264 | */ | ||
| 1265 | |||
| 1266 | struct v4l2_rds_data { | ||
| 1267 | __u8 lsb; | ||
| 1268 | __u8 msb; | ||
| 1269 | __u8 block; | ||
| 1270 | } __attribute__ ((packed)); | ||
| 1271 | |||
| 1272 | #define V4L2_RDS_BLOCK_MSK 0x7 | ||
| 1273 | #define V4L2_RDS_BLOCK_A 0 | ||
| 1274 | #define V4L2_RDS_BLOCK_B 1 | ||
| 1275 | #define V4L2_RDS_BLOCK_C 2 | ||
| 1276 | #define V4L2_RDS_BLOCK_D 3 | ||
| 1277 | #define V4L2_RDS_BLOCK_C_ALT 4 | ||
| 1278 | #define V4L2_RDS_BLOCK_INVALID 7 | ||
| 1279 | |||
| 1280 | #define V4L2_RDS_BLOCK_CORRECTED 0x40 | ||
| 1281 | #define V4L2_RDS_BLOCK_ERROR 0x80 | ||
| 1282 | |||
| 1283 | /* | ||
| 1216 | * A U D I O | 1284 | * A U D I O |
| 1217 | */ | 1285 | */ |
| 1218 | struct v4l2_audio { | 1286 | struct v4l2_audio { |
diff --git a/include/linux/virtio.h b/include/linux/virtio.h index 4fca4f5440ba..057a2e010758 100644 --- a/include/linux/virtio.h +++ b/include/linux/virtio.h | |||
| @@ -34,7 +34,7 @@ struct virtqueue { | |||
| 34 | * out_num: the number of sg readable by other side | 34 | * out_num: the number of sg readable by other side |
| 35 | * in_num: the number of sg which are writable (after readable ones) | 35 | * in_num: the number of sg which are writable (after readable ones) |
| 36 | * data: the token identifying the buffer. | 36 | * data: the token identifying the buffer. |
| 37 | * Returns 0 or an error. | 37 | * Returns remaining capacity of queue (sg segments) or a negative error. |
| 38 | * @kick: update after add_buf | 38 | * @kick: update after add_buf |
| 39 | * vq: the struct virtqueue | 39 | * vq: the struct virtqueue |
| 40 | * After one or more add_buf calls, invoke this to kick the other side. | 40 | * After one or more add_buf calls, invoke this to kick the other side. |
diff --git a/include/linux/virtio_9p.h b/include/linux/virtio_9p.h index b3c4a60ceeb3..095e10d148b4 100644 --- a/include/linux/virtio_9p.h +++ b/include/linux/virtio_9p.h | |||
| @@ -2,10 +2,9 @@ | |||
| 2 | #define _LINUX_VIRTIO_9P_H | 2 | #define _LINUX_VIRTIO_9P_H |
| 3 | /* This header is BSD licensed so anyone can use the definitions to implement | 3 | /* This header is BSD licensed so anyone can use the definitions to implement |
| 4 | * compatible drivers/servers. */ | 4 | * compatible drivers/servers. */ |
| 5 | #include <linux/virtio_ids.h> | ||
| 5 | #include <linux/virtio_config.h> | 6 | #include <linux/virtio_config.h> |
| 6 | 7 | ||
| 7 | /* The ID for virtio console */ | ||
| 8 | #define VIRTIO_ID_9P 9 | ||
| 9 | /* Maximum number of virtio channels per partition (1 for now) */ | 8 | /* Maximum number of virtio channels per partition (1 for now) */ |
| 10 | #define MAX_9P_CHAN 1 | 9 | #define MAX_9P_CHAN 1 |
| 11 | 10 | ||
diff --git a/include/linux/virtio_balloon.h b/include/linux/virtio_balloon.h index 8726ff77763e..1418f048cb34 100644 --- a/include/linux/virtio_balloon.h +++ b/include/linux/virtio_balloon.h | |||
| @@ -2,11 +2,9 @@ | |||
| 2 | #define _LINUX_VIRTIO_BALLOON_H | 2 | #define _LINUX_VIRTIO_BALLOON_H |
| 3 | /* This header is BSD licensed so anyone can use the definitions to implement | 3 | /* This header is BSD licensed so anyone can use the definitions to implement |
| 4 | * compatible drivers/servers. */ | 4 | * compatible drivers/servers. */ |
| 5 | #include <linux/virtio_ids.h> | ||
| 5 | #include <linux/virtio_config.h> | 6 | #include <linux/virtio_config.h> |
| 6 | 7 | ||
| 7 | /* The ID for virtio_balloon */ | ||
| 8 | #define VIRTIO_ID_BALLOON 5 | ||
| 9 | |||
| 10 | /* The feature bitmap for virtio balloon */ | 8 | /* The feature bitmap for virtio balloon */ |
| 11 | #define VIRTIO_BALLOON_F_MUST_TELL_HOST 0 /* Tell before reclaiming pages */ | 9 | #define VIRTIO_BALLOON_F_MUST_TELL_HOST 0 /* Tell before reclaiming pages */ |
| 12 | 10 | ||
diff --git a/include/linux/virtio_blk.h b/include/linux/virtio_blk.h index 8dab9f2b8832..fd294c56d571 100644 --- a/include/linux/virtio_blk.h +++ b/include/linux/virtio_blk.h | |||
| @@ -3,11 +3,9 @@ | |||
| 3 | /* This header is BSD licensed so anyone can use the definitions to implement | 3 | /* This header is BSD licensed so anyone can use the definitions to implement |
| 4 | * compatible drivers/servers. */ | 4 | * compatible drivers/servers. */ |
| 5 | #include <linux/types.h> | 5 | #include <linux/types.h> |
| 6 | #include <linux/virtio_ids.h> | ||
| 6 | #include <linux/virtio_config.h> | 7 | #include <linux/virtio_config.h> |
| 7 | 8 | ||
| 8 | /* The ID for virtio_block */ | ||
| 9 | #define VIRTIO_ID_BLOCK 2 | ||
| 10 | |||
| 11 | /* Feature bits */ | 9 | /* Feature bits */ |
| 12 | #define VIRTIO_BLK_F_BARRIER 0 /* Does host support barriers? */ | 10 | #define VIRTIO_BLK_F_BARRIER 0 /* Does host support barriers? */ |
| 13 | #define VIRTIO_BLK_F_SIZE_MAX 1 /* Indicates maximum segment size */ | 11 | #define VIRTIO_BLK_F_SIZE_MAX 1 /* Indicates maximum segment size */ |
| @@ -16,9 +14,7 @@ | |||
| 16 | #define VIRTIO_BLK_F_RO 5 /* Disk is read-only */ | 14 | #define VIRTIO_BLK_F_RO 5 /* Disk is read-only */ |
| 17 | #define VIRTIO_BLK_F_BLK_SIZE 6 /* Block size of disk is available*/ | 15 | #define VIRTIO_BLK_F_BLK_SIZE 6 /* Block size of disk is available*/ |
| 18 | #define VIRTIO_BLK_F_SCSI 7 /* Supports scsi command passthru */ | 16 | #define VIRTIO_BLK_F_SCSI 7 /* Supports scsi command passthru */ |
| 19 | #define VIRTIO_BLK_F_IDENTIFY 8 /* ATA IDENTIFY supported */ | 17 | #define VIRTIO_BLK_F_FLUSH 9 /* Cache flush command support */ |
| 20 | |||
| 21 | #define VIRTIO_BLK_ID_BYTES (sizeof(__u16[256])) /* IDENTIFY DATA */ | ||
| 22 | 18 | ||
| 23 | struct virtio_blk_config { | 19 | struct virtio_blk_config { |
| 24 | /* The capacity (in 512-byte sectors). */ | 20 | /* The capacity (in 512-byte sectors). */ |
| @@ -35,9 +31,19 @@ struct virtio_blk_config { | |||
| 35 | } geometry; | 31 | } geometry; |
| 36 | /* block size of device (if VIRTIO_BLK_F_BLK_SIZE) */ | 32 | /* block size of device (if VIRTIO_BLK_F_BLK_SIZE) */ |
| 37 | __u32 blk_size; | 33 | __u32 blk_size; |
| 38 | __u8 identify[VIRTIO_BLK_ID_BYTES]; | ||
| 39 | } __attribute__((packed)); | 34 | } __attribute__((packed)); |
| 40 | 35 | ||
| 36 | /* | ||
| 37 | * Command types | ||
| 38 | * | ||
| 39 | * Usage is a bit tricky as some bits are used as flags and some are not. | ||
| 40 | * | ||
| 41 | * Rules: | ||
| 42 | * VIRTIO_BLK_T_OUT may be combined with VIRTIO_BLK_T_SCSI_CMD or | ||
| 43 | * VIRTIO_BLK_T_BARRIER. VIRTIO_BLK_T_FLUSH is a command of its own | ||
| 44 | * and may not be combined with any of the other flags. | ||
| 45 | */ | ||
| 46 | |||
| 41 | /* These two define direction. */ | 47 | /* These two define direction. */ |
| 42 | #define VIRTIO_BLK_T_IN 0 | 48 | #define VIRTIO_BLK_T_IN 0 |
| 43 | #define VIRTIO_BLK_T_OUT 1 | 49 | #define VIRTIO_BLK_T_OUT 1 |
| @@ -45,6 +51,9 @@ struct virtio_blk_config { | |||
| 45 | /* This bit says it's a scsi command, not an actual read or write. */ | 51 | /* This bit says it's a scsi command, not an actual read or write. */ |
| 46 | #define VIRTIO_BLK_T_SCSI_CMD 2 | 52 | #define VIRTIO_BLK_T_SCSI_CMD 2 |
| 47 | 53 | ||
| 54 | /* Cache flush command */ | ||
| 55 | #define VIRTIO_BLK_T_FLUSH 4 | ||
| 56 | |||
| 48 | /* Barrier before this op. */ | 57 | /* Barrier before this op. */ |
| 49 | #define VIRTIO_BLK_T_BARRIER 0x80000000 | 58 | #define VIRTIO_BLK_T_BARRIER 0x80000000 |
| 50 | 59 | ||
diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index e547e3c8ee9a..0093dd7c1d6f 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h | |||
| @@ -109,8 +109,7 @@ static inline bool virtio_has_feature(const struct virtio_device *vdev, | |||
| 109 | unsigned int fbit) | 109 | unsigned int fbit) |
| 110 | { | 110 | { |
| 111 | /* Did you forget to fix assumptions on max features? */ | 111 | /* Did you forget to fix assumptions on max features? */ |
| 112 | if (__builtin_constant_p(fbit)) | 112 | MAYBE_BUILD_BUG_ON(fbit >= 32); |
| 113 | BUILD_BUG_ON(fbit >= 32); | ||
| 114 | 113 | ||
| 115 | if (fbit < VIRTIO_TRANSPORT_F_START) | 114 | if (fbit < VIRTIO_TRANSPORT_F_START) |
| 116 | virtio_check_driver_offered_feature(vdev, fbit); | 115 | virtio_check_driver_offered_feature(vdev, fbit); |
diff --git a/include/linux/virtio_console.h b/include/linux/virtio_console.h index dc161115ae35..fe885174cc1f 100644 --- a/include/linux/virtio_console.h +++ b/include/linux/virtio_console.h | |||
| @@ -1,13 +1,11 @@ | |||
| 1 | #ifndef _LINUX_VIRTIO_CONSOLE_H | 1 | #ifndef _LINUX_VIRTIO_CONSOLE_H |
| 2 | #define _LINUX_VIRTIO_CONSOLE_H | 2 | #define _LINUX_VIRTIO_CONSOLE_H |
| 3 | #include <linux/types.h> | 3 | #include <linux/types.h> |
| 4 | #include <linux/virtio_ids.h> | ||
| 4 | #include <linux/virtio_config.h> | 5 | #include <linux/virtio_config.h> |
| 5 | /* This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so | 6 | /* This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so |
| 6 | * anyone can use the definitions to implement compatible drivers/servers. */ | 7 | * anyone can use the definitions to implement compatible drivers/servers. */ |
| 7 | 8 | ||
| 8 | /* The ID for virtio console */ | ||
| 9 | #define VIRTIO_ID_CONSOLE 3 | ||
| 10 | |||
| 11 | /* Feature bits */ | 9 | /* Feature bits */ |
| 12 | #define VIRTIO_CONSOLE_F_SIZE 0 /* Does host provide console size? */ | 10 | #define VIRTIO_CONSOLE_F_SIZE 0 /* Does host provide console size? */ |
| 13 | 11 | ||
diff --git a/include/linux/virtio_ids.h b/include/linux/virtio_ids.h new file mode 100644 index 000000000000..06660c0a78d7 --- /dev/null +++ b/include/linux/virtio_ids.h | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | #ifndef _LINUX_VIRTIO_IDS_H | ||
| 2 | #define _LINUX_VIRTIO_IDS_H | ||
| 3 | /* | ||
| 4 | * Virtio IDs | ||
| 5 | * | ||
| 6 | * This header is BSD licensed so anyone can use the definitions to implement | ||
| 7 | * compatible drivers/servers. | ||
| 8 | */ | ||
| 9 | |||
| 10 | #define VIRTIO_ID_NET 1 /* virtio net */ | ||
| 11 | #define VIRTIO_ID_BLOCK 2 /* virtio block */ | ||
| 12 | #define VIRTIO_ID_CONSOLE 3 /* virtio console */ | ||
| 13 | #define VIRTIO_ID_RNG 4 /* virtio ring */ | ||
| 14 | #define VIRTIO_ID_BALLOON 5 /* virtio balloon */ | ||
| 15 | #define VIRTIO_ID_9P 9 /* 9p virtio console */ | ||
| 16 | |||
| 17 | #endif /* _LINUX_VIRTIO_IDS_H */ | ||
diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h index d8dd539c9f48..085e42298ce5 100644 --- a/include/linux/virtio_net.h +++ b/include/linux/virtio_net.h | |||
| @@ -3,12 +3,10 @@ | |||
| 3 | /* This header is BSD licensed so anyone can use the definitions to implement | 3 | /* This header is BSD licensed so anyone can use the definitions to implement |
| 4 | * compatible drivers/servers. */ | 4 | * compatible drivers/servers. */ |
| 5 | #include <linux/types.h> | 5 | #include <linux/types.h> |
| 6 | #include <linux/virtio_ids.h> | ||
| 6 | #include <linux/virtio_config.h> | 7 | #include <linux/virtio_config.h> |
| 7 | #include <linux/if_ether.h> | 8 | #include <linux/if_ether.h> |
| 8 | 9 | ||
| 9 | /* The ID for virtio_net */ | ||
| 10 | #define VIRTIO_ID_NET 1 | ||
| 11 | |||
| 12 | /* The feature bitmap for virtio net */ | 10 | /* The feature bitmap for virtio net */ |
| 13 | #define VIRTIO_NET_F_CSUM 0 /* Host handles pkts w/ partial csum */ | 11 | #define VIRTIO_NET_F_CSUM 0 /* Host handles pkts w/ partial csum */ |
| 14 | #define VIRTIO_NET_F_GUEST_CSUM 1 /* Guest handles pkts w/ partial csum */ | 12 | #define VIRTIO_NET_F_GUEST_CSUM 1 /* Guest handles pkts w/ partial csum */ |
diff --git a/include/linux/virtio_rng.h b/include/linux/virtio_rng.h index 1a85dab8a940..c4d5de896f0c 100644 --- a/include/linux/virtio_rng.h +++ b/include/linux/virtio_rng.h | |||
| @@ -2,9 +2,7 @@ | |||
| 2 | #define _LINUX_VIRTIO_RNG_H | 2 | #define _LINUX_VIRTIO_RNG_H |
| 3 | /* This header is BSD licensed so anyone can use the definitions to implement | 3 | /* This header is BSD licensed so anyone can use the definitions to implement |
| 4 | * compatible drivers/servers. */ | 4 | * compatible drivers/servers. */ |
| 5 | #include <linux/virtio_ids.h> | ||
| 5 | #include <linux/virtio_config.h> | 6 | #include <linux/virtio_config.h> |
| 6 | 7 | ||
| 7 | /* The ID for virtio_rng */ | ||
| 8 | #define VIRTIO_ID_RNG 4 | ||
| 9 | |||
| 10 | #endif /* _LINUX_VIRTIO_RNG_H */ | 8 | #endif /* _LINUX_VIRTIO_RNG_H */ |
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index a43ebec3a7b9..227c2a585e4f 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h | |||
| @@ -115,4 +115,10 @@ extern rwlock_t vmlist_lock; | |||
| 115 | extern struct vm_struct *vmlist; | 115 | extern struct vm_struct *vmlist; |
| 116 | extern __init void vm_area_register_early(struct vm_struct *vm, size_t align); | 116 | extern __init void vm_area_register_early(struct vm_struct *vm, size_t align); |
| 117 | 117 | ||
| 118 | struct vm_struct **pcpu_get_vm_areas(const unsigned long *offsets, | ||
| 119 | const size_t *sizes, int nr_vms, | ||
| 120 | size_t align, gfp_t gfp_mask); | ||
| 121 | |||
| 122 | void pcpu_free_vm_areas(struct vm_struct **vms, int nr_vms); | ||
| 123 | |||
| 118 | #endif /* _LINUX_VMALLOC_H */ | 124 | #endif /* _LINUX_VMALLOC_H */ |
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h index 81a97cf8f0a0..2d0f222388a8 100644 --- a/include/linux/vmstat.h +++ b/include/linux/vmstat.h | |||
| @@ -166,15 +166,8 @@ static inline unsigned long zone_page_state(struct zone *zone, | |||
| 166 | return x; | 166 | return x; |
| 167 | } | 167 | } |
| 168 | 168 | ||
| 169 | extern unsigned long global_lru_pages(void); | 169 | extern unsigned long global_reclaimable_pages(void); |
| 170 | 170 | extern unsigned long zone_reclaimable_pages(struct zone *zone); | |
| 171 | static inline unsigned long zone_lru_pages(struct zone *zone) | ||
| 172 | { | ||
| 173 | return (zone_page_state(zone, NR_ACTIVE_ANON) | ||
| 174 | + zone_page_state(zone, NR_ACTIVE_FILE) | ||
| 175 | + zone_page_state(zone, NR_INACTIVE_ANON) | ||
| 176 | + zone_page_state(zone, NR_INACTIVE_FILE)); | ||
| 177 | } | ||
| 178 | 171 | ||
| 179 | #ifdef CONFIG_NUMA | 172 | #ifdef CONFIG_NUMA |
| 180 | /* | 173 | /* |
| @@ -210,11 +203,6 @@ extern void zone_statistics(struct zone *, struct zone *); | |||
| 210 | 203 | ||
| 211 | #endif /* CONFIG_NUMA */ | 204 | #endif /* CONFIG_NUMA */ |
| 212 | 205 | ||
| 213 | #define __add_zone_page_state(__z, __i, __d) \ | ||
| 214 | __mod_zone_page_state(__z, __i, __d) | ||
| 215 | #define __sub_zone_page_state(__z, __i, __d) \ | ||
| 216 | __mod_zone_page_state(__z, __i,-(__d)) | ||
| 217 | |||
| 218 | #define add_zone_page_state(__z, __i, __d) mod_zone_page_state(__z, __i, __d) | 206 | #define add_zone_page_state(__z, __i, __d) mod_zone_page_state(__z, __i, __d) |
| 219 | #define sub_zone_page_state(__z, __i, __d) mod_zone_page_state(__z, __i, -(__d)) | 207 | #define sub_zone_page_state(__z, __i, __d) mod_zone_page_state(__z, __i, -(__d)) |
| 220 | 208 | ||
diff --git a/include/linux/vt.h b/include/linux/vt.h index 02c1c0288770..7ffa11f06232 100644 --- a/include/linux/vt.h +++ b/include/linux/vt.h | |||
| @@ -1,17 +1,6 @@ | |||
| 1 | #ifndef _LINUX_VT_H | 1 | #ifndef _LINUX_VT_H |
| 2 | #define _LINUX_VT_H | 2 | #define _LINUX_VT_H |
| 3 | 3 | ||
| 4 | #ifdef __KERNEL__ | ||
| 5 | struct notifier_block; | ||
| 6 | |||
| 7 | struct vt_notifier_param { | ||
| 8 | struct vc_data *vc; /* VC on which the update happened */ | ||
| 9 | unsigned int c; /* Printed char */ | ||
| 10 | }; | ||
| 11 | |||
| 12 | extern int register_vt_notifier(struct notifier_block *nb); | ||
| 13 | extern int unregister_vt_notifier(struct notifier_block *nb); | ||
| 14 | #endif | ||
| 15 | 4 | ||
| 16 | /* | 5 | /* |
| 17 | * These constants are also useful for user-level apps (e.g., VC | 6 | * These constants are also useful for user-level apps (e.g., VC |
| @@ -74,4 +63,25 @@ struct vt_consize { | |||
| 74 | #define VT_UNLOCKSWITCH 0x560C /* allow vt switching */ | 63 | #define VT_UNLOCKSWITCH 0x560C /* allow vt switching */ |
| 75 | #define VT_GETHIFONTMASK 0x560D /* return hi font mask */ | 64 | #define VT_GETHIFONTMASK 0x560D /* return hi font mask */ |
| 76 | 65 | ||
| 66 | struct vt_event { | ||
| 67 | unsigned int event; | ||
| 68 | #define VT_EVENT_SWITCH 0x0001 /* Console switch */ | ||
| 69 | #define VT_EVENT_BLANK 0x0002 /* Screen blank */ | ||
| 70 | #define VT_EVENT_UNBLANK 0x0004 /* Screen unblank */ | ||
| 71 | #define VT_EVENT_RESIZE 0x0008 /* Resize display */ | ||
| 72 | #define VT_MAX_EVENT 0x000F | ||
| 73 | unsigned int oldev; /* Old console */ | ||
| 74 | unsigned int newev; /* New console (if changing) */ | ||
| 75 | unsigned int pad[4]; /* Padding for expansion */ | ||
| 76 | }; | ||
| 77 | |||
| 78 | #define VT_WAITEVENT 0x560E /* Wait for an event */ | ||
| 79 | |||
| 80 | struct vt_setactivate { | ||
| 81 | unsigned int console; | ||
| 82 | struct vt_mode mode; | ||
| 83 | }; | ||
| 84 | |||
| 85 | #define VT_SETACTIVATE 0x560F /* Activate and set the mode of a console */ | ||
| 86 | |||
| 77 | #endif /* _LINUX_VT_H */ | 87 | #endif /* _LINUX_VT_H */ |
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h index 2f1113467f70..c0c4e1103a73 100644 --- a/include/linux/vt_kern.h +++ b/include/linux/vt_kern.h | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | #include <linux/console_struct.h> | 13 | #include <linux/console_struct.h> |
| 14 | #include <linux/mm.h> | 14 | #include <linux/mm.h> |
| 15 | #include <linux/consolemap.h> | 15 | #include <linux/consolemap.h> |
| 16 | #include <linux/notifier.h> | ||
| 16 | 17 | ||
| 17 | /* | 18 | /* |
| 18 | * Presently, a lot of graphics programs do not restore the contents of | 19 | * Presently, a lot of graphics programs do not restore the contents of |
| @@ -91,7 +92,8 @@ int con_copy_unimap(struct vc_data *dst_vc, struct vc_data *src_vc); | |||
| 91 | #endif | 92 | #endif |
| 92 | 93 | ||
| 93 | /* vt.c */ | 94 | /* vt.c */ |
| 94 | int vt_waitactive(int vt); | 95 | void vt_event_post(unsigned int event, unsigned int old, unsigned int new); |
| 96 | int vt_waitactive(int n); | ||
| 95 | void change_console(struct vc_data *new_vc); | 97 | void change_console(struct vc_data *new_vc); |
| 96 | void reset_vc(struct vc_data *vc); | 98 | void reset_vc(struct vc_data *vc); |
| 97 | extern int unbind_con_driver(const struct consw *csw, int first, int last, | 99 | extern int unbind_con_driver(const struct consw *csw, int first, int last, |
| @@ -116,4 +118,16 @@ struct vt_spawn_console { | |||
| 116 | }; | 118 | }; |
| 117 | extern struct vt_spawn_console vt_spawn_con; | 119 | extern struct vt_spawn_console vt_spawn_con; |
| 118 | 120 | ||
| 121 | extern int vt_move_to_console(unsigned int vt, int alloc); | ||
| 122 | |||
| 123 | /* Interfaces for VC notification of character events (for accessibility etc) */ | ||
| 124 | |||
| 125 | struct vt_notifier_param { | ||
| 126 | struct vc_data *vc; /* VC on which the update happened */ | ||
| 127 | unsigned int c; /* Printed char */ | ||
| 128 | }; | ||
| 129 | |||
| 130 | extern int register_vt_notifier(struct notifier_block *nb); | ||
| 131 | extern int unregister_vt_notifier(struct notifier_block *nb); | ||
| 132 | |||
| 119 | #endif /* _VT_KERN_H */ | 133 | #endif /* _VT_KERN_H */ |
diff --git a/include/linux/wait.h b/include/linux/wait.h index cf3c2f5dba51..a48e16b77d5e 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h | |||
| @@ -26,8 +26,8 @@ | |||
| 26 | #include <asm/current.h> | 26 | #include <asm/current.h> |
| 27 | 27 | ||
| 28 | typedef struct __wait_queue wait_queue_t; | 28 | typedef struct __wait_queue wait_queue_t; |
| 29 | typedef int (*wait_queue_func_t)(wait_queue_t *wait, unsigned mode, int sync, void *key); | 29 | typedef int (*wait_queue_func_t)(wait_queue_t *wait, unsigned mode, int flags, void *key); |
| 30 | int default_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key); | 30 | int default_wake_function(wait_queue_t *wait, unsigned mode, int flags, void *key); |
| 31 | 31 | ||
| 32 | struct __wait_queue { | 32 | struct __wait_queue { |
| 33 | unsigned int flags; | 33 | unsigned int flags; |
diff --git a/include/linux/wireless.h b/include/linux/wireless.h index cb24204851f7..5b4c6c772a9b 100644 --- a/include/linux/wireless.h +++ b/include/linux/wireless.h | |||
| @@ -1132,6 +1132,14 @@ struct __compat_iw_event { | |||
| 1132 | }; | 1132 | }; |
| 1133 | #define IW_EV_COMPAT_LCP_LEN offsetof(struct __compat_iw_event, pointer) | 1133 | #define IW_EV_COMPAT_LCP_LEN offsetof(struct __compat_iw_event, pointer) |
| 1134 | #define IW_EV_COMPAT_POINT_OFF offsetof(struct compat_iw_point, length) | 1134 | #define IW_EV_COMPAT_POINT_OFF offsetof(struct compat_iw_point, length) |
| 1135 | |||
| 1136 | /* Size of the various events for compat */ | ||
| 1137 | #define IW_EV_COMPAT_CHAR_LEN (IW_EV_COMPAT_LCP_LEN + IFNAMSIZ) | ||
| 1138 | #define IW_EV_COMPAT_UINT_LEN (IW_EV_COMPAT_LCP_LEN + sizeof(__u32)) | ||
| 1139 | #define IW_EV_COMPAT_FREQ_LEN (IW_EV_COMPAT_LCP_LEN + sizeof(struct iw_freq)) | ||
| 1140 | #define IW_EV_COMPAT_PARAM_LEN (IW_EV_COMPAT_LCP_LEN + sizeof(struct iw_param)) | ||
| 1141 | #define IW_EV_COMPAT_ADDR_LEN (IW_EV_COMPAT_LCP_LEN + sizeof(struct sockaddr)) | ||
| 1142 | #define IW_EV_COMPAT_QUAL_LEN (IW_EV_COMPAT_LCP_LEN + sizeof(struct iw_quality)) | ||
| 1135 | #define IW_EV_COMPAT_POINT_LEN \ | 1143 | #define IW_EV_COMPAT_POINT_LEN \ |
| 1136 | (IW_EV_COMPAT_LCP_LEN + sizeof(struct compat_iw_point) - \ | 1144 | (IW_EV_COMPAT_LCP_LEN + sizeof(struct compat_iw_point) - \ |
| 1137 | IW_EV_COMPAT_POINT_OFF) | 1145 | IW_EV_COMPAT_POINT_OFF) |
diff --git a/include/linux/wm97xx.h b/include/linux/wm97xx.h index 6f69968eab24..38e8c4d9289e 100644 --- a/include/linux/wm97xx.h +++ b/include/linux/wm97xx.h | |||
| @@ -16,6 +16,12 @@ | |||
| 16 | #include <linux/platform_device.h> | 16 | #include <linux/platform_device.h> |
| 17 | 17 | ||
| 18 | /* | 18 | /* |
| 19 | * WM97xx variants | ||
| 20 | */ | ||
| 21 | #define WM97xx_GENERIC 0x0000 | ||
| 22 | #define WM97xx_WM1613 0x1613 | ||
| 23 | |||
| 24 | /* | ||
| 19 | * WM97xx AC97 Touchscreen registers | 25 | * WM97xx AC97 Touchscreen registers |
| 20 | */ | 26 | */ |
| 21 | #define AC97_WM97XX_DIGITISER1 0x76 | 27 | #define AC97_WM97XX_DIGITISER1 0x76 |
| @@ -283,9 +289,28 @@ struct wm97xx { | |||
| 283 | unsigned pen_is_down:1; /* Pen is down */ | 289 | unsigned pen_is_down:1; /* Pen is down */ |
| 284 | unsigned aux_waiting:1; /* aux measurement waiting */ | 290 | unsigned aux_waiting:1; /* aux measurement waiting */ |
| 285 | unsigned pen_probably_down:1; /* used in polling mode */ | 291 | unsigned pen_probably_down:1; /* used in polling mode */ |
| 292 | u16 variant; /* WM97xx chip variant */ | ||
| 286 | u16 suspend_mode; /* PRP in suspend mode */ | 293 | u16 suspend_mode; /* PRP in suspend mode */ |
| 287 | }; | 294 | }; |
| 288 | 295 | ||
| 296 | struct wm97xx_batt_pdata { | ||
| 297 | int batt_aux; | ||
| 298 | int temp_aux; | ||
| 299 | int charge_gpio; | ||
| 300 | int min_voltage; | ||
| 301 | int max_voltage; | ||
| 302 | int batt_div; | ||
| 303 | int batt_mult; | ||
| 304 | int temp_div; | ||
| 305 | int temp_mult; | ||
| 306 | int batt_tech; | ||
| 307 | char *batt_name; | ||
| 308 | }; | ||
| 309 | |||
| 310 | struct wm97xx_pdata { | ||
| 311 | struct wm97xx_batt_pdata *batt_pdata; /* battery data */ | ||
| 312 | }; | ||
| 313 | |||
| 289 | /* | 314 | /* |
| 290 | * Codec GPIO access (not supported on WM9705) | 315 | * Codec GPIO access (not supported on WM9705) |
| 291 | * This can be used to set/get codec GPIO and Virtual GPIO status. | 316 | * This can be used to set/get codec GPIO and Virtual GPIO status. |
diff --git a/include/linux/wm97xx_batt.h b/include/linux/wm97xx_batt.h index 9681d1ab0e4f..a1d6419c2ff8 100644 --- a/include/linux/wm97xx_batt.h +++ b/include/linux/wm97xx_batt.h | |||
| @@ -3,22 +3,12 @@ | |||
| 3 | 3 | ||
| 4 | #include <linux/wm97xx.h> | 4 | #include <linux/wm97xx.h> |
| 5 | 5 | ||
| 6 | struct wm97xx_batt_info { | 6 | #warning This file will be removed soon, use wm97xx.h instead! |
| 7 | int batt_aux; | 7 | |
| 8 | int temp_aux; | 8 | #define wm97xx_batt_info wm97xx_batt_pdata |
| 9 | int charge_gpio; | ||
| 10 | int min_voltage; | ||
| 11 | int max_voltage; | ||
| 12 | int batt_div; | ||
| 13 | int batt_mult; | ||
| 14 | int temp_div; | ||
| 15 | int temp_mult; | ||
| 16 | int batt_tech; | ||
| 17 | char *batt_name; | ||
| 18 | }; | ||
| 19 | 9 | ||
| 20 | #ifdef CONFIG_BATTERY_WM97XX | 10 | #ifdef CONFIG_BATTERY_WM97XX |
| 21 | void __init wm97xx_bat_set_pdata(struct wm97xx_batt_info *data); | 11 | void wm97xx_bat_set_pdata(struct wm97xx_batt_info *data); |
| 22 | #else | 12 | #else |
| 23 | static inline void wm97xx_bat_set_pdata(struct wm97xx_batt_info *data) {} | 13 | static inline void wm97xx_bat_set_pdata(struct wm97xx_batt_info *data) {} |
| 24 | #endif | 14 | #endif |
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index 6273fa97b527..cf24c20de9e4 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
| @@ -94,7 +94,7 @@ struct execute_work { | |||
| 94 | /* | 94 | /* |
| 95 | * initialize all of a work item in one go | 95 | * initialize all of a work item in one go |
| 96 | * | 96 | * |
| 97 | * NOTE! No point in using "atomic_long_set()": useing a direct | 97 | * NOTE! No point in using "atomic_long_set()": using a direct |
| 98 | * assignment of the work data initializer allows the compiler | 98 | * assignment of the work data initializer allows the compiler |
| 99 | * to generate better code. | 99 | * to generate better code. |
| 100 | */ | 100 | */ |
| @@ -207,6 +207,7 @@ extern int queue_delayed_work_on(int cpu, struct workqueue_struct *wq, | |||
| 207 | 207 | ||
| 208 | extern void flush_workqueue(struct workqueue_struct *wq); | 208 | extern void flush_workqueue(struct workqueue_struct *wq); |
| 209 | extern void flush_scheduled_work(void); | 209 | extern void flush_scheduled_work(void); |
| 210 | extern void flush_delayed_work(struct delayed_work *work); | ||
| 210 | 211 | ||
| 211 | extern int schedule_work(struct work_struct *work); | 212 | extern int schedule_work(struct work_struct *work); |
| 212 | extern int schedule_work_on(int cpu, struct work_struct *work); | 213 | extern int schedule_work_on(int cpu, struct work_struct *work); |
diff --git a/include/linux/writeback.h b/include/linux/writeback.h index 78b1e4684cc9..66ebddcff664 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h | |||
| @@ -50,7 +50,6 @@ struct writeback_control { | |||
| 50 | unsigned encountered_congestion:1; /* An output: a queue is full */ | 50 | unsigned encountered_congestion:1; /* An output: a queue is full */ |
| 51 | unsigned for_kupdate:1; /* A kupdate writeback */ | 51 | unsigned for_kupdate:1; /* A kupdate writeback */ |
| 52 | unsigned for_reclaim:1; /* Invoked from the page allocator */ | 52 | unsigned for_reclaim:1; /* Invoked from the page allocator */ |
| 53 | unsigned for_writepages:1; /* This is a writepages() call */ | ||
| 54 | unsigned range_cyclic:1; /* range_start is cyclic */ | 53 | unsigned range_cyclic:1; /* range_start is cyclic */ |
| 55 | unsigned more_io:1; /* more io to be dispatched */ | 54 | unsigned more_io:1; /* more io to be dispatched */ |
| 56 | /* | 55 | /* |
| @@ -69,8 +68,8 @@ struct writeback_control { | |||
| 69 | */ | 68 | */ |
| 70 | struct bdi_writeback; | 69 | struct bdi_writeback; |
| 71 | int inode_wait(void *); | 70 | int inode_wait(void *); |
| 72 | long writeback_inodes_sb(struct super_block *); | 71 | void writeback_inodes_sb(struct super_block *); |
| 73 | long sync_inodes_sb(struct super_block *); | 72 | void sync_inodes_sb(struct super_block *); |
| 74 | void writeback_inodes_wbc(struct writeback_control *wbc); | 73 | void writeback_inodes_wbc(struct writeback_control *wbc); |
| 75 | long wb_do_writeback(struct bdi_writeback *wb, int force_wait); | 74 | long wb_do_writeback(struct bdi_writeback *wb, int force_wait); |
| 76 | void wakeup_flusher_threads(long nr_pages); | 75 | void wakeup_flusher_threads(long nr_pages); |
| @@ -111,21 +110,20 @@ extern int laptop_mode; | |||
| 111 | extern unsigned long determine_dirtyable_memory(void); | 110 | extern unsigned long determine_dirtyable_memory(void); |
| 112 | 111 | ||
| 113 | extern int dirty_background_ratio_handler(struct ctl_table *table, int write, | 112 | extern int dirty_background_ratio_handler(struct ctl_table *table, int write, |
| 114 | struct file *filp, void __user *buffer, size_t *lenp, | 113 | void __user *buffer, size_t *lenp, |
| 115 | loff_t *ppos); | 114 | loff_t *ppos); |
| 116 | extern int dirty_background_bytes_handler(struct ctl_table *table, int write, | 115 | extern int dirty_background_bytes_handler(struct ctl_table *table, int write, |
| 117 | struct file *filp, void __user *buffer, size_t *lenp, | 116 | void __user *buffer, size_t *lenp, |
| 118 | loff_t *ppos); | 117 | loff_t *ppos); |
| 119 | extern int dirty_ratio_handler(struct ctl_table *table, int write, | 118 | extern int dirty_ratio_handler(struct ctl_table *table, int write, |
| 120 | struct file *filp, void __user *buffer, size_t *lenp, | 119 | void __user *buffer, size_t *lenp, |
| 121 | loff_t *ppos); | 120 | loff_t *ppos); |
| 122 | extern int dirty_bytes_handler(struct ctl_table *table, int write, | 121 | extern int dirty_bytes_handler(struct ctl_table *table, int write, |
| 123 | struct file *filp, void __user *buffer, size_t *lenp, | 122 | void __user *buffer, size_t *lenp, |
| 124 | loff_t *ppos); | 123 | loff_t *ppos); |
| 125 | 124 | ||
| 126 | struct ctl_table; | 125 | struct ctl_table; |
| 127 | struct file; | 126 | int dirty_writeback_centisecs_handler(struct ctl_table *, int, |
| 128 | int dirty_writeback_centisecs_handler(struct ctl_table *, int, struct file *, | ||
| 129 | void __user *, size_t *, loff_t *); | 127 | void __user *, size_t *, loff_t *); |
| 130 | 128 | ||
| 131 | void get_dirty_limits(unsigned long *pbackground, unsigned long *pdirty, | 129 | void get_dirty_limits(unsigned long *pbackground, unsigned long *pdirty, |
| @@ -150,10 +148,6 @@ int write_cache_pages(struct address_space *mapping, | |||
| 150 | struct writeback_control *wbc, writepage_t writepage, | 148 | struct writeback_control *wbc, writepage_t writepage, |
| 151 | void *data); | 149 | void *data); |
| 152 | int do_writepages(struct address_space *mapping, struct writeback_control *wbc); | 150 | int do_writepages(struct address_space *mapping, struct writeback_control *wbc); |
| 153 | int sync_page_range(struct inode *inode, struct address_space *mapping, | ||
| 154 | loff_t pos, loff_t count); | ||
| 155 | int sync_page_range_nolock(struct inode *inode, struct address_space *mapping, | ||
| 156 | loff_t pos, loff_t count); | ||
| 157 | void set_page_dirty_balance(struct page *page, int page_mkwrite); | 151 | void set_page_dirty_balance(struct page *page, int page_mkwrite); |
| 158 | void writeback_set_ratelimit(void); | 152 | void writeback_set_ratelimit(void); |
| 159 | 153 | ||
