diff options
| author | NeilBrown <neilb@suse.de> | 2010-08-09 20:02:33 -0400 |
|---|---|---|
| committer | NeilBrown <neilb@suse.de> | 2010-08-09 20:02:33 -0400 |
| commit | fd8aa2c1811bf60ccb2d5de0579c6f62aec1772d (patch) | |
| tree | 311567d03758afc3a93b4273fe172836e89bb01d /include/linux | |
| parent | 6e17b0276452912cb13445e5ea552b599984675f (diff) | |
| parent | 2144381da478cc4aa3a29ee29b0c5e6ddaaced14 (diff) | |
Merge git://git.infradead.org/users/dwmw2/libraid-2.6 into for-linus
Diffstat (limited to 'include/linux')
188 files changed, 4404 insertions, 1240 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 2fc8e14cc24a..9aa9bcadf869 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
| @@ -276,6 +276,7 @@ ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm_para.h \ | |||
| 276 | $(srctree)/include/asm-$(SRCARCH)/kvm_para.h),) | 276 | $(srctree)/include/asm-$(SRCARCH)/kvm_para.h),) |
| 277 | unifdef-y += kvm_para.h | 277 | unifdef-y += kvm_para.h |
| 278 | endif | 278 | endif |
| 279 | unifdef-y += l2tp.h | ||
| 279 | unifdef-y += llc.h | 280 | unifdef-y += llc.h |
| 280 | unifdef-y += loop.h | 281 | unifdef-y += loop.h |
| 281 | unifdef-y += lp.h | 282 | unifdef-y += lp.h |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 224a38c960d4..ccf94dc5acdf 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
| @@ -253,7 +253,7 @@ int acpi_resources_are_enforced(void); | |||
| 253 | #ifdef CONFIG_PM_SLEEP | 253 | #ifdef CONFIG_PM_SLEEP |
| 254 | void __init acpi_no_s4_hw_signature(void); | 254 | void __init acpi_no_s4_hw_signature(void); |
| 255 | void __init acpi_old_suspend_ordering(void); | 255 | void __init acpi_old_suspend_ordering(void); |
| 256 | void __init acpi_s4_no_nvs(void); | 256 | void __init acpi_nvs_nosave(void); |
| 257 | #endif /* CONFIG_PM_SLEEP */ | 257 | #endif /* CONFIG_PM_SLEEP */ |
| 258 | 258 | ||
| 259 | struct acpi_osc_context { | 259 | struct acpi_osc_context { |
diff --git a/include/linux/ahci_platform.h b/include/linux/ahci_platform.h index f7dd576dd5a4..be3d9a77d6ed 100644 --- a/include/linux/ahci_platform.h +++ b/include/linux/ahci_platform.h | |||
| @@ -15,11 +15,13 @@ | |||
| 15 | #ifndef _AHCI_PLATFORM_H | 15 | #ifndef _AHCI_PLATFORM_H |
| 16 | #define _AHCI_PLATFORM_H | 16 | #define _AHCI_PLATFORM_H |
| 17 | 17 | ||
| 18 | #include <linux/compiler.h> | ||
| 19 | |||
| 18 | struct device; | 20 | struct device; |
| 19 | struct ata_port_info; | 21 | struct ata_port_info; |
| 20 | 22 | ||
| 21 | struct ahci_platform_data { | 23 | struct ahci_platform_data { |
| 22 | int (*init)(struct device *dev); | 24 | int (*init)(struct device *dev, void __iomem *addr); |
| 23 | void (*exit)(struct device *dev); | 25 | void (*exit)(struct device *dev); |
| 24 | const struct ata_port_info *ata_port_info; | 26 | const struct ata_port_info *ata_port_info; |
| 25 | unsigned int force_port_map; | 27 | unsigned int force_port_map; |
diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h index 8b1038607831..b0c174012436 100644 --- a/include/linux/amba/bus.h +++ b/include/linux/amba/bus.h | |||
| @@ -14,14 +14,19 @@ | |||
| 14 | #ifndef ASMARM_AMBA_H | 14 | #ifndef ASMARM_AMBA_H |
| 15 | #define ASMARM_AMBA_H | 15 | #define ASMARM_AMBA_H |
| 16 | 16 | ||
| 17 | #include <linux/clk.h> | ||
| 17 | #include <linux/device.h> | 18 | #include <linux/device.h> |
| 19 | #include <linux/err.h> | ||
| 18 | #include <linux/resource.h> | 20 | #include <linux/resource.h> |
| 19 | 21 | ||
| 20 | #define AMBA_NR_IRQS 2 | 22 | #define AMBA_NR_IRQS 2 |
| 21 | 23 | ||
| 24 | struct clk; | ||
| 25 | |||
| 22 | struct amba_device { | 26 | struct amba_device { |
| 23 | struct device dev; | 27 | struct device dev; |
| 24 | struct resource res; | 28 | struct resource res; |
| 29 | struct clk *pclk; | ||
| 25 | u64 dma_mask; | 30 | u64 dma_mask; |
| 26 | unsigned int periphid; | 31 | unsigned int periphid; |
| 27 | unsigned int irq[AMBA_NR_IRQS]; | 32 | unsigned int irq[AMBA_NR_IRQS]; |
| @@ -59,6 +64,12 @@ struct amba_device *amba_find_device(const char *, struct device *, unsigned int | |||
| 59 | int amba_request_regions(struct amba_device *, const char *); | 64 | int amba_request_regions(struct amba_device *, const char *); |
| 60 | void amba_release_regions(struct amba_device *); | 65 | void amba_release_regions(struct amba_device *); |
| 61 | 66 | ||
| 67 | #define amba_pclk_enable(d) \ | ||
| 68 | (IS_ERR((d)->pclk) ? 0 : clk_enable((d)->pclk)) | ||
| 69 | |||
| 70 | #define amba_pclk_disable(d) \ | ||
| 71 | do { if (!IS_ERR((d)->pclk)) clk_disable((d)->pclk); } while (0) | ||
| 72 | |||
| 62 | #define amba_config(d) (((d)->periphid >> 24) & 0xff) | 73 | #define amba_config(d) (((d)->periphid >> 24) & 0xff) |
| 63 | #define amba_rev(d) (((d)->periphid >> 20) & 0x0f) | 74 | #define amba_rev(d) (((d)->periphid >> 20) & 0x0f) |
| 64 | #define amba_manf(d) (((d)->periphid >> 12) & 0xff) | 75 | #define amba_manf(d) (((d)->periphid >> 12) & 0xff) |
diff --git a/include/linux/amba/mmci.h b/include/linux/amba/mmci.h index 7e466fe72025..ca84ce70d5d5 100644 --- a/include/linux/amba/mmci.h +++ b/include/linux/amba/mmci.h | |||
| @@ -15,9 +15,10 @@ | |||
| 15 | * @ocr_mask: available voltages on the 4 pins from the block, this | 15 | * @ocr_mask: available voltages on the 4 pins from the block, this |
| 16 | * is ignored if a regulator is used, see the MMC_VDD_* masks in | 16 | * is ignored if a regulator is used, see the MMC_VDD_* masks in |
| 17 | * mmc/host.h | 17 | * mmc/host.h |
| 18 | * @translate_vdd: a callback function to translate a MMC_VDD_* | 18 | * @vdd_handler: a callback function to translate a MMC_VDD_* |
| 19 | * mask into a value to be binary or:ed and written into the | 19 | * mask into a value to be binary (or set some other custom bits |
| 20 | * MMCIPWR register of the block | 20 | * in MMCIPWR) or:ed and written into the MMCIPWR register of the |
| 21 | * block. May also control external power based on the power_mode. | ||
| 21 | * @status: if no GPIO read function was given to the block in | 22 | * @status: if no GPIO read function was given to the block in |
| 22 | * gpio_wp (below) this function will be called to determine | 23 | * gpio_wp (below) this function will be called to determine |
| 23 | * whether a card is present in the MMC slot or not | 24 | * whether a card is present in the MMC slot or not |
| @@ -29,7 +30,8 @@ | |||
| 29 | struct mmci_platform_data { | 30 | struct mmci_platform_data { |
| 30 | unsigned int f_max; | 31 | unsigned int f_max; |
| 31 | unsigned int ocr_mask; | 32 | unsigned int ocr_mask; |
| 32 | u32 (*translate_vdd)(struct device *, unsigned int); | 33 | u32 (*vdd_handler)(struct device *, unsigned int vdd, |
| 34 | unsigned char power_mode); | ||
| 33 | unsigned int (*status)(struct device *); | 35 | unsigned int (*status)(struct device *); |
| 34 | int gpio_wp; | 36 | int gpio_wp; |
| 35 | int gpio_cd; | 37 | int gpio_cd; |
diff --git a/include/linux/amba/serial.h b/include/linux/amba/serial.h index 5a5a7fd62490..e1b634b635f2 100644 --- a/include/linux/amba/serial.h +++ b/include/linux/amba/serial.h | |||
| @@ -38,10 +38,12 @@ | |||
| 38 | #define UART01x_FR 0x18 /* Flag register (Read only). */ | 38 | #define UART01x_FR 0x18 /* Flag register (Read only). */ |
| 39 | #define UART010_IIR 0x1C /* Interrupt indentification register (Read). */ | 39 | #define UART010_IIR 0x1C /* Interrupt indentification register (Read). */ |
| 40 | #define UART010_ICR 0x1C /* Interrupt clear register (Write). */ | 40 | #define UART010_ICR 0x1C /* Interrupt clear register (Write). */ |
| 41 | #define ST_UART011_LCRH_RX 0x1C /* Rx line control register. */ | ||
| 41 | #define UART01x_ILPR 0x20 /* IrDA low power counter register. */ | 42 | #define UART01x_ILPR 0x20 /* IrDA low power counter register. */ |
| 42 | #define UART011_IBRD 0x24 /* Integer baud rate divisor register. */ | 43 | #define UART011_IBRD 0x24 /* Integer baud rate divisor register. */ |
| 43 | #define UART011_FBRD 0x28 /* Fractional baud rate divisor register. */ | 44 | #define UART011_FBRD 0x28 /* Fractional baud rate divisor register. */ |
| 44 | #define UART011_LCRH 0x2c /* Line control register. */ | 45 | #define UART011_LCRH 0x2c /* Line control register. */ |
| 46 | #define ST_UART011_LCRH_TX 0x2c /* Tx Line control register. */ | ||
| 45 | #define UART011_CR 0x30 /* Control register. */ | 47 | #define UART011_CR 0x30 /* Control register. */ |
| 46 | #define UART011_IFLS 0x34 /* Interrupt fifo level select. */ | 48 | #define UART011_IFLS 0x34 /* Interrupt fifo level select. */ |
| 47 | #define UART011_IMSC 0x38 /* Interrupt mask. */ | 49 | #define UART011_IMSC 0x38 /* Interrupt mask. */ |
| @@ -84,6 +86,7 @@ | |||
| 84 | #define UART010_CR_TIE 0x0020 | 86 | #define UART010_CR_TIE 0x0020 |
| 85 | #define UART010_CR_RIE 0x0010 | 87 | #define UART010_CR_RIE 0x0010 |
| 86 | #define UART010_CR_MSIE 0x0008 | 88 | #define UART010_CR_MSIE 0x0008 |
| 89 | #define ST_UART011_CR_OVSFACT 0x0008 /* Oversampling factor */ | ||
| 87 | #define UART01x_CR_IIRLP 0x0004 /* SIR low power mode */ | 90 | #define UART01x_CR_IIRLP 0x0004 /* SIR low power mode */ |
| 88 | #define UART01x_CR_SIREN 0x0002 /* SIR enable */ | 91 | #define UART01x_CR_SIREN 0x0002 /* SIR enable */ |
| 89 | #define UART01x_CR_UARTEN 0x0001 /* UART enable */ | 92 | #define UART01x_CR_UARTEN 0x0001 /* UART enable */ |
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h index 817b23705c91..f6481daf6e52 100644 --- a/include/linux/atmdev.h +++ b/include/linux/atmdev.h | |||
| @@ -431,6 +431,14 @@ struct atm_dev *atm_dev_register(const char *type,const struct atmdev_ops *ops, | |||
| 431 | int number,unsigned long *flags); /* number == -1: pick first available */ | 431 | int number,unsigned long *flags); /* number == -1: pick first available */ |
| 432 | struct atm_dev *atm_dev_lookup(int number); | 432 | struct atm_dev *atm_dev_lookup(int number); |
| 433 | void atm_dev_deregister(struct atm_dev *dev); | 433 | void atm_dev_deregister(struct atm_dev *dev); |
| 434 | |||
| 435 | /* atm_dev_signal_change | ||
| 436 | * | ||
| 437 | * Propagate lower layer signal change in atm_dev->signal to netdevice. | ||
| 438 | * The event will be sent via a notifier call chain. | ||
| 439 | */ | ||
| 440 | void atm_dev_signal_change(struct atm_dev *dev, char signal); | ||
| 441 | |||
| 434 | void vcc_insert_socket(struct sock *sk); | 442 | void vcc_insert_socket(struct sock *sk); |
| 435 | 443 | ||
| 436 | 444 | ||
| @@ -510,6 +518,15 @@ void register_atm_ioctl(struct atm_ioctl *); | |||
| 510 | */ | 518 | */ |
| 511 | void deregister_atm_ioctl(struct atm_ioctl *); | 519 | void deregister_atm_ioctl(struct atm_ioctl *); |
| 512 | 520 | ||
| 521 | |||
| 522 | /* register_atmdevice_notifier - register atm_dev notify events | ||
| 523 | * | ||
| 524 | * Clients like br2684 will register notify events | ||
| 525 | * Currently we notify of signal found/lost | ||
| 526 | */ | ||
| 527 | int register_atmdevice_notifier(struct notifier_block *nb); | ||
| 528 | void unregister_atmdevice_notifier(struct notifier_block *nb); | ||
| 529 | |||
| 513 | #endif /* __KERNEL__ */ | 530 | #endif /* __KERNEL__ */ |
| 514 | 531 | ||
| 515 | #endif | 532 | #endif |
diff --git a/include/linux/brcmphy.h b/include/linux/brcmphy.h index 7f437ca1ed44..b840a4960282 100644 --- a/include/linux/brcmphy.h +++ b/include/linux/brcmphy.h | |||
| @@ -1,6 +1,13 @@ | |||
| 1 | #define PHY_ID_BCM50610 0x0143bd60 | 1 | #define PHY_ID_BCM50610 0x0143bd60 |
| 2 | #define PHY_ID_BCM50610M 0x0143bd70 | 2 | #define PHY_ID_BCM50610M 0x0143bd70 |
| 3 | #define PHY_ID_BCM5241 0x0143bc30 | ||
| 3 | #define PHY_ID_BCMAC131 0x0143bc70 | 4 | #define PHY_ID_BCMAC131 0x0143bc70 |
| 5 | #define PHY_ID_BCM5481 0x0143bca0 | ||
| 6 | #define PHY_ID_BCM5482 0x0143bcb0 | ||
| 7 | #define PHY_ID_BCM5411 0x00206070 | ||
| 8 | #define PHY_ID_BCM5421 0x002060e0 | ||
| 9 | #define PHY_ID_BCM5464 0x002060b0 | ||
| 10 | #define PHY_ID_BCM5461 0x002060c0 | ||
| 4 | #define PHY_ID_BCM57780 0x03625d90 | 11 | #define PHY_ID_BCM57780 0x03625d90 |
| 5 | 12 | ||
| 6 | #define PHY_BCM_OUI_MASK 0xfffffc00 | 13 | #define PHY_BCM_OUI_MASK 0xfffffc00 |
diff --git a/include/linux/caif/caif_socket.h b/include/linux/caif/caif_socket.h index 2a61eb1beb85..d9cb19b7cff7 100644 --- a/include/linux/caif/caif_socket.h +++ b/include/linux/caif/caif_socket.h | |||
| @@ -62,6 +62,7 @@ enum caif_channel_priority { | |||
| 62 | * @CAIFPROTO_DATAGRAM_LOOP: Datagram loopback channel, used for testing. | 62 | * @CAIFPROTO_DATAGRAM_LOOP: Datagram loopback channel, used for testing. |
| 63 | * @CAIFPROTO_UTIL: Utility (Psock) channel. | 63 | * @CAIFPROTO_UTIL: Utility (Psock) channel. |
| 64 | * @CAIFPROTO_RFM: Remote File Manager | 64 | * @CAIFPROTO_RFM: Remote File Manager |
| 65 | * @CAIFPROTO_DEBUG: Debug link | ||
| 65 | * | 66 | * |
| 66 | * This enum defines the CAIF Channel type to be used. This defines | 67 | * This enum defines the CAIF Channel type to be used. This defines |
| 67 | * the service to connect to on the modem. | 68 | * the service to connect to on the modem. |
| @@ -72,6 +73,7 @@ enum caif_protocol_type { | |||
| 72 | CAIFPROTO_DATAGRAM_LOOP, | 73 | CAIFPROTO_DATAGRAM_LOOP, |
| 73 | CAIFPROTO_UTIL, | 74 | CAIFPROTO_UTIL, |
| 74 | CAIFPROTO_RFM, | 75 | CAIFPROTO_RFM, |
| 76 | CAIFPROTO_DEBUG, | ||
| 75 | _CAIFPROTO_MAX | 77 | _CAIFPROTO_MAX |
| 76 | }; | 78 | }; |
| 77 | #define CAIFPROTO_MAX _CAIFPROTO_MAX | 79 | #define CAIFPROTO_MAX _CAIFPROTO_MAX |
| @@ -83,6 +85,28 @@ enum caif_protocol_type { | |||
| 83 | enum caif_at_type { | 85 | enum caif_at_type { |
| 84 | CAIF_ATTYPE_PLAIN = 2 | 86 | CAIF_ATTYPE_PLAIN = 2 |
| 85 | }; | 87 | }; |
| 88 | /** | ||
| 89 | * enum caif_debug_type - Content selection for debug connection | ||
| 90 | * @CAIF_DEBUG_TRACE_INTERACTIVE: Connection will contain | ||
| 91 | * both trace and interactive debug. | ||
| 92 | * @CAIF_DEBUG_TRACE: Connection contains trace only. | ||
| 93 | * @CAIF_DEBUG_INTERACTIVE: Connection to interactive debug. | ||
| 94 | */ | ||
| 95 | enum caif_debug_type { | ||
| 96 | CAIF_DEBUG_TRACE_INTERACTIVE = 0, | ||
| 97 | CAIF_DEBUG_TRACE, | ||
| 98 | CAIF_DEBUG_INTERACTIVE, | ||
| 99 | }; | ||
| 100 | |||
| 101 | /** | ||
| 102 | * enum caif_debug_service - Debug Service Endpoint | ||
| 103 | * @CAIF_RADIO_DEBUG_SERVICE: Debug service on the Radio sub-system | ||
| 104 | * @CAIF_APP_DEBUG_SERVICE: Debug for the applications sub-system | ||
| 105 | */ | ||
| 106 | enum caif_debug_service { | ||
| 107 | CAIF_RADIO_DEBUG_SERVICE = 1, | ||
| 108 | CAIF_APP_DEBUG_SERVICE | ||
| 109 | }; | ||
| 86 | 110 | ||
| 87 | /** | 111 | /** |
| 88 | * struct sockaddr_caif - the sockaddr structure for CAIF sockets. | 112 | * struct sockaddr_caif - the sockaddr structure for CAIF sockets. |
| @@ -109,6 +133,12 @@ enum caif_at_type { | |||
| 109 | * | 133 | * |
| 110 | * @u.rfm.volume: Volume to mount. | 134 | * @u.rfm.volume: Volume to mount. |
| 111 | * | 135 | * |
| 136 | * @u.dbg: Applies when family = CAIFPROTO_DEBUG. | ||
| 137 | * | ||
| 138 | * @u.dbg.type: Type of debug connection to set up | ||
| 139 | * (caif_debug_type). | ||
| 140 | * | ||
| 141 | * @u.dbg.service: Service sub-system to connect (caif_debug_service | ||
| 112 | * Description: | 142 | * Description: |
| 113 | * This structure holds the connect parameters used for setting up a | 143 | * This structure holds the connect parameters used for setting up a |
| 114 | * CAIF Channel. It defines the service to connect to on the modem. | 144 | * CAIF Channel. It defines the service to connect to on the modem. |
| @@ -130,6 +160,10 @@ struct sockaddr_caif { | |||
| 130 | __u32 connection_id; | 160 | __u32 connection_id; |
| 131 | char volume[16]; | 161 | char volume[16]; |
| 132 | } rfm; /* CAIFPROTO_RFM */ | 162 | } rfm; /* CAIFPROTO_RFM */ |
| 163 | struct { | ||
| 164 | __u8 type; /* type:enum caif_debug_type */ | ||
| 165 | __u8 service; /* service:caif_debug_service */ | ||
| 166 | } dbg; /* CAIFPROTO_DEBUG */ | ||
| 133 | } u; | 167 | } u; |
| 134 | }; | 168 | }; |
| 135 | 169 | ||
diff --git a/include/linux/can/platform/flexcan.h b/include/linux/can/platform/flexcan.h new file mode 100644 index 000000000000..72b713ab57e9 --- /dev/null +++ b/include/linux/can/platform/flexcan.h | |||
| @@ -0,0 +1,20 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2010 Marc Kleine-Budde <kernel@pengutronix.de> | ||
| 3 | * | ||
| 4 | * This file is released under the GPLv2 | ||
| 5 | * | ||
| 6 | */ | ||
| 7 | |||
| 8 | #ifndef __CAN_PLATFORM_FLEXCAN_H | ||
| 9 | #define __CAN_PLATFORM_FLEXCAN_H | ||
| 10 | |||
| 11 | /** | ||
| 12 | * struct flexcan_platform_data - flex CAN controller platform data | ||
| 13 | * @transceiver_enable: - called to power on/off the transceiver | ||
| 14 | * | ||
| 15 | */ | ||
| 16 | struct flexcan_platform_data { | ||
| 17 | void (*transceiver_switch)(int enable); | ||
| 18 | }; | ||
| 19 | |||
| 20 | #endif /* __CAN_PLATFORM_FLEXCAN_H */ | ||
diff --git a/include/linux/capability.h b/include/linux/capability.h index 39e5ff512fbe..90012b9ddbf3 100644 --- a/include/linux/capability.h +++ b/include/linux/capability.h | |||
| @@ -49,9 +49,6 @@ typedef struct __user_cap_data_struct { | |||
| 49 | } __user *cap_user_data_t; | 49 | } __user *cap_user_data_t; |
| 50 | 50 | ||
| 51 | 51 | ||
| 52 | #define XATTR_CAPS_SUFFIX "capability" | ||
| 53 | #define XATTR_NAME_CAPS XATTR_SECURITY_PREFIX XATTR_CAPS_SUFFIX | ||
| 54 | |||
| 55 | #define VFS_CAP_REVISION_MASK 0xFF000000 | 52 | #define VFS_CAP_REVISION_MASK 0xFF000000 |
| 56 | #define VFS_CAP_REVISION_SHIFT 24 | 53 | #define VFS_CAP_REVISION_SHIFT 24 |
| 57 | #define VFS_CAP_FLAGS_MASK ~VFS_CAP_REVISION_MASK | 54 | #define VFS_CAP_FLAGS_MASK ~VFS_CAP_REVISION_MASK |
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index e3d00fdb858d..ed3e92e41c6e 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
| @@ -578,6 +578,7 @@ struct task_struct *cgroup_iter_next(struct cgroup *cgrp, | |||
| 578 | void cgroup_iter_end(struct cgroup *cgrp, struct cgroup_iter *it); | 578 | void cgroup_iter_end(struct cgroup *cgrp, struct cgroup_iter *it); |
| 579 | int cgroup_scan_tasks(struct cgroup_scanner *scan); | 579 | int cgroup_scan_tasks(struct cgroup_scanner *scan); |
| 580 | int cgroup_attach_task(struct cgroup *, struct task_struct *); | 580 | int cgroup_attach_task(struct cgroup *, struct task_struct *); |
| 581 | int cgroup_attach_task_current_cg(struct task_struct *); | ||
| 581 | 582 | ||
| 582 | /* | 583 | /* |
| 583 | * CSS ID is ID for cgroup_subsys_state structs under subsys. This only works | 584 | * CSS ID is ID for cgroup_subsys_state structs under subsys. This only works |
| @@ -634,6 +635,12 @@ static inline int cgroupstats_build(struct cgroupstats *stats, | |||
| 634 | return -EINVAL; | 635 | return -EINVAL; |
| 635 | } | 636 | } |
| 636 | 637 | ||
| 638 | /* No cgroups - nothing to do */ | ||
| 639 | static inline int cgroup_attach_task_current_cg(struct task_struct *t) | ||
| 640 | { | ||
| 641 | return 0; | ||
| 642 | } | ||
| 643 | |||
| 637 | #endif /* !CONFIG_CGROUPS */ | 644 | #endif /* !CONFIG_CGROUPS */ |
| 638 | 645 | ||
| 639 | #endif /* _LINUX_CGROUP_H */ | 646 | #endif /* _LINUX_CGROUP_H */ |
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h index 5ea3c60c160c..c37b21ad5a3b 100644 --- a/include/linux/clocksource.h +++ b/include/linux/clocksource.h | |||
| @@ -292,6 +292,8 @@ clocks_calc_mult_shift(u32 *mult, u32 *shift, u32 from, u32 to, u32 minsec); | |||
| 292 | */ | 292 | */ |
| 293 | extern int | 293 | extern int |
| 294 | __clocksource_register_scale(struct clocksource *cs, u32 scale, u32 freq); | 294 | __clocksource_register_scale(struct clocksource *cs, u32 scale, u32 freq); |
| 295 | extern void | ||
| 296 | __clocksource_updatefreq_scale(struct clocksource *cs, u32 scale, u32 freq); | ||
| 295 | 297 | ||
| 296 | static inline int clocksource_register_hz(struct clocksource *cs, u32 hz) | 298 | static inline int clocksource_register_hz(struct clocksource *cs, u32 hz) |
| 297 | { | 299 | { |
| @@ -303,6 +305,15 @@ static inline int clocksource_register_khz(struct clocksource *cs, u32 khz) | |||
| 303 | return __clocksource_register_scale(cs, 1000, khz); | 305 | return __clocksource_register_scale(cs, 1000, khz); |
| 304 | } | 306 | } |
| 305 | 307 | ||
| 308 | static inline void __clocksource_updatefreq_hz(struct clocksource *cs, u32 hz) | ||
| 309 | { | ||
| 310 | __clocksource_updatefreq_scale(cs, 1, hz); | ||
| 311 | } | ||
| 312 | |||
| 313 | static inline void __clocksource_updatefreq_khz(struct clocksource *cs, u32 khz) | ||
| 314 | { | ||
| 315 | __clocksource_updatefreq_scale(cs, 1000, khz); | ||
| 316 | } | ||
| 306 | 317 | ||
| 307 | static inline void | 318 | static inline void |
| 308 | clocksource_calc_mult_shift(struct clocksource *cs, u32 freq, u32 minsec) | 319 | clocksource_calc_mult_shift(struct clocksource *cs, u32 freq, u32 minsec) |
| @@ -313,11 +324,13 @@ clocksource_calc_mult_shift(struct clocksource *cs, u32 freq, u32 minsec) | |||
| 313 | 324 | ||
| 314 | #ifdef CONFIG_GENERIC_TIME_VSYSCALL | 325 | #ifdef CONFIG_GENERIC_TIME_VSYSCALL |
| 315 | extern void | 326 | extern void |
| 316 | update_vsyscall(struct timespec *ts, struct clocksource *c, u32 mult); | 327 | update_vsyscall(struct timespec *ts, struct timespec *wtm, |
| 328 | struct clocksource *c, u32 mult); | ||
| 317 | extern void update_vsyscall_tz(void); | 329 | extern void update_vsyscall_tz(void); |
| 318 | #else | 330 | #else |
| 319 | static inline void | 331 | static inline void |
| 320 | update_vsyscall(struct timespec *ts, struct clocksource *c, u32 mult) | 332 | update_vsyscall(struct timespec *ts, struct timespec *wtm, |
| 333 | struct clocksource *c, u32 mult) | ||
| 321 | { | 334 | { |
| 322 | } | 335 | } |
| 323 | 336 | ||
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index a5a472b10746..c1a62c56a660 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h | |||
| @@ -16,6 +16,7 @@ | |||
| 16 | # define __release(x) __context__(x,-1) | 16 | # define __release(x) __context__(x,-1) |
| 17 | # define __cond_lock(x,c) ((c) ? ({ __acquire(x); 1; }) : 0) | 17 | # define __cond_lock(x,c) ((c) ? ({ __acquire(x); 1; }) : 0) |
| 18 | # define __percpu __attribute__((noderef, address_space(3))) | 18 | # define __percpu __attribute__((noderef, address_space(3))) |
| 19 | # define __rcu | ||
| 19 | extern void __chk_user_ptr(const volatile void __user *); | 20 | extern void __chk_user_ptr(const volatile void __user *); |
| 20 | extern void __chk_io_ptr(const volatile void __iomem *); | 21 | extern void __chk_io_ptr(const volatile void __iomem *); |
| 21 | #else | 22 | #else |
| @@ -34,6 +35,7 @@ extern void __chk_io_ptr(const volatile void __iomem *); | |||
| 34 | # define __release(x) (void)0 | 35 | # define __release(x) (void)0 |
| 35 | # define __cond_lock(x,c) (c) | 36 | # define __cond_lock(x,c) (c) |
| 36 | # define __percpu | 37 | # define __percpu |
| 38 | # define __rcu | ||
| 37 | #endif | 39 | #endif |
| 38 | 40 | ||
| 39 | #ifdef __KERNEL__ | 41 | #ifdef __KERNEL__ |
diff --git a/include/linux/console.h b/include/linux/console.h index dcca5339ceb3..95cf6f08a59d 100644 --- a/include/linux/console.h +++ b/include/linux/console.h | |||
| @@ -55,6 +55,16 @@ struct consw { | |||
| 55 | void (*con_invert_region)(struct vc_data *, u16 *, int); | 55 | void (*con_invert_region)(struct vc_data *, u16 *, int); |
| 56 | u16 *(*con_screen_pos)(struct vc_data *, int); | 56 | u16 *(*con_screen_pos)(struct vc_data *, int); |
| 57 | unsigned long (*con_getxy)(struct vc_data *, unsigned long, int *, int *); | 57 | unsigned long (*con_getxy)(struct vc_data *, unsigned long, int *, int *); |
| 58 | /* | ||
| 59 | * Prepare the console for the debugger. This includes, but is not | ||
| 60 | * limited to, unblanking the console, loading an appropriate | ||
| 61 | * palette, and allowing debugger generated output. | ||
| 62 | */ | ||
| 63 | int (*con_debug_enter)(struct vc_data *); | ||
| 64 | /* | ||
| 65 | * Restore the console to its pre-debug state as closely as possible. | ||
| 66 | */ | ||
| 67 | int (*con_debug_leave)(struct vc_data *); | ||
| 58 | }; | 68 | }; |
| 59 | 69 | ||
| 60 | extern const struct consw *conswitchp; | 70 | extern const struct consw *conswitchp; |
| @@ -69,6 +79,14 @@ int register_con_driver(const struct consw *csw, int first, int last); | |||
| 69 | int unregister_con_driver(const struct consw *csw); | 79 | int unregister_con_driver(const struct consw *csw); |
| 70 | int take_over_console(const struct consw *sw, int first, int last, int deflt); | 80 | int take_over_console(const struct consw *sw, int first, int last, int deflt); |
| 71 | void give_up_console(const struct consw *sw); | 81 | void give_up_console(const struct consw *sw); |
| 82 | #ifdef CONFIG_HW_CONSOLE | ||
| 83 | int con_debug_enter(struct vc_data *vc); | ||
| 84 | int con_debug_leave(void); | ||
| 85 | #else | ||
| 86 | #define con_debug_enter(vc) (0) | ||
| 87 | #define con_debug_leave() (0) | ||
| 88 | #endif | ||
| 89 | |||
| 72 | /* scroll */ | 90 | /* scroll */ |
| 73 | #define SM_UP (1) | 91 | #define SM_UP (1) |
| 74 | #define SM_DOWN (2) | 92 | #define SM_DOWN (2) |
diff --git a/include/linux/cpu.h b/include/linux/cpu.h index e287863ac053..4823af64e9db 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h | |||
| @@ -48,6 +48,33 @@ extern ssize_t arch_cpu_release(const char *, size_t); | |||
| 48 | #endif | 48 | #endif |
| 49 | struct notifier_block; | 49 | struct notifier_block; |
| 50 | 50 | ||
| 51 | /* | ||
| 52 | * CPU notifier priorities. | ||
| 53 | */ | ||
| 54 | enum { | ||
| 55 | /* | ||
| 56 | * SCHED_ACTIVE marks a cpu which is coming up active during | ||
| 57 | * CPU_ONLINE and CPU_DOWN_FAILED and must be the first | ||
| 58 | * notifier. CPUSET_ACTIVE adjusts cpuset according to | ||
| 59 | * cpu_active mask right after SCHED_ACTIVE. During | ||
| 60 | * CPU_DOWN_PREPARE, SCHED_INACTIVE and CPUSET_INACTIVE are | ||
| 61 | * ordered in the similar way. | ||
| 62 | * | ||
| 63 | * This ordering guarantees consistent cpu_active mask and | ||
| 64 | * migration behavior to all cpu notifiers. | ||
| 65 | */ | ||
| 66 | CPU_PRI_SCHED_ACTIVE = INT_MAX, | ||
| 67 | CPU_PRI_CPUSET_ACTIVE = INT_MAX - 1, | ||
| 68 | CPU_PRI_SCHED_INACTIVE = INT_MIN + 1, | ||
| 69 | CPU_PRI_CPUSET_INACTIVE = INT_MIN, | ||
| 70 | |||
| 71 | /* migration should happen before other stuff but after perf */ | ||
| 72 | CPU_PRI_PERF = 20, | ||
| 73 | CPU_PRI_MIGRATION = 10, | ||
| 74 | /* prepare workqueues for other notifiers */ | ||
| 75 | CPU_PRI_WORKQUEUE = 5, | ||
| 76 | }; | ||
| 77 | |||
| 51 | #ifdef CONFIG_SMP | 78 | #ifdef CONFIG_SMP |
| 52 | /* Need to know about CPUs going up/down? */ | 79 | /* Need to know about CPUs going up/down? */ |
| 53 | #if defined(CONFIG_HOTPLUG_CPU) || !defined(MODULE) | 80 | #if defined(CONFIG_HOTPLUG_CPU) || !defined(MODULE) |
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 9f15150ce8d6..c3e9de8321c6 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
| @@ -196,11 +196,6 @@ extern int __cpufreq_driver_getavg(struct cpufreq_policy *policy, | |||
| 196 | int cpufreq_register_governor(struct cpufreq_governor *governor); | 196 | int cpufreq_register_governor(struct cpufreq_governor *governor); |
| 197 | void cpufreq_unregister_governor(struct cpufreq_governor *governor); | 197 | void cpufreq_unregister_governor(struct cpufreq_governor *governor); |
| 198 | 198 | ||
| 199 | int lock_policy_rwsem_read(int cpu); | ||
| 200 | int lock_policy_rwsem_write(int cpu); | ||
| 201 | void unlock_policy_rwsem_read(int cpu); | ||
| 202 | void unlock_policy_rwsem_write(int cpu); | ||
| 203 | |||
| 204 | 199 | ||
| 205 | /********************************************************************* | 200 | /********************************************************************* |
| 206 | * CPUFREQ DRIVER INTERFACE * | 201 | * CPUFREQ DRIVER INTERFACE * |
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h index 457ed765a116..f20eb8f16025 100644 --- a/include/linux/cpuset.h +++ b/include/linux/cpuset.h | |||
| @@ -20,6 +20,7 @@ extern int number_of_cpusets; /* How many cpusets are defined in system? */ | |||
| 20 | 20 | ||
| 21 | extern int cpuset_init(void); | 21 | extern int cpuset_init(void); |
| 22 | extern void cpuset_init_smp(void); | 22 | extern void cpuset_init_smp(void); |
| 23 | extern void cpuset_update_active_cpus(void); | ||
| 23 | extern void cpuset_cpus_allowed(struct task_struct *p, struct cpumask *mask); | 24 | extern void cpuset_cpus_allowed(struct task_struct *p, struct cpumask *mask); |
| 24 | extern int cpuset_cpus_allowed_fallback(struct task_struct *p); | 25 | extern int cpuset_cpus_allowed_fallback(struct task_struct *p); |
| 25 | extern nodemask_t cpuset_mems_allowed(struct task_struct *p); | 26 | extern nodemask_t cpuset_mems_allowed(struct task_struct *p); |
| @@ -132,6 +133,11 @@ static inline void set_mems_allowed(nodemask_t nodemask) | |||
| 132 | static inline int cpuset_init(void) { return 0; } | 133 | static inline int cpuset_init(void) { return 0; } |
| 133 | static inline void cpuset_init_smp(void) {} | 134 | static inline void cpuset_init_smp(void) {} |
| 134 | 135 | ||
| 136 | static inline void cpuset_update_active_cpus(void) | ||
| 137 | { | ||
| 138 | partition_sched_domains(1, NULL, NULL); | ||
| 139 | } | ||
| 140 | |||
| 135 | static inline void cpuset_cpus_allowed(struct task_struct *p, | 141 | static inline void cpuset_cpus_allowed(struct task_struct *p, |
| 136 | struct cpumask *mask) | 142 | struct cpumask *mask) |
| 137 | { | 143 | { |
diff --git a/include/linux/cred.h b/include/linux/cred.h index 75c0fa881308..4d2c39573f36 100644 --- a/include/linux/cred.h +++ b/include/linux/cred.h | |||
| @@ -153,6 +153,7 @@ struct cred { | |||
| 153 | extern void __put_cred(struct cred *); | 153 | extern void __put_cred(struct cred *); |
| 154 | extern void exit_creds(struct task_struct *); | 154 | extern void exit_creds(struct task_struct *); |
| 155 | extern int copy_creds(struct task_struct *, unsigned long); | 155 | extern int copy_creds(struct task_struct *, unsigned long); |
| 156 | extern const struct cred *get_task_cred(struct task_struct *); | ||
| 156 | extern struct cred *cred_alloc_blank(void); | 157 | extern struct cred *cred_alloc_blank(void); |
| 157 | extern struct cred *prepare_creds(void); | 158 | extern struct cred *prepare_creds(void); |
| 158 | extern struct cred *prepare_exec_creds(void); | 159 | extern struct cred *prepare_exec_creds(void); |
| @@ -273,33 +274,18 @@ static inline void put_cred(const struct cred *_cred) | |||
| 273 | * @task: The task to query | 274 | * @task: The task to query |
| 274 | * | 275 | * |
| 275 | * Access the objective credentials of a task. The caller must hold the RCU | 276 | * Access the objective credentials of a task. The caller must hold the RCU |
| 276 | * readlock. | 277 | * readlock or the task must be dead and unable to change its own credentials. |
| 277 | * | 278 | * |
| 278 | * The caller must make sure task doesn't go away, either by holding a ref on | 279 | * The result of this function should not be passed directly to get_cred(); |
| 279 | * task or by holding tasklist_lock to prevent it from being unlinked. | 280 | * rather get_task_cred() should be used instead. |
| 280 | */ | 281 | */ |
| 281 | #define __task_cred(task) \ | 282 | #define __task_cred(task) \ |
| 282 | ((const struct cred *)(rcu_dereference_check((task)->real_cred, rcu_read_lock_held() || lockdep_tasklist_lock_is_held()))) | 283 | ({ \ |
| 283 | 284 | const struct task_struct *__t = (task); \ | |
| 284 | /** | 285 | rcu_dereference_check(__t->real_cred, \ |
| 285 | * get_task_cred - Get another task's objective credentials | 286 | rcu_read_lock_held() || \ |
| 286 | * @task: The task to query | 287 | task_is_dead(__t)); \ |
| 287 | * | 288 | }) |
| 288 | * Get the objective credentials of a task, pinning them so that they can't go | ||
| 289 | * away. Accessing a task's credentials directly is not permitted. | ||
| 290 | * | ||
| 291 | * The caller must make sure task doesn't go away, either by holding a ref on | ||
| 292 | * task or by holding tasklist_lock to prevent it from being unlinked. | ||
| 293 | */ | ||
| 294 | #define get_task_cred(task) \ | ||
| 295 | ({ \ | ||
| 296 | struct cred *__cred; \ | ||
| 297 | rcu_read_lock(); \ | ||
| 298 | __cred = (struct cred *) __task_cred((task)); \ | ||
| 299 | get_cred(__cred); \ | ||
| 300 | rcu_read_unlock(); \ | ||
| 301 | __cred; \ | ||
| 302 | }) | ||
| 303 | 289 | ||
| 304 | /** | 290 | /** |
| 305 | * get_current_cred - Get the current task's subjective credentials | 291 | * get_current_cred - Get the current task's subjective credentials |
diff --git a/include/linux/delay.h b/include/linux/delay.h index fd832c6d419e..a6ecb34cf547 100644 --- a/include/linux/delay.h +++ b/include/linux/delay.h | |||
| @@ -45,6 +45,7 @@ extern unsigned long lpj_fine; | |||
| 45 | void calibrate_delay(void); | 45 | void calibrate_delay(void); |
| 46 | void msleep(unsigned int msecs); | 46 | void msleep(unsigned int msecs); |
| 47 | unsigned long msleep_interruptible(unsigned int msecs); | 47 | unsigned long msleep_interruptible(unsigned int msecs); |
| 48 | void usleep_range(unsigned long min, unsigned long max); | ||
| 48 | 49 | ||
| 49 | static inline void ssleep(unsigned int seconds) | 50 | static inline void ssleep(unsigned int seconds) |
| 50 | { | 51 | { |
diff --git a/include/linux/device.h b/include/linux/device.h index 0713e10571dd..516fecacf27b 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
| @@ -84,9 +84,8 @@ struct device *bus_find_device_by_name(struct bus_type *bus, | |||
| 84 | struct device *start, | 84 | struct device *start, |
| 85 | const char *name); | 85 | const char *name); |
| 86 | 86 | ||
| 87 | int __must_check bus_for_each_drv(struct bus_type *bus, | 87 | int bus_for_each_drv(struct bus_type *bus, struct device_driver *start, |
| 88 | struct device_driver *start, void *data, | 88 | void *data, int (*fn)(struct device_driver *, void *)); |
| 89 | int (*fn)(struct device_driver *, void *)); | ||
| 90 | 89 | ||
| 91 | void bus_sort_breadthfirst(struct bus_type *bus, | 90 | void bus_sort_breadthfirst(struct bus_type *bus, |
| 92 | int (*compare)(const struct device *a, | 91 | int (*compare)(const struct device *a, |
| @@ -110,10 +109,12 @@ extern int bus_unregister_notifier(struct bus_type *bus, | |||
| 110 | */ | 109 | */ |
| 111 | #define BUS_NOTIFY_ADD_DEVICE 0x00000001 /* device added */ | 110 | #define BUS_NOTIFY_ADD_DEVICE 0x00000001 /* device added */ |
| 112 | #define BUS_NOTIFY_DEL_DEVICE 0x00000002 /* device removed */ | 111 | #define BUS_NOTIFY_DEL_DEVICE 0x00000002 /* device removed */ |
| 113 | #define BUS_NOTIFY_BOUND_DRIVER 0x00000003 /* driver bound to device */ | 112 | #define BUS_NOTIFY_BIND_DRIVER 0x00000003 /* driver about to be |
| 114 | #define BUS_NOTIFY_UNBIND_DRIVER 0x00000004 /* driver about to be | 113 | bound */ |
| 114 | #define BUS_NOTIFY_BOUND_DRIVER 0x00000004 /* driver bound to device */ | ||
| 115 | #define BUS_NOTIFY_UNBIND_DRIVER 0x00000005 /* driver about to be | ||
| 115 | unbound */ | 116 | unbound */ |
| 116 | #define BUS_NOTIFY_UNBOUND_DRIVER 0x00000005 /* driver is unbound | 117 | #define BUS_NOTIFY_UNBOUND_DRIVER 0x00000006 /* driver is unbound |
| 117 | from the device */ | 118 | from the device */ |
| 118 | 119 | ||
| 119 | extern struct kset *bus_get_kset(struct bus_type *bus); | 120 | extern struct kset *bus_get_kset(struct bus_type *bus); |
| @@ -551,7 +552,7 @@ extern int device_for_each_child(struct device *dev, void *data, | |||
| 551 | int (*fn)(struct device *dev, void *data)); | 552 | int (*fn)(struct device *dev, void *data)); |
| 552 | extern struct device *device_find_child(struct device *dev, void *data, | 553 | extern struct device *device_find_child(struct device *dev, void *data, |
| 553 | int (*match)(struct device *dev, void *data)); | 554 | int (*match)(struct device *dev, void *data)); |
| 554 | extern int device_rename(struct device *dev, char *new_name); | 555 | extern int device_rename(struct device *dev, const char *new_name); |
| 555 | extern int device_move(struct device *dev, struct device *new_parent, | 556 | extern int device_move(struct device *dev, struct device *new_parent, |
| 556 | enum dpm_order dpm_order); | 557 | enum dpm_order dpm_order); |
| 557 | extern const char *device_get_devnode(struct device *dev, | 558 | extern const char *device_get_devnode(struct device *dev, |
| @@ -638,43 +639,103 @@ extern void sysdev_shutdown(void); | |||
| 638 | 639 | ||
| 639 | /* debugging and troubleshooting/diagnostic helpers. */ | 640 | /* debugging and troubleshooting/diagnostic helpers. */ |
| 640 | extern const char *dev_driver_string(const struct device *dev); | 641 | extern const char *dev_driver_string(const struct device *dev); |
| 641 | #define dev_printk(level, dev, format, arg...) \ | 642 | |
| 642 | printk(level "%s %s: " format , dev_driver_string(dev) , \ | 643 | |
| 643 | dev_name(dev) , ## arg) | 644 | #ifdef CONFIG_PRINTK |
| 644 | 645 | ||
| 645 | #define dev_emerg(dev, format, arg...) \ | 646 | extern int dev_printk(const char *level, const struct device *dev, |
| 646 | dev_printk(KERN_EMERG , dev , format , ## arg) | 647 | const char *fmt, ...) |
| 647 | #define dev_alert(dev, format, arg...) \ | 648 | __attribute__ ((format (printf, 3, 4))); |
| 648 | dev_printk(KERN_ALERT , dev , format , ## arg) | 649 | extern int dev_emerg(const struct device *dev, const char *fmt, ...) |
| 649 | #define dev_crit(dev, format, arg...) \ | 650 | __attribute__ ((format (printf, 2, 3))); |
| 650 | dev_printk(KERN_CRIT , dev , format , ## arg) | 651 | extern int dev_alert(const struct device *dev, const char *fmt, ...) |
| 651 | #define dev_err(dev, format, arg...) \ | 652 | __attribute__ ((format (printf, 2, 3))); |
| 652 | dev_printk(KERN_ERR , dev , format , ## arg) | 653 | extern int dev_crit(const struct device *dev, const char *fmt, ...) |
| 653 | #define dev_warn(dev, format, arg...) \ | 654 | __attribute__ ((format (printf, 2, 3))); |
| 654 | dev_printk(KERN_WARNING , dev , format , ## arg) | 655 | extern int dev_err(const struct device *dev, const char *fmt, ...) |
| 655 | #define dev_notice(dev, format, arg...) \ | 656 | __attribute__ ((format (printf, 2, 3))); |
| 656 | dev_printk(KERN_NOTICE , dev , format , ## arg) | 657 | extern int dev_warn(const struct device *dev, const char *fmt, ...) |
| 657 | #define dev_info(dev, format, arg...) \ | 658 | __attribute__ ((format (printf, 2, 3))); |
| 658 | dev_printk(KERN_INFO , dev , format , ## arg) | 659 | extern int dev_notice(const struct device *dev, const char *fmt, ...) |
| 660 | __attribute__ ((format (printf, 2, 3))); | ||
| 661 | extern int _dev_info(const struct device *dev, const char *fmt, ...) | ||
| 662 | __attribute__ ((format (printf, 2, 3))); | ||
| 663 | |||
| 664 | #else | ||
| 665 | |||
| 666 | static inline int dev_printk(const char *level, const struct device *dev, | ||
| 667 | const char *fmt, ...) | ||
| 668 | __attribute__ ((format (printf, 3, 4))); | ||
| 669 | static inline int dev_printk(const char *level, const struct device *dev, | ||
| 670 | const char *fmt, ...) | ||
| 671 | { return 0; } | ||
| 672 | |||
| 673 | static inline int dev_emerg(const struct device *dev, const char *fmt, ...) | ||
| 674 | __attribute__ ((format (printf, 2, 3))); | ||
| 675 | static inline int dev_emerg(const struct device *dev, const char *fmt, ...) | ||
| 676 | { return 0; } | ||
| 677 | static inline int dev_crit(const struct device *dev, const char *fmt, ...) | ||
| 678 | __attribute__ ((format (printf, 2, 3))); | ||
| 679 | static inline int dev_crit(const struct device *dev, const char *fmt, ...) | ||
| 680 | { return 0; } | ||
| 681 | static inline int dev_alert(const struct device *dev, const char *fmt, ...) | ||
| 682 | __attribute__ ((format (printf, 2, 3))); | ||
| 683 | static inline int dev_alert(const struct device *dev, const char *fmt, ...) | ||
| 684 | { return 0; } | ||
| 685 | static inline int dev_err(const struct device *dev, const char *fmt, ...) | ||
| 686 | __attribute__ ((format (printf, 2, 3))); | ||
| 687 | static inline int dev_err(const struct device *dev, const char *fmt, ...) | ||
| 688 | { return 0; } | ||
| 689 | static inline int dev_warn(const struct device *dev, const char *fmt, ...) | ||
| 690 | __attribute__ ((format (printf, 2, 3))); | ||
| 691 | static inline int dev_warn(const struct device *dev, const char *fmt, ...) | ||
| 692 | { return 0; } | ||
| 693 | static inline int dev_notice(const struct device *dev, const char *fmt, ...) | ||
| 694 | __attribute__ ((format (printf, 2, 3))); | ||
| 695 | static inline int dev_notice(const struct device *dev, const char *fmt, ...) | ||
| 696 | { return 0; } | ||
| 697 | static inline int _dev_info(const struct device *dev, const char *fmt, ...) | ||
| 698 | __attribute__ ((format (printf, 2, 3))); | ||
| 699 | static inline int _dev_info(const struct device *dev, const char *fmt, ...) | ||
| 700 | { return 0; } | ||
| 701 | |||
| 702 | #endif | ||
| 703 | |||
| 704 | /* | ||
| 705 | * Stupid hackaround for existing uses of non-printk uses dev_info | ||
| 706 | * | ||
| 707 | * Note that the definition of dev_info below is actually _dev_info | ||
| 708 | * and a macro is used to avoid redefining dev_info | ||
| 709 | */ | ||
| 710 | |||
| 711 | #define dev_info(dev, fmt, arg...) _dev_info(dev, fmt, ##arg) | ||
| 659 | 712 | ||
| 660 | #if defined(DEBUG) | 713 | #if defined(DEBUG) |
| 661 | #define dev_dbg(dev, format, arg...) \ | 714 | #define dev_dbg(dev, format, arg...) \ |
| 662 | dev_printk(KERN_DEBUG , dev , format , ## arg) | 715 | dev_printk(KERN_DEBUG, dev, format, ##arg) |
| 663 | #elif defined(CONFIG_DYNAMIC_DEBUG) | 716 | #elif defined(CONFIG_DYNAMIC_DEBUG) |
| 664 | #define dev_dbg(dev, format, ...) do { \ | 717 | #define dev_dbg(dev, format, ...) \ |
| 718 | do { \ | ||
| 665 | dynamic_dev_dbg(dev, format, ##__VA_ARGS__); \ | 719 | dynamic_dev_dbg(dev, format, ##__VA_ARGS__); \ |
| 666 | } while (0) | 720 | } while (0) |
| 667 | #else | 721 | #else |
| 668 | #define dev_dbg(dev, format, arg...) \ | 722 | #define dev_dbg(dev, format, arg...) \ |
| 669 | ({ if (0) dev_printk(KERN_DEBUG, dev, format, ##arg); 0; }) | 723 | ({ \ |
| 724 | if (0) \ | ||
| 725 | dev_printk(KERN_DEBUG, dev, format, ##arg); \ | ||
| 726 | 0; \ | ||
| 727 | }) | ||
| 670 | #endif | 728 | #endif |
| 671 | 729 | ||
| 672 | #ifdef VERBOSE_DEBUG | 730 | #ifdef VERBOSE_DEBUG |
| 673 | #define dev_vdbg dev_dbg | 731 | #define dev_vdbg dev_dbg |
| 674 | #else | 732 | #else |
| 675 | 733 | #define dev_vdbg(dev, format, arg...) \ | |
| 676 | #define dev_vdbg(dev, format, arg...) \ | 734 | ({ \ |
| 677 | ({ if (0) dev_printk(KERN_DEBUG, dev, format, ##arg); 0; }) | 735 | if (0) \ |
| 736 | dev_printk(KERN_DEBUG, dev, format, ##arg); \ | ||
| 737 | 0; \ | ||
| 738 | }) | ||
| 678 | #endif | 739 | #endif |
| 679 | 740 | ||
| 680 | /* | 741 | /* |
diff --git a/include/linux/dmi.h b/include/linux/dmi.h index a8a3e1ac281d..90e087f8d951 100644 --- a/include/linux/dmi.h +++ b/include/linux/dmi.h | |||
| @@ -20,6 +20,7 @@ enum dmi_device_type { | |||
| 20 | DMI_DEV_TYPE_SAS, | 20 | DMI_DEV_TYPE_SAS, |
| 21 | DMI_DEV_TYPE_IPMI = -1, | 21 | DMI_DEV_TYPE_IPMI = -1, |
| 22 | DMI_DEV_TYPE_OEM_STRING = -2, | 22 | DMI_DEV_TYPE_OEM_STRING = -2, |
| 23 | DMI_DEV_TYPE_DEV_ONBOARD = -3, | ||
| 23 | }; | 24 | }; |
| 24 | 25 | ||
| 25 | struct dmi_header { | 26 | struct dmi_header { |
| @@ -37,6 +38,14 @@ struct dmi_device { | |||
| 37 | 38 | ||
| 38 | #ifdef CONFIG_DMI | 39 | #ifdef CONFIG_DMI |
| 39 | 40 | ||
| 41 | struct dmi_dev_onboard { | ||
| 42 | struct dmi_device dev; | ||
| 43 | int instance; | ||
| 44 | int segment; | ||
| 45 | int bus; | ||
| 46 | int devfn; | ||
| 47 | }; | ||
| 48 | |||
| 40 | extern int dmi_check_system(const struct dmi_system_id *list); | 49 | extern int dmi_check_system(const struct dmi_system_id *list); |
| 41 | const struct dmi_system_id *dmi_first_match(const struct dmi_system_id *list); | 50 | const struct dmi_system_id *dmi_first_match(const struct dmi_system_id *list); |
| 42 | extern const char * dmi_get_system_info(int field); | 51 | extern const char * dmi_get_system_info(int field); |
diff --git a/include/linux/dns_resolver.h b/include/linux/dns_resolver.h new file mode 100644 index 000000000000..cc92268af89a --- /dev/null +++ b/include/linux/dns_resolver.h | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | /* | ||
| 2 | * DNS Resolver upcall management for CIFS DFS and AFS | ||
| 3 | * Handles host name to IP address resolution and DNS query for AFSDB RR. | ||
| 4 | * | ||
| 5 | * Copyright (c) International Business Machines Corp., 2008 | ||
| 6 | * Author(s): Steve French (sfrench@us.ibm.com) | ||
| 7 | * Wang Lei (wang840925@gmail.com) | ||
| 8 | * | ||
| 9 | * This library is free software; you can redistribute it and/or modify | ||
| 10 | * it under the terms of the GNU Lesser General Public License as published | ||
| 11 | * by the Free Software Foundation; either version 2.1 of the License, or | ||
| 12 | * (at your option) any later version. | ||
| 13 | * | ||
| 14 | * This library is distributed in the hope that it will be useful, | ||
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See | ||
| 17 | * the GNU Lesser General Public License for more details. | ||
| 18 | * | ||
| 19 | * You should have received a copy of the GNU Lesser General Public License | ||
| 20 | * along with this library; if not, write to the Free Software | ||
| 21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 22 | */ | ||
| 23 | |||
| 24 | #ifndef _LINUX_DNS_RESOLVER_H | ||
| 25 | #define _LINUX_DNS_RESOLVER_H | ||
| 26 | |||
| 27 | #ifdef __KERNEL__ | ||
| 28 | |||
| 29 | extern int dns_query(const char *type, const char *name, size_t namelen, | ||
| 30 | const char *options, char **_result, time_t *_expiry); | ||
| 31 | |||
| 32 | #endif /* KERNEL */ | ||
| 33 | |||
| 34 | #endif /* _LINUX_DNS_RESOLVER_H */ | ||
diff --git a/include/linux/dqblk_xfs.h b/include/linux/dqblk_xfs.h index 4389ae72024e..86552807aed9 100644 --- a/include/linux/dqblk_xfs.h +++ b/include/linux/dqblk_xfs.h | |||
| @@ -49,7 +49,7 @@ | |||
| 49 | #define FS_DQUOT_VERSION 1 /* fs_disk_quota.d_version */ | 49 | #define FS_DQUOT_VERSION 1 /* fs_disk_quota.d_version */ |
| 50 | typedef struct fs_disk_quota { | 50 | typedef struct fs_disk_quota { |
| 51 | __s8 d_version; /* version of this structure */ | 51 | __s8 d_version; /* version of this structure */ |
| 52 | __s8 d_flags; /* XFS_{USER,PROJ,GROUP}_QUOTA */ | 52 | __s8 d_flags; /* FS_{USER,PROJ,GROUP}_QUOTA */ |
| 53 | __u16 d_fieldmask; /* field specifier */ | 53 | __u16 d_fieldmask; /* field specifier */ |
| 54 | __u32 d_id; /* user, project, or group ID */ | 54 | __u32 d_id; /* user, project, or group ID */ |
| 55 | __u64 d_blk_hardlimit;/* absolute limit on disk blks */ | 55 | __u64 d_blk_hardlimit;/* absolute limit on disk blks */ |
| @@ -119,18 +119,18 @@ typedef struct fs_disk_quota { | |||
| 119 | #define FS_DQ_ACCT_MASK (FS_DQ_BCOUNT | FS_DQ_ICOUNT | FS_DQ_RTBCOUNT) | 119 | #define FS_DQ_ACCT_MASK (FS_DQ_BCOUNT | FS_DQ_ICOUNT | FS_DQ_RTBCOUNT) |
| 120 | 120 | ||
| 121 | /* | 121 | /* |
| 122 | * Various flags related to quotactl(2). Only relevant to XFS filesystems. | 122 | * Various flags related to quotactl(2). |
| 123 | */ | 123 | */ |
| 124 | #define XFS_QUOTA_UDQ_ACCT (1<<0) /* user quota accounting */ | 124 | #define FS_QUOTA_UDQ_ACCT (1<<0) /* user quota accounting */ |
| 125 | #define XFS_QUOTA_UDQ_ENFD (1<<1) /* user quota limits enforcement */ | 125 | #define FS_QUOTA_UDQ_ENFD (1<<1) /* user quota limits enforcement */ |
| 126 | #define XFS_QUOTA_GDQ_ACCT (1<<2) /* group quota accounting */ | 126 | #define FS_QUOTA_GDQ_ACCT (1<<2) /* group quota accounting */ |
| 127 | #define XFS_QUOTA_GDQ_ENFD (1<<3) /* group quota limits enforcement */ | 127 | #define FS_QUOTA_GDQ_ENFD (1<<3) /* group quota limits enforcement */ |
| 128 | #define XFS_QUOTA_PDQ_ACCT (1<<4) /* project quota accounting */ | 128 | #define FS_QUOTA_PDQ_ACCT (1<<4) /* project quota accounting */ |
| 129 | #define XFS_QUOTA_PDQ_ENFD (1<<5) /* project quota limits enforcement */ | 129 | #define FS_QUOTA_PDQ_ENFD (1<<5) /* project quota limits enforcement */ |
| 130 | 130 | ||
| 131 | #define XFS_USER_QUOTA (1<<0) /* user quota type */ | 131 | #define FS_USER_QUOTA (1<<0) /* user quota type */ |
| 132 | #define XFS_PROJ_QUOTA (1<<1) /* project quota type */ | 132 | #define FS_PROJ_QUOTA (1<<1) /* project quota type */ |
| 133 | #define XFS_GROUP_QUOTA (1<<2) /* group quota type */ | 133 | #define FS_GROUP_QUOTA (1<<2) /* group quota type */ |
| 134 | 134 | ||
| 135 | /* | 135 | /* |
| 136 | * fs_quota_stat is the struct returned in Q_XGETQSTAT for a given file system. | 136 | * fs_quota_stat is the struct returned in Q_XGETQSTAT for a given file system. |
| @@ -151,7 +151,7 @@ typedef struct fs_qfilestat { | |||
| 151 | 151 | ||
| 152 | typedef struct fs_quota_stat { | 152 | typedef struct fs_quota_stat { |
| 153 | __s8 qs_version; /* version number for future changes */ | 153 | __s8 qs_version; /* version number for future changes */ |
| 154 | __u16 qs_flags; /* XFS_QUOTA_{U,P,G}DQ_{ACCT,ENFD} */ | 154 | __u16 qs_flags; /* FS_QUOTA_{U,P,G}DQ_{ACCT,ENFD} */ |
| 155 | __s8 qs_pad; /* unused */ | 155 | __s8 qs_pad; /* unused */ |
| 156 | fs_qfilestat_t qs_uquota; /* user quota storage information */ | 156 | fs_qfilestat_t qs_uquota; /* user quota storage information */ |
| 157 | fs_qfilestat_t qs_gquota; /* group quota storage information */ | 157 | fs_qfilestat_t qs_gquota; /* group quota storage information */ |
diff --git a/include/linux/dvb/frontend.h b/include/linux/dvb/frontend.h index b6cb5425cde3..493a2bf85f62 100644 --- a/include/linux/dvb/frontend.h +++ b/include/linux/dvb/frontend.h | |||
| @@ -62,6 +62,7 @@ typedef enum fe_caps { | |||
| 62 | FE_CAN_8VSB = 0x200000, | 62 | FE_CAN_8VSB = 0x200000, |
| 63 | FE_CAN_16VSB = 0x400000, | 63 | FE_CAN_16VSB = 0x400000, |
| 64 | FE_HAS_EXTENDED_CAPS = 0x800000, /* We need more bitspace for newer APIs, indicate this. */ | 64 | FE_HAS_EXTENDED_CAPS = 0x800000, /* We need more bitspace for newer APIs, indicate this. */ |
| 65 | FE_CAN_TURBO_FEC = 0x8000000, /* frontend supports "turbo fec modulation" */ | ||
| 65 | FE_CAN_2G_MODULATION = 0x10000000, /* frontend supports "2nd generation modulation" (DVB-S2) */ | 66 | FE_CAN_2G_MODULATION = 0x10000000, /* frontend supports "2nd generation modulation" (DVB-S2) */ |
| 66 | FE_NEEDS_BENDING = 0x20000000, /* not supported anymore, don't use (frontend requires frequency bending) */ | 67 | FE_NEEDS_BENDING = 0x20000000, /* not supported anymore, don't use (frontend requires frequency bending) */ |
| 67 | FE_CAN_RECOVER = 0x40000000, /* frontend can recover from a cable unplug automatically */ | 68 | FE_CAN_RECOVER = 0x40000000, /* frontend can recover from a cable unplug automatically */ |
diff --git a/include/linux/dvb/version.h b/include/linux/dvb/version.h index 540b0583d9fb..5a7546c12688 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 1 | 27 | #define DVB_API_VERSION_MINOR 2 |
| 28 | 28 | ||
| 29 | #endif /*_DVBVERSION_H_*/ | 29 | #endif /*_DVBVERSION_H_*/ |
diff --git a/include/linux/eeprom_93cx6.h b/include/linux/eeprom_93cx6.h index a55c873e8b66..c4627cbdb8e0 100644 --- a/include/linux/eeprom_93cx6.h +++ b/include/linux/eeprom_93cx6.h | |||
| @@ -30,6 +30,7 @@ | |||
| 30 | #define PCI_EEPROM_WIDTH_93C46 6 | 30 | #define PCI_EEPROM_WIDTH_93C46 6 |
| 31 | #define PCI_EEPROM_WIDTH_93C56 8 | 31 | #define PCI_EEPROM_WIDTH_93C56 8 |
| 32 | #define PCI_EEPROM_WIDTH_93C66 8 | 32 | #define PCI_EEPROM_WIDTH_93C66 8 |
| 33 | #define PCI_EEPROM_WIDTH_93C86 8 | ||
| 33 | #define PCI_EEPROM_WIDTH_OPCODE 3 | 34 | #define PCI_EEPROM_WIDTH_OPCODE 3 |
| 34 | #define PCI_EEPROM_WRITE_OPCODE 0x05 | 35 | #define PCI_EEPROM_WRITE_OPCODE 0x05 |
| 35 | #define PCI_EEPROM_READ_OPCODE 0x06 | 36 | #define PCI_EEPROM_READ_OPCODE 0x06 |
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h index 3d7a6687d247..848480bc2bf9 100644 --- a/include/linux/etherdevice.h +++ b/include/linux/etherdevice.h | |||
| @@ -127,6 +127,20 @@ static inline void random_ether_addr(u8 *addr) | |||
| 127 | } | 127 | } |
| 128 | 128 | ||
| 129 | /** | 129 | /** |
| 130 | * dev_hw_addr_random - Create random MAC and set device flag | ||
| 131 | * @dev: pointer to net_device structure | ||
| 132 | * @addr: Pointer to a six-byte array containing the Ethernet address | ||
| 133 | * | ||
| 134 | * Generate random MAC to be used by a device and set addr_assign_type | ||
| 135 | * so the state can be read by sysfs and be used by udev. | ||
| 136 | */ | ||
| 137 | static inline void dev_hw_addr_random(struct net_device *dev, u8 *hwaddr) | ||
| 138 | { | ||
| 139 | dev->addr_assign_type |= NET_ADDR_RANDOM; | ||
| 140 | random_ether_addr(hwaddr); | ||
| 141 | } | ||
| 142 | |||
| 143 | /** | ||
| 130 | * compare_ether_addr - Compare two Ethernet addresses | 144 | * compare_ether_addr - Compare two Ethernet addresses |
| 131 | * @addr1: Pointer to a six-byte array containing the Ethernet address | 145 | * @addr1: Pointer to a six-byte array containing the Ethernet address |
| 132 | * @addr2: Pointer other six-byte array containing the Ethernet address | 146 | * @addr2: Pointer other six-byte array containing the Ethernet address |
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index b4207ca3ad52..991269e5b152 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h | |||
| @@ -386,6 +386,15 @@ struct ethtool_rxnfc { | |||
| 386 | __u32 rule_locs[0]; | 386 | __u32 rule_locs[0]; |
| 387 | }; | 387 | }; |
| 388 | 388 | ||
| 389 | struct ethtool_rxfh_indir { | ||
| 390 | __u32 cmd; | ||
| 391 | /* On entry, this is the array size of the user buffer. On | ||
| 392 | * return from ETHTOOL_GRXFHINDIR, this is the array size of | ||
| 393 | * the hardware indirection table. */ | ||
| 394 | __u32 size; | ||
| 395 | __u32 ring_index[0]; /* ring/queue index for each hash value */ | ||
| 396 | }; | ||
| 397 | |||
| 389 | struct ethtool_rx_ntuple_flow_spec { | 398 | struct ethtool_rx_ntuple_flow_spec { |
| 390 | __u32 flow_type; | 399 | __u32 flow_type; |
| 391 | union { | 400 | union { |
| @@ -459,7 +468,7 @@ int ethtool_op_set_tso(struct net_device *dev, u32 data); | |||
| 459 | u32 ethtool_op_get_ufo(struct net_device *dev); | 468 | u32 ethtool_op_get_ufo(struct net_device *dev); |
| 460 | int ethtool_op_set_ufo(struct net_device *dev, u32 data); | 469 | int ethtool_op_set_ufo(struct net_device *dev, u32 data); |
| 461 | u32 ethtool_op_get_flags(struct net_device *dev); | 470 | u32 ethtool_op_get_flags(struct net_device *dev); |
| 462 | int ethtool_op_set_flags(struct net_device *dev, u32 data); | 471 | int ethtool_op_set_flags(struct net_device *dev, u32 data, u32 supported); |
| 463 | void ethtool_ntuple_flush(struct net_device *dev); | 472 | void ethtool_ntuple_flush(struct net_device *dev); |
| 464 | 473 | ||
| 465 | /** | 474 | /** |
| @@ -578,6 +587,10 @@ struct ethtool_ops { | |||
| 578 | int (*set_rx_ntuple)(struct net_device *, | 587 | int (*set_rx_ntuple)(struct net_device *, |
| 579 | struct ethtool_rx_ntuple *); | 588 | struct ethtool_rx_ntuple *); |
| 580 | int (*get_rx_ntuple)(struct net_device *, u32 stringset, void *); | 589 | int (*get_rx_ntuple)(struct net_device *, u32 stringset, void *); |
| 590 | int (*get_rxfh_indir)(struct net_device *, | ||
| 591 | struct ethtool_rxfh_indir *); | ||
| 592 | int (*set_rxfh_indir)(struct net_device *, | ||
| 593 | const struct ethtool_rxfh_indir *); | ||
| 581 | }; | 594 | }; |
| 582 | #endif /* __KERNEL__ */ | 595 | #endif /* __KERNEL__ */ |
| 583 | 596 | ||
| @@ -588,29 +601,29 @@ struct ethtool_ops { | |||
| 588 | #define ETHTOOL_GREGS 0x00000004 /* Get NIC registers. */ | 601 | #define ETHTOOL_GREGS 0x00000004 /* Get NIC registers. */ |
| 589 | #define ETHTOOL_GWOL 0x00000005 /* Get wake-on-lan options. */ | 602 | #define ETHTOOL_GWOL 0x00000005 /* Get wake-on-lan options. */ |
| 590 | #define ETHTOOL_SWOL 0x00000006 /* Set wake-on-lan options. */ | 603 | #define ETHTOOL_SWOL 0x00000006 /* Set wake-on-lan options. */ |
| 591 | #define ETHTOOL_GMSGLVL 0x00000007 /* Get driver message level */ | 604 | #define ETHTOOL_GMSGLVL 0x00000007 /* Get driver message level */ |
| 592 | #define ETHTOOL_SMSGLVL 0x00000008 /* Set driver msg level. */ | 605 | #define ETHTOOL_SMSGLVL 0x00000008 /* Set driver msg level. */ |
| 593 | #define ETHTOOL_NWAY_RST 0x00000009 /* Restart autonegotiation. */ | 606 | #define ETHTOOL_NWAY_RST 0x00000009 /* Restart autonegotiation. */ |
| 594 | #define ETHTOOL_GLINK 0x0000000a /* Get link status (ethtool_value) */ | 607 | #define ETHTOOL_GLINK 0x0000000a /* Get link status (ethtool_value) */ |
| 595 | #define ETHTOOL_GEEPROM 0x0000000b /* Get EEPROM data */ | 608 | #define ETHTOOL_GEEPROM 0x0000000b /* Get EEPROM data */ |
| 596 | #define ETHTOOL_SEEPROM 0x0000000c /* Set EEPROM data. */ | 609 | #define ETHTOOL_SEEPROM 0x0000000c /* Set EEPROM data. */ |
| 597 | #define ETHTOOL_GCOALESCE 0x0000000e /* Get coalesce config */ | 610 | #define ETHTOOL_GCOALESCE 0x0000000e /* Get coalesce config */ |
| 598 | #define ETHTOOL_SCOALESCE 0x0000000f /* Set coalesce config. */ | 611 | #define ETHTOOL_SCOALESCE 0x0000000f /* Set coalesce config. */ |
| 599 | #define ETHTOOL_GRINGPARAM 0x00000010 /* Get ring parameters */ | 612 | #define ETHTOOL_GRINGPARAM 0x00000010 /* Get ring parameters */ |
| 600 | #define ETHTOOL_SRINGPARAM 0x00000011 /* Set ring parameters. */ | 613 | #define ETHTOOL_SRINGPARAM 0x00000011 /* Set ring parameters. */ |
| 601 | #define ETHTOOL_GPAUSEPARAM 0x00000012 /* Get pause parameters */ | 614 | #define ETHTOOL_GPAUSEPARAM 0x00000012 /* Get pause parameters */ |
| 602 | #define ETHTOOL_SPAUSEPARAM 0x00000013 /* Set pause parameters. */ | 615 | #define ETHTOOL_SPAUSEPARAM 0x00000013 /* Set pause parameters. */ |
| 603 | #define ETHTOOL_GRXCSUM 0x00000014 /* Get RX hw csum enable (ethtool_value) */ | 616 | #define ETHTOOL_GRXCSUM 0x00000014 /* Get RX hw csum enable (ethtool_value) */ |
| 604 | #define ETHTOOL_SRXCSUM 0x00000015 /* Set RX hw csum enable (ethtool_value) */ | 617 | #define ETHTOOL_SRXCSUM 0x00000015 /* Set RX hw csum enable (ethtool_value) */ |
| 605 | #define ETHTOOL_GTXCSUM 0x00000016 /* Get TX hw csum enable (ethtool_value) */ | 618 | #define ETHTOOL_GTXCSUM 0x00000016 /* Get TX hw csum enable (ethtool_value) */ |
| 606 | #define ETHTOOL_STXCSUM 0x00000017 /* Set TX hw csum enable (ethtool_value) */ | 619 | #define ETHTOOL_STXCSUM 0x00000017 /* Set TX hw csum enable (ethtool_value) */ |
| 607 | #define ETHTOOL_GSG 0x00000018 /* Get scatter-gather enable | 620 | #define ETHTOOL_GSG 0x00000018 /* Get scatter-gather enable |
| 608 | * (ethtool_value) */ | 621 | * (ethtool_value) */ |
| 609 | #define ETHTOOL_SSG 0x00000019 /* Set scatter-gather enable | 622 | #define ETHTOOL_SSG 0x00000019 /* Set scatter-gather enable |
| 610 | * (ethtool_value). */ | 623 | * (ethtool_value). */ |
| 611 | #define ETHTOOL_TEST 0x0000001a /* execute NIC self-test. */ | 624 | #define ETHTOOL_TEST 0x0000001a /* execute NIC self-test. */ |
| 612 | #define ETHTOOL_GSTRINGS 0x0000001b /* get specified string set */ | 625 | #define ETHTOOL_GSTRINGS 0x0000001b /* get specified string set */ |
| 613 | #define ETHTOOL_PHYS_ID 0x0000001c /* identify the NIC */ | 626 | #define ETHTOOL_PHYS_ID 0x0000001c /* identify the NIC */ |
| 614 | #define ETHTOOL_GSTATS 0x0000001d /* get NIC-specific statistics */ | 627 | #define ETHTOOL_GSTATS 0x0000001d /* get NIC-specific statistics */ |
| 615 | #define ETHTOOL_GTSO 0x0000001e /* Get TSO enable (ethtool_value) */ | 628 | #define ETHTOOL_GTSO 0x0000001e /* Get TSO enable (ethtool_value) */ |
| 616 | #define ETHTOOL_STSO 0x0000001f /* Set TSO enable (ethtool_value) */ | 629 | #define ETHTOOL_STSO 0x0000001f /* Set TSO enable (ethtool_value) */ |
| @@ -621,8 +634,8 @@ struct ethtool_ops { | |||
| 621 | #define ETHTOOL_SGSO 0x00000024 /* Set GSO enable (ethtool_value) */ | 634 | #define ETHTOOL_SGSO 0x00000024 /* Set GSO enable (ethtool_value) */ |
| 622 | #define ETHTOOL_GFLAGS 0x00000025 /* Get flags bitmap(ethtool_value) */ | 635 | #define ETHTOOL_GFLAGS 0x00000025 /* Get flags bitmap(ethtool_value) */ |
| 623 | #define ETHTOOL_SFLAGS 0x00000026 /* Set flags bitmap(ethtool_value) */ | 636 | #define ETHTOOL_SFLAGS 0x00000026 /* Set flags bitmap(ethtool_value) */ |
| 624 | #define ETHTOOL_GPFLAGS 0x00000027 /* Get driver-private flags bitmap */ | 637 | #define ETHTOOL_GPFLAGS 0x00000027 /* Get driver-private flags bitmap */ |
| 625 | #define ETHTOOL_SPFLAGS 0x00000028 /* Set driver-private flags bitmap */ | 638 | #define ETHTOOL_SPFLAGS 0x00000028 /* Set driver-private flags bitmap */ |
| 626 | 639 | ||
| 627 | #define ETHTOOL_GRXFH 0x00000029 /* Get RX flow hash configuration */ | 640 | #define ETHTOOL_GRXFH 0x00000029 /* Get RX flow hash configuration */ |
| 628 | #define ETHTOOL_SRXFH 0x0000002a /* Set RX flow hash configuration */ | 641 | #define ETHTOOL_SRXFH 0x0000002a /* Set RX flow hash configuration */ |
| @@ -639,6 +652,8 @@ struct ethtool_ops { | |||
| 639 | #define ETHTOOL_SRXNTUPLE 0x00000035 /* Add an n-tuple filter to device */ | 652 | #define ETHTOOL_SRXNTUPLE 0x00000035 /* Add an n-tuple filter to device */ |
| 640 | #define ETHTOOL_GRXNTUPLE 0x00000036 /* Get n-tuple filters from device */ | 653 | #define ETHTOOL_GRXNTUPLE 0x00000036 /* Get n-tuple filters from device */ |
| 641 | #define ETHTOOL_GSSET_INFO 0x00000037 /* Get string set info */ | 654 | #define ETHTOOL_GSSET_INFO 0x00000037 /* Get string set info */ |
| 655 | #define ETHTOOL_GRXFHINDIR 0x00000038 /* Get RX flow hash indir'n table */ | ||
| 656 | #define ETHTOOL_SRXFHINDIR 0x00000039 /* Set RX flow hash indir'n table */ | ||
| 642 | 657 | ||
| 643 | /* compatibility with older code */ | 658 | /* compatibility with older code */ |
| 644 | #define SPARC_ETH_GSET ETHTOOL_GSET | 659 | #define SPARC_ETH_GSET ETHTOOL_GSET |
| @@ -647,18 +662,18 @@ struct ethtool_ops { | |||
| 647 | /* Indicates what features are supported by the interface. */ | 662 | /* Indicates what features are supported by the interface. */ |
| 648 | #define SUPPORTED_10baseT_Half (1 << 0) | 663 | #define SUPPORTED_10baseT_Half (1 << 0) |
| 649 | #define SUPPORTED_10baseT_Full (1 << 1) | 664 | #define SUPPORTED_10baseT_Full (1 << 1) |
| 650 | #define SUPPORTED_100baseT_Half (1 << 2) | 665 | #define SUPPORTED_100baseT_Half (1 << 2) |
| 651 | #define SUPPORTED_100baseT_Full (1 << 3) | 666 | #define SUPPORTED_100baseT_Full (1 << 3) |
| 652 | #define SUPPORTED_1000baseT_Half (1 << 4) | 667 | #define SUPPORTED_1000baseT_Half (1 << 4) |
| 653 | #define SUPPORTED_1000baseT_Full (1 << 5) | 668 | #define SUPPORTED_1000baseT_Full (1 << 5) |
| 654 | #define SUPPORTED_Autoneg (1 << 6) | 669 | #define SUPPORTED_Autoneg (1 << 6) |
| 655 | #define SUPPORTED_TP (1 << 7) | 670 | #define SUPPORTED_TP (1 << 7) |
| 656 | #define SUPPORTED_AUI (1 << 8) | 671 | #define SUPPORTED_AUI (1 << 8) |
| 657 | #define SUPPORTED_MII (1 << 9) | 672 | #define SUPPORTED_MII (1 << 9) |
| 658 | #define SUPPORTED_FIBRE (1 << 10) | 673 | #define SUPPORTED_FIBRE (1 << 10) |
| 659 | #define SUPPORTED_BNC (1 << 11) | 674 | #define SUPPORTED_BNC (1 << 11) |
| 660 | #define SUPPORTED_10000baseT_Full (1 << 12) | 675 | #define SUPPORTED_10000baseT_Full (1 << 12) |
| 661 | #define SUPPORTED_Pause (1 << 13) | 676 | #define SUPPORTED_Pause (1 << 13) |
| 662 | #define SUPPORTED_Asym_Pause (1 << 14) | 677 | #define SUPPORTED_Asym_Pause (1 << 14) |
| 663 | #define SUPPORTED_2500baseX_Full (1 << 15) | 678 | #define SUPPORTED_2500baseX_Full (1 << 15) |
| 664 | #define SUPPORTED_Backplane (1 << 16) | 679 | #define SUPPORTED_Backplane (1 << 16) |
| @@ -668,8 +683,8 @@ struct ethtool_ops { | |||
| 668 | #define SUPPORTED_10000baseR_FEC (1 << 20) | 683 | #define SUPPORTED_10000baseR_FEC (1 << 20) |
| 669 | 684 | ||
| 670 | /* Indicates what features are advertised by the interface. */ | 685 | /* Indicates what features are advertised by the interface. */ |
| 671 | #define ADVERTISED_10baseT_Half (1 << 0) | 686 | #define ADVERTISED_10baseT_Half (1 << 0) |
| 672 | #define ADVERTISED_10baseT_Full (1 << 1) | 687 | #define ADVERTISED_10baseT_Full (1 << 1) |
| 673 | #define ADVERTISED_100baseT_Half (1 << 2) | 688 | #define ADVERTISED_100baseT_Half (1 << 2) |
| 674 | #define ADVERTISED_100baseT_Full (1 << 3) | 689 | #define ADVERTISED_100baseT_Full (1 << 3) |
| 675 | #define ADVERTISED_1000baseT_Half (1 << 4) | 690 | #define ADVERTISED_1000baseT_Half (1 << 4) |
| @@ -708,12 +723,12 @@ struct ethtool_ops { | |||
| 708 | #define DUPLEX_FULL 0x01 | 723 | #define DUPLEX_FULL 0x01 |
| 709 | 724 | ||
| 710 | /* Which connector port. */ | 725 | /* Which connector port. */ |
| 711 | #define PORT_TP 0x00 | 726 | #define PORT_TP 0x00 |
| 712 | #define PORT_AUI 0x01 | 727 | #define PORT_AUI 0x01 |
| 713 | #define PORT_MII 0x02 | 728 | #define PORT_MII 0x02 |
| 714 | #define PORT_FIBRE 0x03 | 729 | #define PORT_FIBRE 0x03 |
| 715 | #define PORT_BNC 0x04 | 730 | #define PORT_BNC 0x04 |
| 716 | #define PORT_DA 0x05 | 731 | #define PORT_DA 0x05 |
| 717 | #define PORT_NONE 0xef | 732 | #define PORT_NONE 0xef |
| 718 | #define PORT_OTHER 0xff | 733 | #define PORT_OTHER 0xff |
| 719 | 734 | ||
| @@ -727,7 +742,7 @@ struct ethtool_ops { | |||
| 727 | /* Enable or disable autonegotiation. If this is set to enable, | 742 | /* Enable or disable autonegotiation. If this is set to enable, |
| 728 | * the forced link modes above are completely ignored. | 743 | * the forced link modes above are completely ignored. |
| 729 | */ | 744 | */ |
| 730 | #define AUTONEG_DISABLE 0x00 | 745 | #define AUTONEG_DISABLE 0x00 |
| 731 | #define AUTONEG_ENABLE 0x01 | 746 | #define AUTONEG_ENABLE 0x01 |
| 732 | 747 | ||
| 733 | /* Mode MDI or MDI-X */ | 748 | /* Mode MDI or MDI-X */ |
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h index 7fc62d4550b2..3d3a9915dde2 100644 --- a/include/linux/ext3_fs.h +++ b/include/linux/ext3_fs.h | |||
| @@ -400,7 +400,6 @@ struct ext3_inode { | |||
| 400 | #define EXT3_MOUNT_POSIX_ACL 0x08000 /* POSIX Access Control Lists */ | 400 | #define EXT3_MOUNT_POSIX_ACL 0x08000 /* POSIX Access Control Lists */ |
| 401 | #define EXT3_MOUNT_RESERVATION 0x10000 /* Preallocation */ | 401 | #define EXT3_MOUNT_RESERVATION 0x10000 /* Preallocation */ |
| 402 | #define EXT3_MOUNT_BARRIER 0x20000 /* Use block barriers */ | 402 | #define EXT3_MOUNT_BARRIER 0x20000 /* Use block barriers */ |
| 403 | #define EXT3_MOUNT_NOBH 0x40000 /* No bufferheads */ | ||
| 404 | #define EXT3_MOUNT_QUOTA 0x80000 /* Some quota option set */ | 403 | #define EXT3_MOUNT_QUOTA 0x80000 /* Some quota option set */ |
| 405 | #define EXT3_MOUNT_USRQUOTA 0x100000 /* "old" user quota */ | 404 | #define EXT3_MOUNT_USRQUOTA 0x100000 /* "old" user quota */ |
| 406 | #define EXT3_MOUNT_GRPQUOTA 0x200000 /* "old" group quota */ | 405 | #define EXT3_MOUNT_GRPQUOTA 0x200000 /* "old" group quota */ |
diff --git a/include/linux/fb.h b/include/linux/fb.h index 8e5a9dfb76bf..0c5659c41b01 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
| @@ -3,6 +3,9 @@ | |||
| 3 | 3 | ||
| 4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 5 | #include <linux/i2c.h> | 5 | #include <linux/i2c.h> |
| 6 | #ifdef __KERNEL__ | ||
| 7 | #include <linux/kgdb.h> | ||
| 8 | #endif /* __KERNEL__ */ | ||
| 6 | 9 | ||
| 7 | /* Definitions of frame buffers */ | 10 | /* Definitions of frame buffers */ |
| 8 | 11 | ||
| @@ -607,6 +610,12 @@ struct fb_deferred_io { | |||
| 607 | * LOCKING NOTE: those functions must _ALL_ be called with the console | 610 | * LOCKING NOTE: those functions must _ALL_ be called with the console |
| 608 | * semaphore held, this is the only suitable locking mechanism we have | 611 | * semaphore held, this is the only suitable locking mechanism we have |
| 609 | * in 2.6. Some may be called at interrupt time at this point though. | 612 | * in 2.6. Some may be called at interrupt time at this point though. |
| 613 | * | ||
| 614 | * The exception to this is the debug related hooks. Putting the fb | ||
| 615 | * into a debug state (e.g. flipping to the kernel console) and restoring | ||
| 616 | * it must be done in a lock-free manner, so low level drivers should | ||
| 617 | * keep track of the initial console (if applicable) and may need to | ||
| 618 | * perform direct, unlocked hardware writes in these hooks. | ||
| 610 | */ | 619 | */ |
| 611 | 620 | ||
| 612 | struct fb_ops { | 621 | struct fb_ops { |
| @@ -676,6 +685,10 @@ struct fb_ops { | |||
| 676 | 685 | ||
| 677 | /* teardown any resources to do with this framebuffer */ | 686 | /* teardown any resources to do with this framebuffer */ |
| 678 | void (*fb_destroy)(struct fb_info *info); | 687 | void (*fb_destroy)(struct fb_info *info); |
| 688 | |||
| 689 | /* called at KDB enter and leave time to prepare the console */ | ||
| 690 | int (*fb_debug_enter)(struct fb_info *info); | ||
| 691 | int (*fb_debug_leave)(struct fb_info *info); | ||
| 679 | }; | 692 | }; |
| 680 | 693 | ||
| 681 | #ifdef CONFIG_FB_TILEBLITTING | 694 | #ifdef CONFIG_FB_TILEBLITTING |
| @@ -873,6 +886,8 @@ struct fb_info { | |||
| 873 | static inline struct apertures_struct *alloc_apertures(unsigned int max_num) { | 886 | static inline struct apertures_struct *alloc_apertures(unsigned int max_num) { |
| 874 | struct apertures_struct *a = kzalloc(sizeof(struct apertures_struct) | 887 | struct apertures_struct *a = kzalloc(sizeof(struct apertures_struct) |
| 875 | + max_num * sizeof(struct aperture), GFP_KERNEL); | 888 | + max_num * sizeof(struct aperture), GFP_KERNEL); |
| 889 | if (!a) | ||
| 890 | return NULL; | ||
| 876 | a->count = max_num; | 891 | a->count = max_num; |
| 877 | return a; | 892 | return a; |
| 878 | } | 893 | } |
diff --git a/include/linux/fdtable.h b/include/linux/fdtable.h index 013dc529e95f..f59ed297b661 100644 --- a/include/linux/fdtable.h +++ b/include/linux/fdtable.h | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | #include <linux/rcupdate.h> | 11 | #include <linux/rcupdate.h> |
| 12 | #include <linux/types.h> | 12 | #include <linux/types.h> |
| 13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
| 14 | #include <linux/fs.h> | ||
| 14 | 15 | ||
| 15 | #include <asm/atomic.h> | 16 | #include <asm/atomic.h> |
| 16 | 17 | ||
| @@ -61,7 +62,8 @@ struct files_struct { | |||
| 61 | (rcu_dereference_check((fdtfd), \ | 62 | (rcu_dereference_check((fdtfd), \ |
| 62 | rcu_read_lock_held() || \ | 63 | rcu_read_lock_held() || \ |
| 63 | lockdep_is_held(&(files)->file_lock) || \ | 64 | lockdep_is_held(&(files)->file_lock) || \ |
| 64 | atomic_read(&(files)->count) == 1)) | 65 | atomic_read(&(files)->count) == 1 || \ |
| 66 | rcu_my_thread_group_empty())) | ||
| 65 | 67 | ||
| 66 | #define files_fdtable(files) \ | 68 | #define files_fdtable(files) \ |
| 67 | (rcu_dereference_check_fdtable((files), (files)->fdt)) | 69 | (rcu_dereference_check_fdtable((files), (files)->fdt)) |
diff --git a/include/linux/filter.h b/include/linux/filter.h index 151f5d703b7e..69b43dbea6c6 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h | |||
| @@ -91,6 +91,54 @@ struct sock_fprog { /* Required for SO_ATTACH_FILTER. */ | |||
| 91 | #define BPF_TAX 0x00 | 91 | #define BPF_TAX 0x00 |
| 92 | #define BPF_TXA 0x80 | 92 | #define BPF_TXA 0x80 |
| 93 | 93 | ||
| 94 | enum { | ||
| 95 | BPF_S_RET_K = 0, | ||
| 96 | BPF_S_RET_A, | ||
| 97 | BPF_S_ALU_ADD_K, | ||
| 98 | BPF_S_ALU_ADD_X, | ||
| 99 | BPF_S_ALU_SUB_K, | ||
| 100 | BPF_S_ALU_SUB_X, | ||
| 101 | BPF_S_ALU_MUL_K, | ||
| 102 | BPF_S_ALU_MUL_X, | ||
| 103 | BPF_S_ALU_DIV_X, | ||
| 104 | BPF_S_ALU_AND_K, | ||
| 105 | BPF_S_ALU_AND_X, | ||
| 106 | BPF_S_ALU_OR_K, | ||
| 107 | BPF_S_ALU_OR_X, | ||
| 108 | BPF_S_ALU_LSH_K, | ||
| 109 | BPF_S_ALU_LSH_X, | ||
| 110 | BPF_S_ALU_RSH_K, | ||
| 111 | BPF_S_ALU_RSH_X, | ||
| 112 | BPF_S_ALU_NEG, | ||
| 113 | BPF_S_LD_W_ABS, | ||
| 114 | BPF_S_LD_H_ABS, | ||
| 115 | BPF_S_LD_B_ABS, | ||
| 116 | BPF_S_LD_W_LEN, | ||
| 117 | BPF_S_LD_W_IND, | ||
| 118 | BPF_S_LD_H_IND, | ||
| 119 | BPF_S_LD_B_IND, | ||
| 120 | BPF_S_LD_IMM, | ||
| 121 | BPF_S_LDX_W_LEN, | ||
| 122 | BPF_S_LDX_B_MSH, | ||
| 123 | BPF_S_LDX_IMM, | ||
| 124 | BPF_S_MISC_TAX, | ||
| 125 | BPF_S_MISC_TXA, | ||
| 126 | BPF_S_ALU_DIV_K, | ||
| 127 | BPF_S_LD_MEM, | ||
| 128 | BPF_S_LDX_MEM, | ||
| 129 | BPF_S_ST, | ||
| 130 | BPF_S_STX, | ||
| 131 | BPF_S_JMP_JA, | ||
| 132 | BPF_S_JMP_JEQ_K, | ||
| 133 | BPF_S_JMP_JEQ_X, | ||
| 134 | BPF_S_JMP_JGE_K, | ||
| 135 | BPF_S_JMP_JGE_X, | ||
| 136 | BPF_S_JMP_JGT_K, | ||
| 137 | BPF_S_JMP_JGT_X, | ||
| 138 | BPF_S_JMP_JSET_K, | ||
| 139 | BPF_S_JMP_JSET_X, | ||
| 140 | }; | ||
| 141 | |||
| 94 | #ifndef BPF_MAXINSNS | 142 | #ifndef BPF_MAXINSNS |
| 95 | #define BPF_MAXINSNS 4096 | 143 | #define BPF_MAXINSNS 4096 |
| 96 | #endif | 144 | #endif |
diff --git a/include/linux/firewire-cdev.h b/include/linux/firewire-cdev.h index 68f883b30a53..68c642d8843d 100644 --- a/include/linux/firewire-cdev.h +++ b/include/linux/firewire-cdev.h | |||
| @@ -30,12 +30,18 @@ | |||
| 30 | #include <linux/types.h> | 30 | #include <linux/types.h> |
| 31 | #include <linux/firewire-constants.h> | 31 | #include <linux/firewire-constants.h> |
| 32 | 32 | ||
| 33 | #define FW_CDEV_EVENT_BUS_RESET 0x00 | 33 | #define FW_CDEV_EVENT_BUS_RESET 0x00 |
| 34 | #define FW_CDEV_EVENT_RESPONSE 0x01 | 34 | #define FW_CDEV_EVENT_RESPONSE 0x01 |
| 35 | #define FW_CDEV_EVENT_REQUEST 0x02 | 35 | #define FW_CDEV_EVENT_REQUEST 0x02 |
| 36 | #define FW_CDEV_EVENT_ISO_INTERRUPT 0x03 | 36 | #define FW_CDEV_EVENT_ISO_INTERRUPT 0x03 |
| 37 | #define FW_CDEV_EVENT_ISO_RESOURCE_ALLOCATED 0x04 | 37 | #define FW_CDEV_EVENT_ISO_RESOURCE_ALLOCATED 0x04 |
| 38 | #define FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED 0x05 | 38 | #define FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED 0x05 |
| 39 | |||
| 40 | /* available since kernel version 2.6.36 */ | ||
| 41 | #define FW_CDEV_EVENT_REQUEST2 0x06 | ||
| 42 | #define FW_CDEV_EVENT_PHY_PACKET_SENT 0x07 | ||
| 43 | #define FW_CDEV_EVENT_PHY_PACKET_RECEIVED 0x08 | ||
| 44 | #define FW_CDEV_EVENT_ISO_INTERRUPT_MULTICHANNEL 0x09 | ||
| 39 | 45 | ||
| 40 | /** | 46 | /** |
| 41 | * struct fw_cdev_event_common - Common part of all fw_cdev_event_ types | 47 | * struct fw_cdev_event_common - Common part of all fw_cdev_event_ types |
| @@ -68,6 +74,10 @@ struct fw_cdev_event_common { | |||
| 68 | * This event is sent when the bus the device belongs to goes through a bus | 74 | * This event is sent when the bus the device belongs to goes through a bus |
| 69 | * reset. It provides information about the new bus configuration, such as | 75 | * reset. It provides information about the new bus configuration, such as |
| 70 | * new node ID for this device, new root ID, and others. | 76 | * new node ID for this device, new root ID, and others. |
| 77 | * | ||
| 78 | * If @bm_node_id is 0xffff right after bus reset it can be reread by an | ||
| 79 | * %FW_CDEV_IOC_GET_INFO ioctl after bus manager selection was finished. | ||
| 80 | * Kernels with ABI version < 4 do not set @bm_node_id. | ||
| 71 | */ | 81 | */ |
| 72 | struct fw_cdev_event_bus_reset { | 82 | struct fw_cdev_event_bus_reset { |
| 73 | __u64 closure; | 83 | __u64 closure; |
| @@ -82,8 +92,9 @@ struct fw_cdev_event_bus_reset { | |||
| 82 | 92 | ||
| 83 | /** | 93 | /** |
| 84 | * struct fw_cdev_event_response - Sent when a response packet was received | 94 | * struct fw_cdev_event_response - Sent when a response packet was received |
| 85 | * @closure: See &fw_cdev_event_common; | 95 | * @closure: See &fw_cdev_event_common; set by %FW_CDEV_IOC_SEND_REQUEST |
| 86 | * set by %FW_CDEV_IOC_SEND_REQUEST ioctl | 96 | * or %FW_CDEV_IOC_SEND_BROADCAST_REQUEST |
| 97 | * or %FW_CDEV_IOC_SEND_STREAM_PACKET ioctl | ||
| 87 | * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_RESPONSE | 98 | * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_RESPONSE |
| 88 | * @rcode: Response code returned by the remote node | 99 | * @rcode: Response code returned by the remote node |
| 89 | * @length: Data length, i.e. the response's payload size in bytes | 100 | * @length: Data length, i.e. the response's payload size in bytes |
| @@ -93,6 +104,11 @@ struct fw_cdev_event_bus_reset { | |||
| 93 | * sent by %FW_CDEV_IOC_SEND_REQUEST ioctl. The payload data for responses | 104 | * sent by %FW_CDEV_IOC_SEND_REQUEST ioctl. The payload data for responses |
| 94 | * carrying data (read and lock responses) follows immediately and can be | 105 | * carrying data (read and lock responses) follows immediately and can be |
| 95 | * accessed through the @data field. | 106 | * accessed through the @data field. |
| 107 | * | ||
| 108 | * The event is also generated after conclusions of transactions that do not | ||
| 109 | * involve response packets. This includes unified write transactions, | ||
| 110 | * broadcast write transactions, and transmission of asynchronous stream | ||
| 111 | * packets. @rcode indicates success or failure of such transmissions. | ||
| 96 | */ | 112 | */ |
| 97 | struct fw_cdev_event_response { | 113 | struct fw_cdev_event_response { |
| 98 | __u64 closure; | 114 | __u64 closure; |
| @@ -103,11 +119,46 @@ struct fw_cdev_event_response { | |||
| 103 | }; | 119 | }; |
| 104 | 120 | ||
| 105 | /** | 121 | /** |
| 106 | * struct fw_cdev_event_request - Sent on incoming request to an address region | 122 | * struct fw_cdev_event_request - Old version of &fw_cdev_event_request2 |
| 107 | * @closure: See &fw_cdev_event_common; set by %FW_CDEV_IOC_ALLOCATE ioctl | 123 | * @closure: See &fw_cdev_event_common; set by %FW_CDEV_IOC_ALLOCATE ioctl |
| 108 | * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_REQUEST | 124 | * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_REQUEST |
| 125 | * @tcode: See &fw_cdev_event_request2 | ||
| 126 | * @offset: See &fw_cdev_event_request2 | ||
| 127 | * @handle: See &fw_cdev_event_request2 | ||
| 128 | * @length: See &fw_cdev_event_request2 | ||
| 129 | * @data: See &fw_cdev_event_request2 | ||
| 130 | * | ||
| 131 | * This event is sent instead of &fw_cdev_event_request2 if the kernel or | ||
| 132 | * the client implements ABI version <= 3. | ||
| 133 | * | ||
| 134 | * Unlike &fw_cdev_event_request2, the sender identity cannot be established, | ||
| 135 | * broadcast write requests cannot be distinguished from unicast writes, and | ||
| 136 | * @tcode of lock requests is %TCODE_LOCK_REQUEST. | ||
| 137 | * | ||
| 138 | * Requests to the FCP_REQUEST or FCP_RESPONSE register are responded to as | ||
| 139 | * with &fw_cdev_event_request2, except in kernel 2.6.32 and older which send | ||
| 140 | * the response packet of the client's %FW_CDEV_IOC_SEND_RESPONSE ioctl. | ||
| 141 | */ | ||
| 142 | struct fw_cdev_event_request { | ||
| 143 | __u64 closure; | ||
| 144 | __u32 type; | ||
| 145 | __u32 tcode; | ||
| 146 | __u64 offset; | ||
| 147 | __u32 handle; | ||
| 148 | __u32 length; | ||
| 149 | __u32 data[0]; | ||
| 150 | }; | ||
| 151 | |||
| 152 | /** | ||
| 153 | * struct fw_cdev_event_request2 - Sent on incoming request to an address region | ||
| 154 | * @closure: See &fw_cdev_event_common; set by %FW_CDEV_IOC_ALLOCATE ioctl | ||
| 155 | * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_REQUEST2 | ||
| 109 | * @tcode: Transaction code of the incoming request | 156 | * @tcode: Transaction code of the incoming request |
| 110 | * @offset: The offset into the 48-bit per-node address space | 157 | * @offset: The offset into the 48-bit per-node address space |
| 158 | * @source_node_id: Sender node ID | ||
| 159 | * @destination_node_id: Destination node ID | ||
| 160 | * @card: The index of the card from which the request came | ||
| 161 | * @generation: Bus generation in which the request is valid | ||
| 111 | * @handle: Reference to the kernel-side pending request | 162 | * @handle: Reference to the kernel-side pending request |
| 112 | * @length: Data length, i.e. the request's payload size in bytes | 163 | * @length: Data length, i.e. the request's payload size in bytes |
| 113 | * @data: Incoming data, if any | 164 | * @data: Incoming data, if any |
| @@ -120,12 +171,42 @@ struct fw_cdev_event_response { | |||
| 120 | * | 171 | * |
| 121 | * The payload data for requests carrying data (write and lock requests) | 172 | * The payload data for requests carrying data (write and lock requests) |
| 122 | * follows immediately and can be accessed through the @data field. | 173 | * follows immediately and can be accessed through the @data field. |
| 174 | * | ||
| 175 | * Unlike &fw_cdev_event_request, @tcode of lock requests is one of the | ||
| 176 | * firewire-core specific %TCODE_LOCK_MASK_SWAP...%TCODE_LOCK_VENDOR_DEPENDENT, | ||
| 177 | * i.e. encodes the extended transaction code. | ||
| 178 | * | ||
| 179 | * @card may differ from &fw_cdev_get_info.card because requests are received | ||
| 180 | * from all cards of the Linux host. @source_node_id, @destination_node_id, and | ||
| 181 | * @generation pertain to that card. Destination node ID and bus generation may | ||
| 182 | * therefore differ from the corresponding fields of the last | ||
| 183 | * &fw_cdev_event_bus_reset. | ||
| 184 | * | ||
| 185 | * @destination_node_id may also differ from the current node ID because of a | ||
| 186 | * non-local bus ID part or in case of a broadcast write request. Note, a | ||
| 187 | * client must call an %FW_CDEV_IOC_SEND_RESPONSE ioctl even in case of a | ||
| 188 | * broadcast write request; the kernel will then release the kernel-side pending | ||
| 189 | * request but will not actually send a response packet. | ||
| 190 | * | ||
| 191 | * In case of a write request to FCP_REQUEST or FCP_RESPONSE, the kernel already | ||
| 192 | * sent a write response immediately after the request was received; in this | ||
| 193 | * case the client must still call an %FW_CDEV_IOC_SEND_RESPONSE ioctl to | ||
| 194 | * release the kernel-side pending request, though another response won't be | ||
| 195 | * sent. | ||
| 196 | * | ||
| 197 | * If the client subsequently needs to initiate requests to the sender node of | ||
| 198 | * an &fw_cdev_event_request2, it needs to use a device file with matching | ||
| 199 | * card index, node ID, and generation for outbound requests. | ||
| 123 | */ | 200 | */ |
| 124 | struct fw_cdev_event_request { | 201 | struct fw_cdev_event_request2 { |
| 125 | __u64 closure; | 202 | __u64 closure; |
| 126 | __u32 type; | 203 | __u32 type; |
| 127 | __u32 tcode; | 204 | __u32 tcode; |
| 128 | __u64 offset; | 205 | __u64 offset; |
| 206 | __u32 source_node_id; | ||
| 207 | __u32 destination_node_id; | ||
| 208 | __u32 card; | ||
| 209 | __u32 generation; | ||
| 129 | __u32 handle; | 210 | __u32 handle; |
| 130 | __u32 length; | 211 | __u32 length; |
| 131 | __u32 data[0]; | 212 | __u32 data[0]; |
| @@ -141,26 +222,43 @@ struct fw_cdev_event_request { | |||
| 141 | * @header: Stripped headers, if any | 222 | * @header: Stripped headers, if any |
| 142 | * | 223 | * |
| 143 | * This event is sent when the controller has completed an &fw_cdev_iso_packet | 224 | * This event is sent when the controller has completed an &fw_cdev_iso_packet |
| 144 | * with the %FW_CDEV_ISO_INTERRUPT bit set. In the receive case, the headers | 225 | * with the %FW_CDEV_ISO_INTERRUPT bit set. |
| 145 | * stripped of all packets up until and including the interrupt packet are | ||
| 146 | * returned in the @header field. The amount of header data per packet is as | ||
| 147 | * specified at iso context creation by &fw_cdev_create_iso_context.header_size. | ||
| 148 | * | 226 | * |
| 149 | * In version 1 of this ABI, header data consisted of the 1394 isochronous | 227 | * Isochronous transmit events (context type %FW_CDEV_ISO_CONTEXT_TRANSMIT): |
| 150 | * packet header, followed by quadlets from the packet payload if | ||
| 151 | * &fw_cdev_create_iso_context.header_size > 4. | ||
| 152 | * | 228 | * |
| 153 | * In version 2 of this ABI, header data consist of the 1394 isochronous | 229 | * In version 3 and some implementations of version 2 of the ABI, &header_length |
| 154 | * packet header, followed by a timestamp quadlet if | 230 | * is a multiple of 4 and &header contains timestamps of all packets up until |
| 155 | * &fw_cdev_create_iso_context.header_size > 4, followed by quadlets from the | 231 | * the interrupt packet. The format of the timestamps is as described below for |
| 156 | * packet payload if &fw_cdev_create_iso_context.header_size > 8. | 232 | * isochronous reception. In version 1 of the ABI, &header_length was 0. |
| 157 | * | 233 | * |
| 158 | * Behaviour of ver. 1 of this ABI is no longer available since ABI ver. 2. | 234 | * Isochronous receive events (context type %FW_CDEV_ISO_CONTEXT_RECEIVE): |
| 235 | * | ||
| 236 | * The headers stripped of all packets up until and including the interrupt | ||
| 237 | * packet are returned in the @header field. The amount of header data per | ||
| 238 | * packet is as specified at iso context creation by | ||
| 239 | * &fw_cdev_create_iso_context.header_size. | ||
| 240 | * | ||
| 241 | * Hence, _interrupt.header_length / _context.header_size is the number of | ||
| 242 | * packets received in this interrupt event. The client can now iterate | ||
| 243 | * through the mmap()'ed DMA buffer according to this number of packets and | ||
| 244 | * to the buffer sizes as the client specified in &fw_cdev_queue_iso. | ||
| 245 | * | ||
| 246 | * Since version 2 of this ABI, the portion for each packet in _interrupt.header | ||
| 247 | * consists of the 1394 isochronous packet header, followed by a timestamp | ||
| 248 | * quadlet if &fw_cdev_create_iso_context.header_size > 4, followed by quadlets | ||
| 249 | * from the packet payload if &fw_cdev_create_iso_context.header_size > 8. | ||
| 159 | * | 250 | * |
| 160 | * Format of 1394 iso packet header: 16 bits len, 2 bits tag, 6 bits channel, | 251 | * Format of 1394 iso packet header: 16 bits data_length, 2 bits tag, 6 bits |
| 161 | * 4 bits tcode, 4 bits sy, in big endian byte order. Format of timestamp: | 252 | * channel, 4 bits tcode, 4 bits sy, in big endian byte order. |
| 162 | * 16 bits invalid, 3 bits cycleSeconds, 13 bits cycleCount, in big endian byte | 253 | * data_length is the actual received size of the packet without the four |
| 163 | * order. | 254 | * 1394 iso packet header bytes. |
| 255 | * | ||
| 256 | * Format of timestamp: 16 bits invalid, 3 bits cycleSeconds, 13 bits | ||
| 257 | * cycleCount, in big endian byte order. | ||
| 258 | * | ||
| 259 | * In version 1 of the ABI, no timestamp quadlet was inserted; instead, payload | ||
| 260 | * data followed directly after the 1394 is header if header_size > 4. | ||
| 261 | * Behaviour of ver. 1 of this ABI is no longer available since ABI ver. 2. | ||
| 164 | */ | 262 | */ |
| 165 | struct fw_cdev_event_iso_interrupt { | 263 | struct fw_cdev_event_iso_interrupt { |
| 166 | __u64 closure; | 264 | __u64 closure; |
| @@ -171,6 +269,43 @@ struct fw_cdev_event_iso_interrupt { | |||
| 171 | }; | 269 | }; |
| 172 | 270 | ||
| 173 | /** | 271 | /** |
| 272 | * struct fw_cdev_event_iso_interrupt_mc - An iso buffer chunk was completed | ||
| 273 | * @closure: See &fw_cdev_event_common; | ||
| 274 | * set by %FW_CDEV_CREATE_ISO_CONTEXT ioctl | ||
| 275 | * @type: %FW_CDEV_EVENT_ISO_INTERRUPT_MULTICHANNEL | ||
| 276 | * @completed: Offset into the receive buffer; data before this offest is valid | ||
| 277 | * | ||
| 278 | * This event is sent in multichannel contexts (context type | ||
| 279 | * %FW_CDEV_ISO_CONTEXT_RECEIVE_MULTICHANNEL) for &fw_cdev_iso_packet buffer | ||
| 280 | * chunks that have the %FW_CDEV_ISO_INTERRUPT bit set. Whether this happens | ||
| 281 | * when a packet is completed and/or when a buffer chunk is completed depends | ||
| 282 | * on the hardware implementation. | ||
| 283 | * | ||
| 284 | * The buffer is continuously filled with the following data, per packet: | ||
| 285 | * - the 1394 iso packet header as described at &fw_cdev_event_iso_interrupt, | ||
| 286 | * but in little endian byte order, | ||
| 287 | * - packet payload (as many bytes as specified in the data_length field of | ||
| 288 | * the 1394 iso packet header) in big endian byte order, | ||
| 289 | * - 0...3 padding bytes as needed to align the following trailer quadlet, | ||
| 290 | * - trailer quadlet, containing the reception timestamp as described at | ||
| 291 | * &fw_cdev_event_iso_interrupt, but in little endian byte order. | ||
| 292 | * | ||
| 293 | * Hence the per-packet size is data_length (rounded up to a multiple of 4) + 8. | ||
| 294 | * When processing the data, stop before a packet that would cross the | ||
| 295 | * @completed offset. | ||
| 296 | * | ||
| 297 | * A packet near the end of a buffer chunk will typically spill over into the | ||
| 298 | * next queued buffer chunk. It is the responsibility of the client to check | ||
| 299 | * for this condition, assemble a broken-up packet from its parts, and not to | ||
| 300 | * re-queue any buffer chunks in which as yet unread packet parts reside. | ||
| 301 | */ | ||
| 302 | struct fw_cdev_event_iso_interrupt_mc { | ||
| 303 | __u64 closure; | ||
| 304 | __u32 type; | ||
| 305 | __u32 completed; | ||
| 306 | }; | ||
| 307 | |||
| 308 | /** | ||
| 174 | * struct fw_cdev_event_iso_resource - Iso resources were allocated or freed | 309 | * struct fw_cdev_event_iso_resource - Iso resources were allocated or freed |
| 175 | * @closure: See &fw_cdev_event_common; | 310 | * @closure: See &fw_cdev_event_common; |
| 176 | * set by %FW_CDEV_IOC_(DE)ALLOCATE_ISO_RESOURCE(_ONCE) ioctl | 311 | * set by %FW_CDEV_IOC_(DE)ALLOCATE_ISO_RESOURCE(_ONCE) ioctl |
| @@ -200,15 +335,45 @@ struct fw_cdev_event_iso_resource { | |||
| 200 | }; | 335 | }; |
| 201 | 336 | ||
| 202 | /** | 337 | /** |
| 338 | * struct fw_cdev_event_phy_packet - A PHY packet was transmitted or received | ||
| 339 | * @closure: See &fw_cdev_event_common; set by %FW_CDEV_IOC_SEND_PHY_PACKET | ||
| 340 | * or %FW_CDEV_IOC_RECEIVE_PHY_PACKETS ioctl | ||
| 341 | * @type: %FW_CDEV_EVENT_PHY_PACKET_SENT or %..._RECEIVED | ||
| 342 | * @rcode: %RCODE_..., indicates success or failure of transmission | ||
| 343 | * @length: Data length in bytes | ||
| 344 | * @data: Incoming data | ||
| 345 | * | ||
| 346 | * If @type is %FW_CDEV_EVENT_PHY_PACKET_SENT, @length is 0 and @data empty, | ||
| 347 | * except in case of a ping packet: Then, @length is 4, and @data[0] is the | ||
| 348 | * ping time in 49.152MHz clocks if @rcode is %RCODE_COMPLETE. | ||
| 349 | * | ||
| 350 | * If @type is %FW_CDEV_EVENT_PHY_PACKET_RECEIVED, @length is 8 and @data | ||
| 351 | * consists of the two PHY packet quadlets, in host byte order. | ||
| 352 | */ | ||
| 353 | struct fw_cdev_event_phy_packet { | ||
| 354 | __u64 closure; | ||
| 355 | __u32 type; | ||
| 356 | __u32 rcode; | ||
| 357 | __u32 length; | ||
| 358 | __u32 data[0]; | ||
| 359 | }; | ||
| 360 | |||
| 361 | /** | ||
| 203 | * union fw_cdev_event - Convenience union of fw_cdev_event_ types | 362 | * union fw_cdev_event - Convenience union of fw_cdev_event_ types |
| 204 | * @common: Valid for all types | 363 | * @common: Valid for all types |
| 205 | * @bus_reset: Valid if @common.type == %FW_CDEV_EVENT_BUS_RESET | 364 | * @bus_reset: Valid if @common.type == %FW_CDEV_EVENT_BUS_RESET |
| 206 | * @response: Valid if @common.type == %FW_CDEV_EVENT_RESPONSE | 365 | * @response: Valid if @common.type == %FW_CDEV_EVENT_RESPONSE |
| 207 | * @request: Valid if @common.type == %FW_CDEV_EVENT_REQUEST | 366 | * @request: Valid if @common.type == %FW_CDEV_EVENT_REQUEST |
| 208 | * @iso_interrupt: Valid if @common.type == %FW_CDEV_EVENT_ISO_INTERRUPT | 367 | * @request2: Valid if @common.type == %FW_CDEV_EVENT_REQUEST2 |
| 209 | * @iso_resource: Valid if @common.type == | 368 | * @iso_interrupt: Valid if @common.type == %FW_CDEV_EVENT_ISO_INTERRUPT |
| 369 | * @iso_interrupt_mc: Valid if @common.type == | ||
| 370 | * %FW_CDEV_EVENT_ISO_INTERRUPT_MULTICHANNEL | ||
| 371 | * @iso_resource: Valid if @common.type == | ||
| 210 | * %FW_CDEV_EVENT_ISO_RESOURCE_ALLOCATED or | 372 | * %FW_CDEV_EVENT_ISO_RESOURCE_ALLOCATED or |
| 211 | * %FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED | 373 | * %FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED |
| 374 | * @phy_packet: Valid if @common.type == | ||
| 375 | * %FW_CDEV_EVENT_PHY_PACKET_SENT or | ||
| 376 | * %FW_CDEV_EVENT_PHY_PACKET_RECEIVED | ||
| 212 | * | 377 | * |
| 213 | * Convenience union for userspace use. Events could be read(2) into an | 378 | * Convenience union for userspace use. Events could be read(2) into an |
| 214 | * appropriately aligned char buffer and then cast to this union for further | 379 | * appropriately aligned char buffer and then cast to this union for further |
| @@ -223,8 +388,11 @@ union fw_cdev_event { | |||
| 223 | struct fw_cdev_event_bus_reset bus_reset; | 388 | struct fw_cdev_event_bus_reset bus_reset; |
| 224 | struct fw_cdev_event_response response; | 389 | struct fw_cdev_event_response response; |
| 225 | struct fw_cdev_event_request request; | 390 | struct fw_cdev_event_request request; |
| 391 | struct fw_cdev_event_request2 request2; /* added in 2.6.36 */ | ||
| 226 | struct fw_cdev_event_iso_interrupt iso_interrupt; | 392 | struct fw_cdev_event_iso_interrupt iso_interrupt; |
| 227 | struct fw_cdev_event_iso_resource iso_resource; | 393 | struct fw_cdev_event_iso_interrupt_mc iso_interrupt_mc; /* added in 2.6.36 */ |
| 394 | struct fw_cdev_event_iso_resource iso_resource; /* added in 2.6.30 */ | ||
| 395 | struct fw_cdev_event_phy_packet phy_packet; /* added in 2.6.36 */ | ||
| 228 | }; | 396 | }; |
| 229 | 397 | ||
| 230 | /* available since kernel version 2.6.22 */ | 398 | /* available since kernel version 2.6.22 */ |
| @@ -256,23 +424,46 @@ union fw_cdev_event { | |||
| 256 | /* available since kernel version 2.6.34 */ | 424 | /* available since kernel version 2.6.34 */ |
| 257 | #define FW_CDEV_IOC_GET_CYCLE_TIMER2 _IOWR('#', 0x14, struct fw_cdev_get_cycle_timer2) | 425 | #define FW_CDEV_IOC_GET_CYCLE_TIMER2 _IOWR('#', 0x14, struct fw_cdev_get_cycle_timer2) |
| 258 | 426 | ||
| 427 | /* available since kernel version 2.6.36 */ | ||
| 428 | #define FW_CDEV_IOC_SEND_PHY_PACKET _IOWR('#', 0x15, struct fw_cdev_send_phy_packet) | ||
| 429 | #define FW_CDEV_IOC_RECEIVE_PHY_PACKETS _IOW('#', 0x16, struct fw_cdev_receive_phy_packets) | ||
| 430 | #define FW_CDEV_IOC_SET_ISO_CHANNELS _IOW('#', 0x17, struct fw_cdev_set_iso_channels) | ||
| 431 | |||
| 259 | /* | 432 | /* |
| 260 | * FW_CDEV_VERSION History | 433 | * ABI version history |
| 261 | * 1 (2.6.22) - initial version | 434 | * 1 (2.6.22) - initial version |
| 435 | * (2.6.24) - added %FW_CDEV_IOC_GET_CYCLE_TIMER | ||
| 262 | * 2 (2.6.30) - changed &fw_cdev_event_iso_interrupt.header if | 436 | * 2 (2.6.30) - changed &fw_cdev_event_iso_interrupt.header if |
| 263 | * &fw_cdev_create_iso_context.header_size is 8 or more | 437 | * &fw_cdev_create_iso_context.header_size is 8 or more |
| 438 | * - added %FW_CDEV_IOC_*_ISO_RESOURCE*, | ||
| 439 | * %FW_CDEV_IOC_GET_SPEED, %FW_CDEV_IOC_SEND_BROADCAST_REQUEST, | ||
| 440 | * %FW_CDEV_IOC_SEND_STREAM_PACKET | ||
| 264 | * (2.6.32) - added time stamp to xmit &fw_cdev_event_iso_interrupt | 441 | * (2.6.32) - added time stamp to xmit &fw_cdev_event_iso_interrupt |
| 265 | * (2.6.33) - IR has always packet-per-buffer semantics now, not one of | 442 | * (2.6.33) - IR has always packet-per-buffer semantics now, not one of |
| 266 | * dual-buffer or packet-per-buffer depending on hardware | 443 | * dual-buffer or packet-per-buffer depending on hardware |
| 444 | * - shared use and auto-response for FCP registers | ||
| 267 | * 3 (2.6.34) - made &fw_cdev_get_cycle_timer reliable | 445 | * 3 (2.6.34) - made &fw_cdev_get_cycle_timer reliable |
| 446 | * - added %FW_CDEV_IOC_GET_CYCLE_TIMER2 | ||
| 447 | * 4 (2.6.36) - added %FW_CDEV_EVENT_REQUEST2, %FW_CDEV_EVENT_PHY_PACKET_*, | ||
| 448 | * and &fw_cdev_allocate.region_end | ||
| 449 | * - implemented &fw_cdev_event_bus_reset.bm_node_id | ||
| 450 | * - added %FW_CDEV_IOC_SEND_PHY_PACKET, _RECEIVE_PHY_PACKETS | ||
| 451 | * - added %FW_CDEV_EVENT_ISO_INTERRUPT_MULTICHANNEL, | ||
| 452 | * %FW_CDEV_ISO_CONTEXT_RECEIVE_MULTICHANNEL, and | ||
| 453 | * %FW_CDEV_IOC_SET_ISO_CHANNELS | ||
| 268 | */ | 454 | */ |
| 269 | #define FW_CDEV_VERSION 3 | 455 | #define FW_CDEV_VERSION 3 /* Meaningless; don't use this macro. */ |
| 270 | 456 | ||
| 271 | /** | 457 | /** |
| 272 | * struct fw_cdev_get_info - General purpose information ioctl | 458 | * struct fw_cdev_get_info - General purpose information ioctl |
| 273 | * @version: The version field is just a running serial number. | 459 | * @version: The version field is just a running serial number. Both an |
| 274 | * We never break backwards compatibility, but may add more | 460 | * input parameter (ABI version implemented by the client) and |
| 275 | * structs and ioctls in later revisions. | 461 | * output parameter (ABI version implemented by the kernel). |
| 462 | * A client must not fill in an %FW_CDEV_VERSION defined from an | ||
| 463 | * included kernel header file but the actual version for which | ||
| 464 | * the client was implemented. This is necessary for forward | ||
| 465 | * compatibility. We never break backwards compatibility, but | ||
| 466 | * may add more structs, events, and ioctls in later revisions. | ||
| 276 | * @rom_length: If @rom is non-zero, at most rom_length bytes of configuration | 467 | * @rom_length: If @rom is non-zero, at most rom_length bytes of configuration |
| 277 | * ROM will be copied into that user space address. In either | 468 | * ROM will be copied into that user space address. In either |
| 278 | * case, @rom_length is updated with the actual length of the | 469 | * case, @rom_length is updated with the actual length of the |
| @@ -339,28 +530,48 @@ struct fw_cdev_send_response { | |||
| 339 | }; | 530 | }; |
| 340 | 531 | ||
| 341 | /** | 532 | /** |
| 342 | * struct fw_cdev_allocate - Allocate a CSR address range | 533 | * struct fw_cdev_allocate - Allocate a CSR in an address range |
| 343 | * @offset: Start offset of the address range | 534 | * @offset: Start offset of the address range |
| 344 | * @closure: To be passed back to userspace in request events | 535 | * @closure: To be passed back to userspace in request events |
| 345 | * @length: Length of the address range, in bytes | 536 | * @length: Length of the CSR, in bytes |
| 346 | * @handle: Handle to the allocation, written by the kernel | 537 | * @handle: Handle to the allocation, written by the kernel |
| 538 | * @region_end: First address above the address range (added in ABI v4, 2.6.36) | ||
| 347 | * | 539 | * |
| 348 | * Allocate an address range in the 48-bit address space on the local node | 540 | * Allocate an address range in the 48-bit address space on the local node |
| 349 | * (the controller). This allows userspace to listen for requests with an | 541 | * (the controller). This allows userspace to listen for requests with an |
| 350 | * offset within that address range. When the kernel receives a request | 542 | * offset within that address range. Every time when the kernel receives a |
| 351 | * within the range, an &fw_cdev_event_request event will be written back. | 543 | * request within the range, an &fw_cdev_event_request2 event will be emitted. |
| 352 | * The @closure field is passed back to userspace in the response event. | 544 | * (If the kernel or the client implements ABI version <= 3, an |
| 545 | * &fw_cdev_event_request will be generated instead.) | ||
| 546 | * | ||
| 547 | * The @closure field is passed back to userspace in these request events. | ||
| 353 | * The @handle field is an out parameter, returning a handle to the allocated | 548 | * The @handle field is an out parameter, returning a handle to the allocated |
| 354 | * range to be used for later deallocation of the range. | 549 | * range to be used for later deallocation of the range. |
| 355 | * | 550 | * |
| 356 | * The address range is allocated on all local nodes. The address allocation | 551 | * The address range is allocated on all local nodes. The address allocation |
| 357 | * is exclusive except for the FCP command and response registers. | 552 | * is exclusive except for the FCP command and response registers. If an |
| 553 | * exclusive address region is already in use, the ioctl fails with errno set | ||
| 554 | * to %EBUSY. | ||
| 555 | * | ||
| 556 | * If kernel and client implement ABI version >= 4, the kernel looks up a free | ||
| 557 | * spot of size @length inside [@offset..@region_end) and, if found, writes | ||
| 558 | * the start address of the new CSR back in @offset. I.e. @offset is an | ||
| 559 | * in and out parameter. If this automatic placement of a CSR in a bigger | ||
| 560 | * address range is not desired, the client simply needs to set @region_end | ||
| 561 | * = @offset + @length. | ||
| 562 | * | ||
| 563 | * If the kernel or the client implements ABI version <= 3, @region_end is | ||
| 564 | * ignored and effectively assumed to be @offset + @length. | ||
| 565 | * | ||
| 566 | * @region_end is only present in a kernel header >= 2.6.36. If necessary, | ||
| 567 | * this can for example be tested by #ifdef FW_CDEV_EVENT_REQUEST2. | ||
| 358 | */ | 568 | */ |
| 359 | struct fw_cdev_allocate { | 569 | struct fw_cdev_allocate { |
| 360 | __u64 offset; | 570 | __u64 offset; |
| 361 | __u64 closure; | 571 | __u64 closure; |
| 362 | __u32 length; | 572 | __u32 length; |
| 363 | __u32 handle; | 573 | __u32 handle; |
| 574 | __u64 region_end; /* available since kernel version 2.6.36 */ | ||
| 364 | }; | 575 | }; |
| 365 | 576 | ||
| 366 | /** | 577 | /** |
| @@ -382,9 +593,14 @@ struct fw_cdev_deallocate { | |||
| 382 | * Initiate a bus reset for the bus this device is on. The bus reset can be | 593 | * Initiate a bus reset for the bus this device is on. The bus reset can be |
| 383 | * either the original (long) bus reset or the arbitrated (short) bus reset | 594 | * either the original (long) bus reset or the arbitrated (short) bus reset |
| 384 | * introduced in 1394a-2000. | 595 | * introduced in 1394a-2000. |
| 596 | * | ||
| 597 | * The ioctl returns immediately. A subsequent &fw_cdev_event_bus_reset | ||
| 598 | * indicates when the reset actually happened. Since ABI v4, this may be | ||
| 599 | * considerably later than the ioctl because the kernel ensures a grace period | ||
| 600 | * between subsequent bus resets as per IEEE 1394 bus management specification. | ||
| 385 | */ | 601 | */ |
| 386 | struct fw_cdev_initiate_bus_reset { | 602 | struct fw_cdev_initiate_bus_reset { |
| 387 | __u32 type; /* FW_CDEV_SHORT_RESET or FW_CDEV_LONG_RESET */ | 603 | __u32 type; |
| 388 | }; | 604 | }; |
| 389 | 605 | ||
| 390 | /** | 606 | /** |
| @@ -408,9 +624,10 @@ struct fw_cdev_initiate_bus_reset { | |||
| 408 | * | 624 | * |
| 409 | * @immediate, @key, and @data array elements are CPU-endian quadlets. | 625 | * @immediate, @key, and @data array elements are CPU-endian quadlets. |
| 410 | * | 626 | * |
| 411 | * If successful, the kernel adds the descriptor and writes back a handle to the | 627 | * If successful, the kernel adds the descriptor and writes back a @handle to |
| 412 | * kernel-side object to be used for later removal of the descriptor block and | 628 | * the kernel-side object to be used for later removal of the descriptor block |
| 413 | * immediate key. | 629 | * and immediate key. The kernel will also generate a bus reset to signal the |
| 630 | * change of the configuration ROM to other nodes. | ||
| 414 | * | 631 | * |
| 415 | * This ioctl affects the configuration ROMs of all local nodes. | 632 | * This ioctl affects the configuration ROMs of all local nodes. |
| 416 | * The ioctl only succeeds on device files which represent a local node. | 633 | * The ioctl only succeeds on device files which represent a local node. |
| @@ -429,38 +646,50 @@ struct fw_cdev_add_descriptor { | |||
| 429 | * descriptor was added | 646 | * descriptor was added |
| 430 | * | 647 | * |
| 431 | * Remove a descriptor block and accompanying immediate key from the local | 648 | * Remove a descriptor block and accompanying immediate key from the local |
| 432 | * nodes' configuration ROMs. | 649 | * nodes' configuration ROMs. The kernel will also generate a bus reset to |
| 650 | * signal the change of the configuration ROM to other nodes. | ||
| 433 | */ | 651 | */ |
| 434 | struct fw_cdev_remove_descriptor { | 652 | struct fw_cdev_remove_descriptor { |
| 435 | __u32 handle; | 653 | __u32 handle; |
| 436 | }; | 654 | }; |
| 437 | 655 | ||
| 438 | #define FW_CDEV_ISO_CONTEXT_TRANSMIT 0 | 656 | #define FW_CDEV_ISO_CONTEXT_TRANSMIT 0 |
| 439 | #define FW_CDEV_ISO_CONTEXT_RECEIVE 1 | 657 | #define FW_CDEV_ISO_CONTEXT_RECEIVE 1 |
| 658 | #define FW_CDEV_ISO_CONTEXT_RECEIVE_MULTICHANNEL 2 /* added in 2.6.36 */ | ||
| 440 | 659 | ||
| 441 | /** | 660 | /** |
| 442 | * struct fw_cdev_create_iso_context - Create a context for isochronous IO | 661 | * struct fw_cdev_create_iso_context - Create a context for isochronous I/O |
| 443 | * @type: %FW_CDEV_ISO_CONTEXT_TRANSMIT or %FW_CDEV_ISO_CONTEXT_RECEIVE | 662 | * @type: %FW_CDEV_ISO_CONTEXT_TRANSMIT or %FW_CDEV_ISO_CONTEXT_RECEIVE or |
| 444 | * @header_size: Header size to strip for receive contexts | 663 | * %FW_CDEV_ISO_CONTEXT_RECEIVE_MULTICHANNEL |
| 445 | * @channel: Channel to bind to | 664 | * @header_size: Header size to strip in single-channel reception |
| 446 | * @speed: Speed for transmit contexts | 665 | * @channel: Channel to bind to in single-channel reception or transmission |
| 447 | * @closure: To be returned in &fw_cdev_event_iso_interrupt | 666 | * @speed: Transmission speed |
| 667 | * @closure: To be returned in &fw_cdev_event_iso_interrupt or | ||
| 668 | * &fw_cdev_event_iso_interrupt_multichannel | ||
| 448 | * @handle: Handle to context, written back by kernel | 669 | * @handle: Handle to context, written back by kernel |
| 449 | * | 670 | * |
| 450 | * Prior to sending or receiving isochronous I/O, a context must be created. | 671 | * Prior to sending or receiving isochronous I/O, a context must be created. |
| 451 | * The context records information about the transmit or receive configuration | 672 | * The context records information about the transmit or receive configuration |
| 452 | * and typically maps to an underlying hardware resource. A context is set up | 673 | * and typically maps to an underlying hardware resource. A context is set up |
| 453 | * for either sending or receiving. It is bound to a specific isochronous | 674 | * for either sending or receiving. It is bound to a specific isochronous |
| 454 | * channel. | 675 | * @channel. |
| 676 | * | ||
| 677 | * In case of multichannel reception, @header_size and @channel are ignored | ||
| 678 | * and the channels are selected by %FW_CDEV_IOC_SET_ISO_CHANNELS. | ||
| 679 | * | ||
| 680 | * For %FW_CDEV_ISO_CONTEXT_RECEIVE contexts, @header_size must be at least 4 | ||
| 681 | * and must be a multiple of 4. It is ignored in other context types. | ||
| 682 | * | ||
| 683 | * @speed is ignored in receive context types. | ||
| 455 | * | 684 | * |
| 456 | * If a context was successfully created, the kernel writes back a handle to the | 685 | * If a context was successfully created, the kernel writes back a handle to the |
| 457 | * context, which must be passed in for subsequent operations on that context. | 686 | * context, which must be passed in for subsequent operations on that context. |
| 458 | * | 687 | * |
| 459 | * For receive contexts, @header_size must be at least 4 and must be a multiple | 688 | * Limitations: |
| 460 | * of 4. | 689 | * No more than one iso context can be created per fd. |
| 461 | * | 690 | * The total number of contexts that all userspace and kernelspace drivers can |
| 462 | * Note that the effect of a @header_size > 4 depends on | 691 | * create on a card at a time is a hardware limit, typically 4 or 8 contexts per |
| 463 | * &fw_cdev_get_info.version, as documented at &fw_cdev_event_iso_interrupt. | 692 | * direction, and of them at most one multichannel receive context. |
| 464 | */ | 693 | */ |
| 465 | struct fw_cdev_create_iso_context { | 694 | struct fw_cdev_create_iso_context { |
| 466 | __u32 type; | 695 | __u32 type; |
| @@ -471,6 +700,22 @@ struct fw_cdev_create_iso_context { | |||
| 471 | __u32 handle; | 700 | __u32 handle; |
| 472 | }; | 701 | }; |
| 473 | 702 | ||
| 703 | /** | ||
| 704 | * struct fw_cdev_set_iso_channels - Select channels in multichannel reception | ||
| 705 | * @channels: Bitmask of channels to listen to | ||
| 706 | * @handle: Handle of the mutichannel receive context | ||
| 707 | * | ||
| 708 | * @channels is the bitwise or of 1ULL << n for each channel n to listen to. | ||
| 709 | * | ||
| 710 | * The ioctl fails with errno %EBUSY if there is already another receive context | ||
| 711 | * on a channel in @channels. In that case, the bitmask of all unoccupied | ||
| 712 | * channels is returned in @channels. | ||
| 713 | */ | ||
| 714 | struct fw_cdev_set_iso_channels { | ||
| 715 | __u64 channels; | ||
| 716 | __u32 handle; | ||
| 717 | }; | ||
| 718 | |||
| 474 | #define FW_CDEV_ISO_PAYLOAD_LENGTH(v) (v) | 719 | #define FW_CDEV_ISO_PAYLOAD_LENGTH(v) (v) |
| 475 | #define FW_CDEV_ISO_INTERRUPT (1 << 16) | 720 | #define FW_CDEV_ISO_INTERRUPT (1 << 16) |
| 476 | #define FW_CDEV_ISO_SKIP (1 << 17) | 721 | #define FW_CDEV_ISO_SKIP (1 << 17) |
| @@ -481,42 +726,72 @@ struct fw_cdev_create_iso_context { | |||
| 481 | 726 | ||
| 482 | /** | 727 | /** |
| 483 | * struct fw_cdev_iso_packet - Isochronous packet | 728 | * struct fw_cdev_iso_packet - Isochronous packet |
| 484 | * @control: Contains the header length (8 uppermost bits), the sy field | 729 | * @control: Contains the header length (8 uppermost bits), |
| 485 | * (4 bits), the tag field (2 bits), a sync flag (1 bit), | 730 | * the sy field (4 bits), the tag field (2 bits), a sync flag |
| 486 | * a skip flag (1 bit), an interrupt flag (1 bit), and the | 731 | * or a skip flag (1 bit), an interrupt flag (1 bit), and the |
| 487 | * payload length (16 lowermost bits) | 732 | * payload length (16 lowermost bits) |
| 488 | * @header: Header and payload | 733 | * @header: Header and payload in case of a transmit context. |
| 489 | * | 734 | * |
| 490 | * &struct fw_cdev_iso_packet is used to describe isochronous packet queues. | 735 | * &struct fw_cdev_iso_packet is used to describe isochronous packet queues. |
| 491 | * | ||
| 492 | * Use the FW_CDEV_ISO_ macros to fill in @control. | 736 | * Use the FW_CDEV_ISO_ macros to fill in @control. |
| 737 | * The @header array is empty in case of receive contexts. | ||
| 738 | * | ||
| 739 | * Context type %FW_CDEV_ISO_CONTEXT_TRANSMIT: | ||
| 740 | * | ||
| 741 | * @control.HEADER_LENGTH must be a multiple of 4. It specifies the numbers of | ||
| 742 | * bytes in @header that will be prepended to the packet's payload. These bytes | ||
| 743 | * are copied into the kernel and will not be accessed after the ioctl has | ||
| 744 | * returned. | ||
| 745 | * | ||
| 746 | * The @control.SY and TAG fields are copied to the iso packet header. These | ||
| 747 | * fields are specified by IEEE 1394a and IEC 61883-1. | ||
| 748 | * | ||
| 749 | * The @control.SKIP flag specifies that no packet is to be sent in a frame. | ||
| 750 | * When using this, all other fields except @control.INTERRUPT must be zero. | ||
| 751 | * | ||
| 752 | * When a packet with the @control.INTERRUPT flag set has been completed, an | ||
| 753 | * &fw_cdev_event_iso_interrupt event will be sent. | ||
| 754 | * | ||
| 755 | * Context type %FW_CDEV_ISO_CONTEXT_RECEIVE: | ||
| 756 | * | ||
| 757 | * @control.HEADER_LENGTH must be a multiple of the context's header_size. | ||
| 758 | * If the HEADER_LENGTH is larger than the context's header_size, multiple | ||
| 759 | * packets are queued for this entry. | ||
| 760 | * | ||
| 761 | * The @control.SY and TAG fields are ignored. | ||
| 762 | * | ||
| 763 | * If the @control.SYNC flag is set, the context drops all packets until a | ||
| 764 | * packet with a sy field is received which matches &fw_cdev_start_iso.sync. | ||
| 765 | * | ||
| 766 | * @control.PAYLOAD_LENGTH defines how many payload bytes can be received for | ||
| 767 | * one packet (in addition to payload quadlets that have been defined as headers | ||
| 768 | * and are stripped and returned in the &fw_cdev_event_iso_interrupt structure). | ||
| 769 | * If more bytes are received, the additional bytes are dropped. If less bytes | ||
| 770 | * are received, the remaining bytes in this part of the payload buffer will not | ||
| 771 | * be written to, not even by the next packet. I.e., packets received in | ||
| 772 | * consecutive frames will not necessarily be consecutive in memory. If an | ||
| 773 | * entry has queued multiple packets, the PAYLOAD_LENGTH is divided equally | ||
| 774 | * among them. | ||
| 493 | * | 775 | * |
| 494 | * For transmit packets, the header length must be a multiple of 4 and specifies | 776 | * When a packet with the @control.INTERRUPT flag set has been completed, an |
| 495 | * the numbers of bytes in @header that will be prepended to the packet's | ||
| 496 | * payload; these bytes are copied into the kernel and will not be accessed | ||
| 497 | * after the ioctl has returned. The sy and tag fields are copied to the iso | ||
| 498 | * packet header (these fields are specified by IEEE 1394a and IEC 61883-1). | ||
| 499 | * The skip flag specifies that no packet is to be sent in a frame; when using | ||
| 500 | * this, all other fields except the interrupt flag must be zero. | ||
| 501 | * | ||
| 502 | * For receive packets, the header length must be a multiple of the context's | ||
| 503 | * header size; if the header length is larger than the context's header size, | ||
| 504 | * multiple packets are queued for this entry. The sy and tag fields are | ||
| 505 | * ignored. If the sync flag is set, the context drops all packets until | ||
| 506 | * a packet with a matching sy field is received (the sync value to wait for is | ||
| 507 | * specified in the &fw_cdev_start_iso structure). The payload length defines | ||
| 508 | * how many payload bytes can be received for one packet (in addition to payload | ||
| 509 | * quadlets that have been defined as headers and are stripped and returned in | ||
| 510 | * the &fw_cdev_event_iso_interrupt structure). If more bytes are received, the | ||
| 511 | * additional bytes are dropped. If less bytes are received, the remaining | ||
| 512 | * bytes in this part of the payload buffer will not be written to, not even by | ||
| 513 | * the next packet, i.e., packets received in consecutive frames will not | ||
| 514 | * necessarily be consecutive in memory. If an entry has queued multiple | ||
| 515 | * packets, the payload length is divided equally among them. | ||
| 516 | * | ||
| 517 | * When a packet with the interrupt flag set has been completed, the | ||
| 518 | * &fw_cdev_event_iso_interrupt event will be sent. An entry that has queued | 777 | * &fw_cdev_event_iso_interrupt event will be sent. An entry that has queued |
| 519 | * multiple receive packets is completed when its last packet is completed. | 778 | * multiple receive packets is completed when its last packet is completed. |
| 779 | * | ||
| 780 | * Context type %FW_CDEV_ISO_CONTEXT_RECEIVE_MULTICHANNEL: | ||
| 781 | * | ||
| 782 | * Here, &fw_cdev_iso_packet would be more aptly named _iso_buffer_chunk since | ||
| 783 | * it specifies a chunk of the mmap()'ed buffer, while the number and alignment | ||
| 784 | * of packets to be placed into the buffer chunk is not known beforehand. | ||
| 785 | * | ||
| 786 | * @control.PAYLOAD_LENGTH is the size of the buffer chunk and specifies room | ||
| 787 | * for header, payload, padding, and trailer bytes of one or more packets. | ||
| 788 | * It must be a multiple of 4. | ||
| 789 | * | ||
| 790 | * @control.HEADER_LENGTH, TAG and SY are ignored. SYNC is treated as described | ||
| 791 | * for single-channel reception. | ||
| 792 | * | ||
| 793 | * When a buffer chunk with the @control.INTERRUPT flag set has been filled | ||
| 794 | * entirely, an &fw_cdev_event_iso_interrupt_mc event will be sent. | ||
| 520 | */ | 795 | */ |
| 521 | struct fw_cdev_iso_packet { | 796 | struct fw_cdev_iso_packet { |
| 522 | __u32 control; | 797 | __u32 control; |
| @@ -525,9 +800,9 @@ struct fw_cdev_iso_packet { | |||
| 525 | 800 | ||
| 526 | /** | 801 | /** |
| 527 | * struct fw_cdev_queue_iso - Queue isochronous packets for I/O | 802 | * struct fw_cdev_queue_iso - Queue isochronous packets for I/O |
| 528 | * @packets: Userspace pointer to packet data | 803 | * @packets: Userspace pointer to an array of &fw_cdev_iso_packet |
| 529 | * @data: Pointer into mmap()'ed payload buffer | 804 | * @data: Pointer into mmap()'ed payload buffer |
| 530 | * @size: Size of packet data in bytes | 805 | * @size: Size of the @packets array, in bytes |
| 531 | * @handle: Isochronous context handle | 806 | * @handle: Isochronous context handle |
| 532 | * | 807 | * |
| 533 | * Queue a number of isochronous packets for reception or transmission. | 808 | * Queue a number of isochronous packets for reception or transmission. |
| @@ -540,6 +815,9 @@ struct fw_cdev_iso_packet { | |||
| 540 | * The kernel may or may not queue all packets, but will write back updated | 815 | * The kernel may or may not queue all packets, but will write back updated |
| 541 | * values of the @packets, @data and @size fields, so the ioctl can be | 816 | * values of the @packets, @data and @size fields, so the ioctl can be |
| 542 | * resubmitted easily. | 817 | * resubmitted easily. |
| 818 | * | ||
| 819 | * In case of a multichannel receive context, @data must be quadlet-aligned | ||
| 820 | * relative to the buffer start. | ||
| 543 | */ | 821 | */ |
| 544 | struct fw_cdev_queue_iso { | 822 | struct fw_cdev_queue_iso { |
| 545 | __u64 packets; | 823 | __u64 packets; |
| @@ -698,4 +976,39 @@ struct fw_cdev_send_stream_packet { | |||
| 698 | __u32 speed; | 976 | __u32 speed; |
| 699 | }; | 977 | }; |
| 700 | 978 | ||
| 979 | /** | ||
| 980 | * struct fw_cdev_send_phy_packet - send a PHY packet | ||
| 981 | * @closure: Passed back to userspace in the PHY-packet-sent event | ||
| 982 | * @data: First and second quadlet of the PHY packet | ||
| 983 | * @generation: The bus generation where packet is valid | ||
| 984 | * | ||
| 985 | * The %FW_CDEV_IOC_SEND_PHY_PACKET ioctl sends a PHY packet to all nodes | ||
| 986 | * on the same card as this device. After transmission, an | ||
| 987 | * %FW_CDEV_EVENT_PHY_PACKET_SENT event is generated. | ||
| 988 | * | ||
| 989 | * The payload @data[] shall be specified in host byte order. Usually, | ||
| 990 | * @data[1] needs to be the bitwise inverse of @data[0]. VersaPHY packets | ||
| 991 | * are an exception to this rule. | ||
| 992 | * | ||
| 993 | * The ioctl is only permitted on device files which represent a local node. | ||
| 994 | */ | ||
| 995 | struct fw_cdev_send_phy_packet { | ||
| 996 | __u64 closure; | ||
| 997 | __u32 data[2]; | ||
| 998 | __u32 generation; | ||
| 999 | }; | ||
| 1000 | |||
| 1001 | /** | ||
| 1002 | * struct fw_cdev_receive_phy_packets - start reception of PHY packets | ||
| 1003 | * @closure: Passed back to userspace in phy packet events | ||
| 1004 | * | ||
| 1005 | * This ioctl activates issuing of %FW_CDEV_EVENT_PHY_PACKET_RECEIVED due to | ||
| 1006 | * incoming PHY packets from any node on the same bus as the device. | ||
| 1007 | * | ||
| 1008 | * The ioctl is only permitted on device files which represent a local node. | ||
| 1009 | */ | ||
| 1010 | struct fw_cdev_receive_phy_packets { | ||
| 1011 | __u64 closure; | ||
| 1012 | }; | ||
| 1013 | |||
| 701 | #endif /* _LINUX_FIREWIRE_CDEV_H */ | 1014 | #endif /* _LINUX_FIREWIRE_CDEV_H */ |
diff --git a/include/linux/firewire.h b/include/linux/firewire.h index 72e2b8ac2a5a..1cd637ef62d2 100644 --- a/include/linux/firewire.h +++ b/include/linux/firewire.h | |||
| @@ -32,11 +32,13 @@ | |||
| 32 | #define CSR_CYCLE_TIME 0x200 | 32 | #define CSR_CYCLE_TIME 0x200 |
| 33 | #define CSR_BUS_TIME 0x204 | 33 | #define CSR_BUS_TIME 0x204 |
| 34 | #define CSR_BUSY_TIMEOUT 0x210 | 34 | #define CSR_BUSY_TIMEOUT 0x210 |
| 35 | #define CSR_PRIORITY_BUDGET 0x218 | ||
| 35 | #define CSR_BUS_MANAGER_ID 0x21c | 36 | #define CSR_BUS_MANAGER_ID 0x21c |
| 36 | #define CSR_BANDWIDTH_AVAILABLE 0x220 | 37 | #define CSR_BANDWIDTH_AVAILABLE 0x220 |
| 37 | #define CSR_CHANNELS_AVAILABLE 0x224 | 38 | #define CSR_CHANNELS_AVAILABLE 0x224 |
| 38 | #define CSR_CHANNELS_AVAILABLE_HI 0x224 | 39 | #define CSR_CHANNELS_AVAILABLE_HI 0x224 |
| 39 | #define CSR_CHANNELS_AVAILABLE_LO 0x228 | 40 | #define CSR_CHANNELS_AVAILABLE_LO 0x228 |
| 41 | #define CSR_MAINT_UTILITY 0x230 | ||
| 40 | #define CSR_BROADCAST_CHANNEL 0x234 | 42 | #define CSR_BROADCAST_CHANNEL 0x234 |
| 41 | #define CSR_CONFIG_ROM 0x400 | 43 | #define CSR_CONFIG_ROM 0x400 |
| 42 | #define CSR_CONFIG_ROM_END 0x800 | 44 | #define CSR_CONFIG_ROM_END 0x800 |
| @@ -89,6 +91,11 @@ struct fw_card { | |||
| 89 | struct list_head transaction_list; | 91 | struct list_head transaction_list; |
| 90 | unsigned long reset_jiffies; | 92 | unsigned long reset_jiffies; |
| 91 | 93 | ||
| 94 | u32 split_timeout_hi; | ||
| 95 | u32 split_timeout_lo; | ||
| 96 | unsigned int split_timeout_cycles; | ||
| 97 | unsigned int split_timeout_jiffies; | ||
| 98 | |||
| 92 | unsigned long long guid; | 99 | unsigned long long guid; |
| 93 | unsigned max_receive; | 100 | unsigned max_receive; |
| 94 | int link_speed; | 101 | int link_speed; |
| @@ -104,18 +111,28 @@ struct fw_card { | |||
| 104 | bool beta_repeaters_present; | 111 | bool beta_repeaters_present; |
| 105 | 112 | ||
| 106 | int index; | 113 | int index; |
| 107 | |||
| 108 | struct list_head link; | 114 | struct list_head link; |
| 109 | 115 | ||
| 110 | /* Work struct for BM duties. */ | 116 | struct list_head phy_receiver_list; |
| 111 | struct delayed_work work; | 117 | |
| 118 | struct delayed_work br_work; /* bus reset job */ | ||
| 119 | bool br_short; | ||
| 120 | |||
| 121 | struct delayed_work bm_work; /* bus manager job */ | ||
| 112 | int bm_retries; | 122 | int bm_retries; |
| 113 | int bm_generation; | 123 | int bm_generation; |
| 114 | __be32 bm_transaction_data[2]; | 124 | __be32 bm_transaction_data[2]; |
| 125 | int bm_node_id; | ||
| 126 | bool bm_abdicate; | ||
| 127 | |||
| 128 | bool priority_budget_implemented; /* controller feature */ | ||
| 129 | bool broadcast_channel_auto_allocated; /* controller feature */ | ||
| 115 | 130 | ||
| 116 | bool broadcast_channel_allocated; | 131 | bool broadcast_channel_allocated; |
| 117 | u32 broadcast_channel; | 132 | u32 broadcast_channel; |
| 118 | __be32 topology_map[(CSR_TOPOLOGY_MAP_END - CSR_TOPOLOGY_MAP) / 4]; | 133 | __be32 topology_map[(CSR_TOPOLOGY_MAP_END - CSR_TOPOLOGY_MAP) / 4]; |
| 134 | |||
| 135 | __be32 maint_utility_register; | ||
| 119 | }; | 136 | }; |
| 120 | 137 | ||
| 121 | struct fw_attribute_group { | 138 | struct fw_attribute_group { |
| @@ -252,7 +269,7 @@ typedef void (*fw_transaction_callback_t)(struct fw_card *card, int rcode, | |||
| 252 | typedef void (*fw_address_callback_t)(struct fw_card *card, | 269 | typedef void (*fw_address_callback_t)(struct fw_card *card, |
| 253 | struct fw_request *request, | 270 | struct fw_request *request, |
| 254 | int tcode, int destination, int source, | 271 | int tcode, int destination, int source, |
| 255 | int generation, int speed, | 272 | int generation, |
| 256 | unsigned long long offset, | 273 | unsigned long long offset, |
| 257 | void *data, size_t length, | 274 | void *data, size_t length, |
| 258 | void *callback_data); | 275 | void *callback_data); |
| @@ -269,10 +286,10 @@ struct fw_packet { | |||
| 269 | u32 timestamp; | 286 | u32 timestamp; |
| 270 | 287 | ||
| 271 | /* | 288 | /* |
| 272 | * This callback is called when the packet transmission has | 289 | * This callback is called when the packet transmission has completed. |
| 273 | * completed; for successful transmission, the status code is | 290 | * For successful transmission, the status code is the ack received |
| 274 | * the ack received from the destination, otherwise it's a | 291 | * from the destination. Otherwise it is one of the juju-specific |
| 275 | * negative errno: ENOMEM, ESTALE, ETIMEDOUT, ENODEV, EIO. | 292 | * rcodes: RCODE_SEND_ERROR, _CANCELLED, _BUSY, _GENERATION, _NO_ACK. |
| 276 | * The callback can be called from tasklet context and thus | 293 | * The callback can be called from tasklet context and thus |
| 277 | * must never block. | 294 | * must never block. |
| 278 | */ | 295 | */ |
| @@ -355,17 +372,19 @@ void fw_core_remove_descriptor(struct fw_descriptor *desc); | |||
| 355 | * scatter-gather streaming (e.g. assembling video frame automatically). | 372 | * scatter-gather streaming (e.g. assembling video frame automatically). |
| 356 | */ | 373 | */ |
| 357 | struct fw_iso_packet { | 374 | struct fw_iso_packet { |
| 358 | u16 payload_length; /* Length of indirect payload. */ | 375 | u16 payload_length; /* Length of indirect payload */ |
| 359 | u32 interrupt:1; /* Generate interrupt on this packet */ | 376 | u32 interrupt:1; /* Generate interrupt on this packet */ |
| 360 | u32 skip:1; /* Set to not send packet at all. */ | 377 | u32 skip:1; /* tx: Set to not send packet at all */ |
| 361 | u32 tag:2; | 378 | /* rx: Sync bit, wait for matching sy */ |
| 362 | u32 sy:4; | 379 | u32 tag:2; /* tx: Tag in packet header */ |
| 363 | u32 header_length:8; /* Length of immediate header. */ | 380 | u32 sy:4; /* tx: Sy in packet header */ |
| 364 | u32 header[0]; | 381 | u32 header_length:8; /* Length of immediate header */ |
| 382 | u32 header[0]; /* tx: Top of 1394 isoch. data_block */ | ||
| 365 | }; | 383 | }; |
| 366 | 384 | ||
| 367 | #define FW_ISO_CONTEXT_TRANSMIT 0 | 385 | #define FW_ISO_CONTEXT_TRANSMIT 0 |
| 368 | #define FW_ISO_CONTEXT_RECEIVE 1 | 386 | #define FW_ISO_CONTEXT_RECEIVE 1 |
| 387 | #define FW_ISO_CONTEXT_RECEIVE_MULTICHANNEL 2 | ||
| 369 | 388 | ||
| 370 | #define FW_ISO_CONTEXT_MATCH_TAG0 1 | 389 | #define FW_ISO_CONTEXT_MATCH_TAG0 1 |
| 371 | #define FW_ISO_CONTEXT_MATCH_TAG1 2 | 390 | #define FW_ISO_CONTEXT_MATCH_TAG1 2 |
| @@ -389,24 +408,31 @@ struct fw_iso_buffer { | |||
| 389 | int fw_iso_buffer_init(struct fw_iso_buffer *buffer, struct fw_card *card, | 408 | int fw_iso_buffer_init(struct fw_iso_buffer *buffer, struct fw_card *card, |
| 390 | int page_count, enum dma_data_direction direction); | 409 | int page_count, enum dma_data_direction direction); |
| 391 | void fw_iso_buffer_destroy(struct fw_iso_buffer *buffer, struct fw_card *card); | 410 | void fw_iso_buffer_destroy(struct fw_iso_buffer *buffer, struct fw_card *card); |
| 411 | size_t fw_iso_buffer_lookup(struct fw_iso_buffer *buffer, dma_addr_t completed); | ||
| 392 | 412 | ||
| 393 | struct fw_iso_context; | 413 | struct fw_iso_context; |
| 394 | typedef void (*fw_iso_callback_t)(struct fw_iso_context *context, | 414 | typedef void (*fw_iso_callback_t)(struct fw_iso_context *context, |
| 395 | u32 cycle, size_t header_length, | 415 | u32 cycle, size_t header_length, |
| 396 | void *header, void *data); | 416 | void *header, void *data); |
| 417 | typedef void (*fw_iso_mc_callback_t)(struct fw_iso_context *context, | ||
| 418 | dma_addr_t completed, void *data); | ||
| 397 | struct fw_iso_context { | 419 | struct fw_iso_context { |
| 398 | struct fw_card *card; | 420 | struct fw_card *card; |
| 399 | int type; | 421 | int type; |
| 400 | int channel; | 422 | int channel; |
| 401 | int speed; | 423 | int speed; |
| 402 | size_t header_size; | 424 | size_t header_size; |
| 403 | fw_iso_callback_t callback; | 425 | union { |
| 426 | fw_iso_callback_t sc; | ||
| 427 | fw_iso_mc_callback_t mc; | ||
| 428 | } callback; | ||
| 404 | void *callback_data; | 429 | void *callback_data; |
| 405 | }; | 430 | }; |
| 406 | 431 | ||
| 407 | struct fw_iso_context *fw_iso_context_create(struct fw_card *card, | 432 | struct fw_iso_context *fw_iso_context_create(struct fw_card *card, |
| 408 | int type, int channel, int speed, size_t header_size, | 433 | int type, int channel, int speed, size_t header_size, |
| 409 | fw_iso_callback_t callback, void *callback_data); | 434 | fw_iso_callback_t callback, void *callback_data); |
| 435 | int fw_iso_context_set_channels(struct fw_iso_context *ctx, u64 *channels); | ||
| 410 | int fw_iso_context_queue(struct fw_iso_context *ctx, | 436 | int fw_iso_context_queue(struct fw_iso_context *ctx, |
| 411 | struct fw_iso_packet *packet, | 437 | struct fw_iso_packet *packet, |
| 412 | struct fw_iso_buffer *buffer, | 438 | struct fw_iso_buffer *buffer, |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 68ca1b0491af..e5106e49bd2c 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -53,6 +53,7 @@ struct inodes_stat_t { | |||
| 53 | #define MAY_APPEND 8 | 53 | #define MAY_APPEND 8 |
| 54 | #define MAY_ACCESS 16 | 54 | #define MAY_ACCESS 16 |
| 55 | #define MAY_OPEN 32 | 55 | #define MAY_OPEN 32 |
| 56 | #define MAY_CHDIR 64 | ||
| 56 | 57 | ||
| 57 | /* | 58 | /* |
| 58 | * flags in file.f_mode. Note that FMODE_READ and FMODE_WRITE must correspond | 59 | * flags in file.f_mode. Note that FMODE_READ and FMODE_WRITE must correspond |
| @@ -415,7 +416,8 @@ struct buffer_head; | |||
| 415 | typedef int (get_block_t)(struct inode *inode, sector_t iblock, | 416 | typedef int (get_block_t)(struct inode *inode, sector_t iblock, |
| 416 | struct buffer_head *bh_result, int create); | 417 | struct buffer_head *bh_result, int create); |
| 417 | typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset, | 418 | typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset, |
| 418 | ssize_t bytes, void *private); | 419 | ssize_t bytes, void *private, int ret, |
| 420 | bool is_async); | ||
| 419 | 421 | ||
| 420 | /* | 422 | /* |
| 421 | * Attribute flags. These should be or-ed together to figure out what | 423 | * Attribute flags. These should be or-ed together to figure out what |
diff --git a/include/linux/fscache-cache.h b/include/linux/fscache-cache.h index c57db27ac861..b8581c09d19f 100644 --- a/include/linux/fscache-cache.h +++ b/include/linux/fscache-cache.h | |||
| @@ -20,7 +20,7 @@ | |||
| 20 | 20 | ||
| 21 | #include <linux/fscache.h> | 21 | #include <linux/fscache.h> |
| 22 | #include <linux/sched.h> | 22 | #include <linux/sched.h> |
| 23 | #include <linux/slow-work.h> | 23 | #include <linux/workqueue.h> |
| 24 | 24 | ||
| 25 | #define NR_MAXCACHES BITS_PER_LONG | 25 | #define NR_MAXCACHES BITS_PER_LONG |
| 26 | 26 | ||
| @@ -76,18 +76,14 @@ typedef void (*fscache_operation_release_t)(struct fscache_operation *op); | |||
| 76 | typedef void (*fscache_operation_processor_t)(struct fscache_operation *op); | 76 | typedef void (*fscache_operation_processor_t)(struct fscache_operation *op); |
| 77 | 77 | ||
| 78 | struct fscache_operation { | 78 | struct fscache_operation { |
| 79 | union { | 79 | struct work_struct work; /* record for async ops */ |
| 80 | struct work_struct fast_work; /* record for fast ops */ | ||
| 81 | struct slow_work slow_work; /* record for (very) slow ops */ | ||
| 82 | }; | ||
| 83 | struct list_head pend_link; /* link in object->pending_ops */ | 80 | struct list_head pend_link; /* link in object->pending_ops */ |
| 84 | struct fscache_object *object; /* object to be operated upon */ | 81 | struct fscache_object *object; /* object to be operated upon */ |
| 85 | 82 | ||
| 86 | unsigned long flags; | 83 | unsigned long flags; |
| 87 | #define FSCACHE_OP_TYPE 0x000f /* operation type */ | 84 | #define FSCACHE_OP_TYPE 0x000f /* operation type */ |
| 88 | #define FSCACHE_OP_FAST 0x0001 /* - fast op, processor may not sleep for disk */ | 85 | #define FSCACHE_OP_ASYNC 0x0001 /* - async op, processor may sleep for disk */ |
| 89 | #define FSCACHE_OP_SLOW 0x0002 /* - (very) slow op, processor may sleep for disk */ | 86 | #define FSCACHE_OP_MYTHREAD 0x0002 /* - processing is done be issuing thread, not pool */ |
| 90 | #define FSCACHE_OP_MYTHREAD 0x0003 /* - processing is done be issuing thread, not pool */ | ||
| 91 | #define FSCACHE_OP_WAITING 4 /* cleared when op is woken */ | 87 | #define FSCACHE_OP_WAITING 4 /* cleared when op is woken */ |
| 92 | #define FSCACHE_OP_EXCLUSIVE 5 /* exclusive op, other ops must wait */ | 88 | #define FSCACHE_OP_EXCLUSIVE 5 /* exclusive op, other ops must wait */ |
| 93 | #define FSCACHE_OP_DEAD 6 /* op is now dead */ | 89 | #define FSCACHE_OP_DEAD 6 /* op is now dead */ |
| @@ -105,7 +101,8 @@ struct fscache_operation { | |||
| 105 | /* operation releaser */ | 101 | /* operation releaser */ |
| 106 | fscache_operation_release_t release; | 102 | fscache_operation_release_t release; |
| 107 | 103 | ||
| 108 | #ifdef CONFIG_SLOW_WORK_DEBUG | 104 | #ifdef CONFIG_WORKQUEUE_DEBUGFS |
| 105 | struct work_struct put_work; /* work to delay operation put */ | ||
| 109 | const char *name; /* operation name */ | 106 | const char *name; /* operation name */ |
| 110 | const char *state; /* operation state */ | 107 | const char *state; /* operation state */ |
| 111 | #define fscache_set_op_name(OP, N) do { (OP)->name = (N); } while(0) | 108 | #define fscache_set_op_name(OP, N) do { (OP)->name = (N); } while(0) |
| @@ -117,7 +114,7 @@ struct fscache_operation { | |||
| 117 | }; | 114 | }; |
| 118 | 115 | ||
| 119 | extern atomic_t fscache_op_debug_id; | 116 | extern atomic_t fscache_op_debug_id; |
| 120 | extern const struct slow_work_ops fscache_op_slow_work_ops; | 117 | extern void fscache_op_work_func(struct work_struct *work); |
| 121 | 118 | ||
| 122 | extern void fscache_enqueue_operation(struct fscache_operation *); | 119 | extern void fscache_enqueue_operation(struct fscache_operation *); |
| 123 | extern void fscache_put_operation(struct fscache_operation *); | 120 | extern void fscache_put_operation(struct fscache_operation *); |
| @@ -128,33 +125,21 @@ extern void fscache_put_operation(struct fscache_operation *); | |||
| 128 | * @release: The release function to assign | 125 | * @release: The release function to assign |
| 129 | * | 126 | * |
| 130 | * Do basic initialisation of an operation. The caller must still set flags, | 127 | * Do basic initialisation of an operation. The caller must still set flags, |
| 131 | * object, either fast_work or slow_work if necessary, and processor if needed. | 128 | * object and processor if needed. |
| 132 | */ | 129 | */ |
| 133 | static inline void fscache_operation_init(struct fscache_operation *op, | 130 | static inline void fscache_operation_init(struct fscache_operation *op, |
| 134 | fscache_operation_release_t release) | 131 | fscache_operation_processor_t processor, |
| 132 | fscache_operation_release_t release) | ||
| 135 | { | 133 | { |
| 134 | INIT_WORK(&op->work, fscache_op_work_func); | ||
| 136 | atomic_set(&op->usage, 1); | 135 | atomic_set(&op->usage, 1); |
| 137 | op->debug_id = atomic_inc_return(&fscache_op_debug_id); | 136 | op->debug_id = atomic_inc_return(&fscache_op_debug_id); |
| 137 | op->processor = processor; | ||
| 138 | op->release = release; | 138 | op->release = release; |
| 139 | INIT_LIST_HEAD(&op->pend_link); | 139 | INIT_LIST_HEAD(&op->pend_link); |
| 140 | fscache_set_op_state(op, "Init"); | 140 | fscache_set_op_state(op, "Init"); |
| 141 | } | 141 | } |
| 142 | 142 | ||
| 143 | /** | ||
| 144 | * fscache_operation_init_slow - Do additional initialisation of a slow op | ||
| 145 | * @op: The operation to initialise | ||
| 146 | * @processor: The processor function to assign | ||
| 147 | * | ||
| 148 | * Do additional initialisation of an operation as required for slow work. | ||
| 149 | */ | ||
| 150 | static inline | ||
| 151 | void fscache_operation_init_slow(struct fscache_operation *op, | ||
| 152 | fscache_operation_processor_t processor) | ||
| 153 | { | ||
| 154 | op->processor = processor; | ||
| 155 | slow_work_init(&op->slow_work, &fscache_op_slow_work_ops); | ||
| 156 | } | ||
| 157 | |||
| 158 | /* | 143 | /* |
| 159 | * data read operation | 144 | * data read operation |
| 160 | */ | 145 | */ |
| @@ -389,7 +374,7 @@ struct fscache_object { | |||
| 389 | struct fscache_cache *cache; /* cache that supplied this object */ | 374 | struct fscache_cache *cache; /* cache that supplied this object */ |
| 390 | struct fscache_cookie *cookie; /* netfs's file/index object */ | 375 | struct fscache_cookie *cookie; /* netfs's file/index object */ |
| 391 | struct fscache_object *parent; /* parent object */ | 376 | struct fscache_object *parent; /* parent object */ |
| 392 | struct slow_work work; /* attention scheduling record */ | 377 | struct work_struct work; /* attention scheduling record */ |
| 393 | struct list_head dependents; /* FIFO of dependent objects */ | 378 | struct list_head dependents; /* FIFO of dependent objects */ |
| 394 | struct list_head dep_link; /* link in parent's dependents list */ | 379 | struct list_head dep_link; /* link in parent's dependents list */ |
| 395 | struct list_head pending_ops; /* unstarted operations on this object */ | 380 | struct list_head pending_ops; /* unstarted operations on this object */ |
| @@ -411,7 +396,7 @@ extern const char *fscache_object_states[]; | |||
| 411 | (test_bit(FSCACHE_IOERROR, &(obj)->cache->flags) && \ | 396 | (test_bit(FSCACHE_IOERROR, &(obj)->cache->flags) && \ |
| 412 | (obj)->state >= FSCACHE_OBJECT_DYING) | 397 | (obj)->state >= FSCACHE_OBJECT_DYING) |
| 413 | 398 | ||
| 414 | extern const struct slow_work_ops fscache_object_slow_work_ops; | 399 | extern void fscache_object_work_func(struct work_struct *work); |
| 415 | 400 | ||
| 416 | /** | 401 | /** |
| 417 | * fscache_object_init - Initialise a cache object description | 402 | * fscache_object_init - Initialise a cache object description |
| @@ -433,7 +418,7 @@ void fscache_object_init(struct fscache_object *object, | |||
| 433 | spin_lock_init(&object->lock); | 418 | spin_lock_init(&object->lock); |
| 434 | INIT_LIST_HEAD(&object->cache_link); | 419 | INIT_LIST_HEAD(&object->cache_link); |
| 435 | INIT_HLIST_NODE(&object->cookie_link); | 420 | INIT_HLIST_NODE(&object->cookie_link); |
| 436 | vslow_work_init(&object->work, &fscache_object_slow_work_ops); | 421 | INIT_WORK(&object->work, fscache_object_work_func); |
| 437 | INIT_LIST_HEAD(&object->dependents); | 422 | INIT_LIST_HEAD(&object->dependents); |
| 438 | INIT_LIST_HEAD(&object->dep_link); | 423 | INIT_LIST_HEAD(&object->dep_link); |
| 439 | INIT_LIST_HEAD(&object->pending_ops); | 424 | INIT_LIST_HEAD(&object->pending_ops); |
| @@ -534,6 +519,8 @@ extern void fscache_io_error(struct fscache_cache *cache); | |||
| 534 | extern void fscache_mark_pages_cached(struct fscache_retrieval *op, | 519 | extern void fscache_mark_pages_cached(struct fscache_retrieval *op, |
| 535 | struct pagevec *pagevec); | 520 | struct pagevec *pagevec); |
| 536 | 521 | ||
| 522 | extern bool fscache_object_sleep_till_congested(signed long *timeoutp); | ||
| 523 | |||
| 537 | extern enum fscache_checkaux fscache_check_aux(struct fscache_object *object, | 524 | extern enum fscache_checkaux fscache_check_aux(struct fscache_object *object, |
| 538 | const void *data, | 525 | const void *data, |
| 539 | uint16_t datalen); | 526 | uint16_t datalen); |
diff --git a/include/linux/fscache.h b/include/linux/fscache.h index 595ce49288b7..ec0dad5ab90f 100644 --- a/include/linux/fscache.h +++ b/include/linux/fscache.h | |||
| @@ -85,7 +85,7 @@ struct fscache_cookie_def { | |||
| 85 | 85 | ||
| 86 | /* get an index key | 86 | /* get an index key |
| 87 | * - should store the key data in the buffer | 87 | * - should store the key data in the buffer |
| 88 | * - should return the amount of amount stored | 88 | * - should return the amount of data stored |
| 89 | * - not permitted to return an error | 89 | * - not permitted to return an error |
| 90 | * - the netfs data from the cookie being used as the source is | 90 | * - the netfs data from the cookie being used as the source is |
| 91 | * presented | 91 | * presented |
| @@ -454,6 +454,7 @@ int fscache_read_or_alloc_page(struct fscache_cookie *cookie, | |||
| 454 | * @cookie: The cookie representing the cache object | 454 | * @cookie: The cookie representing the cache object |
| 455 | * @mapping: The netfs inode mapping to which the pages will be attached | 455 | * @mapping: The netfs inode mapping to which the pages will be attached |
| 456 | * @pages: A list of potential netfs pages to be filled | 456 | * @pages: A list of potential netfs pages to be filled |
| 457 | * @nr_pages: Number of pages to be read and/or allocated | ||
| 457 | * @end_io_func: The callback to invoke when and if each page is filled | 458 | * @end_io_func: The callback to invoke when and if each page is filled |
| 458 | * @context: An arbitrary piece of data to pass on to end_io_func() | 459 | * @context: An arbitrary piece of data to pass on to end_io_func() |
| 459 | * @gfp: The conditions under which memory allocation should be made | 460 | * @gfp: The conditions under which memory allocation should be made |
diff --git a/include/linux/fsl-diu-fb.h b/include/linux/fsl-diu-fb.h new file mode 100644 index 000000000000..fc295d7ea463 --- /dev/null +++ b/include/linux/fsl-diu-fb.h | |||
| @@ -0,0 +1,223 @@ | |||
| 1 | /* | ||
| 2 | * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved. | ||
| 3 | * | ||
| 4 | * Freescale DIU Frame Buffer device driver | ||
| 5 | * | ||
| 6 | * Authors: Hongjun Chen <hong-jun.chen@freescale.com> | ||
| 7 | * Paul Widmer <paul.widmer@freescale.com> | ||
| 8 | * Srikanth Srinivasan <srikanth.srinivasan@freescale.com> | ||
| 9 | * York Sun <yorksun@freescale.com> | ||
| 10 | * | ||
| 11 | * Based on imxfb.c Copyright (C) 2004 S.Hauer, Pengutronix | ||
| 12 | * | ||
| 13 | * This program is free software; you can redistribute it and/or modify it | ||
| 14 | * under the terms of the GNU General Public License as published by the | ||
| 15 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 16 | * option) any later version. | ||
| 17 | * | ||
| 18 | */ | ||
| 19 | |||
| 20 | #ifndef __FSL_DIU_FB_H__ | ||
| 21 | #define __FSL_DIU_FB_H__ | ||
| 22 | |||
| 23 | /* Arbitrary threshold to determine the allocation method | ||
| 24 | * See mpc8610fb_set_par(), map_video_memory(), and unmap_video_memory() | ||
| 25 | */ | ||
| 26 | #define MEM_ALLOC_THRESHOLD (1024*768*4+32) | ||
| 27 | /* Minimum value that the pixel clock can be set to in pico seconds | ||
| 28 | * This is determined by platform clock/3 where the minimum platform | ||
| 29 | * clock is 533MHz. This gives 5629 pico seconds. | ||
| 30 | */ | ||
| 31 | #define MIN_PIX_CLK 5629 | ||
| 32 | #define MAX_PIX_CLK 96096 | ||
| 33 | |||
| 34 | #include <linux/types.h> | ||
| 35 | |||
| 36 | struct mfb_alpha { | ||
| 37 | int enable; | ||
| 38 | int alpha; | ||
| 39 | }; | ||
| 40 | |||
| 41 | struct mfb_chroma_key { | ||
| 42 | int enable; | ||
| 43 | __u8 red_max; | ||
| 44 | __u8 green_max; | ||
| 45 | __u8 blue_max; | ||
| 46 | __u8 red_min; | ||
| 47 | __u8 green_min; | ||
| 48 | __u8 blue_min; | ||
| 49 | }; | ||
| 50 | |||
| 51 | struct aoi_display_offset { | ||
| 52 | int x_aoi_d; | ||
| 53 | int y_aoi_d; | ||
| 54 | }; | ||
| 55 | |||
| 56 | #define MFB_SET_CHROMA_KEY _IOW('M', 1, struct mfb_chroma_key) | ||
| 57 | #define MFB_WAIT_FOR_VSYNC _IOW('F', 0x20, u_int32_t) | ||
| 58 | #define MFB_SET_BRIGHTNESS _IOW('M', 3, __u8) | ||
| 59 | |||
| 60 | #define MFB_SET_ALPHA 0x80014d00 | ||
| 61 | #define MFB_GET_ALPHA 0x40014d00 | ||
| 62 | #define MFB_SET_AOID 0x80084d04 | ||
| 63 | #define MFB_GET_AOID 0x40084d04 | ||
| 64 | #define MFB_SET_PIXFMT 0x80014d08 | ||
| 65 | #define MFB_GET_PIXFMT 0x40014d08 | ||
| 66 | |||
| 67 | #define FBIOGET_GWINFO 0x46E0 | ||
| 68 | #define FBIOPUT_GWINFO 0x46E1 | ||
| 69 | |||
| 70 | #ifdef __KERNEL__ | ||
| 71 | #include <linux/spinlock.h> | ||
| 72 | |||
| 73 | /* | ||
| 74 | * These are the fields of area descriptor(in DDR memory) for every plane | ||
| 75 | */ | ||
| 76 | struct diu_ad { | ||
| 77 | /* Word 0(32-bit) in DDR memory */ | ||
| 78 | /* __u16 comp; */ | ||
| 79 | /* __u16 pixel_s:2; */ | ||
| 80 | /* __u16 pallete:1; */ | ||
| 81 | /* __u16 red_c:2; */ | ||
| 82 | /* __u16 green_c:2; */ | ||
| 83 | /* __u16 blue_c:2; */ | ||
| 84 | /* __u16 alpha_c:3; */ | ||
| 85 | /* __u16 byte_f:1; */ | ||
| 86 | /* __u16 res0:3; */ | ||
| 87 | |||
| 88 | __be32 pix_fmt; /* hard coding pixel format */ | ||
| 89 | |||
| 90 | /* Word 1(32-bit) in DDR memory */ | ||
| 91 | __le32 addr; | ||
| 92 | |||
| 93 | /* Word 2(32-bit) in DDR memory */ | ||
| 94 | /* __u32 delta_xs:11; */ | ||
| 95 | /* __u32 res1:1; */ | ||
| 96 | /* __u32 delta_ys:11; */ | ||
| 97 | /* __u32 res2:1; */ | ||
| 98 | /* __u32 g_alpha:8; */ | ||
| 99 | __le32 src_size_g_alpha; | ||
| 100 | |||
| 101 | /* Word 3(32-bit) in DDR memory */ | ||
| 102 | /* __u32 delta_xi:11; */ | ||
| 103 | /* __u32 res3:5; */ | ||
| 104 | /* __u32 delta_yi:11; */ | ||
| 105 | /* __u32 res4:3; */ | ||
| 106 | /* __u32 flip:2; */ | ||
| 107 | __le32 aoi_size; | ||
| 108 | |||
| 109 | /* Word 4(32-bit) in DDR memory */ | ||
| 110 | /*__u32 offset_xi:11; | ||
| 111 | __u32 res5:5; | ||
| 112 | __u32 offset_yi:11; | ||
| 113 | __u32 res6:5; | ||
| 114 | */ | ||
| 115 | __le32 offset_xyi; | ||
| 116 | |||
| 117 | /* Word 5(32-bit) in DDR memory */ | ||
| 118 | /*__u32 offset_xd:11; | ||
| 119 | __u32 res7:5; | ||
| 120 | __u32 offset_yd:11; | ||
| 121 | __u32 res8:5; */ | ||
| 122 | __le32 offset_xyd; | ||
| 123 | |||
| 124 | |||
| 125 | /* Word 6(32-bit) in DDR memory */ | ||
| 126 | __u8 ckmax_r; | ||
| 127 | __u8 ckmax_g; | ||
| 128 | __u8 ckmax_b; | ||
| 129 | __u8 res9; | ||
| 130 | |||
| 131 | /* Word 7(32-bit) in DDR memory */ | ||
| 132 | __u8 ckmin_r; | ||
| 133 | __u8 ckmin_g; | ||
| 134 | __u8 ckmin_b; | ||
| 135 | __u8 res10; | ||
| 136 | /* __u32 res10:8; */ | ||
| 137 | |||
| 138 | /* Word 8(32-bit) in DDR memory */ | ||
| 139 | __le32 next_ad; | ||
| 140 | |||
| 141 | /* Word 9(32-bit) in DDR memory, just for 64-bit aligned */ | ||
| 142 | __u32 paddr; | ||
| 143 | } __attribute__ ((packed)); | ||
| 144 | |||
| 145 | /* DIU register map */ | ||
| 146 | struct diu { | ||
| 147 | __be32 desc[3]; | ||
| 148 | __be32 gamma; | ||
| 149 | __be32 pallete; | ||
| 150 | __be32 cursor; | ||
| 151 | __be32 curs_pos; | ||
| 152 | __be32 diu_mode; | ||
| 153 | __be32 bgnd; | ||
| 154 | __be32 bgnd_wb; | ||
| 155 | __be32 disp_size; | ||
| 156 | __be32 wb_size; | ||
| 157 | __be32 wb_mem_addr; | ||
| 158 | __be32 hsyn_para; | ||
| 159 | __be32 vsyn_para; | ||
| 160 | __be32 syn_pol; | ||
| 161 | __be32 thresholds; | ||
| 162 | __be32 int_status; | ||
| 163 | __be32 int_mask; | ||
| 164 | __be32 colorbar[8]; | ||
| 165 | __be32 filling; | ||
| 166 | __be32 plut; | ||
| 167 | } __attribute__ ((packed)); | ||
| 168 | |||
| 169 | struct diu_hw { | ||
| 170 | struct diu *diu_reg; | ||
| 171 | spinlock_t reg_lock; | ||
| 172 | |||
| 173 | __u32 mode; /* DIU operation mode */ | ||
| 174 | }; | ||
| 175 | |||
| 176 | struct diu_addr { | ||
| 177 | __u8 __iomem *vaddr; /* Virtual address */ | ||
| 178 | dma_addr_t paddr; /* Physical address */ | ||
| 179 | __u32 offset; | ||
| 180 | }; | ||
| 181 | |||
| 182 | struct diu_pool { | ||
| 183 | struct diu_addr ad; | ||
| 184 | struct diu_addr gamma; | ||
| 185 | struct diu_addr pallete; | ||
| 186 | struct diu_addr cursor; | ||
| 187 | }; | ||
| 188 | |||
| 189 | #define FSL_DIU_BASE_OFFSET 0x2C000 /* Offset of DIU */ | ||
| 190 | #define INT_LCDC 64 /* DIU interrupt number */ | ||
| 191 | |||
| 192 | #define FSL_AOI_NUM 6 /* 5 AOIs and one dummy AOI */ | ||
| 193 | /* 1 for plane 0, 2 for plane 1&2 each */ | ||
| 194 | |||
| 195 | /* Minimum X and Y resolutions */ | ||
| 196 | #define MIN_XRES 64 | ||
| 197 | #define MIN_YRES 64 | ||
| 198 | |||
| 199 | /* HW cursor parameters */ | ||
| 200 | #define MAX_CURS 32 | ||
| 201 | |||
| 202 | /* Modes of operation of DIU */ | ||
| 203 | #define MFB_MODE0 0 /* DIU off */ | ||
| 204 | #define MFB_MODE1 1 /* All three planes output to display */ | ||
| 205 | #define MFB_MODE2 2 /* Plane 1 to display, planes 2+3 written back*/ | ||
| 206 | #define MFB_MODE3 3 /* All three planes written back to memory */ | ||
| 207 | #define MFB_MODE4 4 /* Color bar generation */ | ||
| 208 | |||
| 209 | /* INT_STATUS/INT_MASK field descriptions */ | ||
| 210 | #define INT_VSYNC 0x01 /* Vsync interrupt */ | ||
| 211 | #define INT_VSYNC_WB 0x02 /* Vsync interrupt for write back operation */ | ||
| 212 | #define INT_UNDRUN 0x04 /* Under run exception interrupt */ | ||
| 213 | #define INT_PARERR 0x08 /* Display parameters error interrupt */ | ||
| 214 | #define INT_LS_BF_VS 0x10 /* Lines before vsync. interrupt */ | ||
| 215 | |||
| 216 | /* Panels'operation modes */ | ||
| 217 | #define MFB_TYPE_OUTPUT 0 /* Panel output to display */ | ||
| 218 | #define MFB_TYPE_OFF 1 /* Panel off */ | ||
| 219 | #define MFB_TYPE_WB 2 /* Panel written back to memory */ | ||
| 220 | #define MFB_TYPE_TEST 3 /* Panel generate color bar */ | ||
| 221 | |||
| 222 | #endif /* __KERNEL__ */ | ||
| 223 | #endif /* __FSL_DIU_FB_H__ */ | ||
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 41e46330d9be..dcd6a7c3a435 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | /* | ||
| 2 | * Ftrace header. For implementation details beyond the random comments | ||
| 3 | * scattered below, see: Documentation/trace/ftrace-design.txt | ||
| 4 | */ | ||
| 5 | |||
| 1 | #ifndef _LINUX_FTRACE_H | 6 | #ifndef _LINUX_FTRACE_H |
| 2 | #define _LINUX_FTRACE_H | 7 | #define _LINUX_FTRACE_H |
| 3 | 8 | ||
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 3167f2df4126..02b8b24f8f51 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
| @@ -11,8 +11,6 @@ struct trace_array; | |||
| 11 | struct tracer; | 11 | struct tracer; |
| 12 | struct dentry; | 12 | struct dentry; |
| 13 | 13 | ||
| 14 | DECLARE_PER_CPU(struct trace_seq, ftrace_event_seq); | ||
| 15 | |||
| 16 | struct trace_print_flags { | 14 | struct trace_print_flags { |
| 17 | unsigned long mask; | 15 | unsigned long mask; |
| 18 | const char *name; | 16 | const char *name; |
| @@ -58,6 +56,9 @@ struct trace_iterator { | |||
| 58 | struct ring_buffer_iter *buffer_iter[NR_CPUS]; | 56 | struct ring_buffer_iter *buffer_iter[NR_CPUS]; |
| 59 | unsigned long iter_flags; | 57 | unsigned long iter_flags; |
| 60 | 58 | ||
| 59 | /* trace_seq for __print_flags() and __print_symbolic() etc. */ | ||
| 60 | struct trace_seq tmp_seq; | ||
| 61 | |||
| 61 | /* The below is zeroed out in pipe_read */ | 62 | /* The below is zeroed out in pipe_read */ |
| 62 | struct trace_seq seq; | 63 | struct trace_seq seq; |
| 63 | struct trace_entry *ent; | 64 | struct trace_entry *ent; |
| @@ -146,14 +147,19 @@ struct ftrace_event_class { | |||
| 146 | int (*raw_init)(struct ftrace_event_call *); | 147 | int (*raw_init)(struct ftrace_event_call *); |
| 147 | }; | 148 | }; |
| 148 | 149 | ||
| 150 | extern int ftrace_event_reg(struct ftrace_event_call *event, | ||
| 151 | enum trace_reg type); | ||
| 152 | |||
| 149 | enum { | 153 | enum { |
| 150 | TRACE_EVENT_FL_ENABLED_BIT, | 154 | TRACE_EVENT_FL_ENABLED_BIT, |
| 151 | TRACE_EVENT_FL_FILTERED_BIT, | 155 | TRACE_EVENT_FL_FILTERED_BIT, |
| 156 | TRACE_EVENT_FL_RECORDED_CMD_BIT, | ||
| 152 | }; | 157 | }; |
| 153 | 158 | ||
| 154 | enum { | 159 | enum { |
| 155 | TRACE_EVENT_FL_ENABLED = (1 << TRACE_EVENT_FL_ENABLED_BIT), | 160 | TRACE_EVENT_FL_ENABLED = (1 << TRACE_EVENT_FL_ENABLED_BIT), |
| 156 | TRACE_EVENT_FL_FILTERED = (1 << TRACE_EVENT_FL_FILTERED_BIT), | 161 | TRACE_EVENT_FL_FILTERED = (1 << TRACE_EVENT_FL_FILTERED_BIT), |
| 162 | TRACE_EVENT_FL_RECORDED_CMD = (1 << TRACE_EVENT_FL_RECORDED_CMD_BIT), | ||
| 157 | }; | 163 | }; |
| 158 | 164 | ||
| 159 | struct ftrace_event_call { | 165 | struct ftrace_event_call { |
| @@ -171,6 +177,7 @@ struct ftrace_event_call { | |||
| 171 | * 32 bit flags: | 177 | * 32 bit flags: |
| 172 | * bit 1: enabled | 178 | * bit 1: enabled |
| 173 | * bit 2: filter_active | 179 | * bit 2: filter_active |
| 180 | * bit 3: enabled cmd record | ||
| 174 | * | 181 | * |
| 175 | * Changes to flags must hold the event_mutex. | 182 | * Changes to flags must hold the event_mutex. |
| 176 | * | 183 | * |
| @@ -257,8 +264,7 @@ static inline void | |||
| 257 | perf_trace_buf_submit(void *raw_data, int size, int rctx, u64 addr, | 264 | perf_trace_buf_submit(void *raw_data, int size, int rctx, u64 addr, |
| 258 | u64 count, struct pt_regs *regs, void *head) | 265 | u64 count, struct pt_regs *regs, void *head) |
| 259 | { | 266 | { |
| 260 | perf_tp_event(addr, count, raw_data, size, regs, head); | 267 | perf_tp_event(addr, count, raw_data, size, regs, head, rctx); |
| 261 | perf_swevent_put_recursion_context(rctx); | ||
| 262 | } | 268 | } |
| 263 | #endif | 269 | #endif |
| 264 | 270 | ||
diff --git a/include/linux/fuse.h b/include/linux/fuse.h index 88e0eb596919..c3c578e09833 100644 --- a/include/linux/fuse.h +++ b/include/linux/fuse.h | |||
| @@ -37,6 +37,10 @@ | |||
| 37 | * | 37 | * |
| 38 | * 7.14 | 38 | * 7.14 |
| 39 | * - add splice support to fuse device | 39 | * - add splice support to fuse device |
| 40 | * | ||
| 41 | * 7.15 | ||
| 42 | * - add store notify | ||
| 43 | * - add retrieve notify | ||
| 40 | */ | 44 | */ |
| 41 | 45 | ||
| 42 | #ifndef _LINUX_FUSE_H | 46 | #ifndef _LINUX_FUSE_H |
| @@ -68,7 +72,7 @@ | |||
| 68 | #define FUSE_KERNEL_VERSION 7 | 72 | #define FUSE_KERNEL_VERSION 7 |
| 69 | 73 | ||
| 70 | /** Minor version number of this interface */ | 74 | /** Minor version number of this interface */ |
| 71 | #define FUSE_KERNEL_MINOR_VERSION 14 | 75 | #define FUSE_KERNEL_MINOR_VERSION 15 |
| 72 | 76 | ||
| 73 | /** The node ID of the root inode */ | 77 | /** The node ID of the root inode */ |
| 74 | #define FUSE_ROOT_ID 1 | 78 | #define FUSE_ROOT_ID 1 |
| @@ -251,6 +255,7 @@ enum fuse_opcode { | |||
| 251 | FUSE_DESTROY = 38, | 255 | FUSE_DESTROY = 38, |
| 252 | FUSE_IOCTL = 39, | 256 | FUSE_IOCTL = 39, |
| 253 | FUSE_POLL = 40, | 257 | FUSE_POLL = 40, |
| 258 | FUSE_NOTIFY_REPLY = 41, | ||
| 254 | 259 | ||
| 255 | /* CUSE specific operations */ | 260 | /* CUSE specific operations */ |
| 256 | CUSE_INIT = 4096, | 261 | CUSE_INIT = 4096, |
| @@ -260,6 +265,8 @@ enum fuse_notify_code { | |||
| 260 | FUSE_NOTIFY_POLL = 1, | 265 | FUSE_NOTIFY_POLL = 1, |
| 261 | FUSE_NOTIFY_INVAL_INODE = 2, | 266 | FUSE_NOTIFY_INVAL_INODE = 2, |
| 262 | FUSE_NOTIFY_INVAL_ENTRY = 3, | 267 | FUSE_NOTIFY_INVAL_ENTRY = 3, |
| 268 | FUSE_NOTIFY_STORE = 4, | ||
| 269 | FUSE_NOTIFY_RETRIEVE = 5, | ||
| 263 | FUSE_NOTIFY_CODE_MAX, | 270 | FUSE_NOTIFY_CODE_MAX, |
| 264 | }; | 271 | }; |
| 265 | 272 | ||
| @@ -568,4 +575,29 @@ struct fuse_notify_inval_entry_out { | |||
| 568 | __u32 padding; | 575 | __u32 padding; |
| 569 | }; | 576 | }; |
| 570 | 577 | ||
| 578 | struct fuse_notify_store_out { | ||
| 579 | __u64 nodeid; | ||
| 580 | __u64 offset; | ||
| 581 | __u32 size; | ||
| 582 | __u32 padding; | ||
| 583 | }; | ||
| 584 | |||
| 585 | struct fuse_notify_retrieve_out { | ||
| 586 | __u64 notify_unique; | ||
| 587 | __u64 nodeid; | ||
| 588 | __u64 offset; | ||
| 589 | __u32 size; | ||
| 590 | __u32 padding; | ||
| 591 | }; | ||
| 592 | |||
| 593 | /* Matches the size of fuse_write_in */ | ||
| 594 | struct fuse_notify_retrieve_in { | ||
| 595 | __u64 dummy1; | ||
| 596 | __u64 offset; | ||
| 597 | __u32 size; | ||
| 598 | __u32 dummy2; | ||
| 599 | __u64 dummy3; | ||
| 600 | __u64 dummy4; | ||
| 601 | }; | ||
| 602 | |||
| 571 | #endif /* _LINUX_FUSE_H */ | 603 | #endif /* _LINUX_FUSE_H */ |
diff --git a/include/linux/hid.h b/include/linux/hid.h index 895001f7f4b2..42a0f1d11365 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h | |||
| @@ -311,6 +311,7 @@ struct hid_item { | |||
| 311 | #define HID_QUIRK_HIDDEV_FORCE 0x00000010 | 311 | #define HID_QUIRK_HIDDEV_FORCE 0x00000010 |
| 312 | #define HID_QUIRK_BADPAD 0x00000020 | 312 | #define HID_QUIRK_BADPAD 0x00000020 |
| 313 | #define HID_QUIRK_MULTI_INPUT 0x00000040 | 313 | #define HID_QUIRK_MULTI_INPUT 0x00000040 |
| 314 | #define HID_QUIRK_HIDINPUT_FORCE 0x00000080 | ||
| 314 | #define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00010000 | 315 | #define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00010000 |
| 315 | #define HID_QUIRK_FULLSPEED_INTERVAL 0x10000000 | 316 | #define HID_QUIRK_FULLSPEED_INTERVAL 0x10000000 |
| 316 | #define HID_QUIRK_NO_INIT_REPORTS 0x20000000 | 317 | #define HID_QUIRK_NO_INIT_REPORTS 0x20000000 |
diff --git a/include/linux/i2c/adp5588.h b/include/linux/i2c/adp5588.h index 02c9af374741..269181b8f623 100644 --- a/include/linux/i2c/adp5588.h +++ b/include/linux/i2c/adp5588.h | |||
| @@ -78,6 +78,40 @@ | |||
| 78 | 78 | ||
| 79 | #define ADP5588_KEYMAPSIZE 80 | 79 | #define ADP5588_KEYMAPSIZE 80 |
| 80 | 80 | ||
| 81 | #define GPI_PIN_ROW0 97 | ||
| 82 | #define GPI_PIN_ROW1 98 | ||
| 83 | #define GPI_PIN_ROW2 99 | ||
| 84 | #define GPI_PIN_ROW3 100 | ||
| 85 | #define GPI_PIN_ROW4 101 | ||
| 86 | #define GPI_PIN_ROW5 102 | ||
| 87 | #define GPI_PIN_ROW6 103 | ||
| 88 | #define GPI_PIN_ROW7 104 | ||
| 89 | #define GPI_PIN_COL0 105 | ||
| 90 | #define GPI_PIN_COL1 106 | ||
| 91 | #define GPI_PIN_COL2 107 | ||
| 92 | #define GPI_PIN_COL3 108 | ||
| 93 | #define GPI_PIN_COL4 109 | ||
| 94 | #define GPI_PIN_COL5 110 | ||
| 95 | #define GPI_PIN_COL6 111 | ||
| 96 | #define GPI_PIN_COL7 112 | ||
| 97 | #define GPI_PIN_COL8 113 | ||
| 98 | #define GPI_PIN_COL9 114 | ||
| 99 | |||
| 100 | #define GPI_PIN_ROW_BASE GPI_PIN_ROW0 | ||
| 101 | #define GPI_PIN_ROW_END GPI_PIN_ROW7 | ||
| 102 | #define GPI_PIN_COL_BASE GPI_PIN_COL0 | ||
| 103 | #define GPI_PIN_COL_END GPI_PIN_COL9 | ||
| 104 | |||
| 105 | #define GPI_PIN_BASE GPI_PIN_ROW_BASE | ||
| 106 | #define GPI_PIN_END GPI_PIN_COL_END | ||
| 107 | |||
| 108 | #define ADP5588_GPIMAPSIZE_MAX (GPI_PIN_END - GPI_PIN_BASE + 1) | ||
| 109 | |||
| 110 | struct adp5588_gpi_map { | ||
| 111 | unsigned short pin; | ||
| 112 | unsigned short sw_evt; | ||
| 113 | }; | ||
| 114 | |||
| 81 | struct adp5588_kpad_platform_data { | 115 | struct adp5588_kpad_platform_data { |
| 82 | int rows; /* Number of rows */ | 116 | int rows; /* Number of rows */ |
| 83 | int cols; /* Number of columns */ | 117 | int cols; /* Number of columns */ |
| @@ -87,6 +121,9 @@ struct adp5588_kpad_platform_data { | |||
| 87 | unsigned en_keylock:1; /* Enable Key Lock feature */ | 121 | unsigned en_keylock:1; /* Enable Key Lock feature */ |
| 88 | unsigned short unlock_key1; /* Unlock Key 1 */ | 122 | unsigned short unlock_key1; /* Unlock Key 1 */ |
| 89 | unsigned short unlock_key2; /* Unlock Key 2 */ | 123 | unsigned short unlock_key2; /* Unlock Key 2 */ |
| 124 | const struct adp5588_gpi_map *gpimap; | ||
| 125 | unsigned short gpimapsize; | ||
| 126 | const struct adp5588_gpio_platform_data *gpio_data; | ||
| 90 | }; | 127 | }; |
| 91 | 128 | ||
| 92 | struct adp5588_gpio_platform_data { | 129 | struct adp5588_gpio_platform_data { |
diff --git a/include/linux/i2c/mcs.h b/include/linux/i2c/mcs.h new file mode 100644 index 000000000000..725ae7c313ff --- /dev/null +++ b/include/linux/i2c/mcs.h | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2009 - 2010 Samsung Electronics Co.Ltd | ||
| 3 | * Author: Joonyoung Shim <jy0922.shim@samsung.com> | ||
| 4 | * Author: HeungJun Kim <riverful.kim@samsung.com> | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify it | ||
| 7 | * under the terms of the GNU General Public License as published by the | ||
| 8 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 9 | * option) any later version. | ||
| 10 | * | ||
| 11 | */ | ||
| 12 | |||
| 13 | #ifndef __LINUX_MCS_H | ||
| 14 | #define __LINUX_MCS_H | ||
| 15 | |||
| 16 | #define MCS_KEY_MAP(v, c) ((((v) & 0xff) << 16) | ((c) & 0xffff)) | ||
| 17 | #define MCS_KEY_VAL(v) (((v) >> 16) & 0xff) | ||
| 18 | #define MCS_KEY_CODE(v) ((v) & 0xffff) | ||
| 19 | |||
| 20 | struct mcs_platform_data { | ||
| 21 | void (*cfg_pin)(void); | ||
| 22 | |||
| 23 | /* touchscreen */ | ||
| 24 | unsigned int x_size; | ||
| 25 | unsigned int y_size; | ||
| 26 | |||
| 27 | /* touchkey */ | ||
| 28 | const u32 *keymap; | ||
| 29 | unsigned int keymap_size; | ||
| 30 | unsigned int key_maxval; | ||
| 31 | bool no_autorepeat; | ||
| 32 | }; | ||
| 33 | |||
| 34 | #endif /* __LINUX_MCS_H */ | ||
diff --git a/include/linux/i2c/mcs5000_ts.h b/include/linux/i2c/mcs5000_ts.h deleted file mode 100644 index 5a117b5ca15e..000000000000 --- a/include/linux/i2c/mcs5000_ts.h +++ /dev/null | |||
| @@ -1,24 +0,0 @@ | |||
| 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/qt602240_ts.h b/include/linux/i2c/qt602240_ts.h new file mode 100644 index 000000000000..c5033e101094 --- /dev/null +++ b/include/linux/i2c/qt602240_ts.h | |||
| @@ -0,0 +1,38 @@ | |||
| 1 | /* | ||
| 2 | * AT42QT602240/ATMXT224 Touchscreen driver | ||
| 3 | * | ||
| 4 | * Copyright (C) 2010 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 | #ifndef __LINUX_QT602240_TS_H | ||
| 14 | #define __LINUX_QT602240_TS_H | ||
| 15 | |||
| 16 | /* Orient */ | ||
| 17 | #define QT602240_NORMAL 0x0 | ||
| 18 | #define QT602240_DIAGONAL 0x1 | ||
| 19 | #define QT602240_HORIZONTAL_FLIP 0x2 | ||
| 20 | #define QT602240_ROTATED_90_COUNTER 0x3 | ||
| 21 | #define QT602240_VERTICAL_FLIP 0x4 | ||
| 22 | #define QT602240_ROTATED_90 0x5 | ||
| 23 | #define QT602240_ROTATED_180 0x6 | ||
| 24 | #define QT602240_DIAGONAL_COUNTER 0x7 | ||
| 25 | |||
| 26 | /* The platform data for the AT42QT602240/ATMXT224 touchscreen driver */ | ||
| 27 | struct qt602240_platform_data { | ||
| 28 | unsigned int x_line; | ||
| 29 | unsigned int y_line; | ||
| 30 | unsigned int x_size; | ||
| 31 | unsigned int y_size; | ||
| 32 | unsigned int blen; | ||
| 33 | unsigned int threshold; | ||
| 34 | unsigned int voltage; | ||
| 35 | unsigned char orient; | ||
| 36 | }; | ||
| 37 | |||
| 38 | #endif /* __LINUX_QT602240_TS_H */ | ||
diff --git a/include/linux/ide.h b/include/linux/ide.h index 7b02aa5ce9b4..072fe8c93e6f 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
| @@ -458,7 +458,7 @@ enum { | |||
| 458 | IDE_DFLAG_DOORLOCKING = (1 << 15), | 458 | IDE_DFLAG_DOORLOCKING = (1 << 15), |
| 459 | /* disallow DMA */ | 459 | /* disallow DMA */ |
| 460 | IDE_DFLAG_NODMA = (1 << 16), | 460 | IDE_DFLAG_NODMA = (1 << 16), |
| 461 | /* powermanagment told us not to do anything, so sleep nicely */ | 461 | /* powermanagement told us not to do anything, so sleep nicely */ |
| 462 | IDE_DFLAG_BLOCKED = (1 << 17), | 462 | IDE_DFLAG_BLOCKED = (1 << 17), |
| 463 | /* sleeping & sleep field valid */ | 463 | /* sleeping & sleep field valid */ |
| 464 | IDE_DFLAG_SLEEPING = (1 << 18), | 464 | IDE_DFLAG_SLEEPING = (1 << 18), |
diff --git a/include/linux/if.h b/include/linux/if.h index be350e62a905..53558ec59e1b 100644 --- a/include/linux/if.h +++ b/include/linux/if.h | |||
| @@ -73,6 +73,8 @@ | |||
| 73 | #define IFF_DONT_BRIDGE 0x800 /* disallow bridging this ether dev */ | 73 | #define IFF_DONT_BRIDGE 0x800 /* disallow bridging this ether dev */ |
| 74 | #define IFF_IN_NETPOLL 0x1000 /* whether we are processing netpoll */ | 74 | #define IFF_IN_NETPOLL 0x1000 /* whether we are processing netpoll */ |
| 75 | #define IFF_DISABLE_NETPOLL 0x2000 /* disable netpoll at run-time */ | 75 | #define IFF_DISABLE_NETPOLL 0x2000 /* disable netpoll at run-time */ |
| 76 | #define IFF_MACVLAN_PORT 0x4000 /* device used as macvlan port */ | ||
| 77 | #define IFF_BRIDGE_PORT 0x8000 /* device used as bridge port */ | ||
| 76 | 78 | ||
| 77 | #define IF_GET_IFACE 0x0001 /* for querying only */ | 79 | #define IF_GET_IFACE 0x0001 /* for querying only */ |
| 78 | #define IF_GET_PROTO 0x0002 | 80 | #define IF_GET_PROTO 0x0002 |
diff --git a/include/linux/if_bonding.h b/include/linux/if_bonding.h index cd525fae3c98..2c7994372bde 100644 --- a/include/linux/if_bonding.h +++ b/include/linux/if_bonding.h | |||
| @@ -83,6 +83,7 @@ | |||
| 83 | 83 | ||
| 84 | #define BOND_DEFAULT_MAX_BONDS 1 /* Default maximum number of devices to support */ | 84 | #define BOND_DEFAULT_MAX_BONDS 1 /* Default maximum number of devices to support */ |
| 85 | 85 | ||
| 86 | #define BOND_DEFAULT_TX_QUEUES 16 /* Default number of tx queues per device */ | ||
| 86 | /* hashing types */ | 87 | /* hashing types */ |
| 87 | #define BOND_XMIT_POLICY_LAYER2 0 /* layer 2 (MAC only), default */ | 88 | #define BOND_XMIT_POLICY_LAYER2 0 /* layer 2 (MAC only), default */ |
| 88 | #define BOND_XMIT_POLICY_LAYER34 1 /* layer 3+4 (IP ^ (TCP || UDP)) */ | 89 | #define BOND_XMIT_POLICY_LAYER34 1 /* layer 3+4 (IP ^ (TCP || UDP)) */ |
diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h index 938b7e81df95..0d241a5c4909 100644 --- a/include/linux/if_bridge.h +++ b/include/linux/if_bridge.h | |||
| @@ -102,8 +102,6 @@ struct __fdb_entry { | |||
| 102 | #include <linux/netdevice.h> | 102 | #include <linux/netdevice.h> |
| 103 | 103 | ||
| 104 | extern void brioctl_set(int (*ioctl_hook)(struct net *, unsigned int, void __user *)); | 104 | extern void brioctl_set(int (*ioctl_hook)(struct net *, unsigned int, void __user *)); |
| 105 | extern struct sk_buff *(*br_handle_frame_hook)(struct net_bridge_port *p, | ||
| 106 | struct sk_buff *skb); | ||
| 107 | extern int (*br_should_route_hook)(struct sk_buff *skb); | 105 | extern int (*br_should_route_hook)(struct sk_buff *skb); |
| 108 | 106 | ||
| 109 | #endif | 107 | #endif |
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h index bed7a4682b90..c831467774d0 100644 --- a/include/linux/if_ether.h +++ b/include/linux/if_ether.h | |||
| @@ -119,7 +119,7 @@ struct ethhdr { | |||
| 119 | unsigned char h_dest[ETH_ALEN]; /* destination eth addr */ | 119 | unsigned char h_dest[ETH_ALEN]; /* destination eth addr */ |
| 120 | unsigned char h_source[ETH_ALEN]; /* source ether addr */ | 120 | unsigned char h_source[ETH_ALEN]; /* source ether addr */ |
| 121 | __be16 h_proto; /* packet type ID field */ | 121 | __be16 h_proto; /* packet type ID field */ |
| 122 | } __attribute__((packed)); | 122 | } __packed; |
| 123 | 123 | ||
| 124 | #ifdef __KERNEL__ | 124 | #ifdef __KERNEL__ |
| 125 | #include <linux/skbuff.h> | 125 | #include <linux/skbuff.h> |
diff --git a/include/linux/if_fddi.h b/include/linux/if_fddi.h index 5459c5c09930..9947c39e62f6 100644 --- a/include/linux/if_fddi.h +++ b/include/linux/if_fddi.h | |||
| @@ -67,7 +67,7 @@ struct fddi_8022_1_hdr { | |||
| 67 | __u8 dsap; /* destination service access point */ | 67 | __u8 dsap; /* destination service access point */ |
| 68 | __u8 ssap; /* source service access point */ | 68 | __u8 ssap; /* source service access point */ |
| 69 | __u8 ctrl; /* control byte #1 */ | 69 | __u8 ctrl; /* control byte #1 */ |
| 70 | } __attribute__ ((packed)); | 70 | } __packed; |
| 71 | 71 | ||
| 72 | /* Define 802.2 Type 2 header */ | 72 | /* Define 802.2 Type 2 header */ |
| 73 | struct fddi_8022_2_hdr { | 73 | struct fddi_8022_2_hdr { |
| @@ -75,7 +75,7 @@ struct fddi_8022_2_hdr { | |||
| 75 | __u8 ssap; /* source service access point */ | 75 | __u8 ssap; /* source service access point */ |
| 76 | __u8 ctrl_1; /* control byte #1 */ | 76 | __u8 ctrl_1; /* control byte #1 */ |
| 77 | __u8 ctrl_2; /* control byte #2 */ | 77 | __u8 ctrl_2; /* control byte #2 */ |
| 78 | } __attribute__ ((packed)); | 78 | } __packed; |
| 79 | 79 | ||
| 80 | /* Define 802.2 SNAP header */ | 80 | /* Define 802.2 SNAP header */ |
| 81 | #define FDDI_K_OUI_LEN 3 | 81 | #define FDDI_K_OUI_LEN 3 |
| @@ -85,7 +85,7 @@ struct fddi_snap_hdr { | |||
| 85 | __u8 ctrl; /* always 0x03 */ | 85 | __u8 ctrl; /* always 0x03 */ |
| 86 | __u8 oui[FDDI_K_OUI_LEN]; /* organizational universal id */ | 86 | __u8 oui[FDDI_K_OUI_LEN]; /* organizational universal id */ |
| 87 | __be16 ethertype; /* packet type ID field */ | 87 | __be16 ethertype; /* packet type ID field */ |
| 88 | } __attribute__ ((packed)); | 88 | } __packed; |
| 89 | 89 | ||
| 90 | /* Define FDDI LLC frame header */ | 90 | /* Define FDDI LLC frame header */ |
| 91 | struct fddihdr { | 91 | struct fddihdr { |
| @@ -98,7 +98,7 @@ struct fddihdr { | |||
| 98 | struct fddi_8022_2_hdr llc_8022_2; | 98 | struct fddi_8022_2_hdr llc_8022_2; |
| 99 | struct fddi_snap_hdr llc_snap; | 99 | struct fddi_snap_hdr llc_snap; |
| 100 | } hdr; | 100 | } hdr; |
| 101 | } __attribute__ ((packed)); | 101 | } __packed; |
| 102 | 102 | ||
| 103 | #ifdef __KERNEL__ | 103 | #ifdef __KERNEL__ |
| 104 | #include <linux/netdevice.h> | 104 | #include <linux/netdevice.h> |
diff --git a/include/linux/if_frad.h b/include/linux/if_frad.h index 80b3a1056a5f..191ee0869bc1 100644 --- a/include/linux/if_frad.h +++ b/include/linux/if_frad.h | |||
| @@ -135,7 +135,7 @@ struct frhdr | |||
| 135 | __be16 PID; | 135 | __be16 PID; |
| 136 | 136 | ||
| 137 | #define IP_NLPID pad | 137 | #define IP_NLPID pad |
| 138 | } __attribute__((packed)); | 138 | } __packed; |
| 139 | 139 | ||
| 140 | /* see RFC 1490 for the definition of the following */ | 140 | /* see RFC 1490 for the definition of the following */ |
| 141 | #define FRAD_I_UI 0x03 | 141 | #define FRAD_I_UI 0x03 |
diff --git a/include/linux/if_hippi.h b/include/linux/if_hippi.h index 8d038eb8db5c..5fe5f307c6f5 100644 --- a/include/linux/if_hippi.h +++ b/include/linux/if_hippi.h | |||
| @@ -104,7 +104,7 @@ struct hippi_fp_hdr { | |||
| 104 | __be32 fixed; | 104 | __be32 fixed; |
| 105 | #endif | 105 | #endif |
| 106 | __be32 d2_size; | 106 | __be32 d2_size; |
| 107 | } __attribute__ ((packed)); | 107 | } __packed; |
| 108 | 108 | ||
| 109 | struct hippi_le_hdr { | 109 | struct hippi_le_hdr { |
| 110 | #if defined (__BIG_ENDIAN_BITFIELD) | 110 | #if defined (__BIG_ENDIAN_BITFIELD) |
| @@ -129,7 +129,7 @@ struct hippi_le_hdr { | |||
| 129 | __u8 daddr[HIPPI_ALEN]; | 129 | __u8 daddr[HIPPI_ALEN]; |
| 130 | __u16 locally_administered; | 130 | __u16 locally_administered; |
| 131 | __u8 saddr[HIPPI_ALEN]; | 131 | __u8 saddr[HIPPI_ALEN]; |
| 132 | } __attribute__ ((packed)); | 132 | } __packed; |
| 133 | 133 | ||
| 134 | #define HIPPI_OUI_LEN 3 | 134 | #define HIPPI_OUI_LEN 3 |
| 135 | /* | 135 | /* |
| @@ -142,12 +142,12 @@ struct hippi_snap_hdr { | |||
| 142 | __u8 ctrl; /* always 0x03 */ | 142 | __u8 ctrl; /* always 0x03 */ |
| 143 | __u8 oui[HIPPI_OUI_LEN]; /* organizational universal id (zero)*/ | 143 | __u8 oui[HIPPI_OUI_LEN]; /* organizational universal id (zero)*/ |
| 144 | __be16 ethertype; /* packet type ID field */ | 144 | __be16 ethertype; /* packet type ID field */ |
| 145 | } __attribute__ ((packed)); | 145 | } __packed; |
| 146 | 146 | ||
| 147 | struct hippi_hdr { | 147 | struct hippi_hdr { |
| 148 | struct hippi_fp_hdr fp; | 148 | struct hippi_fp_hdr fp; |
| 149 | struct hippi_le_hdr le; | 149 | struct hippi_le_hdr le; |
| 150 | struct hippi_snap_hdr snap; | 150 | struct hippi_snap_hdr snap; |
| 151 | } __attribute__ ((packed)); | 151 | } __packed; |
| 152 | 152 | ||
| 153 | #endif /* _LINUX_IF_HIPPI_H */ | 153 | #endif /* _LINUX_IF_HIPPI_H */ |
diff --git a/include/linux/if_link.h b/include/linux/if_link.h index 85c812db5a3f..2fc66dd783ee 100644 --- a/include/linux/if_link.h +++ b/include/linux/if_link.h | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 5 | #include <linux/netlink.h> | 5 | #include <linux/netlink.h> |
| 6 | 6 | ||
| 7 | /* The struct should be in sync with struct net_device_stats */ | 7 | /* This struct should be in sync with struct rtnl_link_stats64 */ |
| 8 | struct rtnl_link_stats { | 8 | struct rtnl_link_stats { |
| 9 | __u32 rx_packets; /* total packets received */ | 9 | __u32 rx_packets; /* total packets received */ |
| 10 | __u32 tx_packets; /* total packets transmitted */ | 10 | __u32 tx_packets; /* total packets transmitted */ |
| @@ -37,6 +37,7 @@ struct rtnl_link_stats { | |||
| 37 | __u32 tx_compressed; | 37 | __u32 tx_compressed; |
| 38 | }; | 38 | }; |
| 39 | 39 | ||
| 40 | /* The main device statistics structure */ | ||
| 40 | struct rtnl_link_stats64 { | 41 | struct rtnl_link_stats64 { |
| 41 | __u64 rx_packets; /* total packets received */ | 42 | __u64 rx_packets; /* total packets received */ |
| 42 | __u64 tx_packets; /* total packets transmitted */ | 43 | __u64 tx_packets; /* total packets transmitted */ |
| @@ -233,7 +234,7 @@ enum macvlan_mode { | |||
| 233 | MACVLAN_MODE_BRIDGE = 4, /* talk to bridge ports directly */ | 234 | MACVLAN_MODE_BRIDGE = 4, /* talk to bridge ports directly */ |
| 234 | }; | 235 | }; |
| 235 | 236 | ||
| 236 | /* SR-IOV virtual function managment section */ | 237 | /* SR-IOV virtual function management section */ |
| 237 | 238 | ||
| 238 | enum { | 239 | enum { |
| 239 | IFLA_VF_INFO_UNSPEC, | 240 | IFLA_VF_INFO_UNSPEC, |
diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h index 9ea047aca795..35280b302290 100644 --- a/include/linux/if_macvlan.h +++ b/include/linux/if_macvlan.h | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | #include <linux/netdevice.h> | 6 | #include <linux/netdevice.h> |
| 7 | #include <linux/netlink.h> | 7 | #include <linux/netlink.h> |
| 8 | #include <net/netlink.h> | 8 | #include <net/netlink.h> |
| 9 | #include <linux/u64_stats_sync.h> | ||
| 9 | 10 | ||
| 10 | #if defined(CONFIG_MACVTAP) || defined(CONFIG_MACVTAP_MODULE) | 11 | #if defined(CONFIG_MACVTAP) || defined(CONFIG_MACVTAP_MODULE) |
| 11 | struct socket *macvtap_get_socket(struct file *); | 12 | struct socket *macvtap_get_socket(struct file *); |
| @@ -27,14 +28,16 @@ struct macvtap_queue; | |||
| 27 | * struct macvlan_rx_stats - MACVLAN percpu rx stats | 28 | * struct macvlan_rx_stats - MACVLAN percpu rx stats |
| 28 | * @rx_packets: number of received packets | 29 | * @rx_packets: number of received packets |
| 29 | * @rx_bytes: number of received bytes | 30 | * @rx_bytes: number of received bytes |
| 30 | * @multicast: number of received multicast packets | 31 | * @rx_multicast: number of received multicast packets |
| 32 | * @syncp: synchronization point for 64bit counters | ||
| 31 | * @rx_errors: number of errors | 33 | * @rx_errors: number of errors |
| 32 | */ | 34 | */ |
| 33 | struct macvlan_rx_stats { | 35 | struct macvlan_rx_stats { |
| 34 | unsigned long rx_packets; | 36 | u64 rx_packets; |
| 35 | unsigned long rx_bytes; | 37 | u64 rx_bytes; |
| 36 | unsigned long multicast; | 38 | u64 rx_multicast; |
| 37 | unsigned long rx_errors; | 39 | struct u64_stats_sync syncp; |
| 40 | unsigned long rx_errors; | ||
| 38 | }; | 41 | }; |
| 39 | 42 | ||
| 40 | struct macvlan_dev { | 43 | struct macvlan_dev { |
| @@ -56,17 +59,21 @@ static inline void macvlan_count_rx(const struct macvlan_dev *vlan, | |||
| 56 | { | 59 | { |
| 57 | struct macvlan_rx_stats *rx_stats; | 60 | struct macvlan_rx_stats *rx_stats; |
| 58 | 61 | ||
| 59 | rx_stats = per_cpu_ptr(vlan->rx_stats, smp_processor_id()); | 62 | rx_stats = this_cpu_ptr(vlan->rx_stats); |
| 60 | if (likely(success)) { | 63 | if (likely(success)) { |
| 64 | u64_stats_update_begin(&rx_stats->syncp); | ||
| 61 | rx_stats->rx_packets++;; | 65 | rx_stats->rx_packets++;; |
| 62 | rx_stats->rx_bytes += len; | 66 | rx_stats->rx_bytes += len; |
| 63 | if (multicast) | 67 | if (multicast) |
| 64 | rx_stats->multicast++; | 68 | rx_stats->rx_multicast++; |
| 69 | u64_stats_update_end(&rx_stats->syncp); | ||
| 65 | } else { | 70 | } else { |
| 66 | rx_stats->rx_errors++; | 71 | rx_stats->rx_errors++; |
| 67 | } | 72 | } |
| 68 | } | 73 | } |
| 69 | 74 | ||
| 75 | extern void macvlan_common_setup(struct net_device *dev); | ||
| 76 | |||
| 70 | extern int macvlan_common_newlink(struct net *src_net, struct net_device *dev, | 77 | extern int macvlan_common_newlink(struct net *src_net, struct net_device *dev, |
| 71 | struct nlattr *tb[], struct nlattr *data[], | 78 | struct nlattr *tb[], struct nlattr *data[], |
| 72 | int (*receive)(struct sk_buff *skb), | 79 | int (*receive)(struct sk_buff *skb), |
| @@ -84,8 +91,4 @@ extern int macvlan_link_register(struct rtnl_link_ops *ops); | |||
| 84 | extern netdev_tx_t macvlan_start_xmit(struct sk_buff *skb, | 91 | extern netdev_tx_t macvlan_start_xmit(struct sk_buff *skb, |
| 85 | struct net_device *dev); | 92 | struct net_device *dev); |
| 86 | 93 | ||
| 87 | |||
| 88 | extern struct sk_buff *(*macvlan_handle_frame_hook)(struct macvlan_port *, | ||
| 89 | struct sk_buff *); | ||
| 90 | |||
| 91 | #endif /* _LINUX_IF_MACVLAN_H */ | 94 | #endif /* _LINUX_IF_MACVLAN_H */ |
diff --git a/include/linux/if_packet.h b/include/linux/if_packet.h index 6ac23ef1801a..72bfa5a034dd 100644 --- a/include/linux/if_packet.h +++ b/include/linux/if_packet.h | |||
| @@ -48,6 +48,7 @@ struct sockaddr_ll { | |||
| 48 | #define PACKET_LOSS 14 | 48 | #define PACKET_LOSS 14 |
| 49 | #define PACKET_VNET_HDR 15 | 49 | #define PACKET_VNET_HDR 15 |
| 50 | #define PACKET_TX_TIMESTAMP 16 | 50 | #define PACKET_TX_TIMESTAMP 16 |
| 51 | #define PACKET_TIMESTAMP 17 | ||
| 51 | 52 | ||
| 52 | struct tpacket_stats { | 53 | struct tpacket_stats { |
| 53 | unsigned int tp_packets; | 54 | unsigned int tp_packets; |
diff --git a/include/linux/if_pppox.h b/include/linux/if_pppox.h index a6577af0c4e6..1925e0c3f162 100644 --- a/include/linux/if_pppox.h +++ b/include/linux/if_pppox.h | |||
| @@ -59,7 +59,7 @@ struct sockaddr_pppox { | |||
| 59 | union{ | 59 | union{ |
| 60 | struct pppoe_addr pppoe; | 60 | struct pppoe_addr pppoe; |
| 61 | }sa_addr; | 61 | }sa_addr; |
| 62 | }__attribute__ ((packed)); | 62 | } __packed; |
| 63 | 63 | ||
| 64 | /* The use of the above union isn't viable because the size of this | 64 | /* The use of the above union isn't viable because the size of this |
| 65 | * struct must stay fixed over time -- applications use sizeof(struct | 65 | * struct must stay fixed over time -- applications use sizeof(struct |
| @@ -70,7 +70,7 @@ struct sockaddr_pppol2tp { | |||
| 70 | sa_family_t sa_family; /* address family, AF_PPPOX */ | 70 | sa_family_t sa_family; /* address family, AF_PPPOX */ |
| 71 | unsigned int sa_protocol; /* protocol identifier */ | 71 | unsigned int sa_protocol; /* protocol identifier */ |
| 72 | struct pppol2tp_addr pppol2tp; | 72 | struct pppol2tp_addr pppol2tp; |
| 73 | }__attribute__ ((packed)); | 73 | } __packed; |
| 74 | 74 | ||
| 75 | /* The L2TPv3 protocol changes tunnel and session ids from 16 to 32 | 75 | /* The L2TPv3 protocol changes tunnel and session ids from 16 to 32 |
| 76 | * bits. So we need a different sockaddr structure. | 76 | * bits. So we need a different sockaddr structure. |
| @@ -79,7 +79,7 @@ struct sockaddr_pppol2tpv3 { | |||
| 79 | sa_family_t sa_family; /* address family, AF_PPPOX */ | 79 | sa_family_t sa_family; /* address family, AF_PPPOX */ |
| 80 | unsigned int sa_protocol; /* protocol identifier */ | 80 | unsigned int sa_protocol; /* protocol identifier */ |
| 81 | struct pppol2tpv3_addr pppol2tp; | 81 | struct pppol2tpv3_addr pppol2tp; |
| 82 | } __attribute__ ((packed)); | 82 | } __packed; |
| 83 | 83 | ||
| 84 | /********************************************************************* | 84 | /********************************************************************* |
| 85 | * | 85 | * |
| @@ -129,7 +129,7 @@ struct pppoe_hdr { | |||
| 129 | __be16 sid; | 129 | __be16 sid; |
| 130 | __be16 length; | 130 | __be16 length; |
| 131 | struct pppoe_tag tag[0]; | 131 | struct pppoe_tag tag[0]; |
| 132 | } __attribute__ ((packed)); | 132 | } __packed; |
| 133 | 133 | ||
| 134 | /* Length of entire PPPoE + PPP header */ | 134 | /* Length of entire PPPoE + PPP header */ |
| 135 | #define PPPOE_SES_HLEN 8 | 135 | #define PPPOE_SES_HLEN 8 |
diff --git a/include/linux/in.h b/include/linux/in.h index 583c76f9c30f..41d88a4689af 100644 --- a/include/linux/in.h +++ b/include/linux/in.h | |||
| @@ -85,6 +85,7 @@ struct in_addr { | |||
| 85 | #define IP_RECVORIGDSTADDR IP_ORIGDSTADDR | 85 | #define IP_RECVORIGDSTADDR IP_ORIGDSTADDR |
| 86 | 86 | ||
| 87 | #define IP_MINTTL 21 | 87 | #define IP_MINTTL 21 |
| 88 | #define IP_NODEFRAG 22 | ||
| 88 | 89 | ||
| 89 | /* IP_MTU_DISCOVER values */ | 90 | /* IP_MTU_DISCOVER values */ |
| 90 | #define IP_PMTUDISC_DONT 0 /* Never send DF frames */ | 91 | #define IP_PMTUDISC_DONT 0 /* Never send DF frames */ |
diff --git a/include/linux/input.h b/include/linux/input.h index 6fcc9101beeb..339d043ccb53 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
| @@ -691,9 +691,12 @@ struct input_absinfo { | |||
| 691 | #define ABS_TILT_X 0x1a | 691 | #define ABS_TILT_X 0x1a |
| 692 | #define ABS_TILT_Y 0x1b | 692 | #define ABS_TILT_Y 0x1b |
| 693 | #define ABS_TOOL_WIDTH 0x1c | 693 | #define ABS_TOOL_WIDTH 0x1c |
| 694 | |||
| 694 | #define ABS_VOLUME 0x20 | 695 | #define ABS_VOLUME 0x20 |
| 696 | |||
| 695 | #define ABS_MISC 0x28 | 697 | #define ABS_MISC 0x28 |
| 696 | 698 | ||
| 699 | #define ABS_MT_SLOT 0x2f /* MT slot being modified */ | ||
| 697 | #define ABS_MT_TOUCH_MAJOR 0x30 /* Major axis of touching ellipse */ | 700 | #define ABS_MT_TOUCH_MAJOR 0x30 /* Major axis of touching ellipse */ |
| 698 | #define ABS_MT_TOUCH_MINOR 0x31 /* Minor axis (omit if circular) */ | 701 | #define ABS_MT_TOUCH_MINOR 0x31 /* Minor axis (omit if circular) */ |
| 699 | #define ABS_MT_WIDTH_MAJOR 0x32 /* Major axis of approaching ellipse */ | 702 | #define ABS_MT_WIDTH_MAJOR 0x32 /* Major axis of approaching ellipse */ |
| @@ -706,6 +709,12 @@ struct input_absinfo { | |||
| 706 | #define ABS_MT_TRACKING_ID 0x39 /* Unique ID of initiated contact */ | 709 | #define ABS_MT_TRACKING_ID 0x39 /* Unique ID of initiated contact */ |
| 707 | #define ABS_MT_PRESSURE 0x3a /* Pressure on contact area */ | 710 | #define ABS_MT_PRESSURE 0x3a /* Pressure on contact area */ |
| 708 | 711 | ||
| 712 | #ifdef __KERNEL__ | ||
| 713 | /* Implementation details, userspace should not care about these */ | ||
| 714 | #define ABS_MT_FIRST ABS_MT_TOUCH_MAJOR | ||
| 715 | #define ABS_MT_LAST ABS_MT_PRESSURE | ||
| 716 | #endif | ||
| 717 | |||
| 709 | #define ABS_MAX 0x3f | 718 | #define ABS_MAX 0x3f |
| 710 | #define ABS_CNT (ABS_MAX+1) | 719 | #define ABS_CNT (ABS_MAX+1) |
| 711 | 720 | ||
| @@ -1048,6 +1057,14 @@ struct ff_effect { | |||
| 1048 | #include <linux/mod_devicetable.h> | 1057 | #include <linux/mod_devicetable.h> |
| 1049 | 1058 | ||
| 1050 | /** | 1059 | /** |
| 1060 | * struct input_mt_slot - represents the state of an input MT slot | ||
| 1061 | * @abs: holds current values of ABS_MT axes for this slot | ||
| 1062 | */ | ||
| 1063 | struct input_mt_slot { | ||
| 1064 | int abs[ABS_MT_LAST - ABS_MT_FIRST + 1]; | ||
| 1065 | }; | ||
| 1066 | |||
| 1067 | /** | ||
| 1051 | * struct input_dev - represents an input device | 1068 | * struct input_dev - represents an input device |
| 1052 | * @name: name of the device | 1069 | * @name: name of the device |
| 1053 | * @phys: physical path to the device in the system hierarchy | 1070 | * @phys: physical path to the device in the system hierarchy |
| @@ -1063,6 +1080,10 @@ struct ff_effect { | |||
| 1063 | * @sndbit: bitmap of sound effects supported by the device | 1080 | * @sndbit: bitmap of sound effects supported by the device |
| 1064 | * @ffbit: bitmap of force feedback effects supported by the device | 1081 | * @ffbit: bitmap of force feedback effects supported by the device |
| 1065 | * @swbit: bitmap of switches present on the device | 1082 | * @swbit: bitmap of switches present on the device |
| 1083 | * @hint_events_per_packet: average number of events generated by the | ||
| 1084 | * device in a packet (between EV_SYN/SYN_REPORT events). Used by | ||
| 1085 | * event handlers to estimate size of the buffer needed to hold | ||
| 1086 | * events. | ||
| 1066 | * @keycodemax: size of keycode table | 1087 | * @keycodemax: size of keycode table |
| 1067 | * @keycodesize: size of elements in keycode table | 1088 | * @keycodesize: size of elements in keycode table |
| 1068 | * @keycode: map of scancodes to keycodes for this device | 1089 | * @keycode: map of scancodes to keycodes for this device |
| @@ -1078,9 +1099,12 @@ struct ff_effect { | |||
| 1078 | * @repeat_key: stores key code of the last key pressed; used to implement | 1099 | * @repeat_key: stores key code of the last key pressed; used to implement |
| 1079 | * software autorepeat | 1100 | * software autorepeat |
| 1080 | * @timer: timer for software autorepeat | 1101 | * @timer: timer for software autorepeat |
| 1081 | * @sync: set to 1 when there were no new events since last EV_SYNC | ||
| 1082 | * @abs: current values for reports from absolute axes | 1102 | * @abs: current values for reports from absolute axes |
| 1083 | * @rep: current values for autorepeat parameters (delay, rate) | 1103 | * @rep: current values for autorepeat parameters (delay, rate) |
| 1104 | * @mt: pointer to array of struct input_mt_slot holding current values | ||
| 1105 | * of tracked contacts | ||
| 1106 | * @mtsize: number of MT slots the device uses | ||
| 1107 | * @slot: MT slot currently being transmitted | ||
| 1084 | * @key: reflects current state of device's keys/buttons | 1108 | * @key: reflects current state of device's keys/buttons |
| 1085 | * @led: reflects current state of device's LEDs | 1109 | * @led: reflects current state of device's LEDs |
| 1086 | * @snd: reflects current state of sound effects | 1110 | * @snd: reflects current state of sound effects |
| @@ -1119,6 +1143,7 @@ struct ff_effect { | |||
| 1119 | * last user closes the device | 1143 | * last user closes the device |
| 1120 | * @going_away: marks devices that are in a middle of unregistering and | 1144 | * @going_away: marks devices that are in a middle of unregistering and |
| 1121 | * causes input_open_device*() fail with -ENODEV. | 1145 | * causes input_open_device*() fail with -ENODEV. |
| 1146 | * @sync: set to %true when there were no new events since last EV_SYN | ||
| 1122 | * @dev: driver model's view of this device | 1147 | * @dev: driver model's view of this device |
| 1123 | * @h_list: list of input handles associated with the device. When | 1148 | * @h_list: list of input handles associated with the device. When |
| 1124 | * accessing the list dev->mutex must be held | 1149 | * accessing the list dev->mutex must be held |
| @@ -1140,6 +1165,8 @@ struct input_dev { | |||
| 1140 | unsigned long ffbit[BITS_TO_LONGS(FF_CNT)]; | 1165 | unsigned long ffbit[BITS_TO_LONGS(FF_CNT)]; |
| 1141 | unsigned long swbit[BITS_TO_LONGS(SW_CNT)]; | 1166 | unsigned long swbit[BITS_TO_LONGS(SW_CNT)]; |
| 1142 | 1167 | ||
| 1168 | unsigned int hint_events_per_packet; | ||
| 1169 | |||
| 1143 | unsigned int keycodemax; | 1170 | unsigned int keycodemax; |
| 1144 | unsigned int keycodesize; | 1171 | unsigned int keycodesize; |
| 1145 | void *keycode; | 1172 | void *keycode; |
| @@ -1153,11 +1180,13 @@ struct input_dev { | |||
| 1153 | unsigned int repeat_key; | 1180 | unsigned int repeat_key; |
| 1154 | struct timer_list timer; | 1181 | struct timer_list timer; |
| 1155 | 1182 | ||
| 1156 | int sync; | ||
| 1157 | |||
| 1158 | int abs[ABS_CNT]; | 1183 | int abs[ABS_CNT]; |
| 1159 | int rep[REP_MAX + 1]; | 1184 | int rep[REP_MAX + 1]; |
| 1160 | 1185 | ||
| 1186 | struct input_mt_slot *mt; | ||
| 1187 | int mtsize; | ||
| 1188 | int slot; | ||
| 1189 | |||
| 1161 | unsigned long key[BITS_TO_LONGS(KEY_CNT)]; | 1190 | unsigned long key[BITS_TO_LONGS(KEY_CNT)]; |
| 1162 | unsigned long led[BITS_TO_LONGS(LED_CNT)]; | 1191 | unsigned long led[BITS_TO_LONGS(LED_CNT)]; |
| 1163 | unsigned long snd[BITS_TO_LONGS(SND_CNT)]; | 1192 | unsigned long snd[BITS_TO_LONGS(SND_CNT)]; |
| @@ -1182,6 +1211,8 @@ struct input_dev { | |||
| 1182 | unsigned int users; | 1211 | unsigned int users; |
| 1183 | bool going_away; | 1212 | bool going_away; |
| 1184 | 1213 | ||
| 1214 | bool sync; | ||
| 1215 | |||
| 1185 | struct device dev; | 1216 | struct device dev; |
| 1186 | 1217 | ||
| 1187 | struct list_head h_list; | 1218 | struct list_head h_list; |
| @@ -1406,8 +1437,28 @@ static inline void input_mt_sync(struct input_dev *dev) | |||
| 1406 | input_event(dev, EV_SYN, SYN_MT_REPORT, 0); | 1437 | input_event(dev, EV_SYN, SYN_MT_REPORT, 0); |
| 1407 | } | 1438 | } |
| 1408 | 1439 | ||
| 1440 | static inline void input_mt_slot(struct input_dev *dev, int slot) | ||
| 1441 | { | ||
| 1442 | input_event(dev, EV_ABS, ABS_MT_SLOT, slot); | ||
| 1443 | } | ||
| 1444 | |||
| 1409 | void input_set_capability(struct input_dev *dev, unsigned int type, unsigned int code); | 1445 | void input_set_capability(struct input_dev *dev, unsigned int type, unsigned int code); |
| 1410 | 1446 | ||
| 1447 | /** | ||
| 1448 | * input_set_events_per_packet - tell handlers about the driver event rate | ||
| 1449 | * @dev: the input device used by the driver | ||
| 1450 | * @n_events: the average number of events between calls to input_sync() | ||
| 1451 | * | ||
| 1452 | * If the event rate sent from a device is unusually large, use this | ||
| 1453 | * function to set the expected event rate. This will allow handlers | ||
| 1454 | * to set up an appropriate buffer size for the event stream, in order | ||
| 1455 | * to minimize information loss. | ||
| 1456 | */ | ||
| 1457 | static inline void input_set_events_per_packet(struct input_dev *dev, int n_events) | ||
| 1458 | { | ||
| 1459 | dev->hint_events_per_packet = n_events; | ||
| 1460 | } | ||
| 1461 | |||
| 1411 | static inline void input_set_abs_params(struct input_dev *dev, int axis, int min, int max, int fuzz, int flat) | 1462 | static inline void input_set_abs_params(struct input_dev *dev, int axis, int min, int max, int fuzz, int flat) |
| 1412 | { | 1463 | { |
| 1413 | dev->absmin[axis] = min; | 1464 | dev->absmin[axis] = min; |
| @@ -1485,5 +1536,8 @@ int input_ff_erase(struct input_dev *dev, int effect_id, struct file *file); | |||
| 1485 | int input_ff_create_memless(struct input_dev *dev, void *data, | 1536 | int input_ff_create_memless(struct input_dev *dev, void *data, |
| 1486 | int (*play_effect)(struct input_dev *, void *, struct ff_effect *)); | 1537 | int (*play_effect)(struct input_dev *, void *, struct ff_effect *)); |
| 1487 | 1538 | ||
| 1539 | int input_mt_create_slots(struct input_dev *dev, unsigned int num_slots); | ||
| 1540 | void input_mt_destroy_slots(struct input_dev *dev); | ||
| 1541 | |||
| 1488 | #endif | 1542 | #endif |
| 1489 | #endif | 1543 | #endif |
diff --git a/include/linux/input/adxl34x.h b/include/linux/input/adxl34x.h new file mode 100644 index 000000000000..df00d998a44a --- /dev/null +++ b/include/linux/input/adxl34x.h | |||
| @@ -0,0 +1,349 @@ | |||
| 1 | /* | ||
| 2 | * include/linux/input/adxl34x.h | ||
| 3 | * | ||
| 4 | * Digital Accelerometer characteristics are highly application specific | ||
| 5 | * and may vary between boards and models. The platform_data for the | ||
| 6 | * device's "struct device" holds this information. | ||
| 7 | * | ||
| 8 | * Copyright 2009 Analog Devices Inc. | ||
| 9 | * | ||
| 10 | * Licensed under the GPL-2 or later. | ||
| 11 | */ | ||
| 12 | |||
| 13 | #ifndef __LINUX_INPUT_ADXL34X_H__ | ||
| 14 | #define __LINUX_INPUT_ADXL34X_H__ | ||
| 15 | |||
| 16 | struct adxl34x_platform_data { | ||
| 17 | |||
| 18 | /* | ||
| 19 | * X,Y,Z Axis Offset: | ||
| 20 | * offer user offset adjustments in twoscompliment | ||
| 21 | * form with a scale factor of 15.6 mg/LSB (i.e. 0x7F = +2 g) | ||
| 22 | */ | ||
| 23 | |||
| 24 | s8 x_axis_offset; | ||
| 25 | s8 y_axis_offset; | ||
| 26 | s8 z_axis_offset; | ||
| 27 | |||
| 28 | /* | ||
| 29 | * TAP_X/Y/Z Enable: Setting TAP_X, Y, or Z Enable enables X, | ||
| 30 | * Y, or Z participation in Tap detection. A '0' excludes the | ||
| 31 | * selected axis from participation in Tap detection. | ||
| 32 | * Setting the SUPPRESS bit suppresses Double Tap detection if | ||
| 33 | * acceleration greater than tap_threshold is present between | ||
| 34 | * taps. | ||
| 35 | */ | ||
| 36 | |||
| 37 | #define ADXL_SUPPRESS (1 << 3) | ||
| 38 | #define ADXL_TAP_X_EN (1 << 2) | ||
| 39 | #define ADXL_TAP_Y_EN (1 << 1) | ||
| 40 | #define ADXL_TAP_Z_EN (1 << 0) | ||
| 41 | |||
| 42 | u8 tap_axis_control; | ||
| 43 | |||
| 44 | /* | ||
| 45 | * tap_threshold: | ||
| 46 | * holds the threshold value for tap detection/interrupts. | ||
| 47 | * The data format is unsigned. The scale factor is 62.5 mg/LSB | ||
| 48 | * (i.e. 0xFF = +16 g). A zero value may result in undesirable | ||
| 49 | * behavior if Tap/Double Tap is enabled. | ||
| 50 | */ | ||
| 51 | |||
| 52 | u8 tap_threshold; | ||
| 53 | |||
| 54 | /* | ||
| 55 | * tap_duration: | ||
| 56 | * is an unsigned time value representing the maximum | ||
| 57 | * time that an event must be above the tap_threshold threshold | ||
| 58 | * to qualify as a tap event. The scale factor is 625 us/LSB. A zero | ||
| 59 | * value will prevent Tap/Double Tap functions from working. | ||
| 60 | */ | ||
| 61 | |||
| 62 | u8 tap_duration; | ||
| 63 | |||
| 64 | /* | ||
| 65 | * tap_latency: | ||
| 66 | * is an unsigned time value representing the wait time | ||
| 67 | * from the detection of a tap event to the opening of the time | ||
| 68 | * window tap_window for a possible second tap event. The scale | ||
| 69 | * factor is 1.25 ms/LSB. A zero value will disable the Double Tap | ||
| 70 | * function. | ||
| 71 | */ | ||
| 72 | |||
| 73 | u8 tap_latency; | ||
| 74 | |||
| 75 | /* | ||
| 76 | * tap_window: | ||
| 77 | * is an unsigned time value representing the amount | ||
| 78 | * of time after the expiration of tap_latency during which a second | ||
| 79 | * tap can begin. The scale factor is 1.25 ms/LSB. A zero value will | ||
| 80 | * disable the Double Tap function. | ||
| 81 | */ | ||
| 82 | |||
| 83 | u8 tap_window; | ||
| 84 | |||
| 85 | /* | ||
| 86 | * act_axis_control: | ||
| 87 | * X/Y/Z Enable: A '1' enables X, Y, or Z participation in activity | ||
| 88 | * or inactivity detection. A '0' excludes the selected axis from | ||
| 89 | * participation. If all of the axes are excluded, the function is | ||
| 90 | * disabled. | ||
| 91 | * AC/DC: A '0' = DC coupled operation and a '1' = AC coupled | ||
| 92 | * operation. In DC coupled operation, the current acceleration is | ||
| 93 | * compared with activity_threshold and inactivity_threshold directly | ||
| 94 | * to determine whether activity or inactivity is detected. In AC | ||
| 95 | * coupled operation for activity detection, the acceleration value | ||
| 96 | * at the start of activity detection is taken as a reference value. | ||
| 97 | * New samples of acceleration are then compared to this | ||
| 98 | * reference value and if the magnitude of the difference exceeds | ||
| 99 | * activity_threshold the device will trigger an activity interrupt. In | ||
| 100 | * AC coupled operation for inactivity detection, a reference value | ||
| 101 | * is used again for comparison and is updated whenever the | ||
| 102 | * device exceeds the inactivity threshold. Once the reference | ||
| 103 | * value is selected, the device compares the magnitude of the | ||
| 104 | * difference between the reference value and the current | ||
| 105 | * acceleration with inactivity_threshold. If the difference is below | ||
| 106 | * inactivity_threshold for a total of inactivity_time, the device is | ||
| 107 | * considered inactive and the inactivity interrupt is triggered. | ||
| 108 | */ | ||
| 109 | |||
| 110 | #define ADXL_ACT_ACDC (1 << 7) | ||
| 111 | #define ADXL_ACT_X_EN (1 << 6) | ||
| 112 | #define ADXL_ACT_Y_EN (1 << 5) | ||
| 113 | #define ADXL_ACT_Z_EN (1 << 4) | ||
| 114 | #define ADXL_INACT_ACDC (1 << 3) | ||
| 115 | #define ADXL_INACT_X_EN (1 << 2) | ||
| 116 | #define ADXL_INACT_Y_EN (1 << 1) | ||
| 117 | #define ADXL_INACT_Z_EN (1 << 0) | ||
| 118 | |||
| 119 | u8 act_axis_control; | ||
| 120 | |||
| 121 | /* | ||
| 122 | * activity_threshold: | ||
| 123 | * holds the threshold value for activity detection. | ||
| 124 | * The data format is unsigned. The scale factor is | ||
| 125 | * 62.5 mg/LSB. A zero value may result in undesirable behavior if | ||
| 126 | * Activity interrupt is enabled. | ||
| 127 | */ | ||
| 128 | |||
| 129 | u8 activity_threshold; | ||
| 130 | |||
| 131 | /* | ||
| 132 | * inactivity_threshold: | ||
| 133 | * holds the threshold value for inactivity | ||
| 134 | * detection. The data format is unsigned. The scale | ||
| 135 | * factor is 62.5 mg/LSB. A zero value may result in undesirable | ||
| 136 | * behavior if Inactivity interrupt is enabled. | ||
| 137 | */ | ||
| 138 | |||
| 139 | u8 inactivity_threshold; | ||
| 140 | |||
| 141 | /* | ||
| 142 | * inactivity_time: | ||
| 143 | * is an unsigned time value representing the | ||
| 144 | * amount of time that acceleration must be below the value in | ||
| 145 | * inactivity_threshold for inactivity to be declared. The scale factor | ||
| 146 | * is 1 second/LSB. Unlike the other interrupt functions, which | ||
| 147 | * operate on unfiltered data, the inactivity function operates on the | ||
| 148 | * filtered output data. At least one output sample must be | ||
| 149 | * generated for the inactivity interrupt to be triggered. This will | ||
| 150 | * result in the function appearing un-responsive if the | ||
| 151 | * inactivity_time register is set with a value less than the time | ||
| 152 | * constant of the Output Data Rate. A zero value will result in an | ||
| 153 | * interrupt when the output data is below inactivity_threshold. | ||
| 154 | */ | ||
| 155 | |||
| 156 | u8 inactivity_time; | ||
| 157 | |||
| 158 | /* | ||
| 159 | * free_fall_threshold: | ||
| 160 | * holds the threshold value for Free-Fall detection. | ||
| 161 | * The data format is unsigned. The root-sum-square(RSS) value | ||
| 162 | * of all axes is calculated and compared to the value in | ||
| 163 | * free_fall_threshold to determine if a free fall event may be | ||
| 164 | * occurring. The scale factor is 62.5 mg/LSB. A zero value may | ||
| 165 | * result in undesirable behavior if Free-Fall interrupt is | ||
| 166 | * enabled. Values between 300 and 600 mg (0x05 to 0x09) are | ||
| 167 | * recommended. | ||
| 168 | */ | ||
| 169 | |||
| 170 | u8 free_fall_threshold; | ||
| 171 | |||
| 172 | /* | ||
| 173 | * free_fall_time: | ||
| 174 | * is an unsigned time value representing the minimum | ||
| 175 | * time that the RSS value of all axes must be less than | ||
| 176 | * free_fall_threshold to generate a Free-Fall interrupt. The | ||
| 177 | * scale factor is 5 ms/LSB. A zero value may result in | ||
| 178 | * undesirable behavior if Free-Fall interrupt is enabled. | ||
| 179 | * Values between 100 to 350 ms (0x14 to 0x46) are recommended. | ||
| 180 | */ | ||
| 181 | |||
| 182 | u8 free_fall_time; | ||
| 183 | |||
| 184 | /* | ||
| 185 | * data_rate: | ||
| 186 | * Selects device bandwidth and output data rate. | ||
| 187 | * RATE = 3200 Hz / (2^(15 - x)). Default value is 0x0A, or 100 Hz | ||
| 188 | * Output Data Rate. An Output Data Rate should be selected that | ||
| 189 | * is appropriate for the communication protocol and frequency | ||
| 190 | * selected. Selecting too high of an Output Data Rate with a low | ||
| 191 | * communication speed will result in samples being discarded. | ||
| 192 | */ | ||
| 193 | |||
| 194 | u8 data_rate; | ||
| 195 | |||
| 196 | /* | ||
| 197 | * data_range: | ||
| 198 | * FULL_RES: When this bit is set with the device is | ||
| 199 | * in Full-Resolution Mode, where the output resolution increases | ||
| 200 | * with RANGE to maintain a 4 mg/LSB scale factor. When this | ||
| 201 | * bit is cleared the device is in 10-bit Mode and RANGE determine the | ||
| 202 | * maximum g-Range and scale factor. | ||
| 203 | */ | ||
| 204 | |||
| 205 | #define ADXL_FULL_RES (1 << 3) | ||
| 206 | #define ADXL_RANGE_PM_2g 0 | ||
| 207 | #define ADXL_RANGE_PM_4g 1 | ||
| 208 | #define ADXL_RANGE_PM_8g 2 | ||
| 209 | #define ADXL_RANGE_PM_16g 3 | ||
| 210 | |||
| 211 | u8 data_range; | ||
| 212 | |||
| 213 | /* | ||
| 214 | * low_power_mode: | ||
| 215 | * A '0' = Normal operation and a '1' = Reduced | ||
| 216 | * power operation with somewhat higher noise. | ||
| 217 | */ | ||
| 218 | |||
| 219 | u8 low_power_mode; | ||
| 220 | |||
| 221 | /* | ||
| 222 | * power_mode: | ||
| 223 | * LINK: A '1' with both the activity and inactivity functions | ||
| 224 | * enabled will delay the start of the activity function until | ||
| 225 | * inactivity is detected. Once activity is detected, inactivity | ||
| 226 | * detection will begin and prevent the detection of activity. This | ||
| 227 | * bit serially links the activity and inactivity functions. When '0' | ||
| 228 | * the inactivity and activity functions are concurrent. Additional | ||
| 229 | * information can be found in the Application section under Link | ||
| 230 | * Mode. | ||
| 231 | * AUTO_SLEEP: A '1' sets the ADXL34x to switch to Sleep Mode | ||
| 232 | * when inactivity (acceleration has been below inactivity_threshold | ||
| 233 | * for at least inactivity_time) is detected and the LINK bit is set. | ||
| 234 | * A '0' disables automatic switching to Sleep Mode. See SLEEP | ||
| 235 | * for further description. | ||
| 236 | */ | ||
| 237 | |||
| 238 | #define ADXL_LINK (1 << 5) | ||
| 239 | #define ADXL_AUTO_SLEEP (1 << 4) | ||
| 240 | |||
| 241 | u8 power_mode; | ||
| 242 | |||
| 243 | /* | ||
| 244 | * fifo_mode: | ||
| 245 | * BYPASS The FIFO is bypassed | ||
| 246 | * FIFO FIFO collects up to 32 values then stops collecting data | ||
| 247 | * STREAM FIFO holds the last 32 data values. Once full, the FIFO's | ||
| 248 | * oldest data is lost as it is replaced with newer data | ||
| 249 | * | ||
| 250 | * DEFAULT should be ADXL_FIFO_STREAM | ||
| 251 | */ | ||
| 252 | |||
| 253 | #define ADXL_FIFO_BYPASS 0 | ||
| 254 | #define ADXL_FIFO_FIFO 1 | ||
| 255 | #define ADXL_FIFO_STREAM 2 | ||
| 256 | |||
| 257 | u8 fifo_mode; | ||
| 258 | |||
| 259 | /* | ||
| 260 | * watermark: | ||
| 261 | * The Watermark feature can be used to reduce the interrupt load | ||
| 262 | * of the system. The FIFO fills up to the value stored in watermark | ||
| 263 | * [1..32] and then generates an interrupt. | ||
| 264 | * A '0' disables the watermark feature. | ||
| 265 | */ | ||
| 266 | |||
| 267 | u8 watermark; | ||
| 268 | |||
| 269 | u32 ev_type; /* EV_ABS or EV_REL */ | ||
| 270 | |||
| 271 | u32 ev_code_x; /* ABS_X,Y,Z or REL_X,Y,Z */ | ||
| 272 | u32 ev_code_y; /* ABS_X,Y,Z or REL_X,Y,Z */ | ||
| 273 | u32 ev_code_z; /* ABS_X,Y,Z or REL_X,Y,Z */ | ||
| 274 | |||
| 275 | /* | ||
| 276 | * A valid BTN or KEY Code; use tap_axis_control to disable | ||
| 277 | * event reporting | ||
| 278 | */ | ||
| 279 | |||
| 280 | u32 ev_code_tap[3]; /* EV_KEY {X-Axis, Y-Axis, Z-Axis} */ | ||
| 281 | |||
| 282 | /* | ||
| 283 | * A valid BTN or KEY Code for Free-Fall or Activity enables | ||
| 284 | * input event reporting. A '0' disables the Free-Fall or | ||
| 285 | * Activity reporting. | ||
| 286 | */ | ||
| 287 | |||
| 288 | u32 ev_code_ff; /* EV_KEY */ | ||
| 289 | u32 ev_code_act_inactivity; /* EV_KEY */ | ||
| 290 | |||
| 291 | /* | ||
| 292 | * Use ADXL34x INT2 instead of INT1 | ||
| 293 | */ | ||
| 294 | u8 use_int2; | ||
| 295 | |||
| 296 | /* | ||
| 297 | * ADXL346 only ORIENTATION SENSING feature | ||
| 298 | * The orientation function of the ADXL346 reports both 2-D and | ||
| 299 | * 3-D orientation concurrently. | ||
| 300 | */ | ||
| 301 | |||
| 302 | #define ADXL_EN_ORIENTATION_2D 1 | ||
| 303 | #define ADXL_EN_ORIENTATION_3D 2 | ||
| 304 | #define ADXL_EN_ORIENTATION_2D_3D 3 | ||
| 305 | |||
| 306 | u8 orientation_enable; | ||
| 307 | |||
| 308 | /* | ||
| 309 | * The width of the deadzone region between two or more | ||
| 310 | * orientation positions is determined by setting the Deadzone | ||
| 311 | * value. The deadzone region size can be specified with a | ||
| 312 | * resolution of 3.6deg. The deadzone angle represents the total | ||
| 313 | * angle where the orientation is considered invalid. | ||
| 314 | */ | ||
| 315 | |||
| 316 | #define ADXL_DEADZONE_ANGLE_0p0 0 /* !!!0.0 [deg] */ | ||
| 317 | #define ADXL_DEADZONE_ANGLE_3p6 1 /* 3.6 [deg] */ | ||
| 318 | #define ADXL_DEADZONE_ANGLE_7p2 2 /* 7.2 [deg] */ | ||
| 319 | #define ADXL_DEADZONE_ANGLE_10p8 3 /* 10.8 [deg] */ | ||
| 320 | #define ADXL_DEADZONE_ANGLE_14p4 4 /* 14.4 [deg] */ | ||
| 321 | #define ADXL_DEADZONE_ANGLE_18p0 5 /* 18.0 [deg] */ | ||
| 322 | #define ADXL_DEADZONE_ANGLE_21p6 6 /* 21.6 [deg] */ | ||
| 323 | #define ADXL_DEADZONE_ANGLE_25p2 7 /* 25.2 [deg] */ | ||
| 324 | |||
| 325 | u8 deadzone_angle; | ||
| 326 | |||
| 327 | /* | ||
| 328 | * To eliminate most human motion such as walking or shaking, | ||
| 329 | * a Divisor value should be selected to effectively limit the | ||
| 330 | * orientation bandwidth. Set the depth of the filter used to | ||
| 331 | * low-pass filter the measured acceleration for stable | ||
| 332 | * orientation sensing | ||
| 333 | */ | ||
| 334 | |||
| 335 | #define ADXL_LP_FILTER_DIVISOR_2 0 | ||
| 336 | #define ADXL_LP_FILTER_DIVISOR_4 1 | ||
| 337 | #define ADXL_LP_FILTER_DIVISOR_8 2 | ||
| 338 | #define ADXL_LP_FILTER_DIVISOR_16 3 | ||
| 339 | #define ADXL_LP_FILTER_DIVISOR_32 4 | ||
| 340 | #define ADXL_LP_FILTER_DIVISOR_64 5 | ||
| 341 | #define ADXL_LP_FILTER_DIVISOR_128 6 | ||
| 342 | #define ADXL_LP_FILTER_DIVISOR_256 7 | ||
| 343 | |||
| 344 | u8 divisor_length; | ||
| 345 | |||
| 346 | u32 ev_codes_orient_2d[4]; /* EV_KEY {+X, -X, +Y, -Y} */ | ||
| 347 | u32 ev_codes_orient_3d[6]; /* EV_KEY {+Z, +Y, +X, -X, -Y, -Z} */ | ||
| 348 | }; | ||
| 349 | #endif | ||
diff --git a/include/linux/input/cy8ctmg110_pdata.h b/include/linux/input/cy8ctmg110_pdata.h new file mode 100644 index 000000000000..09522cb59910 --- /dev/null +++ b/include/linux/input/cy8ctmg110_pdata.h | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | #ifndef _LINUX_CY8CTMG110_PDATA_H | ||
| 2 | #define _LINUX_CY8CTMG110_PDATA_H | ||
| 3 | |||
| 4 | struct cy8ctmg110_pdata | ||
| 5 | { | ||
| 6 | int reset_pin; /* Reset pin is wired to this GPIO (optional) */ | ||
| 7 | int irq_pin; /* IRQ pin is wired to this GPIO */ | ||
| 8 | }; | ||
| 9 | |||
| 10 | #endif | ||
diff --git a/include/linux/input/matrix_keypad.h b/include/linux/input/matrix_keypad.h index c964cd7f436a..80352ad6581a 100644 --- a/include/linux/input/matrix_keypad.h +++ b/include/linux/input/matrix_keypad.h | |||
| @@ -41,6 +41,9 @@ struct matrix_keymap_data { | |||
| 41 | * @col_scan_delay_us: delay, measured in microseconds, that is | 41 | * @col_scan_delay_us: delay, measured in microseconds, that is |
| 42 | * needed before we can keypad after activating column gpio | 42 | * needed before we can keypad after activating column gpio |
| 43 | * @debounce_ms: debounce interval in milliseconds | 43 | * @debounce_ms: debounce interval in milliseconds |
| 44 | * @clustered_irq: may be specified if interrupts of all row/column GPIOs | ||
| 45 | * are bundled to one single irq | ||
| 46 | * @clustered_irq_flags: flags that are needed for the clustered irq | ||
| 44 | * @active_low: gpio polarity | 47 | * @active_low: gpio polarity |
| 45 | * @wakeup: controls whether the device should be set up as wakeup | 48 | * @wakeup: controls whether the device should be set up as wakeup |
| 46 | * source | 49 | * source |
| @@ -63,6 +66,9 @@ struct matrix_keypad_platform_data { | |||
| 63 | /* key debounce interval in milli-second */ | 66 | /* key debounce interval in milli-second */ |
| 64 | unsigned int debounce_ms; | 67 | unsigned int debounce_ms; |
| 65 | 68 | ||
| 69 | unsigned int clustered_irq; | ||
| 70 | unsigned int clustered_irq_flags; | ||
| 71 | |||
| 66 | bool active_low; | 72 | bool active_low; |
| 67 | bool wakeup; | 73 | bool wakeup; |
| 68 | bool no_autorepeat; | 74 | bool no_autorepeat; |
diff --git a/include/linux/intel_pmic_gpio.h b/include/linux/intel_pmic_gpio.h new file mode 100644 index 000000000000..920109a29191 --- /dev/null +++ b/include/linux/intel_pmic_gpio.h | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | #ifndef LINUX_INTEL_PMIC_H | ||
| 2 | #define LINUX_INTEL_PMIC_H | ||
| 3 | |||
| 4 | struct intel_pmic_gpio_platform_data { | ||
| 5 | /* the first IRQ of the chip */ | ||
| 6 | unsigned irq_base; | ||
| 7 | /* number assigned to the first GPIO */ | ||
| 8 | unsigned gpio_base; | ||
| 9 | /* sram address for gpiointr register, the langwell chip will map | ||
| 10 | * the PMIC spi GPIO expander's GPIOINTR register in sram. | ||
| 11 | */ | ||
| 12 | unsigned gpiointr; | ||
| 13 | }; | ||
| 14 | |||
| 15 | #endif | ||
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index c2331138ca1b..a0384a4d1e6f 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
| @@ -53,16 +53,21 @@ | |||
| 53 | * IRQF_ONESHOT - Interrupt is not reenabled after the hardirq handler finished. | 53 | * IRQF_ONESHOT - Interrupt is not reenabled after the hardirq handler finished. |
| 54 | * Used by threaded interrupts which need to keep the | 54 | * Used by threaded interrupts which need to keep the |
| 55 | * irq line disabled until the threaded handler has been run. | 55 | * irq line disabled until the threaded handler has been run. |
| 56 | * IRQF_NO_SUSPEND - Do not disable this IRQ during suspend | ||
| 57 | * | ||
| 56 | */ | 58 | */ |
| 57 | #define IRQF_DISABLED 0x00000020 | 59 | #define IRQF_DISABLED 0x00000020 |
| 58 | #define IRQF_SAMPLE_RANDOM 0x00000040 | 60 | #define IRQF_SAMPLE_RANDOM 0x00000040 |
| 59 | #define IRQF_SHARED 0x00000080 | 61 | #define IRQF_SHARED 0x00000080 |
| 60 | #define IRQF_PROBE_SHARED 0x00000100 | 62 | #define IRQF_PROBE_SHARED 0x00000100 |
| 61 | #define IRQF_TIMER 0x00000200 | 63 | #define __IRQF_TIMER 0x00000200 |
| 62 | #define IRQF_PERCPU 0x00000400 | 64 | #define IRQF_PERCPU 0x00000400 |
| 63 | #define IRQF_NOBALANCING 0x00000800 | 65 | #define IRQF_NOBALANCING 0x00000800 |
| 64 | #define IRQF_IRQPOLL 0x00001000 | 66 | #define IRQF_IRQPOLL 0x00001000 |
| 65 | #define IRQF_ONESHOT 0x00002000 | 67 | #define IRQF_ONESHOT 0x00002000 |
| 68 | #define IRQF_NO_SUSPEND 0x00004000 | ||
| 69 | |||
| 70 | #define IRQF_TIMER (__IRQF_TIMER | IRQF_NO_SUSPEND) | ||
| 66 | 71 | ||
| 67 | /* | 72 | /* |
| 68 | * Bits used by threaded handlers: | 73 | * Bits used by threaded handlers: |
diff --git a/include/linux/io-mapping.h b/include/linux/io-mapping.h index 25085ddd955f..e0ea40f6c515 100644 --- a/include/linux/io-mapping.h +++ b/include/linux/io-mapping.h | |||
| @@ -79,7 +79,9 @@ io_mapping_free(struct io_mapping *mapping) | |||
| 79 | 79 | ||
| 80 | /* Atomic map/unmap */ | 80 | /* Atomic map/unmap */ |
| 81 | static inline void * | 81 | static inline void * |
| 82 | io_mapping_map_atomic_wc(struct io_mapping *mapping, unsigned long offset) | 82 | io_mapping_map_atomic_wc(struct io_mapping *mapping, |
| 83 | unsigned long offset, | ||
| 84 | int slot) | ||
| 83 | { | 85 | { |
| 84 | resource_size_t phys_addr; | 86 | resource_size_t phys_addr; |
| 85 | unsigned long pfn; | 87 | unsigned long pfn; |
| @@ -87,13 +89,13 @@ io_mapping_map_atomic_wc(struct io_mapping *mapping, unsigned long offset) | |||
| 87 | BUG_ON(offset >= mapping->size); | 89 | BUG_ON(offset >= mapping->size); |
| 88 | phys_addr = mapping->base + offset; | 90 | phys_addr = mapping->base + offset; |
| 89 | pfn = (unsigned long) (phys_addr >> PAGE_SHIFT); | 91 | pfn = (unsigned long) (phys_addr >> PAGE_SHIFT); |
| 90 | return iomap_atomic_prot_pfn(pfn, KM_USER0, mapping->prot); | 92 | return iomap_atomic_prot_pfn(pfn, slot, mapping->prot); |
| 91 | } | 93 | } |
| 92 | 94 | ||
| 93 | static inline void | 95 | static inline void |
| 94 | io_mapping_unmap_atomic(void *vaddr) | 96 | io_mapping_unmap_atomic(void *vaddr, int slot) |
| 95 | { | 97 | { |
| 96 | iounmap_atomic(vaddr, KM_USER0); | 98 | iounmap_atomic(vaddr, slot); |
| 97 | } | 99 | } |
| 98 | 100 | ||
| 99 | static inline void * | 101 | static inline void * |
| @@ -133,13 +135,15 @@ io_mapping_free(struct io_mapping *mapping) | |||
| 133 | 135 | ||
| 134 | /* Atomic map/unmap */ | 136 | /* Atomic map/unmap */ |
| 135 | static inline void * | 137 | static inline void * |
| 136 | io_mapping_map_atomic_wc(struct io_mapping *mapping, unsigned long offset) | 138 | io_mapping_map_atomic_wc(struct io_mapping *mapping, |
| 139 | unsigned long offset, | ||
| 140 | int slot) | ||
| 137 | { | 141 | { |
| 138 | return ((char *) mapping) + offset; | 142 | return ((char *) mapping) + offset; |
| 139 | } | 143 | } |
| 140 | 144 | ||
| 141 | static inline void | 145 | static inline void |
| 142 | io_mapping_unmap_atomic(void *vaddr) | 146 | io_mapping_unmap_atomic(void *vaddr, int slot) |
| 143 | { | 147 | { |
| 144 | } | 148 | } |
| 145 | 149 | ||
diff --git a/include/linux/io.h b/include/linux/io.h index 6c7f0ba0d5fa..7fd2d2138bf3 100644 --- a/include/linux/io.h +++ b/include/linux/io.h | |||
| @@ -29,10 +29,10 @@ void __iowrite64_copy(void __iomem *to, const void *from, size_t count); | |||
| 29 | 29 | ||
| 30 | #ifdef CONFIG_MMU | 30 | #ifdef CONFIG_MMU |
| 31 | int ioremap_page_range(unsigned long addr, unsigned long end, | 31 | int ioremap_page_range(unsigned long addr, unsigned long end, |
| 32 | unsigned long phys_addr, pgprot_t prot); | 32 | phys_addr_t phys_addr, pgprot_t prot); |
| 33 | #else | 33 | #else |
| 34 | static inline int ioremap_page_range(unsigned long addr, unsigned long end, | 34 | static inline int ioremap_page_range(unsigned long addr, unsigned long end, |
| 35 | unsigned long phys_addr, pgprot_t prot) | 35 | phys_addr_t phys_addr, pgprot_t prot) |
| 36 | { | 36 | { |
| 37 | return 0; | 37 | return 0; |
| 38 | } | 38 | } |
diff --git a/include/linux/iommu.h b/include/linux/iommu.h index be22ad83689c..0a2ba4098996 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h | |||
| @@ -30,6 +30,7 @@ struct iommu_domain { | |||
| 30 | }; | 30 | }; |
| 31 | 31 | ||
| 32 | #define IOMMU_CAP_CACHE_COHERENCY 0x1 | 32 | #define IOMMU_CAP_CACHE_COHERENCY 0x1 |
| 33 | #define IOMMU_CAP_INTR_REMAP 0x2 /* isolates device intrs */ | ||
| 33 | 34 | ||
| 34 | struct iommu_ops { | 35 | struct iommu_ops { |
| 35 | int (*domain_init)(struct iommu_domain *domain); | 36 | int (*domain_init)(struct iommu_domain *domain); |
diff --git a/include/linux/ip_vs.h b/include/linux/ip_vs.h index dfc170362842..9708de265bb1 100644 --- a/include/linux/ip_vs.h +++ b/include/linux/ip_vs.h | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | */ | 19 | */ |
| 20 | #define IP_VS_SVC_F_PERSISTENT 0x0001 /* persistent port */ | 20 | #define IP_VS_SVC_F_PERSISTENT 0x0001 /* persistent port */ |
| 21 | #define IP_VS_SVC_F_HASHED 0x0002 /* hashed entry */ | 21 | #define IP_VS_SVC_F_HASHED 0x0002 /* hashed entry */ |
| 22 | #define IP_VS_SVC_F_ONEPACKET 0x0004 /* one-packet scheduling */ | ||
| 22 | 23 | ||
| 23 | /* | 24 | /* |
| 24 | * Destination Server Flags | 25 | * Destination Server Flags |
| @@ -85,6 +86,7 @@ | |||
| 85 | #define IP_VS_CONN_F_SEQ_MASK 0x0600 /* in/out sequence mask */ | 86 | #define IP_VS_CONN_F_SEQ_MASK 0x0600 /* in/out sequence mask */ |
| 86 | #define IP_VS_CONN_F_NO_CPORT 0x0800 /* no client port set yet */ | 87 | #define IP_VS_CONN_F_NO_CPORT 0x0800 /* no client port set yet */ |
| 87 | #define IP_VS_CONN_F_TEMPLATE 0x1000 /* template, not connection */ | 88 | #define IP_VS_CONN_F_TEMPLATE 0x1000 /* template, not connection */ |
| 89 | #define IP_VS_CONN_F_ONE_PACKET 0x2000 /* forward only one packet */ | ||
| 88 | 90 | ||
| 89 | #define IP_VS_SCHEDNAME_MAXLEN 16 | 91 | #define IP_VS_SCHEDNAME_MAXLEN 16 |
| 90 | #define IP_VS_IFNAME_MAXLEN 16 | 92 | #define IP_VS_IFNAME_MAXLEN 16 |
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index 99e1ab7e3eec..ab9e9e89e407 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h | |||
| @@ -58,7 +58,7 @@ struct ipv6_opt_hdr { | |||
| 58 | /* | 58 | /* |
| 59 | * TLV encoded option data follows. | 59 | * TLV encoded option data follows. |
| 60 | */ | 60 | */ |
| 61 | } __attribute__ ((packed)); /* required for some archs */ | 61 | } __packed; /* required for some archs */ |
| 62 | 62 | ||
| 63 | #define ipv6_destopt_hdr ipv6_opt_hdr | 63 | #define ipv6_destopt_hdr ipv6_opt_hdr |
| 64 | #define ipv6_hopopt_hdr ipv6_opt_hdr | 64 | #define ipv6_hopopt_hdr ipv6_opt_hdr |
| @@ -99,7 +99,7 @@ struct ipv6_destopt_hao { | |||
| 99 | __u8 type; | 99 | __u8 type; |
| 100 | __u8 length; | 100 | __u8 length; |
| 101 | struct in6_addr addr; | 101 | struct in6_addr addr; |
| 102 | } __attribute__ ((__packed__)); | 102 | } __packed; |
| 103 | 103 | ||
| 104 | /* | 104 | /* |
| 105 | * IPv6 fixed header | 105 | * IPv6 fixed header |
| @@ -246,7 +246,7 @@ struct inet6_skb_parm { | |||
| 246 | __u16 srcrt; | 246 | __u16 srcrt; |
| 247 | __u16 dst1; | 247 | __u16 dst1; |
| 248 | __u16 lastopt; | 248 | __u16 lastopt; |
| 249 | __u32 nhoff; | 249 | __u16 nhoff; |
| 250 | __u16 flags; | 250 | __u16 flags; |
| 251 | #if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE) | 251 | #if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE) |
| 252 | __u16 dsthao; | 252 | __u16 dsthao; |
diff --git a/include/linux/iscsi_boot_sysfs.h b/include/linux/iscsi_boot_sysfs.h new file mode 100644 index 000000000000..f1e6c184f14f --- /dev/null +++ b/include/linux/iscsi_boot_sysfs.h | |||
| @@ -0,0 +1,123 @@ | |||
| 1 | /* | ||
| 2 | * Export the iSCSI boot info to userland via sysfs. | ||
| 3 | * | ||
| 4 | * Copyright (C) 2010 Red Hat, Inc. All rights reserved. | ||
| 5 | * Copyright (C) 2010 Mike Christie | ||
| 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 v2.0 as published by | ||
| 9 | * the Free Software Foundation | ||
| 10 | * | ||
| 11 | * This program is distributed in the hope that it will be useful, | ||
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | * GNU General Public License for more details. | ||
| 15 | */ | ||
| 16 | #ifndef _ISCSI_BOOT_SYSFS_ | ||
| 17 | #define _ISCSI_BOOT_SYSFS_ | ||
| 18 | |||
| 19 | /* | ||
| 20 | * The text attributes names for each of the kobjects. | ||
| 21 | */ | ||
| 22 | enum iscsi_boot_eth_properties_enum { | ||
| 23 | ISCSI_BOOT_ETH_INDEX, | ||
| 24 | ISCSI_BOOT_ETH_FLAGS, | ||
| 25 | ISCSI_BOOT_ETH_IP_ADDR, | ||
| 26 | ISCSI_BOOT_ETH_SUBNET_MASK, | ||
| 27 | ISCSI_BOOT_ETH_ORIGIN, | ||
| 28 | ISCSI_BOOT_ETH_GATEWAY, | ||
| 29 | ISCSI_BOOT_ETH_PRIMARY_DNS, | ||
| 30 | ISCSI_BOOT_ETH_SECONDARY_DNS, | ||
| 31 | ISCSI_BOOT_ETH_DHCP, | ||
| 32 | ISCSI_BOOT_ETH_VLAN, | ||
| 33 | ISCSI_BOOT_ETH_MAC, | ||
| 34 | /* eth_pci_bdf - this is replaced by link to the device itself. */ | ||
| 35 | ISCSI_BOOT_ETH_HOSTNAME, | ||
| 36 | ISCSI_BOOT_ETH_END_MARKER, | ||
| 37 | }; | ||
| 38 | |||
| 39 | enum iscsi_boot_tgt_properties_enum { | ||
| 40 | ISCSI_BOOT_TGT_INDEX, | ||
| 41 | ISCSI_BOOT_TGT_FLAGS, | ||
| 42 | ISCSI_BOOT_TGT_IP_ADDR, | ||
| 43 | ISCSI_BOOT_TGT_PORT, | ||
| 44 | ISCSI_BOOT_TGT_LUN, | ||
| 45 | ISCSI_BOOT_TGT_CHAP_TYPE, | ||
| 46 | ISCSI_BOOT_TGT_NIC_ASSOC, | ||
| 47 | ISCSI_BOOT_TGT_NAME, | ||
| 48 | ISCSI_BOOT_TGT_CHAP_NAME, | ||
| 49 | ISCSI_BOOT_TGT_CHAP_SECRET, | ||
| 50 | ISCSI_BOOT_TGT_REV_CHAP_NAME, | ||
| 51 | ISCSI_BOOT_TGT_REV_CHAP_SECRET, | ||
| 52 | ISCSI_BOOT_TGT_END_MARKER, | ||
| 53 | }; | ||
| 54 | |||
| 55 | enum iscsi_boot_initiator_properties_enum { | ||
| 56 | ISCSI_BOOT_INI_INDEX, | ||
| 57 | ISCSI_BOOT_INI_FLAGS, | ||
| 58 | ISCSI_BOOT_INI_ISNS_SERVER, | ||
| 59 | ISCSI_BOOT_INI_SLP_SERVER, | ||
| 60 | ISCSI_BOOT_INI_PRI_RADIUS_SERVER, | ||
| 61 | ISCSI_BOOT_INI_SEC_RADIUS_SERVER, | ||
| 62 | ISCSI_BOOT_INI_INITIATOR_NAME, | ||
| 63 | ISCSI_BOOT_INI_END_MARKER, | ||
| 64 | }; | ||
| 65 | |||
| 66 | struct attribute_group; | ||
| 67 | |||
| 68 | struct iscsi_boot_kobj { | ||
| 69 | struct kobject kobj; | ||
| 70 | struct attribute_group *attr_group; | ||
| 71 | struct list_head list; | ||
| 72 | |||
| 73 | /* | ||
| 74 | * Pointer to store driver specific info. If set this will | ||
| 75 | * be freed for the LLD when the kobj release function is called. | ||
| 76 | */ | ||
| 77 | void *data; | ||
| 78 | /* | ||
| 79 | * Driver specific show function. | ||
| 80 | * | ||
| 81 | * The enum of the type. This can be any value of the above | ||
| 82 | * properties. | ||
| 83 | */ | ||
| 84 | ssize_t (*show) (void *data, int type, char *buf); | ||
| 85 | |||
| 86 | /* | ||
| 87 | * Drivers specific visibility function. | ||
| 88 | * The function should return if they the attr should be readable | ||
| 89 | * writable or should not be shown. | ||
| 90 | * | ||
| 91 | * The enum of the type. This can be any value of the above | ||
| 92 | * properties. | ||
| 93 | */ | ||
| 94 | mode_t (*is_visible) (void *data, int type); | ||
| 95 | }; | ||
| 96 | |||
| 97 | struct iscsi_boot_kset { | ||
| 98 | struct list_head kobj_list; | ||
| 99 | struct kset *kset; | ||
| 100 | }; | ||
| 101 | |||
| 102 | struct iscsi_boot_kobj * | ||
| 103 | iscsi_boot_create_initiator(struct iscsi_boot_kset *boot_kset, int index, | ||
| 104 | void *data, | ||
| 105 | ssize_t (*show) (void *data, int type, char *buf), | ||
| 106 | mode_t (*is_visible) (void *data, int type)); | ||
| 107 | |||
| 108 | struct iscsi_boot_kobj * | ||
| 109 | iscsi_boot_create_ethernet(struct iscsi_boot_kset *boot_kset, int index, | ||
| 110 | void *data, | ||
| 111 | ssize_t (*show) (void *data, int type, char *buf), | ||
| 112 | mode_t (*is_visible) (void *data, int type)); | ||
| 113 | struct iscsi_boot_kobj * | ||
| 114 | iscsi_boot_create_target(struct iscsi_boot_kset *boot_kset, int index, | ||
| 115 | void *data, | ||
| 116 | ssize_t (*show) (void *data, int type, char *buf), | ||
| 117 | mode_t (*is_visible) (void *data, int type)); | ||
| 118 | |||
| 119 | struct iscsi_boot_kset *iscsi_boot_create_kset(const char *set_name); | ||
| 120 | struct iscsi_boot_kset *iscsi_boot_create_host_kset(unsigned int hostno); | ||
| 121 | void iscsi_boot_destroy_kset(struct iscsi_boot_kset *boot_kset); | ||
| 122 | |||
| 123 | #endif | ||
diff --git a/include/linux/iscsi_ibft.h b/include/linux/iscsi_ibft.h index d2e4042f8f5e..8ba7e5b9d62c 100644 --- a/include/linux/iscsi_ibft.h +++ b/include/linux/iscsi_ibft.h | |||
| @@ -21,21 +21,13 @@ | |||
| 21 | #ifndef ISCSI_IBFT_H | 21 | #ifndef ISCSI_IBFT_H |
| 22 | #define ISCSI_IBFT_H | 22 | #define ISCSI_IBFT_H |
| 23 | 23 | ||
| 24 | struct ibft_table_header { | 24 | #include <acpi/acpi.h> |
| 25 | char signature[4]; | ||
| 26 | u32 length; | ||
| 27 | u8 revision; | ||
| 28 | u8 checksum; | ||
| 29 | char oem_id[6]; | ||
| 30 | char oem_table_id[8]; | ||
| 31 | char reserved[24]; | ||
| 32 | } __attribute__((__packed__)); | ||
| 33 | 25 | ||
| 34 | /* | 26 | /* |
| 35 | * Logical location of iSCSI Boot Format Table. | 27 | * Logical location of iSCSI Boot Format Table. |
| 36 | * If the value is NULL there is no iBFT on the machine. | 28 | * If the value is NULL there is no iBFT on the machine. |
| 37 | */ | 29 | */ |
| 38 | extern struct ibft_table_header *ibft_addr; | 30 | extern struct acpi_table_ibft *ibft_addr; |
| 39 | 31 | ||
| 40 | /* | 32 | /* |
| 41 | * Routine used to find and reserve the iSCSI Boot Format Table. The | 33 | * Routine used to find and reserve the iSCSI Boot Format Table. The |
diff --git a/include/linux/isdnif.h b/include/linux/isdnif.h index b9b5a684ed69..b8c23f88dd54 100644 --- a/include/linux/isdnif.h +++ b/include/linux/isdnif.h | |||
| @@ -317,7 +317,7 @@ typedef struct T30_s { | |||
| 317 | __u8 r_scantime; | 317 | __u8 r_scantime; |
| 318 | __u8 r_id[FAXIDLEN]; | 318 | __u8 r_id[FAXIDLEN]; |
| 319 | __u8 r_code; | 319 | __u8 r_code; |
| 320 | } __attribute__((packed)) T30_s; | 320 | } __packed T30_s; |
| 321 | 321 | ||
| 322 | #define ISDN_TTY_FAX_CONN_IN 0 | 322 | #define ISDN_TTY_FAX_CONN_IN 0 |
| 323 | #define ISDN_TTY_FAX_CONN_OUT 1 | 323 | #define ISDN_TTY_FAX_CONN_OUT 1 |
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index adf832dec3f3..0b52924a0cb6 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h | |||
| @@ -601,13 +601,13 @@ struct transaction_s | |||
| 601 | * Number of outstanding updates running on this transaction | 601 | * Number of outstanding updates running on this transaction |
| 602 | * [t_handle_lock] | 602 | * [t_handle_lock] |
| 603 | */ | 603 | */ |
| 604 | int t_updates; | 604 | atomic_t t_updates; |
| 605 | 605 | ||
| 606 | /* | 606 | /* |
| 607 | * Number of buffers reserved for use by all handles in this transaction | 607 | * Number of buffers reserved for use by all handles in this transaction |
| 608 | * handle but not yet modified. [t_handle_lock] | 608 | * handle but not yet modified. [t_handle_lock] |
| 609 | */ | 609 | */ |
| 610 | int t_outstanding_credits; | 610 | atomic_t t_outstanding_credits; |
| 611 | 611 | ||
| 612 | /* | 612 | /* |
| 613 | * Forward and backward links for the circular list of all transactions | 613 | * Forward and backward links for the circular list of all transactions |
| @@ -629,7 +629,7 @@ struct transaction_s | |||
| 629 | /* | 629 | /* |
| 630 | * How many handles used this transaction? [t_handle_lock] | 630 | * How many handles used this transaction? [t_handle_lock] |
| 631 | */ | 631 | */ |
| 632 | int t_handle_count; | 632 | atomic_t t_handle_count; |
| 633 | 633 | ||
| 634 | /* | 634 | /* |
| 635 | * This transaction is being forced and some process is | 635 | * This transaction is being forced and some process is |
| @@ -764,7 +764,7 @@ struct journal_s | |||
| 764 | /* | 764 | /* |
| 765 | * Protect the various scalars in the journal | 765 | * Protect the various scalars in the journal |
| 766 | */ | 766 | */ |
| 767 | spinlock_t j_state_lock; | 767 | rwlock_t j_state_lock; |
| 768 | 768 | ||
| 769 | /* | 769 | /* |
| 770 | * Number of processes waiting to create a barrier lock [j_state_lock] | 770 | * Number of processes waiting to create a barrier lock [j_state_lock] |
| @@ -1082,7 +1082,9 @@ static inline handle_t *journal_current_handle(void) | |||
| 1082 | */ | 1082 | */ |
| 1083 | 1083 | ||
| 1084 | extern handle_t *jbd2_journal_start(journal_t *, int nblocks); | 1084 | extern handle_t *jbd2_journal_start(journal_t *, int nblocks); |
| 1085 | extern int jbd2_journal_restart (handle_t *, int nblocks); | 1085 | extern handle_t *jbd2__journal_start(journal_t *, int nblocks, int gfp_mask); |
| 1086 | extern int jbd2_journal_restart(handle_t *, int nblocks); | ||
| 1087 | extern int jbd2__journal_restart(handle_t *, int nblocks, int gfp_mask); | ||
| 1086 | extern int jbd2_journal_extend (handle_t *, int nblocks); | 1088 | extern int jbd2_journal_extend (handle_t *, int nblocks); |
| 1087 | extern int jbd2_journal_get_write_access(handle_t *, struct buffer_head *); | 1089 | extern int jbd2_journal_get_write_access(handle_t *, struct buffer_head *); |
| 1088 | extern int jbd2_journal_get_create_access (handle_t *, struct buffer_head *); | 1090 | extern int jbd2_journal_get_create_access (handle_t *, struct buffer_head *); |
| @@ -1257,8 +1259,8 @@ static inline int jbd_space_needed(journal_t *journal) | |||
| 1257 | { | 1259 | { |
| 1258 | int nblocks = journal->j_max_transaction_buffers; | 1260 | int nblocks = journal->j_max_transaction_buffers; |
| 1259 | if (journal->j_committing_transaction) | 1261 | if (journal->j_committing_transaction) |
| 1260 | nblocks += journal->j_committing_transaction-> | 1262 | nblocks += atomic_read(&journal->j_committing_transaction-> |
| 1261 | t_outstanding_credits; | 1263 | t_outstanding_credits); |
| 1262 | return nblocks; | 1264 | return nblocks; |
| 1263 | } | 1265 | } |
| 1264 | 1266 | ||
diff --git a/include/linux/jffs2.h b/include/linux/jffs2.h index 0874ab59ffef..edb9231f1898 100644 --- a/include/linux/jffs2.h +++ b/include/linux/jffs2.h | |||
| @@ -185,7 +185,7 @@ struct jffs2_raw_xref | |||
| 185 | jint32_t hdr_crc; | 185 | jint32_t hdr_crc; |
| 186 | jint32_t ino; /* inode number */ | 186 | jint32_t ino; /* inode number */ |
| 187 | jint32_t xid; /* XATTR identifier number */ | 187 | jint32_t xid; /* XATTR identifier number */ |
| 188 | jint32_t xseqno; /* xref sequencial number */ | 188 | jint32_t xseqno; /* xref sequential number */ |
| 189 | jint32_t node_crc; | 189 | jint32_t node_crc; |
| 190 | } __attribute__((packed)); | 190 | } __attribute__((packed)); |
| 191 | 191 | ||
diff --git a/include/linux/kdb.h b/include/linux/kdb.h index ccb2b3ec0fe8..ea6e5244ed3f 100644 --- a/include/linux/kdb.h +++ b/include/linux/kdb.h | |||
| @@ -114,4 +114,8 @@ enum { | |||
| 114 | KDB_INIT_EARLY, | 114 | KDB_INIT_EARLY, |
| 115 | KDB_INIT_FULL, | 115 | KDB_INIT_FULL, |
| 116 | }; | 116 | }; |
| 117 | |||
| 118 | extern int kdbgetintenv(const char *, int *); | ||
| 119 | extern int kdb_set(int, const char **); | ||
| 120 | |||
| 117 | #endif /* !_KDB_H */ | 121 | #endif /* !_KDB_H */ |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 8317ec4b9f3b..7d5b10ff63e0 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
| @@ -171,6 +171,11 @@ static inline void might_fault(void) | |||
| 171 | } | 171 | } |
| 172 | #endif | 172 | #endif |
| 173 | 173 | ||
| 174 | struct va_format { | ||
| 175 | const char *fmt; | ||
| 176 | va_list *va; | ||
| 177 | }; | ||
| 178 | |||
| 174 | extern struct atomic_notifier_head panic_notifier_list; | 179 | extern struct atomic_notifier_head panic_notifier_list; |
| 175 | extern long (*panic_blink)(long time); | 180 | extern long (*panic_blink)(long time); |
| 176 | NORET_TYPE void panic(const char * fmt, ...) | 181 | NORET_TYPE void panic(const char * fmt, ...) |
| @@ -247,6 +252,13 @@ extern struct pid *session_of_pgrp(struct pid *pgrp); | |||
| 247 | #define FW_WARN "[Firmware Warn]: " | 252 | #define FW_WARN "[Firmware Warn]: " |
| 248 | #define FW_INFO "[Firmware Info]: " | 253 | #define FW_INFO "[Firmware Info]: " |
| 249 | 254 | ||
| 255 | /* | ||
| 256 | * HW_ERR | ||
| 257 | * Add this to a message for hardware errors, so that user can report | ||
| 258 | * it to hardware vendor instead of LKML or software vendor. | ||
| 259 | */ | ||
| 260 | #define HW_ERR "[Hardware Error]: " | ||
| 261 | |||
| 250 | #ifdef CONFIG_PRINTK | 262 | #ifdef CONFIG_PRINTK |
| 251 | asmlinkage int vprintk(const char *fmt, va_list args) | 263 | asmlinkage int vprintk(const char *fmt, va_list args) |
| 252 | __attribute__ ((format (printf, 1, 0))); | 264 | __attribute__ ((format (printf, 1, 0))); |
| @@ -508,9 +520,6 @@ extern void tracing_start(void); | |||
| 508 | extern void tracing_stop(void); | 520 | extern void tracing_stop(void); |
| 509 | extern void ftrace_off_permanent(void); | 521 | extern void ftrace_off_permanent(void); |
| 510 | 522 | ||
| 511 | extern void | ||
| 512 | ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3); | ||
| 513 | |||
| 514 | static inline void __attribute__ ((format (printf, 1, 2))) | 523 | static inline void __attribute__ ((format (printf, 1, 2))) |
| 515 | ____trace_printk_check_format(const char *fmt, ...) | 524 | ____trace_printk_check_format(const char *fmt, ...) |
| 516 | { | 525 | { |
| @@ -586,8 +595,6 @@ __ftrace_vprintk(unsigned long ip, const char *fmt, va_list ap); | |||
| 586 | 595 | ||
| 587 | extern void ftrace_dump(enum ftrace_dump_mode oops_dump_mode); | 596 | extern void ftrace_dump(enum ftrace_dump_mode oops_dump_mode); |
| 588 | #else | 597 | #else |
| 589 | static inline void | ||
| 590 | ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3) { } | ||
| 591 | static inline int | 598 | static inline int |
| 592 | trace_printk(const char *fmt, ...) __attribute__ ((format (printf, 1, 2))); | 599 | trace_printk(const char *fmt, ...) __attribute__ ((format (printf, 1, 2))); |
| 593 | 600 | ||
| @@ -728,12 +735,6 @@ extern int do_sysinfo(struct sysinfo *info); | |||
| 728 | 735 | ||
| 729 | #endif /* __KERNEL__ */ | 736 | #endif /* __KERNEL__ */ |
| 730 | 737 | ||
| 731 | #ifndef __EXPORTED_HEADERS__ | ||
| 732 | #ifndef __KERNEL__ | ||
| 733 | #warning Attempt to use kernel headers from user space, see http://kernelnewbies.org/KernelHeaders | ||
| 734 | #endif /* __KERNEL__ */ | ||
| 735 | #endif /* __EXPORTED_HEADERS__ */ | ||
| 736 | |||
| 737 | #define SI_LOAD_SHIFT 16 | 738 | #define SI_LOAD_SHIFT 16 |
| 738 | struct sysinfo { | 739 | struct sysinfo { |
| 739 | long uptime; /* Seconds since boot */ | 740 | long uptime; /* Seconds since boot */ |
diff --git a/include/linux/kgdb.h b/include/linux/kgdb.h index 9340f34d1bb5..cc96f0f23e04 100644 --- a/include/linux/kgdb.h +++ b/include/linux/kgdb.h | |||
| @@ -90,6 +90,19 @@ struct kgdb_bkpt { | |||
| 90 | enum kgdb_bpstate state; | 90 | enum kgdb_bpstate state; |
| 91 | }; | 91 | }; |
| 92 | 92 | ||
| 93 | struct dbg_reg_def_t { | ||
| 94 | char *name; | ||
| 95 | int size; | ||
| 96 | int offset; | ||
| 97 | }; | ||
| 98 | |||
| 99 | #ifndef DBG_MAX_REG_NUM | ||
| 100 | #define DBG_MAX_REG_NUM 0 | ||
| 101 | #else | ||
| 102 | extern struct dbg_reg_def_t dbg_reg_def[]; | ||
| 103 | extern char *dbg_get_reg(int regno, void *mem, struct pt_regs *regs); | ||
| 104 | extern int dbg_set_reg(int regno, void *mem, struct pt_regs *regs); | ||
| 105 | #endif | ||
| 93 | #ifndef KGDB_MAX_BREAKPOINTS | 106 | #ifndef KGDB_MAX_BREAKPOINTS |
| 94 | # define KGDB_MAX_BREAKPOINTS 1000 | 107 | # define KGDB_MAX_BREAKPOINTS 1000 |
| 95 | #endif | 108 | #endif |
| @@ -281,7 +294,7 @@ extern void kgdb_unregister_io_module(struct kgdb_io *local_kgdb_io_ops); | |||
| 281 | extern struct kgdb_io *dbg_io_ops; | 294 | extern struct kgdb_io *dbg_io_ops; |
| 282 | 295 | ||
| 283 | extern int kgdb_hex2long(char **ptr, unsigned long *long_val); | 296 | extern int kgdb_hex2long(char **ptr, unsigned long *long_val); |
| 284 | extern int kgdb_mem2hex(char *mem, char *buf, int count); | 297 | extern char *kgdb_mem2hex(char *mem, char *buf, int count); |
| 285 | extern int kgdb_hex2mem(char *buf, char *mem, int count); | 298 | extern int kgdb_hex2mem(char *buf, char *mem, int count); |
| 286 | 299 | ||
| 287 | extern int kgdb_isremovedbreak(unsigned long addr); | 300 | extern int kgdb_isremovedbreak(unsigned long addr); |
diff --git a/include/linux/kmemtrace.h b/include/linux/kmemtrace.h deleted file mode 100644 index b616d3930c3b..000000000000 --- a/include/linux/kmemtrace.h +++ /dev/null | |||
| @@ -1,25 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2008 Eduard - Gabriel Munteanu | ||
| 3 | * | ||
| 4 | * This file is released under GPL version 2. | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef _LINUX_KMEMTRACE_H | ||
| 8 | #define _LINUX_KMEMTRACE_H | ||
| 9 | |||
| 10 | #ifdef __KERNEL__ | ||
| 11 | |||
| 12 | #include <trace/events/kmem.h> | ||
| 13 | |||
| 14 | #ifdef CONFIG_KMEMTRACE | ||
| 15 | extern void kmemtrace_init(void); | ||
| 16 | #else | ||
| 17 | static inline void kmemtrace_init(void) | ||
| 18 | { | ||
| 19 | } | ||
| 20 | #endif | ||
| 21 | |||
| 22 | #endif /* __KERNEL__ */ | ||
| 23 | |||
| 24 | #endif /* _LINUX_KMEMTRACE_H */ | ||
| 25 | |||
diff --git a/include/linux/ks8842.h b/include/linux/ks8842.h index da0341b8ca0a..14ba4452296e 100644 --- a/include/linux/ks8842.h +++ b/include/linux/ks8842.h | |||
| @@ -25,10 +25,14 @@ | |||
| 25 | * struct ks8842_platform_data - Platform data of the KS8842 network driver | 25 | * struct ks8842_platform_data - Platform data of the KS8842 network driver |
| 26 | * @macaddr: The MAC address of the device, set to all 0:s to use the on in | 26 | * @macaddr: The MAC address of the device, set to all 0:s to use the on in |
| 27 | * the chip. | 27 | * the chip. |
| 28 | * @rx_dma_channel: The DMA channel to use for RX, -1 for none. | ||
| 29 | * @tx_dma_channel: The DMA channel to use for TX, -1 for none. | ||
| 28 | * | 30 | * |
| 29 | */ | 31 | */ |
| 30 | struct ks8842_platform_data { | 32 | struct ks8842_platform_data { |
| 31 | u8 macaddr[ETH_ALEN]; | 33 | u8 macaddr[ETH_ALEN]; |
| 34 | int rx_dma_channel; | ||
| 35 | int tx_dma_channel; | ||
| 32 | }; | 36 | }; |
| 33 | 37 | ||
| 34 | #endif | 38 | #endif |
diff --git a/include/linux/kthread.h b/include/linux/kthread.h index aabc8a13ba71..685ea65eb803 100644 --- a/include/linux/kthread.h +++ b/include/linux/kthread.h | |||
| @@ -30,8 +30,73 @@ struct task_struct *kthread_create(int (*threadfn)(void *data), | |||
| 30 | void kthread_bind(struct task_struct *k, unsigned int cpu); | 30 | void kthread_bind(struct task_struct *k, unsigned int cpu); |
| 31 | int kthread_stop(struct task_struct *k); | 31 | int kthread_stop(struct task_struct *k); |
| 32 | int kthread_should_stop(void); | 32 | int kthread_should_stop(void); |
| 33 | void *kthread_data(struct task_struct *k); | ||
| 33 | 34 | ||
| 34 | int kthreadd(void *unused); | 35 | int kthreadd(void *unused); |
| 35 | extern struct task_struct *kthreadd_task; | 36 | extern struct task_struct *kthreadd_task; |
| 36 | 37 | ||
| 38 | /* | ||
| 39 | * Simple work processor based on kthread. | ||
| 40 | * | ||
| 41 | * This provides easier way to make use of kthreads. A kthread_work | ||
| 42 | * can be queued and flushed using queue/flush_kthread_work() | ||
| 43 | * respectively. Queued kthread_works are processed by a kthread | ||
| 44 | * running kthread_worker_fn(). | ||
| 45 | * | ||
| 46 | * A kthread_work can't be freed while it is executing. | ||
| 47 | */ | ||
| 48 | struct kthread_work; | ||
| 49 | typedef void (*kthread_work_func_t)(struct kthread_work *work); | ||
| 50 | |||
| 51 | struct kthread_worker { | ||
| 52 | spinlock_t lock; | ||
| 53 | struct list_head work_list; | ||
| 54 | struct task_struct *task; | ||
| 55 | }; | ||
| 56 | |||
| 57 | struct kthread_work { | ||
| 58 | struct list_head node; | ||
| 59 | kthread_work_func_t func; | ||
| 60 | wait_queue_head_t done; | ||
| 61 | atomic_t flushing; | ||
| 62 | int queue_seq; | ||
| 63 | int done_seq; | ||
| 64 | }; | ||
| 65 | |||
| 66 | #define KTHREAD_WORKER_INIT(worker) { \ | ||
| 67 | .lock = SPIN_LOCK_UNLOCKED, \ | ||
| 68 | .work_list = LIST_HEAD_INIT((worker).work_list), \ | ||
| 69 | } | ||
| 70 | |||
| 71 | #define KTHREAD_WORK_INIT(work, fn) { \ | ||
| 72 | .node = LIST_HEAD_INIT((work).node), \ | ||
| 73 | .func = (fn), \ | ||
| 74 | .done = __WAIT_QUEUE_HEAD_INITIALIZER((work).done), \ | ||
| 75 | .flushing = ATOMIC_INIT(0), \ | ||
| 76 | } | ||
| 77 | |||
| 78 | #define DEFINE_KTHREAD_WORKER(worker) \ | ||
| 79 | struct kthread_worker worker = KTHREAD_WORKER_INIT(worker) | ||
| 80 | |||
| 81 | #define DEFINE_KTHREAD_WORK(work, fn) \ | ||
| 82 | struct kthread_work work = KTHREAD_WORK_INIT(work, fn) | ||
| 83 | |||
| 84 | static inline void init_kthread_worker(struct kthread_worker *worker) | ||
| 85 | { | ||
| 86 | *worker = (struct kthread_worker)KTHREAD_WORKER_INIT(*worker); | ||
| 87 | } | ||
| 88 | |||
| 89 | static inline void init_kthread_work(struct kthread_work *work, | ||
| 90 | kthread_work_func_t fn) | ||
| 91 | { | ||
| 92 | *work = (struct kthread_work)KTHREAD_WORK_INIT(*work, fn); | ||
| 93 | } | ||
| 94 | |||
| 95 | int kthread_worker_fn(void *worker_ptr); | ||
| 96 | |||
| 97 | bool queue_kthread_work(struct kthread_worker *worker, | ||
| 98 | struct kthread_work *work); | ||
| 99 | void flush_kthread_work(struct kthread_work *work); | ||
| 100 | void flush_kthread_worker(struct kthread_worker *worker); | ||
| 101 | |||
| 37 | #endif /* _LINUX_KTHREAD_H */ | 102 | #endif /* _LINUX_KTHREAD_H */ |
diff --git a/include/linux/kvm.h b/include/linux/kvm.h index 23ea02253900..636fc381c897 100644 --- a/include/linux/kvm.h +++ b/include/linux/kvm.h | |||
| @@ -524,6 +524,12 @@ struct kvm_enable_cap { | |||
| 524 | #define KVM_CAP_PPC_OSI 52 | 524 | #define KVM_CAP_PPC_OSI 52 |
| 525 | #define KVM_CAP_PPC_UNSET_IRQ 53 | 525 | #define KVM_CAP_PPC_UNSET_IRQ 53 |
| 526 | #define KVM_CAP_ENABLE_CAP 54 | 526 | #define KVM_CAP_ENABLE_CAP 54 |
| 527 | #ifdef __KVM_HAVE_XSAVE | ||
| 528 | #define KVM_CAP_XSAVE 55 | ||
| 529 | #endif | ||
| 530 | #ifdef __KVM_HAVE_XCRS | ||
| 531 | #define KVM_CAP_XCRS 56 | ||
| 532 | #endif | ||
| 527 | 533 | ||
| 528 | #ifdef KVM_CAP_IRQ_ROUTING | 534 | #ifdef KVM_CAP_IRQ_ROUTING |
| 529 | 535 | ||
| @@ -613,6 +619,7 @@ struct kvm_clock_data { | |||
| 613 | */ | 619 | */ |
| 614 | #define KVM_CREATE_VCPU _IO(KVMIO, 0x41) | 620 | #define KVM_CREATE_VCPU _IO(KVMIO, 0x41) |
| 615 | #define KVM_GET_DIRTY_LOG _IOW(KVMIO, 0x42, struct kvm_dirty_log) | 621 | #define KVM_GET_DIRTY_LOG _IOW(KVMIO, 0x42, struct kvm_dirty_log) |
| 622 | /* KVM_SET_MEMORY_ALIAS is obsolete: */ | ||
| 616 | #define KVM_SET_MEMORY_ALIAS _IOW(KVMIO, 0x43, struct kvm_memory_alias) | 623 | #define KVM_SET_MEMORY_ALIAS _IOW(KVMIO, 0x43, struct kvm_memory_alias) |
| 617 | #define KVM_SET_NR_MMU_PAGES _IO(KVMIO, 0x44) | 624 | #define KVM_SET_NR_MMU_PAGES _IO(KVMIO, 0x44) |
| 618 | #define KVM_GET_NR_MMU_PAGES _IO(KVMIO, 0x45) | 625 | #define KVM_GET_NR_MMU_PAGES _IO(KVMIO, 0x45) |
| @@ -714,6 +721,12 @@ struct kvm_clock_data { | |||
| 714 | #define KVM_GET_DEBUGREGS _IOR(KVMIO, 0xa1, struct kvm_debugregs) | 721 | #define KVM_GET_DEBUGREGS _IOR(KVMIO, 0xa1, struct kvm_debugregs) |
| 715 | #define KVM_SET_DEBUGREGS _IOW(KVMIO, 0xa2, struct kvm_debugregs) | 722 | #define KVM_SET_DEBUGREGS _IOW(KVMIO, 0xa2, struct kvm_debugregs) |
| 716 | #define KVM_ENABLE_CAP _IOW(KVMIO, 0xa3, struct kvm_enable_cap) | 723 | #define KVM_ENABLE_CAP _IOW(KVMIO, 0xa3, struct kvm_enable_cap) |
| 724 | /* Available with KVM_CAP_XSAVE */ | ||
| 725 | #define KVM_GET_XSAVE _IOR(KVMIO, 0xa4, struct kvm_xsave) | ||
| 726 | #define KVM_SET_XSAVE _IOW(KVMIO, 0xa5, struct kvm_xsave) | ||
| 727 | /* Available with KVM_CAP_XCRS */ | ||
| 728 | #define KVM_GET_XCRS _IOR(KVMIO, 0xa6, struct kvm_xcrs) | ||
| 729 | #define KVM_SET_XCRS _IOW(KVMIO, 0xa7, struct kvm_xcrs) | ||
| 717 | 730 | ||
| 718 | #define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0) | 731 | #define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0) |
| 719 | 732 | ||
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 7cb116afa1cd..c13cc48697aa 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
| @@ -81,13 +81,14 @@ struct kvm_vcpu { | |||
| 81 | int vcpu_id; | 81 | int vcpu_id; |
| 82 | struct mutex mutex; | 82 | struct mutex mutex; |
| 83 | int cpu; | 83 | int cpu; |
| 84 | atomic_t guest_mode; | ||
| 84 | struct kvm_run *run; | 85 | struct kvm_run *run; |
| 85 | unsigned long requests; | 86 | unsigned long requests; |
| 86 | unsigned long guest_debug; | 87 | unsigned long guest_debug; |
| 87 | int srcu_idx; | 88 | int srcu_idx; |
| 88 | 89 | ||
| 89 | int fpu_active; | 90 | int fpu_active; |
| 90 | int guest_fpu_loaded; | 91 | int guest_fpu_loaded, guest_xcr0_loaded; |
| 91 | wait_queue_head_t wq; | 92 | wait_queue_head_t wq; |
| 92 | int sigset_active; | 93 | int sigset_active; |
| 93 | sigset_t sigset; | 94 | sigset_t sigset; |
| @@ -123,6 +124,7 @@ struct kvm_memory_slot { | |||
| 123 | } *lpage_info[KVM_NR_PAGE_SIZES - 1]; | 124 | } *lpage_info[KVM_NR_PAGE_SIZES - 1]; |
| 124 | unsigned long userspace_addr; | 125 | unsigned long userspace_addr; |
| 125 | int user_alloc; | 126 | int user_alloc; |
| 127 | int id; | ||
| 126 | }; | 128 | }; |
| 127 | 129 | ||
| 128 | static inline unsigned long kvm_dirty_bitmap_bytes(struct kvm_memory_slot *memslot) | 130 | static inline unsigned long kvm_dirty_bitmap_bytes(struct kvm_memory_slot *memslot) |
| @@ -266,6 +268,8 @@ extern pfn_t bad_pfn; | |||
| 266 | 268 | ||
| 267 | int is_error_page(struct page *page); | 269 | int is_error_page(struct page *page); |
| 268 | int is_error_pfn(pfn_t pfn); | 270 | int is_error_pfn(pfn_t pfn); |
| 271 | int is_hwpoison_pfn(pfn_t pfn); | ||
| 272 | int is_fault_pfn(pfn_t pfn); | ||
| 269 | int kvm_is_error_hva(unsigned long addr); | 273 | int kvm_is_error_hva(unsigned long addr); |
| 270 | int kvm_set_memory_region(struct kvm *kvm, | 274 | int kvm_set_memory_region(struct kvm *kvm, |
| 271 | struct kvm_userspace_memory_region *mem, | 275 | struct kvm_userspace_memory_region *mem, |
| @@ -284,8 +288,6 @@ void kvm_arch_commit_memory_region(struct kvm *kvm, | |||
| 284 | int user_alloc); | 288 | int user_alloc); |
| 285 | void kvm_disable_largepages(void); | 289 | void kvm_disable_largepages(void); |
| 286 | void kvm_arch_flush_shadow(struct kvm *kvm); | 290 | void kvm_arch_flush_shadow(struct kvm *kvm); |
| 287 | gfn_t unalias_gfn(struct kvm *kvm, gfn_t gfn); | ||
| 288 | gfn_t unalias_gfn_instantiation(struct kvm *kvm, gfn_t gfn); | ||
| 289 | 291 | ||
| 290 | struct page *gfn_to_page(struct kvm *kvm, gfn_t gfn); | 292 | struct page *gfn_to_page(struct kvm *kvm, gfn_t gfn); |
| 291 | unsigned long gfn_to_hva(struct kvm *kvm, gfn_t gfn); | 293 | unsigned long gfn_to_hva(struct kvm *kvm, gfn_t gfn); |
| @@ -445,7 +447,8 @@ void kvm_register_irq_mask_notifier(struct kvm *kvm, int irq, | |||
| 445 | struct kvm_irq_mask_notifier *kimn); | 447 | struct kvm_irq_mask_notifier *kimn); |
| 446 | void kvm_unregister_irq_mask_notifier(struct kvm *kvm, int irq, | 448 | void kvm_unregister_irq_mask_notifier(struct kvm *kvm, int irq, |
| 447 | struct kvm_irq_mask_notifier *kimn); | 449 | struct kvm_irq_mask_notifier *kimn); |
| 448 | void kvm_fire_mask_notifiers(struct kvm *kvm, int irq, bool mask); | 450 | void kvm_fire_mask_notifiers(struct kvm *kvm, unsigned irqchip, unsigned pin, |
| 451 | bool mask); | ||
| 449 | 452 | ||
| 450 | #ifdef __KVM_HAVE_IOAPIC | 453 | #ifdef __KVM_HAVE_IOAPIC |
| 451 | void kvm_get_intr_delivery_bitmask(struct kvm_ioapic *ioapic, | 454 | void kvm_get_intr_delivery_bitmask(struct kvm_ioapic *ioapic, |
| @@ -562,10 +565,6 @@ static inline int mmu_notifier_retry(struct kvm_vcpu *vcpu, unsigned long mmu_se | |||
| 562 | } | 565 | } |
| 563 | #endif | 566 | #endif |
| 564 | 567 | ||
| 565 | #ifndef KVM_ARCH_HAS_UNALIAS_INSTANTIATION | ||
| 566 | #define unalias_gfn_instantiation unalias_gfn | ||
| 567 | #endif | ||
| 568 | |||
| 569 | #ifdef CONFIG_HAVE_KVM_IRQCHIP | 568 | #ifdef CONFIG_HAVE_KVM_IRQCHIP |
| 570 | 569 | ||
| 571 | #define KVM_MAX_IRQ_ROUTES 1024 | 570 | #define KVM_MAX_IRQ_ROUTES 1024 |
| @@ -628,5 +627,25 @@ static inline long kvm_vm_ioctl_assigned_device(struct kvm *kvm, unsigned ioctl, | |||
| 628 | 627 | ||
| 629 | #endif | 628 | #endif |
| 630 | 629 | ||
| 630 | static inline void kvm_make_request(int req, struct kvm_vcpu *vcpu) | ||
| 631 | { | ||
| 632 | set_bit(req, &vcpu->requests); | ||
| 633 | } | ||
| 634 | |||
| 635 | static inline bool kvm_make_check_request(int req, struct kvm_vcpu *vcpu) | ||
| 636 | { | ||
| 637 | return test_and_set_bit(req, &vcpu->requests); | ||
| 638 | } | ||
| 639 | |||
| 640 | static inline bool kvm_check_request(int req, struct kvm_vcpu *vcpu) | ||
| 641 | { | ||
| 642 | if (test_bit(req, &vcpu->requests)) { | ||
| 643 | clear_bit(req, &vcpu->requests); | ||
| 644 | return true; | ||
| 645 | } else { | ||
| 646 | return false; | ||
| 647 | } | ||
| 648 | } | ||
| 649 | |||
| 631 | #endif | 650 | #endif |
| 632 | 651 | ||
diff --git a/include/linux/kvm_types.h b/include/linux/kvm_types.h index fb46efbeabec..7ac0d4eee430 100644 --- a/include/linux/kvm_types.h +++ b/include/linux/kvm_types.h | |||
| @@ -32,11 +32,11 @@ | |||
| 32 | 32 | ||
| 33 | typedef unsigned long gva_t; | 33 | typedef unsigned long gva_t; |
| 34 | typedef u64 gpa_t; | 34 | typedef u64 gpa_t; |
| 35 | typedef unsigned long gfn_t; | 35 | typedef u64 gfn_t; |
| 36 | 36 | ||
| 37 | typedef unsigned long hva_t; | 37 | typedef unsigned long hva_t; |
| 38 | typedef u64 hpa_t; | 38 | typedef u64 hpa_t; |
| 39 | typedef unsigned long hfn_t; | 39 | typedef u64 hfn_t; |
| 40 | 40 | ||
| 41 | typedef hfn_t pfn_t; | 41 | typedef hfn_t pfn_t; |
| 42 | 42 | ||
diff --git a/include/linux/libata.h b/include/linux/libata.h index b85f3ff34d7d..f010f18a0f86 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
| @@ -751,6 +751,7 @@ struct ata_port { | |||
| 751 | struct ata_host *host; | 751 | struct ata_host *host; |
| 752 | struct device *dev; | 752 | struct device *dev; |
| 753 | 753 | ||
| 754 | struct mutex scsi_scan_mutex; | ||
| 754 | struct delayed_work hotplug_task; | 755 | struct delayed_work hotplug_task; |
| 755 | struct work_struct scsi_rescan_task; | 756 | struct work_struct scsi_rescan_task; |
| 756 | 757 | ||
diff --git a/include/linux/list.h b/include/linux/list.h index 5d57a3a1fa1b..d167b5d7c0ac 100644 --- a/include/linux/list.h +++ b/include/linux/list.h | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | #ifndef _LINUX_LIST_H | 1 | #ifndef _LINUX_LIST_H |
| 2 | #define _LINUX_LIST_H | 2 | #define _LINUX_LIST_H |
| 3 | 3 | ||
| 4 | #include <linux/types.h> | ||
| 4 | #include <linux/stddef.h> | 5 | #include <linux/stddef.h> |
| 5 | #include <linux/poison.h> | 6 | #include <linux/poison.h> |
| 6 | #include <linux/prefetch.h> | 7 | #include <linux/prefetch.h> |
| @@ -16,10 +17,6 @@ | |||
| 16 | * using the generic single-entry routines. | 17 | * using the generic single-entry routines. |
| 17 | */ | 18 | */ |
| 18 | 19 | ||
| 19 | struct list_head { | ||
| 20 | struct list_head *next, *prev; | ||
| 21 | }; | ||
| 22 | |||
| 23 | #define LIST_HEAD_INIT(name) { &(name), &(name) } | 20 | #define LIST_HEAD_INIT(name) { &(name), &(name) } |
| 24 | 21 | ||
| 25 | #define LIST_HEAD(name) \ | 22 | #define LIST_HEAD(name) \ |
| @@ -566,14 +563,6 @@ static inline void list_splice_tail_init(struct list_head *list, | |||
| 566 | * You lose the ability to access the tail in O(1). | 563 | * You lose the ability to access the tail in O(1). |
| 567 | */ | 564 | */ |
| 568 | 565 | ||
| 569 | struct hlist_head { | ||
| 570 | struct hlist_node *first; | ||
| 571 | }; | ||
| 572 | |||
| 573 | struct hlist_node { | ||
| 574 | struct hlist_node *next, **pprev; | ||
| 575 | }; | ||
| 576 | |||
| 577 | #define HLIST_HEAD_INIT { .first = NULL } | 566 | #define HLIST_HEAD_INIT { .first = NULL } |
| 578 | #define HLIST_HEAD(name) struct hlist_head name = { .first = NULL } | 567 | #define HLIST_HEAD(name) struct hlist_head name = { .first = NULL } |
| 579 | #define INIT_HLIST_HEAD(ptr) ((ptr)->first = NULL) | 568 | #define INIT_HLIST_HEAD(ptr) ((ptr)->first = NULL) |
diff --git a/include/linux/lru_cache.h b/include/linux/lru_cache.h index de48d167568b..78fbf24f357a 100644 --- a/include/linux/lru_cache.h +++ b/include/linux/lru_cache.h | |||
| @@ -262,7 +262,7 @@ extern void lc_seq_dump_details(struct seq_file *seq, struct lru_cache *lc, char | |||
| 262 | * @lc: the lru cache to operate on | 262 | * @lc: the lru cache to operate on |
| 263 | * | 263 | * |
| 264 | * Note that the reference counts and order on the active and lru lists may | 264 | * Note that the reference counts and order on the active and lru lists may |
| 265 | * still change. Returns true if we aquired the lock. | 265 | * still change. Returns true if we acquired the lock. |
| 266 | */ | 266 | */ |
| 267 | static inline int lc_try_lock(struct lru_cache *lc) | 267 | static inline int lc_try_lock(struct lru_cache *lc) |
| 268 | { | 268 | { |
diff --git a/include/linux/lsm_audit.h b/include/linux/lsm_audit.h index 6907251d5200..112a55033352 100644 --- a/include/linux/lsm_audit.h +++ b/include/linux/lsm_audit.h | |||
| @@ -90,10 +90,42 @@ struct common_audit_data { | |||
| 90 | u32 requested; | 90 | u32 requested; |
| 91 | u32 audited; | 91 | u32 audited; |
| 92 | u32 denied; | 92 | u32 denied; |
| 93 | /* | ||
| 94 | * auditdeny is a bit tricky and unintuitive. See the | ||
| 95 | * comments in avc.c for it's meaning and usage. | ||
| 96 | */ | ||
| 97 | u32 auditdeny; | ||
| 93 | struct av_decision *avd; | 98 | struct av_decision *avd; |
| 94 | int result; | 99 | int result; |
| 95 | } selinux_audit_data; | 100 | } selinux_audit_data; |
| 96 | #endif | 101 | #endif |
| 102 | #ifdef CONFIG_SECURITY_APPARMOR | ||
| 103 | struct { | ||
| 104 | int error; | ||
| 105 | int op; | ||
| 106 | int type; | ||
| 107 | void *profile; | ||
| 108 | const char *name; | ||
| 109 | const char *info; | ||
| 110 | union { | ||
| 111 | void *target; | ||
| 112 | struct { | ||
| 113 | long pos; | ||
| 114 | void *target; | ||
| 115 | } iface; | ||
| 116 | struct { | ||
| 117 | int rlim; | ||
| 118 | unsigned long max; | ||
| 119 | } rlim; | ||
| 120 | struct { | ||
| 121 | const char *target; | ||
| 122 | u32 request; | ||
| 123 | u32 denied; | ||
| 124 | uid_t ouid; | ||
| 125 | } fs; | ||
| 126 | }; | ||
| 127 | } apparmor_audit_data; | ||
| 128 | #endif | ||
| 97 | }; | 129 | }; |
| 98 | /* these callback will be implemented by a specific LSM */ | 130 | /* these callback will be implemented by a specific LSM */ |
| 99 | void (*lsm_pre_audit)(struct audit_buffer *, void *); | 131 | void (*lsm_pre_audit)(struct audit_buffer *, void *); |
diff --git a/include/linux/mISDNif.h b/include/linux/mISDNif.h index 78c3bed1c3f5..b5e7f2202484 100644 --- a/include/linux/mISDNif.h +++ b/include/linux/mISDNif.h | |||
| @@ -251,7 +251,7 @@ | |||
| 251 | struct mISDNhead { | 251 | struct mISDNhead { |
| 252 | unsigned int prim; | 252 | unsigned int prim; |
| 253 | unsigned int id; | 253 | unsigned int id; |
| 254 | } __attribute__((packed)); | 254 | } __packed; |
| 255 | 255 | ||
| 256 | #define MISDN_HEADER_LEN sizeof(struct mISDNhead) | 256 | #define MISDN_HEADER_LEN sizeof(struct mISDNhead) |
| 257 | #define MAX_DATA_SIZE 2048 | 257 | #define MAX_DATA_SIZE 2048 |
diff --git a/include/linux/marvell_phy.h b/include/linux/marvell_phy.h new file mode 100644 index 000000000000..d0f08018335d --- /dev/null +++ b/include/linux/marvell_phy.h | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | #ifndef _MARVELL_PHY_H | ||
| 2 | #define _MARVELL_PHY_H | ||
| 3 | |||
| 4 | /* Mask used for ID comparisons */ | ||
| 5 | #define MARVELL_PHY_ID_MASK 0xfffffff0 | ||
| 6 | |||
| 7 | /* Known PHY IDs */ | ||
| 8 | #define MARVELL_PHY_ID_88E1101 0x01410c60 | ||
| 9 | #define MARVELL_PHY_ID_88E1112 0x01410c90 | ||
| 10 | #define MARVELL_PHY_ID_88E1111 0x01410cc0 | ||
| 11 | #define MARVELL_PHY_ID_88E1118 0x01410e10 | ||
| 12 | #define MARVELL_PHY_ID_88E1121R 0x01410cb0 | ||
| 13 | #define MARVELL_PHY_ID_88E1145 0x01410cd0 | ||
| 14 | #define MARVELL_PHY_ID_88E1240 0x01410e30 | ||
| 15 | #define MARVELL_PHY_ID_88EC048 0x01410e90 | ||
| 16 | |||
| 17 | /* struct phy_device dev_flags definitions */ | ||
| 18 | #define MARVELL_PHY_M1145_FLAGS_RESISTANCE 0x00000001 | ||
| 19 | #define MARVELL_PHY_M1118_DNS323_LEDS 0x00000002 | ||
| 20 | |||
| 21 | #endif /* _MARVELL_PHY_H */ | ||
diff --git a/include/linux/mm.h b/include/linux/mm.h index b969efb03787..7a9ab7db1975 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
| @@ -999,7 +999,7 @@ static inline void sync_mm_rss(struct task_struct *task, struct mm_struct *mm) | |||
| 999 | * querying the cache size, so a fastpath for that case is appropriate. | 999 | * querying the cache size, so a fastpath for that case is appropriate. |
| 1000 | */ | 1000 | */ |
| 1001 | struct shrinker { | 1001 | struct shrinker { |
| 1002 | int (*shrink)(int nr_to_scan, gfp_t gfp_mask); | 1002 | int (*shrink)(struct shrinker *, int nr_to_scan, gfp_t gfp_mask); |
| 1003 | int seeks; /* seeks to recreate an obj */ | 1003 | int seeks; /* seeks to recreate an obj */ |
| 1004 | 1004 | ||
| 1005 | /* These are for internal use */ | 1005 | /* These are for internal use */ |
| @@ -1465,6 +1465,14 @@ extern int sysctl_memory_failure_recovery; | |||
| 1465 | extern void shake_page(struct page *p, int access); | 1465 | extern void shake_page(struct page *p, int access); |
| 1466 | extern atomic_long_t mce_bad_pages; | 1466 | extern atomic_long_t mce_bad_pages; |
| 1467 | extern int soft_offline_page(struct page *page, int flags); | 1467 | extern int soft_offline_page(struct page *page, int flags); |
| 1468 | #ifdef CONFIG_MEMORY_FAILURE | ||
| 1469 | int is_hwpoison_address(unsigned long addr); | ||
| 1470 | #else | ||
| 1471 | static inline int is_hwpoison_address(unsigned long addr) | ||
| 1472 | { | ||
| 1473 | return 0; | ||
| 1474 | } | ||
| 1475 | #endif | ||
| 1468 | 1476 | ||
| 1469 | extern void dump_page(struct page *page); | 1477 | extern void dump_page(struct page *page); |
| 1470 | 1478 | ||
diff --git a/include/linux/msi.h b/include/linux/msi.h index 6991ab5b24d1..91b05c171854 100644 --- a/include/linux/msi.h +++ b/include/linux/msi.h | |||
| @@ -14,8 +14,10 @@ struct irq_desc; | |||
| 14 | extern void mask_msi_irq(unsigned int irq); | 14 | extern void mask_msi_irq(unsigned int irq); |
| 15 | extern void unmask_msi_irq(unsigned int irq); | 15 | extern void unmask_msi_irq(unsigned int irq); |
| 16 | extern void read_msi_msg_desc(struct irq_desc *desc, struct msi_msg *msg); | 16 | extern void read_msi_msg_desc(struct irq_desc *desc, struct msi_msg *msg); |
| 17 | extern void get_cached_msi_msg_desc(struct irq_desc *desc, struct msi_msg *msg); | ||
| 17 | extern void write_msi_msg_desc(struct irq_desc *desc, struct msi_msg *msg); | 18 | extern void write_msi_msg_desc(struct irq_desc *desc, struct msi_msg *msg); |
| 18 | extern void read_msi_msg(unsigned int irq, struct msi_msg *msg); | 19 | extern void read_msi_msg(unsigned int irq, struct msi_msg *msg); |
| 20 | extern void get_cached_msi_msg(unsigned int irq, struct msi_msg *msg); | ||
| 19 | extern void write_msi_msg(unsigned int irq, struct msi_msg *msg); | 21 | extern void write_msi_msg(unsigned int irq, struct msi_msg *msg); |
| 20 | 22 | ||
| 21 | struct msi_desc { | 23 | struct msi_desc { |
diff --git a/include/linux/nbd.h b/include/linux/nbd.h index 155719dab813..bb58854a8061 100644 --- a/include/linux/nbd.h +++ b/include/linux/nbd.h | |||
| @@ -88,7 +88,7 @@ struct nbd_request { | |||
| 88 | char handle[8]; | 88 | char handle[8]; |
| 89 | __be64 from; | 89 | __be64 from; |
| 90 | __be32 len; | 90 | __be32 len; |
| 91 | } __attribute__ ((packed)); | 91 | } __packed; |
| 92 | 92 | ||
| 93 | /* | 93 | /* |
| 94 | * This is the reply packet that nbd-server sends back to the client after | 94 | * This is the reply packet that nbd-server sends back to the client after |
diff --git a/include/linux/ncp.h b/include/linux/ncp.h index 99f0adeeb3f3..3ace8370e61e 100644 --- a/include/linux/ncp.h +++ b/include/linux/ncp.h | |||
| @@ -27,7 +27,7 @@ struct ncp_request_header { | |||
| 27 | __u8 conn_high; | 27 | __u8 conn_high; |
| 28 | __u8 function; | 28 | __u8 function; |
| 29 | __u8 data[0]; | 29 | __u8 data[0]; |
| 30 | } __attribute__((packed)); | 30 | } __packed; |
| 31 | 31 | ||
| 32 | #define NCP_REPLY (0x3333) | 32 | #define NCP_REPLY (0x3333) |
| 33 | #define NCP_WATCHDOG (0x3E3E) | 33 | #define NCP_WATCHDOG (0x3E3E) |
| @@ -42,7 +42,7 @@ struct ncp_reply_header { | |||
| 42 | __u8 completion_code; | 42 | __u8 completion_code; |
| 43 | __u8 connection_state; | 43 | __u8 connection_state; |
| 44 | __u8 data[0]; | 44 | __u8 data[0]; |
| 45 | } __attribute__((packed)); | 45 | } __packed; |
| 46 | 46 | ||
| 47 | #define NCP_VOLNAME_LEN (16) | 47 | #define NCP_VOLNAME_LEN (16) |
| 48 | #define NCP_NUMBER_OF_VOLUMES (256) | 48 | #define NCP_NUMBER_OF_VOLUMES (256) |
| @@ -158,7 +158,7 @@ struct nw_info_struct { | |||
| 158 | #ifdef __KERNEL__ | 158 | #ifdef __KERNEL__ |
| 159 | struct nw_nfs_info nfs; | 159 | struct nw_nfs_info nfs; |
| 160 | #endif | 160 | #endif |
| 161 | } __attribute__((packed)); | 161 | } __packed; |
| 162 | 162 | ||
| 163 | /* modify mask - use with MODIFY_DOS_INFO structure */ | 163 | /* modify mask - use with MODIFY_DOS_INFO structure */ |
| 164 | #define DM_ATTRIBUTES (cpu_to_le32(0x02)) | 164 | #define DM_ATTRIBUTES (cpu_to_le32(0x02)) |
| @@ -190,12 +190,12 @@ struct nw_modify_dos_info { | |||
| 190 | __u16 inheritanceGrantMask; | 190 | __u16 inheritanceGrantMask; |
| 191 | __u16 inheritanceRevokeMask; | 191 | __u16 inheritanceRevokeMask; |
| 192 | __u32 maximumSpace; | 192 | __u32 maximumSpace; |
| 193 | } __attribute__((packed)); | 193 | } __packed; |
| 194 | 194 | ||
| 195 | struct nw_search_sequence { | 195 | struct nw_search_sequence { |
| 196 | __u8 volNumber; | 196 | __u8 volNumber; |
| 197 | __u32 dirBase; | 197 | __u32 dirBase; |
| 198 | __u32 sequence; | 198 | __u32 sequence; |
| 199 | } __attribute__((packed)); | 199 | } __packed; |
| 200 | 200 | ||
| 201 | #endif /* _LINUX_NCP_H */ | 201 | #endif /* _LINUX_NCP_H */ |
diff --git a/include/linux/ncp_fs_sb.h b/include/linux/ncp_fs_sb.h index 5ec9ca671687..8da05bc098ca 100644 --- a/include/linux/ncp_fs_sb.h +++ b/include/linux/ncp_fs_sb.h | |||
| @@ -104,13 +104,13 @@ struct ncp_server { | |||
| 104 | 104 | ||
| 105 | unsigned int state; /* STREAM only: receiver state */ | 105 | unsigned int state; /* STREAM only: receiver state */ |
| 106 | struct { | 106 | struct { |
| 107 | __u32 magic __attribute__((packed)); | 107 | __u32 magic __packed; |
| 108 | __u32 len __attribute__((packed)); | 108 | __u32 len __packed; |
| 109 | __u16 type __attribute__((packed)); | 109 | __u16 type __packed; |
| 110 | __u16 p1 __attribute__((packed)); | 110 | __u16 p1 __packed; |
| 111 | __u16 p2 __attribute__((packed)); | 111 | __u16 p2 __packed; |
| 112 | __u16 p3 __attribute__((packed)); | 112 | __u16 p3 __packed; |
| 113 | __u16 type2 __attribute__((packed)); | 113 | __u16 type2 __packed; |
| 114 | } buf; /* STREAM only: temporary buffer */ | 114 | } buf; /* STREAM only: temporary buffer */ |
| 115 | unsigned char* ptr; /* STREAM only: pointer to data */ | 115 | unsigned char* ptr; /* STREAM only: pointer to data */ |
| 116 | size_t len; /* STREAM only: length of data to receive */ | 116 | size_t len; /* STREAM only: length of data to receive */ |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index b21e4054c12c..46c36ffe20ee 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
| @@ -54,6 +54,7 @@ | |||
| 54 | 54 | ||
| 55 | struct vlan_group; | 55 | struct vlan_group; |
| 56 | struct netpoll_info; | 56 | struct netpoll_info; |
| 57 | struct phy_device; | ||
| 57 | /* 802.11 specific */ | 58 | /* 802.11 specific */ |
| 58 | struct wireless_dev; | 59 | struct wireless_dev; |
| 59 | /* source back-compat hooks */ | 60 | /* source back-compat hooks */ |
| @@ -65,6 +66,11 @@ struct wireless_dev; | |||
| 65 | #define HAVE_FREE_NETDEV /* free_netdev() */ | 66 | #define HAVE_FREE_NETDEV /* free_netdev() */ |
| 66 | #define HAVE_NETDEV_PRIV /* netdev_priv() */ | 67 | #define HAVE_NETDEV_PRIV /* netdev_priv() */ |
| 67 | 68 | ||
| 69 | /* hardware address assignment types */ | ||
| 70 | #define NET_ADDR_PERM 0 /* address is permanent (default) */ | ||
| 71 | #define NET_ADDR_RANDOM 1 /* address is generated randomly */ | ||
| 72 | #define NET_ADDR_STOLEN 2 /* address is stolen from other device */ | ||
| 73 | |||
| 68 | /* Backlog congestion levels */ | 74 | /* Backlog congestion levels */ |
| 69 | #define NET_RX_SUCCESS 0 /* keep 'em coming, baby */ | 75 | #define NET_RX_SUCCESS 0 /* keep 'em coming, baby */ |
| 70 | #define NET_RX_DROP 1 /* packet dropped */ | 76 | #define NET_RX_DROP 1 /* packet dropped */ |
| @@ -159,45 +165,39 @@ static inline bool dev_xmit_complete(int rc) | |||
| 159 | #define MAX_HEADER (LL_MAX_HEADER + 48) | 165 | #define MAX_HEADER (LL_MAX_HEADER + 48) |
| 160 | #endif | 166 | #endif |
| 161 | 167 | ||
| 162 | #endif /* __KERNEL__ */ | ||
| 163 | |||
| 164 | /* | 168 | /* |
| 165 | * Network device statistics. Akin to the 2.0 ether stats but | 169 | * Old network device statistics. Fields are native words |
| 166 | * with byte counters. | 170 | * (unsigned long) so they can be read and written atomically. |
| 167 | */ | 171 | */ |
| 168 | 172 | ||
| 169 | struct net_device_stats { | 173 | struct net_device_stats { |
| 170 | unsigned long rx_packets; /* total packets received */ | 174 | unsigned long rx_packets; |
| 171 | unsigned long tx_packets; /* total packets transmitted */ | 175 | unsigned long tx_packets; |
| 172 | unsigned long rx_bytes; /* total bytes received */ | 176 | unsigned long rx_bytes; |
| 173 | unsigned long tx_bytes; /* total bytes transmitted */ | 177 | unsigned long tx_bytes; |
| 174 | unsigned long rx_errors; /* bad packets received */ | 178 | unsigned long rx_errors; |
| 175 | unsigned long tx_errors; /* packet transmit problems */ | 179 | unsigned long tx_errors; |
| 176 | unsigned long rx_dropped; /* no space in linux buffers */ | 180 | unsigned long rx_dropped; |
| 177 | unsigned long tx_dropped; /* no space available in linux */ | 181 | unsigned long tx_dropped; |
| 178 | unsigned long multicast; /* multicast packets received */ | 182 | unsigned long multicast; |
| 179 | unsigned long collisions; | 183 | unsigned long collisions; |
| 180 | |||
| 181 | /* detailed rx_errors: */ | ||
| 182 | unsigned long rx_length_errors; | 184 | unsigned long rx_length_errors; |
| 183 | unsigned long rx_over_errors; /* receiver ring buff overflow */ | 185 | unsigned long rx_over_errors; |
| 184 | unsigned long rx_crc_errors; /* recved pkt with crc error */ | 186 | unsigned long rx_crc_errors; |
| 185 | unsigned long rx_frame_errors; /* recv'd frame alignment error */ | 187 | unsigned long rx_frame_errors; |
| 186 | unsigned long rx_fifo_errors; /* recv'r fifo overrun */ | 188 | unsigned long rx_fifo_errors; |
| 187 | unsigned long rx_missed_errors; /* receiver missed packet */ | 189 | unsigned long rx_missed_errors; |
| 188 | |||
| 189 | /* detailed tx_errors */ | ||
| 190 | unsigned long tx_aborted_errors; | 190 | unsigned long tx_aborted_errors; |
| 191 | unsigned long tx_carrier_errors; | 191 | unsigned long tx_carrier_errors; |
| 192 | unsigned long tx_fifo_errors; | 192 | unsigned long tx_fifo_errors; |
| 193 | unsigned long tx_heartbeat_errors; | 193 | unsigned long tx_heartbeat_errors; |
| 194 | unsigned long tx_window_errors; | 194 | unsigned long tx_window_errors; |
| 195 | |||
| 196 | /* for cslip etc */ | ||
| 197 | unsigned long rx_compressed; | 195 | unsigned long rx_compressed; |
| 198 | unsigned long tx_compressed; | 196 | unsigned long tx_compressed; |
| 199 | }; | 197 | }; |
| 200 | 198 | ||
| 199 | #endif /* __KERNEL__ */ | ||
| 200 | |||
| 201 | 201 | ||
| 202 | /* Media selection options. */ | 202 | /* Media selection options. */ |
| 203 | enum { | 203 | enum { |
| @@ -381,6 +381,8 @@ enum gro_result { | |||
| 381 | }; | 381 | }; |
| 382 | typedef enum gro_result gro_result_t; | 382 | typedef enum gro_result gro_result_t; |
| 383 | 383 | ||
| 384 | typedef struct sk_buff *rx_handler_func_t(struct sk_buff *skb); | ||
| 385 | |||
| 384 | extern void __napi_schedule(struct napi_struct *n); | 386 | extern void __napi_schedule(struct napi_struct *n); |
| 385 | 387 | ||
| 386 | static inline int napi_disable_pending(struct napi_struct *n) | 388 | static inline int napi_disable_pending(struct napi_struct *n) |
| @@ -504,9 +506,9 @@ struct netdev_queue { | |||
| 504 | * please use this field instead of dev->trans_start | 506 | * please use this field instead of dev->trans_start |
| 505 | */ | 507 | */ |
| 506 | unsigned long trans_start; | 508 | unsigned long trans_start; |
| 507 | unsigned long tx_bytes; | 509 | u64 tx_bytes; |
| 508 | unsigned long tx_packets; | 510 | u64 tx_packets; |
| 509 | unsigned long tx_dropped; | 511 | u64 tx_dropped; |
| 510 | } ____cacheline_aligned_in_smp; | 512 | } ____cacheline_aligned_in_smp; |
| 511 | 513 | ||
| 512 | #ifdef CONFIG_RPS | 514 | #ifdef CONFIG_RPS |
| @@ -660,10 +662,19 @@ struct netdev_rx_queue { | |||
| 660 | * Callback uses when the transmitter has not made any progress | 662 | * Callback uses when the transmitter has not made any progress |
| 661 | * for dev->watchdog ticks. | 663 | * for dev->watchdog ticks. |
| 662 | * | 664 | * |
| 665 | * struct rtnl_link_stats64* (*ndo_get_stats64)(struct net_device *dev, | ||
| 666 | * struct rtnl_link_stats64 *storage); | ||
| 663 | * struct net_device_stats* (*ndo_get_stats)(struct net_device *dev); | 667 | * struct net_device_stats* (*ndo_get_stats)(struct net_device *dev); |
| 664 | * Called when a user wants to get the network device usage | 668 | * Called when a user wants to get the network device usage |
| 665 | * statistics. If not defined, the counters in dev->stats will | 669 | * statistics. Drivers must do one of the following: |
| 666 | * be used. | 670 | * 1. Define @ndo_get_stats64 to fill in a zero-initialised |
| 671 | * rtnl_link_stats64 structure passed by the caller. | ||
| 672 | * 2. Define @ndo_get_stats to update a net_device_stats structure | ||
| 673 | * (which should normally be dev->stats) and return a pointer to | ||
| 674 | * it. The structure may be changed asynchronously only if each | ||
| 675 | * field is written atomically. | ||
| 676 | * 3. Update dev->stats asynchronously and atomically, and define | ||
| 677 | * neither operation. | ||
| 667 | * | 678 | * |
| 668 | * void (*ndo_vlan_rx_register)(struct net_device *dev, struct vlan_group *grp); | 679 | * void (*ndo_vlan_rx_register)(struct net_device *dev, struct vlan_group *grp); |
| 669 | * If device support VLAN receive accleration | 680 | * If device support VLAN receive accleration |
| @@ -718,6 +729,8 @@ struct net_device_ops { | |||
| 718 | struct neigh_parms *); | 729 | struct neigh_parms *); |
| 719 | void (*ndo_tx_timeout) (struct net_device *dev); | 730 | void (*ndo_tx_timeout) (struct net_device *dev); |
| 720 | 731 | ||
| 732 | struct rtnl_link_stats64* (*ndo_get_stats64)(struct net_device *dev, | ||
| 733 | struct rtnl_link_stats64 *storage); | ||
| 721 | struct net_device_stats* (*ndo_get_stats)(struct net_device *dev); | 734 | struct net_device_stats* (*ndo_get_stats)(struct net_device *dev); |
| 722 | 735 | ||
| 723 | void (*ndo_vlan_rx_register)(struct net_device *dev, | 736 | void (*ndo_vlan_rx_register)(struct net_device *dev, |
| @@ -728,6 +741,8 @@ struct net_device_ops { | |||
| 728 | unsigned short vid); | 741 | unsigned short vid); |
| 729 | #ifdef CONFIG_NET_POLL_CONTROLLER | 742 | #ifdef CONFIG_NET_POLL_CONTROLLER |
| 730 | void (*ndo_poll_controller)(struct net_device *dev); | 743 | void (*ndo_poll_controller)(struct net_device *dev); |
| 744 | int (*ndo_netpoll_setup)(struct net_device *dev, | ||
| 745 | struct netpoll_info *info); | ||
| 731 | void (*ndo_netpoll_cleanup)(struct net_device *dev); | 746 | void (*ndo_netpoll_cleanup)(struct net_device *dev); |
| 732 | #endif | 747 | #endif |
| 733 | int (*ndo_set_vf_mac)(struct net_device *dev, | 748 | int (*ndo_set_vf_mac)(struct net_device *dev, |
| @@ -775,11 +790,11 @@ struct net_device { | |||
| 775 | /* | 790 | /* |
| 776 | * This is the first field of the "visible" part of this structure | 791 | * This is the first field of the "visible" part of this structure |
| 777 | * (i.e. as seen by users in the "Space.c" file). It is the name | 792 | * (i.e. as seen by users in the "Space.c" file). It is the name |
| 778 | * the interface. | 793 | * of the interface. |
| 779 | */ | 794 | */ |
| 780 | char name[IFNAMSIZ]; | 795 | char name[IFNAMSIZ]; |
| 781 | 796 | ||
| 782 | struct pm_qos_request_list *pm_qos_req; | 797 | struct pm_qos_request_list pm_qos_req; |
| 783 | 798 | ||
| 784 | /* device name hash chain */ | 799 | /* device name hash chain */ |
| 785 | struct hlist_node name_hlist; | 800 | struct hlist_node name_hlist; |
| @@ -847,7 +862,8 @@ struct net_device { | |||
| 847 | #define NETIF_F_FSO (SKB_GSO_FCOE << NETIF_F_GSO_SHIFT) | 862 | #define NETIF_F_FSO (SKB_GSO_FCOE << NETIF_F_GSO_SHIFT) |
| 848 | 863 | ||
| 849 | /* List of features with software fallbacks. */ | 864 | /* List of features with software fallbacks. */ |
| 850 | #define NETIF_F_GSO_SOFTWARE (NETIF_F_TSO | NETIF_F_TSO_ECN | NETIF_F_TSO6) | 865 | #define NETIF_F_GSO_SOFTWARE (NETIF_F_TSO | NETIF_F_TSO_ECN | \ |
| 866 | NETIF_F_TSO6 | NETIF_F_UFO) | ||
| 851 | 867 | ||
| 852 | 868 | ||
| 853 | #define NETIF_F_GEN_CSUM (NETIF_F_NO_CSUM | NETIF_F_HW_CSUM) | 869 | #define NETIF_F_GEN_CSUM (NETIF_F_NO_CSUM | NETIF_F_HW_CSUM) |
| @@ -908,6 +924,7 @@ struct net_device { | |||
| 908 | 924 | ||
| 909 | /* Interface address info. */ | 925 | /* Interface address info. */ |
| 910 | unsigned char perm_addr[MAX_ADDR_LEN]; /* permanent hw address */ | 926 | unsigned char perm_addr[MAX_ADDR_LEN]; /* permanent hw address */ |
| 927 | unsigned char addr_assign_type; /* hw address assignment type */ | ||
| 911 | unsigned char addr_len; /* hardware address length */ | 928 | unsigned char addr_len; /* hardware address length */ |
| 912 | unsigned short dev_id; /* for shared network cards */ | 929 | unsigned short dev_id; /* for shared network cards */ |
| 913 | 930 | ||
| @@ -957,6 +974,8 @@ struct net_device { | |||
| 957 | #endif | 974 | #endif |
| 958 | 975 | ||
| 959 | struct netdev_queue rx_queue; | 976 | struct netdev_queue rx_queue; |
| 977 | rx_handler_func_t *rx_handler; | ||
| 978 | void *rx_handler_data; | ||
| 960 | 979 | ||
| 961 | struct netdev_queue *_tx ____cacheline_aligned_in_smp; | 980 | struct netdev_queue *_tx ____cacheline_aligned_in_smp; |
| 962 | 981 | ||
| @@ -1024,10 +1043,6 @@ struct net_device { | |||
| 1024 | /* mid-layer private */ | 1043 | /* mid-layer private */ |
| 1025 | void *ml_priv; | 1044 | void *ml_priv; |
| 1026 | 1045 | ||
| 1027 | /* bridge stuff */ | ||
| 1028 | struct net_bridge_port *br_port; | ||
| 1029 | /* macvlan */ | ||
| 1030 | struct macvlan_port *macvlan_port; | ||
| 1031 | /* GARP */ | 1046 | /* GARP */ |
| 1032 | struct garp_port *garp_port; | 1047 | struct garp_port *garp_port; |
| 1033 | 1048 | ||
| @@ -1057,6 +1072,9 @@ struct net_device { | |||
| 1057 | #endif | 1072 | #endif |
| 1058 | /* n-tuple filter list attached to this device */ | 1073 | /* n-tuple filter list attached to this device */ |
| 1059 | struct ethtool_rx_ntuple_list ethtool_ntuple_list; | 1074 | struct ethtool_rx_ntuple_list ethtool_ntuple_list; |
| 1075 | |||
| 1076 | /* phy device may attach itself for hardware timestamping */ | ||
| 1077 | struct phy_device *phydev; | ||
| 1060 | }; | 1078 | }; |
| 1061 | #define to_net_dev(d) container_of(d, struct net_device, dev) | 1079 | #define to_net_dev(d) container_of(d, struct net_device, dev) |
| 1062 | 1080 | ||
| @@ -1087,11 +1105,7 @@ static inline void netdev_for_each_tx_queue(struct net_device *dev, | |||
| 1087 | static inline | 1105 | static inline |
| 1088 | struct net *dev_net(const struct net_device *dev) | 1106 | struct net *dev_net(const struct net_device *dev) |
| 1089 | { | 1107 | { |
| 1090 | #ifdef CONFIG_NET_NS | 1108 | return read_pnet(&dev->nd_net); |
| 1091 | return dev->nd_net; | ||
| 1092 | #else | ||
| 1093 | return &init_net; | ||
| 1094 | #endif | ||
| 1095 | } | 1109 | } |
| 1096 | 1110 | ||
| 1097 | static inline | 1111 | static inline |
| @@ -1272,8 +1286,8 @@ extern void dev_add_pack(struct packet_type *pt); | |||
| 1272 | extern void dev_remove_pack(struct packet_type *pt); | 1286 | extern void dev_remove_pack(struct packet_type *pt); |
| 1273 | extern void __dev_remove_pack(struct packet_type *pt); | 1287 | extern void __dev_remove_pack(struct packet_type *pt); |
| 1274 | 1288 | ||
| 1275 | extern struct net_device *dev_get_by_flags(struct net *net, unsigned short flags, | 1289 | extern struct net_device *dev_get_by_flags_rcu(struct net *net, unsigned short flags, |
| 1276 | unsigned short mask); | 1290 | unsigned short mask); |
| 1277 | extern struct net_device *dev_get_by_name(struct net *net, const char *name); | 1291 | extern struct net_device *dev_get_by_name(struct net *net, const char *name); |
| 1278 | extern struct net_device *dev_get_by_name_rcu(struct net *net, const char *name); | 1292 | extern struct net_device *dev_get_by_name_rcu(struct net *net, const char *name); |
| 1279 | extern struct net_device *__dev_get_by_name(struct net *net, const char *name); | 1293 | extern struct net_device *__dev_get_by_name(struct net *net, const char *name); |
| @@ -1696,6 +1710,11 @@ static inline void napi_free_frags(struct napi_struct *napi) | |||
| 1696 | napi->skb = NULL; | 1710 | napi->skb = NULL; |
| 1697 | } | 1711 | } |
| 1698 | 1712 | ||
| 1713 | extern int netdev_rx_handler_register(struct net_device *dev, | ||
| 1714 | rx_handler_func_t *rx_handler, | ||
| 1715 | void *rx_handler_data); | ||
| 1716 | extern void netdev_rx_handler_unregister(struct net_device *dev); | ||
| 1717 | |||
| 1699 | extern void netif_nit_deliver(struct sk_buff *skb); | 1718 | extern void netif_nit_deliver(struct sk_buff *skb); |
| 1700 | extern int dev_valid_name(const char *name); | 1719 | extern int dev_valid_name(const char *name); |
| 1701 | extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *); | 1720 | extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *); |
| @@ -1775,6 +1794,8 @@ extern void netif_carrier_on(struct net_device *dev); | |||
| 1775 | 1794 | ||
| 1776 | extern void netif_carrier_off(struct net_device *dev); | 1795 | extern void netif_carrier_off(struct net_device *dev); |
| 1777 | 1796 | ||
| 1797 | extern void netif_notify_peers(struct net_device *dev); | ||
| 1798 | |||
| 1778 | /** | 1799 | /** |
| 1779 | * netif_dormant_on - mark device as dormant. | 1800 | * netif_dormant_on - mark device as dormant. |
| 1780 | * @dev: network device | 1801 | * @dev: network device |
| @@ -2119,8 +2140,10 @@ extern void netdev_features_change(struct net_device *dev); | |||
| 2119 | /* Load a device via the kmod */ | 2140 | /* Load a device via the kmod */ |
| 2120 | extern void dev_load(struct net *net, const char *name); | 2141 | extern void dev_load(struct net *net, const char *name); |
| 2121 | extern void dev_mcast_init(void); | 2142 | extern void dev_mcast_init(void); |
| 2122 | extern const struct net_device_stats *dev_get_stats(struct net_device *dev); | 2143 | extern struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev, |
| 2123 | extern void dev_txq_stats_fold(const struct net_device *dev, struct net_device_stats *stats); | 2144 | struct rtnl_link_stats64 *storage); |
| 2145 | extern void dev_txq_stats_fold(const struct net_device *dev, | ||
| 2146 | struct rtnl_link_stats64 *stats); | ||
| 2124 | 2147 | ||
| 2125 | extern int netdev_max_backlog; | 2148 | extern int netdev_max_backlog; |
| 2126 | extern int netdev_tstamp_prequeue; | 2149 | extern int netdev_tstamp_prequeue; |
| @@ -2230,25 +2253,23 @@ static inline const char *netdev_name(const struct net_device *dev) | |||
| 2230 | return dev->name; | 2253 | return dev->name; |
| 2231 | } | 2254 | } |
| 2232 | 2255 | ||
| 2233 | #define netdev_printk(level, netdev, format, args...) \ | 2256 | extern int netdev_printk(const char *level, const struct net_device *dev, |
| 2234 | dev_printk(level, (netdev)->dev.parent, \ | 2257 | const char *format, ...) |
| 2235 | "%s: " format, \ | 2258 | __attribute__ ((format (printf, 3, 4))); |
| 2236 | netdev_name(netdev), ##args) | 2259 | extern int netdev_emerg(const struct net_device *dev, const char *format, ...) |
| 2237 | 2260 | __attribute__ ((format (printf, 2, 3))); | |
| 2238 | #define netdev_emerg(dev, format, args...) \ | 2261 | extern int netdev_alert(const struct net_device *dev, const char *format, ...) |
| 2239 | netdev_printk(KERN_EMERG, dev, format, ##args) | 2262 | __attribute__ ((format (printf, 2, 3))); |
| 2240 | #define netdev_alert(dev, format, args...) \ | 2263 | extern int netdev_crit(const struct net_device *dev, const char *format, ...) |
| 2241 | netdev_printk(KERN_ALERT, dev, format, ##args) | 2264 | __attribute__ ((format (printf, 2, 3))); |
| 2242 | #define netdev_crit(dev, format, args...) \ | 2265 | extern int netdev_err(const struct net_device *dev, const char *format, ...) |
| 2243 | netdev_printk(KERN_CRIT, dev, format, ##args) | 2266 | __attribute__ ((format (printf, 2, 3))); |
| 2244 | #define netdev_err(dev, format, args...) \ | 2267 | extern int netdev_warn(const struct net_device *dev, const char *format, ...) |
| 2245 | netdev_printk(KERN_ERR, dev, format, ##args) | 2268 | __attribute__ ((format (printf, 2, 3))); |
| 2246 | #define netdev_warn(dev, format, args...) \ | 2269 | extern int netdev_notice(const struct net_device *dev, const char *format, ...) |
| 2247 | netdev_printk(KERN_WARNING, dev, format, ##args) | 2270 | __attribute__ ((format (printf, 2, 3))); |
| 2248 | #define netdev_notice(dev, format, args...) \ | 2271 | extern int netdev_info(const struct net_device *dev, const char *format, ...) |
| 2249 | netdev_printk(KERN_NOTICE, dev, format, ##args) | 2272 | __attribute__ ((format (printf, 2, 3))); |
| 2250 | #define netdev_info(dev, format, args...) \ | ||
| 2251 | netdev_printk(KERN_INFO, dev, format, ##args) | ||
| 2252 | 2273 | ||
| 2253 | #if defined(DEBUG) | 2274 | #if defined(DEBUG) |
| 2254 | #define netdev_dbg(__dev, format, args...) \ | 2275 | #define netdev_dbg(__dev, format, args...) \ |
| @@ -2296,20 +2317,26 @@ do { \ | |||
| 2296 | netdev_printk(level, (dev), fmt, ##args); \ | 2317 | netdev_printk(level, (dev), fmt, ##args); \ |
| 2297 | } while (0) | 2318 | } while (0) |
| 2298 | 2319 | ||
| 2320 | #define netif_level(level, priv, type, dev, fmt, args...) \ | ||
| 2321 | do { \ | ||
| 2322 | if (netif_msg_##type(priv)) \ | ||
| 2323 | netdev_##level(dev, fmt, ##args); \ | ||
| 2324 | } while (0) | ||
| 2325 | |||
| 2299 | #define netif_emerg(priv, type, dev, fmt, args...) \ | 2326 | #define netif_emerg(priv, type, dev, fmt, args...) \ |
| 2300 | netif_printk(priv, type, KERN_EMERG, dev, fmt, ##args) | 2327 | netif_level(emerg, priv, type, dev, fmt, ##args) |
| 2301 | #define netif_alert(priv, type, dev, fmt, args...) \ | 2328 | #define netif_alert(priv, type, dev, fmt, args...) \ |
| 2302 | netif_printk(priv, type, KERN_ALERT, dev, fmt, ##args) | 2329 | netif_level(alert, priv, type, dev, fmt, ##args) |
| 2303 | #define netif_crit(priv, type, dev, fmt, args...) \ | 2330 | #define netif_crit(priv, type, dev, fmt, args...) \ |
| 2304 | netif_printk(priv, type, KERN_CRIT, dev, fmt, ##args) | 2331 | netif_level(crit, priv, type, dev, fmt, ##args) |
| 2305 | #define netif_err(priv, type, dev, fmt, args...) \ | 2332 | #define netif_err(priv, type, dev, fmt, args...) \ |
| 2306 | netif_printk(priv, type, KERN_ERR, dev, fmt, ##args) | 2333 | netif_level(err, priv, type, dev, fmt, ##args) |
| 2307 | #define netif_warn(priv, type, dev, fmt, args...) \ | 2334 | #define netif_warn(priv, type, dev, fmt, args...) \ |
| 2308 | netif_printk(priv, type, KERN_WARNING, dev, fmt, ##args) | 2335 | netif_level(warn, priv, type, dev, fmt, ##args) |
| 2309 | #define netif_notice(priv, type, dev, fmt, args...) \ | 2336 | #define netif_notice(priv, type, dev, fmt, args...) \ |
| 2310 | netif_printk(priv, type, KERN_NOTICE, dev, fmt, ##args) | 2337 | netif_level(notice, priv, type, dev, fmt, ##args) |
| 2311 | #define netif_info(priv, type, dev, fmt, args...) \ | 2338 | #define netif_info(priv, type, dev, fmt, args...) \ |
| 2312 | netif_printk(priv, type, KERN_INFO, (dev), fmt, ##args) | 2339 | netif_level(info, priv, type, dev, fmt, ##args) |
| 2313 | 2340 | ||
| 2314 | #if defined(DEBUG) | 2341 | #if defined(DEBUG) |
| 2315 | #define netif_dbg(priv, type, dev, format, args...) \ | 2342 | #define netif_dbg(priv, type, dev, format, args...) \ |
diff --git a/include/linux/netfilter/Kbuild b/include/linux/netfilter/Kbuild index 48767cd16453..edeeabdc1500 100644 --- a/include/linux/netfilter/Kbuild +++ b/include/linux/netfilter/Kbuild | |||
| @@ -3,11 +3,13 @@ header-y += nf_conntrack_tuple_common.h | |||
| 3 | header-y += nfnetlink_conntrack.h | 3 | header-y += nfnetlink_conntrack.h |
| 4 | header-y += nfnetlink_log.h | 4 | header-y += nfnetlink_log.h |
| 5 | header-y += nfnetlink_queue.h | 5 | header-y += nfnetlink_queue.h |
| 6 | header-y += xt_CHECKSUM.h | ||
| 6 | header-y += xt_CLASSIFY.h | 7 | header-y += xt_CLASSIFY.h |
| 7 | header-y += xt_CONNMARK.h | 8 | header-y += xt_CONNMARK.h |
| 8 | header-y += xt_CONNSECMARK.h | 9 | header-y += xt_CONNSECMARK.h |
| 9 | header-y += xt_CT.h | 10 | header-y += xt_CT.h |
| 10 | header-y += xt_DSCP.h | 11 | header-y += xt_DSCP.h |
| 12 | header-y += xt_IDLETIMER.h | ||
| 11 | header-y += xt_LED.h | 13 | header-y += xt_LED.h |
| 12 | header-y += xt_MARK.h | 14 | header-y += xt_MARK.h |
| 13 | header-y += xt_NFLOG.h | 15 | header-y += xt_NFLOG.h |
| @@ -18,17 +20,19 @@ header-y += xt_TCPMSS.h | |||
| 18 | header-y += xt_TCPOPTSTRIP.h | 20 | header-y += xt_TCPOPTSTRIP.h |
| 19 | header-y += xt_TEE.h | 21 | header-y += xt_TEE.h |
| 20 | header-y += xt_TPROXY.h | 22 | header-y += xt_TPROXY.h |
| 23 | header-y += xt_cluster.h | ||
| 21 | header-y += xt_comment.h | 24 | header-y += xt_comment.h |
| 22 | header-y += xt_connbytes.h | 25 | header-y += xt_connbytes.h |
| 23 | header-y += xt_connlimit.h | 26 | header-y += xt_connlimit.h |
| 24 | header-y += xt_connmark.h | 27 | header-y += xt_connmark.h |
| 25 | header-y += xt_conntrack.h | 28 | header-y += xt_conntrack.h |
| 26 | header-y += xt_cluster.h | 29 | header-y += xt_cpu.h |
| 27 | header-y += xt_dccp.h | 30 | header-y += xt_dccp.h |
| 28 | header-y += xt_dscp.h | 31 | header-y += xt_dscp.h |
| 29 | header-y += xt_esp.h | 32 | header-y += xt_esp.h |
| 30 | header-y += xt_hashlimit.h | 33 | header-y += xt_hashlimit.h |
| 31 | header-y += xt_iprange.h | 34 | header-y += xt_iprange.h |
| 35 | header-y += xt_ipvs.h | ||
| 32 | header-y += xt_helper.h | 36 | header-y += xt_helper.h |
| 33 | header-y += xt_length.h | 37 | header-y += xt_length.h |
| 34 | header-y += xt_limit.h | 38 | header-y += xt_limit.h |
diff --git a/include/linux/netfilter/nf_conntrack_common.h b/include/linux/netfilter/nf_conntrack_common.h index 14e6d32002c4..1afd18c855ec 100644 --- a/include/linux/netfilter/nf_conntrack_common.h +++ b/include/linux/netfilter/nf_conntrack_common.h | |||
| @@ -76,6 +76,10 @@ enum ip_conntrack_status { | |||
| 76 | /* Conntrack is a template */ | 76 | /* Conntrack is a template */ |
| 77 | IPS_TEMPLATE_BIT = 11, | 77 | IPS_TEMPLATE_BIT = 11, |
| 78 | IPS_TEMPLATE = (1 << IPS_TEMPLATE_BIT), | 78 | IPS_TEMPLATE = (1 << IPS_TEMPLATE_BIT), |
| 79 | |||
| 80 | /* Conntrack is a fake untracked entry */ | ||
| 81 | IPS_UNTRACKED_BIT = 12, | ||
| 82 | IPS_UNTRACKED = (1 << IPS_UNTRACKED_BIT), | ||
| 79 | }; | 83 | }; |
| 80 | 84 | ||
| 81 | /* Connection tracking event types */ | 85 | /* Connection tracking event types */ |
diff --git a/include/linux/netfilter/nfnetlink_log.h b/include/linux/netfilter/nfnetlink_log.h index d3bab7a2c9b7..ea9b8d380527 100644 --- a/include/linux/netfilter/nfnetlink_log.h +++ b/include/linux/netfilter/nfnetlink_log.h | |||
| @@ -89,6 +89,7 @@ enum nfulnl_attr_config { | |||
| 89 | #define NFULNL_COPY_NONE 0x00 | 89 | #define NFULNL_COPY_NONE 0x00 |
| 90 | #define NFULNL_COPY_META 0x01 | 90 | #define NFULNL_COPY_META 0x01 |
| 91 | #define NFULNL_COPY_PACKET 0x02 | 91 | #define NFULNL_COPY_PACKET 0x02 |
| 92 | /* 0xff is reserved, don't use it for new copy modes. */ | ||
| 92 | 93 | ||
| 93 | #define NFULNL_CFG_F_SEQ 0x0001 | 94 | #define NFULNL_CFG_F_SEQ 0x0001 |
| 94 | #define NFULNL_CFG_F_SEQ_GLOBAL 0x0002 | 95 | #define NFULNL_CFG_F_SEQ_GLOBAL 0x0002 |
diff --git a/include/linux/netfilter/xt_CHECKSUM.h b/include/linux/netfilter/xt_CHECKSUM.h new file mode 100644 index 000000000000..9a2e4661654e --- /dev/null +++ b/include/linux/netfilter/xt_CHECKSUM.h | |||
| @@ -0,0 +1,20 @@ | |||
| 1 | /* Header file for iptables ipt_CHECKSUM target | ||
| 2 | * | ||
| 3 | * (C) 2002 by Harald Welte <laforge@gnumonks.org> | ||
| 4 | * (C) 2010 Red Hat Inc | ||
| 5 | * Author: Michael S. Tsirkin <mst@redhat.com> | ||
| 6 | * | ||
| 7 | * This software is distributed under GNU GPL v2, 1991 | ||
| 8 | */ | ||
| 9 | #ifndef _XT_CHECKSUM_TARGET_H | ||
| 10 | #define _XT_CHECKSUM_TARGET_H | ||
| 11 | |||
| 12 | #include <linux/types.h> | ||
| 13 | |||
| 14 | #define XT_CHECKSUM_OP_FILL 0x01 /* fill in checksum in IP header */ | ||
| 15 | |||
| 16 | struct xt_CHECKSUM_info { | ||
| 17 | __u8 operation; /* bitset of operations */ | ||
| 18 | }; | ||
| 19 | |||
| 20 | #endif /* _XT_CHECKSUM_TARGET_H */ | ||
diff --git a/include/linux/netfilter/xt_IDLETIMER.h b/include/linux/netfilter/xt_IDLETIMER.h new file mode 100644 index 000000000000..3e1aa1be942e --- /dev/null +++ b/include/linux/netfilter/xt_IDLETIMER.h | |||
| @@ -0,0 +1,45 @@ | |||
| 1 | /* | ||
| 2 | * linux/include/linux/netfilter/xt_IDLETIMER.h | ||
| 3 | * | ||
| 4 | * Header file for Xtables timer target module. | ||
| 5 | * | ||
| 6 | * Copyright (C) 2004, 2010 Nokia Corporation | ||
| 7 | * Written by Timo Teras <ext-timo.teras@nokia.com> | ||
| 8 | * | ||
| 9 | * Converted to x_tables and forward-ported to 2.6.34 | ||
| 10 | * by Luciano Coelho <luciano.coelho@nokia.com> | ||
| 11 | * | ||
| 12 | * Contact: Luciano Coelho <luciano.coelho@nokia.com> | ||
| 13 | * | ||
| 14 | * This program is free software; you can redistribute it and/or | ||
| 15 | * modify it under the terms of the GNU General Public License | ||
| 16 | * version 2 as published by the Free Software Foundation. | ||
| 17 | * | ||
| 18 | * This program is distributed in the hope that it will be useful, but | ||
| 19 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 21 | * General Public License for more details. | ||
| 22 | * | ||
| 23 | * You should have received a copy of the GNU General Public License | ||
| 24 | * along with this program; if not, write to the Free Software | ||
| 25 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
| 26 | * 02110-1301 USA | ||
| 27 | */ | ||
| 28 | |||
| 29 | #ifndef _XT_IDLETIMER_H | ||
| 30 | #define _XT_IDLETIMER_H | ||
| 31 | |||
| 32 | #include <linux/types.h> | ||
| 33 | |||
| 34 | #define MAX_IDLETIMER_LABEL_SIZE 28 | ||
| 35 | |||
| 36 | struct idletimer_tg_info { | ||
| 37 | __u32 timeout; | ||
| 38 | |||
| 39 | char label[MAX_IDLETIMER_LABEL_SIZE]; | ||
| 40 | |||
| 41 | /* for kernel module internal use only */ | ||
| 42 | struct idletimer_tg *timer __attribute((aligned(8))); | ||
| 43 | }; | ||
| 44 | |||
| 45 | #endif | ||
diff --git a/include/linux/netfilter/xt_cpu.h b/include/linux/netfilter/xt_cpu.h new file mode 100644 index 000000000000..93c7f11d8f42 --- /dev/null +++ b/include/linux/netfilter/xt_cpu.h | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | #ifndef _XT_CPU_H | ||
| 2 | #define _XT_CPU_H | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | |||
| 6 | struct xt_cpu_info { | ||
| 7 | __u32 cpu; | ||
| 8 | __u32 invert; | ||
| 9 | }; | ||
| 10 | |||
| 11 | #endif /*_XT_CPU_H*/ | ||
diff --git a/include/linux/netfilter/xt_ipvs.h b/include/linux/netfilter/xt_ipvs.h new file mode 100644 index 000000000000..1167aeb7a347 --- /dev/null +++ b/include/linux/netfilter/xt_ipvs.h | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | #ifndef _XT_IPVS_H | ||
| 2 | #define _XT_IPVS_H | ||
| 3 | |||
| 4 | enum { | ||
| 5 | XT_IPVS_IPVS_PROPERTY = 1 << 0, /* all other options imply this one */ | ||
| 6 | XT_IPVS_PROTO = 1 << 1, | ||
| 7 | XT_IPVS_VADDR = 1 << 2, | ||
| 8 | XT_IPVS_VPORT = 1 << 3, | ||
| 9 | XT_IPVS_DIR = 1 << 4, | ||
| 10 | XT_IPVS_METHOD = 1 << 5, | ||
| 11 | XT_IPVS_VPORTCTL = 1 << 6, | ||
| 12 | XT_IPVS_MASK = (1 << 7) - 1, | ||
| 13 | XT_IPVS_ONCE_MASK = XT_IPVS_MASK & ~XT_IPVS_IPVS_PROPERTY | ||
| 14 | }; | ||
| 15 | |||
| 16 | struct xt_ipvs_mtinfo { | ||
| 17 | union nf_inet_addr vaddr, vmask; | ||
| 18 | __be16 vport; | ||
| 19 | __u8 l4proto; | ||
| 20 | __u8 fwd_method; | ||
| 21 | __be16 vportctl; | ||
| 22 | |||
| 23 | __u8 invert; | ||
| 24 | __u8 bitmask; | ||
| 25 | }; | ||
| 26 | |||
| 27 | #endif /* _XT_IPVS_H */ | ||
diff --git a/include/linux/netfilter/xt_quota.h b/include/linux/netfilter/xt_quota.h index 8dc89dfc1361..b0d28c659ab7 100644 --- a/include/linux/netfilter/xt_quota.h +++ b/include/linux/netfilter/xt_quota.h | |||
| @@ -11,9 +11,9 @@ struct xt_quota_priv; | |||
| 11 | struct xt_quota_info { | 11 | struct xt_quota_info { |
| 12 | u_int32_t flags; | 12 | u_int32_t flags; |
| 13 | u_int32_t pad; | 13 | u_int32_t pad; |
| 14 | aligned_u64 quota; | ||
| 14 | 15 | ||
| 15 | /* Used internally by the kernel */ | 16 | /* Used internally by the kernel */ |
| 16 | aligned_u64 quota; | ||
| 17 | struct xt_quota_priv *master; | 17 | struct xt_quota_priv *master; |
| 18 | }; | 18 | }; |
| 19 | 19 | ||
diff --git a/include/linux/netfilter_ipv4/ipt_LOG.h b/include/linux/netfilter_ipv4/ipt_LOG.h index 90fa6525ef9c..dcdbadf9fd4a 100644 --- a/include/linux/netfilter_ipv4/ipt_LOG.h +++ b/include/linux/netfilter_ipv4/ipt_LOG.h | |||
| @@ -7,7 +7,8 @@ | |||
| 7 | #define IPT_LOG_IPOPT 0x04 /* Log IP options */ | 7 | #define IPT_LOG_IPOPT 0x04 /* Log IP options */ |
| 8 | #define IPT_LOG_UID 0x08 /* Log UID owning local socket */ | 8 | #define IPT_LOG_UID 0x08 /* Log UID owning local socket */ |
| 9 | #define IPT_LOG_NFLOG 0x10 /* Unsupported, don't reuse */ | 9 | #define IPT_LOG_NFLOG 0x10 /* Unsupported, don't reuse */ |
| 10 | #define IPT_LOG_MASK 0x1f | 10 | #define IPT_LOG_MACDECODE 0x20 /* Decode MAC header */ |
| 11 | #define IPT_LOG_MASK 0x2f | ||
| 11 | 12 | ||
| 12 | struct ipt_log_info { | 13 | struct ipt_log_info { |
| 13 | unsigned char level; | 14 | unsigned char level; |
diff --git a/include/linux/netfilter_ipv6/ip6t_LOG.h b/include/linux/netfilter_ipv6/ip6t_LOG.h index 0d0119b0458c..9dd5579e02ec 100644 --- a/include/linux/netfilter_ipv6/ip6t_LOG.h +++ b/include/linux/netfilter_ipv6/ip6t_LOG.h | |||
| @@ -7,7 +7,8 @@ | |||
| 7 | #define IP6T_LOG_IPOPT 0x04 /* Log IP options */ | 7 | #define IP6T_LOG_IPOPT 0x04 /* Log IP options */ |
| 8 | #define IP6T_LOG_UID 0x08 /* Log UID owning local socket */ | 8 | #define IP6T_LOG_UID 0x08 /* Log UID owning local socket */ |
| 9 | #define IP6T_LOG_NFLOG 0x10 /* Unsupported, don't use */ | 9 | #define IP6T_LOG_NFLOG 0x10 /* Unsupported, don't use */ |
| 10 | #define IP6T_LOG_MASK 0x1f | 10 | #define IP6T_LOG_MACDECODE 0x20 /* Decode MAC header */ |
| 11 | #define IP6T_LOG_MASK 0x2f | ||
| 11 | 12 | ||
| 12 | struct ip6t_log_info { | 13 | struct ip6t_log_info { |
| 13 | unsigned char level; | 14 | unsigned char level; |
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h index e9e231215865..413742c92d14 100644 --- a/include/linux/netpoll.h +++ b/include/linux/netpoll.h | |||
| @@ -46,9 +46,11 @@ void netpoll_poll(struct netpoll *np); | |||
| 46 | void netpoll_send_udp(struct netpoll *np, const char *msg, int len); | 46 | void netpoll_send_udp(struct netpoll *np, const char *msg, int len); |
| 47 | void netpoll_print_options(struct netpoll *np); | 47 | void netpoll_print_options(struct netpoll *np); |
| 48 | int netpoll_parse_options(struct netpoll *np, char *opt); | 48 | int netpoll_parse_options(struct netpoll *np, char *opt); |
| 49 | int __netpoll_setup(struct netpoll *np); | ||
| 49 | int netpoll_setup(struct netpoll *np); | 50 | int netpoll_setup(struct netpoll *np); |
| 50 | int netpoll_trap(void); | 51 | int netpoll_trap(void); |
| 51 | void netpoll_set_trap(int trap); | 52 | void netpoll_set_trap(int trap); |
| 53 | void __netpoll_cleanup(struct netpoll *np); | ||
| 52 | void netpoll_cleanup(struct netpoll *np); | 54 | void netpoll_cleanup(struct netpoll *np); |
| 53 | int __netpoll_rx(struct sk_buff *skb); | 55 | int __netpoll_rx(struct sk_buff *skb); |
| 54 | void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb); | 56 | void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb); |
| @@ -57,12 +59,15 @@ void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb); | |||
| 57 | #ifdef CONFIG_NETPOLL | 59 | #ifdef CONFIG_NETPOLL |
| 58 | static inline bool netpoll_rx(struct sk_buff *skb) | 60 | static inline bool netpoll_rx(struct sk_buff *skb) |
| 59 | { | 61 | { |
| 60 | struct netpoll_info *npinfo = skb->dev->npinfo; | 62 | struct netpoll_info *npinfo; |
| 61 | unsigned long flags; | 63 | unsigned long flags; |
| 62 | bool ret = false; | 64 | bool ret = false; |
| 63 | 65 | ||
| 66 | rcu_read_lock_bh(); | ||
| 67 | npinfo = rcu_dereference_bh(skb->dev->npinfo); | ||
| 68 | |||
| 64 | if (!npinfo || (list_empty(&npinfo->rx_np) && !npinfo->rx_flags)) | 69 | if (!npinfo || (list_empty(&npinfo->rx_np) && !npinfo->rx_flags)) |
| 65 | return false; | 70 | goto out; |
| 66 | 71 | ||
| 67 | spin_lock_irqsave(&npinfo->rx_lock, flags); | 72 | spin_lock_irqsave(&npinfo->rx_lock, flags); |
| 68 | /* check rx_flags again with the lock held */ | 73 | /* check rx_flags again with the lock held */ |
| @@ -70,12 +75,14 @@ static inline bool netpoll_rx(struct sk_buff *skb) | |||
| 70 | ret = true; | 75 | ret = true; |
| 71 | spin_unlock_irqrestore(&npinfo->rx_lock, flags); | 76 | spin_unlock_irqrestore(&npinfo->rx_lock, flags); |
| 72 | 77 | ||
| 78 | out: | ||
| 79 | rcu_read_unlock_bh(); | ||
| 73 | return ret; | 80 | return ret; |
| 74 | } | 81 | } |
| 75 | 82 | ||
| 76 | static inline int netpoll_rx_on(struct sk_buff *skb) | 83 | static inline int netpoll_rx_on(struct sk_buff *skb) |
| 77 | { | 84 | { |
| 78 | struct netpoll_info *npinfo = skb->dev->npinfo; | 85 | struct netpoll_info *npinfo = rcu_dereference_bh(skb->dev->npinfo); |
| 79 | 86 | ||
| 80 | return npinfo && (!list_empty(&npinfo->rx_np) || npinfo->rx_flags); | 87 | return npinfo && (!list_empty(&npinfo->rx_np) || npinfo->rx_flags); |
| 81 | } | 88 | } |
| @@ -91,7 +98,6 @@ static inline void *netpoll_poll_lock(struct napi_struct *napi) | |||
| 91 | { | 98 | { |
| 92 | struct net_device *dev = napi->dev; | 99 | struct net_device *dev = napi->dev; |
| 93 | 100 | ||
| 94 | rcu_read_lock(); /* deal with race on ->npinfo */ | ||
| 95 | if (dev && dev->npinfo) { | 101 | if (dev && dev->npinfo) { |
| 96 | spin_lock(&napi->poll_lock); | 102 | spin_lock(&napi->poll_lock); |
| 97 | napi->poll_owner = smp_processor_id(); | 103 | napi->poll_owner = smp_processor_id(); |
| @@ -108,7 +114,11 @@ static inline void netpoll_poll_unlock(void *have) | |||
| 108 | napi->poll_owner = -1; | 114 | napi->poll_owner = -1; |
| 109 | spin_unlock(&napi->poll_lock); | 115 | spin_unlock(&napi->poll_lock); |
| 110 | } | 116 | } |
| 111 | rcu_read_unlock(); | 117 | } |
| 118 | |||
| 119 | static inline int netpoll_tx_running(struct net_device *dev) | ||
| 120 | { | ||
| 121 | return irqs_disabled(); | ||
| 112 | } | 122 | } |
| 113 | 123 | ||
| 114 | #else | 124 | #else |
| @@ -134,6 +144,10 @@ static inline void netpoll_poll_unlock(void *have) | |||
| 134 | static inline void netpoll_netdev_init(struct net_device *dev) | 144 | static inline void netpoll_netdev_init(struct net_device *dev) |
| 135 | { | 145 | { |
| 136 | } | 146 | } |
| 147 | static inline int netpoll_tx_running(struct net_device *dev) | ||
| 148 | { | ||
| 149 | return 0; | ||
| 150 | } | ||
| 137 | #endif | 151 | #endif |
| 138 | 152 | ||
| 139 | #endif | 153 | #endif |
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index 9b8299af3741..07e40c625972 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h | |||
| @@ -523,6 +523,7 @@ enum { | |||
| 523 | NFSPROC4_CLNT_GETACL, | 523 | NFSPROC4_CLNT_GETACL, |
| 524 | NFSPROC4_CLNT_SETACL, | 524 | NFSPROC4_CLNT_SETACL, |
| 525 | NFSPROC4_CLNT_FS_LOCATIONS, | 525 | NFSPROC4_CLNT_FS_LOCATIONS, |
| 526 | NFSPROC4_CLNT_RELEASE_LOCKOWNER, | ||
| 526 | 527 | ||
| 527 | /* nfs41 */ | 528 | /* nfs41 */ |
| 528 | NFSPROC4_CLNT_EXCHANGE_ID, | 529 | NFSPROC4_CLNT_EXCHANGE_ID, |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 77c2ae53431c..508f8cf6da37 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
| @@ -72,13 +72,20 @@ struct nfs_access_entry { | |||
| 72 | int mask; | 72 | int mask; |
| 73 | }; | 73 | }; |
| 74 | 74 | ||
| 75 | struct nfs_lock_context { | ||
| 76 | atomic_t count; | ||
| 77 | struct list_head list; | ||
| 78 | struct nfs_open_context *open_context; | ||
| 79 | fl_owner_t lockowner; | ||
| 80 | pid_t pid; | ||
| 81 | }; | ||
| 82 | |||
| 75 | struct nfs4_state; | 83 | struct nfs4_state; |
| 76 | struct nfs_open_context { | 84 | struct nfs_open_context { |
| 77 | atomic_t count; | 85 | struct nfs_lock_context lock_context; |
| 78 | struct path path; | 86 | struct path path; |
| 79 | struct rpc_cred *cred; | 87 | struct rpc_cred *cred; |
| 80 | struct nfs4_state *state; | 88 | struct nfs4_state *state; |
| 81 | fl_owner_t lockowner; | ||
| 82 | fmode_t mode; | 89 | fmode_t mode; |
| 83 | 90 | ||
| 84 | unsigned long flags; | 91 | unsigned long flags; |
| @@ -353,6 +360,8 @@ extern void nfs_setattr_update_inode(struct inode *inode, struct iattr *attr); | |||
| 353 | extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx); | 360 | extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx); |
| 354 | extern void put_nfs_open_context(struct nfs_open_context *ctx); | 361 | extern void put_nfs_open_context(struct nfs_open_context *ctx); |
| 355 | extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, fmode_t mode); | 362 | extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, fmode_t mode); |
| 363 | extern struct nfs_lock_context *nfs_get_lock_context(struct nfs_open_context *ctx); | ||
| 364 | extern void nfs_put_lock_context(struct nfs_lock_context *l_ctx); | ||
| 356 | extern u64 nfs_compat_user_ino64(u64 fileid); | 365 | extern u64 nfs_compat_user_ino64(u64 fileid); |
| 357 | extern void nfs_fattr_init(struct nfs_fattr *fattr); | 366 | extern void nfs_fattr_init(struct nfs_fattr *fattr); |
| 358 | 367 | ||
| @@ -493,8 +502,15 @@ extern int nfs_wb_all(struct inode *inode); | |||
| 493 | extern int nfs_wb_page(struct inode *inode, struct page* page); | 502 | extern int nfs_wb_page(struct inode *inode, struct page* page); |
| 494 | extern int nfs_wb_page_cancel(struct inode *inode, struct page* page); | 503 | extern int nfs_wb_page_cancel(struct inode *inode, struct page* page); |
| 495 | #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) | 504 | #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) |
| 505 | extern int nfs_commit_inode(struct inode *, int); | ||
| 496 | extern struct nfs_write_data *nfs_commitdata_alloc(void); | 506 | extern struct nfs_write_data *nfs_commitdata_alloc(void); |
| 497 | extern void nfs_commit_free(struct nfs_write_data *wdata); | 507 | extern void nfs_commit_free(struct nfs_write_data *wdata); |
| 508 | #else | ||
| 509 | static inline int | ||
| 510 | nfs_commit_inode(struct inode *inode, int how) | ||
| 511 | { | ||
| 512 | return 0; | ||
| 513 | } | ||
| 498 | #endif | 514 | #endif |
| 499 | 515 | ||
| 500 | static inline int | 516 | static inline int |
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h index d6e10a4c06e5..c82ee7cd6288 100644 --- a/include/linux/nfs_fs_sb.h +++ b/include/linux/nfs_fs_sb.h | |||
| @@ -15,6 +15,7 @@ struct nlm_host; | |||
| 15 | struct nfs4_sequence_args; | 15 | struct nfs4_sequence_args; |
| 16 | struct nfs4_sequence_res; | 16 | struct nfs4_sequence_res; |
| 17 | struct nfs_server; | 17 | struct nfs_server; |
| 18 | struct nfs4_minor_version_ops; | ||
| 18 | 19 | ||
| 19 | /* | 20 | /* |
| 20 | * The nfs_client identifies our client state to the server. | 21 | * The nfs_client identifies our client state to the server. |
| @@ -70,11 +71,7 @@ struct nfs_client { | |||
| 70 | */ | 71 | */ |
| 71 | char cl_ipaddr[48]; | 72 | char cl_ipaddr[48]; |
| 72 | unsigned char cl_id_uniquifier; | 73 | unsigned char cl_id_uniquifier; |
| 73 | int (* cl_call_sync)(struct nfs_server *server, | 74 | const struct nfs4_minor_version_ops *cl_mvops; |
| 74 | struct rpc_message *msg, | ||
| 75 | struct nfs4_sequence_args *args, | ||
| 76 | struct nfs4_sequence_res *res, | ||
| 77 | int cache_reply); | ||
| 78 | #endif /* CONFIG_NFS_V4 */ | 75 | #endif /* CONFIG_NFS_V4 */ |
| 79 | 76 | ||
| 80 | #ifdef CONFIG_NFS_V4_1 | 77 | #ifdef CONFIG_NFS_V4_1 |
diff --git a/include/linux/nfs_mount.h b/include/linux/nfs_mount.h index 4499016e6d0d..5d59ae861aa6 100644 --- a/include/linux/nfs_mount.h +++ b/include/linux/nfs_mount.h | |||
| @@ -69,5 +69,6 @@ struct nfs_mount_data { | |||
| 69 | #define NFS_MOUNT_LOOKUP_CACHE_NONEG 0x10000 | 69 | #define NFS_MOUNT_LOOKUP_CACHE_NONEG 0x10000 |
| 70 | #define NFS_MOUNT_LOOKUP_CACHE_NONE 0x20000 | 70 | #define NFS_MOUNT_LOOKUP_CACHE_NONE 0x20000 |
| 71 | #define NFS_MOUNT_NORESVPORT 0x40000 | 71 | #define NFS_MOUNT_NORESVPORT 0x40000 |
| 72 | #define NFS_MOUNT_LEGACY_INTERFACE 0x80000 | ||
| 72 | 73 | ||
| 73 | #endif | 74 | #endif |
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h index 3c60685d972b..f8b60e7f4c44 100644 --- a/include/linux/nfs_page.h +++ b/include/linux/nfs_page.h | |||
| @@ -39,6 +39,7 @@ struct nfs_page { | |||
| 39 | struct list_head wb_list; /* Defines state of page: */ | 39 | struct list_head wb_list; /* Defines state of page: */ |
| 40 | struct page *wb_page; /* page to read in/write out */ | 40 | struct page *wb_page; /* page to read in/write out */ |
| 41 | struct nfs_open_context *wb_context; /* File state context info */ | 41 | struct nfs_open_context *wb_context; /* File state context info */ |
| 42 | struct nfs_lock_context *wb_lock_context; /* lock context info */ | ||
| 42 | atomic_t wb_complete; /* i/os we're waiting for */ | 43 | atomic_t wb_complete; /* i/os we're waiting for */ |
| 43 | pgoff_t wb_index; /* Offset >> PAGE_CACHE_SHIFT */ | 44 | pgoff_t wb_index; /* Offset >> PAGE_CACHE_SHIFT */ |
| 44 | unsigned int wb_offset, /* Offset & ~PAGE_CACHE_MASK */ | 45 | unsigned int wb_offset, /* Offset & ~PAGE_CACHE_MASK */ |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 51914d7d6cc4..fc461926c412 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
| @@ -196,8 +196,10 @@ struct nfs_openargs { | |||
| 196 | __u64 clientid; | 196 | __u64 clientid; |
| 197 | __u64 id; | 197 | __u64 id; |
| 198 | union { | 198 | union { |
| 199 | struct iattr * attrs; /* UNCHECKED, GUARDED */ | 199 | struct { |
| 200 | nfs4_verifier verifier; /* EXCLUSIVE */ | 200 | struct iattr * attrs; /* UNCHECKED, GUARDED */ |
| 201 | nfs4_verifier verifier; /* EXCLUSIVE */ | ||
| 202 | }; | ||
| 201 | nfs4_stateid delegation; /* CLAIM_DELEGATE_CUR */ | 203 | nfs4_stateid delegation; /* CLAIM_DELEGATE_CUR */ |
| 202 | fmode_t delegation_type; /* CLAIM_PREVIOUS */ | 204 | fmode_t delegation_type; /* CLAIM_PREVIOUS */ |
| 203 | } u; | 205 | } u; |
| @@ -313,6 +315,10 @@ struct nfs_lockt_res { | |||
| 313 | struct nfs4_sequence_res seq_res; | 315 | struct nfs4_sequence_res seq_res; |
| 314 | }; | 316 | }; |
| 315 | 317 | ||
| 318 | struct nfs_release_lockowner_args { | ||
| 319 | struct nfs_lowner lock_owner; | ||
| 320 | }; | ||
| 321 | |||
| 316 | struct nfs4_delegreturnargs { | 322 | struct nfs4_delegreturnargs { |
| 317 | const struct nfs_fh *fhandle; | 323 | const struct nfs_fh *fhandle; |
| 318 | const nfs4_stateid *stateid; | 324 | const nfs4_stateid *stateid; |
| @@ -332,6 +338,7 @@ struct nfs4_delegreturnres { | |||
| 332 | struct nfs_readargs { | 338 | struct nfs_readargs { |
| 333 | struct nfs_fh * fh; | 339 | struct nfs_fh * fh; |
| 334 | struct nfs_open_context *context; | 340 | struct nfs_open_context *context; |
| 341 | struct nfs_lock_context *lock_context; | ||
| 335 | __u64 offset; | 342 | __u64 offset; |
| 336 | __u32 count; | 343 | __u32 count; |
| 337 | unsigned int pgbase; | 344 | unsigned int pgbase; |
| @@ -352,6 +359,7 @@ struct nfs_readres { | |||
| 352 | struct nfs_writeargs { | 359 | struct nfs_writeargs { |
| 353 | struct nfs_fh * fh; | 360 | struct nfs_fh * fh; |
| 354 | struct nfs_open_context *context; | 361 | struct nfs_open_context *context; |
| 362 | struct nfs_lock_context *lock_context; | ||
| 355 | __u64 offset; | 363 | __u64 offset; |
| 356 | __u32 count; | 364 | __u32 count; |
| 357 | enum nfs3_stable_how stable; | 365 | enum nfs3_stable_how stable; |
diff --git a/include/linux/nilfs2_fs.h b/include/linux/nilfs2_fs.h index 8c2c6116e788..f5487b6f91ed 100644 --- a/include/linux/nilfs2_fs.h +++ b/include/linux/nilfs2_fs.h | |||
| @@ -160,7 +160,7 @@ struct nilfs_super_root { | |||
| 160 | * struct nilfs_super_block - structure of super block on disk | 160 | * struct nilfs_super_block - structure of super block on disk |
| 161 | */ | 161 | */ |
| 162 | struct nilfs_super_block { | 162 | struct nilfs_super_block { |
| 163 | __le32 s_rev_level; /* Revision level */ | 163 | /*00*/ __le32 s_rev_level; /* Revision level */ |
| 164 | __le16 s_minor_rev_level; /* minor revision level */ | 164 | __le16 s_minor_rev_level; /* minor revision level */ |
| 165 | __le16 s_magic; /* Magic signature */ | 165 | __le16 s_magic; /* Magic signature */ |
| 166 | 166 | ||
| @@ -169,50 +169,53 @@ struct nilfs_super_block { | |||
| 169 | is excluded. */ | 169 | is excluded. */ |
| 170 | __le16 s_flags; /* flags */ | 170 | __le16 s_flags; /* flags */ |
| 171 | __le32 s_crc_seed; /* Seed value of CRC calculation */ | 171 | __le32 s_crc_seed; /* Seed value of CRC calculation */ |
| 172 | __le32 s_sum; /* Check sum of super block */ | 172 | /*10*/ __le32 s_sum; /* Check sum of super block */ |
| 173 | 173 | ||
| 174 | __le32 s_log_block_size; /* Block size represented as follows | 174 | __le32 s_log_block_size; /* Block size represented as follows |
| 175 | blocksize = | 175 | blocksize = |
| 176 | 1 << (s_log_block_size + 10) */ | 176 | 1 << (s_log_block_size + 10) */ |
| 177 | __le64 s_nsegments; /* Number of segments in filesystem */ | 177 | __le64 s_nsegments; /* Number of segments in filesystem */ |
| 178 | __le64 s_dev_size; /* block device size in bytes */ | 178 | /*20*/ __le64 s_dev_size; /* block device size in bytes */ |
| 179 | __le64 s_first_data_block; /* 1st seg disk block number */ | 179 | __le64 s_first_data_block; /* 1st seg disk block number */ |
| 180 | __le32 s_blocks_per_segment; /* number of blocks per full segment */ | 180 | /*30*/ __le32 s_blocks_per_segment; /* number of blocks per full segment */ |
| 181 | __le32 s_r_segments_percentage; /* Reserved segments percentage */ | 181 | __le32 s_r_segments_percentage; /* Reserved segments percentage */ |
| 182 | 182 | ||
| 183 | __le64 s_last_cno; /* Last checkpoint number */ | 183 | __le64 s_last_cno; /* Last checkpoint number */ |
| 184 | __le64 s_last_pseg; /* disk block addr pseg written last */ | 184 | /*40*/ __le64 s_last_pseg; /* disk block addr pseg written last */ |
| 185 | __le64 s_last_seq; /* seq. number of seg written last */ | 185 | __le64 s_last_seq; /* seq. number of seg written last */ |
| 186 | __le64 s_free_blocks_count; /* Free blocks count */ | 186 | /*50*/ __le64 s_free_blocks_count; /* Free blocks count */ |
| 187 | 187 | ||
| 188 | __le64 s_ctime; /* Creation time (execution time of | 188 | __le64 s_ctime; /* Creation time (execution time of |
| 189 | newfs) */ | 189 | newfs) */ |
| 190 | __le64 s_mtime; /* Mount time */ | 190 | /*60*/ __le64 s_mtime; /* Mount time */ |
| 191 | __le64 s_wtime; /* Write time */ | 191 | __le64 s_wtime; /* Write time */ |
| 192 | __le16 s_mnt_count; /* Mount count */ | 192 | /*70*/ __le16 s_mnt_count; /* Mount count */ |
| 193 | __le16 s_max_mnt_count; /* Maximal mount count */ | 193 | __le16 s_max_mnt_count; /* Maximal mount count */ |
| 194 | __le16 s_state; /* File system state */ | 194 | __le16 s_state; /* File system state */ |
| 195 | __le16 s_errors; /* Behaviour when detecting errors */ | 195 | __le16 s_errors; /* Behaviour when detecting errors */ |
| 196 | __le64 s_lastcheck; /* time of last check */ | 196 | __le64 s_lastcheck; /* time of last check */ |
| 197 | 197 | ||
| 198 | __le32 s_checkinterval; /* max. time between checks */ | 198 | /*80*/ __le32 s_checkinterval; /* max. time between checks */ |
| 199 | __le32 s_creator_os; /* OS */ | 199 | __le32 s_creator_os; /* OS */ |
| 200 | __le16 s_def_resuid; /* Default uid for reserved blocks */ | 200 | __le16 s_def_resuid; /* Default uid for reserved blocks */ |
| 201 | __le16 s_def_resgid; /* Default gid for reserved blocks */ | 201 | __le16 s_def_resgid; /* Default gid for reserved blocks */ |
| 202 | __le32 s_first_ino; /* First non-reserved inode */ | 202 | __le32 s_first_ino; /* First non-reserved inode */ |
| 203 | 203 | ||
| 204 | __le16 s_inode_size; /* Size of an inode */ | 204 | /*90*/ __le16 s_inode_size; /* Size of an inode */ |
| 205 | __le16 s_dat_entry_size; /* Size of a dat entry */ | 205 | __le16 s_dat_entry_size; /* Size of a dat entry */ |
| 206 | __le16 s_checkpoint_size; /* Size of a checkpoint */ | 206 | __le16 s_checkpoint_size; /* Size of a checkpoint */ |
| 207 | __le16 s_segment_usage_size; /* Size of a segment usage */ | 207 | __le16 s_segment_usage_size; /* Size of a segment usage */ |
| 208 | 208 | ||
| 209 | __u8 s_uuid[16]; /* 128-bit uuid for volume */ | 209 | /*98*/ __u8 s_uuid[16]; /* 128-bit uuid for volume */ |
| 210 | char s_volume_name[80]; /* volume name */ | 210 | /*A8*/ char s_volume_name[80]; /* volume name */ |
| 211 | 211 | ||
| 212 | __le32 s_c_interval; /* Commit interval of segment */ | 212 | /*F8*/ __le32 s_c_interval; /* Commit interval of segment */ |
| 213 | __le32 s_c_block_max; /* Threshold of data amount for | 213 | __le32 s_c_block_max; /* Threshold of data amount for |
| 214 | the segment construction */ | 214 | the segment construction */ |
| 215 | __u32 s_reserved[192]; /* padding to the end of the block */ | 215 | /*100*/ __le64 s_feature_compat; /* Compatible feature set */ |
| 216 | __le64 s_feature_compat_ro; /* Read-only compatible feature set */ | ||
| 217 | __le64 s_feature_incompat; /* Incompatible feature set */ | ||
| 218 | __u32 s_reserved[186]; /* padding to the end of the block */ | ||
| 216 | }; | 219 | }; |
| 217 | 220 | ||
| 218 | /* | 221 | /* |
| @@ -228,6 +231,16 @@ struct nilfs_super_block { | |||
| 228 | #define NILFS_MINOR_REV 0 /* minor revision */ | 231 | #define NILFS_MINOR_REV 0 /* minor revision */ |
| 229 | 232 | ||
| 230 | /* | 233 | /* |
| 234 | * Feature set definitions | ||
| 235 | * | ||
| 236 | * If there is a bit set in the incompatible feature set that the kernel | ||
| 237 | * doesn't know about, it should refuse to mount the filesystem. | ||
| 238 | */ | ||
| 239 | #define NILFS_FEATURE_COMPAT_SUPP 0ULL | ||
| 240 | #define NILFS_FEATURE_COMPAT_RO_SUPP 0ULL | ||
| 241 | #define NILFS_FEATURE_INCOMPAT_SUPP 0ULL | ||
| 242 | |||
| 243 | /* | ||
| 231 | * Bytes count of super_block for CRC-calculation | 244 | * Bytes count of super_block for CRC-calculation |
| 232 | */ | 245 | */ |
| 233 | #define NILFS_SB_BYTES \ | 246 | #define NILFS_SB_BYTES \ |
| @@ -274,6 +287,12 @@ struct nilfs_super_block { | |||
| 274 | #define NILFS_NAME_LEN 255 | 287 | #define NILFS_NAME_LEN 255 |
| 275 | 288 | ||
| 276 | /* | 289 | /* |
| 290 | * Block size limitations | ||
| 291 | */ | ||
| 292 | #define NILFS_MIN_BLOCK_SIZE 1024 | ||
| 293 | #define NILFS_MAX_BLOCK_SIZE 65536 | ||
| 294 | |||
| 295 | /* | ||
| 277 | * The new version of the directory entry. Since V0 structures are | 296 | * The new version of the directory entry. Since V0 structures are |
| 278 | * stored in intel byte order, and the name_len field could never be | 297 | * stored in intel byte order, and the name_len field could never be |
| 279 | * bigger than 255 chars, it's safe to reclaim the extra byte for the | 298 | * bigger than 255 chars, it's safe to reclaim the extra byte for the |
| @@ -313,7 +332,25 @@ enum { | |||
| 313 | #define NILFS_DIR_ROUND (NILFS_DIR_PAD - 1) | 332 | #define NILFS_DIR_ROUND (NILFS_DIR_PAD - 1) |
| 314 | #define NILFS_DIR_REC_LEN(name_len) (((name_len) + 12 + NILFS_DIR_ROUND) & \ | 333 | #define NILFS_DIR_REC_LEN(name_len) (((name_len) + 12 + NILFS_DIR_ROUND) & \ |
| 315 | ~NILFS_DIR_ROUND) | 334 | ~NILFS_DIR_ROUND) |
| 335 | #define NILFS_MAX_REC_LEN ((1<<16)-1) | ||
| 316 | 336 | ||
| 337 | static inline unsigned nilfs_rec_len_from_disk(__le16 dlen) | ||
| 338 | { | ||
| 339 | unsigned len = le16_to_cpu(dlen); | ||
| 340 | |||
| 341 | if (len == NILFS_MAX_REC_LEN) | ||
| 342 | return 1 << 16; | ||
| 343 | return len; | ||
| 344 | } | ||
| 345 | |||
| 346 | static inline __le16 nilfs_rec_len_to_disk(unsigned len) | ||
| 347 | { | ||
| 348 | if (len == (1 << 16)) | ||
| 349 | return cpu_to_le16(NILFS_MAX_REC_LEN); | ||
| 350 | else if (len > (1 << 16)) | ||
| 351 | BUG(); | ||
| 352 | return cpu_to_le16(len); | ||
| 353 | } | ||
| 317 | 354 | ||
| 318 | /** | 355 | /** |
| 319 | * struct nilfs_finfo - file information | 356 | * struct nilfs_finfo - file information |
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h index b7c77f9712f4..2c8701687336 100644 --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h | |||
| @@ -132,7 +132,7 @@ | |||
| 132 | * %NL80211_ATTR_REG_RULE_POWER_MAX_ANT_GAIN and | 132 | * %NL80211_ATTR_REG_RULE_POWER_MAX_ANT_GAIN and |
| 133 | * %NL80211_ATTR_REG_RULE_POWER_MAX_EIRP. | 133 | * %NL80211_ATTR_REG_RULE_POWER_MAX_EIRP. |
| 134 | * @NL80211_CMD_REQ_SET_REG: ask the wireless core to set the regulatory domain | 134 | * @NL80211_CMD_REQ_SET_REG: ask the wireless core to set the regulatory domain |
| 135 | * to the the specified ISO/IEC 3166-1 alpha2 country code. The core will | 135 | * to the specified ISO/IEC 3166-1 alpha2 country code. The core will |
| 136 | * store this as a valid request and then query userspace for it. | 136 | * store this as a valid request and then query userspace for it. |
| 137 | * | 137 | * |
| 138 | * @NL80211_CMD_GET_MESH_PARAMS: Get mesh networking properties for the | 138 | * @NL80211_CMD_GET_MESH_PARAMS: Get mesh networking properties for the |
| @@ -725,6 +725,12 @@ enum nl80211_commands { | |||
| 725 | * @NL80211_ATTR_AP_ISOLATE: (AP mode) Do not forward traffic between stations | 725 | * @NL80211_ATTR_AP_ISOLATE: (AP mode) Do not forward traffic between stations |
| 726 | * connected to this BSS. | 726 | * connected to this BSS. |
| 727 | * | 727 | * |
| 728 | * @NL80211_ATTR_WIPHY_TX_POWER_SETTING: Transmit power setting type. See | ||
| 729 | * &enum nl80211_tx_power_setting for possible values. | ||
| 730 | * @NL80211_ATTR_WIPHY_TX_POWER_LEVEL: Transmit power level in signed mBm units. | ||
| 731 | * This is used in association with @NL80211_ATTR_WIPHY_TX_POWER_SETTING | ||
| 732 | * for non-automatic settings. | ||
| 733 | * | ||
| 728 | * @NL80211_ATTR_MAX: highest attribute number currently defined | 734 | * @NL80211_ATTR_MAX: highest attribute number currently defined |
| 729 | * @__NL80211_ATTR_AFTER_LAST: internal use | 735 | * @__NL80211_ATTR_AFTER_LAST: internal use |
| 730 | */ | 736 | */ |
| @@ -882,6 +888,9 @@ enum nl80211_attrs { | |||
| 882 | 888 | ||
| 883 | NL80211_ATTR_AP_ISOLATE, | 889 | NL80211_ATTR_AP_ISOLATE, |
| 884 | 890 | ||
| 891 | NL80211_ATTR_WIPHY_TX_POWER_SETTING, | ||
| 892 | NL80211_ATTR_WIPHY_TX_POWER_LEVEL, | ||
| 893 | |||
| 885 | /* add attributes here, update the policy in nl80211.c */ | 894 | /* add attributes here, update the policy in nl80211.c */ |
| 886 | 895 | ||
| 887 | __NL80211_ATTR_AFTER_LAST, | 896 | __NL80211_ATTR_AFTER_LAST, |
| @@ -1659,4 +1668,17 @@ enum nl80211_cqm_rssi_threshold_event { | |||
| 1659 | NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH, | 1668 | NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH, |
| 1660 | }; | 1669 | }; |
| 1661 | 1670 | ||
| 1671 | |||
| 1672 | /** | ||
| 1673 | * enum nl80211_tx_power_setting - TX power adjustment | ||
| 1674 | * @NL80211_TX_POWER_AUTOMATIC: automatically determine transmit power | ||
| 1675 | * @NL80211_TX_POWER_LIMITED: limit TX power by the mBm parameter | ||
| 1676 | * @NL80211_TX_POWER_FIXED: fix TX power to the mBm parameter | ||
| 1677 | */ | ||
| 1678 | enum nl80211_tx_power_setting { | ||
| 1679 | NL80211_TX_POWER_AUTOMATIC, | ||
| 1680 | NL80211_TX_POWER_LIMITED, | ||
| 1681 | NL80211_TX_POWER_FIXED, | ||
| 1682 | }; | ||
| 1683 | |||
| 1662 | #endif /* __LINUX_NL80211_H */ | 1684 | #endif /* __LINUX_NL80211_H */ |
diff --git a/include/linux/nmi.h b/include/linux/nmi.h index b752e807adde..06aab5eee134 100644 --- a/include/linux/nmi.h +++ b/include/linux/nmi.h | |||
| @@ -20,10 +20,14 @@ extern void touch_nmi_watchdog(void); | |||
| 20 | extern void acpi_nmi_disable(void); | 20 | extern void acpi_nmi_disable(void); |
| 21 | extern void acpi_nmi_enable(void); | 21 | extern void acpi_nmi_enable(void); |
| 22 | #else | 22 | #else |
| 23 | #ifndef CONFIG_HARDLOCKUP_DETECTOR | ||
| 23 | static inline void touch_nmi_watchdog(void) | 24 | static inline void touch_nmi_watchdog(void) |
| 24 | { | 25 | { |
| 25 | touch_softlockup_watchdog(); | 26 | touch_softlockup_watchdog(); |
| 26 | } | 27 | } |
| 28 | #else | ||
| 29 | extern void touch_nmi_watchdog(void); | ||
| 30 | #endif | ||
| 27 | static inline void acpi_nmi_disable(void) { } | 31 | static inline void acpi_nmi_disable(void) { } |
| 28 | static inline void acpi_nmi_enable(void) { } | 32 | static inline void acpi_nmi_enable(void) { } |
| 29 | #endif | 33 | #endif |
| @@ -47,4 +51,13 @@ static inline bool trigger_all_cpu_backtrace(void) | |||
| 47 | } | 51 | } |
| 48 | #endif | 52 | #endif |
| 49 | 53 | ||
| 54 | #ifdef CONFIG_LOCKUP_DETECTOR | ||
| 55 | int hw_nmi_is_cpu_stuck(struct pt_regs *); | ||
| 56 | u64 hw_nmi_get_sample_period(void); | ||
| 57 | extern int watchdog_enabled; | ||
| 58 | struct ctl_table; | ||
| 59 | extern int proc_dowatchdog_enabled(struct ctl_table *, int , | ||
| 60 | void __user *, size_t *, loff_t *); | ||
| 61 | #endif | ||
| 62 | |||
| 50 | #endif | 63 | #endif |
diff --git a/include/linux/notifier.h b/include/linux/notifier.h index 540703b555cb..b2f1a4d83550 100644 --- a/include/linux/notifier.h +++ b/include/linux/notifier.h | |||
| @@ -210,6 +210,7 @@ static inline int notifier_to_errno(int ret) | |||
| 210 | #define NETDEV_POST_INIT 0x0010 | 210 | #define NETDEV_POST_INIT 0x0010 |
| 211 | #define NETDEV_UNREGISTER_BATCH 0x0011 | 211 | #define NETDEV_UNREGISTER_BATCH 0x0011 |
| 212 | #define NETDEV_BONDING_DESLAVE 0x0012 | 212 | #define NETDEV_BONDING_DESLAVE 0x0012 |
| 213 | #define NETDEV_NOTIFY_PEERS 0x0013 | ||
| 213 | 214 | ||
| 214 | #define SYS_DOWN 0x0001 /* Notify of system down */ | 215 | #define SYS_DOWN 0x0001 /* Notify of system down */ |
| 215 | #define SYS_RESTART SYS_DOWN | 216 | #define SYS_RESTART SYS_DOWN |
diff --git a/include/linux/of.h b/include/linux/of.h index a367e19bb3af..cad7cf0ab278 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
| @@ -70,6 +70,11 @@ extern struct device_node *allnodes; | |||
| 70 | extern struct device_node *of_chosen; | 70 | extern struct device_node *of_chosen; |
| 71 | extern rwlock_t devtree_lock; | 71 | extern rwlock_t devtree_lock; |
| 72 | 72 | ||
| 73 | static inline bool of_node_is_root(const struct device_node *node) | ||
| 74 | { | ||
| 75 | return node && (node->parent == NULL); | ||
| 76 | } | ||
| 77 | |||
| 73 | static inline int of_node_check_flag(struct device_node *n, unsigned long flag) | 78 | static inline int of_node_check_flag(struct device_node *n, unsigned long flag) |
| 74 | { | 79 | { |
| 75 | return test_bit(flag, &n->_flags); | 80 | return test_bit(flag, &n->_flags); |
| @@ -141,6 +146,11 @@ static inline unsigned long of_read_ulong(const __be32 *cell, int size) | |||
| 141 | 146 | ||
| 142 | #define OF_BAD_ADDR ((u64)-1) | 147 | #define OF_BAD_ADDR ((u64)-1) |
| 143 | 148 | ||
| 149 | #ifndef of_node_to_nid | ||
| 150 | static inline int of_node_to_nid(struct device_node *np) { return -1; } | ||
| 151 | #define of_node_to_nid of_node_to_nid | ||
| 152 | #endif | ||
| 153 | |||
| 144 | extern struct device_node *of_find_node_by_name(struct device_node *from, | 154 | extern struct device_node *of_find_node_by_name(struct device_node *from, |
| 145 | const char *name); | 155 | const char *name); |
| 146 | #define for_each_node_by_name(dn, name) \ | 156 | #define for_each_node_by_name(dn, name) \ |
diff --git a/include/linux/of_address.h b/include/linux/of_address.h new file mode 100644 index 000000000000..8aea06f0564c --- /dev/null +++ b/include/linux/of_address.h | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | #ifndef __OF_ADDRESS_H | ||
| 2 | #define __OF_ADDRESS_H | ||
| 3 | #include <linux/ioport.h> | ||
| 4 | #include <linux/of.h> | ||
| 5 | |||
| 6 | extern u64 of_translate_address(struct device_node *np, const u32 *addr); | ||
| 7 | extern int of_address_to_resource(struct device_node *dev, int index, | ||
| 8 | struct resource *r); | ||
| 9 | extern void __iomem *of_iomap(struct device_node *device, int index); | ||
| 10 | |||
| 11 | /* Extract an address from a device, returns the region size and | ||
| 12 | * the address space flags too. The PCI version uses a BAR number | ||
| 13 | * instead of an absolute index | ||
| 14 | */ | ||
| 15 | extern const u32 *of_get_address(struct device_node *dev, int index, | ||
| 16 | u64 *size, unsigned int *flags); | ||
| 17 | |||
| 18 | #ifndef pci_address_to_pio | ||
| 19 | static inline unsigned long pci_address_to_pio(phys_addr_t addr) { return -1; } | ||
| 20 | #define pci_address_to_pio pci_address_to_pio | ||
| 21 | #endif | ||
| 22 | |||
| 23 | #ifdef CONFIG_PCI | ||
| 24 | extern const u32 *of_get_pci_address(struct device_node *dev, int bar_no, | ||
| 25 | u64 *size, unsigned int *flags); | ||
| 26 | extern int of_pci_address_to_resource(struct device_node *dev, int bar, | ||
| 27 | struct resource *r); | ||
| 28 | #else /* CONFIG_PCI */ | ||
| 29 | static inline int of_pci_address_to_resource(struct device_node *dev, int bar, | ||
| 30 | struct resource *r) | ||
| 31 | { | ||
| 32 | return -ENOSYS; | ||
| 33 | } | ||
| 34 | |||
| 35 | static inline const u32 *of_get_pci_address(struct device_node *dev, | ||
| 36 | int bar_no, u64 *size, unsigned int *flags) | ||
| 37 | { | ||
| 38 | return NULL; | ||
| 39 | } | ||
| 40 | #endif /* CONFIG_PCI */ | ||
| 41 | |||
| 42 | |||
| 43 | #endif /* __OF_ADDRESS_H */ | ||
| 44 | |||
diff --git a/include/linux/of_device.h b/include/linux/of_device.h index 11651facc5f1..35aa44ad9f2c 100644 --- a/include/linux/of_device.h +++ b/include/linux/of_device.h | |||
| @@ -1,32 +1,77 @@ | |||
| 1 | #ifndef _LINUX_OF_DEVICE_H | 1 | #ifndef _LINUX_OF_DEVICE_H |
| 2 | #define _LINUX_OF_DEVICE_H | 2 | #define _LINUX_OF_DEVICE_H |
| 3 | 3 | ||
| 4 | /* | ||
| 5 | * The of_device *was* a kind of "base class" that was a superset of | ||
| 6 | * struct device for use by devices attached to an OF node and probed | ||
| 7 | * using OF properties. However, the important bit of OF-style | ||
| 8 | * probing, namely the device node pointer, has been moved into the | ||
| 9 | * common struct device when CONFIG_OF is set to make OF-style probing | ||
| 10 | * available to all bus types. So now, just make of_device and | ||
| 11 | * platform_device equivalent so that current of_platform bus users | ||
| 12 | * can be transparently migrated over to using the platform bus. | ||
| 13 | * | ||
| 14 | * This line will go away once all references to of_device are removed | ||
| 15 | * from the kernel. | ||
| 16 | */ | ||
| 17 | #define of_device platform_device | ||
| 18 | #include <linux/platform_device.h> | ||
| 19 | #include <linux/of_platform.h> /* temporary until merge */ | ||
| 20 | |||
| 4 | #ifdef CONFIG_OF_DEVICE | 21 | #ifdef CONFIG_OF_DEVICE |
| 5 | #include <linux/device.h> | 22 | #include <linux/device.h> |
| 6 | #include <linux/of.h> | 23 | #include <linux/of.h> |
| 7 | #include <linux/mod_devicetable.h> | 24 | #include <linux/mod_devicetable.h> |
| 8 | 25 | ||
| 9 | #include <asm/of_device.h> | ||
| 10 | |||
| 11 | #define to_of_device(d) container_of(d, struct of_device, dev) | 26 | #define to_of_device(d) container_of(d, struct of_device, dev) |
| 12 | 27 | ||
| 13 | extern const struct of_device_id *of_match_device( | 28 | extern const struct of_device_id *of_match_device( |
| 14 | const struct of_device_id *matches, const struct device *dev); | 29 | const struct of_device_id *matches, const struct device *dev); |
| 30 | extern void of_device_make_bus_id(struct device *dev); | ||
| 31 | |||
| 32 | /** | ||
| 33 | * of_driver_match_device - Tell if a driver's of_match_table matches a device. | ||
| 34 | * @drv: the device_driver structure to test | ||
| 35 | * @dev: the device structure to match against | ||
| 36 | */ | ||
| 37 | static inline int of_driver_match_device(const struct device *dev, | ||
| 38 | const struct device_driver *drv) | ||
| 39 | { | ||
| 40 | return of_match_device(drv->of_match_table, dev) != NULL; | ||
| 41 | } | ||
| 15 | 42 | ||
| 16 | extern struct of_device *of_dev_get(struct of_device *dev); | 43 | extern struct platform_device *of_dev_get(struct platform_device *dev); |
| 17 | extern void of_dev_put(struct of_device *dev); | 44 | extern void of_dev_put(struct platform_device *dev); |
| 18 | 45 | ||
| 19 | extern int of_device_register(struct of_device *ofdev); | 46 | extern int of_device_register(struct platform_device *ofdev); |
| 20 | extern void of_device_unregister(struct of_device *ofdev); | 47 | extern void of_device_unregister(struct platform_device *ofdev); |
| 21 | extern void of_release_dev(struct device *dev); | 48 | extern void of_release_dev(struct device *dev); |
| 22 | 49 | ||
| 23 | static inline void of_device_free(struct of_device *dev) | 50 | static inline void of_device_free(struct platform_device *dev) |
| 24 | { | 51 | { |
| 25 | of_release_dev(&dev->dev); | 52 | of_release_dev(&dev->dev); |
| 26 | } | 53 | } |
| 27 | 54 | ||
| 28 | extern ssize_t of_device_get_modalias(struct of_device *ofdev, | 55 | extern ssize_t of_device_get_modalias(struct device *dev, |
| 29 | char *str, ssize_t len); | 56 | char *str, ssize_t len); |
| 57 | |||
| 58 | extern int of_device_uevent(struct device *dev, struct kobj_uevent_env *env); | ||
| 59 | |||
| 60 | |||
| 61 | #else /* CONFIG_OF_DEVICE */ | ||
| 62 | |||
| 63 | static inline int of_driver_match_device(struct device *dev, | ||
| 64 | struct device_driver *drv) | ||
| 65 | { | ||
| 66 | return 0; | ||
| 67 | } | ||
| 68 | |||
| 69 | static inline int of_device_uevent(struct device *dev, | ||
| 70 | struct kobj_uevent_env *env) | ||
| 71 | { | ||
| 72 | return -ENODEV; | ||
| 73 | } | ||
| 74 | |||
| 30 | #endif /* CONFIG_OF_DEVICE */ | 75 | #endif /* CONFIG_OF_DEVICE */ |
| 31 | 76 | ||
| 32 | #endif /* _LINUX_OF_DEVICE_H */ | 77 | #endif /* _LINUX_OF_DEVICE_H */ |
diff --git a/include/linux/of_gpio.h b/include/linux/of_gpio.h index fc2472c3c254..6598c04dab01 100644 --- a/include/linux/of_gpio.h +++ b/include/linux/of_gpio.h | |||
| @@ -33,34 +33,17 @@ enum of_gpio_flags { | |||
| 33 | #ifdef CONFIG_OF_GPIO | 33 | #ifdef CONFIG_OF_GPIO |
| 34 | 34 | ||
| 35 | /* | 35 | /* |
| 36 | * Generic OF GPIO chip | ||
| 37 | */ | ||
| 38 | struct of_gpio_chip { | ||
| 39 | struct gpio_chip gc; | ||
| 40 | int gpio_cells; | ||
| 41 | int (*xlate)(struct of_gpio_chip *of_gc, struct device_node *np, | ||
| 42 | const void *gpio_spec, enum of_gpio_flags *flags); | ||
| 43 | }; | ||
| 44 | |||
| 45 | static inline struct of_gpio_chip *to_of_gpio_chip(struct gpio_chip *gc) | ||
| 46 | { | ||
| 47 | return container_of(gc, struct of_gpio_chip, gc); | ||
| 48 | } | ||
| 49 | |||
| 50 | /* | ||
| 51 | * OF GPIO chip for memory mapped banks | 36 | * OF GPIO chip for memory mapped banks |
| 52 | */ | 37 | */ |
| 53 | struct of_mm_gpio_chip { | 38 | struct of_mm_gpio_chip { |
| 54 | struct of_gpio_chip of_gc; | 39 | struct gpio_chip gc; |
| 55 | void (*save_regs)(struct of_mm_gpio_chip *mm_gc); | 40 | void (*save_regs)(struct of_mm_gpio_chip *mm_gc); |
| 56 | void __iomem *regs; | 41 | void __iomem *regs; |
| 57 | }; | 42 | }; |
| 58 | 43 | ||
| 59 | static inline struct of_mm_gpio_chip *to_of_mm_gpio_chip(struct gpio_chip *gc) | 44 | static inline struct of_mm_gpio_chip *to_of_mm_gpio_chip(struct gpio_chip *gc) |
| 60 | { | 45 | { |
| 61 | struct of_gpio_chip *of_gc = to_of_gpio_chip(gc); | 46 | return container_of(gc, struct of_mm_gpio_chip, gc); |
| 62 | |||
| 63 | return container_of(of_gc, struct of_mm_gpio_chip, of_gc); | ||
| 64 | } | 47 | } |
| 65 | 48 | ||
| 66 | extern int of_get_gpio_flags(struct device_node *np, int index, | 49 | extern int of_get_gpio_flags(struct device_node *np, int index, |
| @@ -69,11 +52,12 @@ extern unsigned int of_gpio_count(struct device_node *np); | |||
| 69 | 52 | ||
| 70 | extern int of_mm_gpiochip_add(struct device_node *np, | 53 | extern int of_mm_gpiochip_add(struct device_node *np, |
| 71 | struct of_mm_gpio_chip *mm_gc); | 54 | struct of_mm_gpio_chip *mm_gc); |
| 72 | extern int of_gpio_simple_xlate(struct of_gpio_chip *of_gc, | 55 | |
| 73 | struct device_node *np, | 56 | extern void of_gpiochip_add(struct gpio_chip *gc); |
| 74 | const void *gpio_spec, | 57 | extern void of_gpiochip_remove(struct gpio_chip *gc); |
| 75 | enum of_gpio_flags *flags); | 58 | extern struct gpio_chip *of_node_to_gpiochip(struct device_node *np); |
| 76 | #else | 59 | |
| 60 | #else /* CONFIG_OF_GPIO */ | ||
| 77 | 61 | ||
| 78 | /* Drivers may not strictly depend on the GPIO support, so let them link. */ | 62 | /* Drivers may not strictly depend on the GPIO support, so let them link. */ |
| 79 | static inline int of_get_gpio_flags(struct device_node *np, int index, | 63 | static inline int of_get_gpio_flags(struct device_node *np, int index, |
| @@ -87,6 +71,9 @@ static inline unsigned int of_gpio_count(struct device_node *np) | |||
| 87 | return 0; | 71 | return 0; |
| 88 | } | 72 | } |
| 89 | 73 | ||
| 74 | static inline void of_gpiochip_add(struct gpio_chip *gc) { } | ||
| 75 | static inline void of_gpiochip_remove(struct gpio_chip *gc) { } | ||
| 76 | |||
| 90 | #endif /* CONFIG_OF_GPIO */ | 77 | #endif /* CONFIG_OF_GPIO */ |
| 91 | 78 | ||
| 92 | /** | 79 | /** |
diff --git a/include/linux/of_i2c.h b/include/linux/of_i2c.h index 34974b5a76f7..0efe8d465f55 100644 --- a/include/linux/of_i2c.h +++ b/include/linux/of_i2c.h | |||
| @@ -12,12 +12,19 @@ | |||
| 12 | #ifndef __LINUX_OF_I2C_H | 12 | #ifndef __LINUX_OF_I2C_H |
| 13 | #define __LINUX_OF_I2C_H | 13 | #define __LINUX_OF_I2C_H |
| 14 | 14 | ||
| 15 | #if defined(CONFIG_OF_I2C) || defined(CONFIG_OF_I2C_MODULE) | ||
| 15 | #include <linux/i2c.h> | 16 | #include <linux/i2c.h> |
| 16 | 17 | ||
| 17 | void of_register_i2c_devices(struct i2c_adapter *adap, | 18 | extern void of_i2c_register_devices(struct i2c_adapter *adap); |
| 18 | struct device_node *adap_node); | ||
| 19 | 19 | ||
| 20 | /* must call put_device() when done with returned i2c_client device */ | 20 | /* must call put_device() when done with returned i2c_client device */ |
| 21 | struct i2c_client *of_find_i2c_device_by_node(struct device_node *node); | 21 | extern struct i2c_client *of_find_i2c_device_by_node(struct device_node *node); |
| 22 | |||
| 23 | #else | ||
| 24 | static inline void of_i2c_register_devices(struct i2c_adapter *adap) | ||
| 25 | { | ||
| 26 | return; | ||
| 27 | } | ||
| 28 | #endif /* CONFIG_OF_I2C */ | ||
| 22 | 29 | ||
| 23 | #endif /* __LINUX_OF_I2C_H */ | 30 | #endif /* __LINUX_OF_I2C_H */ |
diff --git a/include/linux/of_irq.h b/include/linux/of_irq.h new file mode 100644 index 000000000000..5929781c104d --- /dev/null +++ b/include/linux/of_irq.h | |||
| @@ -0,0 +1,70 @@ | |||
| 1 | #ifndef __OF_IRQ_H | ||
| 2 | #define __OF_IRQ_H | ||
| 3 | |||
| 4 | #if defined(CONFIG_OF) | ||
| 5 | struct of_irq; | ||
| 6 | #include <linux/types.h> | ||
| 7 | #include <linux/errno.h> | ||
| 8 | #include <linux/ioport.h> | ||
| 9 | #include <linux/of.h> | ||
| 10 | |||
| 11 | /* | ||
| 12 | * irq_of_parse_and_map() is used ba all OF enabled platforms; but SPARC | ||
| 13 | * implements it differently. However, the prototype is the same for all, | ||
| 14 | * so declare it here regardless of the CONFIG_OF_IRQ setting. | ||
| 15 | */ | ||
| 16 | extern unsigned int irq_of_parse_and_map(struct device_node *node, int index); | ||
| 17 | |||
| 18 | #if defined(CONFIG_OF_IRQ) | ||
| 19 | /** | ||
| 20 | * of_irq - container for device_node/irq_specifier pair for an irq controller | ||
| 21 | * @controller: pointer to interrupt controller device tree node | ||
| 22 | * @size: size of interrupt specifier | ||
| 23 | * @specifier: array of cells @size long specifing the specific interrupt | ||
| 24 | * | ||
| 25 | * This structure is returned when an interrupt is mapped. The controller | ||
| 26 | * field needs to be put() after use | ||
| 27 | */ | ||
| 28 | #define OF_MAX_IRQ_SPEC 4 /* We handle specifiers of at most 4 cells */ | ||
| 29 | struct of_irq { | ||
| 30 | struct device_node *controller; /* Interrupt controller node */ | ||
| 31 | u32 size; /* Specifier size */ | ||
| 32 | u32 specifier[OF_MAX_IRQ_SPEC]; /* Specifier copy */ | ||
| 33 | }; | ||
| 34 | |||
| 35 | /* | ||
| 36 | * Workarounds only applied to 32bit powermac machines | ||
| 37 | */ | ||
| 38 | #define OF_IMAP_OLDWORLD_MAC 0x00000001 | ||
| 39 | #define OF_IMAP_NO_PHANDLE 0x00000002 | ||
| 40 | |||
| 41 | #if defined(CONFIG_PPC32) && defined(CONFIG_PPC_PMAC) | ||
| 42 | extern unsigned int of_irq_workarounds; | ||
| 43 | extern struct device_node *of_irq_dflt_pic; | ||
| 44 | extern int of_irq_map_oldworld(struct device_node *device, int index, | ||
| 45 | struct of_irq *out_irq); | ||
| 46 | #else /* CONFIG_PPC32 && CONFIG_PPC_PMAC */ | ||
| 47 | #define of_irq_workarounds (0) | ||
| 48 | #define of_irq_dflt_pic (NULL) | ||
| 49 | static inline int of_irq_map_oldworld(struct device_node *device, int index, | ||
| 50 | struct of_irq *out_irq) | ||
| 51 | { | ||
| 52 | return -EINVAL; | ||
| 53 | } | ||
| 54 | #endif /* CONFIG_PPC32 && CONFIG_PPC_PMAC */ | ||
| 55 | |||
| 56 | |||
| 57 | extern int of_irq_map_raw(struct device_node *parent, const u32 *intspec, | ||
| 58 | u32 ointsize, const u32 *addr, | ||
| 59 | struct of_irq *out_irq); | ||
| 60 | extern int of_irq_map_one(struct device_node *device, int index, | ||
| 61 | struct of_irq *out_irq); | ||
| 62 | extern unsigned int irq_create_of_mapping(struct device_node *controller, | ||
| 63 | const u32 *intspec, | ||
| 64 | unsigned int intsize); | ||
| 65 | extern int of_irq_to_resource(struct device_node *dev, int index, | ||
| 66 | struct resource *r); | ||
| 67 | |||
| 68 | #endif /* CONFIG_OF_IRQ */ | ||
| 69 | #endif /* CONFIG_OF */ | ||
| 70 | #endif /* __OF_IRQ_H */ | ||
diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h index 1643d3761eb4..4e6d989c06df 100644 --- a/include/linux/of_platform.h +++ b/include/linux/of_platform.h | |||
| @@ -17,29 +17,24 @@ | |||
| 17 | #include <linux/mod_devicetable.h> | 17 | #include <linux/mod_devicetable.h> |
| 18 | #include <linux/pm.h> | 18 | #include <linux/pm.h> |
| 19 | #include <linux/of_device.h> | 19 | #include <linux/of_device.h> |
| 20 | 20 | #include <linux/platform_device.h> | |
| 21 | /* | ||
| 22 | * The of_platform_bus_type is a bus type used by drivers that do not | ||
| 23 | * attach to a macio or similar bus but still use OF probing | ||
| 24 | * mechanism | ||
| 25 | */ | ||
| 26 | extern struct bus_type of_platform_bus_type; | ||
| 27 | 21 | ||
| 28 | /* | 22 | /* |
| 29 | * An of_platform_driver driver is attached to a basic of_device on | 23 | * An of_platform_driver driver is attached to a basic of_device on |
| 30 | * the "platform bus" (of_platform_bus_type). | 24 | * the "platform bus" (platform_bus_type). |
| 31 | */ | 25 | */ |
| 32 | struct of_platform_driver | 26 | struct of_platform_driver |
| 33 | { | 27 | { |
| 34 | int (*probe)(struct of_device* dev, | 28 | int (*probe)(struct platform_device* dev, |
| 35 | const struct of_device_id *match); | 29 | const struct of_device_id *match); |
| 36 | int (*remove)(struct of_device* dev); | 30 | int (*remove)(struct platform_device* dev); |
| 37 | 31 | ||
| 38 | int (*suspend)(struct of_device* dev, pm_message_t state); | 32 | int (*suspend)(struct platform_device* dev, pm_message_t state); |
| 39 | int (*resume)(struct of_device* dev); | 33 | int (*resume)(struct platform_device* dev); |
| 40 | int (*shutdown)(struct of_device* dev); | 34 | int (*shutdown)(struct platform_device* dev); |
| 41 | 35 | ||
| 42 | struct device_driver driver; | 36 | struct device_driver driver; |
| 37 | struct platform_driver platform_driver; | ||
| 43 | }; | 38 | }; |
| 44 | #define to_of_platform_driver(drv) \ | 39 | #define to_of_platform_driver(drv) \ |
| 45 | container_of(drv,struct of_platform_driver, driver) | 40 | container_of(drv,struct of_platform_driver, driver) |
| @@ -49,20 +44,30 @@ extern int of_register_driver(struct of_platform_driver *drv, | |||
| 49 | extern void of_unregister_driver(struct of_platform_driver *drv); | 44 | extern void of_unregister_driver(struct of_platform_driver *drv); |
| 50 | 45 | ||
| 51 | /* Platform drivers register/unregister */ | 46 | /* Platform drivers register/unregister */ |
| 52 | static inline int of_register_platform_driver(struct of_platform_driver *drv) | 47 | extern int of_register_platform_driver(struct of_platform_driver *drv); |
| 53 | { | 48 | extern void of_unregister_platform_driver(struct of_platform_driver *drv); |
| 54 | return of_register_driver(drv, &of_platform_bus_type); | ||
| 55 | } | ||
| 56 | static inline void of_unregister_platform_driver(struct of_platform_driver *drv) | ||
| 57 | { | ||
| 58 | of_unregister_driver(drv); | ||
| 59 | } | ||
| 60 | 49 | ||
| 61 | #include <asm/of_platform.h> | 50 | extern struct platform_device *of_device_alloc(struct device_node *np, |
| 62 | 51 | const char *bus_id, | |
| 63 | extern struct of_device *of_find_device_by_node(struct device_node *np); | 52 | struct device *parent); |
| 53 | extern struct platform_device *of_find_device_by_node(struct device_node *np); | ||
| 64 | 54 | ||
| 65 | extern int of_bus_type_init(struct bus_type *bus, const char *name); | 55 | extern int of_bus_type_init(struct bus_type *bus, const char *name); |
| 56 | |||
| 57 | #if !defined(CONFIG_SPARC) /* SPARC has its own device registration method */ | ||
| 58 | /* Platform devices and busses creation */ | ||
| 59 | extern struct platform_device *of_platform_device_create(struct device_node *np, | ||
| 60 | const char *bus_id, | ||
| 61 | struct device *parent); | ||
| 62 | |||
| 63 | /* pseudo "matches" value to not do deep probe */ | ||
| 64 | #define OF_NO_DEEP_PROBE ((struct of_device_id *)-1) | ||
| 65 | |||
| 66 | extern int of_platform_bus_probe(struct device_node *root, | ||
| 67 | const struct of_device_id *matches, | ||
| 68 | struct device *parent); | ||
| 69 | #endif /* !CONFIG_SPARC */ | ||
| 70 | |||
| 66 | #endif /* CONFIG_OF_DEVICE */ | 71 | #endif /* CONFIG_OF_DEVICE */ |
| 67 | 72 | ||
| 68 | #endif /* _LINUX_OF_PLATFORM_H */ | 73 | #endif /* _LINUX_OF_PLATFORM_H */ |
diff --git a/include/linux/of_spi.h b/include/linux/of_spi.h index 5f71ee8c0868..9e3e70f78ae6 100644 --- a/include/linux/of_spi.h +++ b/include/linux/of_spi.h | |||
| @@ -9,10 +9,15 @@ | |||
| 9 | #ifndef __LINUX_OF_SPI_H | 9 | #ifndef __LINUX_OF_SPI_H |
| 10 | #define __LINUX_OF_SPI_H | 10 | #define __LINUX_OF_SPI_H |
| 11 | 11 | ||
| 12 | #include <linux/of.h> | ||
| 13 | #include <linux/spi/spi.h> | 12 | #include <linux/spi/spi.h> |
| 14 | 13 | ||
| 15 | extern void of_register_spi_devices(struct spi_master *master, | 14 | #if defined(CONFIG_OF_SPI) || defined(CONFIG_OF_SPI_MODULE) |
| 16 | struct device_node *np); | 15 | extern void of_register_spi_devices(struct spi_master *master); |
| 16 | #else | ||
| 17 | static inline void of_register_spi_devices(struct spi_master *master) | ||
| 18 | { | ||
| 19 | return; | ||
| 20 | } | ||
| 21 | #endif /* CONFIG_OF_SPI */ | ||
| 17 | 22 | ||
| 18 | #endif /* __LINUX_OF_SPI */ | 23 | #endif /* __LINUX_OF_SPI */ |
diff --git a/include/linux/omapfb.h b/include/linux/omapfb.h index 9bdd91486b49..c0b018790f07 100644 --- a/include/linux/omapfb.h +++ b/include/linux/omapfb.h | |||
| @@ -85,6 +85,9 @@ | |||
| 85 | #define OMAPFB_MEMTYPE_SRAM 1 | 85 | #define OMAPFB_MEMTYPE_SRAM 1 |
| 86 | #define OMAPFB_MEMTYPE_MAX 1 | 86 | #define OMAPFB_MEMTYPE_MAX 1 |
| 87 | 87 | ||
| 88 | #define OMAPFB_MEM_IDX_ENABLED 0x80 | ||
| 89 | #define OMAPFB_MEM_IDX_MASK 0x7f | ||
| 90 | |||
| 88 | enum omapfb_color_format { | 91 | enum omapfb_color_format { |
| 89 | OMAPFB_COLOR_RGB565 = 0, | 92 | OMAPFB_COLOR_RGB565 = 0, |
| 90 | OMAPFB_COLOR_YUV422, | 93 | OMAPFB_COLOR_YUV422, |
| @@ -136,7 +139,7 @@ struct omapfb_plane_info { | |||
| 136 | __u8 enabled; | 139 | __u8 enabled; |
| 137 | __u8 channel_out; | 140 | __u8 channel_out; |
| 138 | __u8 mirror; | 141 | __u8 mirror; |
| 139 | __u8 reserved1; | 142 | __u8 mem_idx; |
| 140 | __u32 out_width; | 143 | __u32 out_width; |
| 141 | __u32 out_height; | 144 | __u32 out_height; |
| 142 | __u32 reserved2[12]; | 145 | __u32 reserved2[12]; |
| @@ -253,7 +256,7 @@ struct omapfb_platform_data { | |||
| 253 | /* in arch/arm/plat-omap/fb.c */ | 256 | /* in arch/arm/plat-omap/fb.c */ |
| 254 | extern void omapfb_set_platform_data(struct omapfb_platform_data *data); | 257 | extern void omapfb_set_platform_data(struct omapfb_platform_data *data); |
| 255 | extern void omapfb_set_ctrl_platform_data(void *pdata); | 258 | extern void omapfb_set_ctrl_platform_data(void *pdata); |
| 256 | extern void omapfb_reserve_sdram(void); | 259 | extern void omapfb_reserve_sdram_memblock(void); |
| 257 | 260 | ||
| 258 | #endif | 261 | #endif |
| 259 | 262 | ||
diff --git a/include/linux/padata.h b/include/linux/padata.h index 8d8406246eef..bdcd1e9eacea 100644 --- a/include/linux/padata.h +++ b/include/linux/padata.h | |||
| @@ -25,6 +25,11 @@ | |||
| 25 | #include <linux/spinlock.h> | 25 | #include <linux/spinlock.h> |
| 26 | #include <linux/list.h> | 26 | #include <linux/list.h> |
| 27 | #include <linux/timer.h> | 27 | #include <linux/timer.h> |
| 28 | #include <linux/notifier.h> | ||
| 29 | #include <linux/kobject.h> | ||
| 30 | |||
| 31 | #define PADATA_CPU_SERIAL 0x01 | ||
| 32 | #define PADATA_CPU_PARALLEL 0x02 | ||
| 28 | 33 | ||
| 29 | /** | 34 | /** |
| 30 | * struct padata_priv - Embedded to the users data structure. | 35 | * struct padata_priv - Embedded to the users data structure. |
| @@ -59,7 +64,20 @@ struct padata_list { | |||
| 59 | }; | 64 | }; |
| 60 | 65 | ||
| 61 | /** | 66 | /** |
| 62 | * struct padata_queue - The percpu padata queues. | 67 | * struct padata_serial_queue - The percpu padata serial queue |
| 68 | * | ||
| 69 | * @serial: List to wait for serialization after reordering. | ||
| 70 | * @work: work struct for serialization. | ||
| 71 | * @pd: Backpointer to the internal control structure. | ||
| 72 | */ | ||
| 73 | struct padata_serial_queue { | ||
| 74 | struct padata_list serial; | ||
| 75 | struct work_struct work; | ||
| 76 | struct parallel_data *pd; | ||
| 77 | }; | ||
| 78 | |||
| 79 | /** | ||
| 80 | * struct padata_parallel_queue - The percpu padata parallel queue | ||
| 63 | * | 81 | * |
| 64 | * @parallel: List to wait for parallelization. | 82 | * @parallel: List to wait for parallelization. |
| 65 | * @reorder: List to wait for reordering after parallel processing. | 83 | * @reorder: List to wait for reordering after parallel processing. |
| @@ -67,18 +85,28 @@ struct padata_list { | |||
| 67 | * @pwork: work struct for parallelization. | 85 | * @pwork: work struct for parallelization. |
| 68 | * @swork: work struct for serialization. | 86 | * @swork: work struct for serialization. |
| 69 | * @pd: Backpointer to the internal control structure. | 87 | * @pd: Backpointer to the internal control structure. |
| 88 | * @work: work struct for parallelization. | ||
| 70 | * @num_obj: Number of objects that are processed by this cpu. | 89 | * @num_obj: Number of objects that are processed by this cpu. |
| 71 | * @cpu_index: Index of the cpu. | 90 | * @cpu_index: Index of the cpu. |
| 72 | */ | 91 | */ |
| 73 | struct padata_queue { | 92 | struct padata_parallel_queue { |
| 74 | struct padata_list parallel; | 93 | struct padata_list parallel; |
| 75 | struct padata_list reorder; | 94 | struct padata_list reorder; |
| 76 | struct padata_list serial; | 95 | struct parallel_data *pd; |
| 77 | struct work_struct pwork; | 96 | struct work_struct work; |
| 78 | struct work_struct swork; | 97 | atomic_t num_obj; |
| 79 | struct parallel_data *pd; | 98 | int cpu_index; |
| 80 | atomic_t num_obj; | 99 | }; |
| 81 | int cpu_index; | 100 | |
| 101 | /** | ||
| 102 | * struct padata_cpumask - The cpumasks for the parallel/serial workers | ||
| 103 | * | ||
| 104 | * @pcpu: cpumask for the parallel workers. | ||
| 105 | * @cbcpu: cpumask for the serial (callback) workers. | ||
| 106 | */ | ||
| 107 | struct padata_cpumask { | ||
| 108 | cpumask_var_t pcpu; | ||
| 109 | cpumask_var_t cbcpu; | ||
| 82 | }; | 110 | }; |
| 83 | 111 | ||
| 84 | /** | 112 | /** |
| @@ -86,25 +114,29 @@ struct padata_queue { | |||
| 86 | * that depends on the cpumask in use. | 114 | * that depends on the cpumask in use. |
| 87 | * | 115 | * |
| 88 | * @pinst: padata instance. | 116 | * @pinst: padata instance. |
| 89 | * @queue: percpu padata queues. | 117 | * @pqueue: percpu padata queues used for parallelization. |
| 118 | * @squeue: percpu padata queues used for serialuzation. | ||
| 90 | * @seq_nr: The sequence number that will be attached to the next object. | 119 | * @seq_nr: The sequence number that will be attached to the next object. |
| 91 | * @reorder_objects: Number of objects waiting in the reorder queues. | 120 | * @reorder_objects: Number of objects waiting in the reorder queues. |
| 92 | * @refcnt: Number of objects holding a reference on this parallel_data. | 121 | * @refcnt: Number of objects holding a reference on this parallel_data. |
| 93 | * @max_seq_nr: Maximal used sequence number. | 122 | * @max_seq_nr: Maximal used sequence number. |
| 94 | * @cpumask: cpumask in use. | 123 | * @cpumask: The cpumasks in use for parallel and serial workers. |
| 95 | * @lock: Reorder lock. | 124 | * @lock: Reorder lock. |
| 125 | * @processed: Number of already processed objects. | ||
| 96 | * @timer: Reorder timer. | 126 | * @timer: Reorder timer. |
| 97 | */ | 127 | */ |
| 98 | struct parallel_data { | 128 | struct parallel_data { |
| 99 | struct padata_instance *pinst; | 129 | struct padata_instance *pinst; |
| 100 | struct padata_queue *queue; | 130 | struct padata_parallel_queue *pqueue; |
| 101 | atomic_t seq_nr; | 131 | struct padata_serial_queue *squeue; |
| 102 | atomic_t reorder_objects; | 132 | atomic_t seq_nr; |
| 103 | atomic_t refcnt; | 133 | atomic_t reorder_objects; |
| 104 | unsigned int max_seq_nr; | 134 | atomic_t refcnt; |
| 105 | cpumask_var_t cpumask; | 135 | unsigned int max_seq_nr; |
| 106 | spinlock_t lock; | 136 | struct padata_cpumask cpumask; |
| 107 | struct timer_list timer; | 137 | spinlock_t lock ____cacheline_aligned; |
| 138 | unsigned int processed; | ||
| 139 | struct timer_list timer; | ||
| 108 | }; | 140 | }; |
| 109 | 141 | ||
| 110 | /** | 142 | /** |
| @@ -113,31 +145,48 @@ struct parallel_data { | |||
| 113 | * @cpu_notifier: cpu hotplug notifier. | 145 | * @cpu_notifier: cpu hotplug notifier. |
| 114 | * @wq: The workqueue in use. | 146 | * @wq: The workqueue in use. |
| 115 | * @pd: The internal control structure. | 147 | * @pd: The internal control structure. |
| 116 | * @cpumask: User supplied cpumask. | 148 | * @cpumask: User supplied cpumasks for parallel and serial works. |
| 149 | * @cpumask_change_notifier: Notifiers chain for user-defined notify | ||
| 150 | * callbacks that will be called when either @pcpu or @cbcpu | ||
| 151 | * or both cpumasks change. | ||
| 152 | * @kobj: padata instance kernel object. | ||
| 117 | * @lock: padata instance lock. | 153 | * @lock: padata instance lock. |
| 118 | * @flags: padata flags. | 154 | * @flags: padata flags. |
| 119 | */ | 155 | */ |
| 120 | struct padata_instance { | 156 | struct padata_instance { |
| 121 | struct notifier_block cpu_notifier; | 157 | struct notifier_block cpu_notifier; |
| 122 | struct workqueue_struct *wq; | 158 | struct workqueue_struct *wq; |
| 123 | struct parallel_data *pd; | 159 | struct parallel_data *pd; |
| 124 | cpumask_var_t cpumask; | 160 | struct padata_cpumask cpumask; |
| 125 | struct mutex lock; | 161 | struct blocking_notifier_head cpumask_change_notifier; |
| 126 | u8 flags; | 162 | struct kobject kobj; |
| 127 | #define PADATA_INIT 1 | 163 | struct mutex lock; |
| 128 | #define PADATA_RESET 2 | 164 | u8 flags; |
| 165 | #define PADATA_INIT 1 | ||
| 166 | #define PADATA_RESET 2 | ||
| 167 | #define PADATA_INVALID 4 | ||
| 129 | }; | 168 | }; |
| 130 | 169 | ||
| 131 | extern struct padata_instance *padata_alloc(const struct cpumask *cpumask, | 170 | extern struct padata_instance *padata_alloc_possible( |
| 132 | struct workqueue_struct *wq); | 171 | struct workqueue_struct *wq); |
| 172 | extern struct padata_instance *padata_alloc(struct workqueue_struct *wq, | ||
| 173 | const struct cpumask *pcpumask, | ||
| 174 | const struct cpumask *cbcpumask); | ||
| 133 | extern void padata_free(struct padata_instance *pinst); | 175 | extern void padata_free(struct padata_instance *pinst); |
| 134 | extern int padata_do_parallel(struct padata_instance *pinst, | 176 | extern int padata_do_parallel(struct padata_instance *pinst, |
| 135 | struct padata_priv *padata, int cb_cpu); | 177 | struct padata_priv *padata, int cb_cpu); |
| 136 | extern void padata_do_serial(struct padata_priv *padata); | 178 | extern void padata_do_serial(struct padata_priv *padata); |
| 137 | extern int padata_set_cpumask(struct padata_instance *pinst, | 179 | extern int padata_set_cpumask(struct padata_instance *pinst, int cpumask_type, |
| 138 | cpumask_var_t cpumask); | 180 | cpumask_var_t cpumask); |
| 139 | extern int padata_add_cpu(struct padata_instance *pinst, int cpu); | 181 | extern int padata_set_cpumasks(struct padata_instance *pinst, |
| 140 | extern int padata_remove_cpu(struct padata_instance *pinst, int cpu); | 182 | cpumask_var_t pcpumask, |
| 141 | extern void padata_start(struct padata_instance *pinst); | 183 | cpumask_var_t cbcpumask); |
| 184 | extern int padata_add_cpu(struct padata_instance *pinst, int cpu, int mask); | ||
| 185 | extern int padata_remove_cpu(struct padata_instance *pinst, int cpu, int mask); | ||
| 186 | extern int padata_start(struct padata_instance *pinst); | ||
| 142 | extern void padata_stop(struct padata_instance *pinst); | 187 | extern void padata_stop(struct padata_instance *pinst); |
| 188 | extern int padata_register_cpumask_notifier(struct padata_instance *pinst, | ||
| 189 | struct notifier_block *nblock); | ||
| 190 | extern int padata_unregister_cpumask_notifier(struct padata_instance *pinst, | ||
| 191 | struct notifier_block *nblock); | ||
| 143 | #endif | 192 | #endif |
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 5b59f35dcb8f..6fa317801e1c 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
| @@ -128,7 +128,6 @@ enum pageflags { | |||
| 128 | 128 | ||
| 129 | /* SLUB */ | 129 | /* SLUB */ |
| 130 | PG_slub_frozen = PG_active, | 130 | PG_slub_frozen = PG_active, |
| 131 | PG_slub_debug = PG_error, | ||
| 132 | }; | 131 | }; |
| 133 | 132 | ||
| 134 | #ifndef __GENERATING_BOUNDS_H | 133 | #ifndef __GENERATING_BOUNDS_H |
| @@ -215,7 +214,6 @@ PAGEFLAG(SwapBacked, swapbacked) __CLEARPAGEFLAG(SwapBacked, swapbacked) | |||
| 215 | __PAGEFLAG(SlobFree, slob_free) | 214 | __PAGEFLAG(SlobFree, slob_free) |
| 216 | 215 | ||
| 217 | __PAGEFLAG(SlubFrozen, slub_frozen) | 216 | __PAGEFLAG(SlubFrozen, slub_frozen) |
| 218 | __PAGEFLAG(SlubDebug, slub_debug) | ||
| 219 | 217 | ||
| 220 | /* | 218 | /* |
| 221 | * Private page markings that may be used by the filesystem that owns the page | 219 | * Private page markings that may be used by the filesystem that owns the page |
diff --git a/include/linux/pci.h b/include/linux/pci.h index f26fda76b87f..b1d17956a153 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
| @@ -270,6 +270,8 @@ struct pci_dev { | |||
| 270 | unsigned int d1_support:1; /* Low power state D1 is supported */ | 270 | unsigned int d1_support:1; /* Low power state D1 is supported */ |
| 271 | unsigned int d2_support:1; /* Low power state D2 is supported */ | 271 | unsigned int d2_support:1; /* Low power state D2 is supported */ |
| 272 | unsigned int no_d1d2:1; /* Only allow D0 and D3 */ | 272 | unsigned int no_d1d2:1; /* Only allow D0 and D3 */ |
| 273 | unsigned int mmio_always_on:1; /* disallow turning off io/mem | ||
| 274 | decoding during bar sizing */ | ||
| 273 | unsigned int wakeup_prepared:1; | 275 | unsigned int wakeup_prepared:1; |
| 274 | unsigned int d3_delay; /* D3->D0 transition time in ms */ | 276 | unsigned int d3_delay; /* D3->D0 transition time in ms */ |
| 275 | 277 | ||
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 3bedcc149c84..c81eec4d3c35 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
| @@ -1494,6 +1494,9 @@ | |||
| 1494 | #define PCI_DEVICE_ID_SBE_WANXL100 0x0301 | 1494 | #define PCI_DEVICE_ID_SBE_WANXL100 0x0301 |
| 1495 | #define PCI_DEVICE_ID_SBE_WANXL200 0x0302 | 1495 | #define PCI_DEVICE_ID_SBE_WANXL200 0x0302 |
| 1496 | #define PCI_DEVICE_ID_SBE_WANXL400 0x0104 | 1496 | #define PCI_DEVICE_ID_SBE_WANXL400 0x0104 |
| 1497 | #define PCI_SUBDEVICE_ID_SBE_T3E3 0x0009 | ||
| 1498 | #define PCI_SUBDEVICE_ID_SBE_2T3E3_P0 0x0901 | ||
| 1499 | #define PCI_SUBDEVICE_ID_SBE_2T3E3_P1 0x0902 | ||
| 1497 | 1500 | ||
| 1498 | #define PCI_VENDOR_ID_TOSHIBA 0x1179 | 1501 | #define PCI_VENDOR_ID_TOSHIBA 0x1179 |
| 1499 | #define PCI_DEVICE_ID_TOSHIBA_PICCOLO_1 0x0101 | 1502 | #define PCI_DEVICE_ID_TOSHIBA_PICCOLO_1 0x0101 |
| @@ -2054,7 +2057,6 @@ | |||
| 2054 | #define PCI_DEVICE_ID_NX2_57711E 0x1650 | 2057 | #define PCI_DEVICE_ID_NX2_57711E 0x1650 |
| 2055 | #define PCI_DEVICE_ID_TIGON3_5705 0x1653 | 2058 | #define PCI_DEVICE_ID_TIGON3_5705 0x1653 |
| 2056 | #define PCI_DEVICE_ID_TIGON3_5705_2 0x1654 | 2059 | #define PCI_DEVICE_ID_TIGON3_5705_2 0x1654 |
| 2057 | #define PCI_DEVICE_ID_TIGON3_5720 0x1658 | ||
| 2058 | #define PCI_DEVICE_ID_TIGON3_5721 0x1659 | 2060 | #define PCI_DEVICE_ID_TIGON3_5721 0x1659 |
| 2059 | #define PCI_DEVICE_ID_TIGON3_5722 0x165a | 2061 | #define PCI_DEVICE_ID_TIGON3_5722 0x165a |
| 2060 | #define PCI_DEVICE_ID_TIGON3_5723 0x165b | 2062 | #define PCI_DEVICE_ID_TIGON3_5723 0x165b |
| @@ -2068,13 +2070,11 @@ | |||
| 2068 | #define PCI_DEVICE_ID_TIGON3_5754M 0x1672 | 2070 | #define PCI_DEVICE_ID_TIGON3_5754M 0x1672 |
| 2069 | #define PCI_DEVICE_ID_TIGON3_5755M 0x1673 | 2071 | #define PCI_DEVICE_ID_TIGON3_5755M 0x1673 |
| 2070 | #define PCI_DEVICE_ID_TIGON3_5756 0x1674 | 2072 | #define PCI_DEVICE_ID_TIGON3_5756 0x1674 |
| 2071 | #define PCI_DEVICE_ID_TIGON3_5750 0x1676 | ||
| 2072 | #define PCI_DEVICE_ID_TIGON3_5751 0x1677 | 2073 | #define PCI_DEVICE_ID_TIGON3_5751 0x1677 |
| 2073 | #define PCI_DEVICE_ID_TIGON3_5715 0x1678 | 2074 | #define PCI_DEVICE_ID_TIGON3_5715 0x1678 |
| 2074 | #define PCI_DEVICE_ID_TIGON3_5715S 0x1679 | 2075 | #define PCI_DEVICE_ID_TIGON3_5715S 0x1679 |
| 2075 | #define PCI_DEVICE_ID_TIGON3_5754 0x167a | 2076 | #define PCI_DEVICE_ID_TIGON3_5754 0x167a |
| 2076 | #define PCI_DEVICE_ID_TIGON3_5755 0x167b | 2077 | #define PCI_DEVICE_ID_TIGON3_5755 0x167b |
| 2077 | #define PCI_DEVICE_ID_TIGON3_5750M 0x167c | ||
| 2078 | #define PCI_DEVICE_ID_TIGON3_5751M 0x167d | 2078 | #define PCI_DEVICE_ID_TIGON3_5751M 0x167d |
| 2079 | #define PCI_DEVICE_ID_TIGON3_5751F 0x167e | 2079 | #define PCI_DEVICE_ID_TIGON3_5751F 0x167e |
| 2080 | #define PCI_DEVICE_ID_TIGON3_5787F 0x167f | 2080 | #define PCI_DEVICE_ID_TIGON3_5787F 0x167f |
| @@ -2264,6 +2264,7 @@ | |||
| 2264 | #define PCI_DEVICE_ID_TDI_EHCI 0x0101 | 2264 | #define PCI_DEVICE_ID_TDI_EHCI 0x0101 |
| 2265 | 2265 | ||
| 2266 | #define PCI_VENDOR_ID_FREESCALE 0x1957 | 2266 | #define PCI_VENDOR_ID_FREESCALE 0x1957 |
| 2267 | #define PCI_DEVICE_ID_MPC8308 0xc006 | ||
| 2267 | #define PCI_DEVICE_ID_MPC8315E 0x00b4 | 2268 | #define PCI_DEVICE_ID_MPC8315E 0x00b4 |
| 2268 | #define PCI_DEVICE_ID_MPC8315 0x00b5 | 2269 | #define PCI_DEVICE_ID_MPC8315 0x00b5 |
| 2269 | #define PCI_DEVICE_ID_MPC8314E 0x00b6 | 2270 | #define PCI_DEVICE_ID_MPC8314E 0x00b6 |
| @@ -2324,9 +2325,11 @@ | |||
| 2324 | #define PCI_DEVICE_ID_JMICRON_JMB361 0x2361 | 2325 | #define PCI_DEVICE_ID_JMICRON_JMB361 0x2361 |
| 2325 | #define PCI_DEVICE_ID_JMICRON_JMB362 0x2362 | 2326 | #define PCI_DEVICE_ID_JMICRON_JMB362 0x2362 |
| 2326 | #define PCI_DEVICE_ID_JMICRON_JMB363 0x2363 | 2327 | #define PCI_DEVICE_ID_JMICRON_JMB363 0x2363 |
| 2328 | #define PCI_DEVICE_ID_JMICRON_JMB364 0x2364 | ||
| 2327 | #define PCI_DEVICE_ID_JMICRON_JMB365 0x2365 | 2329 | #define PCI_DEVICE_ID_JMICRON_JMB365 0x2365 |
| 2328 | #define PCI_DEVICE_ID_JMICRON_JMB366 0x2366 | 2330 | #define PCI_DEVICE_ID_JMICRON_JMB366 0x2366 |
| 2329 | #define PCI_DEVICE_ID_JMICRON_JMB368 0x2368 | 2331 | #define PCI_DEVICE_ID_JMICRON_JMB368 0x2368 |
| 2332 | #define PCI_DEVICE_ID_JMICRON_JMB369 0x2369 | ||
| 2330 | #define PCI_DEVICE_ID_JMICRON_JMB38X_SD 0x2381 | 2333 | #define PCI_DEVICE_ID_JMICRON_JMB38X_SD 0x2381 |
| 2331 | #define PCI_DEVICE_ID_JMICRON_JMB38X_MMC 0x2382 | 2334 | #define PCI_DEVICE_ID_JMICRON_JMB38X_MMC 0x2382 |
| 2332 | #define PCI_DEVICE_ID_JMICRON_JMB38X_MS 0x2383 | 2335 | #define PCI_DEVICE_ID_JMICRON_JMB38X_MS 0x2383 |
| @@ -2772,3 +2775,6 @@ | |||
| 2772 | #define PCI_DEVICE_ID_RME_DIGI32 0x9896 | 2775 | #define PCI_DEVICE_ID_RME_DIGI32 0x9896 |
| 2773 | #define PCI_DEVICE_ID_RME_DIGI32_PRO 0x9897 | 2776 | #define PCI_DEVICE_ID_RME_DIGI32_PRO 0x9897 |
| 2774 | #define PCI_DEVICE_ID_RME_DIGI32_8 0x9898 | 2777 | #define PCI_DEVICE_ID_RME_DIGI32_8 0x9898 |
| 2778 | |||
| 2779 | #define PCI_VENDOR_ID_XEN 0x5853 | ||
| 2780 | #define PCI_DEVICE_ID_XEN_PLATFORM 0x0001 | ||
diff --git a/include/linux/percpu.h b/include/linux/percpu.h index d3a38d687104..b8b9084527b1 100644 --- a/include/linux/percpu.h +++ b/include/linux/percpu.h | |||
| @@ -45,6 +45,16 @@ | |||
| 45 | #define PCPU_MIN_UNIT_SIZE PFN_ALIGN(64 << 10) | 45 | #define PCPU_MIN_UNIT_SIZE PFN_ALIGN(64 << 10) |
| 46 | 46 | ||
| 47 | /* | 47 | /* |
| 48 | * Percpu allocator can serve percpu allocations before slab is | ||
| 49 | * initialized which allows slab to depend on the percpu allocator. | ||
| 50 | * The following two parameters decide how much resource to | ||
| 51 | * preallocate for this. Keep PERCPU_DYNAMIC_RESERVE equal to or | ||
| 52 | * larger than PERCPU_DYNAMIC_EARLY_SIZE. | ||
| 53 | */ | ||
| 54 | #define PERCPU_DYNAMIC_EARLY_SLOTS 128 | ||
| 55 | #define PERCPU_DYNAMIC_EARLY_SIZE (12 << 10) | ||
| 56 | |||
| 57 | /* | ||
| 48 | * PERCPU_DYNAMIC_RESERVE indicates the amount of free area to piggy | 58 | * PERCPU_DYNAMIC_RESERVE indicates the amount of free area to piggy |
| 49 | * back on the first chunk for dynamic percpu allocation if arch is | 59 | * back on the first chunk for dynamic percpu allocation if arch is |
| 50 | * manually allocating and mapping it for faster access (as a part of | 60 | * manually allocating and mapping it for faster access (as a part of |
| @@ -104,16 +114,11 @@ extern struct pcpu_alloc_info * __init pcpu_alloc_alloc_info(int nr_groups, | |||
| 104 | int nr_units); | 114 | int nr_units); |
| 105 | extern void __init pcpu_free_alloc_info(struct pcpu_alloc_info *ai); | 115 | extern void __init pcpu_free_alloc_info(struct pcpu_alloc_info *ai); |
| 106 | 116 | ||
| 107 | extern struct pcpu_alloc_info * __init pcpu_build_alloc_info( | ||
| 108 | size_t reserved_size, ssize_t dyn_size, | ||
| 109 | size_t atom_size, | ||
| 110 | pcpu_fc_cpu_distance_fn_t cpu_distance_fn); | ||
| 111 | |||
| 112 | extern int __init pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai, | 117 | extern int __init pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai, |
| 113 | void *base_addr); | 118 | void *base_addr); |
| 114 | 119 | ||
| 115 | #ifdef CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK | 120 | #ifdef CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK |
| 116 | extern int __init pcpu_embed_first_chunk(size_t reserved_size, ssize_t dyn_size, | 121 | extern int __init pcpu_embed_first_chunk(size_t reserved_size, size_t dyn_size, |
| 117 | size_t atom_size, | 122 | size_t atom_size, |
| 118 | pcpu_fc_cpu_distance_fn_t cpu_distance_fn, | 123 | pcpu_fc_cpu_distance_fn_t cpu_distance_fn, |
| 119 | pcpu_fc_alloc_fn_t alloc_fn, | 124 | pcpu_fc_alloc_fn_t alloc_fn, |
| @@ -140,6 +145,7 @@ extern bool is_kernel_percpu_address(unsigned long addr); | |||
| 140 | #ifndef CONFIG_HAVE_SETUP_PER_CPU_AREA | 145 | #ifndef CONFIG_HAVE_SETUP_PER_CPU_AREA |
| 141 | extern void __init setup_per_cpu_areas(void); | 146 | extern void __init setup_per_cpu_areas(void); |
| 142 | #endif | 147 | #endif |
| 148 | extern void __init percpu_init_late(void); | ||
| 143 | 149 | ||
| 144 | #else /* CONFIG_SMP */ | 150 | #else /* CONFIG_SMP */ |
| 145 | 151 | ||
| @@ -153,6 +159,8 @@ static inline bool is_kernel_percpu_address(unsigned long addr) | |||
| 153 | 159 | ||
| 154 | static inline void __init setup_per_cpu_areas(void) { } | 160 | static inline void __init setup_per_cpu_areas(void) { } |
| 155 | 161 | ||
| 162 | static inline void __init percpu_init_late(void) { } | ||
| 163 | |||
| 156 | static inline void *pcpu_lpage_remapped(void *kaddr) | 164 | static inline void *pcpu_lpage_remapped(void *kaddr) |
| 157 | { | 165 | { |
| 158 | return NULL; | 166 | return NULL; |
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 5d0266d94985..716f99b682c1 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
| @@ -214,8 +214,9 @@ struct perf_event_attr { | |||
| 214 | * See also PERF_RECORD_MISC_EXACT_IP | 214 | * See also PERF_RECORD_MISC_EXACT_IP |
| 215 | */ | 215 | */ |
| 216 | precise_ip : 2, /* skid constraint */ | 216 | precise_ip : 2, /* skid constraint */ |
| 217 | mmap_data : 1, /* non-exec mmap data */ | ||
| 217 | 218 | ||
| 218 | __reserved_1 : 47; | 219 | __reserved_1 : 46; |
| 219 | 220 | ||
| 220 | union { | 221 | union { |
| 221 | __u32 wakeup_events; /* wakeup every n events */ | 222 | __u32 wakeup_events; /* wakeup every n events */ |
| @@ -461,6 +462,7 @@ enum perf_callchain_context { | |||
| 461 | 462 | ||
| 462 | #ifdef CONFIG_PERF_EVENTS | 463 | #ifdef CONFIG_PERF_EVENTS |
| 463 | # include <asm/perf_event.h> | 464 | # include <asm/perf_event.h> |
| 465 | # include <asm/local64.h> | ||
| 464 | #endif | 466 | #endif |
| 465 | 467 | ||
| 466 | struct perf_guest_info_callbacks { | 468 | struct perf_guest_info_callbacks { |
| @@ -531,14 +533,16 @@ struct hw_perf_event { | |||
| 531 | struct hrtimer hrtimer; | 533 | struct hrtimer hrtimer; |
| 532 | }; | 534 | }; |
| 533 | #ifdef CONFIG_HAVE_HW_BREAKPOINT | 535 | #ifdef CONFIG_HAVE_HW_BREAKPOINT |
| 534 | /* breakpoint */ | 536 | struct { /* breakpoint */ |
| 535 | struct arch_hw_breakpoint info; | 537 | struct arch_hw_breakpoint info; |
| 538 | struct list_head bp_list; | ||
| 539 | }; | ||
| 536 | #endif | 540 | #endif |
| 537 | }; | 541 | }; |
| 538 | atomic64_t prev_count; | 542 | local64_t prev_count; |
| 539 | u64 sample_period; | 543 | u64 sample_period; |
| 540 | u64 last_period; | 544 | u64 last_period; |
| 541 | atomic64_t period_left; | 545 | local64_t period_left; |
| 542 | u64 interrupts; | 546 | u64 interrupts; |
| 543 | 547 | ||
| 544 | u64 freq_time_stamp; | 548 | u64 freq_time_stamp; |
| @@ -548,7 +552,10 @@ struct hw_perf_event { | |||
| 548 | 552 | ||
| 549 | struct perf_event; | 553 | struct perf_event; |
| 550 | 554 | ||
| 551 | #define PERF_EVENT_TXN_STARTED 1 | 555 | /* |
| 556 | * Common implementation detail of pmu::{start,commit,cancel}_txn | ||
| 557 | */ | ||
| 558 | #define PERF_EVENT_TXN 0x1 | ||
| 552 | 559 | ||
| 553 | /** | 560 | /** |
| 554 | * struct pmu - generic performance monitoring unit | 561 | * struct pmu - generic performance monitoring unit |
| @@ -562,14 +569,28 @@ struct pmu { | |||
| 562 | void (*unthrottle) (struct perf_event *event); | 569 | void (*unthrottle) (struct perf_event *event); |
| 563 | 570 | ||
| 564 | /* | 571 | /* |
| 565 | * group events scheduling is treated as a transaction, | 572 | * Group events scheduling is treated as a transaction, add group |
| 566 | * add group events as a whole and perform one schedulability test. | 573 | * events as a whole and perform one schedulability test. If the test |
| 567 | * If test fails, roll back the whole group | 574 | * fails, roll back the whole group |
| 568 | */ | 575 | */ |
| 569 | 576 | ||
| 577 | /* | ||
| 578 | * Start the transaction, after this ->enable() doesn't need | ||
| 579 | * to do schedulability tests. | ||
| 580 | */ | ||
| 570 | void (*start_txn) (const struct pmu *pmu); | 581 | void (*start_txn) (const struct pmu *pmu); |
| 571 | void (*cancel_txn) (const struct pmu *pmu); | 582 | /* |
| 583 | * If ->start_txn() disabled the ->enable() schedulability test | ||
| 584 | * then ->commit_txn() is required to perform one. On success | ||
| 585 | * the transaction is closed. On error the transaction is kept | ||
| 586 | * open until ->cancel_txn() is called. | ||
| 587 | */ | ||
| 572 | int (*commit_txn) (const struct pmu *pmu); | 588 | int (*commit_txn) (const struct pmu *pmu); |
| 589 | /* | ||
| 590 | * Will cancel the transaction, assumes ->disable() is called for | ||
| 591 | * each successfull ->enable() during the transaction. | ||
| 592 | */ | ||
| 593 | void (*cancel_txn) (const struct pmu *pmu); | ||
| 573 | }; | 594 | }; |
| 574 | 595 | ||
| 575 | /** | 596 | /** |
| @@ -584,7 +605,9 @@ enum perf_event_active_state { | |||
| 584 | 605 | ||
| 585 | struct file; | 606 | struct file; |
| 586 | 607 | ||
| 587 | struct perf_mmap_data { | 608 | #define PERF_BUFFER_WRITABLE 0x01 |
| 609 | |||
| 610 | struct perf_buffer { | ||
| 588 | atomic_t refcount; | 611 | atomic_t refcount; |
| 589 | struct rcu_head rcu_head; | 612 | struct rcu_head rcu_head; |
| 590 | #ifdef CONFIG_PERF_USE_VMALLOC | 613 | #ifdef CONFIG_PERF_USE_VMALLOC |
| @@ -650,7 +673,8 @@ struct perf_event { | |||
| 650 | 673 | ||
| 651 | enum perf_event_active_state state; | 674 | enum perf_event_active_state state; |
| 652 | unsigned int attach_state; | 675 | unsigned int attach_state; |
| 653 | atomic64_t count; | 676 | local64_t count; |
| 677 | atomic64_t child_count; | ||
| 654 | 678 | ||
| 655 | /* | 679 | /* |
| 656 | * These are the total time in nanoseconds that the event | 680 | * These are the total time in nanoseconds that the event |
| @@ -709,7 +733,7 @@ struct perf_event { | |||
| 709 | atomic_t mmap_count; | 733 | atomic_t mmap_count; |
| 710 | int mmap_locked; | 734 | int mmap_locked; |
| 711 | struct user_struct *mmap_user; | 735 | struct user_struct *mmap_user; |
| 712 | struct perf_mmap_data *data; | 736 | struct perf_buffer *buffer; |
| 713 | 737 | ||
| 714 | /* poll related */ | 738 | /* poll related */ |
| 715 | wait_queue_head_t waitq; | 739 | wait_queue_head_t waitq; |
| @@ -807,7 +831,7 @@ struct perf_cpu_context { | |||
| 807 | 831 | ||
| 808 | struct perf_output_handle { | 832 | struct perf_output_handle { |
| 809 | struct perf_event *event; | 833 | struct perf_event *event; |
| 810 | struct perf_mmap_data *data; | 834 | struct perf_buffer *buffer; |
| 811 | unsigned long wakeup; | 835 | unsigned long wakeup; |
| 812 | unsigned long size; | 836 | unsigned long size; |
| 813 | void *addr; | 837 | void *addr; |
| @@ -910,8 +934,10 @@ extern atomic_t perf_swevent_enabled[PERF_COUNT_SW_MAX]; | |||
| 910 | 934 | ||
| 911 | extern void __perf_sw_event(u32, u64, int, struct pt_regs *, u64); | 935 | extern void __perf_sw_event(u32, u64, int, struct pt_regs *, u64); |
| 912 | 936 | ||
| 913 | extern void | 937 | #ifndef perf_arch_fetch_caller_regs |
| 914 | perf_arch_fetch_caller_regs(struct pt_regs *regs, unsigned long ip, int skip); | 938 | static inline void |
| 939 | perf_arch_fetch_caller_regs(struct pt_regs *regs, unsigned long ip) { } | ||
| 940 | #endif | ||
| 915 | 941 | ||
| 916 | /* | 942 | /* |
| 917 | * Take a snapshot of the regs. Skip ip and frame pointer to | 943 | * Take a snapshot of the regs. Skip ip and frame pointer to |
| @@ -921,31 +947,11 @@ perf_arch_fetch_caller_regs(struct pt_regs *regs, unsigned long ip, int skip); | |||
| 921 | * - bp for callchains | 947 | * - bp for callchains |
| 922 | * - eflags, for future purposes, just in case | 948 | * - eflags, for future purposes, just in case |
| 923 | */ | 949 | */ |
| 924 | static inline void perf_fetch_caller_regs(struct pt_regs *regs, int skip) | 950 | static inline void perf_fetch_caller_regs(struct pt_regs *regs) |
| 925 | { | 951 | { |
| 926 | unsigned long ip; | ||
| 927 | |||
| 928 | memset(regs, 0, sizeof(*regs)); | 952 | memset(regs, 0, sizeof(*regs)); |
| 929 | 953 | ||
| 930 | switch (skip) { | 954 | perf_arch_fetch_caller_regs(regs, CALLER_ADDR0); |
| 931 | case 1 : | ||
| 932 | ip = CALLER_ADDR0; | ||
| 933 | break; | ||
| 934 | case 2 : | ||
| 935 | ip = CALLER_ADDR1; | ||
| 936 | break; | ||
| 937 | case 3 : | ||
| 938 | ip = CALLER_ADDR2; | ||
| 939 | break; | ||
| 940 | case 4: | ||
| 941 | ip = CALLER_ADDR3; | ||
| 942 | break; | ||
| 943 | /* No need to support further for now */ | ||
| 944 | default: | ||
| 945 | ip = 0; | ||
| 946 | } | ||
| 947 | |||
| 948 | return perf_arch_fetch_caller_regs(regs, ip, skip); | ||
| 949 | } | 955 | } |
| 950 | 956 | ||
| 951 | static inline void | 957 | static inline void |
| @@ -955,21 +961,14 @@ perf_sw_event(u32 event_id, u64 nr, int nmi, struct pt_regs *regs, u64 addr) | |||
| 955 | struct pt_regs hot_regs; | 961 | struct pt_regs hot_regs; |
| 956 | 962 | ||
| 957 | if (!regs) { | 963 | if (!regs) { |
| 958 | perf_fetch_caller_regs(&hot_regs, 1); | 964 | perf_fetch_caller_regs(&hot_regs); |
| 959 | regs = &hot_regs; | 965 | regs = &hot_regs; |
| 960 | } | 966 | } |
| 961 | __perf_sw_event(event_id, nr, nmi, regs, addr); | 967 | __perf_sw_event(event_id, nr, nmi, regs, addr); |
| 962 | } | 968 | } |
| 963 | } | 969 | } |
| 964 | 970 | ||
| 965 | extern void __perf_event_mmap(struct vm_area_struct *vma); | 971 | extern void perf_event_mmap(struct vm_area_struct *vma); |
| 966 | |||
| 967 | static inline void perf_event_mmap(struct vm_area_struct *vma) | ||
| 968 | { | ||
| 969 | if (vma->vm_flags & VM_EXEC) | ||
| 970 | __perf_event_mmap(vma); | ||
| 971 | } | ||
| 972 | |||
| 973 | extern struct perf_guest_info_callbacks *perf_guest_cbs; | 972 | extern struct perf_guest_info_callbacks *perf_guest_cbs; |
| 974 | extern int perf_register_guest_info_callbacks(struct perf_guest_info_callbacks *callbacks); | 973 | extern int perf_register_guest_info_callbacks(struct perf_guest_info_callbacks *callbacks); |
| 975 | extern int perf_unregister_guest_info_callbacks(struct perf_guest_info_callbacks *callbacks); | 974 | extern int perf_unregister_guest_info_callbacks(struct perf_guest_info_callbacks *callbacks); |
| @@ -1001,7 +1000,7 @@ static inline bool perf_paranoid_kernel(void) | |||
| 1001 | extern void perf_event_init(void); | 1000 | extern void perf_event_init(void); |
| 1002 | extern void perf_tp_event(u64 addr, u64 count, void *record, | 1001 | extern void perf_tp_event(u64 addr, u64 count, void *record, |
| 1003 | int entry_size, struct pt_regs *regs, | 1002 | int entry_size, struct pt_regs *regs, |
| 1004 | struct hlist_head *head); | 1003 | struct hlist_head *head, int rctx); |
| 1005 | extern void perf_bp_event(struct perf_event *event, void *data); | 1004 | extern void perf_bp_event(struct perf_event *event, void *data); |
| 1006 | 1005 | ||
| 1007 | #ifndef perf_misc_flags | 1006 | #ifndef perf_misc_flags |
| @@ -1068,7 +1067,7 @@ static inline void perf_event_disable(struct perf_event *event) { } | |||
| 1068 | #define perf_cpu_notifier(fn) \ | 1067 | #define perf_cpu_notifier(fn) \ |
| 1069 | do { \ | 1068 | do { \ |
| 1070 | static struct notifier_block fn##_nb __cpuinitdata = \ | 1069 | static struct notifier_block fn##_nb __cpuinitdata = \ |
| 1071 | { .notifier_call = fn, .priority = 20 }; \ | 1070 | { .notifier_call = fn, .priority = CPU_PRI_PERF }; \ |
| 1072 | fn(&fn##_nb, (unsigned long)CPU_UP_PREPARE, \ | 1071 | fn(&fn##_nb, (unsigned long)CPU_UP_PREPARE, \ |
| 1073 | (void *)(unsigned long)smp_processor_id()); \ | 1072 | (void *)(unsigned long)smp_processor_id()); \ |
| 1074 | fn(&fn##_nb, (unsigned long)CPU_STARTING, \ | 1073 | fn(&fn##_nb, (unsigned long)CPU_STARTING, \ |
diff --git a/include/linux/phonet.h b/include/linux/phonet.h index e5126cff9b2a..24426c3d6b5a 100644 --- a/include/linux/phonet.h +++ b/include/linux/phonet.h | |||
| @@ -56,7 +56,7 @@ struct phonethdr { | |||
| 56 | __be16 pn_length; | 56 | __be16 pn_length; |
| 57 | __u8 pn_robj; | 57 | __u8 pn_robj; |
| 58 | __u8 pn_sobj; | 58 | __u8 pn_sobj; |
| 59 | } __attribute__((packed)); | 59 | } __packed; |
| 60 | 60 | ||
| 61 | /* Common Phonet payload header */ | 61 | /* Common Phonet payload header */ |
| 62 | struct phonetmsg { | 62 | struct phonetmsg { |
| @@ -98,7 +98,7 @@ struct sockaddr_pn { | |||
| 98 | __u8 spn_dev; | 98 | __u8 spn_dev; |
| 99 | __u8 spn_resource; | 99 | __u8 spn_resource; |
| 100 | __u8 spn_zero[sizeof(struct sockaddr) - sizeof(sa_family_t) - 3]; | 100 | __u8 spn_zero[sizeof(struct sockaddr) - sizeof(sa_family_t) - 3]; |
| 101 | } __attribute__ ((packed)); | 101 | } __packed; |
| 102 | 102 | ||
| 103 | /* Well known address */ | 103 | /* Well known address */ |
| 104 | #define PN_DEV_PC 0x10 | 104 | #define PN_DEV_PC 0x10 |
diff --git a/include/linux/phy.h b/include/linux/phy.h index 987e111f7b11..6b0a782c6224 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h | |||
| @@ -234,6 +234,8 @@ enum phy_state { | |||
| 234 | PHY_RESUMING | 234 | PHY_RESUMING |
| 235 | }; | 235 | }; |
| 236 | 236 | ||
| 237 | struct sk_buff; | ||
| 238 | |||
| 237 | /* phy_device: An instance of a PHY | 239 | /* phy_device: An instance of a PHY |
| 238 | * | 240 | * |
| 239 | * drv: Pointer to the driver for this PHY instance | 241 | * drv: Pointer to the driver for this PHY instance |
| @@ -402,6 +404,26 @@ struct phy_driver { | |||
| 402 | /* Clears up any memory if needed */ | 404 | /* Clears up any memory if needed */ |
| 403 | void (*remove)(struct phy_device *phydev); | 405 | void (*remove)(struct phy_device *phydev); |
| 404 | 406 | ||
| 407 | /* Handles SIOCSHWTSTAMP ioctl for hardware time stamping. */ | ||
| 408 | int (*hwtstamp)(struct phy_device *phydev, struct ifreq *ifr); | ||
| 409 | |||
| 410 | /* | ||
| 411 | * Requests a Rx timestamp for 'skb'. If the skb is accepted, | ||
| 412 | * the phy driver promises to deliver it using netif_rx() as | ||
| 413 | * soon as a timestamp becomes available. One of the | ||
| 414 | * PTP_CLASS_ values is passed in 'type'. The function must | ||
| 415 | * return true if the skb is accepted for delivery. | ||
| 416 | */ | ||
| 417 | bool (*rxtstamp)(struct phy_device *dev, struct sk_buff *skb, int type); | ||
| 418 | |||
| 419 | /* | ||
| 420 | * Requests a Tx timestamp for 'skb'. The phy driver promises | ||
| 421 | * to deliver it to the socket's error queue as soon as a | ||
| 422 | * timestamp becomes available. One of the PTP_CLASS_ values | ||
| 423 | * is passed in 'type'. | ||
| 424 | */ | ||
| 425 | void (*txtstamp)(struct phy_device *dev, struct sk_buff *skb, int type); | ||
| 426 | |||
| 405 | struct device_driver driver; | 427 | struct device_driver driver; |
| 406 | }; | 428 | }; |
| 407 | #define to_phy_driver(d) container_of(d, struct phy_driver, driver) | 429 | #define to_phy_driver(d) container_of(d, struct phy_driver, driver) |
| @@ -498,7 +520,7 @@ void phy_stop_machine(struct phy_device *phydev); | |||
| 498 | int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd); | 520 | int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd); |
| 499 | int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd); | 521 | int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd); |
| 500 | int phy_mii_ioctl(struct phy_device *phydev, | 522 | int phy_mii_ioctl(struct phy_device *phydev, |
| 501 | struct mii_ioctl_data *mii_data, int cmd); | 523 | struct ifreq *ifr, int cmd); |
| 502 | int phy_start_interrupts(struct phy_device *phydev); | 524 | int phy_start_interrupts(struct phy_device *phydev); |
| 503 | void phy_print_status(struct phy_device *phydev); | 525 | void phy_print_status(struct phy_device *phydev); |
| 504 | struct phy_device* phy_device_create(struct mii_bus *bus, int addr, int phy_id); | 526 | struct phy_device* phy_device_create(struct mii_bus *bus, int addr, int phy_id); |
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index 5417944d3687..d7ecad0093bb 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h | |||
| @@ -43,10 +43,64 @@ extern struct resource *platform_get_resource_byname(struct platform_device *, u | |||
| 43 | extern int platform_get_irq_byname(struct platform_device *, const char *); | 43 | extern int platform_get_irq_byname(struct platform_device *, const char *); |
| 44 | extern int platform_add_devices(struct platform_device **, int); | 44 | extern int platform_add_devices(struct platform_device **, int); |
| 45 | 45 | ||
| 46 | extern struct platform_device *platform_device_register_simple(const char *, int id, | 46 | extern struct platform_device *platform_device_register_resndata( |
| 47 | const struct resource *, unsigned int); | 47 | struct device *parent, const char *name, int id, |
| 48 | extern struct platform_device *platform_device_register_data(struct device *, | 48 | const struct resource *res, unsigned int num, |
| 49 | const char *, int, const void *, size_t); | 49 | const void *data, size_t size); |
| 50 | |||
| 51 | /** | ||
| 52 | * platform_device_register_simple - add a platform-level device and its resources | ||
| 53 | * @name: base name of the device we're adding | ||
| 54 | * @id: instance id | ||
| 55 | * @res: set of resources that needs to be allocated for the device | ||
| 56 | * @num: number of resources | ||
| 57 | * | ||
| 58 | * This function creates a simple platform device that requires minimal | ||
| 59 | * resource and memory management. Canned release function freeing memory | ||
| 60 | * allocated for the device allows drivers using such devices to be | ||
| 61 | * unloaded without waiting for the last reference to the device to be | ||
| 62 | * dropped. | ||
| 63 | * | ||
| 64 | * This interface is primarily intended for use with legacy drivers which | ||
| 65 | * probe hardware directly. Because such drivers create sysfs device nodes | ||
| 66 | * themselves, rather than letting system infrastructure handle such device | ||
| 67 | * enumeration tasks, they don't fully conform to the Linux driver model. | ||
| 68 | * In particular, when such drivers are built as modules, they can't be | ||
| 69 | * "hotplugged". | ||
| 70 | * | ||
| 71 | * Returns &struct platform_device pointer on success, or ERR_PTR() on error. | ||
| 72 | */ | ||
| 73 | static inline struct platform_device *platform_device_register_simple( | ||
| 74 | const char *name, int id, | ||
| 75 | const struct resource *res, unsigned int num) | ||
| 76 | { | ||
| 77 | return platform_device_register_resndata(NULL, name, id, | ||
| 78 | res, num, NULL, 0); | ||
| 79 | } | ||
| 80 | |||
| 81 | /** | ||
| 82 | * platform_device_register_data - add a platform-level device with platform-specific data | ||
| 83 | * @parent: parent device for the device we're adding | ||
| 84 | * @name: base name of the device we're adding | ||
| 85 | * @id: instance id | ||
| 86 | * @data: platform specific data for this platform device | ||
| 87 | * @size: size of platform specific data | ||
| 88 | * | ||
| 89 | * This function creates a simple platform device that requires minimal | ||
| 90 | * resource and memory management. Canned release function freeing memory | ||
| 91 | * allocated for the device allows drivers using such devices to be | ||
| 92 | * unloaded without waiting for the last reference to the device to be | ||
| 93 | * dropped. | ||
| 94 | * | ||
| 95 | * Returns &struct platform_device pointer on success, or ERR_PTR() on error. | ||
| 96 | */ | ||
| 97 | static inline struct platform_device *platform_device_register_data( | ||
| 98 | struct device *parent, const char *name, int id, | ||
| 99 | const void *data, size_t size) | ||
| 100 | { | ||
| 101 | return platform_device_register_resndata(parent, name, id, | ||
| 102 | NULL, 0, data, size); | ||
| 103 | } | ||
| 50 | 104 | ||
| 51 | extern struct platform_device *platform_device_alloc(const char *name, int id); | 105 | extern struct platform_device *platform_device_alloc(const char *name, int id); |
| 52 | extern int platform_device_add_resources(struct platform_device *pdev, | 106 | extern int platform_device_add_resources(struct platform_device *pdev, |
diff --git a/include/linux/plist.h b/include/linux/plist.h index 6898985e7b38..7254eda078e5 100644 --- a/include/linux/plist.h +++ b/include/linux/plist.h | |||
| @@ -260,6 +260,23 @@ static inline int plist_node_empty(const struct plist_node *node) | |||
| 260 | #endif | 260 | #endif |
| 261 | 261 | ||
| 262 | /** | 262 | /** |
| 263 | * plist_last_entry - get the struct for the last entry | ||
| 264 | * @head: the &struct plist_head pointer | ||
| 265 | * @type: the type of the struct this is embedded in | ||
| 266 | * @member: the name of the list_struct within the struct | ||
| 267 | */ | ||
| 268 | #ifdef CONFIG_DEBUG_PI_LIST | ||
| 269 | # define plist_last_entry(head, type, member) \ | ||
| 270 | ({ \ | ||
| 271 | WARN_ON(plist_head_empty(head)); \ | ||
| 272 | container_of(plist_last(head), type, member); \ | ||
| 273 | }) | ||
| 274 | #else | ||
| 275 | # define plist_last_entry(head, type, member) \ | ||
| 276 | container_of(plist_last(head), type, member) | ||
| 277 | #endif | ||
| 278 | |||
| 279 | /** | ||
| 263 | * plist_first - return the first node (and thus, highest priority) | 280 | * plist_first - return the first node (and thus, highest priority) |
| 264 | * @head: the &struct plist_head pointer | 281 | * @head: the &struct plist_head pointer |
| 265 | * | 282 | * |
| @@ -271,4 +288,16 @@ static inline struct plist_node *plist_first(const struct plist_head *head) | |||
| 271 | struct plist_node, plist.node_list); | 288 | struct plist_node, plist.node_list); |
| 272 | } | 289 | } |
| 273 | 290 | ||
| 291 | /** | ||
| 292 | * plist_last - return the last node (and thus, lowest priority) | ||
| 293 | * @head: the &struct plist_head pointer | ||
| 294 | * | ||
| 295 | * Assumes the plist is _not_ empty. | ||
| 296 | */ | ||
| 297 | static inline struct plist_node *plist_last(const struct plist_head *head) | ||
| 298 | { | ||
| 299 | return list_entry(head->node_list.prev, | ||
| 300 | struct plist_node, plist.node_list); | ||
| 301 | } | ||
| 302 | |||
| 274 | #endif | 303 | #endif |
diff --git a/include/linux/pm.h b/include/linux/pm.h index 8e258c727971..52e8c55ff314 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
| @@ -457,6 +457,7 @@ struct dev_pm_info { | |||
| 457 | #ifdef CONFIG_PM_SLEEP | 457 | #ifdef CONFIG_PM_SLEEP |
| 458 | struct list_head entry; | 458 | struct list_head entry; |
| 459 | struct completion completion; | 459 | struct completion completion; |
| 460 | unsigned long wakeup_count; | ||
| 460 | #endif | 461 | #endif |
| 461 | #ifdef CONFIG_PM_RUNTIME | 462 | #ifdef CONFIG_PM_RUNTIME |
| 462 | struct timer_list suspend_timer; | 463 | struct timer_list suspend_timer; |
| @@ -476,9 +477,15 @@ struct dev_pm_info { | |||
| 476 | enum rpm_request request; | 477 | enum rpm_request request; |
| 477 | enum rpm_status runtime_status; | 478 | enum rpm_status runtime_status; |
| 478 | int runtime_error; | 479 | int runtime_error; |
| 480 | unsigned long active_jiffies; | ||
| 481 | unsigned long suspended_jiffies; | ||
| 482 | unsigned long accounting_timestamp; | ||
| 479 | #endif | 483 | #endif |
| 480 | }; | 484 | }; |
| 481 | 485 | ||
| 486 | extern void update_pm_runtime_accounting(struct device *dev); | ||
| 487 | |||
| 488 | |||
| 482 | /* | 489 | /* |
| 483 | * The PM_EVENT_ messages are also used by drivers implementing the legacy | 490 | * The PM_EVENT_ messages are also used by drivers implementing the legacy |
| 484 | * suspend framework, based on the ->suspend() and ->resume() callbacks common | 491 | * suspend framework, based on the ->suspend() and ->resume() callbacks common |
| @@ -552,6 +559,11 @@ extern void __suspend_report_result(const char *function, void *fn, int ret); | |||
| 552 | } while (0) | 559 | } while (0) |
| 553 | 560 | ||
| 554 | extern void device_pm_wait_for_dev(struct device *sub, struct device *dev); | 561 | extern void device_pm_wait_for_dev(struct device *sub, struct device *dev); |
| 562 | |||
| 563 | /* drivers/base/power/wakeup.c */ | ||
| 564 | extern void pm_wakeup_event(struct device *dev, unsigned int msec); | ||
| 565 | extern void pm_stay_awake(struct device *dev); | ||
| 566 | extern void pm_relax(void); | ||
| 555 | #else /* !CONFIG_PM_SLEEP */ | 567 | #else /* !CONFIG_PM_SLEEP */ |
| 556 | 568 | ||
| 557 | #define device_pm_lock() do {} while (0) | 569 | #define device_pm_lock() do {} while (0) |
| @@ -565,6 +577,10 @@ static inline int dpm_suspend_start(pm_message_t state) | |||
| 565 | #define suspend_report_result(fn, ret) do {} while (0) | 577 | #define suspend_report_result(fn, ret) do {} while (0) |
| 566 | 578 | ||
| 567 | static inline void device_pm_wait_for_dev(struct device *a, struct device *b) {} | 579 | static inline void device_pm_wait_for_dev(struct device *a, struct device *b) {} |
| 580 | |||
| 581 | static inline void pm_wakeup_event(struct device *dev, unsigned int msec) {} | ||
| 582 | static inline void pm_stay_awake(struct device *dev) {} | ||
| 583 | static inline void pm_relax(void) {} | ||
| 568 | #endif /* !CONFIG_PM_SLEEP */ | 584 | #endif /* !CONFIG_PM_SLEEP */ |
| 569 | 585 | ||
| 570 | /* How to reorder dpm_list after device_move() */ | 586 | /* How to reorder dpm_list after device_move() */ |
diff --git a/include/linux/pm_qos_params.h b/include/linux/pm_qos_params.h index 8ba440e5eb7f..77cbddb3784c 100644 --- a/include/linux/pm_qos_params.h +++ b/include/linux/pm_qos_params.h | |||
| @@ -1,8 +1,10 @@ | |||
| 1 | #ifndef _LINUX_PM_QOS_PARAMS_H | ||
| 2 | #define _LINUX_PM_QOS_PARAMS_H | ||
| 1 | /* interface for the pm_qos_power infrastructure of the linux kernel. | 3 | /* interface for the pm_qos_power infrastructure of the linux kernel. |
| 2 | * | 4 | * |
| 3 | * Mark Gross <mgross@linux.intel.com> | 5 | * Mark Gross <mgross@linux.intel.com> |
| 4 | */ | 6 | */ |
| 5 | #include <linux/list.h> | 7 | #include <linux/plist.h> |
| 6 | #include <linux/notifier.h> | 8 | #include <linux/notifier.h> |
| 7 | #include <linux/miscdevice.h> | 9 | #include <linux/miscdevice.h> |
| 8 | 10 | ||
| @@ -14,9 +16,12 @@ | |||
| 14 | #define PM_QOS_NUM_CLASSES 4 | 16 | #define PM_QOS_NUM_CLASSES 4 |
| 15 | #define PM_QOS_DEFAULT_VALUE -1 | 17 | #define PM_QOS_DEFAULT_VALUE -1 |
| 16 | 18 | ||
| 17 | struct pm_qos_request_list; | 19 | struct pm_qos_request_list { |
| 20 | struct plist_node list; | ||
| 21 | int pm_qos_class; | ||
| 22 | }; | ||
| 18 | 23 | ||
| 19 | struct pm_qos_request_list *pm_qos_add_request(int pm_qos_class, s32 value); | 24 | void pm_qos_add_request(struct pm_qos_request_list *l, int pm_qos_class, s32 value); |
| 20 | void pm_qos_update_request(struct pm_qos_request_list *pm_qos_req, | 25 | void pm_qos_update_request(struct pm_qos_request_list *pm_qos_req, |
| 21 | s32 new_value); | 26 | s32 new_value); |
| 22 | void pm_qos_remove_request(struct pm_qos_request_list *pm_qos_req); | 27 | void pm_qos_remove_request(struct pm_qos_request_list *pm_qos_req); |
| @@ -24,4 +29,6 @@ void pm_qos_remove_request(struct pm_qos_request_list *pm_qos_req); | |||
| 24 | int pm_qos_request(int pm_qos_class); | 29 | int pm_qos_request(int pm_qos_class); |
| 25 | int pm_qos_add_notifier(int pm_qos_class, struct notifier_block *notifier); | 30 | int pm_qos_add_notifier(int pm_qos_class, struct notifier_block *notifier); |
| 26 | int pm_qos_remove_notifier(int pm_qos_class, struct notifier_block *notifier); | 31 | int pm_qos_remove_notifier(int pm_qos_class, struct notifier_block *notifier); |
| 32 | int pm_qos_request_active(struct pm_qos_request_list *req); | ||
| 27 | 33 | ||
| 34 | #endif | ||
diff --git a/include/linux/pm_wakeup.h b/include/linux/pm_wakeup.h index 22d64c18056c..76aca48722ae 100644 --- a/include/linux/pm_wakeup.h +++ b/include/linux/pm_wakeup.h | |||
| @@ -29,8 +29,11 @@ | |||
| 29 | 29 | ||
| 30 | #ifdef CONFIG_PM | 30 | #ifdef CONFIG_PM |
| 31 | 31 | ||
| 32 | /* changes to device_may_wakeup take effect on the next pm state change. | 32 | /* Changes to device_may_wakeup take effect on the next pm state change. |
| 33 | * by default, devices should wakeup if they can. | 33 | * |
| 34 | * By default, most devices should leave wakeup disabled. The exceptions | ||
| 35 | * are devices that everyone expects to be wakeup sources: keyboards, | ||
| 36 | * power buttons, possibly network interfaces, etc. | ||
| 34 | */ | 37 | */ |
| 35 | static inline void device_init_wakeup(struct device *dev, bool val) | 38 | static inline void device_init_wakeup(struct device *dev, bool val) |
| 36 | { | 39 | { |
| @@ -59,7 +62,7 @@ static inline bool device_may_wakeup(struct device *dev) | |||
| 59 | 62 | ||
| 60 | #else /* !CONFIG_PM */ | 63 | #else /* !CONFIG_PM */ |
| 61 | 64 | ||
| 62 | /* For some reason the next two routines work even without CONFIG_PM */ | 65 | /* For some reason the following routines work even without CONFIG_PM */ |
| 63 | static inline void device_init_wakeup(struct device *dev, bool val) | 66 | static inline void device_init_wakeup(struct device *dev, bool val) |
| 64 | { | 67 | { |
| 65 | dev->power.can_wakeup = val; | 68 | dev->power.can_wakeup = val; |
| @@ -67,6 +70,7 @@ static inline void device_init_wakeup(struct device *dev, bool val) | |||
| 67 | 70 | ||
| 68 | static inline void device_set_wakeup_capable(struct device *dev, bool capable) | 71 | static inline void device_set_wakeup_capable(struct device *dev, bool capable) |
| 69 | { | 72 | { |
| 73 | dev->power.can_wakeup = capable; | ||
| 70 | } | 74 | } |
| 71 | 75 | ||
| 72 | static inline bool device_can_wakeup(struct device *dev) | 76 | static inline bool device_can_wakeup(struct device *dev) |
diff --git a/include/linux/pnp.h b/include/linux/pnp.h index 7c4193eb0072..1bc1338b817b 100644 --- a/include/linux/pnp.h +++ b/include/linux/pnp.h | |||
| @@ -414,6 +414,7 @@ struct pnp_protocol { | |||
| 414 | int (*disable) (struct pnp_dev *dev); | 414 | int (*disable) (struct pnp_dev *dev); |
| 415 | 415 | ||
| 416 | /* protocol specific suspend/resume */ | 416 | /* protocol specific suspend/resume */ |
| 417 | bool (*can_wakeup) (struct pnp_dev *dev); | ||
| 417 | int (*suspend) (struct pnp_dev * dev, pm_message_t state); | 418 | int (*suspend) (struct pnp_dev * dev, pm_message_t state); |
| 418 | int (*resume) (struct pnp_dev * dev); | 419 | int (*resume) (struct pnp_dev * dev); |
| 419 | 420 | ||
diff --git a/include/linux/power/jz4740-battery.h b/include/linux/power/jz4740-battery.h new file mode 100644 index 000000000000..19c9610c720a --- /dev/null +++ b/include/linux/power/jz4740-battery.h | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2009, Jiejing Zhang <kzjeef@gmail.com> | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify it | ||
| 5 | * under the terms of the GNU General Public License as published by the | ||
| 6 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 7 | * option) any later version. | ||
| 8 | * | ||
| 9 | * You should have received a copy of the GNU General Public License along | ||
| 10 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
| 11 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 12 | * | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef __JZ4740_BATTERY_H | ||
| 16 | #define __JZ4740_BATTERY_H | ||
| 17 | |||
| 18 | struct jz_battery_platform_data { | ||
| 19 | struct power_supply_info info; | ||
| 20 | int gpio_charge; /* GPIO port of Charger state */ | ||
| 21 | int gpio_charge_active_low; | ||
| 22 | }; | ||
| 23 | |||
| 24 | #endif | ||
diff --git a/include/linux/ptp_classify.h b/include/linux/ptp_classify.h new file mode 100644 index 000000000000..943a85ab0020 --- /dev/null +++ b/include/linux/ptp_classify.h | |||
| @@ -0,0 +1,126 @@ | |||
| 1 | /* | ||
| 2 | * PTP 1588 support | ||
| 3 | * | ||
| 4 | * This file implements a BPF that recognizes PTP event messages. | ||
| 5 | * | ||
| 6 | * Copyright (C) 2010 OMICRON electronics GmbH | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License as published by | ||
| 10 | * the Free Software Foundation; either version 2 of the License, or | ||
| 11 | * (at your option) any later version. | ||
| 12 | * | ||
| 13 | * This program is distributed in the hope that it will be useful, | ||
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 16 | * GNU General Public License for more details. | ||
| 17 | * | ||
| 18 | * You should have received a copy of the GNU General Public License | ||
| 19 | * along with this program; if not, write to the Free Software | ||
| 20 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 21 | */ | ||
| 22 | |||
| 23 | #ifndef _PTP_CLASSIFY_H_ | ||
| 24 | #define _PTP_CLASSIFY_H_ | ||
| 25 | |||
| 26 | #include <linux/if_ether.h> | ||
| 27 | #include <linux/if_vlan.h> | ||
| 28 | #include <linux/filter.h> | ||
| 29 | #ifdef __KERNEL__ | ||
| 30 | #include <linux/in.h> | ||
| 31 | #else | ||
| 32 | #include <netinet/in.h> | ||
| 33 | #endif | ||
| 34 | |||
| 35 | #define PTP_CLASS_NONE 0x00 /* not a PTP event message */ | ||
| 36 | #define PTP_CLASS_V1 0x01 /* protocol version 1 */ | ||
| 37 | #define PTP_CLASS_V2 0x02 /* protocol version 2 */ | ||
| 38 | #define PTP_CLASS_VMASK 0x0f /* max protocol version is 15 */ | ||
| 39 | #define PTP_CLASS_IPV4 0x10 /* event in an IPV4 UDP packet */ | ||
| 40 | #define PTP_CLASS_IPV6 0x20 /* event in an IPV6 UDP packet */ | ||
| 41 | #define PTP_CLASS_L2 0x30 /* event in a L2 packet */ | ||
| 42 | #define PTP_CLASS_VLAN 0x40 /* event in a VLAN tagged L2 packet */ | ||
| 43 | #define PTP_CLASS_PMASK 0xf0 /* mask for the packet type field */ | ||
| 44 | |||
| 45 | #define PTP_CLASS_V1_IPV4 (PTP_CLASS_V1 | PTP_CLASS_IPV4) | ||
| 46 | #define PTP_CLASS_V1_IPV6 (PTP_CLASS_V1 | PTP_CLASS_IPV6) /*probably DNE*/ | ||
| 47 | #define PTP_CLASS_V2_IPV4 (PTP_CLASS_V2 | PTP_CLASS_IPV4) | ||
| 48 | #define PTP_CLASS_V2_IPV6 (PTP_CLASS_V2 | PTP_CLASS_IPV6) | ||
| 49 | #define PTP_CLASS_V2_L2 (PTP_CLASS_V2 | PTP_CLASS_L2) | ||
| 50 | #define PTP_CLASS_V2_VLAN (PTP_CLASS_V2 | PTP_CLASS_VLAN) | ||
| 51 | |||
| 52 | #define PTP_EV_PORT 319 | ||
| 53 | |||
| 54 | #define OFF_ETYPE 12 | ||
| 55 | #define OFF_IHL 14 | ||
| 56 | #define OFF_FRAG 20 | ||
| 57 | #define OFF_PROTO4 23 | ||
| 58 | #define OFF_NEXT 6 | ||
| 59 | #define OFF_UDP_DST 2 | ||
| 60 | |||
| 61 | #define IP6_HLEN 40 | ||
| 62 | #define UDP_HLEN 8 | ||
| 63 | |||
| 64 | #define RELOFF_DST4 (ETH_HLEN + OFF_UDP_DST) | ||
| 65 | #define OFF_DST6 (ETH_HLEN + IP6_HLEN + OFF_UDP_DST) | ||
| 66 | #define OFF_PTP6 (ETH_HLEN + IP6_HLEN + UDP_HLEN) | ||
| 67 | |||
| 68 | #define OP_AND (BPF_ALU | BPF_AND | BPF_K) | ||
| 69 | #define OP_JEQ (BPF_JMP | BPF_JEQ | BPF_K) | ||
| 70 | #define OP_JSET (BPF_JMP | BPF_JSET | BPF_K) | ||
| 71 | #define OP_LDB (BPF_LD | BPF_B | BPF_ABS) | ||
| 72 | #define OP_LDH (BPF_LD | BPF_H | BPF_ABS) | ||
| 73 | #define OP_LDHI (BPF_LD | BPF_H | BPF_IND) | ||
| 74 | #define OP_LDX (BPF_LDX | BPF_B | BPF_MSH) | ||
| 75 | #define OP_OR (BPF_ALU | BPF_OR | BPF_K) | ||
| 76 | #define OP_RETA (BPF_RET | BPF_A) | ||
| 77 | #define OP_RETK (BPF_RET | BPF_K) | ||
| 78 | |||
| 79 | static inline int ptp_filter_init(struct sock_filter *f, int len) | ||
| 80 | { | ||
| 81 | if (OP_LDH == f[0].code) | ||
| 82 | return sk_chk_filter(f, len); | ||
| 83 | else | ||
| 84 | return 0; | ||
| 85 | } | ||
| 86 | |||
| 87 | #define PTP_FILTER \ | ||
| 88 | {OP_LDH, 0, 0, OFF_ETYPE }, /* */ \ | ||
| 89 | {OP_JEQ, 0, 12, ETH_P_IP }, /* f goto L20 */ \ | ||
| 90 | {OP_LDB, 0, 0, OFF_PROTO4 }, /* */ \ | ||
| 91 | {OP_JEQ, 0, 9, IPPROTO_UDP }, /* f goto L10 */ \ | ||
| 92 | {OP_LDH, 0, 0, OFF_FRAG }, /* */ \ | ||
| 93 | {OP_JSET, 7, 0, 0x1fff }, /* t goto L11 */ \ | ||
| 94 | {OP_LDX, 0, 0, OFF_IHL }, /* */ \ | ||
| 95 | {OP_LDHI, 0, 0, RELOFF_DST4 }, /* */ \ | ||
| 96 | {OP_JEQ, 0, 4, PTP_EV_PORT }, /* f goto L12 */ \ | ||
| 97 | {OP_LDHI, 0, 0, ETH_HLEN + UDP_HLEN }, /* */ \ | ||
| 98 | {OP_AND, 0, 0, PTP_CLASS_VMASK }, /* */ \ | ||
| 99 | {OP_OR, 0, 0, PTP_CLASS_IPV4 }, /* */ \ | ||
| 100 | {OP_RETA, 0, 0, 0 }, /* */ \ | ||
| 101 | /*L1x*/ {OP_RETK, 0, 0, PTP_CLASS_NONE }, /* */ \ | ||
| 102 | /*L20*/ {OP_JEQ, 0, 9, ETH_P_IPV6 }, /* f goto L40 */ \ | ||
| 103 | {OP_LDB, 0, 0, ETH_HLEN + OFF_NEXT }, /* */ \ | ||
| 104 | {OP_JEQ, 0, 6, IPPROTO_UDP }, /* f goto L30 */ \ | ||
| 105 | {OP_LDH, 0, 0, OFF_DST6 }, /* */ \ | ||
| 106 | {OP_JEQ, 0, 4, PTP_EV_PORT }, /* f goto L31 */ \ | ||
| 107 | {OP_LDH, 0, 0, OFF_PTP6 }, /* */ \ | ||
| 108 | {OP_AND, 0, 0, PTP_CLASS_VMASK }, /* */ \ | ||
| 109 | {OP_OR, 0, 0, PTP_CLASS_IPV6 }, /* */ \ | ||
| 110 | {OP_RETA, 0, 0, 0 }, /* */ \ | ||
| 111 | /*L3x*/ {OP_RETK, 0, 0, PTP_CLASS_NONE }, /* */ \ | ||
| 112 | /*L40*/ {OP_JEQ, 0, 6, ETH_P_8021Q }, /* f goto L50 */ \ | ||
| 113 | {OP_LDH, 0, 0, OFF_ETYPE + 4 }, /* */ \ | ||
| 114 | {OP_JEQ, 0, 9, ETH_P_1588 }, /* f goto L60 */ \ | ||
| 115 | {OP_LDH, 0, 0, ETH_HLEN + VLAN_HLEN }, /* */ \ | ||
| 116 | {OP_AND, 0, 0, PTP_CLASS_VMASK }, /* */ \ | ||
| 117 | {OP_OR, 0, 0, PTP_CLASS_VLAN }, /* */ \ | ||
| 118 | {OP_RETA, 0, 0, 0 }, /* */ \ | ||
| 119 | /*L50*/ {OP_JEQ, 0, 4, ETH_P_1588 }, /* f goto L61 */ \ | ||
| 120 | {OP_LDH, 0, 0, ETH_HLEN }, /* */ \ | ||
| 121 | {OP_AND, 0, 0, PTP_CLASS_VMASK }, /* */ \ | ||
| 122 | {OP_OR, 0, 0, PTP_CLASS_L2 }, /* */ \ | ||
| 123 | {OP_RETA, 0, 0, 0 }, /* */ \ | ||
| 124 | /*L6x*/ {OP_RETK, 0, 0, PTP_CLASS_NONE }, | ||
| 125 | |||
| 126 | #endif | ||
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h index aa36793b48bd..d50ba858cfe0 100644 --- a/include/linux/quotaops.h +++ b/include/linux/quotaops.h | |||
| @@ -28,6 +28,12 @@ static inline bool is_quota_modification(struct inode *inode, struct iattr *ia) | |||
| 28 | 28 | ||
| 29 | #if defined(CONFIG_QUOTA) | 29 | #if defined(CONFIG_QUOTA) |
| 30 | 30 | ||
| 31 | #define quota_error(sb, fmt, args...) \ | ||
| 32 | __quota_error((sb), __func__, fmt , ## args) | ||
| 33 | |||
| 34 | extern void __quota_error(struct super_block *sb, const char *func, | ||
| 35 | const char *fmt, ...); | ||
| 36 | |||
| 31 | /* | 37 | /* |
| 32 | * declaration of quota_function calls in kernel. | 38 | * declaration of quota_function calls in kernel. |
| 33 | */ | 39 | */ |
| @@ -145,11 +151,6 @@ static inline bool sb_has_quota_active(struct super_block *sb, int type) | |||
| 145 | !sb_has_quota_suspended(sb, type); | 151 | !sb_has_quota_suspended(sb, type); |
| 146 | } | 152 | } |
| 147 | 153 | ||
| 148 | static inline unsigned sb_any_quota_active(struct super_block *sb) | ||
| 149 | { | ||
| 150 | return sb_any_quota_loaded(sb) & ~sb_any_quota_suspended(sb); | ||
| 151 | } | ||
| 152 | |||
| 153 | /* | 154 | /* |
| 154 | * Operations supported for diskquotas. | 155 | * Operations supported for diskquotas. |
| 155 | */ | 156 | */ |
| @@ -194,11 +195,6 @@ static inline int sb_has_quota_active(struct super_block *sb, int type) | |||
| 194 | return 0; | 195 | return 0; |
| 195 | } | 196 | } |
| 196 | 197 | ||
| 197 | static inline int sb_any_quota_active(struct super_block *sb) | ||
| 198 | { | ||
| 199 | return 0; | ||
| 200 | } | ||
| 201 | |||
| 202 | static inline void dquot_initialize(struct inode *inode) | 198 | static inline void dquot_initialize(struct inode *inode) |
| 203 | { | 199 | { |
| 204 | } | 200 | } |
| @@ -270,7 +266,7 @@ static inline int dquot_alloc_space_nodirty(struct inode *inode, qsize_t nr) | |||
| 270 | static inline void dquot_alloc_space_nofail(struct inode *inode, qsize_t nr) | 266 | static inline void dquot_alloc_space_nofail(struct inode *inode, qsize_t nr) |
| 271 | { | 267 | { |
| 272 | __dquot_alloc_space(inode, nr, DQUOT_SPACE_WARN|DQUOT_SPACE_NOFAIL); | 268 | __dquot_alloc_space(inode, nr, DQUOT_SPACE_WARN|DQUOT_SPACE_NOFAIL); |
| 273 | mark_inode_dirty(inode); | 269 | mark_inode_dirty_sync(inode); |
| 274 | } | 270 | } |
| 275 | 271 | ||
| 276 | static inline int dquot_alloc_space(struct inode *inode, qsize_t nr) | 272 | static inline int dquot_alloc_space(struct inode *inode, qsize_t nr) |
| @@ -279,7 +275,7 @@ static inline int dquot_alloc_space(struct inode *inode, qsize_t nr) | |||
| 279 | 275 | ||
| 280 | ret = dquot_alloc_space_nodirty(inode, nr); | 276 | ret = dquot_alloc_space_nodirty(inode, nr); |
| 281 | if (!ret) | 277 | if (!ret) |
| 282 | mark_inode_dirty(inode); | 278 | mark_inode_dirty_sync(inode); |
| 283 | return ret; | 279 | return ret; |
| 284 | } | 280 | } |
| 285 | 281 | ||
| @@ -309,7 +305,7 @@ static inline int dquot_prealloc_block(struct inode *inode, qsize_t nr) | |||
| 309 | 305 | ||
| 310 | ret = dquot_prealloc_block_nodirty(inode, nr); | 306 | ret = dquot_prealloc_block_nodirty(inode, nr); |
| 311 | if (!ret) | 307 | if (!ret) |
| 312 | mark_inode_dirty(inode); | 308 | mark_inode_dirty_sync(inode); |
| 313 | return ret; | 309 | return ret; |
| 314 | } | 310 | } |
| 315 | 311 | ||
| @@ -325,7 +321,7 @@ static inline int dquot_claim_block(struct inode *inode, qsize_t nr) | |||
| 325 | 321 | ||
| 326 | ret = dquot_claim_space_nodirty(inode, nr << inode->i_blkbits); | 322 | ret = dquot_claim_space_nodirty(inode, nr << inode->i_blkbits); |
| 327 | if (!ret) | 323 | if (!ret) |
| 328 | mark_inode_dirty(inode); | 324 | mark_inode_dirty_sync(inode); |
| 329 | return ret; | 325 | return ret; |
| 330 | } | 326 | } |
| 331 | 327 | ||
| @@ -337,7 +333,7 @@ static inline void dquot_free_space_nodirty(struct inode *inode, qsize_t nr) | |||
| 337 | static inline void dquot_free_space(struct inode *inode, qsize_t nr) | 333 | static inline void dquot_free_space(struct inode *inode, qsize_t nr) |
| 338 | { | 334 | { |
| 339 | dquot_free_space_nodirty(inode, nr); | 335 | dquot_free_space_nodirty(inode, nr); |
| 340 | mark_inode_dirty(inode); | 336 | mark_inode_dirty_sync(inode); |
| 341 | } | 337 | } |
| 342 | 338 | ||
| 343 | static inline void dquot_free_block_nodirty(struct inode *inode, qsize_t nr) | 339 | static inline void dquot_free_block_nodirty(struct inode *inode, qsize_t nr) |
diff --git a/include/linux/rar_register.h b/include/linux/rar_register.h new file mode 100644 index 000000000000..ffa805780f85 --- /dev/null +++ b/include/linux/rar_register.h | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2010 Intel Corporation. All rights reserved. | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or | ||
| 5 | * modify it under the terms of version 2 of the GNU General | ||
| 6 | * Public License as published by the Free Software Foundation. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be | ||
| 9 | * useful, but WITHOUT ANY WARRANTY; without even the implied | ||
| 10 | * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR | ||
| 11 | * PURPOSE. See the GNU General Public License for more details. | ||
| 12 | * You should have received a copy of the GNU General Public | ||
| 13 | * License along with this program; if not, write to the Free | ||
| 14 | * Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
| 15 | * Boston, MA 02111-1307, USA. | ||
| 16 | * The full GNU General Public License is included in this | ||
| 17 | * distribution in the file called COPYING. | ||
| 18 | */ | ||
| 19 | |||
| 20 | |||
| 21 | #ifndef _RAR_REGISTER_H | ||
| 22 | #define _RAR_REGISTER_H | ||
| 23 | |||
| 24 | #include <linux/types.h> | ||
| 25 | |||
| 26 | /* following are used both in drivers as well as user space apps */ | ||
| 27 | |||
| 28 | #define RAR_TYPE_VIDEO 0 | ||
| 29 | #define RAR_TYPE_AUDIO 1 | ||
| 30 | #define RAR_TYPE_IMAGE 2 | ||
| 31 | #define RAR_TYPE_DATA 3 | ||
| 32 | |||
| 33 | #ifdef __KERNEL__ | ||
| 34 | |||
| 35 | struct rar_device; | ||
| 36 | |||
| 37 | int register_rar(int num, | ||
| 38 | int (*callback)(unsigned long data), unsigned long data); | ||
| 39 | void unregister_rar(int num); | ||
| 40 | int rar_get_address(int rar_index, dma_addr_t *start, dma_addr_t *end); | ||
| 41 | int rar_lock(int rar_index); | ||
| 42 | |||
| 43 | #endif /* __KERNEL__ */ | ||
| 44 | #endif /* _RAR_REGISTER_H */ | ||
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index b653b4aaa8a6..9fbc54a2585d 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
| @@ -40,6 +40,7 @@ | |||
| 40 | #include <linux/seqlock.h> | 40 | #include <linux/seqlock.h> |
| 41 | #include <linux/lockdep.h> | 41 | #include <linux/lockdep.h> |
| 42 | #include <linux/completion.h> | 42 | #include <linux/completion.h> |
| 43 | #include <linux/debugobjects.h> | ||
| 43 | 44 | ||
| 44 | #ifdef CONFIG_RCU_TORTURE_TEST | 45 | #ifdef CONFIG_RCU_TORTURE_TEST |
| 45 | extern int rcutorture_runnable; /* for sysctl */ | 46 | extern int rcutorture_runnable; /* for sysctl */ |
| @@ -79,6 +80,16 @@ extern void rcu_init(void); | |||
| 79 | (ptr)->next = NULL; (ptr)->func = NULL; \ | 80 | (ptr)->next = NULL; (ptr)->func = NULL; \ |
| 80 | } while (0) | 81 | } while (0) |
| 81 | 82 | ||
| 83 | /* | ||
| 84 | * init_rcu_head_on_stack()/destroy_rcu_head_on_stack() are needed for dynamic | ||
| 85 | * initialization and destruction of rcu_head on the stack. rcu_head structures | ||
| 86 | * allocated dynamically in the heap or defined statically don't need any | ||
| 87 | * initialization. | ||
| 88 | */ | ||
| 89 | #ifdef CONFIG_DEBUG_OBJECTS_RCU_HEAD | ||
| 90 | extern void init_rcu_head_on_stack(struct rcu_head *head); | ||
| 91 | extern void destroy_rcu_head_on_stack(struct rcu_head *head); | ||
| 92 | #else /* !CONFIG_DEBUG_OBJECTS_RCU_HEAD */ | ||
| 82 | static inline void init_rcu_head_on_stack(struct rcu_head *head) | 93 | static inline void init_rcu_head_on_stack(struct rcu_head *head) |
| 83 | { | 94 | { |
| 84 | } | 95 | } |
| @@ -86,6 +97,7 @@ static inline void init_rcu_head_on_stack(struct rcu_head *head) | |||
| 86 | static inline void destroy_rcu_head_on_stack(struct rcu_head *head) | 97 | static inline void destroy_rcu_head_on_stack(struct rcu_head *head) |
| 87 | { | 98 | { |
| 88 | } | 99 | } |
| 100 | #endif /* #else !CONFIG_DEBUG_OBJECTS_RCU_HEAD */ | ||
| 89 | 101 | ||
| 90 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 102 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
| 91 | 103 | ||
| @@ -517,4 +529,74 @@ extern void call_rcu(struct rcu_head *head, | |||
| 517 | extern void call_rcu_bh(struct rcu_head *head, | 529 | extern void call_rcu_bh(struct rcu_head *head, |
| 518 | void (*func)(struct rcu_head *head)); | 530 | void (*func)(struct rcu_head *head)); |
| 519 | 531 | ||
| 532 | /* | ||
| 533 | * debug_rcu_head_queue()/debug_rcu_head_unqueue() are used internally | ||
| 534 | * by call_rcu() and rcu callback execution, and are therefore not part of the | ||
| 535 | * RCU API. Leaving in rcupdate.h because they are used by all RCU flavors. | ||
| 536 | */ | ||
| 537 | |||
| 538 | #ifdef CONFIG_DEBUG_OBJECTS_RCU_HEAD | ||
| 539 | # define STATE_RCU_HEAD_READY 0 | ||
| 540 | # define STATE_RCU_HEAD_QUEUED 1 | ||
| 541 | |||
| 542 | extern struct debug_obj_descr rcuhead_debug_descr; | ||
| 543 | |||
| 544 | static inline void debug_rcu_head_queue(struct rcu_head *head) | ||
| 545 | { | ||
| 546 | debug_object_activate(head, &rcuhead_debug_descr); | ||
| 547 | debug_object_active_state(head, &rcuhead_debug_descr, | ||
| 548 | STATE_RCU_HEAD_READY, | ||
| 549 | STATE_RCU_HEAD_QUEUED); | ||
| 550 | } | ||
| 551 | |||
| 552 | static inline void debug_rcu_head_unqueue(struct rcu_head *head) | ||
| 553 | { | ||
| 554 | debug_object_active_state(head, &rcuhead_debug_descr, | ||
| 555 | STATE_RCU_HEAD_QUEUED, | ||
| 556 | STATE_RCU_HEAD_READY); | ||
| 557 | debug_object_deactivate(head, &rcuhead_debug_descr); | ||
| 558 | } | ||
| 559 | #else /* !CONFIG_DEBUG_OBJECTS_RCU_HEAD */ | ||
| 560 | static inline void debug_rcu_head_queue(struct rcu_head *head) | ||
| 561 | { | ||
| 562 | } | ||
| 563 | |||
| 564 | static inline void debug_rcu_head_unqueue(struct rcu_head *head) | ||
| 565 | { | ||
| 566 | } | ||
| 567 | #endif /* #else !CONFIG_DEBUG_OBJECTS_RCU_HEAD */ | ||
| 568 | |||
| 569 | #ifndef CONFIG_PROVE_RCU | ||
| 570 | #define __do_rcu_dereference_check(c) do { } while (0) | ||
| 571 | #endif /* #ifdef CONFIG_PROVE_RCU */ | ||
| 572 | |||
| 573 | #define __rcu_dereference_index_check(p, c) \ | ||
| 574 | ({ \ | ||
| 575 | typeof(p) _________p1 = ACCESS_ONCE(p); \ | ||
| 576 | __do_rcu_dereference_check(c); \ | ||
| 577 | smp_read_barrier_depends(); \ | ||
| 578 | (_________p1); \ | ||
| 579 | }) | ||
| 580 | |||
| 581 | /** | ||
| 582 | * rcu_dereference_index_check() - rcu_dereference for indices with debug checking | ||
| 583 | * @p: The pointer to read, prior to dereferencing | ||
| 584 | * @c: The conditions under which the dereference will take place | ||
| 585 | * | ||
| 586 | * Similar to rcu_dereference_check(), but omits the sparse checking. | ||
| 587 | * This allows rcu_dereference_index_check() to be used on integers, | ||
| 588 | * which can then be used as array indices. Attempting to use | ||
| 589 | * rcu_dereference_check() on an integer will give compiler warnings | ||
| 590 | * because the sparse address-space mechanism relies on dereferencing | ||
| 591 | * the RCU-protected pointer. Dereferencing integers is not something | ||
| 592 | * that even gcc will put up with. | ||
| 593 | * | ||
| 594 | * Note that this function does not implicitly check for RCU read-side | ||
| 595 | * critical sections. If this function gains lots of uses, it might | ||
| 596 | * make sense to provide versions for each flavor of RCU, but it does | ||
| 597 | * not make sense as of early 2010. | ||
| 598 | */ | ||
| 599 | #define rcu_dereference_index_check(p, c) \ | ||
| 600 | __rcu_dereference_index_check((p), (c)) | ||
| 601 | |||
| 520 | #endif /* __LINUX_RCUPDATE_H */ | 602 | #endif /* __LINUX_RCUPDATE_H */ |
diff --git a/include/linux/rds.h b/include/linux/rds.h index cab4994c2f63..24bce3ded9ea 100644 --- a/include/linux/rds.h +++ b/include/linux/rds.h | |||
| @@ -100,7 +100,7 @@ | |||
| 100 | struct rds_info_counter { | 100 | struct rds_info_counter { |
| 101 | u_int8_t name[32]; | 101 | u_int8_t name[32]; |
| 102 | u_int64_t value; | 102 | u_int64_t value; |
| 103 | } __attribute__((packed)); | 103 | } __packed; |
| 104 | 104 | ||
| 105 | #define RDS_INFO_CONNECTION_FLAG_SENDING 0x01 | 105 | #define RDS_INFO_CONNECTION_FLAG_SENDING 0x01 |
| 106 | #define RDS_INFO_CONNECTION_FLAG_CONNECTING 0x02 | 106 | #define RDS_INFO_CONNECTION_FLAG_CONNECTING 0x02 |
| @@ -115,7 +115,7 @@ struct rds_info_connection { | |||
| 115 | __be32 faddr; | 115 | __be32 faddr; |
| 116 | u_int8_t transport[TRANSNAMSIZ]; /* null term ascii */ | 116 | u_int8_t transport[TRANSNAMSIZ]; /* null term ascii */ |
| 117 | u_int8_t flags; | 117 | u_int8_t flags; |
| 118 | } __attribute__((packed)); | 118 | } __packed; |
| 119 | 119 | ||
| 120 | struct rds_info_flow { | 120 | struct rds_info_flow { |
| 121 | __be32 laddr; | 121 | __be32 laddr; |
| @@ -123,7 +123,7 @@ struct rds_info_flow { | |||
| 123 | u_int32_t bytes; | 123 | u_int32_t bytes; |
| 124 | __be16 lport; | 124 | __be16 lport; |
| 125 | __be16 fport; | 125 | __be16 fport; |
| 126 | } __attribute__((packed)); | 126 | } __packed; |
| 127 | 127 | ||
| 128 | #define RDS_INFO_MESSAGE_FLAG_ACK 0x01 | 128 | #define RDS_INFO_MESSAGE_FLAG_ACK 0x01 |
| 129 | #define RDS_INFO_MESSAGE_FLAG_FAST_ACK 0x02 | 129 | #define RDS_INFO_MESSAGE_FLAG_FAST_ACK 0x02 |
| @@ -136,7 +136,7 @@ struct rds_info_message { | |||
| 136 | __be16 lport; | 136 | __be16 lport; |
| 137 | __be16 fport; | 137 | __be16 fport; |
| 138 | u_int8_t flags; | 138 | u_int8_t flags; |
| 139 | } __attribute__((packed)); | 139 | } __packed; |
| 140 | 140 | ||
| 141 | struct rds_info_socket { | 141 | struct rds_info_socket { |
| 142 | u_int32_t sndbuf; | 142 | u_int32_t sndbuf; |
| @@ -146,7 +146,7 @@ struct rds_info_socket { | |||
| 146 | __be16 connected_port; | 146 | __be16 connected_port; |
| 147 | u_int32_t rcvbuf; | 147 | u_int32_t rcvbuf; |
| 148 | u_int64_t inum; | 148 | u_int64_t inum; |
| 149 | } __attribute__((packed)); | 149 | } __packed; |
| 150 | 150 | ||
| 151 | struct rds_info_tcp_socket { | 151 | struct rds_info_tcp_socket { |
| 152 | __be32 local_addr; | 152 | __be32 local_addr; |
| @@ -158,7 +158,7 @@ struct rds_info_tcp_socket { | |||
| 158 | u_int32_t last_sent_nxt; | 158 | u_int32_t last_sent_nxt; |
| 159 | u_int32_t last_expected_una; | 159 | u_int32_t last_expected_una; |
| 160 | u_int32_t last_seen_una; | 160 | u_int32_t last_seen_una; |
| 161 | } __attribute__((packed)); | 161 | } __packed; |
| 162 | 162 | ||
| 163 | #define RDS_IB_GID_LEN 16 | 163 | #define RDS_IB_GID_LEN 16 |
| 164 | struct rds_info_rdma_connection { | 164 | struct rds_info_rdma_connection { |
diff --git a/include/linux/regulator/tps6507x.h b/include/linux/regulator/tps6507x.h new file mode 100644 index 000000000000..4892f591bab1 --- /dev/null +++ b/include/linux/regulator/tps6507x.h | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | /* | ||
| 2 | * tps6507x.h -- Voltage regulation for the Texas Instruments TPS6507X | ||
| 3 | * | ||
| 4 | * Copyright (C) 2010 Texas Instruments, Inc. | ||
| 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 REGULATOR_TPS6507X | ||
| 21 | #define REGULATOR_TPS6507X | ||
| 22 | |||
| 23 | /** | ||
| 24 | * tps6507x_reg_platform_data - platform data for tps6507x | ||
| 25 | * @defdcdc_default: Defines whether DCDC high or the low register controls | ||
| 26 | * output voltage by default. Valid for DCDC2 and DCDC3 outputs only. | ||
| 27 | */ | ||
| 28 | struct tps6507x_reg_platform_data { | ||
| 29 | bool defdcdc_default; | ||
| 30 | }; | ||
| 31 | |||
| 32 | #endif | ||
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index 3b603f474186..ba394163dea1 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h | |||
| @@ -360,7 +360,7 @@ int is_reiserfs_jr(struct reiserfs_super_block *rs); | |||
| 360 | /* the spot for the super in versions 3.5 - 3.5.10 (inclusive) */ | 360 | /* the spot for the super in versions 3.5 - 3.5.10 (inclusive) */ |
| 361 | #define REISERFS_OLD_DISK_OFFSET_IN_BYTES (8 * 1024) | 361 | #define REISERFS_OLD_DISK_OFFSET_IN_BYTES (8 * 1024) |
| 362 | 362 | ||
| 363 | // reiserfs internal error code (used by search_by_key adn fix_nodes)) | 363 | /* reiserfs internal error code (used by search_by_key and fix_nodes)) */ |
| 364 | #define CARRY_ON 0 | 364 | #define CARRY_ON 0 |
| 365 | #define REPEAT_SEARCH -1 | 365 | #define REPEAT_SEARCH -1 |
| 366 | #define IO_ERROR -2 | 366 | #define IO_ERROR -2 |
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index fbc8cb0d48c3..58d44491880f 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
| @@ -282,6 +282,7 @@ enum rtattr_type_t { | |||
| 282 | RTA_SESSION, /* no longer used */ | 282 | RTA_SESSION, /* no longer used */ |
| 283 | RTA_MP_ALGO, /* no longer used */ | 283 | RTA_MP_ALGO, /* no longer used */ |
| 284 | RTA_TABLE, | 284 | RTA_TABLE, |
| 285 | RTA_MARK, | ||
| 285 | __RTA_MAX | 286 | __RTA_MAX |
| 286 | }; | 287 | }; |
| 287 | 288 | ||
diff --git a/include/linux/sched.h b/include/linux/sched.h index 747fcaedddb7..9591907c4f79 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -214,6 +214,7 @@ extern char ___assert_task_state[1 - 2*!!( | |||
| 214 | 214 | ||
| 215 | #define task_is_traced(task) ((task->state & __TASK_TRACED) != 0) | 215 | #define task_is_traced(task) ((task->state & __TASK_TRACED) != 0) |
| 216 | #define task_is_stopped(task) ((task->state & __TASK_STOPPED) != 0) | 216 | #define task_is_stopped(task) ((task->state & __TASK_STOPPED) != 0) |
| 217 | #define task_is_dead(task) ((task)->exit_state != 0) | ||
| 217 | #define task_is_stopped_or_traced(task) \ | 218 | #define task_is_stopped_or_traced(task) \ |
| 218 | ((task->state & (__TASK_STOPPED | __TASK_TRACED)) != 0) | 219 | ((task->state & (__TASK_STOPPED | __TASK_TRACED)) != 0) |
| 219 | #define task_contributes_to_load(task) \ | 220 | #define task_contributes_to_load(task) \ |
| @@ -271,19 +272,10 @@ extern int runqueue_is_locked(int cpu); | |||
| 271 | 272 | ||
| 272 | extern cpumask_var_t nohz_cpu_mask; | 273 | extern cpumask_var_t nohz_cpu_mask; |
| 273 | #if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ) | 274 | #if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ) |
| 274 | extern int select_nohz_load_balancer(int cpu); | 275 | extern void select_nohz_load_balancer(int stop_tick); |
| 275 | extern int get_nohz_load_balancer(void); | 276 | extern int get_nohz_timer_target(void); |
| 276 | extern int nohz_ratelimit(int cpu); | ||
| 277 | #else | 277 | #else |
| 278 | static inline int select_nohz_load_balancer(int cpu) | 278 | static inline void select_nohz_load_balancer(int stop_tick) { } |
| 279 | { | ||
| 280 | return 0; | ||
| 281 | } | ||
| 282 | |||
| 283 | static inline int nohz_ratelimit(int cpu) | ||
| 284 | { | ||
| 285 | return 0; | ||
| 286 | } | ||
| 287 | #endif | 279 | #endif |
| 288 | 280 | ||
| 289 | /* | 281 | /* |
| @@ -315,20 +307,16 @@ extern void scheduler_tick(void); | |||
| 315 | 307 | ||
| 316 | extern void sched_show_task(struct task_struct *p); | 308 | extern void sched_show_task(struct task_struct *p); |
| 317 | 309 | ||
| 318 | #ifdef CONFIG_DETECT_SOFTLOCKUP | 310 | #ifdef CONFIG_LOCKUP_DETECTOR |
| 319 | extern void softlockup_tick(void); | ||
| 320 | extern void touch_softlockup_watchdog(void); | 311 | extern void touch_softlockup_watchdog(void); |
| 321 | extern void touch_softlockup_watchdog_sync(void); | 312 | extern void touch_softlockup_watchdog_sync(void); |
| 322 | extern void touch_all_softlockup_watchdogs(void); | 313 | extern void touch_all_softlockup_watchdogs(void); |
| 323 | extern int proc_dosoftlockup_thresh(struct ctl_table *table, int write, | 314 | extern int proc_dowatchdog_thresh(struct ctl_table *table, int write, |
| 324 | void __user *buffer, | 315 | void __user *buffer, |
| 325 | size_t *lenp, loff_t *ppos); | 316 | size_t *lenp, loff_t *ppos); |
| 326 | extern unsigned int softlockup_panic; | 317 | extern unsigned int softlockup_panic; |
| 327 | extern int softlockup_thresh; | 318 | extern int softlockup_thresh; |
| 328 | #else | 319 | #else |
| 329 | static inline void softlockup_tick(void) | ||
| 330 | { | ||
| 331 | } | ||
| 332 | static inline void touch_softlockup_watchdog(void) | 320 | static inline void touch_softlockup_watchdog(void) |
| 333 | { | 321 | { |
| 334 | } | 322 | } |
| @@ -804,7 +792,7 @@ enum cpu_idle_type { | |||
| 804 | #define SD_POWERSAVINGS_BALANCE 0x0100 /* Balance for power savings */ | 792 | #define SD_POWERSAVINGS_BALANCE 0x0100 /* Balance for power savings */ |
| 805 | #define SD_SHARE_PKG_RESOURCES 0x0200 /* Domain members share cpu pkg resources */ | 793 | #define SD_SHARE_PKG_RESOURCES 0x0200 /* Domain members share cpu pkg resources */ |
| 806 | #define SD_SERIALIZE 0x0400 /* Only a single load balancing instance */ | 794 | #define SD_SERIALIZE 0x0400 /* Only a single load balancing instance */ |
| 807 | 795 | #define SD_ASYM_PACKING 0x0800 /* Place busy groups earlier in the domain */ | |
| 808 | #define SD_PREFER_SIBLING 0x1000 /* Prefer to place tasks in a sibling domain */ | 796 | #define SD_PREFER_SIBLING 0x1000 /* Prefer to place tasks in a sibling domain */ |
| 809 | 797 | ||
| 810 | enum powersavings_balance_level { | 798 | enum powersavings_balance_level { |
| @@ -839,6 +827,8 @@ static inline int sd_balance_for_package_power(void) | |||
| 839 | return SD_PREFER_SIBLING; | 827 | return SD_PREFER_SIBLING; |
| 840 | } | 828 | } |
| 841 | 829 | ||
| 830 | extern int __weak arch_sd_sibiling_asym_packing(void); | ||
| 831 | |||
| 842 | /* | 832 | /* |
| 843 | * Optimise SD flags for power savings: | 833 | * Optimise SD flags for power savings: |
| 844 | * SD_BALANCE_NEWIDLE helps agressive task consolidation and power savings. | 834 | * SD_BALANCE_NEWIDLE helps agressive task consolidation and power savings. |
| @@ -860,7 +850,7 @@ struct sched_group { | |||
| 860 | * CPU power of this group, SCHED_LOAD_SCALE being max power for a | 850 | * CPU power of this group, SCHED_LOAD_SCALE being max power for a |
| 861 | * single CPU. | 851 | * single CPU. |
| 862 | */ | 852 | */ |
| 863 | unsigned int cpu_power; | 853 | unsigned int cpu_power, cpu_power_orig; |
| 864 | 854 | ||
| 865 | /* | 855 | /* |
| 866 | * The CPUs this group covers. | 856 | * The CPUs this group covers. |
| @@ -1696,6 +1686,7 @@ extern void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t * | |||
| 1696 | #define PF_EXITING 0x00000004 /* getting shut down */ | 1686 | #define PF_EXITING 0x00000004 /* getting shut down */ |
| 1697 | #define PF_EXITPIDONE 0x00000008 /* pi exit done on shut down */ | 1687 | #define PF_EXITPIDONE 0x00000008 /* pi exit done on shut down */ |
| 1698 | #define PF_VCPU 0x00000010 /* I'm a virtual CPU */ | 1688 | #define PF_VCPU 0x00000010 /* I'm a virtual CPU */ |
| 1689 | #define PF_WQ_WORKER 0x00000020 /* I'm a workqueue worker */ | ||
| 1699 | #define PF_FORKNOEXEC 0x00000040 /* forked but didn't exec */ | 1690 | #define PF_FORKNOEXEC 0x00000040 /* forked but didn't exec */ |
| 1700 | #define PF_MCE_PROCESS 0x00000080 /* process policy on mce errors */ | 1691 | #define PF_MCE_PROCESS 0x00000080 /* process policy on mce errors */ |
| 1701 | #define PF_SUPERPRIV 0x00000100 /* used super-user privileges */ | 1692 | #define PF_SUPERPRIV 0x00000100 /* used super-user privileges */ |
| @@ -1790,20 +1781,23 @@ static inline int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask) | |||
| 1790 | #endif | 1781 | #endif |
| 1791 | 1782 | ||
| 1792 | /* | 1783 | /* |
| 1793 | * Architectures can set this to 1 if they have specified | 1784 | * Do not use outside of architecture code which knows its limitations. |
| 1794 | * CONFIG_HAVE_UNSTABLE_SCHED_CLOCK in their arch Kconfig, | 1785 | * |
| 1795 | * but then during bootup it turns out that sched_clock() | 1786 | * sched_clock() has no promise of monotonicity or bounded drift between |
| 1796 | * is reliable after all: | 1787 | * CPUs, use (which you should not) requires disabling IRQs. |
| 1788 | * | ||
| 1789 | * Please use one of the three interfaces below. | ||
| 1797 | */ | 1790 | */ |
| 1798 | #ifdef CONFIG_HAVE_UNSTABLE_SCHED_CLOCK | ||
| 1799 | extern int sched_clock_stable; | ||
| 1800 | #endif | ||
| 1801 | |||
| 1802 | /* ftrace calls sched_clock() directly */ | ||
| 1803 | extern unsigned long long notrace sched_clock(void); | 1791 | extern unsigned long long notrace sched_clock(void); |
| 1792 | /* | ||
| 1793 | * See the comment in kernel/sched_clock.c | ||
| 1794 | */ | ||
| 1795 | extern u64 cpu_clock(int cpu); | ||
| 1796 | extern u64 local_clock(void); | ||
| 1797 | extern u64 sched_clock_cpu(int cpu); | ||
| 1798 | |||
| 1804 | 1799 | ||
| 1805 | extern void sched_clock_init(void); | 1800 | extern void sched_clock_init(void); |
| 1806 | extern u64 sched_clock_cpu(int cpu); | ||
| 1807 | 1801 | ||
| 1808 | #ifndef CONFIG_HAVE_UNSTABLE_SCHED_CLOCK | 1802 | #ifndef CONFIG_HAVE_UNSTABLE_SCHED_CLOCK |
| 1809 | static inline void sched_clock_tick(void) | 1803 | static inline void sched_clock_tick(void) |
| @@ -1818,17 +1812,19 @@ static inline void sched_clock_idle_wakeup_event(u64 delta_ns) | |||
| 1818 | { | 1812 | { |
| 1819 | } | 1813 | } |
| 1820 | #else | 1814 | #else |
| 1815 | /* | ||
| 1816 | * Architectures can set this to 1 if they have specified | ||
| 1817 | * CONFIG_HAVE_UNSTABLE_SCHED_CLOCK in their arch Kconfig, | ||
| 1818 | * but then during bootup it turns out that sched_clock() | ||
| 1819 | * is reliable after all: | ||
| 1820 | */ | ||
| 1821 | extern int sched_clock_stable; | ||
| 1822 | |||
| 1821 | extern void sched_clock_tick(void); | 1823 | extern void sched_clock_tick(void); |
| 1822 | extern void sched_clock_idle_sleep_event(void); | 1824 | extern void sched_clock_idle_sleep_event(void); |
| 1823 | extern void sched_clock_idle_wakeup_event(u64 delta_ns); | 1825 | extern void sched_clock_idle_wakeup_event(u64 delta_ns); |
| 1824 | #endif | 1826 | #endif |
| 1825 | 1827 | ||
| 1826 | /* | ||
| 1827 | * For kernel-internal use: high-speed (but slightly incorrect) per-cpu | ||
| 1828 | * clock constructed from sched_clock(): | ||
| 1829 | */ | ||
| 1830 | extern unsigned long long cpu_clock(int cpu); | ||
| 1831 | |||
| 1832 | extern unsigned long long | 1828 | extern unsigned long long |
| 1833 | task_sched_runtime(struct task_struct *task); | 1829 | task_sched_runtime(struct task_struct *task); |
| 1834 | extern unsigned long long thread_group_sched_runtime(struct task_struct *task); | 1830 | extern unsigned long long thread_group_sched_runtime(struct task_struct *task); |
| @@ -2434,18 +2430,6 @@ static inline void set_task_cpu(struct task_struct *p, unsigned int cpu) | |||
| 2434 | 2430 | ||
| 2435 | #endif /* CONFIG_SMP */ | 2431 | #endif /* CONFIG_SMP */ |
| 2436 | 2432 | ||
| 2437 | #ifdef CONFIG_TRACING | ||
| 2438 | extern void | ||
| 2439 | __trace_special(void *__tr, void *__data, | ||
| 2440 | unsigned long arg1, unsigned long arg2, unsigned long arg3); | ||
| 2441 | #else | ||
| 2442 | static inline void | ||
| 2443 | __trace_special(void *__tr, void *__data, | ||
| 2444 | unsigned long arg1, unsigned long arg2, unsigned long arg3) | ||
| 2445 | { | ||
| 2446 | } | ||
| 2447 | #endif | ||
| 2448 | |||
| 2449 | extern long sched_setaffinity(pid_t pid, const struct cpumask *new_mask); | 2433 | extern long sched_setaffinity(pid_t pid, const struct cpumask *new_mask); |
| 2450 | extern long sched_getaffinity(pid_t pid, struct cpumask *mask); | 2434 | extern long sched_getaffinity(pid_t pid, struct cpumask *mask); |
| 2451 | 2435 | ||
diff --git a/include/linux/sctp.h b/include/linux/sctp.h index c20d3ce673c0..c11a28706fa4 100644 --- a/include/linux/sctp.h +++ b/include/linux/sctp.h | |||
| @@ -61,7 +61,7 @@ typedef struct sctphdr { | |||
| 61 | __be16 dest; | 61 | __be16 dest; |
| 62 | __be32 vtag; | 62 | __be32 vtag; |
| 63 | __le32 checksum; | 63 | __le32 checksum; |
| 64 | } __attribute__((packed)) sctp_sctphdr_t; | 64 | } __packed sctp_sctphdr_t; |
| 65 | 65 | ||
| 66 | #ifdef __KERNEL__ | 66 | #ifdef __KERNEL__ |
| 67 | #include <linux/skbuff.h> | 67 | #include <linux/skbuff.h> |
| @@ -77,7 +77,7 @@ typedef struct sctp_chunkhdr { | |||
| 77 | __u8 type; | 77 | __u8 type; |
| 78 | __u8 flags; | 78 | __u8 flags; |
| 79 | __be16 length; | 79 | __be16 length; |
| 80 | } __attribute__((packed)) sctp_chunkhdr_t; | 80 | } __packed sctp_chunkhdr_t; |
| 81 | 81 | ||
| 82 | 82 | ||
| 83 | /* Section 3.2. Chunk Type Values. | 83 | /* Section 3.2. Chunk Type Values. |
| @@ -167,7 +167,7 @@ enum { SCTP_CHUNK_FLAG_T = 0x01 }; | |||
| 167 | typedef struct sctp_paramhdr { | 167 | typedef struct sctp_paramhdr { |
| 168 | __be16 type; | 168 | __be16 type; |
| 169 | __be16 length; | 169 | __be16 length; |
| 170 | } __attribute__((packed)) sctp_paramhdr_t; | 170 | } __packed sctp_paramhdr_t; |
| 171 | 171 | ||
| 172 | typedef enum { | 172 | typedef enum { |
| 173 | 173 | ||
| @@ -228,12 +228,12 @@ typedef struct sctp_datahdr { | |||
| 228 | __be16 ssn; | 228 | __be16 ssn; |
| 229 | __be32 ppid; | 229 | __be32 ppid; |
| 230 | __u8 payload[0]; | 230 | __u8 payload[0]; |
| 231 | } __attribute__((packed)) sctp_datahdr_t; | 231 | } __packed sctp_datahdr_t; |
| 232 | 232 | ||
| 233 | typedef struct sctp_data_chunk { | 233 | typedef struct sctp_data_chunk { |
| 234 | sctp_chunkhdr_t chunk_hdr; | 234 | sctp_chunkhdr_t chunk_hdr; |
| 235 | sctp_datahdr_t data_hdr; | 235 | sctp_datahdr_t data_hdr; |
| 236 | } __attribute__((packed)) sctp_data_chunk_t; | 236 | } __packed sctp_data_chunk_t; |
| 237 | 237 | ||
| 238 | /* DATA Chuck Specific Flags */ | 238 | /* DATA Chuck Specific Flags */ |
| 239 | enum { | 239 | enum { |
| @@ -259,78 +259,78 @@ typedef struct sctp_inithdr { | |||
| 259 | __be16 num_inbound_streams; | 259 | __be16 num_inbound_streams; |
| 260 | __be32 initial_tsn; | 260 | __be32 initial_tsn; |
| 261 | __u8 params[0]; | 261 | __u8 params[0]; |
| 262 | } __attribute__((packed)) sctp_inithdr_t; | 262 | } __packed sctp_inithdr_t; |
| 263 | 263 | ||
| 264 | typedef struct sctp_init_chunk { | 264 | typedef struct sctp_init_chunk { |
| 265 | sctp_chunkhdr_t chunk_hdr; | 265 | sctp_chunkhdr_t chunk_hdr; |
| 266 | sctp_inithdr_t init_hdr; | 266 | sctp_inithdr_t init_hdr; |
| 267 | } __attribute__((packed)) sctp_init_chunk_t; | 267 | } __packed sctp_init_chunk_t; |
| 268 | 268 | ||
| 269 | 269 | ||
| 270 | /* Section 3.3.2.1. IPv4 Address Parameter (5) */ | 270 | /* Section 3.3.2.1. IPv4 Address Parameter (5) */ |
| 271 | typedef struct sctp_ipv4addr_param { | 271 | typedef struct sctp_ipv4addr_param { |
| 272 | sctp_paramhdr_t param_hdr; | 272 | sctp_paramhdr_t param_hdr; |
| 273 | struct in_addr addr; | 273 | struct in_addr addr; |
| 274 | } __attribute__((packed)) sctp_ipv4addr_param_t; | 274 | } __packed sctp_ipv4addr_param_t; |
| 275 | 275 | ||
| 276 | /* Section 3.3.2.1. IPv6 Address Parameter (6) */ | 276 | /* Section 3.3.2.1. IPv6 Address Parameter (6) */ |
| 277 | typedef struct sctp_ipv6addr_param { | 277 | typedef struct sctp_ipv6addr_param { |
| 278 | sctp_paramhdr_t param_hdr; | 278 | sctp_paramhdr_t param_hdr; |
| 279 | struct in6_addr addr; | 279 | struct in6_addr addr; |
| 280 | } __attribute__((packed)) sctp_ipv6addr_param_t; | 280 | } __packed sctp_ipv6addr_param_t; |
| 281 | 281 | ||
| 282 | /* Section 3.3.2.1 Cookie Preservative (9) */ | 282 | /* Section 3.3.2.1 Cookie Preservative (9) */ |
| 283 | typedef struct sctp_cookie_preserve_param { | 283 | typedef struct sctp_cookie_preserve_param { |
| 284 | sctp_paramhdr_t param_hdr; | 284 | sctp_paramhdr_t param_hdr; |
| 285 | __be32 lifespan_increment; | 285 | __be32 lifespan_increment; |
| 286 | } __attribute__((packed)) sctp_cookie_preserve_param_t; | 286 | } __packed sctp_cookie_preserve_param_t; |
| 287 | 287 | ||
| 288 | /* Section 3.3.2.1 Host Name Address (11) */ | 288 | /* Section 3.3.2.1 Host Name Address (11) */ |
| 289 | typedef struct sctp_hostname_param { | 289 | typedef struct sctp_hostname_param { |
| 290 | sctp_paramhdr_t param_hdr; | 290 | sctp_paramhdr_t param_hdr; |
| 291 | uint8_t hostname[0]; | 291 | uint8_t hostname[0]; |
| 292 | } __attribute__((packed)) sctp_hostname_param_t; | 292 | } __packed sctp_hostname_param_t; |
| 293 | 293 | ||
| 294 | /* Section 3.3.2.1 Supported Address Types (12) */ | 294 | /* Section 3.3.2.1 Supported Address Types (12) */ |
| 295 | typedef struct sctp_supported_addrs_param { | 295 | typedef struct sctp_supported_addrs_param { |
| 296 | sctp_paramhdr_t param_hdr; | 296 | sctp_paramhdr_t param_hdr; |
| 297 | __be16 types[0]; | 297 | __be16 types[0]; |
| 298 | } __attribute__((packed)) sctp_supported_addrs_param_t; | 298 | } __packed sctp_supported_addrs_param_t; |
| 299 | 299 | ||
| 300 | /* Appendix A. ECN Capable (32768) */ | 300 | /* Appendix A. ECN Capable (32768) */ |
| 301 | typedef struct sctp_ecn_capable_param { | 301 | typedef struct sctp_ecn_capable_param { |
| 302 | sctp_paramhdr_t param_hdr; | 302 | sctp_paramhdr_t param_hdr; |
| 303 | } __attribute__((packed)) sctp_ecn_capable_param_t; | 303 | } __packed sctp_ecn_capable_param_t; |
| 304 | 304 | ||
| 305 | /* ADDIP Section 3.2.6 Adaptation Layer Indication */ | 305 | /* ADDIP Section 3.2.6 Adaptation Layer Indication */ |
| 306 | typedef struct sctp_adaptation_ind_param { | 306 | typedef struct sctp_adaptation_ind_param { |
| 307 | struct sctp_paramhdr param_hdr; | 307 | struct sctp_paramhdr param_hdr; |
| 308 | __be32 adaptation_ind; | 308 | __be32 adaptation_ind; |
| 309 | } __attribute__((packed)) sctp_adaptation_ind_param_t; | 309 | } __packed sctp_adaptation_ind_param_t; |
| 310 | 310 | ||
| 311 | /* ADDIP Section 4.2.7 Supported Extensions Parameter */ | 311 | /* ADDIP Section 4.2.7 Supported Extensions Parameter */ |
| 312 | typedef struct sctp_supported_ext_param { | 312 | typedef struct sctp_supported_ext_param { |
| 313 | struct sctp_paramhdr param_hdr; | 313 | struct sctp_paramhdr param_hdr; |
| 314 | __u8 chunks[0]; | 314 | __u8 chunks[0]; |
| 315 | } __attribute__((packed)) sctp_supported_ext_param_t; | 315 | } __packed sctp_supported_ext_param_t; |
| 316 | 316 | ||
| 317 | /* AUTH Section 3.1 Random */ | 317 | /* AUTH Section 3.1 Random */ |
| 318 | typedef struct sctp_random_param { | 318 | typedef struct sctp_random_param { |
| 319 | sctp_paramhdr_t param_hdr; | 319 | sctp_paramhdr_t param_hdr; |
| 320 | __u8 random_val[0]; | 320 | __u8 random_val[0]; |
| 321 | } __attribute__((packed)) sctp_random_param_t; | 321 | } __packed sctp_random_param_t; |
| 322 | 322 | ||
| 323 | /* AUTH Section 3.2 Chunk List */ | 323 | /* AUTH Section 3.2 Chunk List */ |
| 324 | typedef struct sctp_chunks_param { | 324 | typedef struct sctp_chunks_param { |
| 325 | sctp_paramhdr_t param_hdr; | 325 | sctp_paramhdr_t param_hdr; |
| 326 | __u8 chunks[0]; | 326 | __u8 chunks[0]; |
| 327 | } __attribute__((packed)) sctp_chunks_param_t; | 327 | } __packed sctp_chunks_param_t; |
| 328 | 328 | ||
| 329 | /* AUTH Section 3.3 HMAC Algorithm */ | 329 | /* AUTH Section 3.3 HMAC Algorithm */ |
| 330 | typedef struct sctp_hmac_algo_param { | 330 | typedef struct sctp_hmac_algo_param { |
| 331 | sctp_paramhdr_t param_hdr; | 331 | sctp_paramhdr_t param_hdr; |
| 332 | __be16 hmac_ids[0]; | 332 | __be16 hmac_ids[0]; |
| 333 | } __attribute__((packed)) sctp_hmac_algo_param_t; | 333 | } __packed sctp_hmac_algo_param_t; |
| 334 | 334 | ||
| 335 | /* RFC 2960. Section 3.3.3 Initiation Acknowledgement (INIT ACK) (2): | 335 | /* RFC 2960. Section 3.3.3 Initiation Acknowledgement (INIT ACK) (2): |
| 336 | * The INIT ACK chunk is used to acknowledge the initiation of an SCTP | 336 | * The INIT ACK chunk is used to acknowledge the initiation of an SCTP |
| @@ -342,13 +342,13 @@ typedef sctp_init_chunk_t sctp_initack_chunk_t; | |||
| 342 | typedef struct sctp_cookie_param { | 342 | typedef struct sctp_cookie_param { |
| 343 | sctp_paramhdr_t p; | 343 | sctp_paramhdr_t p; |
| 344 | __u8 body[0]; | 344 | __u8 body[0]; |
| 345 | } __attribute__((packed)) sctp_cookie_param_t; | 345 | } __packed sctp_cookie_param_t; |
| 346 | 346 | ||
| 347 | /* Section 3.3.3.1 Unrecognized Parameters (8) */ | 347 | /* Section 3.3.3.1 Unrecognized Parameters (8) */ |
| 348 | typedef struct sctp_unrecognized_param { | 348 | typedef struct sctp_unrecognized_param { |
| 349 | sctp_paramhdr_t param_hdr; | 349 | sctp_paramhdr_t param_hdr; |
| 350 | sctp_paramhdr_t unrecognized; | 350 | sctp_paramhdr_t unrecognized; |
| 351 | } __attribute__((packed)) sctp_unrecognized_param_t; | 351 | } __packed sctp_unrecognized_param_t; |
| 352 | 352 | ||
| 353 | 353 | ||
| 354 | 354 | ||
| @@ -363,7 +363,7 @@ typedef struct sctp_unrecognized_param { | |||
| 363 | typedef struct sctp_gap_ack_block { | 363 | typedef struct sctp_gap_ack_block { |
| 364 | __be16 start; | 364 | __be16 start; |
| 365 | __be16 end; | 365 | __be16 end; |
| 366 | } __attribute__((packed)) sctp_gap_ack_block_t; | 366 | } __packed sctp_gap_ack_block_t; |
| 367 | 367 | ||
| 368 | typedef __be32 sctp_dup_tsn_t; | 368 | typedef __be32 sctp_dup_tsn_t; |
| 369 | 369 | ||
| @@ -378,12 +378,12 @@ typedef struct sctp_sackhdr { | |||
| 378 | __be16 num_gap_ack_blocks; | 378 | __be16 num_gap_ack_blocks; |
| 379 | __be16 num_dup_tsns; | 379 | __be16 num_dup_tsns; |
| 380 | sctp_sack_variable_t variable[0]; | 380 | sctp_sack_variable_t variable[0]; |
| 381 | } __attribute__((packed)) sctp_sackhdr_t; | 381 | } __packed sctp_sackhdr_t; |
| 382 | 382 | ||
| 383 | typedef struct sctp_sack_chunk { | 383 | typedef struct sctp_sack_chunk { |
| 384 | sctp_chunkhdr_t chunk_hdr; | 384 | sctp_chunkhdr_t chunk_hdr; |
| 385 | sctp_sackhdr_t sack_hdr; | 385 | sctp_sackhdr_t sack_hdr; |
| 386 | } __attribute__((packed)) sctp_sack_chunk_t; | 386 | } __packed sctp_sack_chunk_t; |
| 387 | 387 | ||
| 388 | 388 | ||
| 389 | /* RFC 2960. Section 3.3.5 Heartbeat Request (HEARTBEAT) (4): | 389 | /* RFC 2960. Section 3.3.5 Heartbeat Request (HEARTBEAT) (4): |
| @@ -395,12 +395,12 @@ typedef struct sctp_sack_chunk { | |||
| 395 | 395 | ||
| 396 | typedef struct sctp_heartbeathdr { | 396 | typedef struct sctp_heartbeathdr { |
| 397 | sctp_paramhdr_t info; | 397 | sctp_paramhdr_t info; |
| 398 | } __attribute__((packed)) sctp_heartbeathdr_t; | 398 | } __packed sctp_heartbeathdr_t; |
| 399 | 399 | ||
| 400 | typedef struct sctp_heartbeat_chunk { | 400 | typedef struct sctp_heartbeat_chunk { |
| 401 | sctp_chunkhdr_t chunk_hdr; | 401 | sctp_chunkhdr_t chunk_hdr; |
| 402 | sctp_heartbeathdr_t hb_hdr; | 402 | sctp_heartbeathdr_t hb_hdr; |
| 403 | } __attribute__((packed)) sctp_heartbeat_chunk_t; | 403 | } __packed sctp_heartbeat_chunk_t; |
| 404 | 404 | ||
| 405 | 405 | ||
| 406 | /* For the abort and shutdown ACK we must carry the init tag in the | 406 | /* For the abort and shutdown ACK we must carry the init tag in the |
| @@ -409,7 +409,7 @@ typedef struct sctp_heartbeat_chunk { | |||
| 409 | */ | 409 | */ |
| 410 | typedef struct sctp_abort_chunk { | 410 | typedef struct sctp_abort_chunk { |
| 411 | sctp_chunkhdr_t uh; | 411 | sctp_chunkhdr_t uh; |
| 412 | } __attribute__((packed)) sctp_abort_chunk_t; | 412 | } __packed sctp_abort_chunk_t; |
| 413 | 413 | ||
| 414 | 414 | ||
| 415 | /* For the graceful shutdown we must carry the tag (in common header) | 415 | /* For the graceful shutdown we must carry the tag (in common header) |
| @@ -417,12 +417,12 @@ typedef struct sctp_abort_chunk { | |||
| 417 | */ | 417 | */ |
| 418 | typedef struct sctp_shutdownhdr { | 418 | typedef struct sctp_shutdownhdr { |
| 419 | __be32 cum_tsn_ack; | 419 | __be32 cum_tsn_ack; |
| 420 | } __attribute__((packed)) sctp_shutdownhdr_t; | 420 | } __packed sctp_shutdownhdr_t; |
| 421 | 421 | ||
| 422 | struct sctp_shutdown_chunk_t { | 422 | struct sctp_shutdown_chunk_t { |
| 423 | sctp_chunkhdr_t chunk_hdr; | 423 | sctp_chunkhdr_t chunk_hdr; |
| 424 | sctp_shutdownhdr_t shutdown_hdr; | 424 | sctp_shutdownhdr_t shutdown_hdr; |
| 425 | } __attribute__ ((packed)); | 425 | } __packed; |
| 426 | 426 | ||
| 427 | /* RFC 2960. Section 3.3.10 Operation Error (ERROR) (9) */ | 427 | /* RFC 2960. Section 3.3.10 Operation Error (ERROR) (9) */ |
| 428 | 428 | ||
| @@ -430,12 +430,12 @@ typedef struct sctp_errhdr { | |||
| 430 | __be16 cause; | 430 | __be16 cause; |
| 431 | __be16 length; | 431 | __be16 length; |
| 432 | __u8 variable[0]; | 432 | __u8 variable[0]; |
| 433 | } __attribute__((packed)) sctp_errhdr_t; | 433 | } __packed sctp_errhdr_t; |
| 434 | 434 | ||
| 435 | typedef struct sctp_operr_chunk { | 435 | typedef struct sctp_operr_chunk { |
| 436 | sctp_chunkhdr_t chunk_hdr; | 436 | sctp_chunkhdr_t chunk_hdr; |
| 437 | sctp_errhdr_t err_hdr; | 437 | sctp_errhdr_t err_hdr; |
| 438 | } __attribute__((packed)) sctp_operr_chunk_t; | 438 | } __packed sctp_operr_chunk_t; |
| 439 | 439 | ||
| 440 | /* RFC 2960 3.3.10 - Operation Error | 440 | /* RFC 2960 3.3.10 - Operation Error |
| 441 | * | 441 | * |
| @@ -525,7 +525,7 @@ typedef struct sctp_ecnehdr { | |||
| 525 | typedef struct sctp_ecne_chunk { | 525 | typedef struct sctp_ecne_chunk { |
| 526 | sctp_chunkhdr_t chunk_hdr; | 526 | sctp_chunkhdr_t chunk_hdr; |
| 527 | sctp_ecnehdr_t ence_hdr; | 527 | sctp_ecnehdr_t ence_hdr; |
| 528 | } __attribute__((packed)) sctp_ecne_chunk_t; | 528 | } __packed sctp_ecne_chunk_t; |
| 529 | 529 | ||
| 530 | /* RFC 2960. Appendix A. Explicit Congestion Notification. | 530 | /* RFC 2960. Appendix A. Explicit Congestion Notification. |
| 531 | * Congestion Window Reduced (CWR) (13) | 531 | * Congestion Window Reduced (CWR) (13) |
| @@ -537,7 +537,7 @@ typedef struct sctp_cwrhdr { | |||
| 537 | typedef struct sctp_cwr_chunk { | 537 | typedef struct sctp_cwr_chunk { |
| 538 | sctp_chunkhdr_t chunk_hdr; | 538 | sctp_chunkhdr_t chunk_hdr; |
| 539 | sctp_cwrhdr_t cwr_hdr; | 539 | sctp_cwrhdr_t cwr_hdr; |
| 540 | } __attribute__((packed)) sctp_cwr_chunk_t; | 540 | } __packed sctp_cwr_chunk_t; |
| 541 | 541 | ||
| 542 | /* PR-SCTP | 542 | /* PR-SCTP |
| 543 | * 3.2 Forward Cumulative TSN Chunk Definition (FORWARD TSN) | 543 | * 3.2 Forward Cumulative TSN Chunk Definition (FORWARD TSN) |
| @@ -588,17 +588,17 @@ typedef struct sctp_cwr_chunk { | |||
| 588 | struct sctp_fwdtsn_skip { | 588 | struct sctp_fwdtsn_skip { |
| 589 | __be16 stream; | 589 | __be16 stream; |
| 590 | __be16 ssn; | 590 | __be16 ssn; |
| 591 | } __attribute__((packed)); | 591 | } __packed; |
| 592 | 592 | ||
| 593 | struct sctp_fwdtsn_hdr { | 593 | struct sctp_fwdtsn_hdr { |
| 594 | __be32 new_cum_tsn; | 594 | __be32 new_cum_tsn; |
| 595 | struct sctp_fwdtsn_skip skip[0]; | 595 | struct sctp_fwdtsn_skip skip[0]; |
| 596 | } __attribute((packed)); | 596 | } __packed; |
| 597 | 597 | ||
| 598 | struct sctp_fwdtsn_chunk { | 598 | struct sctp_fwdtsn_chunk { |
| 599 | struct sctp_chunkhdr chunk_hdr; | 599 | struct sctp_chunkhdr chunk_hdr; |
| 600 | struct sctp_fwdtsn_hdr fwdtsn_hdr; | 600 | struct sctp_fwdtsn_hdr fwdtsn_hdr; |
| 601 | } __attribute((packed)); | 601 | } __packed; |
| 602 | 602 | ||
| 603 | 603 | ||
| 604 | /* ADDIP | 604 | /* ADDIP |
| @@ -636,17 +636,17 @@ struct sctp_fwdtsn_chunk { | |||
| 636 | typedef struct sctp_addip_param { | 636 | typedef struct sctp_addip_param { |
| 637 | sctp_paramhdr_t param_hdr; | 637 | sctp_paramhdr_t param_hdr; |
| 638 | __be32 crr_id; | 638 | __be32 crr_id; |
| 639 | } __attribute__((packed)) sctp_addip_param_t; | 639 | } __packed sctp_addip_param_t; |
| 640 | 640 | ||
| 641 | typedef struct sctp_addiphdr { | 641 | typedef struct sctp_addiphdr { |
| 642 | __be32 serial; | 642 | __be32 serial; |
| 643 | __u8 params[0]; | 643 | __u8 params[0]; |
| 644 | } __attribute__((packed)) sctp_addiphdr_t; | 644 | } __packed sctp_addiphdr_t; |
| 645 | 645 | ||
| 646 | typedef struct sctp_addip_chunk { | 646 | typedef struct sctp_addip_chunk { |
| 647 | sctp_chunkhdr_t chunk_hdr; | 647 | sctp_chunkhdr_t chunk_hdr; |
| 648 | sctp_addiphdr_t addip_hdr; | 648 | sctp_addiphdr_t addip_hdr; |
| 649 | } __attribute__((packed)) sctp_addip_chunk_t; | 649 | } __packed sctp_addip_chunk_t; |
| 650 | 650 | ||
| 651 | /* AUTH | 651 | /* AUTH |
| 652 | * Section 4.1 Authentication Chunk (AUTH) | 652 | * Section 4.1 Authentication Chunk (AUTH) |
| @@ -701,11 +701,11 @@ typedef struct sctp_authhdr { | |||
| 701 | __be16 shkey_id; | 701 | __be16 shkey_id; |
| 702 | __be16 hmac_id; | 702 | __be16 hmac_id; |
| 703 | __u8 hmac[0]; | 703 | __u8 hmac[0]; |
| 704 | } __attribute__((packed)) sctp_authhdr_t; | 704 | } __packed sctp_authhdr_t; |
| 705 | 705 | ||
| 706 | typedef struct sctp_auth_chunk { | 706 | typedef struct sctp_auth_chunk { |
| 707 | sctp_chunkhdr_t chunk_hdr; | 707 | sctp_chunkhdr_t chunk_hdr; |
| 708 | sctp_authhdr_t auth_hdr; | 708 | sctp_authhdr_t auth_hdr; |
| 709 | } __attribute__((packed)) sctp_auth_chunk_t; | 709 | } __packed sctp_auth_chunk_t; |
| 710 | 710 | ||
| 711 | #endif /* __LINUX_SCTP_H__ */ | 711 | #endif /* __LINUX_SCTP_H__ */ |
diff --git a/include/linux/security.h b/include/linux/security.h index 0c8819170463..723a93df756a 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
| @@ -470,8 +470,6 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
| 470 | * @path_truncate: | 470 | * @path_truncate: |
| 471 | * Check permission before truncating a file. | 471 | * Check permission before truncating a file. |
| 472 | * @path contains the path structure for the file. | 472 | * @path contains the path structure for the file. |
| 473 | * @length is the new length of the file. | ||
| 474 | * @time_attrs is the flags passed to do_truncate(). | ||
| 475 | * Return 0 if permission is granted. | 473 | * Return 0 if permission is granted. |
| 476 | * @inode_getattr: | 474 | * @inode_getattr: |
| 477 | * Check permission before obtaining file attributes. | 475 | * Check permission before obtaining file attributes. |
| @@ -1412,8 +1410,7 @@ struct security_operations { | |||
| 1412 | int (*path_rmdir) (struct path *dir, struct dentry *dentry); | 1410 | int (*path_rmdir) (struct path *dir, struct dentry *dentry); |
| 1413 | int (*path_mknod) (struct path *dir, struct dentry *dentry, int mode, | 1411 | int (*path_mknod) (struct path *dir, struct dentry *dentry, int mode, |
| 1414 | unsigned int dev); | 1412 | unsigned int dev); |
| 1415 | int (*path_truncate) (struct path *path, loff_t length, | 1413 | int (*path_truncate) (struct path *path); |
| 1416 | unsigned int time_attrs); | ||
| 1417 | int (*path_symlink) (struct path *dir, struct dentry *dentry, | 1414 | int (*path_symlink) (struct path *dir, struct dentry *dentry, |
| 1418 | const char *old_name); | 1415 | const char *old_name); |
| 1419 | int (*path_link) (struct dentry *old_dentry, struct path *new_dir, | 1416 | int (*path_link) (struct dentry *old_dentry, struct path *new_dir, |
| @@ -2806,8 +2803,7 @@ int security_path_mkdir(struct path *dir, struct dentry *dentry, int mode); | |||
| 2806 | int security_path_rmdir(struct path *dir, struct dentry *dentry); | 2803 | int security_path_rmdir(struct path *dir, struct dentry *dentry); |
| 2807 | int security_path_mknod(struct path *dir, struct dentry *dentry, int mode, | 2804 | int security_path_mknod(struct path *dir, struct dentry *dentry, int mode, |
| 2808 | unsigned int dev); | 2805 | unsigned int dev); |
| 2809 | int security_path_truncate(struct path *path, loff_t length, | 2806 | int security_path_truncate(struct path *path); |
| 2810 | unsigned int time_attrs); | ||
| 2811 | int security_path_symlink(struct path *dir, struct dentry *dentry, | 2807 | int security_path_symlink(struct path *dir, struct dentry *dentry, |
| 2812 | const char *old_name); | 2808 | const char *old_name); |
| 2813 | int security_path_link(struct dentry *old_dentry, struct path *new_dir, | 2809 | int security_path_link(struct dentry *old_dentry, struct path *new_dir, |
| @@ -2841,8 +2837,7 @@ static inline int security_path_mknod(struct path *dir, struct dentry *dentry, | |||
| 2841 | return 0; | 2837 | return 0; |
| 2842 | } | 2838 | } |
| 2843 | 2839 | ||
| 2844 | static inline int security_path_truncate(struct path *path, loff_t length, | 2840 | static inline int security_path_truncate(struct path *path) |
| 2845 | unsigned int time_attrs) | ||
| 2846 | { | 2841 | { |
| 2847 | return 0; | 2842 | return 0; |
| 2848 | } | 2843 | } |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index f89e7fd59a4c..d20d9e7a9bbd 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
| @@ -169,6 +169,7 @@ struct skb_shared_hwtstamps { | |||
| 169 | * @software: generate software time stamp | 169 | * @software: generate software time stamp |
| 170 | * @in_progress: device driver is going to provide | 170 | * @in_progress: device driver is going to provide |
| 171 | * hardware time stamp | 171 | * hardware time stamp |
| 172 | * @prevent_sk_orphan: make sk reference available on driver level | ||
| 172 | * @flags: all shared_tx flags | 173 | * @flags: all shared_tx flags |
| 173 | * | 174 | * |
| 174 | * These flags are attached to packets as part of the | 175 | * These flags are attached to packets as part of the |
| @@ -178,7 +179,8 @@ union skb_shared_tx { | |||
| 178 | struct { | 179 | struct { |
| 179 | __u8 hardware:1, | 180 | __u8 hardware:1, |
| 180 | software:1, | 181 | software:1, |
| 181 | in_progress:1; | 182 | in_progress:1, |
| 183 | prevent_sk_orphan:1; | ||
| 182 | }; | 184 | }; |
| 183 | __u8 flags; | 185 | __u8 flags; |
| 184 | }; | 186 | }; |
| @@ -202,10 +204,11 @@ struct skb_shared_info { | |||
| 202 | */ | 204 | */ |
| 203 | atomic_t dataref; | 205 | atomic_t dataref; |
| 204 | 206 | ||
| 205 | skb_frag_t frags[MAX_SKB_FRAGS]; | ||
| 206 | /* Intermediate layers must ensure that destructor_arg | 207 | /* Intermediate layers must ensure that destructor_arg |
| 207 | * remains valid until skb destructor */ | 208 | * remains valid until skb destructor */ |
| 208 | void * destructor_arg; | 209 | void * destructor_arg; |
| 210 | /* must be last field, see pskb_expand_head() */ | ||
| 211 | skb_frag_t frags[MAX_SKB_FRAGS]; | ||
| 209 | }; | 212 | }; |
| 210 | 213 | ||
| 211 | /* We divide dataref into two halves. The higher 16 bits hold references | 214 | /* We divide dataref into two halves. The higher 16 bits hold references |
| @@ -1414,12 +1417,14 @@ static inline int skb_network_offset(const struct sk_buff *skb) | |||
| 1414 | * | 1417 | * |
| 1415 | * Various parts of the networking layer expect at least 32 bytes of | 1418 | * Various parts of the networking layer expect at least 32 bytes of |
| 1416 | * headroom, you should not reduce this. | 1419 | * headroom, you should not reduce this. |
| 1417 | * With RPS, we raised NET_SKB_PAD to 64 so that get_rps_cpus() fetches span | 1420 | * |
| 1418 | * a 64 bytes aligned block to fit modern (>= 64 bytes) cache line sizes | 1421 | * Using max(32, L1_CACHE_BYTES) makes sense (especially with RPS) |
| 1422 | * to reduce average number of cache lines per packet. | ||
| 1423 | * get_rps_cpus() for example only access one 64 bytes aligned block : | ||
| 1419 | * NET_IP_ALIGN(2) + ethernet_header(14) + IP_header(20/40) + ports(8) | 1424 | * NET_IP_ALIGN(2) + ethernet_header(14) + IP_header(20/40) + ports(8) |
| 1420 | */ | 1425 | */ |
| 1421 | #ifndef NET_SKB_PAD | 1426 | #ifndef NET_SKB_PAD |
| 1422 | #define NET_SKB_PAD 64 | 1427 | #define NET_SKB_PAD max(32, L1_CACHE_BYTES) |
| 1423 | #endif | 1428 | #endif |
| 1424 | 1429 | ||
| 1425 | extern int ___pskb_trim(struct sk_buff *skb, unsigned int len); | 1430 | extern int ___pskb_trim(struct sk_buff *skb, unsigned int len); |
| @@ -1931,6 +1936,36 @@ static inline ktime_t net_invalid_timestamp(void) | |||
| 1931 | return ktime_set(0, 0); | 1936 | return ktime_set(0, 0); |
| 1932 | } | 1937 | } |
| 1933 | 1938 | ||
| 1939 | extern void skb_timestamping_init(void); | ||
| 1940 | |||
| 1941 | #ifdef CONFIG_NETWORK_PHY_TIMESTAMPING | ||
| 1942 | |||
| 1943 | extern void skb_clone_tx_timestamp(struct sk_buff *skb); | ||
| 1944 | extern bool skb_defer_rx_timestamp(struct sk_buff *skb); | ||
| 1945 | |||
| 1946 | #else /* CONFIG_NETWORK_PHY_TIMESTAMPING */ | ||
| 1947 | |||
| 1948 | static inline void skb_clone_tx_timestamp(struct sk_buff *skb) | ||
| 1949 | { | ||
| 1950 | } | ||
| 1951 | |||
| 1952 | static inline bool skb_defer_rx_timestamp(struct sk_buff *skb) | ||
| 1953 | { | ||
| 1954 | return false; | ||
| 1955 | } | ||
| 1956 | |||
| 1957 | #endif /* !CONFIG_NETWORK_PHY_TIMESTAMPING */ | ||
| 1958 | |||
| 1959 | /** | ||
| 1960 | * skb_complete_tx_timestamp() - deliver cloned skb with tx timestamps | ||
| 1961 | * | ||
| 1962 | * @skb: clone of the the original outgoing packet | ||
| 1963 | * @hwtstamps: hardware time stamps | ||
| 1964 | * | ||
| 1965 | */ | ||
| 1966 | void skb_complete_tx_timestamp(struct sk_buff *skb, | ||
| 1967 | struct skb_shared_hwtstamps *hwtstamps); | ||
| 1968 | |||
| 1934 | /** | 1969 | /** |
| 1935 | * skb_tstamp_tx - queue clone of skb with send time stamps | 1970 | * skb_tstamp_tx - queue clone of skb with send time stamps |
| 1936 | * @orig_skb: the original outgoing packet | 1971 | * @orig_skb: the original outgoing packet |
| @@ -1945,6 +1980,28 @@ static inline ktime_t net_invalid_timestamp(void) | |||
| 1945 | extern void skb_tstamp_tx(struct sk_buff *orig_skb, | 1980 | extern void skb_tstamp_tx(struct sk_buff *orig_skb, |
| 1946 | struct skb_shared_hwtstamps *hwtstamps); | 1981 | struct skb_shared_hwtstamps *hwtstamps); |
| 1947 | 1982 | ||
| 1983 | static inline void sw_tx_timestamp(struct sk_buff *skb) | ||
| 1984 | { | ||
| 1985 | union skb_shared_tx *shtx = skb_tx(skb); | ||
| 1986 | if (shtx->software && !shtx->in_progress) | ||
| 1987 | skb_tstamp_tx(skb, NULL); | ||
| 1988 | } | ||
| 1989 | |||
| 1990 | /** | ||
| 1991 | * skb_tx_timestamp() - Driver hook for transmit timestamping | ||
| 1992 | * | ||
| 1993 | * Ethernet MAC Drivers should call this function in their hard_xmit() | ||
| 1994 | * function as soon as possible after giving the sk_buff to the MAC | ||
| 1995 | * hardware, but before freeing the sk_buff. | ||
| 1996 | * | ||
| 1997 | * @skb: A socket buffer. | ||
| 1998 | */ | ||
| 1999 | static inline void skb_tx_timestamp(struct sk_buff *skb) | ||
| 2000 | { | ||
| 2001 | skb_clone_tx_timestamp(skb); | ||
| 2002 | sw_tx_timestamp(skb); | ||
| 2003 | } | ||
| 2004 | |||
| 1948 | extern __sum16 __skb_checksum_complete_head(struct sk_buff *skb, int len); | 2005 | extern __sum16 __skb_checksum_complete_head(struct sk_buff *skb, int len); |
| 1949 | extern __sum16 __skb_checksum_complete(struct sk_buff *skb); | 2006 | extern __sum16 __skb_checksum_complete(struct sk_buff *skb); |
| 1950 | 2007 | ||
| @@ -2132,7 +2189,8 @@ static inline bool skb_warn_if_lro(const struct sk_buff *skb) | |||
| 2132 | /* LRO sets gso_size but not gso_type, whereas if GSO is really | 2189 | /* LRO sets gso_size but not gso_type, whereas if GSO is really |
| 2133 | * wanted then gso_type will be set. */ | 2190 | * wanted then gso_type will be set. */ |
| 2134 | struct skb_shared_info *shinfo = skb_shinfo(skb); | 2191 | struct skb_shared_info *shinfo = skb_shinfo(skb); |
| 2135 | if (shinfo->gso_size != 0 && unlikely(shinfo->gso_type == 0)) { | 2192 | if (skb_is_nonlinear(skb) && shinfo->gso_size != 0 && |
| 2193 | unlikely(shinfo->gso_type == 0)) { | ||
| 2136 | __skb_warn_lro_forwarding(skb); | 2194 | __skb_warn_lro_forwarding(skb); |
| 2137 | return true; | 2195 | return true; |
| 2138 | } | 2196 | } |
diff --git a/include/linux/slab.h b/include/linux/slab.h index 49d1247cd6d9..59260e21bdf5 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
| @@ -268,7 +268,8 @@ static inline void *kmem_cache_alloc_node(struct kmem_cache *cachep, | |||
| 268 | * allocator where we care about the real place the memory allocation | 268 | * allocator where we care about the real place the memory allocation |
| 269 | * request comes from. | 269 | * request comes from. |
| 270 | */ | 270 | */ |
| 271 | #if defined(CONFIG_DEBUG_SLAB) || defined(CONFIG_SLUB) | 271 | #if defined(CONFIG_DEBUG_SLAB) || defined(CONFIG_SLUB) || \ |
| 272 | (defined(CONFIG_SLAB) && defined(CONFIG_TRACING)) | ||
| 272 | extern void *__kmalloc_track_caller(size_t, gfp_t, unsigned long); | 273 | extern void *__kmalloc_track_caller(size_t, gfp_t, unsigned long); |
| 273 | #define kmalloc_track_caller(size, flags) \ | 274 | #define kmalloc_track_caller(size, flags) \ |
| 274 | __kmalloc_track_caller(size, flags, _RET_IP_) | 275 | __kmalloc_track_caller(size, flags, _RET_IP_) |
| @@ -286,7 +287,8 @@ extern void *__kmalloc_track_caller(size_t, gfp_t, unsigned long); | |||
| 286 | * standard allocator where we care about the real place the memory | 287 | * standard allocator where we care about the real place the memory |
| 287 | * allocation request comes from. | 288 | * allocation request comes from. |
| 288 | */ | 289 | */ |
| 289 | #if defined(CONFIG_DEBUG_SLAB) || defined(CONFIG_SLUB) | 290 | #if defined(CONFIG_DEBUG_SLAB) || defined(CONFIG_SLUB) || \ |
| 291 | (defined(CONFIG_SLAB) && defined(CONFIG_TRACING)) | ||
| 290 | extern void *__kmalloc_node_track_caller(size_t, gfp_t, int, unsigned long); | 292 | extern void *__kmalloc_node_track_caller(size_t, gfp_t, int, unsigned long); |
| 291 | #define kmalloc_node_track_caller(size, flags, node) \ | 293 | #define kmalloc_node_track_caller(size, flags, node) \ |
| 292 | __kmalloc_node_track_caller(size, flags, node, \ | 294 | __kmalloc_node_track_caller(size, flags, node, \ |
diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h index 1812dac8c496..1acfa73ce2ac 100644 --- a/include/linux/slab_def.h +++ b/include/linux/slab_def.h | |||
| @@ -14,7 +14,8 @@ | |||
| 14 | #include <asm/page.h> /* kmalloc_sizes.h needs PAGE_SIZE */ | 14 | #include <asm/page.h> /* kmalloc_sizes.h needs PAGE_SIZE */ |
| 15 | #include <asm/cache.h> /* kmalloc_sizes.h needs L1_CACHE_BYTES */ | 15 | #include <asm/cache.h> /* kmalloc_sizes.h needs L1_CACHE_BYTES */ |
| 16 | #include <linux/compiler.h> | 16 | #include <linux/compiler.h> |
| 17 | #include <linux/kmemtrace.h> | 17 | |
| 18 | #include <trace/events/kmem.h> | ||
| 18 | 19 | ||
| 19 | #ifndef ARCH_KMALLOC_MINALIGN | 20 | #ifndef ARCH_KMALLOC_MINALIGN |
| 20 | /* | 21 | /* |
diff --git a/include/linux/slow-work.h b/include/linux/slow-work.h deleted file mode 100644 index 13337bf6c3f5..000000000000 --- a/include/linux/slow-work.h +++ /dev/null | |||
| @@ -1,163 +0,0 @@ | |||
| 1 | /* Worker thread pool for slow items, such as filesystem lookups or mkdirs | ||
| 2 | * | ||
| 3 | * Copyright (C) 2008 Red Hat, Inc. All Rights Reserved. | ||
| 4 | * Written by David Howells (dhowells@redhat.com) | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or | ||
| 7 | * modify it under the terms of the GNU General Public Licence | ||
| 8 | * as published by the Free Software Foundation; either version | ||
| 9 | * 2 of the Licence, or (at your option) any later version. | ||
| 10 | * | ||
| 11 | * See Documentation/slow-work.txt | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef _LINUX_SLOW_WORK_H | ||
| 15 | #define _LINUX_SLOW_WORK_H | ||
| 16 | |||
| 17 | #ifdef CONFIG_SLOW_WORK | ||
| 18 | |||
| 19 | #include <linux/sysctl.h> | ||
| 20 | #include <linux/timer.h> | ||
| 21 | |||
| 22 | struct slow_work; | ||
| 23 | #ifdef CONFIG_SLOW_WORK_DEBUG | ||
| 24 | struct seq_file; | ||
| 25 | #endif | ||
| 26 | |||
| 27 | /* | ||
| 28 | * The operations used to support slow work items | ||
| 29 | */ | ||
| 30 | struct slow_work_ops { | ||
| 31 | /* owner */ | ||
| 32 | struct module *owner; | ||
| 33 | |||
| 34 | /* get a ref on a work item | ||
| 35 | * - return 0 if successful, -ve if not | ||
| 36 | */ | ||
| 37 | int (*get_ref)(struct slow_work *work); | ||
| 38 | |||
| 39 | /* discard a ref to a work item */ | ||
| 40 | void (*put_ref)(struct slow_work *work); | ||
| 41 | |||
| 42 | /* execute a work item */ | ||
| 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 | ||
| 49 | }; | ||
| 50 | |||
| 51 | /* | ||
| 52 | * A slow work item | ||
| 53 | * - A reference is held on the parent object by the thread pool when it is | ||
| 54 | * queued | ||
| 55 | */ | ||
| 56 | struct slow_work { | ||
| 57 | struct module *owner; /* the owning module */ | ||
| 58 | unsigned long flags; | ||
| 59 | #define SLOW_WORK_PENDING 0 /* item pending (further) execution */ | ||
| 60 | #define SLOW_WORK_EXECUTING 1 /* item currently executing */ | ||
| 61 | #define SLOW_WORK_ENQ_DEFERRED 2 /* item enqueue deferred */ | ||
| 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 */ | ||
| 65 | const struct slow_work_ops *ops; /* operations table for this item */ | ||
| 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; | ||
| 75 | }; | ||
| 76 | |||
| 77 | /** | ||
| 78 | * slow_work_init - Initialise a slow work item | ||
| 79 | * @work: The work item to initialise | ||
| 80 | * @ops: The operations to use to handle the slow work item | ||
| 81 | * | ||
| 82 | * Initialise a slow work item. | ||
| 83 | */ | ||
| 84 | static inline void slow_work_init(struct slow_work *work, | ||
| 85 | const struct slow_work_ops *ops) | ||
| 86 | { | ||
| 87 | work->flags = 0; | ||
| 88 | work->ops = ops; | ||
| 89 | INIT_LIST_HEAD(&work->link); | ||
| 90 | } | ||
| 91 | |||
| 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 | /** | ||
| 107 | * vslow_work_init - Initialise a very slow work item | ||
| 108 | * @work: The work item to initialise | ||
| 109 | * @ops: The operations to use to handle the slow work item | ||
| 110 | * | ||
| 111 | * Initialise a very slow work item. This item will be restricted such that | ||
| 112 | * only a certain number of the pool threads will be able to execute items of | ||
| 113 | * this type. | ||
| 114 | */ | ||
| 115 | static inline void vslow_work_init(struct slow_work *work, | ||
| 116 | const struct slow_work_ops *ops) | ||
| 117 | { | ||
| 118 | work->flags = 1 << SLOW_WORK_VERY_SLOW; | ||
| 119 | work->ops = ops; | ||
| 120 | INIT_LIST_HEAD(&work->link); | ||
| 121 | } | ||
| 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 | |||
| 142 | extern int slow_work_enqueue(struct slow_work *work); | ||
| 143 | extern void slow_work_cancel(struct slow_work *work); | ||
| 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); | ||
| 157 | |||
| 158 | #ifdef CONFIG_SYSCTL | ||
| 159 | extern ctl_table slow_work_sysctls[]; | ||
| 160 | #endif | ||
| 161 | |||
| 162 | #endif /* CONFIG_SLOW_WORK */ | ||
| 163 | #endif /* _LINUX_SLOW_WORK_H */ | ||
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h index 4ba59cfc1f75..6447a723ecb1 100644 --- a/include/linux/slub_def.h +++ b/include/linux/slub_def.h | |||
| @@ -10,9 +10,10 @@ | |||
| 10 | #include <linux/gfp.h> | 10 | #include <linux/gfp.h> |
| 11 | #include <linux/workqueue.h> | 11 | #include <linux/workqueue.h> |
| 12 | #include <linux/kobject.h> | 12 | #include <linux/kobject.h> |
| 13 | #include <linux/kmemtrace.h> | ||
| 14 | #include <linux/kmemleak.h> | 13 | #include <linux/kmemleak.h> |
| 15 | 14 | ||
| 15 | #include <trace/events/kmem.h> | ||
| 16 | |||
| 16 | enum stat_item { | 17 | enum stat_item { |
| 17 | ALLOC_FASTPATH, /* Allocation from cpu slab */ | 18 | ALLOC_FASTPATH, /* Allocation from cpu slab */ |
| 18 | ALLOC_SLOWPATH, /* Allocation by getting a new cpu slab */ | 19 | ALLOC_SLOWPATH, /* Allocation by getting a new cpu slab */ |
diff --git a/include/linux/snmp.h b/include/linux/snmp.h index 52797714ade7..ebb0c80ffd6e 100644 --- a/include/linux/snmp.h +++ b/include/linux/snmp.h | |||
| @@ -229,6 +229,7 @@ enum | |||
| 229 | LINUX_MIB_TCPBACKLOGDROP, | 229 | LINUX_MIB_TCPBACKLOGDROP, |
| 230 | LINUX_MIB_TCPMINTTLDROP, /* RFC 5082 */ | 230 | LINUX_MIB_TCPMINTTLDROP, /* RFC 5082 */ |
| 231 | LINUX_MIB_TCPDEFERACCEPTDROP, | 231 | LINUX_MIB_TCPDEFERACCEPTDROP, |
| 232 | LINUX_MIB_IPRPFILTER, /* IP Reverse Path Filter (rp_filter) */ | ||
| 232 | __LINUX_MIB_MAX | 233 | __LINUX_MIB_MAX |
| 233 | }; | 234 | }; |
| 234 | 235 | ||
diff --git a/include/linux/socket.h b/include/linux/socket.h index 032a19eb61b1..a2fada9becb6 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h | |||
| @@ -24,6 +24,9 @@ struct __kernel_sockaddr_storage { | |||
| 24 | #include <linux/types.h> /* pid_t */ | 24 | #include <linux/types.h> /* pid_t */ |
| 25 | #include <linux/compiler.h> /* __user */ | 25 | #include <linux/compiler.h> /* __user */ |
| 26 | 26 | ||
| 27 | struct pid; | ||
| 28 | struct cred; | ||
| 29 | |||
| 27 | #define __sockaddr_check_size(size) \ | 30 | #define __sockaddr_check_size(size) \ |
| 28 | BUILD_BUG_ON(((size) > sizeof(struct __kernel_sockaddr_storage))) | 31 | BUILD_BUG_ON(((size) > sizeof(struct __kernel_sockaddr_storage))) |
| 29 | 32 | ||
| @@ -309,6 +312,8 @@ struct ucred { | |||
| 309 | #define IPX_TYPE 1 | 312 | #define IPX_TYPE 1 |
| 310 | 313 | ||
| 311 | #ifdef __KERNEL__ | 314 | #ifdef __KERNEL__ |
| 315 | extern void cred_to_ucred(struct pid *pid, const struct cred *cred, struct ucred *ucred); | ||
| 316 | |||
| 312 | extern int memcpy_fromiovec(unsigned char *kdata, struct iovec *iov, int len); | 317 | extern int memcpy_fromiovec(unsigned char *kdata, struct iovec *iov, int len); |
| 313 | extern int memcpy_fromiovecend(unsigned char *kdata, const struct iovec *iov, | 318 | extern int memcpy_fromiovecend(unsigned char *kdata, const struct iovec *iov, |
| 314 | int offset, int len); | 319 | int offset, int len); |
diff --git a/include/linux/spi/ads7846.h b/include/linux/spi/ads7846.h index b4ae570d3c98..92bd0839d5b4 100644 --- a/include/linux/spi/ads7846.h +++ b/include/linux/spi/ads7846.h | |||
| @@ -48,11 +48,12 @@ struct ads7846_platform_data { | |||
| 48 | * state if get_pendown_state == NULL | 48 | * state if get_pendown_state == NULL |
| 49 | */ | 49 | */ |
| 50 | int (*get_pendown_state)(void); | 50 | int (*get_pendown_state)(void); |
| 51 | int (*filter_init) (struct ads7846_platform_data *pdata, | 51 | int (*filter_init) (const struct ads7846_platform_data *pdata, |
| 52 | void **filter_data); | 52 | void **filter_data); |
| 53 | int (*filter) (void *filter_data, int data_idx, int *val); | 53 | int (*filter) (void *filter_data, int data_idx, int *val); |
| 54 | void (*filter_cleanup)(void *filter_data); | 54 | void (*filter_cleanup)(void *filter_data); |
| 55 | void (*wait_for_sync)(void); | 55 | void (*wait_for_sync)(void); |
| 56 | bool wakeup; | 56 | bool wakeup; |
| 57 | unsigned long irq_flags; | ||
| 57 | }; | 58 | }; |
| 58 | 59 | ||
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h index a2608bff9c78..623b704fdc42 100644 --- a/include/linux/ssb/ssb.h +++ b/include/linux/ssb/ssb.h | |||
| @@ -167,7 +167,7 @@ struct ssb_device { | |||
| 167 | * is an optimization. */ | 167 | * is an optimization. */ |
| 168 | const struct ssb_bus_ops *ops; | 168 | const struct ssb_bus_ops *ops; |
| 169 | 169 | ||
| 170 | struct device *dev; | 170 | struct device *dev, *dma_dev; |
| 171 | 171 | ||
| 172 | struct ssb_bus *bus; | 172 | struct ssb_bus *bus; |
| 173 | struct ssb_device_id id; | 173 | struct ssb_device_id id; |
| @@ -470,14 +470,6 @@ extern u32 ssb_dma_translation(struct ssb_device *dev); | |||
| 470 | #define SSB_DMA_TRANSLATION_MASK 0xC0000000 | 470 | #define SSB_DMA_TRANSLATION_MASK 0xC0000000 |
| 471 | #define SSB_DMA_TRANSLATION_SHIFT 30 | 471 | #define SSB_DMA_TRANSLATION_SHIFT 30 |
| 472 | 472 | ||
| 473 | extern int ssb_dma_set_mask(struct ssb_device *dev, u64 mask); | ||
| 474 | |||
| 475 | extern void * ssb_dma_alloc_consistent(struct ssb_device *dev, size_t size, | ||
| 476 | dma_addr_t *dma_handle, gfp_t gfp_flags); | ||
| 477 | extern void ssb_dma_free_consistent(struct ssb_device *dev, size_t size, | ||
| 478 | void *vaddr, dma_addr_t dma_handle, | ||
| 479 | gfp_t gfp_flags); | ||
| 480 | |||
| 481 | static inline void __cold __ssb_dma_not_implemented(struct ssb_device *dev) | 473 | static inline void __cold __ssb_dma_not_implemented(struct ssb_device *dev) |
| 482 | { | 474 | { |
| 483 | #ifdef CONFIG_SSB_DEBUG | 475 | #ifdef CONFIG_SSB_DEBUG |
| @@ -486,155 +478,6 @@ static inline void __cold __ssb_dma_not_implemented(struct ssb_device *dev) | |||
| 486 | #endif /* DEBUG */ | 478 | #endif /* DEBUG */ |
| 487 | } | 479 | } |
| 488 | 480 | ||
| 489 | static inline int ssb_dma_mapping_error(struct ssb_device *dev, dma_addr_t addr) | ||
| 490 | { | ||
| 491 | switch (dev->bus->bustype) { | ||
| 492 | case SSB_BUSTYPE_PCI: | ||
| 493 | #ifdef CONFIG_SSB_PCIHOST | ||
| 494 | return pci_dma_mapping_error(dev->bus->host_pci, addr); | ||
| 495 | #endif | ||
| 496 | break; | ||
| 497 | case SSB_BUSTYPE_SSB: | ||
| 498 | return dma_mapping_error(dev->dev, addr); | ||
| 499 | default: | ||
| 500 | break; | ||
| 501 | } | ||
| 502 | __ssb_dma_not_implemented(dev); | ||
| 503 | return -ENOSYS; | ||
| 504 | } | ||
| 505 | |||
| 506 | static inline dma_addr_t ssb_dma_map_single(struct ssb_device *dev, void *p, | ||
| 507 | size_t size, enum dma_data_direction dir) | ||
| 508 | { | ||
| 509 | switch (dev->bus->bustype) { | ||
| 510 | case SSB_BUSTYPE_PCI: | ||
| 511 | #ifdef CONFIG_SSB_PCIHOST | ||
| 512 | return pci_map_single(dev->bus->host_pci, p, size, dir); | ||
| 513 | #endif | ||
| 514 | break; | ||
| 515 | case SSB_BUSTYPE_SSB: | ||
| 516 | return dma_map_single(dev->dev, p, size, dir); | ||
| 517 | default: | ||
| 518 | break; | ||
| 519 | } | ||
| 520 | __ssb_dma_not_implemented(dev); | ||
| 521 | return 0; | ||
| 522 | } | ||
| 523 | |||
| 524 | static inline void ssb_dma_unmap_single(struct ssb_device *dev, dma_addr_t dma_addr, | ||
| 525 | size_t size, enum dma_data_direction dir) | ||
| 526 | { | ||
| 527 | switch (dev->bus->bustype) { | ||
| 528 | case SSB_BUSTYPE_PCI: | ||
| 529 | #ifdef CONFIG_SSB_PCIHOST | ||
| 530 | pci_unmap_single(dev->bus->host_pci, dma_addr, size, dir); | ||
| 531 | return; | ||
| 532 | #endif | ||
| 533 | break; | ||
| 534 | case SSB_BUSTYPE_SSB: | ||
| 535 | dma_unmap_single(dev->dev, dma_addr, size, dir); | ||
| 536 | return; | ||
| 537 | default: | ||
| 538 | break; | ||
| 539 | } | ||
| 540 | __ssb_dma_not_implemented(dev); | ||
| 541 | } | ||
| 542 | |||
| 543 | static inline void ssb_dma_sync_single_for_cpu(struct ssb_device *dev, | ||
| 544 | dma_addr_t dma_addr, | ||
| 545 | size_t size, | ||
| 546 | enum dma_data_direction dir) | ||
| 547 | { | ||
| 548 | switch (dev->bus->bustype) { | ||
| 549 | case SSB_BUSTYPE_PCI: | ||
| 550 | #ifdef CONFIG_SSB_PCIHOST | ||
| 551 | pci_dma_sync_single_for_cpu(dev->bus->host_pci, dma_addr, | ||
| 552 | size, dir); | ||
| 553 | return; | ||
| 554 | #endif | ||
| 555 | break; | ||
| 556 | case SSB_BUSTYPE_SSB: | ||
| 557 | dma_sync_single_for_cpu(dev->dev, dma_addr, size, dir); | ||
| 558 | return; | ||
| 559 | default: | ||
| 560 | break; | ||
| 561 | } | ||
| 562 | __ssb_dma_not_implemented(dev); | ||
| 563 | } | ||
| 564 | |||
| 565 | static inline void ssb_dma_sync_single_for_device(struct ssb_device *dev, | ||
| 566 | dma_addr_t dma_addr, | ||
| 567 | size_t size, | ||
| 568 | enum dma_data_direction dir) | ||
| 569 | { | ||
| 570 | switch (dev->bus->bustype) { | ||
| 571 | case SSB_BUSTYPE_PCI: | ||
| 572 | #ifdef CONFIG_SSB_PCIHOST | ||
| 573 | pci_dma_sync_single_for_device(dev->bus->host_pci, dma_addr, | ||
| 574 | size, dir); | ||
| 575 | return; | ||
| 576 | #endif | ||
| 577 | break; | ||
| 578 | case SSB_BUSTYPE_SSB: | ||
| 579 | dma_sync_single_for_device(dev->dev, dma_addr, size, dir); | ||
| 580 | return; | ||
| 581 | default: | ||
| 582 | break; | ||
| 583 | } | ||
| 584 | __ssb_dma_not_implemented(dev); | ||
| 585 | } | ||
| 586 | |||
| 587 | static inline void ssb_dma_sync_single_range_for_cpu(struct ssb_device *dev, | ||
| 588 | dma_addr_t dma_addr, | ||
| 589 | unsigned long offset, | ||
| 590 | size_t size, | ||
| 591 | enum dma_data_direction dir) | ||
| 592 | { | ||
| 593 | switch (dev->bus->bustype) { | ||
| 594 | case SSB_BUSTYPE_PCI: | ||
| 595 | #ifdef CONFIG_SSB_PCIHOST | ||
| 596 | /* Just sync everything. That's all the PCI API can do. */ | ||
| 597 | pci_dma_sync_single_for_cpu(dev->bus->host_pci, dma_addr, | ||
| 598 | offset + size, dir); | ||
| 599 | return; | ||
| 600 | #endif | ||
| 601 | break; | ||
| 602 | case SSB_BUSTYPE_SSB: | ||
| 603 | dma_sync_single_range_for_cpu(dev->dev, dma_addr, offset, | ||
| 604 | size, dir); | ||
| 605 | return; | ||
| 606 | default: | ||
| 607 | break; | ||
| 608 | } | ||
| 609 | __ssb_dma_not_implemented(dev); | ||
| 610 | } | ||
| 611 | |||
| 612 | static inline void ssb_dma_sync_single_range_for_device(struct ssb_device *dev, | ||
| 613 | dma_addr_t dma_addr, | ||
| 614 | unsigned long offset, | ||
| 615 | size_t size, | ||
| 616 | enum dma_data_direction dir) | ||
| 617 | { | ||
| 618 | switch (dev->bus->bustype) { | ||
| 619 | case SSB_BUSTYPE_PCI: | ||
| 620 | #ifdef CONFIG_SSB_PCIHOST | ||
| 621 | /* Just sync everything. That's all the PCI API can do. */ | ||
| 622 | pci_dma_sync_single_for_device(dev->bus->host_pci, dma_addr, | ||
| 623 | offset + size, dir); | ||
| 624 | return; | ||
| 625 | #endif | ||
| 626 | break; | ||
| 627 | case SSB_BUSTYPE_SSB: | ||
| 628 | dma_sync_single_range_for_device(dev->dev, dma_addr, offset, | ||
| 629 | size, dir); | ||
| 630 | return; | ||
| 631 | default: | ||
| 632 | break; | ||
| 633 | } | ||
| 634 | __ssb_dma_not_implemented(dev); | ||
| 635 | } | ||
| 636 | |||
| 637 | |||
| 638 | #ifdef CONFIG_SSB_PCIHOST | 481 | #ifdef CONFIG_SSB_PCIHOST |
| 639 | /* PCI-host wrapper driver */ | 482 | /* PCI-host wrapper driver */ |
| 640 | extern int ssb_pcihost_register(struct pci_driver *driver); | 483 | extern int ssb_pcihost_register(struct pci_driver *driver); |
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h index 87d7ec0bf779..5bbc447175dc 100644 --- a/include/linux/sunrpc/auth.h +++ b/include/linux/sunrpc/auth.h | |||
| @@ -61,13 +61,7 @@ struct rpc_cred { | |||
| 61 | /* | 61 | /* |
| 62 | * Client authentication handle | 62 | * Client authentication handle |
| 63 | */ | 63 | */ |
| 64 | #define RPC_CREDCACHE_HASHBITS 4 | 64 | struct rpc_cred_cache; |
| 65 | #define RPC_CREDCACHE_NR (1 << RPC_CREDCACHE_HASHBITS) | ||
| 66 | struct rpc_cred_cache { | ||
| 67 | struct hlist_head hashtable[RPC_CREDCACHE_NR]; | ||
| 68 | spinlock_t lock; | ||
| 69 | }; | ||
| 70 | |||
| 71 | struct rpc_authops; | 65 | struct rpc_authops; |
| 72 | struct rpc_auth { | 66 | struct rpc_auth { |
| 73 | unsigned int au_cslack; /* call cred size estimate */ | 67 | unsigned int au_cslack; /* call cred size estimate */ |
| @@ -112,7 +106,7 @@ struct rpc_credops { | |||
| 112 | void (*crdestroy)(struct rpc_cred *); | 106 | void (*crdestroy)(struct rpc_cred *); |
| 113 | 107 | ||
| 114 | int (*crmatch)(struct auth_cred *, struct rpc_cred *, int); | 108 | int (*crmatch)(struct auth_cred *, struct rpc_cred *, int); |
| 115 | void (*crbind)(struct rpc_task *, struct rpc_cred *, int); | 109 | struct rpc_cred * (*crbind)(struct rpc_task *, struct rpc_cred *, int); |
| 116 | __be32 * (*crmarshal)(struct rpc_task *, __be32 *); | 110 | __be32 * (*crmarshal)(struct rpc_task *, __be32 *); |
| 117 | int (*crrefresh)(struct rpc_task *); | 111 | int (*crrefresh)(struct rpc_task *); |
| 118 | __be32 * (*crvalidate)(struct rpc_task *, __be32 *); | 112 | __be32 * (*crvalidate)(struct rpc_task *, __be32 *); |
| @@ -125,11 +119,12 @@ struct rpc_credops { | |||
| 125 | extern const struct rpc_authops authunix_ops; | 119 | extern const struct rpc_authops authunix_ops; |
| 126 | extern const struct rpc_authops authnull_ops; | 120 | extern const struct rpc_authops authnull_ops; |
| 127 | 121 | ||
| 128 | void __init rpc_init_authunix(void); | 122 | int __init rpc_init_authunix(void); |
| 129 | void __init rpc_init_generic_auth(void); | 123 | int __init rpc_init_generic_auth(void); |
| 130 | void __init rpcauth_init_module(void); | 124 | int __init rpcauth_init_module(void); |
| 131 | void __exit rpcauth_remove_module(void); | 125 | void __exit rpcauth_remove_module(void); |
| 132 | void __exit rpc_destroy_generic_auth(void); | 126 | void __exit rpc_destroy_generic_auth(void); |
| 127 | void rpc_destroy_authunix(void); | ||
| 133 | 128 | ||
| 134 | struct rpc_cred * rpc_lookup_cred(void); | 129 | struct rpc_cred * rpc_lookup_cred(void); |
| 135 | struct rpc_cred * rpc_lookup_machine_cred(void); | 130 | struct rpc_cred * rpc_lookup_machine_cred(void); |
| @@ -140,10 +135,8 @@ void rpcauth_release(struct rpc_auth *); | |||
| 140 | struct rpc_cred * rpcauth_lookup_credcache(struct rpc_auth *, struct auth_cred *, int); | 135 | struct rpc_cred * rpcauth_lookup_credcache(struct rpc_auth *, struct auth_cred *, int); |
| 141 | void rpcauth_init_cred(struct rpc_cred *, const struct auth_cred *, struct rpc_auth *, const struct rpc_credops *); | 136 | void rpcauth_init_cred(struct rpc_cred *, const struct auth_cred *, struct rpc_auth *, const struct rpc_credops *); |
| 142 | struct rpc_cred * rpcauth_lookupcred(struct rpc_auth *, int); | 137 | struct rpc_cred * rpcauth_lookupcred(struct rpc_auth *, int); |
| 143 | void rpcauth_bindcred(struct rpc_task *, struct rpc_cred *, int); | 138 | struct rpc_cred * rpcauth_generic_bind_cred(struct rpc_task *, struct rpc_cred *, int); |
| 144 | void rpcauth_generic_bind_cred(struct rpc_task *, struct rpc_cred *, int); | ||
| 145 | void put_rpccred(struct rpc_cred *); | 139 | void put_rpccred(struct rpc_cred *); |
| 146 | void rpcauth_unbindcred(struct rpc_task *); | ||
| 147 | __be32 * rpcauth_marshcred(struct rpc_task *, __be32 *); | 140 | __be32 * rpcauth_marshcred(struct rpc_task *, __be32 *); |
| 148 | __be32 * rpcauth_checkverf(struct rpc_task *, __be32 *); | 141 | __be32 * rpcauth_checkverf(struct rpc_task *, __be32 *); |
| 149 | int rpcauth_wrap_req(struct rpc_task *task, kxdrproc_t encode, void *rqstp, __be32 *data, void *obj); | 142 | int rpcauth_wrap_req(struct rpc_task *task, kxdrproc_t encode, void *rqstp, __be32 *data, void *obj); |
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h index 6f52b4d7c447..7bf3e84b92f4 100644 --- a/include/linux/sunrpc/cache.h +++ b/include/linux/sunrpc/cache.h | |||
| @@ -192,6 +192,7 @@ extern int cache_check(struct cache_detail *detail, | |||
| 192 | extern void cache_flush(void); | 192 | extern void cache_flush(void); |
| 193 | extern void cache_purge(struct cache_detail *detail); | 193 | extern void cache_purge(struct cache_detail *detail); |
| 194 | #define NEVER (0x7FFFFFFF) | 194 | #define NEVER (0x7FFFFFFF) |
| 195 | extern void __init cache_initialize(void); | ||
| 195 | extern int cache_register(struct cache_detail *cd); | 196 | extern int cache_register(struct cache_detail *cd); |
| 196 | extern void cache_unregister(struct cache_detail *cd); | 197 | extern void cache_unregister(struct cache_detail *cd); |
| 197 | 198 | ||
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index 8ed9642a5a76..569dc722a600 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h | |||
| @@ -131,6 +131,7 @@ struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *, | |||
| 131 | struct rpc_clnt *rpc_clone_client(struct rpc_clnt *); | 131 | struct rpc_clnt *rpc_clone_client(struct rpc_clnt *); |
| 132 | void rpc_shutdown_client(struct rpc_clnt *); | 132 | void rpc_shutdown_client(struct rpc_clnt *); |
| 133 | void rpc_release_client(struct rpc_clnt *); | 133 | void rpc_release_client(struct rpc_clnt *); |
| 134 | void rpc_task_release_client(struct rpc_task *); | ||
| 134 | 135 | ||
| 135 | int rpcb_register(u32, u32, int, unsigned short); | 136 | int rpcb_register(u32, u32, int, unsigned short); |
| 136 | int rpcb_v4_register(const u32 program, const u32 version, | 137 | int rpcb_v4_register(const u32 program, const u32 version, |
| @@ -148,8 +149,8 @@ int rpc_call_sync(struct rpc_clnt *clnt, | |||
| 148 | const struct rpc_message *msg, int flags); | 149 | const struct rpc_message *msg, int flags); |
| 149 | struct rpc_task *rpc_call_null(struct rpc_clnt *clnt, struct rpc_cred *cred, | 150 | struct rpc_task *rpc_call_null(struct rpc_clnt *clnt, struct rpc_cred *cred, |
| 150 | int flags); | 151 | int flags); |
| 151 | void rpc_restart_call_prepare(struct rpc_task *); | 152 | int rpc_restart_call_prepare(struct rpc_task *); |
| 152 | void rpc_restart_call(struct rpc_task *); | 153 | int rpc_restart_call(struct rpc_task *); |
| 153 | void rpc_setbufsize(struct rpc_clnt *, unsigned int, unsigned int); | 154 | void rpc_setbufsize(struct rpc_clnt *, unsigned int, unsigned int); |
| 154 | size_t rpc_max_payload(struct rpc_clnt *); | 155 | size_t rpc_max_payload(struct rpc_clnt *); |
| 155 | void rpc_force_rebind(struct rpc_clnt *); | 156 | void rpc_force_rebind(struct rpc_clnt *); |
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index 7be4f3a6d246..88513fd8e208 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h | |||
| @@ -213,6 +213,7 @@ struct rpc_task *rpc_run_bc_task(struct rpc_rqst *req, | |||
| 213 | const struct rpc_call_ops *ops); | 213 | const struct rpc_call_ops *ops); |
| 214 | void rpc_put_task(struct rpc_task *); | 214 | void rpc_put_task(struct rpc_task *); |
| 215 | void rpc_exit_task(struct rpc_task *); | 215 | void rpc_exit_task(struct rpc_task *); |
| 216 | void rpc_exit(struct rpc_task *, int); | ||
| 216 | void rpc_release_calldata(const struct rpc_call_ops *, void *); | 217 | void rpc_release_calldata(const struct rpc_call_ops *, void *); |
| 217 | void rpc_killall_tasks(struct rpc_clnt *); | 218 | void rpc_killall_tasks(struct rpc_clnt *); |
| 218 | void rpc_execute(struct rpc_task *); | 219 | void rpc_execute(struct rpc_task *); |
| @@ -241,12 +242,6 @@ void rpc_destroy_mempool(void); | |||
| 241 | extern struct workqueue_struct *rpciod_workqueue; | 242 | extern struct workqueue_struct *rpciod_workqueue; |
| 242 | void rpc_prepare_task(struct rpc_task *task); | 243 | void rpc_prepare_task(struct rpc_task *task); |
| 243 | 244 | ||
| 244 | static inline void rpc_exit(struct rpc_task *task, int status) | ||
| 245 | { | ||
| 246 | task->tk_status = status; | ||
| 247 | task->tk_action = rpc_exit_task; | ||
| 248 | } | ||
| 249 | |||
| 250 | static inline int rpc_wait_for_completion_task(struct rpc_task *task) | 245 | static inline int rpc_wait_for_completion_task(struct rpc_task *task) |
| 251 | { | 246 | { |
| 252 | return __rpc_wait_for_completion_task(task, NULL); | 247 | return __rpc_wait_for_completion_task(task, NULL); |
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index b51470302399..ff5a77b28c50 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h | |||
| @@ -64,6 +64,7 @@ struct rpc_rqst { | |||
| 64 | * This is the private part | 64 | * This is the private part |
| 65 | */ | 65 | */ |
| 66 | struct rpc_task * rq_task; /* RPC task data */ | 66 | struct rpc_task * rq_task; /* RPC task data */ |
| 67 | struct rpc_cred * rq_cred; /* Bound cred */ | ||
| 67 | __be32 rq_xid; /* request XID */ | 68 | __be32 rq_xid; /* request XID */ |
| 68 | int rq_cong; /* has incremented xprt->cong */ | 69 | int rq_cong; /* has incremented xprt->cong */ |
| 69 | u32 rq_seqno; /* gss seq no. used on req. */ | 70 | u32 rq_seqno; /* gss seq no. used on req. */ |
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index bc7d6bb4cd8e..4af270ec2204 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h | |||
| @@ -61,14 +61,15 @@ typedef int __bitwise suspend_state_t; | |||
| 61 | * before device drivers' late suspend callbacks are executed. It returns | 61 | * before device drivers' late suspend callbacks are executed. It returns |
| 62 | * 0 on success or a negative error code otherwise, in which case the | 62 | * 0 on success or a negative error code otherwise, in which case the |
| 63 | * system cannot enter the desired sleep state (@prepare_late(), @enter(), | 63 | * system cannot enter the desired sleep state (@prepare_late(), @enter(), |
| 64 | * @wake(), and @finish() will not be called in that case). | 64 | * and @wake() will not be called in that case). |
| 65 | * | 65 | * |
| 66 | * @prepare_late: Finish preparing the platform for entering the system sleep | 66 | * @prepare_late: Finish preparing the platform for entering the system sleep |
| 67 | * state indicated by @begin(). | 67 | * state indicated by @begin(). |
| 68 | * @prepare_late is called before disabling nonboot CPUs and after | 68 | * @prepare_late is called before disabling nonboot CPUs and after |
| 69 | * device drivers' late suspend callbacks have been executed. It returns | 69 | * device drivers' late suspend callbacks have been executed. It returns |
| 70 | * 0 on success or a negative error code otherwise, in which case the | 70 | * 0 on success or a negative error code otherwise, in which case the |
| 71 | * system cannot enter the desired sleep state (@enter() and @wake()). | 71 | * system cannot enter the desired sleep state (@enter() will not be |
| 72 | * executed). | ||
| 72 | * | 73 | * |
| 73 | * @enter: Enter the system sleep state indicated by @begin() or represented by | 74 | * @enter: Enter the system sleep state indicated by @begin() or represented by |
| 74 | * the argument if @begin() is not implemented. | 75 | * the argument if @begin() is not implemented. |
| @@ -81,14 +82,15 @@ typedef int __bitwise suspend_state_t; | |||
| 81 | * resume callbacks are executed. | 82 | * resume callbacks are executed. |
| 82 | * This callback is optional, but should be implemented by the platforms | 83 | * This callback is optional, but should be implemented by the platforms |
| 83 | * that implement @prepare_late(). If implemented, it is always called | 84 | * that implement @prepare_late(). If implemented, it is always called |
| 84 | * after @enter(), even if @enter() fails. | 85 | * after @prepare_late and @enter(), even if one of them fails. |
| 85 | * | 86 | * |
| 86 | * @finish: Finish wake-up of the platform. | 87 | * @finish: Finish wake-up of the platform. |
| 87 | * @finish is called right prior to calling device drivers' regular suspend | 88 | * @finish is called right prior to calling device drivers' regular suspend |
| 88 | * callbacks. | 89 | * callbacks. |
| 89 | * This callback is optional, but should be implemented by the platforms | 90 | * This callback is optional, but should be implemented by the platforms |
| 90 | * that implement @prepare(). If implemented, it is always called after | 91 | * that implement @prepare(). If implemented, it is always called after |
| 91 | * @enter() and @wake(), if implemented, even if any of them fails. | 92 | * @enter() and @wake(), even if any of them fails. It is executed after |
| 93 | * a failing @prepare. | ||
| 92 | * | 94 | * |
| 93 | * @end: Called by the PM core right after resuming devices, to indicate to | 95 | * @end: Called by the PM core right after resuming devices, to indicate to |
| 94 | * the platform that the system has returned to the working state or | 96 | * the platform that the system has returned to the working state or |
| @@ -286,6 +288,13 @@ extern int unregister_pm_notifier(struct notifier_block *nb); | |||
| 286 | { .notifier_call = fn, .priority = pri }; \ | 288 | { .notifier_call = fn, .priority = pri }; \ |
| 287 | register_pm_notifier(&fn##_nb); \ | 289 | register_pm_notifier(&fn##_nb); \ |
| 288 | } | 290 | } |
| 291 | |||
| 292 | /* drivers/base/power/wakeup.c */ | ||
| 293 | extern bool events_check_enabled; | ||
| 294 | |||
| 295 | extern bool pm_check_wakeup_events(void); | ||
| 296 | extern bool pm_get_wakeup_count(unsigned long *count); | ||
| 297 | extern bool pm_save_wakeup_count(unsigned long count); | ||
| 289 | #else /* !CONFIG_PM_SLEEP */ | 298 | #else /* !CONFIG_PM_SLEEP */ |
| 290 | 299 | ||
| 291 | static inline int register_pm_notifier(struct notifier_block *nb) | 300 | static inline int register_pm_notifier(struct notifier_block *nb) |
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h index 81a4e213c6cf..8c0e349f4a6c 100644 --- a/include/linux/swiotlb.h +++ b/include/linux/swiotlb.h | |||
| @@ -23,6 +23,29 @@ extern int swiotlb_force; | |||
| 23 | #define IO_TLB_SHIFT 11 | 23 | #define IO_TLB_SHIFT 11 |
| 24 | 24 | ||
| 25 | extern void swiotlb_init(int verbose); | 25 | extern void swiotlb_init(int verbose); |
| 26 | extern void swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int verbose); | ||
| 27 | |||
| 28 | /* | ||
| 29 | * Enumeration for sync targets | ||
| 30 | */ | ||
| 31 | enum dma_sync_target { | ||
| 32 | SYNC_FOR_CPU = 0, | ||
| 33 | SYNC_FOR_DEVICE = 1, | ||
| 34 | }; | ||
| 35 | extern void *swiotlb_tbl_map_single(struct device *hwdev, dma_addr_t tbl_dma_addr, | ||
| 36 | phys_addr_t phys, size_t size, | ||
| 37 | enum dma_data_direction dir); | ||
| 38 | |||
| 39 | extern void swiotlb_tbl_unmap_single(struct device *hwdev, char *dma_addr, | ||
| 40 | size_t size, enum dma_data_direction dir); | ||
| 41 | |||
| 42 | extern void swiotlb_tbl_sync_single(struct device *hwdev, char *dma_addr, | ||
| 43 | size_t size, enum dma_data_direction dir, | ||
| 44 | enum dma_sync_target target); | ||
| 45 | |||
| 46 | /* Accessory functions. */ | ||
| 47 | extern void swiotlb_bounce(phys_addr_t phys, char *dma_addr, size_t size, | ||
| 48 | enum dma_data_direction dir); | ||
| 26 | 49 | ||
| 27 | extern void | 50 | extern void |
| 28 | *swiotlb_alloc_coherent(struct device *hwdev, size_t size, | 51 | *swiotlb_alloc_coherent(struct device *hwdev, size_t size, |
| @@ -42,11 +65,11 @@ extern void swiotlb_unmap_page(struct device *hwdev, dma_addr_t dev_addr, | |||
| 42 | 65 | ||
| 43 | extern int | 66 | extern int |
| 44 | swiotlb_map_sg(struct device *hwdev, struct scatterlist *sg, int nents, | 67 | swiotlb_map_sg(struct device *hwdev, struct scatterlist *sg, int nents, |
| 45 | int direction); | 68 | enum dma_data_direction dir); |
| 46 | 69 | ||
| 47 | extern void | 70 | extern void |
| 48 | swiotlb_unmap_sg(struct device *hwdev, struct scatterlist *sg, int nents, | 71 | swiotlb_unmap_sg(struct device *hwdev, struct scatterlist *sg, int nents, |
| 49 | int direction); | 72 | enum dma_data_direction dir); |
| 50 | 73 | ||
| 51 | extern int | 74 | extern int |
| 52 | swiotlb_map_sg_attrs(struct device *hwdev, struct scatterlist *sgl, int nelems, | 75 | swiotlb_map_sg_attrs(struct device *hwdev, struct scatterlist *sgl, int nelems, |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 13ebb5413a79..a6bfd1367d2a 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
| @@ -167,7 +167,6 @@ extern struct trace_event_functions exit_syscall_print_funcs; | |||
| 167 | .enter_event = &event_enter_##sname, \ | 167 | .enter_event = &event_enter_##sname, \ |
| 168 | .exit_event = &event_exit_##sname, \ | 168 | .exit_event = &event_exit_##sname, \ |
| 169 | .enter_fields = LIST_HEAD_INIT(__syscall_meta_##sname.enter_fields), \ | 169 | .enter_fields = LIST_HEAD_INIT(__syscall_meta_##sname.enter_fields), \ |
| 170 | .exit_fields = LIST_HEAD_INIT(__syscall_meta_##sname.exit_fields), \ | ||
| 171 | }; | 170 | }; |
| 172 | 171 | ||
| 173 | #define SYSCALL_DEFINE0(sname) \ | 172 | #define SYSCALL_DEFINE0(sname) \ |
| @@ -182,7 +181,6 @@ extern struct trace_event_functions exit_syscall_print_funcs; | |||
| 182 | .enter_event = &event_enter__##sname, \ | 181 | .enter_event = &event_enter__##sname, \ |
| 183 | .exit_event = &event_exit__##sname, \ | 182 | .exit_event = &event_exit__##sname, \ |
| 184 | .enter_fields = LIST_HEAD_INIT(__syscall_meta__##sname.enter_fields), \ | 183 | .enter_fields = LIST_HEAD_INIT(__syscall_meta__##sname.enter_fields), \ |
| 185 | .exit_fields = LIST_HEAD_INIT(__syscall_meta__##sname.exit_fields), \ | ||
| 186 | }; \ | 184 | }; \ |
| 187 | asmlinkage long sys_##sname(void) | 185 | asmlinkage long sys_##sname(void) |
| 188 | #else | 186 | #else |
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index f2694eb4dd3d..3c92121ba9af 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h | |||
| @@ -22,14 +22,8 @@ struct kobject; | |||
| 22 | struct module; | 22 | struct module; |
| 23 | enum kobj_ns_type; | 23 | enum kobj_ns_type; |
| 24 | 24 | ||
| 25 | /* FIXME | ||
| 26 | * The *owner field is no longer used. | ||
| 27 | * x86 tree has been cleaned up. The owner | ||
| 28 | * attribute is still left for other arches. | ||
| 29 | */ | ||
| 30 | struct attribute { | 25 | struct attribute { |
| 31 | const char *name; | 26 | const char *name; |
| 32 | struct module *owner; | ||
| 33 | mode_t mode; | 27 | mode_t mode; |
| 34 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 28 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
| 35 | struct lock_class_key *key; | 29 | struct lock_class_key *key; |
| @@ -136,8 +130,8 @@ int __must_check sysfs_create_file(struct kobject *kobj, | |||
| 136 | const struct attribute *attr); | 130 | const struct attribute *attr); |
| 137 | int __must_check sysfs_create_files(struct kobject *kobj, | 131 | int __must_check sysfs_create_files(struct kobject *kobj, |
| 138 | const struct attribute **attr); | 132 | const struct attribute **attr); |
| 139 | int __must_check sysfs_chmod_file(struct kobject *kobj, struct attribute *attr, | 133 | int __must_check sysfs_chmod_file(struct kobject *kobj, |
| 140 | mode_t mode); | 134 | const struct attribute *attr, mode_t mode); |
| 141 | void sysfs_remove_file(struct kobject *kobj, const struct attribute *attr); | 135 | void sysfs_remove_file(struct kobject *kobj, const struct attribute *attr); |
| 142 | void sysfs_remove_files(struct kobject *kobj, const struct attribute **attr); | 136 | void sysfs_remove_files(struct kobject *kobj, const struct attribute **attr); |
| 143 | 137 | ||
| @@ -225,7 +219,7 @@ static inline int sysfs_create_files(struct kobject *kobj, | |||
| 225 | } | 219 | } |
| 226 | 220 | ||
| 227 | static inline int sysfs_chmod_file(struct kobject *kobj, | 221 | static inline int sysfs_chmod_file(struct kobject *kobj, |
| 228 | struct attribute *attr, mode_t mode) | 222 | const struct attribute *attr, mode_t mode) |
| 229 | { | 223 | { |
| 230 | return 0; | 224 | return 0; |
| 231 | } | 225 | } |
diff --git a/include/linux/sysrq.h b/include/linux/sysrq.h index 4496322e28dd..609e8ca5f534 100644 --- a/include/linux/sysrq.h +++ b/include/linux/sysrq.h | |||
| @@ -45,6 +45,7 @@ struct sysrq_key_op { | |||
| 45 | */ | 45 | */ |
| 46 | 46 | ||
| 47 | void handle_sysrq(int key, struct tty_struct *tty); | 47 | void handle_sysrq(int key, struct tty_struct *tty); |
| 48 | void __handle_sysrq(int key, struct tty_struct *tty, int check_mask); | ||
| 48 | int register_sysrq_key(int key, struct sysrq_key_op *op); | 49 | int register_sysrq_key(int key, struct sysrq_key_op *op); |
| 49 | int unregister_sysrq_key(int key, struct sysrq_key_op *op); | 50 | int unregister_sysrq_key(int key, struct sysrq_key_op *op); |
| 50 | struct sysrq_key_op *__sysrq_get_key_op(int key); | 51 | struct sysrq_key_op *__sysrq_get_key_op(int key); |
diff --git a/include/linux/time.h b/include/linux/time.h index ea3559f0b3f2..cb34e35fabac 100644 --- a/include/linux/time.h +++ b/include/linux/time.h | |||
| @@ -76,9 +76,25 @@ extern unsigned long mktime(const unsigned int year, const unsigned int mon, | |||
| 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, s64 nsec); | 78 | extern void set_normalized_timespec(struct timespec *ts, time_t sec, s64 nsec); |
| 79 | |||
| 80 | /* | ||
| 81 | * timespec_add_safe assumes both values are positive and checks | ||
| 82 | * for overflow. It will return TIME_T_MAX if the reutrn would be | ||
| 83 | * smaller then either of the arguments. | ||
| 84 | */ | ||
| 79 | extern struct timespec timespec_add_safe(const struct timespec lhs, | 85 | extern struct timespec timespec_add_safe(const struct timespec lhs, |
| 80 | const struct timespec rhs); | 86 | const struct timespec rhs); |
| 81 | 87 | ||
| 88 | |||
| 89 | static inline struct timespec timespec_add(struct timespec lhs, | ||
| 90 | struct timespec rhs) | ||
| 91 | { | ||
| 92 | struct timespec ts_delta; | ||
| 93 | set_normalized_timespec(&ts_delta, lhs.tv_sec + rhs.tv_sec, | ||
| 94 | lhs.tv_nsec + rhs.tv_nsec); | ||
| 95 | return ts_delta; | ||
| 96 | } | ||
| 97 | |||
| 82 | /* | 98 | /* |
| 83 | * sub = lhs - rhs, in normalized form | 99 | * sub = lhs - rhs, in normalized form |
| 84 | */ | 100 | */ |
| @@ -97,8 +113,6 @@ static inline struct timespec timespec_sub(struct timespec lhs, | |||
| 97 | #define timespec_valid(ts) \ | 113 | #define timespec_valid(ts) \ |
| 98 | (((ts)->tv_sec >= 0) && (((unsigned long) (ts)->tv_nsec) < NSEC_PER_SEC)) | 114 | (((ts)->tv_sec >= 0) && (((unsigned long) (ts)->tv_nsec) < NSEC_PER_SEC)) |
| 99 | 115 | ||
| 100 | extern struct timespec xtime; | ||
| 101 | extern struct timespec wall_to_monotonic; | ||
| 102 | extern seqlock_t xtime_lock; | 116 | extern seqlock_t xtime_lock; |
| 103 | 117 | ||
| 104 | extern void read_persistent_clock(struct timespec *ts); | 118 | extern void read_persistent_clock(struct timespec *ts); |
| @@ -110,7 +124,8 @@ extern int timekeeping_suspended; | |||
| 110 | 124 | ||
| 111 | unsigned long get_seconds(void); | 125 | unsigned long get_seconds(void); |
| 112 | struct timespec current_kernel_time(void); | 126 | struct timespec current_kernel_time(void); |
| 113 | struct timespec __current_kernel_time(void); /* does not hold xtime_lock */ | 127 | struct timespec __current_kernel_time(void); /* does not take xtime_lock */ |
| 128 | struct timespec __get_wall_to_monotonic(void); /* does not take xtime_lock */ | ||
| 114 | struct timespec get_monotonic_coarse(void); | 129 | struct timespec get_monotonic_coarse(void); |
| 115 | 130 | ||
| 116 | #define CURRENT_TIME (current_kernel_time()) | 131 | #define CURRENT_TIME (current_kernel_time()) |
diff --git a/include/linux/timer.h b/include/linux/timer.h index ea965b857a50..38cf093ef62c 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h | |||
| @@ -100,6 +100,13 @@ void init_timer_deferrable_key(struct timer_list *timer, | |||
| 100 | setup_timer_on_stack_key((timer), #timer, &__key, \ | 100 | setup_timer_on_stack_key((timer), #timer, &__key, \ |
| 101 | (fn), (data)); \ | 101 | (fn), (data)); \ |
| 102 | } while (0) | 102 | } while (0) |
| 103 | #define setup_deferrable_timer_on_stack(timer, fn, data) \ | ||
| 104 | do { \ | ||
| 105 | static struct lock_class_key __key; \ | ||
| 106 | setup_deferrable_timer_on_stack_key((timer), #timer, \ | ||
| 107 | &__key, (fn), \ | ||
| 108 | (data)); \ | ||
| 109 | } while (0) | ||
| 103 | #else | 110 | #else |
| 104 | #define init_timer(timer)\ | 111 | #define init_timer(timer)\ |
| 105 | init_timer_key((timer), NULL, NULL) | 112 | init_timer_key((timer), NULL, NULL) |
| @@ -111,6 +118,8 @@ void init_timer_deferrable_key(struct timer_list *timer, | |||
| 111 | setup_timer_key((timer), NULL, NULL, (fn), (data)) | 118 | setup_timer_key((timer), NULL, NULL, (fn), (data)) |
| 112 | #define setup_timer_on_stack(timer, fn, data)\ | 119 | #define setup_timer_on_stack(timer, fn, data)\ |
| 113 | setup_timer_on_stack_key((timer), NULL, NULL, (fn), (data)) | 120 | setup_timer_on_stack_key((timer), NULL, NULL, (fn), (data)) |
| 121 | #define setup_deferrable_timer_on_stack(timer, fn, data)\ | ||
| 122 | setup_deferrable_timer_on_stack_key((timer), NULL, NULL, (fn), (data)) | ||
| 114 | #endif | 123 | #endif |
| 115 | 124 | ||
| 116 | #ifdef CONFIG_DEBUG_OBJECTS_TIMERS | 125 | #ifdef CONFIG_DEBUG_OBJECTS_TIMERS |
| @@ -150,6 +159,12 @@ static inline void setup_timer_on_stack_key(struct timer_list *timer, | |||
| 150 | init_timer_on_stack_key(timer, name, key); | 159 | init_timer_on_stack_key(timer, name, key); |
| 151 | } | 160 | } |
| 152 | 161 | ||
| 162 | extern void setup_deferrable_timer_on_stack_key(struct timer_list *timer, | ||
| 163 | const char *name, | ||
| 164 | struct lock_class_key *key, | ||
| 165 | void (*function)(unsigned long), | ||
| 166 | unsigned long data); | ||
| 167 | |||
| 153 | /** | 168 | /** |
| 154 | * timer_pending - is a timer pending? | 169 | * timer_pending - is a timer pending? |
| 155 | * @timer: the timer in question | 170 | * @timer: the timer in question |
diff --git a/include/linux/topology.h b/include/linux/topology.h index c44df50a05ab..b572e432d2f3 100644 --- a/include/linux/topology.h +++ b/include/linux/topology.h | |||
| @@ -103,6 +103,7 @@ int arch_update_cpu_topology(void); | |||
| 103 | | 1*SD_SHARE_PKG_RESOURCES \ | 103 | | 1*SD_SHARE_PKG_RESOURCES \ |
| 104 | | 0*SD_SERIALIZE \ | 104 | | 0*SD_SERIALIZE \ |
| 105 | | 0*SD_PREFER_SIBLING \ | 105 | | 0*SD_PREFER_SIBLING \ |
| 106 | | arch_sd_sibling_asym_packing() \ | ||
| 106 | , \ | 107 | , \ |
| 107 | .last_balance = jiffies, \ | 108 | .last_balance = jiffies, \ |
| 108 | .balance_interval = 1, \ | 109 | .balance_interval = 1, \ |
diff --git a/include/linux/tty.h b/include/linux/tty.h index 931078b73226..7802a243ee13 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
| @@ -552,6 +552,9 @@ static inline void tty_audit_push_task(struct task_struct *tsk, | |||
| 552 | } | 552 | } |
| 553 | #endif | 553 | #endif |
| 554 | 554 | ||
| 555 | /* tty_io.c */ | ||
| 556 | extern int __init tty_init(void); | ||
| 557 | |||
| 555 | /* tty_ioctl.c */ | 558 | /* tty_ioctl.c */ |
| 556 | extern int n_tty_ioctl_helper(struct tty_struct *tty, struct file *file, | 559 | extern int n_tty_ioctl_helper(struct tty_struct *tty, struct file *file, |
| 557 | unsigned int cmd, unsigned long arg); | 560 | unsigned int cmd, unsigned long arg); |
diff --git a/include/linux/types.h b/include/linux/types.h index 23d237a075e2..01a082f56ef4 100644 --- a/include/linux/types.h +++ b/include/linux/types.h | |||
| @@ -8,7 +8,10 @@ | |||
| 8 | 8 | ||
| 9 | #define DECLARE_BITMAP(name,bits) \ | 9 | #define DECLARE_BITMAP(name,bits) \ |
| 10 | unsigned long name[BITS_TO_LONGS(bits)] | 10 | unsigned long name[BITS_TO_LONGS(bits)] |
| 11 | 11 | #else | |
| 12 | #ifndef __EXPORTED_HEADERS__ | ||
| 13 | #warning "Attempt to use kernel headers from user space, see http://kernelnewbies.org/KernelHeaders" | ||
| 14 | #endif /* __EXPORTED_HEADERS__ */ | ||
| 12 | #endif | 15 | #endif |
| 13 | 16 | ||
| 14 | #include <linux/posix_types.h> | 17 | #include <linux/posix_types.h> |
| @@ -197,6 +200,18 @@ typedef struct { | |||
| 197 | } atomic64_t; | 200 | } atomic64_t; |
| 198 | #endif | 201 | #endif |
| 199 | 202 | ||
| 203 | struct list_head { | ||
| 204 | struct list_head *next, *prev; | ||
| 205 | }; | ||
| 206 | |||
| 207 | struct hlist_head { | ||
| 208 | struct hlist_node *first; | ||
| 209 | }; | ||
| 210 | |||
| 211 | struct hlist_node { | ||
| 212 | struct hlist_node *next, **pprev; | ||
| 213 | }; | ||
| 214 | |||
| 200 | struct ustat { | 215 | struct ustat { |
| 201 | __kernel_daddr_t f_tfree; | 216 | __kernel_daddr_t f_tfree; |
| 202 | __kernel_ino_t f_tinode; | 217 | __kernel_ino_t f_tinode; |
diff --git a/include/linux/u64_stats_sync.h b/include/linux/u64_stats_sync.h new file mode 100644 index 000000000000..fa261a0da280 --- /dev/null +++ b/include/linux/u64_stats_sync.h | |||
| @@ -0,0 +1,140 @@ | |||
| 1 | #ifndef _LINUX_U64_STATS_SYNC_H | ||
| 2 | #define _LINUX_U64_STATS_SYNC_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * To properly implement 64bits network statistics on 32bit and 64bit hosts, | ||
| 6 | * we provide a synchronization point, that is a noop on 64bit or UP kernels. | ||
| 7 | * | ||
| 8 | * Key points : | ||
| 9 | * 1) Use a seqcount on SMP 32bits, with low overhead. | ||
| 10 | * 2) Whole thing is a noop on 64bit arches or UP kernels. | ||
| 11 | * 3) Write side must ensure mutual exclusion or one seqcount update could | ||
| 12 | * be lost, thus blocking readers forever. | ||
| 13 | * If this synchronization point is not a mutex, but a spinlock or | ||
| 14 | * spinlock_bh() or disable_bh() : | ||
| 15 | * 3.1) Write side should not sleep. | ||
| 16 | * 3.2) Write side should not allow preemption. | ||
| 17 | * 3.3) If applicable, interrupts should be disabled. | ||
| 18 | * | ||
| 19 | * 4) If reader fetches several counters, there is no guarantee the whole values | ||
| 20 | * are consistent (remember point 1) : this is a noop on 64bit arches anyway) | ||
| 21 | * | ||
| 22 | * 5) readers are allowed to sleep or be preempted/interrupted : They perform | ||
| 23 | * pure reads. But if they have to fetch many values, it's better to not allow | ||
| 24 | * preemptions/interruptions to avoid many retries. | ||
| 25 | * | ||
| 26 | * 6) If counter might be written by an interrupt, readers should block interrupts. | ||
| 27 | * (On UP, there is no seqcount_t protection, a reader allowing interrupts could | ||
| 28 | * read partial values) | ||
| 29 | * | ||
| 30 | * 7) For softirq uses, readers can use u64_stats_fetch_begin_bh() and | ||
| 31 | * u64_stats_fetch_retry_bh() helpers | ||
| 32 | * | ||
| 33 | * Usage : | ||
| 34 | * | ||
| 35 | * Stats producer (writer) should use following template granted it already got | ||
| 36 | * an exclusive access to counters (a lock is already taken, or per cpu | ||
| 37 | * data is used [in a non preemptable context]) | ||
| 38 | * | ||
| 39 | * spin_lock_bh(...) or other synchronization to get exclusive access | ||
| 40 | * ... | ||
| 41 | * u64_stats_update_begin(&stats->syncp); | ||
| 42 | * stats->bytes64 += len; // non atomic operation | ||
| 43 | * stats->packets64++; // non atomic operation | ||
| 44 | * u64_stats_update_end(&stats->syncp); | ||
| 45 | * | ||
| 46 | * While a consumer (reader) should use following template to get consistent | ||
| 47 | * snapshot for each variable (but no guarantee on several ones) | ||
| 48 | * | ||
| 49 | * u64 tbytes, tpackets; | ||
| 50 | * unsigned int start; | ||
| 51 | * | ||
| 52 | * do { | ||
| 53 | * start = u64_stats_fetch_begin(&stats->syncp); | ||
| 54 | * tbytes = stats->bytes64; // non atomic operation | ||
| 55 | * tpackets = stats->packets64; // non atomic operation | ||
| 56 | * } while (u64_stats_fetch_retry(&stats->syncp, start)); | ||
| 57 | * | ||
| 58 | * | ||
| 59 | * Example of use in drivers/net/loopback.c, using per_cpu containers, | ||
| 60 | * in BH disabled context. | ||
| 61 | */ | ||
| 62 | #include <linux/seqlock.h> | ||
| 63 | |||
| 64 | struct u64_stats_sync { | ||
| 65 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) | ||
| 66 | seqcount_t seq; | ||
| 67 | #endif | ||
| 68 | }; | ||
| 69 | |||
| 70 | static void inline u64_stats_update_begin(struct u64_stats_sync *syncp) | ||
| 71 | { | ||
| 72 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) | ||
| 73 | write_seqcount_begin(&syncp->seq); | ||
| 74 | #endif | ||
| 75 | } | ||
| 76 | |||
| 77 | static void inline u64_stats_update_end(struct u64_stats_sync *syncp) | ||
| 78 | { | ||
| 79 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) | ||
| 80 | write_seqcount_end(&syncp->seq); | ||
| 81 | #endif | ||
| 82 | } | ||
| 83 | |||
| 84 | static unsigned int inline u64_stats_fetch_begin(const struct u64_stats_sync *syncp) | ||
| 85 | { | ||
| 86 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) | ||
| 87 | return read_seqcount_begin(&syncp->seq); | ||
| 88 | #else | ||
| 89 | #if BITS_PER_LONG==32 | ||
| 90 | preempt_disable(); | ||
| 91 | #endif | ||
| 92 | return 0; | ||
| 93 | #endif | ||
| 94 | } | ||
| 95 | |||
| 96 | static bool inline u64_stats_fetch_retry(const struct u64_stats_sync *syncp, | ||
| 97 | unsigned int start) | ||
| 98 | { | ||
| 99 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) | ||
| 100 | return read_seqcount_retry(&syncp->seq, start); | ||
| 101 | #else | ||
| 102 | #if BITS_PER_LONG==32 | ||
| 103 | preempt_enable(); | ||
| 104 | #endif | ||
| 105 | return false; | ||
| 106 | #endif | ||
| 107 | } | ||
| 108 | |||
| 109 | /* | ||
| 110 | * In case softirq handlers can update u64 counters, readers can use following helpers | ||
| 111 | * - SMP 32bit arches use seqcount protection, irq safe. | ||
| 112 | * - UP 32bit must disable BH. | ||
| 113 | * - 64bit have no problem atomically reading u64 values, irq safe. | ||
| 114 | */ | ||
| 115 | static unsigned int inline u64_stats_fetch_begin_bh(const struct u64_stats_sync *syncp) | ||
| 116 | { | ||
| 117 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) | ||
| 118 | return read_seqcount_begin(&syncp->seq); | ||
| 119 | #else | ||
| 120 | #if BITS_PER_LONG==32 | ||
| 121 | local_bh_disable(); | ||
| 122 | #endif | ||
| 123 | return 0; | ||
| 124 | #endif | ||
| 125 | } | ||
| 126 | |||
| 127 | static bool inline u64_stats_fetch_retry_bh(const struct u64_stats_sync *syncp, | ||
| 128 | unsigned int start) | ||
| 129 | { | ||
| 130 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) | ||
| 131 | return read_seqcount_retry(&syncp->seq, start); | ||
| 132 | #else | ||
| 133 | #if BITS_PER_LONG==32 | ||
| 134 | local_bh_enable(); | ||
| 135 | #endif | ||
| 136 | return false; | ||
| 137 | #endif | ||
| 138 | } | ||
| 139 | |||
| 140 | #endif /* _LINUX_U64_STATS_SYNC_H */ | ||
diff --git a/include/linux/usb/audio-v2.h b/include/linux/usb/audio-v2.h index 383b94ba8c20..964cb603f7c7 100644 --- a/include/linux/usb/audio-v2.h +++ b/include/linux/usb/audio-v2.h | |||
| @@ -18,6 +18,21 @@ | |||
| 18 | /* v1.0 and v2.0 of this standard have many things in common. For the rest | 18 | /* v1.0 and v2.0 of this standard have many things in common. For the rest |
| 19 | * of the definitions, please refer to audio.h */ | 19 | * of the definitions, please refer to audio.h */ |
| 20 | 20 | ||
| 21 | /* | ||
| 22 | * bmControl field decoders | ||
| 23 | * | ||
| 24 | * From the USB Audio spec v2.0: | ||
| 25 | * | ||
| 26 | * bmaControls() is a (ch+1)-element array of 4-byte bitmaps, | ||
| 27 | * each containing a set of bit pairs. If a Control is present, | ||
| 28 | * it must be Host readable. If a certain Control is not | ||
| 29 | * present then the bit pair must be set to 0b00. | ||
| 30 | * If a Control is present but read-only, the bit pair must be | ||
| 31 | * set to 0b01. If a Control is also Host programmable, the bit | ||
| 32 | * pair must be set to 0b11. The value 0b10 is not allowed. | ||
| 33 | * | ||
| 34 | */ | ||
| 35 | |||
| 21 | static inline bool uac2_control_is_readable(u32 bmControls, u8 control) | 36 | static inline bool uac2_control_is_readable(u32 bmControls, u8 control) |
| 22 | { | 37 | { |
| 23 | return (bmControls >> (control * 2)) & 0x1; | 38 | return (bmControls >> (control * 2)) & 0x1; |
| @@ -121,7 +136,7 @@ struct uac2_feature_unit_descriptor { | |||
| 121 | 136 | ||
| 122 | /* 4.9.2 Class-Specific AS Interface Descriptor */ | 137 | /* 4.9.2 Class-Specific AS Interface Descriptor */ |
| 123 | 138 | ||
| 124 | struct uac_as_header_descriptor_v2 { | 139 | struct uac2_as_header_descriptor { |
| 125 | __u8 bLength; | 140 | __u8 bLength; |
| 126 | __u8 bDescriptorType; | 141 | __u8 bDescriptorType; |
| 127 | __u8 bDescriptorSubtype; | 142 | __u8 bDescriptorSubtype; |
diff --git a/include/linux/usb/audio.h b/include/linux/usb/audio.h index c51200c715e5..a54b8255d75f 100644 --- a/include/linux/usb/audio.h +++ b/include/linux/usb/audio.h | |||
| @@ -39,8 +39,8 @@ | |||
| 39 | #define UAC_MIXER_UNIT 0x04 | 39 | #define UAC_MIXER_UNIT 0x04 |
| 40 | #define UAC_SELECTOR_UNIT 0x05 | 40 | #define UAC_SELECTOR_UNIT 0x05 |
| 41 | #define UAC_FEATURE_UNIT 0x06 | 41 | #define UAC_FEATURE_UNIT 0x06 |
| 42 | #define UAC_PROCESSING_UNIT_V1 0x07 | 42 | #define UAC1_PROCESSING_UNIT 0x07 |
| 43 | #define UAC_EXTENSION_UNIT_V1 0x08 | 43 | #define UAC1_EXTENSION_UNIT 0x08 |
| 44 | 44 | ||
| 45 | /* A.6 Audio Class-Specific AS Interface Descriptor Subtypes */ | 45 | /* A.6 Audio Class-Specific AS Interface Descriptor Subtypes */ |
| 46 | #define UAC_AS_GENERAL 0x01 | 46 | #define UAC_AS_GENERAL 0x01 |
| @@ -151,7 +151,7 @@ | |||
| 151 | 151 | ||
| 152 | /* Terminal Control Selectors */ | 152 | /* Terminal Control Selectors */ |
| 153 | /* 4.3.2 Class-Specific AC Interface Descriptor */ | 153 | /* 4.3.2 Class-Specific AC Interface Descriptor */ |
| 154 | struct uac_ac_header_descriptor_v1 { | 154 | struct uac1_ac_header_descriptor { |
| 155 | __u8 bLength; /* 8 + n */ | 155 | __u8 bLength; /* 8 + n */ |
| 156 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ | 156 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ |
| 157 | __u8 bDescriptorSubtype; /* UAC_MS_HEADER */ | 157 | __u8 bDescriptorSubtype; /* UAC_MS_HEADER */ |
| @@ -165,7 +165,7 @@ struct uac_ac_header_descriptor_v1 { | |||
| 165 | 165 | ||
| 166 | /* As above, but more useful for defining your own descriptors: */ | 166 | /* As above, but more useful for defining your own descriptors: */ |
| 167 | #define DECLARE_UAC_AC_HEADER_DESCRIPTOR(n) \ | 167 | #define DECLARE_UAC_AC_HEADER_DESCRIPTOR(n) \ |
| 168 | struct uac_ac_header_descriptor_v1_##n { \ | 168 | struct uac1_ac_header_descriptor_##n { \ |
| 169 | __u8 bLength; \ | 169 | __u8 bLength; \ |
| 170 | __u8 bDescriptorType; \ | 170 | __u8 bDescriptorType; \ |
| 171 | __u8 bDescriptorSubtype; \ | 171 | __u8 bDescriptorSubtype; \ |
| @@ -205,7 +205,7 @@ struct uac_input_terminal_descriptor { | |||
| 205 | #define UAC_TERMINAL_CS_COPY_PROTECT_CONTROL 0x01 | 205 | #define UAC_TERMINAL_CS_COPY_PROTECT_CONTROL 0x01 |
| 206 | 206 | ||
| 207 | /* 4.3.2.2 Output Terminal Descriptor */ | 207 | /* 4.3.2.2 Output Terminal Descriptor */ |
| 208 | struct uac_output_terminal_descriptor_v1 { | 208 | struct uac1_output_terminal_descriptor { |
| 209 | __u8 bLength; /* in bytes: 9 */ | 209 | __u8 bLength; /* in bytes: 9 */ |
| 210 | __u8 bDescriptorType; /* CS_INTERFACE descriptor type */ | 210 | __u8 bDescriptorType; /* CS_INTERFACE descriptor type */ |
| 211 | __u8 bDescriptorSubtype; /* OUTPUT_TERMINAL descriptor subtype */ | 211 | __u8 bDescriptorSubtype; /* OUTPUT_TERMINAL descriptor subtype */ |
| @@ -395,7 +395,7 @@ static inline __u8 *uac_processing_unit_specific(struct uac_processing_unit_desc | |||
| 395 | } | 395 | } |
| 396 | 396 | ||
| 397 | /* 4.5.2 Class-Specific AS Interface Descriptor */ | 397 | /* 4.5.2 Class-Specific AS Interface Descriptor */ |
| 398 | struct uac_as_header_descriptor_v1 { | 398 | struct uac1_as_header_descriptor { |
| 399 | __u8 bLength; /* in bytes: 7 */ | 399 | __u8 bLength; /* in bytes: 7 */ |
| 400 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ | 400 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ |
| 401 | __u8 bDescriptorSubtype; /* AS_GENERAL */ | 401 | __u8 bDescriptorSubtype; /* AS_GENERAL */ |
diff --git a/include/linux/usb/video.h b/include/linux/usb/video.h index be436d9ee479..3b3b95e01f71 100644 --- a/include/linux/usb/video.h +++ b/include/linux/usb/video.h | |||
| @@ -160,5 +160,409 @@ | |||
| 160 | #define UVC_STATUS_TYPE_CONTROL 1 | 160 | #define UVC_STATUS_TYPE_CONTROL 1 |
| 161 | #define UVC_STATUS_TYPE_STREAMING 2 | 161 | #define UVC_STATUS_TYPE_STREAMING 2 |
| 162 | 162 | ||
| 163 | /* 2.4.3.3. Payload Header Information */ | ||
| 164 | #define UVC_STREAM_EOH (1 << 7) | ||
| 165 | #define UVC_STREAM_ERR (1 << 6) | ||
| 166 | #define UVC_STREAM_STI (1 << 5) | ||
| 167 | #define UVC_STREAM_RES (1 << 4) | ||
| 168 | #define UVC_STREAM_SCR (1 << 3) | ||
| 169 | #define UVC_STREAM_PTS (1 << 2) | ||
| 170 | #define UVC_STREAM_EOF (1 << 1) | ||
| 171 | #define UVC_STREAM_FID (1 << 0) | ||
| 172 | |||
| 173 | /* 4.1.2. Control Capabilities */ | ||
| 174 | #define UVC_CONTROL_CAP_GET (1 << 0) | ||
| 175 | #define UVC_CONTROL_CAP_SET (1 << 1) | ||
| 176 | #define UVC_CONTROL_CAP_DISABLED (1 << 2) | ||
| 177 | #define UVC_CONTROL_CAP_AUTOUPDATE (1 << 3) | ||
| 178 | #define UVC_CONTROL_CAP_ASYNCHRONOUS (1 << 4) | ||
| 179 | |||
| 180 | /* ------------------------------------------------------------------------ | ||
| 181 | * UVC structures | ||
| 182 | */ | ||
| 183 | |||
| 184 | /* All UVC descriptors have these 3 fields at the beginning */ | ||
| 185 | struct uvc_descriptor_header { | ||
| 186 | __u8 bLength; | ||
| 187 | __u8 bDescriptorType; | ||
| 188 | __u8 bDescriptorSubType; | ||
| 189 | } __attribute__((packed)); | ||
| 190 | |||
| 191 | /* 3.7.2. Video Control Interface Header Descriptor */ | ||
| 192 | struct uvc_header_descriptor { | ||
| 193 | __u8 bLength; | ||
| 194 | __u8 bDescriptorType; | ||
| 195 | __u8 bDescriptorSubType; | ||
| 196 | __u16 bcdUVC; | ||
| 197 | __u16 wTotalLength; | ||
| 198 | __u32 dwClockFrequency; | ||
| 199 | __u8 bInCollection; | ||
| 200 | __u8 baInterfaceNr[]; | ||
| 201 | } __attribute__((__packed__)); | ||
| 202 | |||
| 203 | #define UVC_DT_HEADER_SIZE(n) (12+(n)) | ||
| 204 | |||
| 205 | #define UVC_HEADER_DESCRIPTOR(n) \ | ||
| 206 | uvc_header_descriptor_##n | ||
| 207 | |||
| 208 | #define DECLARE_UVC_HEADER_DESCRIPTOR(n) \ | ||
| 209 | struct UVC_HEADER_DESCRIPTOR(n) { \ | ||
| 210 | __u8 bLength; \ | ||
| 211 | __u8 bDescriptorType; \ | ||
| 212 | __u8 bDescriptorSubType; \ | ||
| 213 | __u16 bcdUVC; \ | ||
| 214 | __u16 wTotalLength; \ | ||
| 215 | __u32 dwClockFrequency; \ | ||
| 216 | __u8 bInCollection; \ | ||
| 217 | __u8 baInterfaceNr[n]; \ | ||
| 218 | } __attribute__ ((packed)) | ||
| 219 | |||
| 220 | /* 3.7.2.1. Input Terminal Descriptor */ | ||
| 221 | struct uvc_input_terminal_descriptor { | ||
| 222 | __u8 bLength; | ||
| 223 | __u8 bDescriptorType; | ||
| 224 | __u8 bDescriptorSubType; | ||
| 225 | __u8 bTerminalID; | ||
| 226 | __u16 wTerminalType; | ||
| 227 | __u8 bAssocTerminal; | ||
| 228 | __u8 iTerminal; | ||
| 229 | } __attribute__((__packed__)); | ||
| 230 | |||
| 231 | #define UVC_DT_INPUT_TERMINAL_SIZE 8 | ||
| 232 | |||
| 233 | /* 3.7.2.2. Output Terminal Descriptor */ | ||
| 234 | struct uvc_output_terminal_descriptor { | ||
| 235 | __u8 bLength; | ||
| 236 | __u8 bDescriptorType; | ||
| 237 | __u8 bDescriptorSubType; | ||
| 238 | __u8 bTerminalID; | ||
| 239 | __u16 wTerminalType; | ||
| 240 | __u8 bAssocTerminal; | ||
| 241 | __u8 bSourceID; | ||
| 242 | __u8 iTerminal; | ||
| 243 | } __attribute__((__packed__)); | ||
| 244 | |||
| 245 | #define UVC_DT_OUTPUT_TERMINAL_SIZE 9 | ||
| 246 | |||
| 247 | /* 3.7.2.3. Camera Terminal Descriptor */ | ||
| 248 | struct uvc_camera_terminal_descriptor { | ||
| 249 | __u8 bLength; | ||
| 250 | __u8 bDescriptorType; | ||
| 251 | __u8 bDescriptorSubType; | ||
| 252 | __u8 bTerminalID; | ||
| 253 | __u16 wTerminalType; | ||
| 254 | __u8 bAssocTerminal; | ||
| 255 | __u8 iTerminal; | ||
| 256 | __u16 wObjectiveFocalLengthMin; | ||
| 257 | __u16 wObjectiveFocalLengthMax; | ||
| 258 | __u16 wOcularFocalLength; | ||
| 259 | __u8 bControlSize; | ||
| 260 | __u8 bmControls[3]; | ||
| 261 | } __attribute__((__packed__)); | ||
| 262 | |||
| 263 | #define UVC_DT_CAMERA_TERMINAL_SIZE(n) (15+(n)) | ||
| 264 | |||
| 265 | /* 3.7.2.4. Selector Unit Descriptor */ | ||
| 266 | struct uvc_selector_unit_descriptor { | ||
| 267 | __u8 bLength; | ||
| 268 | __u8 bDescriptorType; | ||
| 269 | __u8 bDescriptorSubType; | ||
| 270 | __u8 bUnitID; | ||
| 271 | __u8 bNrInPins; | ||
| 272 | __u8 baSourceID[0]; | ||
| 273 | __u8 iSelector; | ||
| 274 | } __attribute__((__packed__)); | ||
| 275 | |||
| 276 | #define UVC_DT_SELECTOR_UNIT_SIZE(n) (6+(n)) | ||
| 277 | |||
| 278 | #define UVC_SELECTOR_UNIT_DESCRIPTOR(n) \ | ||
| 279 | uvc_selector_unit_descriptor_##n | ||
| 280 | |||
| 281 | #define DECLARE_UVC_SELECTOR_UNIT_DESCRIPTOR(n) \ | ||
| 282 | struct UVC_SELECTOR_UNIT_DESCRIPTOR(n) { \ | ||
| 283 | __u8 bLength; \ | ||
| 284 | __u8 bDescriptorType; \ | ||
| 285 | __u8 bDescriptorSubType; \ | ||
| 286 | __u8 bUnitID; \ | ||
| 287 | __u8 bNrInPins; \ | ||
| 288 | __u8 baSourceID[n]; \ | ||
| 289 | __u8 iSelector; \ | ||
| 290 | } __attribute__ ((packed)) | ||
| 291 | |||
| 292 | /* 3.7.2.5. Processing Unit Descriptor */ | ||
| 293 | struct uvc_processing_unit_descriptor { | ||
| 294 | __u8 bLength; | ||
| 295 | __u8 bDescriptorType; | ||
| 296 | __u8 bDescriptorSubType; | ||
| 297 | __u8 bUnitID; | ||
| 298 | __u8 bSourceID; | ||
| 299 | __u16 wMaxMultiplier; | ||
| 300 | __u8 bControlSize; | ||
| 301 | __u8 bmControls[2]; | ||
| 302 | __u8 iProcessing; | ||
| 303 | } __attribute__((__packed__)); | ||
| 304 | |||
| 305 | #define UVC_DT_PROCESSING_UNIT_SIZE(n) (9+(n)) | ||
| 306 | |||
| 307 | /* 3.7.2.6. Extension Unit Descriptor */ | ||
| 308 | struct uvc_extension_unit_descriptor { | ||
| 309 | __u8 bLength; | ||
| 310 | __u8 bDescriptorType; | ||
| 311 | __u8 bDescriptorSubType; | ||
| 312 | __u8 bUnitID; | ||
| 313 | __u8 guidExtensionCode[16]; | ||
| 314 | __u8 bNumControls; | ||
| 315 | __u8 bNrInPins; | ||
| 316 | __u8 baSourceID[0]; | ||
| 317 | __u8 bControlSize; | ||
| 318 | __u8 bmControls[0]; | ||
| 319 | __u8 iExtension; | ||
| 320 | } __attribute__((__packed__)); | ||
| 321 | |||
| 322 | #define UVC_DT_EXTENSION_UNIT_SIZE(p, n) (24+(p)+(n)) | ||
| 323 | |||
| 324 | #define UVC_EXTENSION_UNIT_DESCRIPTOR(p, n) \ | ||
| 325 | uvc_extension_unit_descriptor_##p_##n | ||
| 326 | |||
| 327 | #define DECLARE_UVC_EXTENSION_UNIT_DESCRIPTOR(p, n) \ | ||
| 328 | struct UVC_EXTENSION_UNIT_DESCRIPTOR(p, n) { \ | ||
| 329 | __u8 bLength; \ | ||
| 330 | __u8 bDescriptorType; \ | ||
| 331 | __u8 bDescriptorSubType; \ | ||
| 332 | __u8 bUnitID; \ | ||
| 333 | __u8 guidExtensionCode[16]; \ | ||
| 334 | __u8 bNumControls; \ | ||
| 335 | __u8 bNrInPins; \ | ||
| 336 | __u8 baSourceID[p]; \ | ||
| 337 | __u8 bControlSize; \ | ||
| 338 | __u8 bmControls[n]; \ | ||
| 339 | __u8 iExtension; \ | ||
| 340 | } __attribute__ ((packed)) | ||
| 341 | |||
| 342 | /* 3.8.2.2. Video Control Interrupt Endpoint Descriptor */ | ||
| 343 | struct uvc_control_endpoint_descriptor { | ||
| 344 | __u8 bLength; | ||
| 345 | __u8 bDescriptorType; | ||
| 346 | __u8 bDescriptorSubType; | ||
| 347 | __u16 wMaxTransferSize; | ||
| 348 | } __attribute__((__packed__)); | ||
| 349 | |||
| 350 | #define UVC_DT_CONTROL_ENDPOINT_SIZE 5 | ||
| 351 | |||
| 352 | /* 3.9.2.1. Input Header Descriptor */ | ||
| 353 | struct uvc_input_header_descriptor { | ||
| 354 | __u8 bLength; | ||
| 355 | __u8 bDescriptorType; | ||
| 356 | __u8 bDescriptorSubType; | ||
| 357 | __u8 bNumFormats; | ||
| 358 | __u16 wTotalLength; | ||
| 359 | __u8 bEndpointAddress; | ||
| 360 | __u8 bmInfo; | ||
| 361 | __u8 bTerminalLink; | ||
| 362 | __u8 bStillCaptureMethod; | ||
| 363 | __u8 bTriggerSupport; | ||
| 364 | __u8 bTriggerUsage; | ||
| 365 | __u8 bControlSize; | ||
| 366 | __u8 bmaControls[]; | ||
| 367 | } __attribute__((__packed__)); | ||
| 368 | |||
| 369 | #define UVC_DT_INPUT_HEADER_SIZE(n, p) (13+(n*p)) | ||
| 370 | |||
| 371 | #define UVC_INPUT_HEADER_DESCRIPTOR(n, p) \ | ||
| 372 | uvc_input_header_descriptor_##n_##p | ||
| 373 | |||
| 374 | #define DECLARE_UVC_INPUT_HEADER_DESCRIPTOR(n, p) \ | ||
| 375 | struct UVC_INPUT_HEADER_DESCRIPTOR(n, p) { \ | ||
| 376 | __u8 bLength; \ | ||
| 377 | __u8 bDescriptorType; \ | ||
| 378 | __u8 bDescriptorSubType; \ | ||
| 379 | __u8 bNumFormats; \ | ||
| 380 | __u16 wTotalLength; \ | ||
| 381 | __u8 bEndpointAddress; \ | ||
| 382 | __u8 bmInfo; \ | ||
| 383 | __u8 bTerminalLink; \ | ||
| 384 | __u8 bStillCaptureMethod; \ | ||
| 385 | __u8 bTriggerSupport; \ | ||
| 386 | __u8 bTriggerUsage; \ | ||
| 387 | __u8 bControlSize; \ | ||
| 388 | __u8 bmaControls[p][n]; \ | ||
| 389 | } __attribute__ ((packed)) | ||
| 390 | |||
| 391 | /* 3.9.2.2. Output Header Descriptor */ | ||
| 392 | struct uvc_output_header_descriptor { | ||
| 393 | __u8 bLength; | ||
| 394 | __u8 bDescriptorType; | ||
| 395 | __u8 bDescriptorSubType; | ||
| 396 | __u8 bNumFormats; | ||
| 397 | __u16 wTotalLength; | ||
| 398 | __u8 bEndpointAddress; | ||
| 399 | __u8 bTerminalLink; | ||
| 400 | __u8 bControlSize; | ||
| 401 | __u8 bmaControls[]; | ||
| 402 | } __attribute__((__packed__)); | ||
| 403 | |||
| 404 | #define UVC_DT_OUTPUT_HEADER_SIZE(n, p) (9+(n*p)) | ||
| 405 | |||
| 406 | #define UVC_OUTPUT_HEADER_DESCRIPTOR(n, p) \ | ||
| 407 | uvc_output_header_descriptor_##n_##p | ||
| 408 | |||
| 409 | #define DECLARE_UVC_OUTPUT_HEADER_DESCRIPTOR(n, p) \ | ||
| 410 | struct UVC_OUTPUT_HEADER_DESCRIPTOR(n, p) { \ | ||
| 411 | __u8 bLength; \ | ||
| 412 | __u8 bDescriptorType; \ | ||
| 413 | __u8 bDescriptorSubType; \ | ||
| 414 | __u8 bNumFormats; \ | ||
| 415 | __u16 wTotalLength; \ | ||
| 416 | __u8 bEndpointAddress; \ | ||
| 417 | __u8 bTerminalLink; \ | ||
| 418 | __u8 bControlSize; \ | ||
| 419 | __u8 bmaControls[p][n]; \ | ||
| 420 | } __attribute__ ((packed)) | ||
| 421 | |||
| 422 | /* 3.9.2.6. Color matching descriptor */ | ||
| 423 | struct uvc_color_matching_descriptor { | ||
| 424 | __u8 bLength; | ||
| 425 | __u8 bDescriptorType; | ||
| 426 | __u8 bDescriptorSubType; | ||
| 427 | __u8 bColorPrimaries; | ||
| 428 | __u8 bTransferCharacteristics; | ||
| 429 | __u8 bMatrixCoefficients; | ||
| 430 | } __attribute__((__packed__)); | ||
| 431 | |||
| 432 | #define UVC_DT_COLOR_MATCHING_SIZE 6 | ||
| 433 | |||
| 434 | /* 4.3.1.1. Video Probe and Commit Controls */ | ||
| 435 | struct uvc_streaming_control { | ||
| 436 | __u16 bmHint; | ||
| 437 | __u8 bFormatIndex; | ||
| 438 | __u8 bFrameIndex; | ||
| 439 | __u32 dwFrameInterval; | ||
| 440 | __u16 wKeyFrameRate; | ||
| 441 | __u16 wPFrameRate; | ||
| 442 | __u16 wCompQuality; | ||
| 443 | __u16 wCompWindowSize; | ||
| 444 | __u16 wDelay; | ||
| 445 | __u32 dwMaxVideoFrameSize; | ||
| 446 | __u32 dwMaxPayloadTransferSize; | ||
| 447 | __u32 dwClockFrequency; | ||
| 448 | __u8 bmFramingInfo; | ||
| 449 | __u8 bPreferedVersion; | ||
| 450 | __u8 bMinVersion; | ||
| 451 | __u8 bMaxVersion; | ||
| 452 | } __attribute__((__packed__)); | ||
| 453 | |||
| 454 | /* Uncompressed Payload - 3.1.1. Uncompressed Video Format Descriptor */ | ||
| 455 | struct uvc_format_uncompressed { | ||
| 456 | __u8 bLength; | ||
| 457 | __u8 bDescriptorType; | ||
| 458 | __u8 bDescriptorSubType; | ||
| 459 | __u8 bFormatIndex; | ||
| 460 | __u8 bNumFrameDescriptors; | ||
| 461 | __u8 guidFormat[16]; | ||
| 462 | __u8 bBitsPerPixel; | ||
| 463 | __u8 bDefaultFrameIndex; | ||
| 464 | __u8 bAspectRatioX; | ||
| 465 | __u8 bAspectRatioY; | ||
| 466 | __u8 bmInterfaceFlags; | ||
| 467 | __u8 bCopyProtect; | ||
| 468 | } __attribute__((__packed__)); | ||
| 469 | |||
| 470 | #define UVC_DT_FORMAT_UNCOMPRESSED_SIZE 27 | ||
| 471 | |||
| 472 | /* Uncompressed Payload - 3.1.2. Uncompressed Video Frame Descriptor */ | ||
| 473 | struct uvc_frame_uncompressed { | ||
| 474 | __u8 bLength; | ||
| 475 | __u8 bDescriptorType; | ||
| 476 | __u8 bDescriptorSubType; | ||
| 477 | __u8 bFrameIndex; | ||
| 478 | __u8 bmCapabilities; | ||
| 479 | __u16 wWidth; | ||
| 480 | __u16 wHeight; | ||
| 481 | __u32 dwMinBitRate; | ||
| 482 | __u32 dwMaxBitRate; | ||
| 483 | __u32 dwMaxVideoFrameBufferSize; | ||
| 484 | __u32 dwDefaultFrameInterval; | ||
| 485 | __u8 bFrameIntervalType; | ||
| 486 | __u32 dwFrameInterval[]; | ||
| 487 | } __attribute__((__packed__)); | ||
| 488 | |||
| 489 | #define UVC_DT_FRAME_UNCOMPRESSED_SIZE(n) (26+4*(n)) | ||
| 490 | |||
| 491 | #define UVC_FRAME_UNCOMPRESSED(n) \ | ||
| 492 | uvc_frame_uncompressed_##n | ||
| 493 | |||
| 494 | #define DECLARE_UVC_FRAME_UNCOMPRESSED(n) \ | ||
| 495 | struct UVC_FRAME_UNCOMPRESSED(n) { \ | ||
| 496 | __u8 bLength; \ | ||
| 497 | __u8 bDescriptorType; \ | ||
| 498 | __u8 bDescriptorSubType; \ | ||
| 499 | __u8 bFrameIndex; \ | ||
| 500 | __u8 bmCapabilities; \ | ||
| 501 | __u16 wWidth; \ | ||
| 502 | __u16 wHeight; \ | ||
| 503 | __u32 dwMinBitRate; \ | ||
| 504 | __u32 dwMaxBitRate; \ | ||
| 505 | __u32 dwMaxVideoFrameBufferSize; \ | ||
| 506 | __u32 dwDefaultFrameInterval; \ | ||
| 507 | __u8 bFrameIntervalType; \ | ||
| 508 | __u32 dwFrameInterval[n]; \ | ||
| 509 | } __attribute__ ((packed)) | ||
| 510 | |||
| 511 | /* MJPEG Payload - 3.1.1. MJPEG Video Format Descriptor */ | ||
| 512 | struct uvc_format_mjpeg { | ||
| 513 | __u8 bLength; | ||
| 514 | __u8 bDescriptorType; | ||
| 515 | __u8 bDescriptorSubType; | ||
| 516 | __u8 bFormatIndex; | ||
| 517 | __u8 bNumFrameDescriptors; | ||
| 518 | __u8 bmFlags; | ||
| 519 | __u8 bDefaultFrameIndex; | ||
| 520 | __u8 bAspectRatioX; | ||
| 521 | __u8 bAspectRatioY; | ||
| 522 | __u8 bmInterfaceFlags; | ||
| 523 | __u8 bCopyProtect; | ||
| 524 | } __attribute__((__packed__)); | ||
| 525 | |||
| 526 | #define UVC_DT_FORMAT_MJPEG_SIZE 11 | ||
| 527 | |||
| 528 | /* MJPEG Payload - 3.1.2. MJPEG Video Frame Descriptor */ | ||
| 529 | struct uvc_frame_mjpeg { | ||
| 530 | __u8 bLength; | ||
| 531 | __u8 bDescriptorType; | ||
| 532 | __u8 bDescriptorSubType; | ||
| 533 | __u8 bFrameIndex; | ||
| 534 | __u8 bmCapabilities; | ||
| 535 | __u16 wWidth; | ||
| 536 | __u16 wHeight; | ||
| 537 | __u32 dwMinBitRate; | ||
| 538 | __u32 dwMaxBitRate; | ||
| 539 | __u32 dwMaxVideoFrameBufferSize; | ||
| 540 | __u32 dwDefaultFrameInterval; | ||
| 541 | __u8 bFrameIntervalType; | ||
| 542 | __u32 dwFrameInterval[]; | ||
| 543 | } __attribute__((__packed__)); | ||
| 544 | |||
| 545 | #define UVC_DT_FRAME_MJPEG_SIZE(n) (26+4*(n)) | ||
| 546 | |||
| 547 | #define UVC_FRAME_MJPEG(n) \ | ||
| 548 | uvc_frame_mjpeg_##n | ||
| 549 | |||
| 550 | #define DECLARE_UVC_FRAME_MJPEG(n) \ | ||
| 551 | struct UVC_FRAME_MJPEG(n) { \ | ||
| 552 | __u8 bLength; \ | ||
| 553 | __u8 bDescriptorType; \ | ||
| 554 | __u8 bDescriptorSubType; \ | ||
| 555 | __u8 bFrameIndex; \ | ||
| 556 | __u8 bmCapabilities; \ | ||
| 557 | __u16 wWidth; \ | ||
| 558 | __u16 wHeight; \ | ||
| 559 | __u32 dwMinBitRate; \ | ||
| 560 | __u32 dwMaxBitRate; \ | ||
| 561 | __u32 dwMaxVideoFrameBufferSize; \ | ||
| 562 | __u32 dwDefaultFrameInterval; \ | ||
| 563 | __u8 bFrameIntervalType; \ | ||
| 564 | __u32 dwFrameInterval[n]; \ | ||
| 565 | } __attribute__ ((packed)) | ||
| 566 | |||
| 163 | #endif /* __LINUX_USB_VIDEO_H */ | 567 | #endif /* __LINUX_USB_VIDEO_H */ |
| 164 | 568 | ||
diff --git a/include/linux/user_namespace.h b/include/linux/user_namespace.h index cc4f45361dbb..8178156711f9 100644 --- a/include/linux/user_namespace.h +++ b/include/linux/user_namespace.h | |||
| @@ -36,6 +36,9 @@ static inline void put_user_ns(struct user_namespace *ns) | |||
| 36 | kref_put(&ns->kref, free_user_ns); | 36 | kref_put(&ns->kref, free_user_ns); |
| 37 | } | 37 | } |
| 38 | 38 | ||
| 39 | uid_t user_ns_map_uid(struct user_namespace *to, const struct cred *cred, uid_t uid); | ||
| 40 | gid_t user_ns_map_gid(struct user_namespace *to, const struct cred *cred, gid_t gid); | ||
| 41 | |||
| 39 | #else | 42 | #else |
| 40 | 43 | ||
| 41 | static inline struct user_namespace *get_user_ns(struct user_namespace *ns) | 44 | static inline struct user_namespace *get_user_ns(struct user_namespace *ns) |
| @@ -52,6 +55,17 @@ static inline void put_user_ns(struct user_namespace *ns) | |||
| 52 | { | 55 | { |
| 53 | } | 56 | } |
| 54 | 57 | ||
| 58 | static inline uid_t user_ns_map_uid(struct user_namespace *to, | ||
| 59 | const struct cred *cred, uid_t uid) | ||
| 60 | { | ||
| 61 | return uid; | ||
| 62 | } | ||
| 63 | static inline gid_t user_ns_map_gid(struct user_namespace *to, | ||
| 64 | const struct cred *cred, gid_t gid) | ||
| 65 | { | ||
| 66 | return gid; | ||
| 67 | } | ||
| 68 | |||
| 55 | #endif | 69 | #endif |
| 56 | 70 | ||
| 57 | #endif /* _LINUX_USER_H */ | 71 | #endif /* _LINUX_USER_H */ |
diff --git a/include/linux/vgaarb.h b/include/linux/vgaarb.h index c9a975976995..814f294d4cd0 100644 --- a/include/linux/vgaarb.h +++ b/include/linux/vgaarb.h | |||
| @@ -29,6 +29,7 @@ | |||
| 29 | */ | 29 | */ |
| 30 | 30 | ||
| 31 | #ifndef LINUX_VGA_H | 31 | #ifndef LINUX_VGA_H |
| 32 | #define LINUX_VGA_H | ||
| 32 | 33 | ||
| 33 | #include <asm/vga.h> | 34 | #include <asm/vga.h> |
| 34 | 35 | ||
diff --git a/include/linux/virtio_9p.h b/include/linux/virtio_9p.h index 5cf11765146b..395c38a47adb 100644 --- a/include/linux/virtio_9p.h +++ b/include/linux/virtio_9p.h | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | * compatible drivers/servers. */ | 4 | * compatible drivers/servers. */ |
| 5 | #include <linux/virtio_ids.h> | 5 | #include <linux/virtio_ids.h> |
| 6 | #include <linux/virtio_config.h> | 6 | #include <linux/virtio_config.h> |
| 7 | #include <linux/types.h> | ||
| 7 | 8 | ||
| 8 | /* The feature bitmap for virtio 9P */ | 9 | /* The feature bitmap for virtio 9P */ |
| 9 | 10 | ||
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index 227c2a585e4f..de05e96e0a70 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h | |||
| @@ -30,7 +30,7 @@ struct vm_struct { | |||
| 30 | unsigned long flags; | 30 | unsigned long flags; |
| 31 | struct page **pages; | 31 | struct page **pages; |
| 32 | unsigned int nr_pages; | 32 | unsigned int nr_pages; |
| 33 | unsigned long phys_addr; | 33 | phys_addr_t phys_addr; |
| 34 | void *caller; | 34 | void *caller; |
| 35 | }; | 35 | }; |
| 36 | 36 | ||
diff --git a/include/linux/wlp.h b/include/linux/wlp.h index ac95ce6606ac..c76fe2392506 100644 --- a/include/linux/wlp.h +++ b/include/linux/wlp.h | |||
| @@ -300,7 +300,7 @@ struct wlp_ie { | |||
| 300 | __le16 cycle_param; | 300 | __le16 cycle_param; |
| 301 | __le16 acw_anchor_addr; | 301 | __le16 acw_anchor_addr; |
| 302 | u8 wssid_hash_list[]; | 302 | u8 wssid_hash_list[]; |
| 303 | } __attribute__((packed)); | 303 | } __packed; |
| 304 | 304 | ||
| 305 | static inline int wlp_ie_hash_length(struct wlp_ie *ie) | 305 | static inline int wlp_ie_hash_length(struct wlp_ie *ie) |
| 306 | { | 306 | { |
| @@ -324,7 +324,7 @@ static inline void wlp_ie_set_hash_length(struct wlp_ie *ie, int hash_length) | |||
| 324 | */ | 324 | */ |
| 325 | struct wlp_nonce { | 325 | struct wlp_nonce { |
| 326 | u8 data[16]; | 326 | u8 data[16]; |
| 327 | } __attribute__((packed)); | 327 | } __packed; |
| 328 | 328 | ||
| 329 | /** | 329 | /** |
| 330 | * WLP UUID | 330 | * WLP UUID |
| @@ -336,7 +336,7 @@ struct wlp_nonce { | |||
| 336 | */ | 336 | */ |
| 337 | struct wlp_uuid { | 337 | struct wlp_uuid { |
| 338 | u8 data[16]; | 338 | u8 data[16]; |
| 339 | } __attribute__((packed)); | 339 | } __packed; |
| 340 | 340 | ||
| 341 | 341 | ||
| 342 | /** | 342 | /** |
| @@ -348,7 +348,7 @@ struct wlp_dev_type { | |||
| 348 | u8 OUI[3]; | 348 | u8 OUI[3]; |
| 349 | u8 OUIsubdiv; | 349 | u8 OUIsubdiv; |
| 350 | __le16 subID; | 350 | __le16 subID; |
| 351 | } __attribute__((packed)); | 351 | } __packed; |
| 352 | 352 | ||
| 353 | /** | 353 | /** |
| 354 | * WLP frame header | 354 | * WLP frame header |
| @@ -357,7 +357,7 @@ struct wlp_dev_type { | |||
| 357 | struct wlp_frame_hdr { | 357 | struct wlp_frame_hdr { |
| 358 | __le16 mux_hdr; /* WLP_PROTOCOL_ID */ | 358 | __le16 mux_hdr; /* WLP_PROTOCOL_ID */ |
| 359 | enum wlp_frame_type type:8; | 359 | enum wlp_frame_type type:8; |
| 360 | } __attribute__((packed)); | 360 | } __packed; |
| 361 | 361 | ||
| 362 | /** | 362 | /** |
| 363 | * WLP attribute field header | 363 | * WLP attribute field header |
| @@ -368,7 +368,7 @@ struct wlp_frame_hdr { | |||
| 368 | struct wlp_attr_hdr { | 368 | struct wlp_attr_hdr { |
| 369 | __le16 type; | 369 | __le16 type; |
| 370 | __le16 length; | 370 | __le16 length; |
| 371 | } __attribute__((packed)); | 371 | } __packed; |
| 372 | 372 | ||
| 373 | /** | 373 | /** |
| 374 | * Device information commonly used together | 374 | * Device information commonly used together |
| @@ -401,13 +401,13 @@ struct wlp_device_info { | |||
| 401 | struct wlp_attr_##name { \ | 401 | struct wlp_attr_##name { \ |
| 402 | struct wlp_attr_hdr hdr; \ | 402 | struct wlp_attr_hdr hdr; \ |
| 403 | type name; \ | 403 | type name; \ |
| 404 | } __attribute__((packed)); | 404 | } __packed; |
| 405 | 405 | ||
| 406 | #define wlp_attr_array(type, name) \ | 406 | #define wlp_attr_array(type, name) \ |
| 407 | struct wlp_attr_##name { \ | 407 | struct wlp_attr_##name { \ |
| 408 | struct wlp_attr_hdr hdr; \ | 408 | struct wlp_attr_hdr hdr; \ |
| 409 | type name[]; \ | 409 | type name[]; \ |
| 410 | } __attribute__((packed)); | 410 | } __packed; |
| 411 | 411 | ||
| 412 | /** | 412 | /** |
| 413 | * WLP association attribute fields | 413 | * WLP association attribute fields |
| @@ -483,7 +483,7 @@ struct wlp_wss_info { | |||
| 483 | struct wlp_attr_accept_enrl accept; | 483 | struct wlp_attr_accept_enrl accept; |
| 484 | struct wlp_attr_wss_sec_status sec_stat; | 484 | struct wlp_attr_wss_sec_status sec_stat; |
| 485 | struct wlp_attr_wss_bcast bcast; | 485 | struct wlp_attr_wss_bcast bcast; |
| 486 | } __attribute__((packed)); | 486 | } __packed; |
| 487 | 487 | ||
| 488 | /* WLP WSS Information */ | 488 | /* WLP WSS Information */ |
| 489 | wlp_attr_array(struct wlp_wss_info, wss_info) | 489 | wlp_attr_array(struct wlp_wss_info, wss_info) |
| @@ -520,7 +520,7 @@ wlp_attr(u8, wlp_assc_err) | |||
| 520 | struct wlp_frame_std_abbrv_hdr { | 520 | struct wlp_frame_std_abbrv_hdr { |
| 521 | struct wlp_frame_hdr hdr; | 521 | struct wlp_frame_hdr hdr; |
| 522 | u8 tag; | 522 | u8 tag; |
| 523 | } __attribute__((packed)); | 523 | } __packed; |
| 524 | 524 | ||
| 525 | /** | 525 | /** |
| 526 | * WLP association frames | 526 | * WLP association frames |
| @@ -533,7 +533,7 @@ struct wlp_frame_assoc { | |||
| 533 | struct wlp_attr_version version; | 533 | struct wlp_attr_version version; |
| 534 | struct wlp_attr_msg_type msg_type; | 534 | struct wlp_attr_msg_type msg_type; |
| 535 | u8 attr[]; | 535 | u8 attr[]; |
| 536 | } __attribute__((packed)); | 536 | } __packed; |
| 537 | 537 | ||
| 538 | /* Ethernet to dev address mapping */ | 538 | /* Ethernet to dev address mapping */ |
| 539 | struct wlp_eda { | 539 | struct wlp_eda { |
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index 9466e860d8c2..4f9d277bcd9a 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | #include <linux/linkage.h> | 9 | #include <linux/linkage.h> |
| 10 | #include <linux/bitops.h> | 10 | #include <linux/bitops.h> |
| 11 | #include <linux/lockdep.h> | 11 | #include <linux/lockdep.h> |
| 12 | #include <linux/threads.h> | ||
| 12 | #include <asm/atomic.h> | 13 | #include <asm/atomic.h> |
| 13 | 14 | ||
| 14 | struct workqueue_struct; | 15 | struct workqueue_struct; |
| @@ -22,12 +23,59 @@ typedef void (*work_func_t)(struct work_struct *work); | |||
| 22 | */ | 23 | */ |
| 23 | #define work_data_bits(work) ((unsigned long *)(&(work)->data)) | 24 | #define work_data_bits(work) ((unsigned long *)(&(work)->data)) |
| 24 | 25 | ||
| 26 | enum { | ||
| 27 | WORK_STRUCT_PENDING_BIT = 0, /* work item is pending execution */ | ||
| 28 | WORK_STRUCT_CWQ_BIT = 1, /* data points to cwq */ | ||
| 29 | WORK_STRUCT_LINKED_BIT = 2, /* next work is linked to this one */ | ||
| 30 | #ifdef CONFIG_DEBUG_OBJECTS_WORK | ||
| 31 | WORK_STRUCT_STATIC_BIT = 3, /* static initializer (debugobjects) */ | ||
| 32 | WORK_STRUCT_COLOR_SHIFT = 4, /* color for workqueue flushing */ | ||
| 33 | #else | ||
| 34 | WORK_STRUCT_COLOR_SHIFT = 3, /* color for workqueue flushing */ | ||
| 35 | #endif | ||
| 36 | |||
| 37 | WORK_STRUCT_COLOR_BITS = 4, | ||
| 38 | |||
| 39 | WORK_STRUCT_PENDING = 1 << WORK_STRUCT_PENDING_BIT, | ||
| 40 | WORK_STRUCT_CWQ = 1 << WORK_STRUCT_CWQ_BIT, | ||
| 41 | WORK_STRUCT_LINKED = 1 << WORK_STRUCT_LINKED_BIT, | ||
| 42 | #ifdef CONFIG_DEBUG_OBJECTS_WORK | ||
| 43 | WORK_STRUCT_STATIC = 1 << WORK_STRUCT_STATIC_BIT, | ||
| 44 | #else | ||
| 45 | WORK_STRUCT_STATIC = 0, | ||
| 46 | #endif | ||
| 47 | |||
| 48 | /* | ||
| 49 | * The last color is no color used for works which don't | ||
| 50 | * participate in workqueue flushing. | ||
| 51 | */ | ||
| 52 | WORK_NR_COLORS = (1 << WORK_STRUCT_COLOR_BITS) - 1, | ||
| 53 | WORK_NO_COLOR = WORK_NR_COLORS, | ||
| 54 | |||
| 55 | /* special cpu IDs */ | ||
| 56 | WORK_CPU_UNBOUND = NR_CPUS, | ||
| 57 | WORK_CPU_NONE = NR_CPUS + 1, | ||
| 58 | WORK_CPU_LAST = WORK_CPU_NONE, | ||
| 59 | |||
| 60 | /* | ||
| 61 | * Reserve 7 bits off of cwq pointer w/ debugobjects turned | ||
| 62 | * off. This makes cwqs aligned to 128 bytes which isn't too | ||
| 63 | * excessive while allowing 15 workqueue flush colors. | ||
| 64 | */ | ||
| 65 | WORK_STRUCT_FLAG_BITS = WORK_STRUCT_COLOR_SHIFT + | ||
| 66 | WORK_STRUCT_COLOR_BITS, | ||
| 67 | |||
| 68 | WORK_STRUCT_FLAG_MASK = (1UL << WORK_STRUCT_FLAG_BITS) - 1, | ||
| 69 | WORK_STRUCT_WQ_DATA_MASK = ~WORK_STRUCT_FLAG_MASK, | ||
| 70 | WORK_STRUCT_NO_CPU = WORK_CPU_NONE << WORK_STRUCT_FLAG_BITS, | ||
| 71 | |||
| 72 | /* bit mask for work_busy() return values */ | ||
| 73 | WORK_BUSY_PENDING = 1 << 0, | ||
| 74 | WORK_BUSY_RUNNING = 1 << 1, | ||
| 75 | }; | ||
| 76 | |||
| 25 | struct work_struct { | 77 | struct work_struct { |
| 26 | atomic_long_t data; | 78 | atomic_long_t data; |
| 27 | #define WORK_STRUCT_PENDING 0 /* T if work item pending execution */ | ||
| 28 | #define WORK_STRUCT_STATIC 1 /* static initializer (debugobjects) */ | ||
| 29 | #define WORK_STRUCT_FLAG_MASK (3UL) | ||
| 30 | #define WORK_STRUCT_WQ_DATA_MASK (~WORK_STRUCT_FLAG_MASK) | ||
| 31 | struct list_head entry; | 79 | struct list_head entry; |
| 32 | work_func_t func; | 80 | work_func_t func; |
| 33 | #ifdef CONFIG_LOCKDEP | 81 | #ifdef CONFIG_LOCKDEP |
| @@ -35,8 +83,9 @@ struct work_struct { | |||
| 35 | #endif | 83 | #endif |
| 36 | }; | 84 | }; |
| 37 | 85 | ||
| 38 | #define WORK_DATA_INIT() ATOMIC_LONG_INIT(0) | 86 | #define WORK_DATA_INIT() ATOMIC_LONG_INIT(WORK_STRUCT_NO_CPU) |
| 39 | #define WORK_DATA_STATIC_INIT() ATOMIC_LONG_INIT(2) | 87 | #define WORK_DATA_STATIC_INIT() \ |
| 88 | ATOMIC_LONG_INIT(WORK_STRUCT_NO_CPU | WORK_STRUCT_STATIC) | ||
| 40 | 89 | ||
| 41 | struct delayed_work { | 90 | struct delayed_work { |
| 42 | struct work_struct work; | 91 | struct work_struct work; |
| @@ -96,9 +145,14 @@ struct execute_work { | |||
| 96 | #ifdef CONFIG_DEBUG_OBJECTS_WORK | 145 | #ifdef CONFIG_DEBUG_OBJECTS_WORK |
| 97 | extern void __init_work(struct work_struct *work, int onstack); | 146 | extern void __init_work(struct work_struct *work, int onstack); |
| 98 | extern void destroy_work_on_stack(struct work_struct *work); | 147 | extern void destroy_work_on_stack(struct work_struct *work); |
| 148 | static inline unsigned int work_static(struct work_struct *work) | ||
| 149 | { | ||
| 150 | return *work_data_bits(work) & WORK_STRUCT_STATIC; | ||
| 151 | } | ||
| 99 | #else | 152 | #else |
| 100 | static inline void __init_work(struct work_struct *work, int onstack) { } | 153 | static inline void __init_work(struct work_struct *work, int onstack) { } |
| 101 | static inline void destroy_work_on_stack(struct work_struct *work) { } | 154 | static inline void destroy_work_on_stack(struct work_struct *work) { } |
| 155 | static inline unsigned int work_static(struct work_struct *work) { return 0; } | ||
| 102 | #endif | 156 | #endif |
| 103 | 157 | ||
| 104 | /* | 158 | /* |
| @@ -162,7 +216,7 @@ static inline void destroy_work_on_stack(struct work_struct *work) { } | |||
| 162 | * @work: The work item in question | 216 | * @work: The work item in question |
| 163 | */ | 217 | */ |
| 164 | #define work_pending(work) \ | 218 | #define work_pending(work) \ |
| 165 | test_bit(WORK_STRUCT_PENDING, work_data_bits(work)) | 219 | test_bit(WORK_STRUCT_PENDING_BIT, work_data_bits(work)) |
| 166 | 220 | ||
| 167 | /** | 221 | /** |
| 168 | * delayed_work_pending - Find out whether a delayable work item is currently | 222 | * delayed_work_pending - Find out whether a delayable work item is currently |
| @@ -177,16 +231,56 @@ static inline void destroy_work_on_stack(struct work_struct *work) { } | |||
| 177 | * @work: The work item in question | 231 | * @work: The work item in question |
| 178 | */ | 232 | */ |
| 179 | #define work_clear_pending(work) \ | 233 | #define work_clear_pending(work) \ |
| 180 | clear_bit(WORK_STRUCT_PENDING, work_data_bits(work)) | 234 | clear_bit(WORK_STRUCT_PENDING_BIT, work_data_bits(work)) |
| 235 | |||
| 236 | enum { | ||
| 237 | WQ_NON_REENTRANT = 1 << 0, /* guarantee non-reentrance */ | ||
| 238 | WQ_UNBOUND = 1 << 1, /* not bound to any cpu */ | ||
| 239 | WQ_FREEZEABLE = 1 << 2, /* freeze during suspend */ | ||
| 240 | WQ_RESCUER = 1 << 3, /* has an rescue worker */ | ||
| 241 | WQ_HIGHPRI = 1 << 4, /* high priority */ | ||
| 242 | WQ_CPU_INTENSIVE = 1 << 5, /* cpu instensive workqueue */ | ||
| 243 | |||
| 244 | WQ_MAX_ACTIVE = 512, /* I like 512, better ideas? */ | ||
| 245 | WQ_MAX_UNBOUND_PER_CPU = 4, /* 4 * #cpus for unbound wq */ | ||
| 246 | WQ_DFL_ACTIVE = WQ_MAX_ACTIVE / 2, | ||
| 247 | }; | ||
| 181 | 248 | ||
| 249 | /* unbound wq's aren't per-cpu, scale max_active according to #cpus */ | ||
| 250 | #define WQ_UNBOUND_MAX_ACTIVE \ | ||
| 251 | max_t(int, WQ_MAX_ACTIVE, num_possible_cpus() * WQ_MAX_UNBOUND_PER_CPU) | ||
| 252 | |||
| 253 | /* | ||
| 254 | * System-wide workqueues which are always present. | ||
| 255 | * | ||
| 256 | * system_wq is the one used by schedule[_delayed]_work[_on](). | ||
| 257 | * Multi-CPU multi-threaded. There are users which expect relatively | ||
| 258 | * short queue flush time. Don't queue works which can run for too | ||
| 259 | * long. | ||
| 260 | * | ||
| 261 | * system_long_wq is similar to system_wq but may host long running | ||
| 262 | * works. Queue flushing might take relatively long. | ||
| 263 | * | ||
| 264 | * system_nrt_wq is non-reentrant and guarantees that any given work | ||
| 265 | * item is never executed in parallel by multiple CPUs. Queue | ||
| 266 | * flushing might take relatively long. | ||
| 267 | * | ||
| 268 | * system_unbound_wq is unbound workqueue. Workers are not bound to | ||
| 269 | * any specific CPU, not concurrency managed, and all queued works are | ||
| 270 | * executed immediately as long as max_active limit is not reached and | ||
| 271 | * resources are available. | ||
| 272 | */ | ||
| 273 | extern struct workqueue_struct *system_wq; | ||
| 274 | extern struct workqueue_struct *system_long_wq; | ||
| 275 | extern struct workqueue_struct *system_nrt_wq; | ||
| 276 | extern struct workqueue_struct *system_unbound_wq; | ||
| 182 | 277 | ||
| 183 | extern struct workqueue_struct * | 278 | extern struct workqueue_struct * |
| 184 | __create_workqueue_key(const char *name, int singlethread, | 279 | __alloc_workqueue_key(const char *name, unsigned int flags, int max_active, |
| 185 | int freezeable, int rt, struct lock_class_key *key, | 280 | struct lock_class_key *key, const char *lock_name); |
| 186 | const char *lock_name); | ||
| 187 | 281 | ||
| 188 | #ifdef CONFIG_LOCKDEP | 282 | #ifdef CONFIG_LOCKDEP |
| 189 | #define __create_workqueue(name, singlethread, freezeable, rt) \ | 283 | #define alloc_workqueue(name, flags, max_active) \ |
| 190 | ({ \ | 284 | ({ \ |
| 191 | static struct lock_class_key __key; \ | 285 | static struct lock_class_key __key; \ |
| 192 | const char *__lock_name; \ | 286 | const char *__lock_name; \ |
| @@ -196,20 +290,20 @@ __create_workqueue_key(const char *name, int singlethread, | |||
| 196 | else \ | 290 | else \ |
| 197 | __lock_name = #name; \ | 291 | __lock_name = #name; \ |
| 198 | \ | 292 | \ |
| 199 | __create_workqueue_key((name), (singlethread), \ | 293 | __alloc_workqueue_key((name), (flags), (max_active), \ |
| 200 | (freezeable), (rt), &__key, \ | 294 | &__key, __lock_name); \ |
| 201 | __lock_name); \ | ||
| 202 | }) | 295 | }) |
| 203 | #else | 296 | #else |
| 204 | #define __create_workqueue(name, singlethread, freezeable, rt) \ | 297 | #define alloc_workqueue(name, flags, max_active) \ |
| 205 | __create_workqueue_key((name), (singlethread), (freezeable), (rt), \ | 298 | __alloc_workqueue_key((name), (flags), (max_active), NULL, NULL) |
| 206 | NULL, NULL) | ||
| 207 | #endif | 299 | #endif |
| 208 | 300 | ||
| 209 | #define create_workqueue(name) __create_workqueue((name), 0, 0, 0) | 301 | #define create_workqueue(name) \ |
| 210 | #define create_rt_workqueue(name) __create_workqueue((name), 0, 0, 1) | 302 | alloc_workqueue((name), WQ_RESCUER, 1) |
| 211 | #define create_freezeable_workqueue(name) __create_workqueue((name), 1, 1, 0) | 303 | #define create_freezeable_workqueue(name) \ |
| 212 | #define create_singlethread_workqueue(name) __create_workqueue((name), 1, 0, 0) | 304 | alloc_workqueue((name), WQ_FREEZEABLE | WQ_UNBOUND | WQ_RESCUER, 1) |
| 305 | #define create_singlethread_workqueue(name) \ | ||
| 306 | alloc_workqueue((name), WQ_UNBOUND | WQ_RESCUER, 1) | ||
| 213 | 307 | ||
| 214 | extern void destroy_workqueue(struct workqueue_struct *wq); | 308 | extern void destroy_workqueue(struct workqueue_struct *wq); |
| 215 | 309 | ||
| @@ -231,16 +325,19 @@ extern int schedule_delayed_work(struct delayed_work *work, unsigned long delay) | |||
| 231 | extern int schedule_delayed_work_on(int cpu, struct delayed_work *work, | 325 | extern int schedule_delayed_work_on(int cpu, struct delayed_work *work, |
| 232 | unsigned long delay); | 326 | unsigned long delay); |
| 233 | extern int schedule_on_each_cpu(work_func_t func); | 327 | extern int schedule_on_each_cpu(work_func_t func); |
| 234 | extern int current_is_keventd(void); | ||
| 235 | extern int keventd_up(void); | 328 | extern int keventd_up(void); |
| 236 | 329 | ||
| 237 | extern void init_workqueues(void); | ||
| 238 | int execute_in_process_context(work_func_t fn, struct execute_work *); | 330 | int execute_in_process_context(work_func_t fn, struct execute_work *); |
| 239 | 331 | ||
| 240 | extern int flush_work(struct work_struct *work); | 332 | extern int flush_work(struct work_struct *work); |
| 241 | |||
| 242 | extern int cancel_work_sync(struct work_struct *work); | 333 | extern int cancel_work_sync(struct work_struct *work); |
| 243 | 334 | ||
| 335 | extern void workqueue_set_max_active(struct workqueue_struct *wq, | ||
| 336 | int max_active); | ||
| 337 | extern bool workqueue_congested(unsigned int cpu, struct workqueue_struct *wq); | ||
| 338 | extern unsigned int work_cpu(struct work_struct *work); | ||
| 339 | extern unsigned int work_busy(struct work_struct *work); | ||
| 340 | |||
| 244 | /* | 341 | /* |
| 245 | * Kill off a pending schedule_delayed_work(). Note that the work callback | 342 | * Kill off a pending schedule_delayed_work(). Note that the work callback |
| 246 | * function may still be running on return from cancel_delayed_work(), unless | 343 | * function may still be running on return from cancel_delayed_work(), unless |
| @@ -297,4 +394,15 @@ static inline long work_on_cpu(unsigned int cpu, long (*fn)(void *), void *arg) | |||
| 297 | #else | 394 | #else |
| 298 | long work_on_cpu(unsigned int cpu, long (*fn)(void *), void *arg); | 395 | long work_on_cpu(unsigned int cpu, long (*fn)(void *), void *arg); |
| 299 | #endif /* CONFIG_SMP */ | 396 | #endif /* CONFIG_SMP */ |
| 397 | |||
| 398 | #ifdef CONFIG_FREEZER | ||
| 399 | extern void freeze_workqueues_begin(void); | ||
| 400 | extern bool freeze_workqueues_busy(void); | ||
| 401 | extern void thaw_workqueues(void); | ||
| 402 | #endif /* CONFIG_FREEZER */ | ||
| 403 | |||
| 404 | #ifdef CONFIG_LOCKDEP | ||
| 405 | int in_workqueue_context(struct workqueue_struct *wq); | ||
| 406 | #endif | ||
| 407 | |||
| 300 | #endif | 408 | #endif |
diff --git a/include/linux/xattr.h b/include/linux/xattr.h index 0cfa1e9c4cc1..f1e5bde4b35a 100644 --- a/include/linux/xattr.h +++ b/include/linux/xattr.h | |||
| @@ -33,6 +33,20 @@ | |||
| 33 | #define XATTR_USER_PREFIX "user." | 33 | #define XATTR_USER_PREFIX "user." |
| 34 | #define XATTR_USER_PREFIX_LEN (sizeof (XATTR_USER_PREFIX) - 1) | 34 | #define XATTR_USER_PREFIX_LEN (sizeof (XATTR_USER_PREFIX) - 1) |
| 35 | 35 | ||
| 36 | /* Security namespace */ | ||
| 37 | #define XATTR_SELINUX_SUFFIX "selinux" | ||
| 38 | #define XATTR_NAME_SELINUX XATTR_SECURITY_PREFIX XATTR_SELINUX_SUFFIX | ||
| 39 | |||
| 40 | #define XATTR_SMACK_SUFFIX "SMACK64" | ||
| 41 | #define XATTR_SMACK_IPIN "SMACK64IPIN" | ||
| 42 | #define XATTR_SMACK_IPOUT "SMACK64IPOUT" | ||
| 43 | #define XATTR_NAME_SMACK XATTR_SECURITY_PREFIX XATTR_SMACK_SUFFIX | ||
| 44 | #define XATTR_NAME_SMACKIPIN XATTR_SECURITY_PREFIX XATTR_SMACK_IPIN | ||
| 45 | #define XATTR_NAME_SMACKIPOUT XATTR_SECURITY_PREFIX XATTR_SMACK_IPOUT | ||
| 46 | |||
| 47 | #define XATTR_CAPS_SUFFIX "capability" | ||
| 48 | #define XATTR_NAME_CAPS XATTR_SECURITY_PREFIX XATTR_CAPS_SUFFIX | ||
| 49 | |||
| 36 | struct inode; | 50 | struct inode; |
| 37 | struct dentry; | 51 | struct dentry; |
| 38 | 52 | ||
