diff options
author | Ingo Molnar <mingo@kernel.org> | 2013-12-16 08:51:32 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2013-12-16 08:51:32 -0500 |
commit | fe361cfcf40ad4612226347573a8669cd0d44799 (patch) | |
tree | e874ef5a29c3bfe3dd67dc2d8962562c00fc8e3a /include | |
parent | c7f2e3cd6c1f4932ccc4135d050eae3f7c7aef63 (diff) | |
parent | 319e2e3f63c348a9b66db4667efa73178e18b17d (diff) |
Merge tag 'v3.13-rc4' into perf/core
Merge Linux 3.13-rc4, to refresh this branch with the latest fixes.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include')
102 files changed, 1351 insertions, 516 deletions
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h index d98c67001840..3ea214cff349 100644 --- a/include/acpi/acconfig.h +++ b/include/acpi/acconfig.h | |||
@@ -83,7 +83,9 @@ | |||
83 | * Should the subsystem abort the loading of an ACPI table if the | 83 | * Should the subsystem abort the loading of an ACPI table if the |
84 | * table checksum is incorrect? | 84 | * table checksum is incorrect? |
85 | */ | 85 | */ |
86 | #ifndef ACPI_CHECKSUM_ABORT | ||
86 | #define ACPI_CHECKSUM_ABORT FALSE | 87 | #define ACPI_CHECKSUM_ABORT FALSE |
88 | #endif | ||
87 | 89 | ||
88 | /* | 90 | /* |
89 | * Generate a version of ACPICA that only supports "reduced hardware" | 91 | * Generate a version of ACPICA that only supports "reduced hardware" |
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 89c60b0f6408..c602c7718421 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h | |||
@@ -100,6 +100,7 @@ enum acpi_hotplug_mode { | |||
100 | struct acpi_hotplug_profile { | 100 | struct acpi_hotplug_profile { |
101 | struct kobject kobj; | 101 | struct kobject kobj; |
102 | bool enabled:1; | 102 | bool enabled:1; |
103 | bool ignore:1; | ||
103 | enum acpi_hotplug_mode mode; | 104 | enum acpi_hotplug_mode mode; |
104 | }; | 105 | }; |
105 | 106 | ||
@@ -431,9 +432,9 @@ static inline acpi_handle acpi_get_child(acpi_handle handle, u64 addr) | |||
431 | { | 432 | { |
432 | return acpi_find_child(handle, addr, false); | 433 | return acpi_find_child(handle, addr, false); |
433 | } | 434 | } |
435 | void acpi_preset_companion(struct device *dev, acpi_handle parent, u64 addr); | ||
434 | int acpi_is_root_bridge(acpi_handle); | 436 | int acpi_is_root_bridge(acpi_handle); |
435 | struct acpi_pci_root *acpi_pci_find_root(acpi_handle handle); | 437 | struct acpi_pci_root *acpi_pci_find_root(acpi_handle handle); |
436 | #define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)ACPI_HANDLE(dev)) | ||
437 | 438 | ||
438 | int acpi_enable_wakeup_device_power(struct acpi_device *dev, int state); | 439 | int acpi_enable_wakeup_device_power(struct acpi_device *dev, int state); |
439 | int acpi_disable_wakeup_device_power(struct acpi_device *dev); | 440 | int acpi_disable_wakeup_device_power(struct acpi_device *dev); |
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index d8f9457755b4..4278aba96503 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h | |||
@@ -46,7 +46,7 @@ | |||
46 | 46 | ||
47 | /* Current ACPICA subsystem version in YYYYMMDD format */ | 47 | /* Current ACPICA subsystem version in YYYYMMDD format */ |
48 | 48 | ||
49 | #define ACPI_CA_VERSION 0x20130927 | 49 | #define ACPI_CA_VERSION 0x20131115 |
50 | 50 | ||
51 | #include <acpi/acconfig.h> | 51 | #include <acpi/acconfig.h> |
52 | #include <acpi/actypes.h> | 52 | #include <acpi/actypes.h> |
diff --git a/include/asm-generic/simd.h b/include/asm-generic/simd.h new file mode 100644 index 000000000000..f57eb7b5c23b --- /dev/null +++ b/include/asm-generic/simd.h | |||
@@ -0,0 +1,14 @@ | |||
1 | |||
2 | #include <linux/hardirq.h> | ||
3 | |||
4 | /* | ||
5 | * may_use_simd - whether it is allowable at this time to issue SIMD | ||
6 | * instructions or access the SIMD register file | ||
7 | * | ||
8 | * As architectures typically don't preserve the SIMD register file when | ||
9 | * taking an interrupt, !in_interrupt() should be a reasonable default. | ||
10 | */ | ||
11 | static __must_check inline bool may_use_simd(void) | ||
12 | { | ||
13 | return !in_interrupt(); | ||
14 | } | ||
diff --git a/include/asm-generic/word-at-a-time.h b/include/asm-generic/word-at-a-time.h index 3f21f1b72e45..d3909effd725 100644 --- a/include/asm-generic/word-at-a-time.h +++ b/include/asm-generic/word-at-a-time.h | |||
@@ -49,4 +49,12 @@ static inline bool has_zero(unsigned long val, unsigned long *data, const struct | |||
49 | return (val + c->high_bits) & ~rhs; | 49 | return (val + c->high_bits) & ~rhs; |
50 | } | 50 | } |
51 | 51 | ||
52 | #ifndef zero_bytemask | ||
53 | #ifdef CONFIG_64BIT | ||
54 | #define zero_bytemask(mask) (~0ul << fls64(mask)) | ||
55 | #else | ||
56 | #define zero_bytemask(mask) (~0ul << fls(mask)) | ||
57 | #endif /* CONFIG_64BIT */ | ||
58 | #endif /* zero_bytemask */ | ||
59 | |||
52 | #endif /* _ASM_WORD_AT_A_TIME_H */ | 60 | #endif /* _ASM_WORD_AT_A_TIME_H */ |
diff --git a/include/crypto/ablk_helper.h b/include/crypto/ablk_helper.h new file mode 100644 index 000000000000..4f93df50c23e --- /dev/null +++ b/include/crypto/ablk_helper.h | |||
@@ -0,0 +1,31 @@ | |||
1 | /* | ||
2 | * Shared async block cipher helpers | ||
3 | */ | ||
4 | |||
5 | #ifndef _CRYPTO_ABLK_HELPER_H | ||
6 | #define _CRYPTO_ABLK_HELPER_H | ||
7 | |||
8 | #include <linux/crypto.h> | ||
9 | #include <linux/kernel.h> | ||
10 | #include <crypto/cryptd.h> | ||
11 | |||
12 | struct async_helper_ctx { | ||
13 | struct cryptd_ablkcipher *cryptd_tfm; | ||
14 | }; | ||
15 | |||
16 | extern int ablk_set_key(struct crypto_ablkcipher *tfm, const u8 *key, | ||
17 | unsigned int key_len); | ||
18 | |||
19 | extern int __ablk_encrypt(struct ablkcipher_request *req); | ||
20 | |||
21 | extern int ablk_encrypt(struct ablkcipher_request *req); | ||
22 | |||
23 | extern int ablk_decrypt(struct ablkcipher_request *req); | ||
24 | |||
25 | extern void ablk_exit(struct crypto_tfm *tfm); | ||
26 | |||
27 | extern int ablk_init_common(struct crypto_tfm *tfm, const char *drv_name); | ||
28 | |||
29 | extern int ablk_init(struct crypto_tfm *tfm); | ||
30 | |||
31 | #endif /* _CRYPTO_ABLK_HELPER_H */ | ||
diff --git a/include/crypto/algapi.h b/include/crypto/algapi.h index 418d270e1806..e73c19e90e38 100644 --- a/include/crypto/algapi.h +++ b/include/crypto/algapi.h | |||
@@ -386,5 +386,21 @@ static inline int crypto_requires_sync(u32 type, u32 mask) | |||
386 | return (type ^ CRYPTO_ALG_ASYNC) & mask & CRYPTO_ALG_ASYNC; | 386 | return (type ^ CRYPTO_ALG_ASYNC) & mask & CRYPTO_ALG_ASYNC; |
387 | } | 387 | } |
388 | 388 | ||
389 | #endif /* _CRYPTO_ALGAPI_H */ | 389 | noinline unsigned long __crypto_memneq(const void *a, const void *b, size_t size); |
390 | |||
391 | /** | ||
392 | * crypto_memneq - Compare two areas of memory without leaking | ||
393 | * timing information. | ||
394 | * | ||
395 | * @a: One area of memory | ||
396 | * @b: Another area of memory | ||
397 | * @size: The size of the area. | ||
398 | * | ||
399 | * Returns 0 when data is equal, 1 otherwise. | ||
400 | */ | ||
401 | static inline int crypto_memneq(const void *a, const void *b, size_t size) | ||
402 | { | ||
403 | return __crypto_memneq(a, b, size) != 0UL ? 1 : 0; | ||
404 | } | ||
390 | 405 | ||
406 | #endif /* _CRYPTO_ALGAPI_H */ | ||
diff --git a/include/crypto/authenc.h b/include/crypto/authenc.h index e47b044929a8..6775059539b5 100644 --- a/include/crypto/authenc.h +++ b/include/crypto/authenc.h | |||
@@ -23,5 +23,15 @@ struct crypto_authenc_key_param { | |||
23 | __be32 enckeylen; | 23 | __be32 enckeylen; |
24 | }; | 24 | }; |
25 | 25 | ||
26 | #endif /* _CRYPTO_AUTHENC_H */ | 26 | struct crypto_authenc_keys { |
27 | const u8 *authkey; | ||
28 | const u8 *enckey; | ||
29 | |||
30 | unsigned int authkeylen; | ||
31 | unsigned int enckeylen; | ||
32 | }; | ||
27 | 33 | ||
34 | int crypto_authenc_extractkeys(struct crypto_authenc_keys *keys, const u8 *key, | ||
35 | unsigned int keylen); | ||
36 | |||
37 | #endif /* _CRYPTO_AUTHENC_H */ | ||
diff --git a/include/crypto/hash_info.h b/include/crypto/hash_info.h new file mode 100644 index 000000000000..e1e5a3e5dd1b --- /dev/null +++ b/include/crypto/hash_info.h | |||
@@ -0,0 +1,40 @@ | |||
1 | /* | ||
2 | * Hash Info: Hash algorithms information | ||
3 | * | ||
4 | * Copyright (c) 2013 Dmitry Kasatkin <d.kasatkin@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 Free | ||
8 | * Software Foundation; either version 2 of the License, or (at your option) | ||
9 | * any later version. | ||
10 | * | ||
11 | */ | ||
12 | |||
13 | #ifndef _CRYPTO_HASH_INFO_H | ||
14 | #define _CRYPTO_HASH_INFO_H | ||
15 | |||
16 | #include <crypto/sha.h> | ||
17 | #include <crypto/md5.h> | ||
18 | |||
19 | #include <uapi/linux/hash_info.h> | ||
20 | |||
21 | /* not defined in include/crypto/ */ | ||
22 | #define RMD128_DIGEST_SIZE 16 | ||
23 | #define RMD160_DIGEST_SIZE 20 | ||
24 | #define RMD256_DIGEST_SIZE 32 | ||
25 | #define RMD320_DIGEST_SIZE 40 | ||
26 | |||
27 | /* not defined in include/crypto/ */ | ||
28 | #define WP512_DIGEST_SIZE 64 | ||
29 | #define WP384_DIGEST_SIZE 48 | ||
30 | #define WP256_DIGEST_SIZE 32 | ||
31 | |||
32 | /* not defined in include/crypto/ */ | ||
33 | #define TGR128_DIGEST_SIZE 16 | ||
34 | #define TGR160_DIGEST_SIZE 20 | ||
35 | #define TGR192_DIGEST_SIZE 24 | ||
36 | |||
37 | extern const char *const hash_algo_name[HASH_ALGO__LAST]; | ||
38 | extern const int hash_digest_size[HASH_ALGO__LAST]; | ||
39 | |||
40 | #endif /* _CRYPTO_HASH_INFO_H */ | ||
diff --git a/include/crypto/public_key.h b/include/crypto/public_key.h index f5b0224c9967..fc09732613ad 100644 --- a/include/crypto/public_key.h +++ b/include/crypto/public_key.h | |||
@@ -15,6 +15,7 @@ | |||
15 | #define _LINUX_PUBLIC_KEY_H | 15 | #define _LINUX_PUBLIC_KEY_H |
16 | 16 | ||
17 | #include <linux/mpi.h> | 17 | #include <linux/mpi.h> |
18 | #include <crypto/hash_info.h> | ||
18 | 19 | ||
19 | enum pkey_algo { | 20 | enum pkey_algo { |
20 | PKEY_ALGO_DSA, | 21 | PKEY_ALGO_DSA, |
@@ -22,21 +23,11 @@ enum pkey_algo { | |||
22 | PKEY_ALGO__LAST | 23 | PKEY_ALGO__LAST |
23 | }; | 24 | }; |
24 | 25 | ||
25 | extern const char *const pkey_algo[PKEY_ALGO__LAST]; | 26 | extern const char *const pkey_algo_name[PKEY_ALGO__LAST]; |
27 | extern const struct public_key_algorithm *pkey_algo[PKEY_ALGO__LAST]; | ||
26 | 28 | ||
27 | enum pkey_hash_algo { | 29 | /* asymmetric key implementation supports only up to SHA224 */ |
28 | PKEY_HASH_MD4, | 30 | #define PKEY_HASH__LAST (HASH_ALGO_SHA224 + 1) |
29 | PKEY_HASH_MD5, | ||
30 | PKEY_HASH_SHA1, | ||
31 | PKEY_HASH_RIPE_MD_160, | ||
32 | PKEY_HASH_SHA256, | ||
33 | PKEY_HASH_SHA384, | ||
34 | PKEY_HASH_SHA512, | ||
35 | PKEY_HASH_SHA224, | ||
36 | PKEY_HASH__LAST | ||
37 | }; | ||
38 | |||
39 | extern const char *const pkey_hash_algo[PKEY_HASH__LAST]; | ||
40 | 31 | ||
41 | enum pkey_id_type { | 32 | enum pkey_id_type { |
42 | PKEY_ID_PGP, /* OpenPGP generated key ID */ | 33 | PKEY_ID_PGP, /* OpenPGP generated key ID */ |
@@ -44,7 +35,7 @@ enum pkey_id_type { | |||
44 | PKEY_ID_TYPE__LAST | 35 | PKEY_ID_TYPE__LAST |
45 | }; | 36 | }; |
46 | 37 | ||
47 | extern const char *const pkey_id_type[PKEY_ID_TYPE__LAST]; | 38 | extern const char *const pkey_id_type_name[PKEY_ID_TYPE__LAST]; |
48 | 39 | ||
49 | /* | 40 | /* |
50 | * Cryptographic data for the public-key subtype of the asymmetric key type. | 41 | * Cryptographic data for the public-key subtype of the asymmetric key type. |
@@ -59,6 +50,7 @@ struct public_key { | |||
59 | #define PKEY_CAN_DECRYPT 0x02 | 50 | #define PKEY_CAN_DECRYPT 0x02 |
60 | #define PKEY_CAN_SIGN 0x04 | 51 | #define PKEY_CAN_SIGN 0x04 |
61 | #define PKEY_CAN_VERIFY 0x08 | 52 | #define PKEY_CAN_VERIFY 0x08 |
53 | enum pkey_algo pkey_algo : 8; | ||
62 | enum pkey_id_type id_type : 8; | 54 | enum pkey_id_type id_type : 8; |
63 | union { | 55 | union { |
64 | MPI mpi[5]; | 56 | MPI mpi[5]; |
@@ -88,7 +80,8 @@ struct public_key_signature { | |||
88 | u8 *digest; | 80 | u8 *digest; |
89 | u8 digest_size; /* Number of bytes in digest */ | 81 | u8 digest_size; /* Number of bytes in digest */ |
90 | u8 nr_mpi; /* Occupancy of mpi[] */ | 82 | u8 nr_mpi; /* Occupancy of mpi[] */ |
91 | enum pkey_hash_algo pkey_hash_algo : 8; | 83 | enum pkey_algo pkey_algo : 8; |
84 | enum hash_algo pkey_hash_algo : 8; | ||
92 | union { | 85 | union { |
93 | MPI mpi[2]; | 86 | MPI mpi[2]; |
94 | struct { | 87 | struct { |
diff --git a/include/crypto/scatterwalk.h b/include/crypto/scatterwalk.h index 13621cc8cf4c..6a626a507b8c 100644 --- a/include/crypto/scatterwalk.h +++ b/include/crypto/scatterwalk.h | |||
@@ -36,6 +36,7 @@ static inline void scatterwalk_sg_chain(struct scatterlist *sg1, int num, | |||
36 | { | 36 | { |
37 | sg_set_page(&sg1[num - 1], (void *)sg2, 0, 0); | 37 | sg_set_page(&sg1[num - 1], (void *)sg2, 0, 0); |
38 | sg1[num - 1].page_link &= ~0x02; | 38 | sg1[num - 1].page_link &= ~0x02; |
39 | sg1[num - 1].page_link |= 0x01; | ||
39 | } | 40 | } |
40 | 41 | ||
41 | static inline struct scatterlist *scatterwalk_sg_next(struct scatterlist *sg) | 42 | static inline struct scatterlist *scatterwalk_sg_next(struct scatterlist *sg) |
@@ -43,7 +44,7 @@ static inline struct scatterlist *scatterwalk_sg_next(struct scatterlist *sg) | |||
43 | if (sg_is_last(sg)) | 44 | if (sg_is_last(sg)) |
44 | return NULL; | 45 | return NULL; |
45 | 46 | ||
46 | return (++sg)->length ? sg : (void *)sg_page(sg); | 47 | return (++sg)->length ? sg : sg_chain_ptr(sg); |
47 | } | 48 | } |
48 | 49 | ||
49 | static inline void scatterwalk_crypto_chain(struct scatterlist *head, | 50 | static inline void scatterwalk_crypto_chain(struct scatterlist *head, |
diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h index 751eaffbf0d5..ee127ec33c60 100644 --- a/include/drm/ttm/ttm_bo_api.h +++ b/include/drm/ttm/ttm_bo_api.h | |||
@@ -169,6 +169,7 @@ struct ttm_tt; | |||
169 | * @offset: The current GPU offset, which can have different meanings | 169 | * @offset: The current GPU offset, which can have different meanings |
170 | * depending on the memory type. For SYSTEM type memory, it should be 0. | 170 | * depending on the memory type. For SYSTEM type memory, it should be 0. |
171 | * @cur_placement: Hint of current placement. | 171 | * @cur_placement: Hint of current placement. |
172 | * @wu_mutex: Wait unreserved mutex. | ||
172 | * | 173 | * |
173 | * Base class for TTM buffer object, that deals with data placement and CPU | 174 | * Base class for TTM buffer object, that deals with data placement and CPU |
174 | * mappings. GPU mappings are really up to the driver, but for simpler GPUs | 175 | * mappings. GPU mappings are really up to the driver, but for simpler GPUs |
@@ -250,6 +251,7 @@ struct ttm_buffer_object { | |||
250 | 251 | ||
251 | struct reservation_object *resv; | 252 | struct reservation_object *resv; |
252 | struct reservation_object ttm_resv; | 253 | struct reservation_object ttm_resv; |
254 | struct mutex wu_mutex; | ||
253 | }; | 255 | }; |
254 | 256 | ||
255 | /** | 257 | /** |
@@ -702,5 +704,5 @@ extern ssize_t ttm_bo_io(struct ttm_bo_device *bdev, struct file *filp, | |||
702 | size_t count, loff_t *f_pos, bool write); | 704 | size_t count, loff_t *f_pos, bool write); |
703 | 705 | ||
704 | extern void ttm_bo_swapout_all(struct ttm_bo_device *bdev); | 706 | extern void ttm_bo_swapout_all(struct ttm_bo_device *bdev); |
705 | 707 | extern int ttm_bo_wait_unreserved(struct ttm_buffer_object *bo); | |
706 | #endif | 708 | #endif |
diff --git a/include/drm/ttm/ttm_execbuf_util.h b/include/drm/ttm/ttm_execbuf_util.h index ec8a1d306510..16db7d01a336 100644 --- a/include/drm/ttm/ttm_execbuf_util.h +++ b/include/drm/ttm/ttm_execbuf_util.h | |||
@@ -70,7 +70,8 @@ extern void ttm_eu_backoff_reservation(struct ww_acquire_ctx *ticket, | |||
70 | /** | 70 | /** |
71 | * function ttm_eu_reserve_buffers | 71 | * function ttm_eu_reserve_buffers |
72 | * | 72 | * |
73 | * @ticket: [out] ww_acquire_ctx returned by call. | 73 | * @ticket: [out] ww_acquire_ctx filled in by call, or NULL if only |
74 | * non-blocking reserves should be tried. | ||
74 | * @list: thread private list of ttm_validate_buffer structs. | 75 | * @list: thread private list of ttm_validate_buffer structs. |
75 | * | 76 | * |
76 | * Tries to reserve bos pointed to by the list entries for validation. | 77 | * Tries to reserve bos pointed to by the list entries for validation. |
diff --git a/include/drm/ttm/ttm_object.h b/include/drm/ttm/ttm_object.h index fc0cf0649901..58b029894eb3 100644 --- a/include/drm/ttm/ttm_object.h +++ b/include/drm/ttm/ttm_object.h | |||
@@ -41,6 +41,7 @@ | |||
41 | #include <drm/drm_hashtab.h> | 41 | #include <drm/drm_hashtab.h> |
42 | #include <linux/kref.h> | 42 | #include <linux/kref.h> |
43 | #include <linux/rcupdate.h> | 43 | #include <linux/rcupdate.h> |
44 | #include <linux/dma-buf.h> | ||
44 | #include <ttm/ttm_memory.h> | 45 | #include <ttm/ttm_memory.h> |
45 | 46 | ||
46 | /** | 47 | /** |
@@ -77,6 +78,7 @@ enum ttm_object_type { | |||
77 | ttm_fence_type, | 78 | ttm_fence_type, |
78 | ttm_buffer_type, | 79 | ttm_buffer_type, |
79 | ttm_lock_type, | 80 | ttm_lock_type, |
81 | ttm_prime_type, | ||
80 | ttm_driver_type0 = 256, | 82 | ttm_driver_type0 = 256, |
81 | ttm_driver_type1, | 83 | ttm_driver_type1, |
82 | ttm_driver_type2, | 84 | ttm_driver_type2, |
@@ -132,6 +134,30 @@ struct ttm_base_object { | |||
132 | enum ttm_ref_type ref_type); | 134 | enum ttm_ref_type ref_type); |
133 | }; | 135 | }; |
134 | 136 | ||
137 | |||
138 | /** | ||
139 | * struct ttm_prime_object - Modified base object that is prime-aware | ||
140 | * | ||
141 | * @base: struct ttm_base_object that we derive from | ||
142 | * @mutex: Mutex protecting the @dma_buf member. | ||
143 | * @size: Size of the dma_buf associated with this object | ||
144 | * @real_type: Type of the underlying object. Needed since we're setting | ||
145 | * the value of @base::object_type to ttm_prime_type | ||
146 | * @dma_buf: Non ref-coutned pointer to a struct dma_buf created from this | ||
147 | * object. | ||
148 | * @refcount_release: The underlying object's release method. Needed since | ||
149 | * we set @base::refcount_release to our own release method. | ||
150 | */ | ||
151 | |||
152 | struct ttm_prime_object { | ||
153 | struct ttm_base_object base; | ||
154 | struct mutex mutex; | ||
155 | size_t size; | ||
156 | enum ttm_object_type real_type; | ||
157 | struct dma_buf *dma_buf; | ||
158 | void (*refcount_release) (struct ttm_base_object **); | ||
159 | }; | ||
160 | |||
135 | /** | 161 | /** |
136 | * ttm_base_object_init | 162 | * ttm_base_object_init |
137 | * | 163 | * |
@@ -248,14 +274,18 @@ extern void ttm_object_file_release(struct ttm_object_file **p_tfile); | |||
248 | /** | 274 | /** |
249 | * ttm_object device init - initialize a struct ttm_object_device | 275 | * ttm_object device init - initialize a struct ttm_object_device |
250 | * | 276 | * |
277 | * @mem_glob: struct ttm_mem_global for memory accounting. | ||
251 | * @hash_order: Order of hash table used to hash the base objects. | 278 | * @hash_order: Order of hash table used to hash the base objects. |
279 | * @ops: DMA buf ops for prime objects of this device. | ||
252 | * | 280 | * |
253 | * This function is typically called on device initialization to prepare | 281 | * This function is typically called on device initialization to prepare |
254 | * data structures needed for ttm base and ref objects. | 282 | * data structures needed for ttm base and ref objects. |
255 | */ | 283 | */ |
256 | 284 | ||
257 | extern struct ttm_object_device *ttm_object_device_init | 285 | extern struct ttm_object_device * |
258 | (struct ttm_mem_global *mem_glob, unsigned int hash_order); | 286 | ttm_object_device_init(struct ttm_mem_global *mem_glob, |
287 | unsigned int hash_order, | ||
288 | const struct dma_buf_ops *ops); | ||
259 | 289 | ||
260 | /** | 290 | /** |
261 | * ttm_object_device_release - release data held by a ttm_object_device | 291 | * ttm_object_device_release - release data held by a ttm_object_device |
@@ -272,4 +302,31 @@ extern void ttm_object_device_release(struct ttm_object_device **p_tdev); | |||
272 | 302 | ||
273 | #define ttm_base_object_kfree(__object, __base)\ | 303 | #define ttm_base_object_kfree(__object, __base)\ |
274 | kfree_rcu(__object, __base.rhead) | 304 | kfree_rcu(__object, __base.rhead) |
305 | |||
306 | extern int ttm_prime_object_init(struct ttm_object_file *tfile, | ||
307 | size_t size, | ||
308 | struct ttm_prime_object *prime, | ||
309 | bool shareable, | ||
310 | enum ttm_object_type type, | ||
311 | void (*refcount_release) | ||
312 | (struct ttm_base_object **), | ||
313 | void (*ref_obj_release) | ||
314 | (struct ttm_base_object *, | ||
315 | enum ttm_ref_type ref_type)); | ||
316 | |||
317 | static inline enum ttm_object_type | ||
318 | ttm_base_object_type(struct ttm_base_object *base) | ||
319 | { | ||
320 | return (base->object_type == ttm_prime_type) ? | ||
321 | container_of(base, struct ttm_prime_object, base)->real_type : | ||
322 | base->object_type; | ||
323 | } | ||
324 | extern int ttm_prime_fd_to_handle(struct ttm_object_file *tfile, | ||
325 | int fd, u32 *handle); | ||
326 | extern int ttm_prime_handle_to_fd(struct ttm_object_file *tfile, | ||
327 | uint32_t handle, uint32_t flags, | ||
328 | int *prime_fd); | ||
329 | |||
330 | #define ttm_prime_object_kfree(__obj, __prime) \ | ||
331 | kfree_rcu(__obj, __prime.base.rhead) | ||
275 | #endif | 332 | #endif |
diff --git a/include/keys/big_key-type.h b/include/keys/big_key-type.h new file mode 100644 index 000000000000..d69bc8af3292 --- /dev/null +++ b/include/keys/big_key-type.h | |||
@@ -0,0 +1,25 @@ | |||
1 | /* Big capacity key type. | ||
2 | * | ||
3 | * Copyright (C) 2013 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 License | ||
8 | * as published by the Free Software Foundation; either version | ||
9 | * 2 of the License, or (at your option) any later version. | ||
10 | */ | ||
11 | |||
12 | #ifndef _KEYS_BIG_KEY_TYPE_H | ||
13 | #define _KEYS_BIG_KEY_TYPE_H | ||
14 | |||
15 | #include <linux/key-type.h> | ||
16 | |||
17 | extern struct key_type key_type_big_key; | ||
18 | |||
19 | extern int big_key_instantiate(struct key *key, struct key_preparsed_payload *prep); | ||
20 | extern void big_key_revoke(struct key *key); | ||
21 | extern void big_key_destroy(struct key *key); | ||
22 | extern void big_key_describe(const struct key *big_key, struct seq_file *m); | ||
23 | extern long big_key_read(const struct key *key, char __user *buffer, size_t buflen); | ||
24 | |||
25 | #endif /* _KEYS_BIG_KEY_TYPE_H */ | ||
diff --git a/include/keys/keyring-type.h b/include/keys/keyring-type.h index cf49159b0e3a..fca5c62340a4 100644 --- a/include/keys/keyring-type.h +++ b/include/keys/keyring-type.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* Keyring key type | 1 | /* Keyring key type |
2 | * | 2 | * |
3 | * Copyright (C) 2008 Red Hat, Inc. All Rights Reserved. | 3 | * Copyright (C) 2008, 2013 Red Hat, Inc. All Rights Reserved. |
4 | * Written by David Howells (dhowells@redhat.com) | 4 | * Written by David Howells (dhowells@redhat.com) |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or | 6 | * This program is free software; you can redistribute it and/or |
@@ -13,19 +13,6 @@ | |||
13 | #define _KEYS_KEYRING_TYPE_H | 13 | #define _KEYS_KEYRING_TYPE_H |
14 | 14 | ||
15 | #include <linux/key.h> | 15 | #include <linux/key.h> |
16 | #include <linux/rcupdate.h> | 16 | #include <linux/assoc_array.h> |
17 | |||
18 | /* | ||
19 | * the keyring payload contains a list of the keys to which the keyring is | ||
20 | * subscribed | ||
21 | */ | ||
22 | struct keyring_list { | ||
23 | struct rcu_head rcu; /* RCU deletion hook */ | ||
24 | unsigned short maxkeys; /* max keys this list can hold */ | ||
25 | unsigned short nkeys; /* number of keys currently held */ | ||
26 | unsigned short delkey; /* key to be unlinked by RCU */ | ||
27 | struct key __rcu *keys[0]; | ||
28 | }; | ||
29 | |||
30 | 17 | ||
31 | #endif /* _KEYS_KEYRING_TYPE_H */ | 18 | #endif /* _KEYS_KEYRING_TYPE_H */ |
diff --git a/include/keys/system_keyring.h b/include/keys/system_keyring.h new file mode 100644 index 000000000000..8dabc399bd1d --- /dev/null +++ b/include/keys/system_keyring.h | |||
@@ -0,0 +1,23 @@ | |||
1 | /* System keyring containing trusted public keys. | ||
2 | * | ||
3 | * Copyright (C) 2013 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 | |||
12 | #ifndef _KEYS_SYSTEM_KEYRING_H | ||
13 | #define _KEYS_SYSTEM_KEYRING_H | ||
14 | |||
15 | #ifdef CONFIG_SYSTEM_TRUSTED_KEYRING | ||
16 | |||
17 | #include <linux/key.h> | ||
18 | |||
19 | extern struct key *system_trusted_keyring; | ||
20 | |||
21 | #endif | ||
22 | |||
23 | #endif /* _KEYS_SYSTEM_KEYRING_H */ | ||
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index b0972c4ce81c..d9099b15b472 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
@@ -44,6 +44,20 @@ | |||
44 | #include <acpi/acpi_numa.h> | 44 | #include <acpi/acpi_numa.h> |
45 | #include <asm/acpi.h> | 45 | #include <asm/acpi.h> |
46 | 46 | ||
47 | static inline acpi_handle acpi_device_handle(struct acpi_device *adev) | ||
48 | { | ||
49 | return adev ? adev->handle : NULL; | ||
50 | } | ||
51 | |||
52 | #define ACPI_COMPANION(dev) ((dev)->acpi_node.companion) | ||
53 | #define ACPI_COMPANION_SET(dev, adev) ACPI_COMPANION(dev) = (adev) | ||
54 | #define ACPI_HANDLE(dev) acpi_device_handle(ACPI_COMPANION(dev)) | ||
55 | |||
56 | static inline const char *acpi_dev_name(struct acpi_device *adev) | ||
57 | { | ||
58 | return dev_name(&adev->dev); | ||
59 | } | ||
60 | |||
47 | enum acpi_irq_model_id { | 61 | enum acpi_irq_model_id { |
48 | ACPI_IRQ_MODEL_PIC = 0, | 62 | ACPI_IRQ_MODEL_PIC = 0, |
49 | ACPI_IRQ_MODEL_IOAPIC, | 63 | ACPI_IRQ_MODEL_IOAPIC, |
@@ -401,6 +415,15 @@ static inline bool acpi_driver_match_device(struct device *dev, | |||
401 | 415 | ||
402 | #define acpi_disabled 1 | 416 | #define acpi_disabled 1 |
403 | 417 | ||
418 | #define ACPI_COMPANION(dev) (NULL) | ||
419 | #define ACPI_COMPANION_SET(dev, adev) do { } while (0) | ||
420 | #define ACPI_HANDLE(dev) (NULL) | ||
421 | |||
422 | static inline const char *acpi_dev_name(struct acpi_device *adev) | ||
423 | { | ||
424 | return NULL; | ||
425 | } | ||
426 | |||
404 | static inline void acpi_early_init(void) { } | 427 | static inline void acpi_early_init(void) { } |
405 | 428 | ||
406 | static inline int early_acpi_boot_init(void) | 429 | static inline int early_acpi_boot_init(void) |
diff --git a/include/linux/assoc_array.h b/include/linux/assoc_array.h new file mode 100644 index 000000000000..a89df3be1686 --- /dev/null +++ b/include/linux/assoc_array.h | |||
@@ -0,0 +1,92 @@ | |||
1 | /* Generic associative array implementation. | ||
2 | * | ||
3 | * See Documentation/assoc_array.txt for information. | ||
4 | * | ||
5 | * Copyright (C) 2013 Red Hat, Inc. All Rights Reserved. | ||
6 | * Written by David Howells (dhowells@redhat.com) | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public Licence | ||
10 | * as published by the Free Software Foundation; either version | ||
11 | * 2 of the Licence, or (at your option) any later version. | ||
12 | */ | ||
13 | |||
14 | #ifndef _LINUX_ASSOC_ARRAY_H | ||
15 | #define _LINUX_ASSOC_ARRAY_H | ||
16 | |||
17 | #ifdef CONFIG_ASSOCIATIVE_ARRAY | ||
18 | |||
19 | #include <linux/types.h> | ||
20 | |||
21 | #define ASSOC_ARRAY_KEY_CHUNK_SIZE BITS_PER_LONG /* Key data retrieved in chunks of this size */ | ||
22 | |||
23 | /* | ||
24 | * Generic associative array. | ||
25 | */ | ||
26 | struct assoc_array { | ||
27 | struct assoc_array_ptr *root; /* The node at the root of the tree */ | ||
28 | unsigned long nr_leaves_on_tree; | ||
29 | }; | ||
30 | |||
31 | /* | ||
32 | * Operations on objects and index keys for use by array manipulation routines. | ||
33 | */ | ||
34 | struct assoc_array_ops { | ||
35 | /* Method to get a chunk of an index key from caller-supplied data */ | ||
36 | unsigned long (*get_key_chunk)(const void *index_key, int level); | ||
37 | |||
38 | /* Method to get a piece of an object's index key */ | ||
39 | unsigned long (*get_object_key_chunk)(const void *object, int level); | ||
40 | |||
41 | /* Is this the object we're looking for? */ | ||
42 | bool (*compare_object)(const void *object, const void *index_key); | ||
43 | |||
44 | /* How different is an object from an index key, to a bit position in | ||
45 | * their keys? (or -1 if they're the same) | ||
46 | */ | ||
47 | int (*diff_objects)(const void *object, const void *index_key); | ||
48 | |||
49 | /* Method to free an object. */ | ||
50 | void (*free_object)(void *object); | ||
51 | }; | ||
52 | |||
53 | /* | ||
54 | * Access and manipulation functions. | ||
55 | */ | ||
56 | struct assoc_array_edit; | ||
57 | |||
58 | static inline void assoc_array_init(struct assoc_array *array) | ||
59 | { | ||
60 | array->root = NULL; | ||
61 | array->nr_leaves_on_tree = 0; | ||
62 | } | ||
63 | |||
64 | extern int assoc_array_iterate(const struct assoc_array *array, | ||
65 | int (*iterator)(const void *object, | ||
66 | void *iterator_data), | ||
67 | void *iterator_data); | ||
68 | extern void *assoc_array_find(const struct assoc_array *array, | ||
69 | const struct assoc_array_ops *ops, | ||
70 | const void *index_key); | ||
71 | extern void assoc_array_destroy(struct assoc_array *array, | ||
72 | const struct assoc_array_ops *ops); | ||
73 | extern struct assoc_array_edit *assoc_array_insert(struct assoc_array *array, | ||
74 | const struct assoc_array_ops *ops, | ||
75 | const void *index_key, | ||
76 | void *object); | ||
77 | extern void assoc_array_insert_set_object(struct assoc_array_edit *edit, | ||
78 | void *object); | ||
79 | extern struct assoc_array_edit *assoc_array_delete(struct assoc_array *array, | ||
80 | const struct assoc_array_ops *ops, | ||
81 | const void *index_key); | ||
82 | extern struct assoc_array_edit *assoc_array_clear(struct assoc_array *array, | ||
83 | const struct assoc_array_ops *ops); | ||
84 | extern void assoc_array_apply_edit(struct assoc_array_edit *edit); | ||
85 | extern void assoc_array_cancel_edit(struct assoc_array_edit *edit); | ||
86 | extern int assoc_array_gc(struct assoc_array *array, | ||
87 | const struct assoc_array_ops *ops, | ||
88 | bool (*iterator)(void *object, void *iterator_data), | ||
89 | void *iterator_data); | ||
90 | |||
91 | #endif /* CONFIG_ASSOCIATIVE_ARRAY */ | ||
92 | #endif /* _LINUX_ASSOC_ARRAY_H */ | ||
diff --git a/include/linux/assoc_array_priv.h b/include/linux/assoc_array_priv.h new file mode 100644 index 000000000000..711275e6681c --- /dev/null +++ b/include/linux/assoc_array_priv.h | |||
@@ -0,0 +1,182 @@ | |||
1 | /* Private definitions for the generic associative array implementation. | ||
2 | * | ||
3 | * See Documentation/assoc_array.txt for information. | ||
4 | * | ||
5 | * Copyright (C) 2013 Red Hat, Inc. All Rights Reserved. | ||
6 | * Written by David Howells (dhowells@redhat.com) | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public Licence | ||
10 | * as published by the Free Software Foundation; either version | ||
11 | * 2 of the Licence, or (at your option) any later version. | ||
12 | */ | ||
13 | |||
14 | #ifndef _LINUX_ASSOC_ARRAY_PRIV_H | ||
15 | #define _LINUX_ASSOC_ARRAY_PRIV_H | ||
16 | |||
17 | #ifdef CONFIG_ASSOCIATIVE_ARRAY | ||
18 | |||
19 | #include <linux/assoc_array.h> | ||
20 | |||
21 | #define ASSOC_ARRAY_FAN_OUT 16 /* Number of slots per node */ | ||
22 | #define ASSOC_ARRAY_FAN_MASK (ASSOC_ARRAY_FAN_OUT - 1) | ||
23 | #define ASSOC_ARRAY_LEVEL_STEP (ilog2(ASSOC_ARRAY_FAN_OUT)) | ||
24 | #define ASSOC_ARRAY_LEVEL_STEP_MASK (ASSOC_ARRAY_LEVEL_STEP - 1) | ||
25 | #define ASSOC_ARRAY_KEY_CHUNK_MASK (ASSOC_ARRAY_KEY_CHUNK_SIZE - 1) | ||
26 | #define ASSOC_ARRAY_KEY_CHUNK_SHIFT (ilog2(BITS_PER_LONG)) | ||
27 | |||
28 | /* | ||
29 | * Undefined type representing a pointer with type information in the bottom | ||
30 | * two bits. | ||
31 | */ | ||
32 | struct assoc_array_ptr; | ||
33 | |||
34 | /* | ||
35 | * An N-way node in the tree. | ||
36 | * | ||
37 | * Each slot contains one of four things: | ||
38 | * | ||
39 | * (1) Nothing (NULL). | ||
40 | * | ||
41 | * (2) A leaf object (pointer types 0). | ||
42 | * | ||
43 | * (3) A next-level node (pointer type 1, subtype 0). | ||
44 | * | ||
45 | * (4) A shortcut (pointer type 1, subtype 1). | ||
46 | * | ||
47 | * The tree is optimised for search-by-ID, but permits reasonable iteration | ||
48 | * also. | ||
49 | * | ||
50 | * The tree is navigated by constructing an index key consisting of an array of | ||
51 | * segments, where each segment is ilog2(ASSOC_ARRAY_FAN_OUT) bits in size. | ||
52 | * | ||
53 | * The segments correspond to levels of the tree (the first segment is used at | ||
54 | * level 0, the second at level 1, etc.). | ||
55 | */ | ||
56 | struct assoc_array_node { | ||
57 | struct assoc_array_ptr *back_pointer; | ||
58 | u8 parent_slot; | ||
59 | struct assoc_array_ptr *slots[ASSOC_ARRAY_FAN_OUT]; | ||
60 | unsigned long nr_leaves_on_branch; | ||
61 | }; | ||
62 | |||
63 | /* | ||
64 | * A shortcut through the index space out to where a collection of nodes/leaves | ||
65 | * with the same IDs live. | ||
66 | */ | ||
67 | struct assoc_array_shortcut { | ||
68 | struct assoc_array_ptr *back_pointer; | ||
69 | int parent_slot; | ||
70 | int skip_to_level; | ||
71 | struct assoc_array_ptr *next_node; | ||
72 | unsigned long index_key[]; | ||
73 | }; | ||
74 | |||
75 | /* | ||
76 | * Preallocation cache. | ||
77 | */ | ||
78 | struct assoc_array_edit { | ||
79 | struct rcu_head rcu; | ||
80 | struct assoc_array *array; | ||
81 | const struct assoc_array_ops *ops; | ||
82 | const struct assoc_array_ops *ops_for_excised_subtree; | ||
83 | struct assoc_array_ptr *leaf; | ||
84 | struct assoc_array_ptr **leaf_p; | ||
85 | struct assoc_array_ptr *dead_leaf; | ||
86 | struct assoc_array_ptr *new_meta[3]; | ||
87 | struct assoc_array_ptr *excised_meta[1]; | ||
88 | struct assoc_array_ptr *excised_subtree; | ||
89 | struct assoc_array_ptr **set_backpointers[ASSOC_ARRAY_FAN_OUT]; | ||
90 | struct assoc_array_ptr *set_backpointers_to; | ||
91 | struct assoc_array_node *adjust_count_on; | ||
92 | long adjust_count_by; | ||
93 | struct { | ||
94 | struct assoc_array_ptr **ptr; | ||
95 | struct assoc_array_ptr *to; | ||
96 | } set[2]; | ||
97 | struct { | ||
98 | u8 *p; | ||
99 | u8 to; | ||
100 | } set_parent_slot[1]; | ||
101 | u8 segment_cache[ASSOC_ARRAY_FAN_OUT + 1]; | ||
102 | }; | ||
103 | |||
104 | /* | ||
105 | * Internal tree member pointers are marked in the bottom one or two bits to | ||
106 | * indicate what type they are so that we don't have to look behind every | ||
107 | * pointer to see what it points to. | ||
108 | * | ||
109 | * We provide functions to test type annotations and to create and translate | ||
110 | * the annotated pointers. | ||
111 | */ | ||
112 | #define ASSOC_ARRAY_PTR_TYPE_MASK 0x1UL | ||
113 | #define ASSOC_ARRAY_PTR_LEAF_TYPE 0x0UL /* Points to leaf (or nowhere) */ | ||
114 | #define ASSOC_ARRAY_PTR_META_TYPE 0x1UL /* Points to node or shortcut */ | ||
115 | #define ASSOC_ARRAY_PTR_SUBTYPE_MASK 0x2UL | ||
116 | #define ASSOC_ARRAY_PTR_NODE_SUBTYPE 0x0UL | ||
117 | #define ASSOC_ARRAY_PTR_SHORTCUT_SUBTYPE 0x2UL | ||
118 | |||
119 | static inline bool assoc_array_ptr_is_meta(const struct assoc_array_ptr *x) | ||
120 | { | ||
121 | return (unsigned long)x & ASSOC_ARRAY_PTR_TYPE_MASK; | ||
122 | } | ||
123 | static inline bool assoc_array_ptr_is_leaf(const struct assoc_array_ptr *x) | ||
124 | { | ||
125 | return !assoc_array_ptr_is_meta(x); | ||
126 | } | ||
127 | static inline bool assoc_array_ptr_is_shortcut(const struct assoc_array_ptr *x) | ||
128 | { | ||
129 | return (unsigned long)x & ASSOC_ARRAY_PTR_SUBTYPE_MASK; | ||
130 | } | ||
131 | static inline bool assoc_array_ptr_is_node(const struct assoc_array_ptr *x) | ||
132 | { | ||
133 | return !assoc_array_ptr_is_shortcut(x); | ||
134 | } | ||
135 | |||
136 | static inline void *assoc_array_ptr_to_leaf(const struct assoc_array_ptr *x) | ||
137 | { | ||
138 | return (void *)((unsigned long)x & ~ASSOC_ARRAY_PTR_TYPE_MASK); | ||
139 | } | ||
140 | |||
141 | static inline | ||
142 | unsigned long __assoc_array_ptr_to_meta(const struct assoc_array_ptr *x) | ||
143 | { | ||
144 | return (unsigned long)x & | ||
145 | ~(ASSOC_ARRAY_PTR_SUBTYPE_MASK | ASSOC_ARRAY_PTR_TYPE_MASK); | ||
146 | } | ||
147 | static inline | ||
148 | struct assoc_array_node *assoc_array_ptr_to_node(const struct assoc_array_ptr *x) | ||
149 | { | ||
150 | return (struct assoc_array_node *)__assoc_array_ptr_to_meta(x); | ||
151 | } | ||
152 | static inline | ||
153 | struct assoc_array_shortcut *assoc_array_ptr_to_shortcut(const struct assoc_array_ptr *x) | ||
154 | { | ||
155 | return (struct assoc_array_shortcut *)__assoc_array_ptr_to_meta(x); | ||
156 | } | ||
157 | |||
158 | static inline | ||
159 | struct assoc_array_ptr *__assoc_array_x_to_ptr(const void *p, unsigned long t) | ||
160 | { | ||
161 | return (struct assoc_array_ptr *)((unsigned long)p | t); | ||
162 | } | ||
163 | static inline | ||
164 | struct assoc_array_ptr *assoc_array_leaf_to_ptr(const void *p) | ||
165 | { | ||
166 | return __assoc_array_x_to_ptr(p, ASSOC_ARRAY_PTR_LEAF_TYPE); | ||
167 | } | ||
168 | static inline | ||
169 | struct assoc_array_ptr *assoc_array_node_to_ptr(const struct assoc_array_node *p) | ||
170 | { | ||
171 | return __assoc_array_x_to_ptr( | ||
172 | p, ASSOC_ARRAY_PTR_META_TYPE | ASSOC_ARRAY_PTR_NODE_SUBTYPE); | ||
173 | } | ||
174 | static inline | ||
175 | struct assoc_array_ptr *assoc_array_shortcut_to_ptr(const struct assoc_array_shortcut *p) | ||
176 | { | ||
177 | return __assoc_array_x_to_ptr( | ||
178 | p, ASSOC_ARRAY_PTR_META_TYPE | ASSOC_ARRAY_PTR_SHORTCUT_SUBTYPE); | ||
179 | } | ||
180 | |||
181 | #endif /* CONFIG_ASSOCIATIVE_ARRAY */ | ||
182 | #endif /* _LINUX_ASSOC_ARRAY_PRIV_H */ | ||
diff --git a/include/linux/audit.h b/include/linux/audit.h index 729a4d165bcc..a40641954c29 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
@@ -73,6 +73,8 @@ struct audit_field { | |||
73 | void *lsm_rule; | 73 | void *lsm_rule; |
74 | }; | 74 | }; |
75 | 75 | ||
76 | extern int is_audit_feature_set(int which); | ||
77 | |||
76 | extern int __init audit_register_class(int class, unsigned *list); | 78 | extern int __init audit_register_class(int class, unsigned *list); |
77 | extern int audit_classify_syscall(int abi, unsigned syscall); | 79 | extern int audit_classify_syscall(int abi, unsigned syscall); |
78 | extern int audit_classify_arch(int arch); | 80 | extern int audit_classify_arch(int arch); |
@@ -207,7 +209,7 @@ static inline int audit_get_sessionid(struct task_struct *tsk) | |||
207 | 209 | ||
208 | extern void __audit_ipc_obj(struct kern_ipc_perm *ipcp); | 210 | extern void __audit_ipc_obj(struct kern_ipc_perm *ipcp); |
209 | extern void __audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, umode_t mode); | 211 | extern void __audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, umode_t mode); |
210 | extern int __audit_bprm(struct linux_binprm *bprm); | 212 | extern void __audit_bprm(struct linux_binprm *bprm); |
211 | extern int __audit_socketcall(int nargs, unsigned long *args); | 213 | extern int __audit_socketcall(int nargs, unsigned long *args); |
212 | extern int __audit_sockaddr(int len, void *addr); | 214 | extern int __audit_sockaddr(int len, void *addr); |
213 | extern void __audit_fd_pair(int fd1, int fd2); | 215 | extern void __audit_fd_pair(int fd1, int fd2); |
@@ -236,11 +238,10 @@ static inline void audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid | |||
236 | if (unlikely(!audit_dummy_context())) | 238 | if (unlikely(!audit_dummy_context())) |
237 | __audit_ipc_set_perm(qbytes, uid, gid, mode); | 239 | __audit_ipc_set_perm(qbytes, uid, gid, mode); |
238 | } | 240 | } |
239 | static inline int audit_bprm(struct linux_binprm *bprm) | 241 | static inline void audit_bprm(struct linux_binprm *bprm) |
240 | { | 242 | { |
241 | if (unlikely(!audit_dummy_context())) | 243 | if (unlikely(!audit_dummy_context())) |
242 | return __audit_bprm(bprm); | 244 | __audit_bprm(bprm); |
243 | return 0; | ||
244 | } | 245 | } |
245 | static inline int audit_socketcall(int nargs, unsigned long *args) | 246 | static inline int audit_socketcall(int nargs, unsigned long *args) |
246 | { | 247 | { |
@@ -367,10 +368,8 @@ static inline void audit_ipc_obj(struct kern_ipc_perm *ipcp) | |||
367 | static inline void audit_ipc_set_perm(unsigned long qbytes, uid_t uid, | 368 | static inline void audit_ipc_set_perm(unsigned long qbytes, uid_t uid, |
368 | gid_t gid, umode_t mode) | 369 | gid_t gid, umode_t mode) |
369 | { } | 370 | { } |
370 | static inline int audit_bprm(struct linux_binprm *bprm) | 371 | static inline void audit_bprm(struct linux_binprm *bprm) |
371 | { | 372 | { } |
372 | return 0; | ||
373 | } | ||
374 | static inline int audit_socketcall(int nargs, unsigned long *args) | 373 | static inline int audit_socketcall(int nargs, unsigned long *args) |
375 | { | 374 | { |
376 | return 0; | 375 | return 0; |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index f26ec20f6354..1b135d49b279 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -505,6 +505,9 @@ struct request_queue { | |||
505 | (1 << QUEUE_FLAG_SAME_COMP) | \ | 505 | (1 << QUEUE_FLAG_SAME_COMP) | \ |
506 | (1 << QUEUE_FLAG_ADD_RANDOM)) | 506 | (1 << QUEUE_FLAG_ADD_RANDOM)) |
507 | 507 | ||
508 | #define QUEUE_FLAG_MQ_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \ | ||
509 | (1 << QUEUE_FLAG_SAME_COMP)) | ||
510 | |||
508 | static inline void queue_lockdep_assert_held(struct request_queue *q) | 511 | static inline void queue_lockdep_assert_held(struct request_queue *q) |
509 | { | 512 | { |
510 | if (q->queue_lock) | 513 | if (q->queue_lock) |
diff --git a/include/linux/compiler-intel.h b/include/linux/compiler-intel.h index 973ce10c40b6..dc1bd3dcf11f 100644 --- a/include/linux/compiler-intel.h +++ b/include/linux/compiler-intel.h | |||
@@ -28,8 +28,6 @@ | |||
28 | 28 | ||
29 | #endif | 29 | #endif |
30 | 30 | ||
31 | #define uninitialized_var(x) x | ||
32 | |||
33 | #ifndef __HAVE_BUILTIN_BSWAP16__ | 31 | #ifndef __HAVE_BUILTIN_BSWAP16__ |
34 | /* icc has this, but it's called _bswap16 */ | 32 | /* icc has this, but it's called _bswap16 */ |
35 | #define __HAVE_BUILTIN_BSWAP16__ | 33 | #define __HAVE_BUILTIN_BSWAP16__ |
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 57e87e749a48..bf72e9ac6de0 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h | |||
@@ -29,8 +29,10 @@ struct vfsmount; | |||
29 | /* The hash is always the low bits of hash_len */ | 29 | /* The hash is always the low bits of hash_len */ |
30 | #ifdef __LITTLE_ENDIAN | 30 | #ifdef __LITTLE_ENDIAN |
31 | #define HASH_LEN_DECLARE u32 hash; u32 len; | 31 | #define HASH_LEN_DECLARE u32 hash; u32 len; |
32 | #define bytemask_from_count(cnt) (~(~0ul << (cnt)*8)) | ||
32 | #else | 33 | #else |
33 | #define HASH_LEN_DECLARE u32 len; u32 hash; | 34 | #define HASH_LEN_DECLARE u32 len; u32 hash; |
35 | #define bytemask_from_count(cnt) (~(~0ul >> (cnt)*8)) | ||
34 | #endif | 36 | #endif |
35 | 37 | ||
36 | /* | 38 | /* |
diff --git a/include/linux/device.h b/include/linux/device.h index b025925df7f7..952b01033c32 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -644,9 +644,11 @@ struct device_dma_parameters { | |||
644 | unsigned long segment_boundary_mask; | 644 | unsigned long segment_boundary_mask; |
645 | }; | 645 | }; |
646 | 646 | ||
647 | struct acpi_device; | ||
648 | |||
647 | struct acpi_dev_node { | 649 | struct acpi_dev_node { |
648 | #ifdef CONFIG_ACPI | 650 | #ifdef CONFIG_ACPI |
649 | void *handle; | 651 | struct acpi_device *companion; |
650 | #endif | 652 | #endif |
651 | }; | 653 | }; |
652 | 654 | ||
@@ -790,14 +792,6 @@ static inline struct device *kobj_to_dev(struct kobject *kobj) | |||
790 | return container_of(kobj, struct device, kobj); | 792 | return container_of(kobj, struct device, kobj); |
791 | } | 793 | } |
792 | 794 | ||
793 | #ifdef CONFIG_ACPI | ||
794 | #define ACPI_HANDLE(dev) ((dev)->acpi_node.handle) | ||
795 | #define ACPI_HANDLE_SET(dev, _handle_) (dev)->acpi_node.handle = (_handle_) | ||
796 | #else | ||
797 | #define ACPI_HANDLE(dev) (NULL) | ||
798 | #define ACPI_HANDLE_SET(dev, _handle_) do { } while (0) | ||
799 | #endif | ||
800 | |||
801 | /* Get the wakeup routines, which depend on struct device */ | 795 | /* Get the wakeup routines, which depend on struct device */ |
802 | #include <linux/pm_wakeup.h> | 796 | #include <linux/pm_wakeup.h> |
803 | 797 | ||
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index 0bc727534108..41cf0c399288 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h | |||
@@ -45,13 +45,13 @@ static inline int dma_submit_error(dma_cookie_t cookie) | |||
45 | 45 | ||
46 | /** | 46 | /** |
47 | * enum dma_status - DMA transaction status | 47 | * enum dma_status - DMA transaction status |
48 | * @DMA_SUCCESS: transaction completed successfully | 48 | * @DMA_COMPLETE: transaction completed |
49 | * @DMA_IN_PROGRESS: transaction not yet processed | 49 | * @DMA_IN_PROGRESS: transaction not yet processed |
50 | * @DMA_PAUSED: transaction is paused | 50 | * @DMA_PAUSED: transaction is paused |
51 | * @DMA_ERROR: transaction failed | 51 | * @DMA_ERROR: transaction failed |
52 | */ | 52 | */ |
53 | enum dma_status { | 53 | enum dma_status { |
54 | DMA_SUCCESS, | 54 | DMA_COMPLETE, |
55 | DMA_IN_PROGRESS, | 55 | DMA_IN_PROGRESS, |
56 | DMA_PAUSED, | 56 | DMA_PAUSED, |
57 | DMA_ERROR, | 57 | DMA_ERROR, |
@@ -171,12 +171,6 @@ struct dma_interleaved_template { | |||
171 | * @DMA_CTRL_ACK - if clear, the descriptor cannot be reused until the client | 171 | * @DMA_CTRL_ACK - if clear, the descriptor cannot be reused until the client |
172 | * acknowledges receipt, i.e. has has a chance to establish any dependency | 172 | * acknowledges receipt, i.e. has has a chance to establish any dependency |
173 | * chains | 173 | * chains |
174 | * @DMA_COMPL_SKIP_SRC_UNMAP - set to disable dma-unmapping the source buffer(s) | ||
175 | * @DMA_COMPL_SKIP_DEST_UNMAP - set to disable dma-unmapping the destination(s) | ||
176 | * @DMA_COMPL_SRC_UNMAP_SINGLE - set to do the source dma-unmapping as single | ||
177 | * (if not set, do the source dma-unmapping as page) | ||
178 | * @DMA_COMPL_DEST_UNMAP_SINGLE - set to do the destination dma-unmapping as single | ||
179 | * (if not set, do the destination dma-unmapping as page) | ||
180 | * @DMA_PREP_PQ_DISABLE_P - prevent generation of P while generating Q | 174 | * @DMA_PREP_PQ_DISABLE_P - prevent generation of P while generating Q |
181 | * @DMA_PREP_PQ_DISABLE_Q - prevent generation of Q while generating P | 175 | * @DMA_PREP_PQ_DISABLE_Q - prevent generation of Q while generating P |
182 | * @DMA_PREP_CONTINUE - indicate to a driver that it is reusing buffers as | 176 | * @DMA_PREP_CONTINUE - indicate to a driver that it is reusing buffers as |
@@ -188,14 +182,10 @@ struct dma_interleaved_template { | |||
188 | enum dma_ctrl_flags { | 182 | enum dma_ctrl_flags { |
189 | DMA_PREP_INTERRUPT = (1 << 0), | 183 | DMA_PREP_INTERRUPT = (1 << 0), |
190 | DMA_CTRL_ACK = (1 << 1), | 184 | DMA_CTRL_ACK = (1 << 1), |
191 | DMA_COMPL_SKIP_SRC_UNMAP = (1 << 2), | 185 | DMA_PREP_PQ_DISABLE_P = (1 << 2), |
192 | DMA_COMPL_SKIP_DEST_UNMAP = (1 << 3), | 186 | DMA_PREP_PQ_DISABLE_Q = (1 << 3), |
193 | DMA_COMPL_SRC_UNMAP_SINGLE = (1 << 4), | 187 | DMA_PREP_CONTINUE = (1 << 4), |
194 | DMA_COMPL_DEST_UNMAP_SINGLE = (1 << 5), | 188 | DMA_PREP_FENCE = (1 << 5), |
195 | DMA_PREP_PQ_DISABLE_P = (1 << 6), | ||
196 | DMA_PREP_PQ_DISABLE_Q = (1 << 7), | ||
197 | DMA_PREP_CONTINUE = (1 << 8), | ||
198 | DMA_PREP_FENCE = (1 << 9), | ||
199 | }; | 189 | }; |
200 | 190 | ||
201 | /** | 191 | /** |
@@ -413,6 +403,17 @@ void dma_chan_cleanup(struct kref *kref); | |||
413 | typedef bool (*dma_filter_fn)(struct dma_chan *chan, void *filter_param); | 403 | typedef bool (*dma_filter_fn)(struct dma_chan *chan, void *filter_param); |
414 | 404 | ||
415 | typedef void (*dma_async_tx_callback)(void *dma_async_param); | 405 | typedef void (*dma_async_tx_callback)(void *dma_async_param); |
406 | |||
407 | struct dmaengine_unmap_data { | ||
408 | u8 to_cnt; | ||
409 | u8 from_cnt; | ||
410 | u8 bidi_cnt; | ||
411 | struct device *dev; | ||
412 | struct kref kref; | ||
413 | size_t len; | ||
414 | dma_addr_t addr[0]; | ||
415 | }; | ||
416 | |||
416 | /** | 417 | /** |
417 | * struct dma_async_tx_descriptor - async transaction descriptor | 418 | * struct dma_async_tx_descriptor - async transaction descriptor |
418 | * ---dma generic offload fields--- | 419 | * ---dma generic offload fields--- |
@@ -438,6 +439,7 @@ struct dma_async_tx_descriptor { | |||
438 | dma_cookie_t (*tx_submit)(struct dma_async_tx_descriptor *tx); | 439 | dma_cookie_t (*tx_submit)(struct dma_async_tx_descriptor *tx); |
439 | dma_async_tx_callback callback; | 440 | dma_async_tx_callback callback; |
440 | void *callback_param; | 441 | void *callback_param; |
442 | struct dmaengine_unmap_data *unmap; | ||
441 | #ifdef CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH | 443 | #ifdef CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH |
442 | struct dma_async_tx_descriptor *next; | 444 | struct dma_async_tx_descriptor *next; |
443 | struct dma_async_tx_descriptor *parent; | 445 | struct dma_async_tx_descriptor *parent; |
@@ -445,6 +447,40 @@ struct dma_async_tx_descriptor { | |||
445 | #endif | 447 | #endif |
446 | }; | 448 | }; |
447 | 449 | ||
450 | #ifdef CONFIG_DMA_ENGINE | ||
451 | static inline void dma_set_unmap(struct dma_async_tx_descriptor *tx, | ||
452 | struct dmaengine_unmap_data *unmap) | ||
453 | { | ||
454 | kref_get(&unmap->kref); | ||
455 | tx->unmap = unmap; | ||
456 | } | ||
457 | |||
458 | struct dmaengine_unmap_data * | ||
459 | dmaengine_get_unmap_data(struct device *dev, int nr, gfp_t flags); | ||
460 | void dmaengine_unmap_put(struct dmaengine_unmap_data *unmap); | ||
461 | #else | ||
462 | static inline void dma_set_unmap(struct dma_async_tx_descriptor *tx, | ||
463 | struct dmaengine_unmap_data *unmap) | ||
464 | { | ||
465 | } | ||
466 | static inline struct dmaengine_unmap_data * | ||
467 | dmaengine_get_unmap_data(struct device *dev, int nr, gfp_t flags) | ||
468 | { | ||
469 | return NULL; | ||
470 | } | ||
471 | static inline void dmaengine_unmap_put(struct dmaengine_unmap_data *unmap) | ||
472 | { | ||
473 | } | ||
474 | #endif | ||
475 | |||
476 | static inline void dma_descriptor_unmap(struct dma_async_tx_descriptor *tx) | ||
477 | { | ||
478 | if (tx->unmap) { | ||
479 | dmaengine_unmap_put(tx->unmap); | ||
480 | tx->unmap = NULL; | ||
481 | } | ||
482 | } | ||
483 | |||
448 | #ifndef CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH | 484 | #ifndef CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH |
449 | static inline void txd_lock(struct dma_async_tx_descriptor *txd) | 485 | static inline void txd_lock(struct dma_async_tx_descriptor *txd) |
450 | { | 486 | { |
@@ -979,10 +1015,10 @@ static inline enum dma_status dma_async_is_complete(dma_cookie_t cookie, | |||
979 | { | 1015 | { |
980 | if (last_complete <= last_used) { | 1016 | if (last_complete <= last_used) { |
981 | if ((cookie <= last_complete) || (cookie > last_used)) | 1017 | if ((cookie <= last_complete) || (cookie > last_used)) |
982 | return DMA_SUCCESS; | 1018 | return DMA_COMPLETE; |
983 | } else { | 1019 | } else { |
984 | if ((cookie <= last_complete) && (cookie > last_used)) | 1020 | if ((cookie <= last_complete) && (cookie > last_used)) |
985 | return DMA_SUCCESS; | 1021 | return DMA_COMPLETE; |
986 | } | 1022 | } |
987 | return DMA_IN_PROGRESS; | 1023 | return DMA_IN_PROGRESS; |
988 | } | 1024 | } |
@@ -1013,11 +1049,11 @@ static inline struct dma_chan *dma_find_channel(enum dma_transaction_type tx_typ | |||
1013 | } | 1049 | } |
1014 | static inline enum dma_status dma_sync_wait(struct dma_chan *chan, dma_cookie_t cookie) | 1050 | static inline enum dma_status dma_sync_wait(struct dma_chan *chan, dma_cookie_t cookie) |
1015 | { | 1051 | { |
1016 | return DMA_SUCCESS; | 1052 | return DMA_COMPLETE; |
1017 | } | 1053 | } |
1018 | static inline enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx) | 1054 | static inline enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx) |
1019 | { | 1055 | { |
1020 | return DMA_SUCCESS; | 1056 | return DMA_COMPLETE; |
1021 | } | 1057 | } |
1022 | static inline void dma_issue_pending_all(void) | 1058 | static inline void dma_issue_pending_all(void) |
1023 | { | 1059 | { |
diff --git a/include/linux/efi.h b/include/linux/efi.h index bc5687d0f315..11ce6784a196 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h | |||
@@ -801,6 +801,8 @@ struct efivar_entry { | |||
801 | struct efi_variable var; | 801 | struct efi_variable var; |
802 | struct list_head list; | 802 | struct list_head list; |
803 | struct kobject kobj; | 803 | struct kobject kobj; |
804 | bool scanning; | ||
805 | bool deleting; | ||
804 | }; | 806 | }; |
805 | 807 | ||
806 | 808 | ||
@@ -866,6 +868,8 @@ void efivar_run_worker(void); | |||
866 | #if defined(CONFIG_EFI_VARS) || defined(CONFIG_EFI_VARS_MODULE) | 868 | #if defined(CONFIG_EFI_VARS) || defined(CONFIG_EFI_VARS_MODULE) |
867 | int efivars_sysfs_init(void); | 869 | int efivars_sysfs_init(void); |
868 | 870 | ||
871 | #define EFIVARS_DATA_SIZE_MAX 1024 | ||
872 | |||
869 | #endif /* CONFIG_EFI_VARS */ | 873 | #endif /* CONFIG_EFI_VARS */ |
870 | 874 | ||
871 | #endif /* _LINUX_EFI_H */ | 875 | #endif /* _LINUX_EFI_H */ |
diff --git a/include/linux/fs.h b/include/linux/fs.h index bf5d574ebdf4..121f11f001c0 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -2622,7 +2622,9 @@ extern int simple_write_begin(struct file *file, struct address_space *mapping, | |||
2622 | extern int simple_write_end(struct file *file, struct address_space *mapping, | 2622 | extern int simple_write_end(struct file *file, struct address_space *mapping, |
2623 | loff_t pos, unsigned len, unsigned copied, | 2623 | loff_t pos, unsigned len, unsigned copied, |
2624 | struct page *page, void *fsdata); | 2624 | struct page *page, void *fsdata); |
2625 | extern int always_delete_dentry(const struct dentry *); | ||
2625 | extern struct inode *alloc_anon_inode(struct super_block *); | 2626 | extern struct inode *alloc_anon_inode(struct super_block *); |
2627 | extern const struct dentry_operations simple_dentry_operations; | ||
2626 | 2628 | ||
2627 | extern struct dentry *simple_lookup(struct inode *, struct dentry *, unsigned int flags); | 2629 | extern struct dentry *simple_lookup(struct inode *, struct dentry *, unsigned int flags); |
2628 | extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *); | 2630 | extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *); |
diff --git a/include/linux/genl_magic_func.h b/include/linux/genl_magic_func.h index 023bc346b877..c0894dd8827b 100644 --- a/include/linux/genl_magic_func.h +++ b/include/linux/genl_magic_func.h | |||
@@ -273,49 +273,40 @@ static struct genl_family ZZZ_genl_family __read_mostly = { | |||
273 | * Magic: define multicast groups | 273 | * Magic: define multicast groups |
274 | * Magic: define multicast group registration helper | 274 | * Magic: define multicast group registration helper |
275 | */ | 275 | */ |
276 | #define ZZZ_genl_mcgrps CONCAT_(GENL_MAGIC_FAMILY, _genl_mcgrps) | ||
277 | static const struct genl_multicast_group ZZZ_genl_mcgrps[] = { | ||
278 | #undef GENL_mc_group | ||
279 | #define GENL_mc_group(group) { .name = #group, }, | ||
280 | #include GENL_MAGIC_INCLUDE_FILE | ||
281 | }; | ||
282 | |||
283 | enum CONCAT_(GENL_MAGIC_FAMILY, group_ids) { | ||
284 | #undef GENL_mc_group | ||
285 | #define GENL_mc_group(group) CONCAT_(GENL_MAGIC_FAMILY, _group_ ## group), | ||
286 | #include GENL_MAGIC_INCLUDE_FILE | ||
287 | }; | ||
288 | |||
276 | #undef GENL_mc_group | 289 | #undef GENL_mc_group |
277 | #define GENL_mc_group(group) \ | 290 | #define GENL_mc_group(group) \ |
278 | static struct genl_multicast_group \ | ||
279 | CONCAT_(GENL_MAGIC_FAMILY, _mcg_ ## group) __read_mostly = { \ | ||
280 | .name = #group, \ | ||
281 | }; \ | ||
282 | static int CONCAT_(GENL_MAGIC_FAMILY, _genl_multicast_ ## group)( \ | 291 | static int CONCAT_(GENL_MAGIC_FAMILY, _genl_multicast_ ## group)( \ |
283 | struct sk_buff *skb, gfp_t flags) \ | 292 | struct sk_buff *skb, gfp_t flags) \ |
284 | { \ | 293 | { \ |
285 | unsigned int group_id = \ | 294 | unsigned int group_id = \ |
286 | CONCAT_(GENL_MAGIC_FAMILY, _mcg_ ## group).id; \ | 295 | CONCAT_(GENL_MAGIC_FAMILY, _group_ ## group); \ |
287 | if (!group_id) \ | 296 | return genlmsg_multicast(&ZZZ_genl_family, skb, 0, \ |
288 | return -EINVAL; \ | 297 | group_id, flags); \ |
289 | return genlmsg_multicast(skb, 0, group_id, flags); \ | ||
290 | } | 298 | } |
291 | 299 | ||
292 | #include GENL_MAGIC_INCLUDE_FILE | 300 | #include GENL_MAGIC_INCLUDE_FILE |
293 | 301 | ||
294 | int CONCAT_(GENL_MAGIC_FAMILY, _genl_register)(void) | ||
295 | { | ||
296 | int err = genl_register_family_with_ops(&ZZZ_genl_family, | ||
297 | ZZZ_genl_ops, ARRAY_SIZE(ZZZ_genl_ops)); | ||
298 | if (err) | ||
299 | return err; | ||
300 | #undef GENL_mc_group | ||
301 | #define GENL_mc_group(group) \ | ||
302 | err = genl_register_mc_group(&ZZZ_genl_family, \ | ||
303 | &CONCAT_(GENL_MAGIC_FAMILY, _mcg_ ## group)); \ | ||
304 | if (err) \ | ||
305 | goto fail; \ | ||
306 | else \ | ||
307 | pr_info("%s: mcg %s: %u\n", #group, \ | ||
308 | __stringify(GENL_MAGIC_FAMILY), \ | ||
309 | CONCAT_(GENL_MAGIC_FAMILY, _mcg_ ## group).id); | ||
310 | |||
311 | #include GENL_MAGIC_INCLUDE_FILE | ||
312 | |||
313 | #undef GENL_mc_group | 302 | #undef GENL_mc_group |
314 | #define GENL_mc_group(group) | 303 | #define GENL_mc_group(group) |
315 | return 0; | 304 | |
316 | fail: | 305 | int CONCAT_(GENL_MAGIC_FAMILY, _genl_register)(void) |
317 | genl_unregister_family(&ZZZ_genl_family); | 306 | { |
318 | return err; | 307 | return genl_register_family_with_ops_groups(&ZZZ_genl_family, \ |
308 | ZZZ_genl_ops, \ | ||
309 | ZZZ_genl_mcgrps); | ||
319 | } | 310 | } |
320 | 311 | ||
321 | void CONCAT_(GENL_MAGIC_FAMILY, _genl_unregister)(void) | 312 | void CONCAT_(GENL_MAGIC_FAMILY, _genl_unregister)(void) |
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h index 656a27efb2c8..3ea2cf6b0e6c 100644 --- a/include/linux/gpio/driver.h +++ b/include/linux/gpio/driver.h | |||
@@ -2,9 +2,12 @@ | |||
2 | #define __LINUX_GPIO_DRIVER_H | 2 | #define __LINUX_GPIO_DRIVER_H |
3 | 3 | ||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | #include <linux/module.h> | ||
5 | 6 | ||
6 | struct device; | 7 | struct device; |
7 | struct gpio_desc; | 8 | struct gpio_desc; |
9 | struct of_phandle_args; | ||
10 | struct device_node; | ||
8 | struct seq_file; | 11 | struct seq_file; |
9 | 12 | ||
10 | /** | 13 | /** |
@@ -125,6 +128,13 @@ extern struct gpio_chip *gpiochip_find(void *data, | |||
125 | int gpiod_lock_as_irq(struct gpio_desc *desc); | 128 | int gpiod_lock_as_irq(struct gpio_desc *desc); |
126 | void gpiod_unlock_as_irq(struct gpio_desc *desc); | 129 | void gpiod_unlock_as_irq(struct gpio_desc *desc); |
127 | 130 | ||
131 | enum gpio_lookup_flags { | ||
132 | GPIO_ACTIVE_HIGH = (0 << 0), | ||
133 | GPIO_ACTIVE_LOW = (1 << 0), | ||
134 | GPIO_OPEN_DRAIN = (1 << 1), | ||
135 | GPIO_OPEN_SOURCE = (1 << 2), | ||
136 | }; | ||
137 | |||
128 | /** | 138 | /** |
129 | * Lookup table for associating GPIOs to specific devices and functions using | 139 | * Lookup table for associating GPIOs to specific devices and functions using |
130 | * platform data. | 140 | * platform data. |
@@ -152,9 +162,9 @@ struct gpiod_lookup { | |||
152 | */ | 162 | */ |
153 | unsigned int idx; | 163 | unsigned int idx; |
154 | /* | 164 | /* |
155 | * mask of GPIOF_* values | 165 | * mask of GPIO_* values |
156 | */ | 166 | */ |
157 | unsigned long flags; | 167 | enum gpio_lookup_flags flags; |
158 | }; | 168 | }; |
159 | 169 | ||
160 | /* | 170 | /* |
diff --git a/include/linux/hid-sensor-hub.h b/include/linux/hid-sensor-hub.h index a265af294ea4..b914ca3f57ba 100644 --- a/include/linux/hid-sensor-hub.h +++ b/include/linux/hid-sensor-hub.h | |||
@@ -21,6 +21,8 @@ | |||
21 | 21 | ||
22 | #include <linux/hid.h> | 22 | #include <linux/hid.h> |
23 | #include <linux/hid-sensor-ids.h> | 23 | #include <linux/hid-sensor-ids.h> |
24 | #include <linux/iio/iio.h> | ||
25 | #include <linux/iio/trigger.h> | ||
24 | 26 | ||
25 | /** | 27 | /** |
26 | * struct hid_sensor_hub_attribute_info - Attribute info | 28 | * struct hid_sensor_hub_attribute_info - Attribute info |
@@ -40,6 +42,8 @@ struct hid_sensor_hub_attribute_info { | |||
40 | s32 units; | 42 | s32 units; |
41 | s32 unit_expo; | 43 | s32 unit_expo; |
42 | s32 size; | 44 | s32 size; |
45 | s32 logical_minimum; | ||
46 | s32 logical_maximum; | ||
43 | }; | 47 | }; |
44 | 48 | ||
45 | /** | 49 | /** |
@@ -184,6 +188,7 @@ struct hid_sensor_common { | |||
184 | struct platform_device *pdev; | 188 | struct platform_device *pdev; |
185 | unsigned usage_id; | 189 | unsigned usage_id; |
186 | bool data_ready; | 190 | bool data_ready; |
191 | struct iio_trigger *trigger; | ||
187 | struct hid_sensor_hub_attribute_info poll; | 192 | struct hid_sensor_hub_attribute_info poll; |
188 | struct hid_sensor_hub_attribute_info report_state; | 193 | struct hid_sensor_hub_attribute_info report_state; |
189 | struct hid_sensor_hub_attribute_info power_state; | 194 | struct hid_sensor_hub_attribute_info power_state; |
diff --git a/include/linux/hid-sensor-ids.h b/include/linux/hid-sensor-ids.h index 4f945d3ed49f..8323775ac21d 100644 --- a/include/linux/hid-sensor-ids.h +++ b/include/linux/hid-sensor-ids.h | |||
@@ -117,4 +117,16 @@ | |||
117 | #define HID_USAGE_SENSOR_PROP_REPORT_STATE 0x200316 | 117 | #define HID_USAGE_SENSOR_PROP_REPORT_STATE 0x200316 |
118 | #define HID_USAGE_SENSOR_PROY_POWER_STATE 0x200319 | 118 | #define HID_USAGE_SENSOR_PROY_POWER_STATE 0x200319 |
119 | 119 | ||
120 | /* Power state enumerations */ | ||
121 | #define HID_USAGE_SENSOR_PROP_POWER_STATE_UNDEFINED_ENUM 0x00 | ||
122 | #define HID_USAGE_SENSOR_PROP_POWER_STATE_D0_FULL_POWER_ENUM 0x01 | ||
123 | #define HID_USAGE_SENSOR_PROP_POWER_STATE_D1_LOW_POWER_ENUM 0x02 | ||
124 | #define HID_USAGE_SENSOR_PROP_POWER_STATE_D2_STANDBY_WITH_WAKE_ENUM 0x03 | ||
125 | #define HID_USAGE_SENSOR_PROP_POWER_STATE_D3_SLEEP_WITH_WAKE_ENUM 0x04 | ||
126 | #define HID_USAGE_SENSOR_PROP_POWER_STATE_D4_POWER_OFF_ENUM 0x05 | ||
127 | |||
128 | /* Report State enumerations */ | ||
129 | #define HID_USAGE_SENSOR_PROP_REPORTING_STATE_NO_EVENTS_ENUM 0x00 | ||
130 | #define HID_USAGE_SENSOR_PROP_REPORTING_STATE_ALL_EVENTS_ENUM 0x01 | ||
131 | |||
120 | #endif | 132 | #endif |
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index acd2010328f3..bd7e98752222 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -31,6 +31,7 @@ struct hugepage_subpool *hugepage_new_subpool(long nr_blocks); | |||
31 | void hugepage_put_subpool(struct hugepage_subpool *spool); | 31 | void hugepage_put_subpool(struct hugepage_subpool *spool); |
32 | 32 | ||
33 | int PageHuge(struct page *page); | 33 | int PageHuge(struct page *page); |
34 | int PageHeadHuge(struct page *page_head); | ||
34 | 35 | ||
35 | void reset_vma_resv_huge_pages(struct vm_area_struct *vma); | 36 | void reset_vma_resv_huge_pages(struct vm_area_struct *vma); |
36 | int hugetlb_sysctl_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *); | 37 | int hugetlb_sysctl_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *); |
@@ -69,7 +70,6 @@ int dequeue_hwpoisoned_huge_page(struct page *page); | |||
69 | bool isolate_huge_page(struct page *page, struct list_head *list); | 70 | bool isolate_huge_page(struct page *page, struct list_head *list); |
70 | void putback_active_hugepage(struct page *page); | 71 | void putback_active_hugepage(struct page *page); |
71 | bool is_hugepage_active(struct page *page); | 72 | bool is_hugepage_active(struct page *page); |
72 | void copy_huge_page(struct page *dst, struct page *src); | ||
73 | 73 | ||
74 | #ifdef CONFIG_ARCH_WANT_HUGE_PMD_SHARE | 74 | #ifdef CONFIG_ARCH_WANT_HUGE_PMD_SHARE |
75 | pte_t *huge_pmd_share(struct mm_struct *mm, unsigned long addr, pud_t *pud); | 75 | pte_t *huge_pmd_share(struct mm_struct *mm, unsigned long addr, pud_t *pud); |
@@ -104,6 +104,11 @@ static inline int PageHuge(struct page *page) | |||
104 | return 0; | 104 | return 0; |
105 | } | 105 | } |
106 | 106 | ||
107 | static inline int PageHeadHuge(struct page *page_head) | ||
108 | { | ||
109 | return 0; | ||
110 | } | ||
111 | |||
107 | static inline void reset_vma_resv_huge_pages(struct vm_area_struct *vma) | 112 | static inline void reset_vma_resv_huge_pages(struct vm_area_struct *vma) |
108 | { | 113 | { |
109 | } | 114 | } |
@@ -137,12 +142,12 @@ static inline int dequeue_hwpoisoned_huge_page(struct page *page) | |||
137 | return 0; | 142 | return 0; |
138 | } | 143 | } |
139 | 144 | ||
140 | #define isolate_huge_page(p, l) false | 145 | static inline bool isolate_huge_page(struct page *page, struct list_head *list) |
141 | #define putback_active_hugepage(p) do {} while (0) | ||
142 | #define is_hugepage_active(x) false | ||
143 | static inline void copy_huge_page(struct page *dst, struct page *src) | ||
144 | { | 146 | { |
147 | return false; | ||
145 | } | 148 | } |
149 | #define putback_active_hugepage(p) do {} while (0) | ||
150 | #define is_hugepage_active(x) false | ||
146 | 151 | ||
147 | static inline unsigned long hugetlb_change_protection(struct vm_area_struct *vma, | 152 | static inline unsigned long hugetlb_change_protection(struct vm_area_struct *vma, |
148 | unsigned long address, unsigned long end, pgprot_t newprot) | 153 | unsigned long address, unsigned long end, pgprot_t newprot) |
diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h index c2702856295e..84ba5ac39e03 100644 --- a/include/linux/if_macvlan.h +++ b/include/linux/if_macvlan.h | |||
@@ -119,4 +119,21 @@ extern int macvlan_link_register(struct rtnl_link_ops *ops); | |||
119 | extern netdev_tx_t macvlan_start_xmit(struct sk_buff *skb, | 119 | extern netdev_tx_t macvlan_start_xmit(struct sk_buff *skb, |
120 | struct net_device *dev); | 120 | struct net_device *dev); |
121 | 121 | ||
122 | #if IS_ENABLED(CONFIG_MACVLAN) | ||
123 | static inline struct net_device * | ||
124 | macvlan_dev_real_dev(const struct net_device *dev) | ||
125 | { | ||
126 | struct macvlan_dev *macvlan = netdev_priv(dev); | ||
127 | |||
128 | return macvlan->lowerdev; | ||
129 | } | ||
130 | #else | ||
131 | static inline struct net_device * | ||
132 | macvlan_dev_real_dev(const struct net_device *dev) | ||
133 | { | ||
134 | BUG(); | ||
135 | return NULL; | ||
136 | } | ||
137 | #endif | ||
138 | |||
122 | #endif /* _LINUX_IF_MACVLAN_H */ | 139 | #endif /* _LINUX_IF_MACVLAN_H */ |
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index 5d89d1b808a6..c56c350324e4 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <uapi/linux/ipv6.h> | 4 | #include <uapi/linux/ipv6.h> |
5 | 5 | ||
6 | #define ipv6_optlen(p) (((p)->hdrlen+1) << 3) | 6 | #define ipv6_optlen(p) (((p)->hdrlen+1) << 3) |
7 | #define ipv6_authlen(p) (((p)->hdrlen+2) << 2) | ||
7 | /* | 8 | /* |
8 | * This structure contains configuration options per IPv6 link. | 9 | * This structure contains configuration options per IPv6 link. |
9 | */ | 10 | */ |
diff --git a/include/linux/irq.h b/include/linux/irq.h index 56bb0dc8b7d4..7dc10036eff5 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -70,6 +70,9 @@ typedef void (*irq_preflow_handler_t)(struct irq_data *data); | |||
70 | * IRQ_MOVE_PCNTXT - Interrupt can be migrated from process context | 70 | * IRQ_MOVE_PCNTXT - Interrupt can be migrated from process context |
71 | * IRQ_NESTED_TRHEAD - Interrupt nests into another thread | 71 | * IRQ_NESTED_TRHEAD - Interrupt nests into another thread |
72 | * IRQ_PER_CPU_DEVID - Dev_id is a per-cpu variable | 72 | * IRQ_PER_CPU_DEVID - Dev_id is a per-cpu variable |
73 | * IRQ_IS_POLLED - Always polled by another interrupt. Exclude | ||
74 | * it from the spurious interrupt detection | ||
75 | * mechanism and from core side polling. | ||
73 | */ | 76 | */ |
74 | enum { | 77 | enum { |
75 | IRQ_TYPE_NONE = 0x00000000, | 78 | IRQ_TYPE_NONE = 0x00000000, |
@@ -94,12 +97,14 @@ enum { | |||
94 | IRQ_NESTED_THREAD = (1 << 15), | 97 | IRQ_NESTED_THREAD = (1 << 15), |
95 | IRQ_NOTHREAD = (1 << 16), | 98 | IRQ_NOTHREAD = (1 << 16), |
96 | IRQ_PER_CPU_DEVID = (1 << 17), | 99 | IRQ_PER_CPU_DEVID = (1 << 17), |
100 | IRQ_IS_POLLED = (1 << 18), | ||
97 | }; | 101 | }; |
98 | 102 | ||
99 | #define IRQF_MODIFY_MASK \ | 103 | #define IRQF_MODIFY_MASK \ |
100 | (IRQ_TYPE_SENSE_MASK | IRQ_NOPROBE | IRQ_NOREQUEST | \ | 104 | (IRQ_TYPE_SENSE_MASK | IRQ_NOPROBE | IRQ_NOREQUEST | \ |
101 | IRQ_NOAUTOEN | IRQ_MOVE_PCNTXT | IRQ_LEVEL | IRQ_NO_BALANCING | \ | 105 | IRQ_NOAUTOEN | IRQ_MOVE_PCNTXT | IRQ_LEVEL | IRQ_NO_BALANCING | \ |
102 | IRQ_PER_CPU | IRQ_NESTED_THREAD | IRQ_NOTHREAD | IRQ_PER_CPU_DEVID) | 106 | IRQ_PER_CPU | IRQ_NESTED_THREAD | IRQ_NOTHREAD | IRQ_PER_CPU_DEVID | \ |
107 | IRQ_IS_POLLED) | ||
103 | 108 | ||
104 | #define IRQ_NO_BALANCING_MASK (IRQ_PER_CPU | IRQ_NO_BALANCING) | 109 | #define IRQ_NO_BALANCING_MASK (IRQ_PER_CPU | IRQ_NO_BALANCING) |
105 | 110 | ||
diff --git a/include/linux/irqreturn.h b/include/linux/irqreturn.h index 714ba08dc092..e374e369fb2f 100644 --- a/include/linux/irqreturn.h +++ b/include/linux/irqreturn.h | |||
@@ -14,6 +14,6 @@ enum irqreturn { | |||
14 | }; | 14 | }; |
15 | 15 | ||
16 | typedef enum irqreturn irqreturn_t; | 16 | typedef enum irqreturn irqreturn_t; |
17 | #define IRQ_RETVAL(x) ((x) != IRQ_NONE) | 17 | #define IRQ_RETVAL(x) ((x) ? IRQ_HANDLED : IRQ_NONE) |
18 | 18 | ||
19 | #endif | 19 | #endif |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index d4e98d13eff4..ecb87544cc5d 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -193,7 +193,8 @@ extern int _cond_resched(void); | |||
193 | (__x < 0) ? -__x : __x; \ | 193 | (__x < 0) ? -__x : __x; \ |
194 | }) | 194 | }) |
195 | 195 | ||
196 | #if defined(CONFIG_PROVE_LOCKING) || defined(CONFIG_DEBUG_ATOMIC_SLEEP) | 196 | #if defined(CONFIG_MMU) && \ |
197 | (defined(CONFIG_PROVE_LOCKING) || defined(CONFIG_DEBUG_ATOMIC_SLEEP)) | ||
197 | void might_fault(void); | 198 | void might_fault(void); |
198 | #else | 199 | #else |
199 | static inline void might_fault(void) { } | 200 | static inline void might_fault(void) { } |
diff --git a/include/linux/kexec.h b/include/linux/kexec.h index d78d28a733b1..5fd33dc1fe3a 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h | |||
@@ -198,6 +198,9 @@ extern u32 vmcoreinfo_note[VMCOREINFO_NOTE_SIZE/4]; | |||
198 | extern size_t vmcoreinfo_size; | 198 | extern size_t vmcoreinfo_size; |
199 | extern size_t vmcoreinfo_max_size; | 199 | extern size_t vmcoreinfo_max_size; |
200 | 200 | ||
201 | /* flag to track if kexec reboot is in progress */ | ||
202 | extern bool kexec_in_progress; | ||
203 | |||
201 | int __init parse_crashkernel(char *cmdline, unsigned long long system_ram, | 204 | int __init parse_crashkernel(char *cmdline, unsigned long long system_ram, |
202 | unsigned long long *crash_size, unsigned long long *crash_base); | 205 | unsigned long long *crash_size, unsigned long long *crash_base); |
203 | int parse_crashkernel_high(char *cmdline, unsigned long long system_ram, | 206 | int parse_crashkernel_high(char *cmdline, unsigned long long system_ram, |
diff --git a/include/linux/key-type.h b/include/linux/key-type.h index 518a53afb9ea..a74c3a84dfdd 100644 --- a/include/linux/key-type.h +++ b/include/linux/key-type.h | |||
@@ -45,6 +45,7 @@ struct key_preparsed_payload { | |||
45 | const void *data; /* Raw data */ | 45 | const void *data; /* Raw data */ |
46 | size_t datalen; /* Raw datalen */ | 46 | size_t datalen; /* Raw datalen */ |
47 | size_t quotalen; /* Quota length for proposed payload */ | 47 | size_t quotalen; /* Quota length for proposed payload */ |
48 | bool trusted; /* True if key is trusted */ | ||
48 | }; | 49 | }; |
49 | 50 | ||
50 | typedef int (*request_key_actor_t)(struct key_construction *key, | 51 | typedef int (*request_key_actor_t)(struct key_construction *key, |
@@ -63,6 +64,11 @@ struct key_type { | |||
63 | */ | 64 | */ |
64 | size_t def_datalen; | 65 | size_t def_datalen; |
65 | 66 | ||
67 | /* Default key search algorithm. */ | ||
68 | unsigned def_lookup_type; | ||
69 | #define KEYRING_SEARCH_LOOKUP_DIRECT 0x0000 /* Direct lookup by description. */ | ||
70 | #define KEYRING_SEARCH_LOOKUP_ITERATE 0x0001 /* Iterative search. */ | ||
71 | |||
66 | /* vet a description */ | 72 | /* vet a description */ |
67 | int (*vet_description)(const char *description); | 73 | int (*vet_description)(const char *description); |
68 | 74 | ||
diff --git a/include/linux/key.h b/include/linux/key.h index 4dfde1161c5e..80d677483e31 100644 --- a/include/linux/key.h +++ b/include/linux/key.h | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/sysctl.h> | 22 | #include <linux/sysctl.h> |
23 | #include <linux/rwsem.h> | 23 | #include <linux/rwsem.h> |
24 | #include <linux/atomic.h> | 24 | #include <linux/atomic.h> |
25 | #include <linux/assoc_array.h> | ||
25 | 26 | ||
26 | #ifdef __KERNEL__ | 27 | #ifdef __KERNEL__ |
27 | #include <linux/uidgid.h> | 28 | #include <linux/uidgid.h> |
@@ -82,6 +83,12 @@ struct key_owner; | |||
82 | struct keyring_list; | 83 | struct keyring_list; |
83 | struct keyring_name; | 84 | struct keyring_name; |
84 | 85 | ||
86 | struct keyring_index_key { | ||
87 | struct key_type *type; | ||
88 | const char *description; | ||
89 | size_t desc_len; | ||
90 | }; | ||
91 | |||
85 | /*****************************************************************************/ | 92 | /*****************************************************************************/ |
86 | /* | 93 | /* |
87 | * key reference with possession attribute handling | 94 | * key reference with possession attribute handling |
@@ -99,7 +106,7 @@ struct keyring_name; | |||
99 | typedef struct __key_reference_with_attributes *key_ref_t; | 106 | typedef struct __key_reference_with_attributes *key_ref_t; |
100 | 107 | ||
101 | static inline key_ref_t make_key_ref(const struct key *key, | 108 | static inline key_ref_t make_key_ref(const struct key *key, |
102 | unsigned long possession) | 109 | bool possession) |
103 | { | 110 | { |
104 | return (key_ref_t) ((unsigned long) key | possession); | 111 | return (key_ref_t) ((unsigned long) key | possession); |
105 | } | 112 | } |
@@ -109,7 +116,7 @@ static inline struct key *key_ref_to_ptr(const key_ref_t key_ref) | |||
109 | return (struct key *) ((unsigned long) key_ref & ~1UL); | 116 | return (struct key *) ((unsigned long) key_ref & ~1UL); |
110 | } | 117 | } |
111 | 118 | ||
112 | static inline unsigned long is_key_possessed(const key_ref_t key_ref) | 119 | static inline bool is_key_possessed(const key_ref_t key_ref) |
113 | { | 120 | { |
114 | return (unsigned long) key_ref & 1UL; | 121 | return (unsigned long) key_ref & 1UL; |
115 | } | 122 | } |
@@ -129,7 +136,6 @@ struct key { | |||
129 | struct list_head graveyard_link; | 136 | struct list_head graveyard_link; |
130 | struct rb_node serial_node; | 137 | struct rb_node serial_node; |
131 | }; | 138 | }; |
132 | struct key_type *type; /* type of key */ | ||
133 | struct rw_semaphore sem; /* change vs change sem */ | 139 | struct rw_semaphore sem; /* change vs change sem */ |
134 | struct key_user *user; /* owner of this key */ | 140 | struct key_user *user; /* owner of this key */ |
135 | void *security; /* security data for this key */ | 141 | void *security; /* security data for this key */ |
@@ -162,13 +168,21 @@ struct key { | |||
162 | #define KEY_FLAG_NEGATIVE 5 /* set if key is negative */ | 168 | #define KEY_FLAG_NEGATIVE 5 /* set if key is negative */ |
163 | #define KEY_FLAG_ROOT_CAN_CLEAR 6 /* set if key can be cleared by root without permission */ | 169 | #define KEY_FLAG_ROOT_CAN_CLEAR 6 /* set if key can be cleared by root without permission */ |
164 | #define KEY_FLAG_INVALIDATED 7 /* set if key has been invalidated */ | 170 | #define KEY_FLAG_INVALIDATED 7 /* set if key has been invalidated */ |
171 | #define KEY_FLAG_TRUSTED 8 /* set if key is trusted */ | ||
172 | #define KEY_FLAG_TRUSTED_ONLY 9 /* set if keyring only accepts links to trusted keys */ | ||
165 | 173 | ||
166 | /* the description string | 174 | /* the key type and key description string |
167 | * - this is used to match a key against search criteria | 175 | * - the desc is used to match a key against search criteria |
168 | * - this should be a printable string | 176 | * - it should be a printable string |
169 | * - eg: for krb5 AFS, this might be "afs@REDHAT.COM" | 177 | * - eg: for krb5 AFS, this might be "afs@REDHAT.COM" |
170 | */ | 178 | */ |
171 | char *description; | 179 | union { |
180 | struct keyring_index_key index_key; | ||
181 | struct { | ||
182 | struct key_type *type; /* type of key */ | ||
183 | char *description; | ||
184 | }; | ||
185 | }; | ||
172 | 186 | ||
173 | /* type specific data | 187 | /* type specific data |
174 | * - this is used by the keyring type to index the name | 188 | * - this is used by the keyring type to index the name |
@@ -185,11 +199,14 @@ struct key { | |||
185 | * whatever | 199 | * whatever |
186 | */ | 200 | */ |
187 | union { | 201 | union { |
188 | unsigned long value; | 202 | union { |
189 | void __rcu *rcudata; | 203 | unsigned long value; |
190 | void *data; | 204 | void __rcu *rcudata; |
191 | struct keyring_list __rcu *subscriptions; | 205 | void *data; |
192 | } payload; | 206 | void *data2[2]; |
207 | } payload; | ||
208 | struct assoc_array keys; | ||
209 | }; | ||
193 | }; | 210 | }; |
194 | 211 | ||
195 | extern struct key *key_alloc(struct key_type *type, | 212 | extern struct key *key_alloc(struct key_type *type, |
@@ -203,18 +220,23 @@ extern struct key *key_alloc(struct key_type *type, | |||
203 | #define KEY_ALLOC_IN_QUOTA 0x0000 /* add to quota, reject if would overrun */ | 220 | #define KEY_ALLOC_IN_QUOTA 0x0000 /* add to quota, reject if would overrun */ |
204 | #define KEY_ALLOC_QUOTA_OVERRUN 0x0001 /* add to quota, permit even if overrun */ | 221 | #define KEY_ALLOC_QUOTA_OVERRUN 0x0001 /* add to quota, permit even if overrun */ |
205 | #define KEY_ALLOC_NOT_IN_QUOTA 0x0002 /* not in quota */ | 222 | #define KEY_ALLOC_NOT_IN_QUOTA 0x0002 /* not in quota */ |
223 | #define KEY_ALLOC_TRUSTED 0x0004 /* Key should be flagged as trusted */ | ||
206 | 224 | ||
207 | extern void key_revoke(struct key *key); | 225 | extern void key_revoke(struct key *key); |
208 | extern void key_invalidate(struct key *key); | 226 | extern void key_invalidate(struct key *key); |
209 | extern void key_put(struct key *key); | 227 | extern void key_put(struct key *key); |
210 | 228 | ||
211 | static inline struct key *key_get(struct key *key) | 229 | static inline struct key *__key_get(struct key *key) |
212 | { | 230 | { |
213 | if (key) | 231 | atomic_inc(&key->usage); |
214 | atomic_inc(&key->usage); | ||
215 | return key; | 232 | return key; |
216 | } | 233 | } |
217 | 234 | ||
235 | static inline struct key *key_get(struct key *key) | ||
236 | { | ||
237 | return key ? __key_get(key) : key; | ||
238 | } | ||
239 | |||
218 | static inline void key_ref_put(key_ref_t key_ref) | 240 | static inline void key_ref_put(key_ref_t key_ref) |
219 | { | 241 | { |
220 | key_put(key_ref_to_ptr(key_ref)); | 242 | key_put(key_ref_to_ptr(key_ref)); |
diff --git a/include/linux/mfd/samsung/core.h b/include/linux/mfd/samsung/core.h index 2d0c9071bcfb..cab2dd279076 100644 --- a/include/linux/mfd/samsung/core.h +++ b/include/linux/mfd/samsung/core.h | |||
@@ -39,7 +39,8 @@ enum sec_device_type { | |||
39 | struct sec_pmic_dev { | 39 | struct sec_pmic_dev { |
40 | struct device *dev; | 40 | struct device *dev; |
41 | struct sec_platform_data *pdata; | 41 | struct sec_platform_data *pdata; |
42 | struct regmap *regmap; | 42 | struct regmap *regmap_pmic; |
43 | struct regmap *regmap_rtc; | ||
43 | struct i2c_client *i2c; | 44 | struct i2c_client *i2c; |
44 | struct i2c_client *rtc; | 45 | struct i2c_client *rtc; |
45 | 46 | ||
diff --git a/include/linux/micrel_phy.h b/include/linux/micrel_phy.h index ad05ce60c1c9..2e5b194b9b19 100644 --- a/include/linux/micrel_phy.h +++ b/include/linux/micrel_phy.h | |||
@@ -22,6 +22,8 @@ | |||
22 | #define PHY_ID_KSZ8021 0x00221555 | 22 | #define PHY_ID_KSZ8021 0x00221555 |
23 | #define PHY_ID_KSZ8031 0x00221556 | 23 | #define PHY_ID_KSZ8031 0x00221556 |
24 | #define PHY_ID_KSZ8041 0x00221510 | 24 | #define PHY_ID_KSZ8041 0x00221510 |
25 | /* undocumented */ | ||
26 | #define PHY_ID_KSZ8041RNLI 0x00221537 | ||
25 | #define PHY_ID_KSZ8051 0x00221550 | 27 | #define PHY_ID_KSZ8051 0x00221550 |
26 | /* same id: ks8001 Rev. A/B, and ks8721 Rev 3. */ | 28 | /* same id: ks8001 Rev. A/B, and ks8721 Rev 3. */ |
27 | #define PHY_ID_KSZ8001 0x0022161A | 29 | #define PHY_ID_KSZ8001 0x0022161A |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 0548eb201e05..1cedd000cf29 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -1318,7 +1318,6 @@ static inline pmd_t *pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long a | |||
1318 | 1318 | ||
1319 | #if USE_SPLIT_PTE_PTLOCKS | 1319 | #if USE_SPLIT_PTE_PTLOCKS |
1320 | #if BLOATED_SPINLOCKS | 1320 | #if BLOATED_SPINLOCKS |
1321 | void __init ptlock_cache_init(void); | ||
1322 | extern bool ptlock_alloc(struct page *page); | 1321 | extern bool ptlock_alloc(struct page *page); |
1323 | extern void ptlock_free(struct page *page); | 1322 | extern void ptlock_free(struct page *page); |
1324 | 1323 | ||
@@ -1327,7 +1326,6 @@ static inline spinlock_t *ptlock_ptr(struct page *page) | |||
1327 | return page->ptl; | 1326 | return page->ptl; |
1328 | } | 1327 | } |
1329 | #else /* BLOATED_SPINLOCKS */ | 1328 | #else /* BLOATED_SPINLOCKS */ |
1330 | static inline void ptlock_cache_init(void) {} | ||
1331 | static inline bool ptlock_alloc(struct page *page) | 1329 | static inline bool ptlock_alloc(struct page *page) |
1332 | { | 1330 | { |
1333 | return true; | 1331 | return true; |
@@ -1380,17 +1378,10 @@ static inline spinlock_t *pte_lockptr(struct mm_struct *mm, pmd_t *pmd) | |||
1380 | { | 1378 | { |
1381 | return &mm->page_table_lock; | 1379 | return &mm->page_table_lock; |
1382 | } | 1380 | } |
1383 | static inline void ptlock_cache_init(void) {} | ||
1384 | static inline bool ptlock_init(struct page *page) { return true; } | 1381 | static inline bool ptlock_init(struct page *page) { return true; } |
1385 | static inline void pte_lock_deinit(struct page *page) {} | 1382 | static inline void pte_lock_deinit(struct page *page) {} |
1386 | #endif /* USE_SPLIT_PTE_PTLOCKS */ | 1383 | #endif /* USE_SPLIT_PTE_PTLOCKS */ |
1387 | 1384 | ||
1388 | static inline void pgtable_init(void) | ||
1389 | { | ||
1390 | ptlock_cache_init(); | ||
1391 | pgtable_cache_init(); | ||
1392 | } | ||
1393 | |||
1394 | static inline bool pgtable_page_ctor(struct page *page) | 1385 | static inline bool pgtable_page_ctor(struct page *page) |
1395 | { | 1386 | { |
1396 | inc_zone_page_state(page, NR_PAGETABLE); | 1387 | inc_zone_page_state(page, NR_PAGETABLE); |
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 10f5a7272b80..bd299418a934 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
@@ -44,18 +44,22 @@ struct page { | |||
44 | /* First double word block */ | 44 | /* First double word block */ |
45 | unsigned long flags; /* Atomic flags, some possibly | 45 | unsigned long flags; /* Atomic flags, some possibly |
46 | * updated asynchronously */ | 46 | * updated asynchronously */ |
47 | struct address_space *mapping; /* If low bit clear, points to | 47 | union { |
48 | * inode address_space, or NULL. | 48 | struct address_space *mapping; /* If low bit clear, points to |
49 | * If page mapped as anonymous | 49 | * inode address_space, or NULL. |
50 | * memory, low bit is set, and | 50 | * If page mapped as anonymous |
51 | * it points to anon_vma object: | 51 | * memory, low bit is set, and |
52 | * see PAGE_MAPPING_ANON below. | 52 | * it points to anon_vma object: |
53 | */ | 53 | * see PAGE_MAPPING_ANON below. |
54 | */ | ||
55 | void *s_mem; /* slab first object */ | ||
56 | }; | ||
57 | |||
54 | /* Second double word */ | 58 | /* Second double word */ |
55 | struct { | 59 | struct { |
56 | union { | 60 | union { |
57 | pgoff_t index; /* Our offset within mapping. */ | 61 | pgoff_t index; /* Our offset within mapping. */ |
58 | void *freelist; /* slub/slob first free object */ | 62 | void *freelist; /* sl[aou]b first free object */ |
59 | bool pfmemalloc; /* If set by the page allocator, | 63 | bool pfmemalloc; /* If set by the page allocator, |
60 | * ALLOC_NO_WATERMARKS was set | 64 | * ALLOC_NO_WATERMARKS was set |
61 | * and the low watermark was not | 65 | * and the low watermark was not |
@@ -65,9 +69,6 @@ struct page { | |||
65 | * this page is only used to | 69 | * this page is only used to |
66 | * free other pages. | 70 | * free other pages. |
67 | */ | 71 | */ |
68 | #if defined(CONFIG_TRANSPARENT_HUGEPAGE) && USE_SPLIT_PMD_PTLOCKS | ||
69 | pgtable_t pmd_huge_pte; /* protected by page->ptl */ | ||
70 | #endif | ||
71 | }; | 72 | }; |
72 | 73 | ||
73 | union { | 74 | union { |
@@ -114,6 +115,7 @@ struct page { | |||
114 | }; | 115 | }; |
115 | atomic_t _count; /* Usage count, see below. */ | 116 | atomic_t _count; /* Usage count, see below. */ |
116 | }; | 117 | }; |
118 | unsigned int active; /* SLAB */ | ||
117 | }; | 119 | }; |
118 | }; | 120 | }; |
119 | 121 | ||
@@ -135,6 +137,12 @@ struct page { | |||
135 | 137 | ||
136 | struct list_head list; /* slobs list of pages */ | 138 | struct list_head list; /* slobs list of pages */ |
137 | struct slab *slab_page; /* slab fields */ | 139 | struct slab *slab_page; /* slab fields */ |
140 | struct rcu_head rcu_head; /* Used by SLAB | ||
141 | * when destroying via RCU | ||
142 | */ | ||
143 | #if defined(CONFIG_TRANSPARENT_HUGEPAGE) && USE_SPLIT_PMD_PTLOCKS | ||
144 | pgtable_t pmd_huge_pte; /* protected by page->ptl */ | ||
145 | #endif | ||
138 | }; | 146 | }; |
139 | 147 | ||
140 | /* Remainder is not double word aligned */ | 148 | /* Remainder is not double word aligned */ |
diff --git a/include/linux/msi.h b/include/linux/msi.h index 87cce50bd121..009b02481436 100644 --- a/include/linux/msi.h +++ b/include/linux/msi.h | |||
@@ -26,11 +26,11 @@ struct msi_desc { | |||
26 | struct { | 26 | struct { |
27 | __u8 is_msix : 1; | 27 | __u8 is_msix : 1; |
28 | __u8 multiple: 3; /* log2 number of messages */ | 28 | __u8 multiple: 3; /* log2 number of messages */ |
29 | __u8 maskbit : 1; /* mask-pending bit supported ? */ | 29 | __u8 maskbit : 1; /* mask-pending bit supported ? */ |
30 | __u8 is_64 : 1; /* Address size: 0=32bit 1=64bit */ | 30 | __u8 is_64 : 1; /* Address size: 0=32bit 1=64bit */ |
31 | __u8 pos; /* Location of the msi capability */ | 31 | __u8 pos; /* Location of the msi capability */ |
32 | __u16 entry_nr; /* specific enabled entry */ | 32 | __u16 entry_nr; /* specific enabled entry */ |
33 | unsigned default_irq; /* default pre-assigned irq */ | 33 | unsigned default_irq; /* default pre-assigned irq */ |
34 | } msi_attrib; | 34 | } msi_attrib; |
35 | 35 | ||
36 | u32 masked; /* mask bits */ | 36 | u32 masked; /* mask bits */ |
diff --git a/include/linux/net.h b/include/linux/net.h index b292a0435571..69be3e6079c8 100644 --- a/include/linux/net.h +++ b/include/linux/net.h | |||
@@ -164,6 +164,14 @@ struct proto_ops { | |||
164 | #endif | 164 | #endif |
165 | int (*sendmsg) (struct kiocb *iocb, struct socket *sock, | 165 | int (*sendmsg) (struct kiocb *iocb, struct socket *sock, |
166 | struct msghdr *m, size_t total_len); | 166 | struct msghdr *m, size_t total_len); |
167 | /* Notes for implementing recvmsg: | ||
168 | * =============================== | ||
169 | * msg->msg_namelen should get updated by the recvmsg handlers | ||
170 | * iff msg_name != NULL. It is by default 0 to prevent | ||
171 | * returning uninitialized memory to user space. The recvfrom | ||
172 | * handlers can assume that msg.msg_name is either NULL or has | ||
173 | * a minimum size of sizeof(struct sockaddr_storage). | ||
174 | */ | ||
167 | int (*recvmsg) (struct kiocb *iocb, struct socket *sock, | 175 | int (*recvmsg) (struct kiocb *iocb, struct socket *sock, |
168 | struct msghdr *m, size_t total_len, | 176 | struct msghdr *m, size_t total_len, |
169 | int flags); | 177 | int flags); |
@@ -173,7 +181,7 @@ struct proto_ops { | |||
173 | int offset, size_t size, int flags); | 181 | int offset, size_t size, int flags); |
174 | ssize_t (*splice_read)(struct socket *sock, loff_t *ppos, | 182 | ssize_t (*splice_read)(struct socket *sock, loff_t *ppos, |
175 | struct pipe_inode_info *pipe, size_t len, unsigned int flags); | 183 | struct pipe_inode_info *pipe, size_t len, unsigned int flags); |
176 | void (*set_peek_off)(struct sock *sk, int val); | 184 | int (*set_peek_off)(struct sock *sk, int val); |
177 | }; | 185 | }; |
178 | 186 | ||
179 | #define DECLARE_SOCKADDR(type, dst, src) \ | 187 | #define DECLARE_SOCKADDR(type, dst, src) \ |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 7f0ed423a360..d9a550bf3e8e 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -1255,7 +1255,7 @@ struct net_device { | |||
1255 | unsigned char perm_addr[MAX_ADDR_LEN]; /* permanent hw address */ | 1255 | unsigned char perm_addr[MAX_ADDR_LEN]; /* permanent hw address */ |
1256 | unsigned char addr_assign_type; /* hw address assignment type */ | 1256 | unsigned char addr_assign_type; /* hw address assignment type */ |
1257 | unsigned char addr_len; /* hardware address length */ | 1257 | unsigned char addr_len; /* hardware address length */ |
1258 | unsigned char neigh_priv_len; | 1258 | unsigned short neigh_priv_len; |
1259 | unsigned short dev_id; /* Used to differentiate devices | 1259 | unsigned short dev_id; /* Used to differentiate devices |
1260 | * that share the same link | 1260 | * that share the same link |
1261 | * layer address | 1261 | * layer address |
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index c1637062c1ce..12c2cb947df5 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h | |||
@@ -413,16 +413,6 @@ enum lock_type4 { | |||
413 | #define NFS4_VERSION 4 | 413 | #define NFS4_VERSION 4 |
414 | #define NFS4_MINOR_VERSION 0 | 414 | #define NFS4_MINOR_VERSION 0 |
415 | 415 | ||
416 | #if defined(CONFIG_NFS_V4_2) | ||
417 | #define NFS4_MAX_MINOR_VERSION 2 | ||
418 | #else | ||
419 | #if defined(CONFIG_NFS_V4_1) | ||
420 | #define NFS4_MAX_MINOR_VERSION 1 | ||
421 | #else | ||
422 | #define NFS4_MAX_MINOR_VERSION 0 | ||
423 | #endif /* CONFIG_NFS_V4_1 */ | ||
424 | #endif /* CONFIG_NFS_V4_2 */ | ||
425 | |||
426 | #define NFS4_DEBUG 1 | 416 | #define NFS4_DEBUG 1 |
427 | 417 | ||
428 | /* Index of predefined Linux client operations */ | 418 | /* Index of predefined Linux client operations */ |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 14a48207a304..48997374eaf0 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
@@ -507,24 +507,6 @@ extern int nfs_mountpoint_expiry_timeout; | |||
507 | extern void nfs_release_automount_timer(void); | 507 | extern void nfs_release_automount_timer(void); |
508 | 508 | ||
509 | /* | 509 | /* |
510 | * linux/fs/nfs/nfs4proc.c | ||
511 | */ | ||
512 | #ifdef CONFIG_NFS_V4_SECURITY_LABEL | ||
513 | extern struct nfs4_label *nfs4_label_alloc(struct nfs_server *server, gfp_t flags); | ||
514 | static inline void nfs4_label_free(struct nfs4_label *label) | ||
515 | { | ||
516 | if (label) { | ||
517 | kfree(label->label); | ||
518 | kfree(label); | ||
519 | } | ||
520 | return; | ||
521 | } | ||
522 | #else | ||
523 | static inline struct nfs4_label *nfs4_label_alloc(struct nfs_server *server, gfp_t flags) { return NULL; } | ||
524 | static inline void nfs4_label_free(void *label) {} | ||
525 | #endif | ||
526 | |||
527 | /* | ||
528 | * linux/fs/nfs/unlink.c | 510 | * linux/fs/nfs/unlink.c |
529 | */ | 511 | */ |
530 | extern void nfs_complete_unlink(struct dentry *dentry, struct inode *); | 512 | extern void nfs_complete_unlink(struct dentry *dentry, struct inode *); |
diff --git a/include/linux/padata.h b/include/linux/padata.h index 86292beebfe2..438694650471 100644 --- a/include/linux/padata.h +++ b/include/linux/padata.h | |||
@@ -129,10 +129,9 @@ struct parallel_data { | |||
129 | struct padata_serial_queue __percpu *squeue; | 129 | struct padata_serial_queue __percpu *squeue; |
130 | atomic_t reorder_objects; | 130 | atomic_t reorder_objects; |
131 | atomic_t refcnt; | 131 | atomic_t refcnt; |
132 | atomic_t seq_nr; | ||
132 | struct padata_cpumask cpumask; | 133 | struct padata_cpumask cpumask; |
133 | spinlock_t lock ____cacheline_aligned; | 134 | spinlock_t lock ____cacheline_aligned; |
134 | spinlock_t seq_lock; | ||
135 | unsigned int seq_nr; | ||
136 | unsigned int processed; | 135 | unsigned int processed; |
137 | struct timer_list timer; | 136 | struct timer_list timer; |
138 | }; | 137 | }; |
diff --git a/include/linux/pci-acpi.h b/include/linux/pci-acpi.h index d006f0ca60f4..5a462c4e5009 100644 --- a/include/linux/pci-acpi.h +++ b/include/linux/pci-acpi.h | |||
@@ -27,7 +27,7 @@ static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev) | |||
27 | while (!pci_is_root_bus(pbus)) | 27 | while (!pci_is_root_bus(pbus)) |
28 | pbus = pbus->parent; | 28 | pbus = pbus->parent; |
29 | 29 | ||
30 | return DEVICE_ACPI_HANDLE(pbus->bridge); | 30 | return ACPI_HANDLE(pbus->bridge); |
31 | } | 31 | } |
32 | 32 | ||
33 | static inline acpi_handle acpi_pci_get_bridge_handle(struct pci_bus *pbus) | 33 | static inline acpi_handle acpi_pci_get_bridge_handle(struct pci_bus *pbus) |
@@ -39,7 +39,7 @@ static inline acpi_handle acpi_pci_get_bridge_handle(struct pci_bus *pbus) | |||
39 | else | 39 | else |
40 | dev = &pbus->self->dev; | 40 | dev = &pbus->self->dev; |
41 | 41 | ||
42 | return DEVICE_ACPI_HANDLE(dev); | 42 | return ACPI_HANDLE(dev); |
43 | } | 43 | } |
44 | 44 | ||
45 | void acpi_pci_add_bus(struct pci_bus *bus); | 45 | void acpi_pci_add_bus(struct pci_bus *bus); |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 835ec7bf6c05..a13d6825e586 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -32,7 +32,6 @@ | |||
32 | #include <linux/irqreturn.h> | 32 | #include <linux/irqreturn.h> |
33 | #include <uapi/linux/pci.h> | 33 | #include <uapi/linux/pci.h> |
34 | 34 | ||
35 | /* Include the ID list */ | ||
36 | #include <linux/pci_ids.h> | 35 | #include <linux/pci_ids.h> |
37 | 36 | ||
38 | /* | 37 | /* |
@@ -42,9 +41,10 @@ | |||
42 | * | 41 | * |
43 | * 7:3 = slot | 42 | * 7:3 = slot |
44 | * 2:0 = function | 43 | * 2:0 = function |
45 | * PCI_DEVFN(), PCI_SLOT(), and PCI_FUNC() are defined uapi/linux/pci.h | 44 | * |
45 | * PCI_DEVFN(), PCI_SLOT(), and PCI_FUNC() are defined in uapi/linux/pci.h. | ||
46 | * In the interest of not exposing interfaces to user-space unnecessarily, | 46 | * In the interest of not exposing interfaces to user-space unnecessarily, |
47 | * the following kernel only defines are being added here. | 47 | * the following kernel-only defines are being added here. |
48 | */ | 48 | */ |
49 | #define PCI_DEVID(bus, devfn) ((((u16)bus) << 8) | devfn) | 49 | #define PCI_DEVID(bus, devfn) ((((u16)bus) << 8) | devfn) |
50 | /* return bus from PCI devid = ((u16)bus_number) << 8) | devfn */ | 50 | /* return bus from PCI devid = ((u16)bus_number) << 8) | devfn */ |
@@ -153,10 +153,10 @@ enum pcie_reset_state { | |||
153 | /* Reset is NOT asserted (Use to deassert reset) */ | 153 | /* Reset is NOT asserted (Use to deassert reset) */ |
154 | pcie_deassert_reset = (__force pcie_reset_state_t) 1, | 154 | pcie_deassert_reset = (__force pcie_reset_state_t) 1, |
155 | 155 | ||
156 | /* Use #PERST to reset PCI-E device */ | 156 | /* Use #PERST to reset PCIe device */ |
157 | pcie_warm_reset = (__force pcie_reset_state_t) 2, | 157 | pcie_warm_reset = (__force pcie_reset_state_t) 2, |
158 | 158 | ||
159 | /* Use PCI-E Hot Reset to reset device */ | 159 | /* Use PCIe Hot Reset to reset device */ |
160 | pcie_hot_reset = (__force pcie_reset_state_t) 3 | 160 | pcie_hot_reset = (__force pcie_reset_state_t) 3 |
161 | }; | 161 | }; |
162 | 162 | ||
@@ -259,13 +259,13 @@ struct pci_dev { | |||
259 | unsigned int class; /* 3 bytes: (base,sub,prog-if) */ | 259 | unsigned int class; /* 3 bytes: (base,sub,prog-if) */ |
260 | u8 revision; /* PCI revision, low byte of class word */ | 260 | u8 revision; /* PCI revision, low byte of class word */ |
261 | u8 hdr_type; /* PCI header type (`multi' flag masked out) */ | 261 | u8 hdr_type; /* PCI header type (`multi' flag masked out) */ |
262 | u8 pcie_cap; /* PCI-E capability offset */ | 262 | u8 pcie_cap; /* PCIe capability offset */ |
263 | u8 msi_cap; /* MSI capability offset */ | 263 | u8 msi_cap; /* MSI capability offset */ |
264 | u8 msix_cap; /* MSI-X capability offset */ | 264 | u8 msix_cap; /* MSI-X capability offset */ |
265 | u8 pcie_mpss:3; /* PCI-E Max Payload Size Supported */ | 265 | u8 pcie_mpss:3; /* PCIe Max Payload Size Supported */ |
266 | u8 rom_base_reg; /* which config register controls the ROM */ | 266 | u8 rom_base_reg; /* which config register controls the ROM */ |
267 | u8 pin; /* which interrupt pin this device uses */ | 267 | u8 pin; /* which interrupt pin this device uses */ |
268 | u16 pcie_flags_reg; /* cached PCI-E Capabilities Register */ | 268 | u16 pcie_flags_reg; /* cached PCIe Capabilities Register */ |
269 | 269 | ||
270 | struct pci_driver *driver; /* which driver has allocated this device */ | 270 | struct pci_driver *driver; /* which driver has allocated this device */ |
271 | u64 dma_mask; /* Mask of the bits of bus address this | 271 | u64 dma_mask; /* Mask of the bits of bus address this |
@@ -300,7 +300,7 @@ struct pci_dev { | |||
300 | unsigned int d3cold_delay; /* D3cold->D0 transition time in ms */ | 300 | unsigned int d3cold_delay; /* D3cold->D0 transition time in ms */ |
301 | 301 | ||
302 | #ifdef CONFIG_PCIEASPM | 302 | #ifdef CONFIG_PCIEASPM |
303 | struct pcie_link_state *link_state; /* ASPM link state. */ | 303 | struct pcie_link_state *link_state; /* ASPM link state */ |
304 | #endif | 304 | #endif |
305 | 305 | ||
306 | pci_channel_state_t error_state; /* current connectivity state */ | 306 | pci_channel_state_t error_state; /* current connectivity state */ |
@@ -317,7 +317,7 @@ struct pci_dev { | |||
317 | 317 | ||
318 | bool match_driver; /* Skip attaching driver */ | 318 | bool match_driver; /* Skip attaching driver */ |
319 | /* These fields are used by common fixups */ | 319 | /* These fields are used by common fixups */ |
320 | unsigned int transparent:1; /* Transparent PCI bridge */ | 320 | unsigned int transparent:1; /* Subtractive decode PCI bridge */ |
321 | unsigned int multifunction:1;/* Part of multi-function device */ | 321 | unsigned int multifunction:1;/* Part of multi-function device */ |
322 | /* keep track of device state */ | 322 | /* keep track of device state */ |
323 | unsigned int is_added:1; | 323 | unsigned int is_added:1; |
@@ -326,7 +326,7 @@ struct pci_dev { | |||
326 | unsigned int block_cfg_access:1; /* config space access is blocked */ | 326 | unsigned int block_cfg_access:1; /* config space access is blocked */ |
327 | unsigned int broken_parity_status:1; /* Device generates false positive parity */ | 327 | unsigned int broken_parity_status:1; /* Device generates false positive parity */ |
328 | unsigned int irq_reroute_variant:2; /* device needs IRQ rerouting variant */ | 328 | unsigned int irq_reroute_variant:2; /* device needs IRQ rerouting variant */ |
329 | unsigned int msi_enabled:1; | 329 | unsigned int msi_enabled:1; |
330 | unsigned int msix_enabled:1; | 330 | unsigned int msix_enabled:1; |
331 | unsigned int ari_enabled:1; /* ARI forwarding */ | 331 | unsigned int ari_enabled:1; /* ARI forwarding */ |
332 | unsigned int is_managed:1; | 332 | unsigned int is_managed:1; |
@@ -371,7 +371,6 @@ static inline struct pci_dev *pci_physfn(struct pci_dev *dev) | |||
371 | if (dev->is_virtfn) | 371 | if (dev->is_virtfn) |
372 | dev = dev->physfn; | 372 | dev = dev->physfn; |
373 | #endif | 373 | #endif |
374 | |||
375 | return dev; | 374 | return dev; |
376 | } | 375 | } |
377 | 376 | ||
@@ -456,7 +455,7 @@ struct pci_bus { | |||
456 | char name[48]; | 455 | char name[48]; |
457 | 456 | ||
458 | unsigned short bridge_ctl; /* manage NO_ISA/FBB/et al behaviors */ | 457 | unsigned short bridge_ctl; /* manage NO_ISA/FBB/et al behaviors */ |
459 | pci_bus_flags_t bus_flags; /* Inherited by child busses */ | 458 | pci_bus_flags_t bus_flags; /* inherited by child buses */ |
460 | struct device *bridge; | 459 | struct device *bridge; |
461 | struct device dev; | 460 | struct device dev; |
462 | struct bin_attribute *legacy_io; /* legacy I/O for this bus */ | 461 | struct bin_attribute *legacy_io; /* legacy I/O for this bus */ |
@@ -468,7 +467,7 @@ struct pci_bus { | |||
468 | #define to_pci_bus(n) container_of(n, struct pci_bus, dev) | 467 | #define to_pci_bus(n) container_of(n, struct pci_bus, dev) |
469 | 468 | ||
470 | /* | 469 | /* |
471 | * Returns true if the pci bus is root (behind host-pci bridge), | 470 | * Returns true if the PCI bus is root (behind host-PCI bridge), |
472 | * false otherwise | 471 | * false otherwise |
473 | * | 472 | * |
474 | * Some code assumes that "bus->self == NULL" means that bus is a root bus. | 473 | * Some code assumes that "bus->self == NULL" means that bus is a root bus. |
@@ -510,7 +509,7 @@ static inline bool pci_dev_msi_enabled(struct pci_dev *pci_dev) { return false; | |||
510 | #define PCIBIOS_BUFFER_TOO_SMALL 0x89 | 509 | #define PCIBIOS_BUFFER_TOO_SMALL 0x89 |
511 | 510 | ||
512 | /* | 511 | /* |
513 | * Translate above to generic errno for passing back through non-pci. | 512 | * Translate above to generic errno for passing back through non-PCI code. |
514 | */ | 513 | */ |
515 | static inline int pcibios_err_to_errno(int err) | 514 | static inline int pcibios_err_to_errno(int err) |
516 | { | 515 | { |
@@ -561,11 +560,12 @@ struct pci_dynids { | |||
561 | struct list_head list; /* for IDs added at runtime */ | 560 | struct list_head list; /* for IDs added at runtime */ |
562 | }; | 561 | }; |
563 | 562 | ||
564 | /* ---------------------------------------------------------------- */ | 563 | |
565 | /** PCI Error Recovery System (PCI-ERS). If a PCI device driver provides | 564 | /* |
566 | * a set of callbacks in struct pci_error_handlers, then that device driver | 565 | * PCI Error Recovery System (PCI-ERS). If a PCI device driver provides |
567 | * will be notified of PCI bus errors, and will be driven to recovery | 566 | * a set of callbacks in struct pci_error_handlers, that device driver |
568 | * when an error occurs. | 567 | * will be notified of PCI bus errors, and will be driven to recovery |
568 | * when an error occurs. | ||
569 | */ | 569 | */ |
570 | 570 | ||
571 | typedef unsigned int __bitwise pci_ers_result_t; | 571 | typedef unsigned int __bitwise pci_ers_result_t; |
@@ -609,7 +609,6 @@ struct pci_error_handlers { | |||
609 | void (*resume)(struct pci_dev *dev); | 609 | void (*resume)(struct pci_dev *dev); |
610 | }; | 610 | }; |
611 | 611 | ||
612 | /* ---------------------------------------------------------------- */ | ||
613 | 612 | ||
614 | struct module; | 613 | struct module; |
615 | struct pci_driver { | 614 | struct pci_driver { |
@@ -713,10 +712,10 @@ extern enum pcie_bus_config_types pcie_bus_config; | |||
713 | 712 | ||
714 | extern struct bus_type pci_bus_type; | 713 | extern struct bus_type pci_bus_type; |
715 | 714 | ||
716 | /* Do NOT directly access these two variables, unless you are arch specific pci | 715 | /* Do NOT directly access these two variables, unless you are arch-specific PCI |
717 | * code, or pci core code. */ | 716 | * code, or PCI core code. */ |
718 | extern struct list_head pci_root_buses; /* list of all known PCI buses */ | 717 | extern struct list_head pci_root_buses; /* list of all known PCI buses */ |
719 | /* Some device drivers need know if pci is initiated */ | 718 | /* Some device drivers need know if PCI is initiated */ |
720 | int no_pci_devices(void); | 719 | int no_pci_devices(void); |
721 | 720 | ||
722 | void pcibios_resource_survey_bus(struct pci_bus *bus); | 721 | void pcibios_resource_survey_bus(struct pci_bus *bus); |
@@ -724,7 +723,7 @@ void pcibios_add_bus(struct pci_bus *bus); | |||
724 | void pcibios_remove_bus(struct pci_bus *bus); | 723 | void pcibios_remove_bus(struct pci_bus *bus); |
725 | void pcibios_fixup_bus(struct pci_bus *); | 724 | void pcibios_fixup_bus(struct pci_bus *); |
726 | int __must_check pcibios_enable_device(struct pci_dev *, int mask); | 725 | int __must_check pcibios_enable_device(struct pci_dev *, int mask); |
727 | /* Architecture specific versions may override this (weak) */ | 726 | /* Architecture-specific versions may override this (weak) */ |
728 | char *pcibios_setup(char *str); | 727 | char *pcibios_setup(char *str); |
729 | 728 | ||
730 | /* Used only when drivers/pci/setup.c is used */ | 729 | /* Used only when drivers/pci/setup.c is used */ |
@@ -961,6 +960,7 @@ void pci_update_resource(struct pci_dev *dev, int resno); | |||
961 | int __must_check pci_assign_resource(struct pci_dev *dev, int i); | 960 | int __must_check pci_assign_resource(struct pci_dev *dev, int i); |
962 | int __must_check pci_reassign_resource(struct pci_dev *dev, int i, resource_size_t add_size, resource_size_t align); | 961 | int __must_check pci_reassign_resource(struct pci_dev *dev, int i, resource_size_t add_size, resource_size_t align); |
963 | int pci_select_bars(struct pci_dev *dev, unsigned long flags); | 962 | int pci_select_bars(struct pci_dev *dev, unsigned long flags); |
963 | bool pci_device_is_present(struct pci_dev *pdev); | ||
964 | 964 | ||
965 | /* ROM control related routines */ | 965 | /* ROM control related routines */ |
966 | int pci_enable_rom(struct pci_dev *pdev); | 966 | int pci_enable_rom(struct pci_dev *pdev); |
@@ -1258,7 +1258,7 @@ void pci_cfg_access_unlock(struct pci_dev *dev); | |||
1258 | 1258 | ||
1259 | /* | 1259 | /* |
1260 | * PCI domain support. Sometimes called PCI segment (eg by ACPI), | 1260 | * PCI domain support. Sometimes called PCI segment (eg by ACPI), |
1261 | * a PCI domain is defined to be a set of PCI busses which share | 1261 | * a PCI domain is defined to be a set of PCI buses which share |
1262 | * configuration space. | 1262 | * configuration space. |
1263 | */ | 1263 | */ |
1264 | #ifdef CONFIG_PCI_DOMAINS | 1264 | #ifdef CONFIG_PCI_DOMAINS |
@@ -1568,65 +1568,65 @@ enum pci_fixup_pass { | |||
1568 | /* Anonymous variables would be nice... */ | 1568 | /* Anonymous variables would be nice... */ |
1569 | #define DECLARE_PCI_FIXUP_SECTION(section, name, vendor, device, class, \ | 1569 | #define DECLARE_PCI_FIXUP_SECTION(section, name, vendor, device, class, \ |
1570 | class_shift, hook) \ | 1570 | class_shift, hook) \ |
1571 | static const struct pci_fixup __pci_fixup_##name __used \ | 1571 | static const struct pci_fixup __PASTE(__pci_fixup_##name,__LINE__) __used \ |
1572 | __attribute__((__section__(#section), aligned((sizeof(void *))))) \ | 1572 | __attribute__((__section__(#section), aligned((sizeof(void *))))) \ |
1573 | = { vendor, device, class, class_shift, hook }; | 1573 | = { vendor, device, class, class_shift, hook }; |
1574 | 1574 | ||
1575 | #define DECLARE_PCI_FIXUP_CLASS_EARLY(vendor, device, class, \ | 1575 | #define DECLARE_PCI_FIXUP_CLASS_EARLY(vendor, device, class, \ |
1576 | class_shift, hook) \ | 1576 | class_shift, hook) \ |
1577 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_early, \ | 1577 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_early, \ |
1578 | vendor##device##hook, vendor, device, class, class_shift, hook) | 1578 | hook, vendor, device, class, class_shift, hook) |
1579 | #define DECLARE_PCI_FIXUP_CLASS_HEADER(vendor, device, class, \ | 1579 | #define DECLARE_PCI_FIXUP_CLASS_HEADER(vendor, device, class, \ |
1580 | class_shift, hook) \ | 1580 | class_shift, hook) \ |
1581 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_header, \ | 1581 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_header, \ |
1582 | vendor##device##hook, vendor, device, class, class_shift, hook) | 1582 | hook, vendor, device, class, class_shift, hook) |
1583 | #define DECLARE_PCI_FIXUP_CLASS_FINAL(vendor, device, class, \ | 1583 | #define DECLARE_PCI_FIXUP_CLASS_FINAL(vendor, device, class, \ |
1584 | class_shift, hook) \ | 1584 | class_shift, hook) \ |
1585 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_final, \ | 1585 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_final, \ |
1586 | vendor##device##hook, vendor, device, class, class_shift, hook) | 1586 | hook, vendor, device, class, class_shift, hook) |
1587 | #define DECLARE_PCI_FIXUP_CLASS_ENABLE(vendor, device, class, \ | 1587 | #define DECLARE_PCI_FIXUP_CLASS_ENABLE(vendor, device, class, \ |
1588 | class_shift, hook) \ | 1588 | class_shift, hook) \ |
1589 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_enable, \ | 1589 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_enable, \ |
1590 | vendor##device##hook, vendor, device, class, class_shift, hook) | 1590 | hook, vendor, device, class, class_shift, hook) |
1591 | #define DECLARE_PCI_FIXUP_CLASS_RESUME(vendor, device, class, \ | 1591 | #define DECLARE_PCI_FIXUP_CLASS_RESUME(vendor, device, class, \ |
1592 | class_shift, hook) \ | 1592 | class_shift, hook) \ |
1593 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume, \ | 1593 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume, \ |
1594 | resume##vendor##device##hook, vendor, device, class, \ | 1594 | resume##hook, vendor, device, class, \ |
1595 | class_shift, hook) | 1595 | class_shift, hook) |
1596 | #define DECLARE_PCI_FIXUP_CLASS_RESUME_EARLY(vendor, device, class, \ | 1596 | #define DECLARE_PCI_FIXUP_CLASS_RESUME_EARLY(vendor, device, class, \ |
1597 | class_shift, hook) \ | 1597 | class_shift, hook) \ |
1598 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume_early, \ | 1598 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume_early, \ |
1599 | resume_early##vendor##device##hook, vendor, device, \ | 1599 | resume_early##hook, vendor, device, \ |
1600 | class, class_shift, hook) | 1600 | class, class_shift, hook) |
1601 | #define DECLARE_PCI_FIXUP_CLASS_SUSPEND(vendor, device, class, \ | 1601 | #define DECLARE_PCI_FIXUP_CLASS_SUSPEND(vendor, device, class, \ |
1602 | class_shift, hook) \ | 1602 | class_shift, hook) \ |
1603 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend, \ | 1603 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend, \ |
1604 | suspend##vendor##device##hook, vendor, device, class, \ | 1604 | suspend##hook, vendor, device, class, \ |
1605 | class_shift, hook) | 1605 | class_shift, hook) |
1606 | 1606 | ||
1607 | #define DECLARE_PCI_FIXUP_EARLY(vendor, device, hook) \ | 1607 | #define DECLARE_PCI_FIXUP_EARLY(vendor, device, hook) \ |
1608 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_early, \ | 1608 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_early, \ |
1609 | vendor##device##hook, vendor, device, PCI_ANY_ID, 0, hook) | 1609 | hook, vendor, device, PCI_ANY_ID, 0, hook) |
1610 | #define DECLARE_PCI_FIXUP_HEADER(vendor, device, hook) \ | 1610 | #define DECLARE_PCI_FIXUP_HEADER(vendor, device, hook) \ |
1611 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_header, \ | 1611 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_header, \ |
1612 | vendor##device##hook, vendor, device, PCI_ANY_ID, 0, hook) | 1612 | hook, vendor, device, PCI_ANY_ID, 0, hook) |
1613 | #define DECLARE_PCI_FIXUP_FINAL(vendor, device, hook) \ | 1613 | #define DECLARE_PCI_FIXUP_FINAL(vendor, device, hook) \ |
1614 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_final, \ | 1614 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_final, \ |
1615 | vendor##device##hook, vendor, device, PCI_ANY_ID, 0, hook) | 1615 | hook, vendor, device, PCI_ANY_ID, 0, hook) |
1616 | #define DECLARE_PCI_FIXUP_ENABLE(vendor, device, hook) \ | 1616 | #define DECLARE_PCI_FIXUP_ENABLE(vendor, device, hook) \ |
1617 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_enable, \ | 1617 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_enable, \ |
1618 | vendor##device##hook, vendor, device, PCI_ANY_ID, 0, hook) | 1618 | hook, vendor, device, PCI_ANY_ID, 0, hook) |
1619 | #define DECLARE_PCI_FIXUP_RESUME(vendor, device, hook) \ | 1619 | #define DECLARE_PCI_FIXUP_RESUME(vendor, device, hook) \ |
1620 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume, \ | 1620 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume, \ |
1621 | resume##vendor##device##hook, vendor, device, \ | 1621 | resume##hook, vendor, device, \ |
1622 | PCI_ANY_ID, 0, hook) | 1622 | PCI_ANY_ID, 0, hook) |
1623 | #define DECLARE_PCI_FIXUP_RESUME_EARLY(vendor, device, hook) \ | 1623 | #define DECLARE_PCI_FIXUP_RESUME_EARLY(vendor, device, hook) \ |
1624 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume_early, \ | 1624 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume_early, \ |
1625 | resume_early##vendor##device##hook, vendor, device, \ | 1625 | resume_early##hook, vendor, device, \ |
1626 | PCI_ANY_ID, 0, hook) | 1626 | PCI_ANY_ID, 0, hook) |
1627 | #define DECLARE_PCI_FIXUP_SUSPEND(vendor, device, hook) \ | 1627 | #define DECLARE_PCI_FIXUP_SUSPEND(vendor, device, hook) \ |
1628 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend, \ | 1628 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend, \ |
1629 | suspend##vendor##device##hook, vendor, device, \ | 1629 | suspend##hook, vendor, device, \ |
1630 | PCI_ANY_ID, 0, hook) | 1630 | PCI_ANY_ID, 0, hook) |
1631 | 1631 | ||
1632 | #ifdef CONFIG_PCI_QUIRKS | 1632 | #ifdef CONFIG_PCI_QUIRKS |
@@ -1672,7 +1672,7 @@ extern u8 pci_cache_line_size; | |||
1672 | extern unsigned long pci_hotplug_io_size; | 1672 | extern unsigned long pci_hotplug_io_size; |
1673 | extern unsigned long pci_hotplug_mem_size; | 1673 | extern unsigned long pci_hotplug_mem_size; |
1674 | 1674 | ||
1675 | /* Architecture specific versions may override these (weak) */ | 1675 | /* Architecture-specific versions may override these (weak) */ |
1676 | int pcibios_add_platform_entries(struct pci_dev *dev); | 1676 | int pcibios_add_platform_entries(struct pci_dev *dev); |
1677 | void pcibios_disable_device(struct pci_dev *dev); | 1677 | void pcibios_disable_device(struct pci_dev *dev); |
1678 | void pcibios_set_master(struct pci_dev *dev); | 1678 | void pcibios_set_master(struct pci_dev *dev); |
diff --git a/include/linux/pci_hotplug.h b/include/linux/pci_hotplug.h index 430dd963707b..a2e2f1d17e16 100644 --- a/include/linux/pci_hotplug.h +++ b/include/linux/pci_hotplug.h | |||
@@ -39,8 +39,8 @@ | |||
39 | * @hardware_test: Called to run a specified hardware test on the specified | 39 | * @hardware_test: Called to run a specified hardware test on the specified |
40 | * slot. | 40 | * slot. |
41 | * @get_power_status: Called to get the current power status of a slot. | 41 | * @get_power_status: Called to get the current power status of a slot. |
42 | * If this field is NULL, the value passed in the struct hotplug_slot_info | 42 | * If this field is NULL, the value passed in the struct hotplug_slot_info |
43 | * will be used when this value is requested by a user. | 43 | * will be used when this value is requested by a user. |
44 | * @get_attention_status: Called to get the current attention status of a slot. | 44 | * @get_attention_status: Called to get the current attention status of a slot. |
45 | * If this field is NULL, the value passed in the struct hotplug_slot_info | 45 | * If this field is NULL, the value passed in the struct hotplug_slot_info |
46 | * will be used when this value is requested by a user. | 46 | * will be used when this value is requested by a user. |
@@ -191,4 +191,3 @@ static inline int pci_get_hp_params(struct pci_dev *dev, | |||
191 | 191 | ||
192 | void pci_configure_slot(struct pci_dev *dev); | 192 | void pci_configure_slot(struct pci_dev *dev); |
193 | #endif | 193 | #endif |
194 | |||
diff --git a/include/linux/pcieport_if.h b/include/linux/pcieport_if.h index 9572669eea97..4f1089f2cc98 100644 --- a/include/linux/pcieport_if.h +++ b/include/linux/pcieport_if.h | |||
@@ -23,7 +23,7 @@ | |||
23 | #define PCIE_PORT_SERVICE_VC (1 << PCIE_PORT_SERVICE_VC_SHIFT) | 23 | #define PCIE_PORT_SERVICE_VC (1 << PCIE_PORT_SERVICE_VC_SHIFT) |
24 | 24 | ||
25 | struct pcie_device { | 25 | struct pcie_device { |
26 | int irq; /* Service IRQ/MSI/MSI-X Vector */ | 26 | int irq; /* Service IRQ/MSI/MSI-X Vector */ |
27 | struct pci_dev *port; /* Root/Upstream/Downstream Port */ | 27 | struct pci_dev *port; /* Root/Upstream/Downstream Port */ |
28 | u32 service; /* Port service this device represents */ | 28 | u32 service; /* Port service this device represents */ |
29 | void *priv_data; /* Service Private Data */ | 29 | void *priv_data; /* Service Private Data */ |
diff --git a/include/linux/phy.h b/include/linux/phy.h index 64ab823f7b74..48a4dc3cb8cf 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h | |||
@@ -559,6 +559,7 @@ static inline int phy_read_status(struct phy_device *phydev) { | |||
559 | return phydev->drv->read_status(phydev); | 559 | return phydev->drv->read_status(phydev); |
560 | } | 560 | } |
561 | 561 | ||
562 | int genphy_setup_forced(struct phy_device *phydev); | ||
562 | int genphy_restart_aneg(struct phy_device *phydev); | 563 | int genphy_restart_aneg(struct phy_device *phydev); |
563 | int genphy_config_aneg(struct phy_device *phydev); | 564 | int genphy_config_aneg(struct phy_device *phydev); |
564 | int genphy_update_link(struct phy_device *phydev); | 565 | int genphy_update_link(struct phy_device *phydev); |
diff --git a/include/linux/platform_data/edma.h b/include/linux/platform_data/edma.h index 179fb91bb5f2..f50821cb64be 100644 --- a/include/linux/platform_data/edma.h +++ b/include/linux/platform_data/edma.h | |||
@@ -67,10 +67,10 @@ struct edmacc_param { | |||
67 | #define ITCCHEN BIT(23) | 67 | #define ITCCHEN BIT(23) |
68 | 68 | ||
69 | /*ch_status paramater of callback function possible values*/ | 69 | /*ch_status paramater of callback function possible values*/ |
70 | #define DMA_COMPLETE 1 | 70 | #define EDMA_DMA_COMPLETE 1 |
71 | #define DMA_CC_ERROR 2 | 71 | #define EDMA_DMA_CC_ERROR 2 |
72 | #define DMA_TC1_ERROR 3 | 72 | #define EDMA_DMA_TC1_ERROR 3 |
73 | #define DMA_TC2_ERROR 4 | 73 | #define EDMA_DMA_TC2_ERROR 4 |
74 | 74 | ||
75 | enum address_mode { | 75 | enum address_mode { |
76 | INCR = 0, | 76 | INCR = 0, |
diff --git a/include/linux/preempt_mask.h b/include/linux/preempt_mask.h index 931bc616219f..d169820203dd 100644 --- a/include/linux/preempt_mask.h +++ b/include/linux/preempt_mask.h | |||
@@ -11,36 +11,23 @@ | |||
11 | * - bits 0-7 are the preemption count (max preemption depth: 256) | 11 | * - bits 0-7 are the preemption count (max preemption depth: 256) |
12 | * - bits 8-15 are the softirq count (max # of softirqs: 256) | 12 | * - bits 8-15 are the softirq count (max # of softirqs: 256) |
13 | * | 13 | * |
14 | * The hardirq count can in theory reach the same as NR_IRQS. | 14 | * The hardirq count could in theory be the same as the number of |
15 | * In reality, the number of nested IRQS is limited to the stack | 15 | * interrupts in the system, but we run all interrupt handlers with |
16 | * size as well. For archs with over 1000 IRQS it is not practical | 16 | * interrupts disabled, so we cannot have nesting interrupts. Though |
17 | * to expect that they will all nest. We give a max of 10 bits for | 17 | * there are a few palaeontologic drivers which reenable interrupts in |
18 | * hardirq nesting. An arch may choose to give less than 10 bits. | 18 | * the handler, so we need more than one bit here. |
19 | * m68k expects it to be 8. | ||
20 | * | 19 | * |
21 | * - bits 16-25 are the hardirq count (max # of nested hardirqs: 1024) | 20 | * PREEMPT_MASK: 0x000000ff |
22 | * - bit 26 is the NMI_MASK | 21 | * SOFTIRQ_MASK: 0x0000ff00 |
23 | * - bit 27 is the PREEMPT_ACTIVE flag | 22 | * HARDIRQ_MASK: 0x000f0000 |
24 | * | 23 | * NMI_MASK: 0x00100000 |
25 | * PREEMPT_MASK: 0x000000ff | 24 | * PREEMPT_ACTIVE: 0x00200000 |
26 | * SOFTIRQ_MASK: 0x0000ff00 | ||
27 | * HARDIRQ_MASK: 0x03ff0000 | ||
28 | * NMI_MASK: 0x04000000 | ||
29 | */ | 25 | */ |
30 | #define PREEMPT_BITS 8 | 26 | #define PREEMPT_BITS 8 |
31 | #define SOFTIRQ_BITS 8 | 27 | #define SOFTIRQ_BITS 8 |
28 | #define HARDIRQ_BITS 4 | ||
32 | #define NMI_BITS 1 | 29 | #define NMI_BITS 1 |
33 | 30 | ||
34 | #define MAX_HARDIRQ_BITS 10 | ||
35 | |||
36 | #ifndef HARDIRQ_BITS | ||
37 | # define HARDIRQ_BITS MAX_HARDIRQ_BITS | ||
38 | #endif | ||
39 | |||
40 | #if HARDIRQ_BITS > MAX_HARDIRQ_BITS | ||
41 | #error HARDIRQ_BITS too high! | ||
42 | #endif | ||
43 | |||
44 | #define PREEMPT_SHIFT 0 | 31 | #define PREEMPT_SHIFT 0 |
45 | #define SOFTIRQ_SHIFT (PREEMPT_SHIFT + PREEMPT_BITS) | 32 | #define SOFTIRQ_SHIFT (PREEMPT_SHIFT + PREEMPT_BITS) |
46 | #define HARDIRQ_SHIFT (SOFTIRQ_SHIFT + SOFTIRQ_BITS) | 33 | #define HARDIRQ_SHIFT (SOFTIRQ_SHIFT + SOFTIRQ_BITS) |
@@ -60,15 +47,9 @@ | |||
60 | 47 | ||
61 | #define SOFTIRQ_DISABLE_OFFSET (2 * SOFTIRQ_OFFSET) | 48 | #define SOFTIRQ_DISABLE_OFFSET (2 * SOFTIRQ_OFFSET) |
62 | 49 | ||
63 | #ifndef PREEMPT_ACTIVE | ||
64 | #define PREEMPT_ACTIVE_BITS 1 | 50 | #define PREEMPT_ACTIVE_BITS 1 |
65 | #define PREEMPT_ACTIVE_SHIFT (NMI_SHIFT + NMI_BITS) | 51 | #define PREEMPT_ACTIVE_SHIFT (NMI_SHIFT + NMI_BITS) |
66 | #define PREEMPT_ACTIVE (__IRQ_MASK(PREEMPT_ACTIVE_BITS) << PREEMPT_ACTIVE_SHIFT) | 52 | #define PREEMPT_ACTIVE (__IRQ_MASK(PREEMPT_ACTIVE_BITS) << PREEMPT_ACTIVE_SHIFT) |
67 | #endif | ||
68 | |||
69 | #if PREEMPT_ACTIVE < (1 << (NMI_SHIFT + NMI_BITS)) | ||
70 | #error PREEMPT_ACTIVE is too low! | ||
71 | #endif | ||
72 | 53 | ||
73 | #define hardirq_count() (preempt_count() & HARDIRQ_MASK) | 54 | #define hardirq_count() (preempt_count() & HARDIRQ_MASK) |
74 | #define softirq_count() (preempt_count() & SOFTIRQ_MASK) | 55 | #define softirq_count() (preempt_count() & SOFTIRQ_MASK) |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 6f7ffa460089..768b037dfacb 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -22,7 +22,7 @@ struct sched_param { | |||
22 | #include <linux/errno.h> | 22 | #include <linux/errno.h> |
23 | #include <linux/nodemask.h> | 23 | #include <linux/nodemask.h> |
24 | #include <linux/mm_types.h> | 24 | #include <linux/mm_types.h> |
25 | #include <linux/preempt.h> | 25 | #include <linux/preempt_mask.h> |
26 | 26 | ||
27 | #include <asm/page.h> | 27 | #include <asm/page.h> |
28 | #include <asm/ptrace.h> | 28 | #include <asm/ptrace.h> |
@@ -831,8 +831,6 @@ struct sched_domain { | |||
831 | unsigned int balance_interval; /* initialise to 1. units in ms. */ | 831 | unsigned int balance_interval; /* initialise to 1. units in ms. */ |
832 | unsigned int nr_balance_failed; /* initialise to 0 */ | 832 | unsigned int nr_balance_failed; /* initialise to 0 */ |
833 | 833 | ||
834 | u64 last_update; | ||
835 | |||
836 | /* idle_balance() stats */ | 834 | /* idle_balance() stats */ |
837 | u64 max_newidle_lb_cost; | 835 | u64 max_newidle_lb_cost; |
838 | unsigned long next_decay_max_lb_cost; | 836 | unsigned long next_decay_max_lb_cost; |
diff --git a/include/linux/security.h b/include/linux/security.h index 9d37e2b9d3ec..5623a7f965b7 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -1052,17 +1052,25 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
1052 | * @xfrm_policy_delete_security: | 1052 | * @xfrm_policy_delete_security: |
1053 | * @ctx contains the xfrm_sec_ctx. | 1053 | * @ctx contains the xfrm_sec_ctx. |
1054 | * Authorize deletion of xp->security. | 1054 | * Authorize deletion of xp->security. |
1055 | * @xfrm_state_alloc_security: | 1055 | * @xfrm_state_alloc: |
1056 | * @x contains the xfrm_state being added to the Security Association | 1056 | * @x contains the xfrm_state being added to the Security Association |
1057 | * Database by the XFRM system. | 1057 | * Database by the XFRM system. |
1058 | * @sec_ctx contains the security context information being provided by | 1058 | * @sec_ctx contains the security context information being provided by |
1059 | * the user-level SA generation program (e.g., setkey or racoon). | 1059 | * the user-level SA generation program (e.g., setkey or racoon). |
1060 | * @secid contains the secid from which to take the mls portion of the context. | ||
1061 | * Allocate a security structure to the x->security field; the security | 1060 | * Allocate a security structure to the x->security field; the security |
1062 | * field is initialized to NULL when the xfrm_state is allocated. Set the | 1061 | * field is initialized to NULL when the xfrm_state is allocated. Set the |
1063 | * context to correspond to either sec_ctx or polsec, with the mls portion | 1062 | * context to correspond to sec_ctx. Return 0 if operation was successful |
1064 | * taken from secid in the latter case. | 1063 | * (memory to allocate, legal context). |
1065 | * Return 0 if operation was successful (memory to allocate, legal context). | 1064 | * @xfrm_state_alloc_acquire: |
1065 | * @x contains the xfrm_state being added to the Security Association | ||
1066 | * Database by the XFRM system. | ||
1067 | * @polsec contains the policy's security context. | ||
1068 | * @secid contains the secid from which to take the mls portion of the | ||
1069 | * context. | ||
1070 | * Allocate a security structure to the x->security field; the security | ||
1071 | * field is initialized to NULL when the xfrm_state is allocated. Set the | ||
1072 | * context to correspond to secid. Return 0 if operation was successful | ||
1073 | * (memory to allocate, legal context). | ||
1066 | * @xfrm_state_free_security: | 1074 | * @xfrm_state_free_security: |
1067 | * @x contains the xfrm_state. | 1075 | * @x contains the xfrm_state. |
1068 | * Deallocate x->security. | 1076 | * Deallocate x->security. |
@@ -1679,9 +1687,11 @@ struct security_operations { | |||
1679 | int (*xfrm_policy_clone_security) (struct xfrm_sec_ctx *old_ctx, struct xfrm_sec_ctx **new_ctx); | 1687 | int (*xfrm_policy_clone_security) (struct xfrm_sec_ctx *old_ctx, struct xfrm_sec_ctx **new_ctx); |
1680 | void (*xfrm_policy_free_security) (struct xfrm_sec_ctx *ctx); | 1688 | void (*xfrm_policy_free_security) (struct xfrm_sec_ctx *ctx); |
1681 | int (*xfrm_policy_delete_security) (struct xfrm_sec_ctx *ctx); | 1689 | int (*xfrm_policy_delete_security) (struct xfrm_sec_ctx *ctx); |
1682 | int (*xfrm_state_alloc_security) (struct xfrm_state *x, | 1690 | int (*xfrm_state_alloc) (struct xfrm_state *x, |
1683 | struct xfrm_user_sec_ctx *sec_ctx, | 1691 | struct xfrm_user_sec_ctx *sec_ctx); |
1684 | u32 secid); | 1692 | int (*xfrm_state_alloc_acquire) (struct xfrm_state *x, |
1693 | struct xfrm_sec_ctx *polsec, | ||
1694 | u32 secid); | ||
1685 | void (*xfrm_state_free_security) (struct xfrm_state *x); | 1695 | void (*xfrm_state_free_security) (struct xfrm_state *x); |
1686 | int (*xfrm_state_delete_security) (struct xfrm_state *x); | 1696 | int (*xfrm_state_delete_security) (struct xfrm_state *x); |
1687 | int (*xfrm_policy_lookup) (struct xfrm_sec_ctx *ctx, u32 fl_secid, u8 dir); | 1697 | int (*xfrm_policy_lookup) (struct xfrm_sec_ctx *ctx, u32 fl_secid, u8 dir); |
diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h index 1e8a8b6e837d..cf87a24c0f92 100644 --- a/include/linux/seqlock.h +++ b/include/linux/seqlock.h | |||
@@ -354,6 +354,35 @@ static inline void read_sequnlock_excl(seqlock_t *sl) | |||
354 | spin_unlock(&sl->lock); | 354 | spin_unlock(&sl->lock); |
355 | } | 355 | } |
356 | 356 | ||
357 | /** | ||
358 | * read_seqbegin_or_lock - begin a sequence number check or locking block | ||
359 | * @lock: sequence lock | ||
360 | * @seq : sequence number to be checked | ||
361 | * | ||
362 | * First try it once optimistically without taking the lock. If that fails, | ||
363 | * take the lock. The sequence number is also used as a marker for deciding | ||
364 | * whether to be a reader (even) or writer (odd). | ||
365 | * N.B. seq must be initialized to an even number to begin with. | ||
366 | */ | ||
367 | static inline void read_seqbegin_or_lock(seqlock_t *lock, int *seq) | ||
368 | { | ||
369 | if (!(*seq & 1)) /* Even */ | ||
370 | *seq = read_seqbegin(lock); | ||
371 | else /* Odd */ | ||
372 | read_seqlock_excl(lock); | ||
373 | } | ||
374 | |||
375 | static inline int need_seqretry(seqlock_t *lock, int seq) | ||
376 | { | ||
377 | return !(seq & 1) && read_seqretry(lock, seq); | ||
378 | } | ||
379 | |||
380 | static inline void done_seqretry(seqlock_t *lock, int seq) | ||
381 | { | ||
382 | if (seq & 1) | ||
383 | read_sequnlock_excl(lock); | ||
384 | } | ||
385 | |||
357 | static inline void read_seqlock_excl_bh(seqlock_t *sl) | 386 | static inline void read_seqlock_excl_bh(seqlock_t *sl) |
358 | { | 387 | { |
359 | spin_lock_bh(&sl->lock); | 388 | spin_lock_bh(&sl->lock); |
diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h index 30aa0dc60d75..9d55438bc4ad 100644 --- a/include/linux/shmem_fs.h +++ b/include/linux/shmem_fs.h | |||
@@ -47,6 +47,8 @@ extern int shmem_init(void); | |||
47 | extern int shmem_fill_super(struct super_block *sb, void *data, int silent); | 47 | extern int shmem_fill_super(struct super_block *sb, void *data, int silent); |
48 | extern struct file *shmem_file_setup(const char *name, | 48 | extern struct file *shmem_file_setup(const char *name, |
49 | loff_t size, unsigned long flags); | 49 | loff_t size, unsigned long flags); |
50 | extern struct file *shmem_kernel_file_setup(const char *name, loff_t size, | ||
51 | unsigned long flags); | ||
50 | extern int shmem_zero_setup(struct vm_area_struct *); | 52 | extern int shmem_zero_setup(struct vm_area_struct *); |
51 | extern int shmem_lock(struct file *file, int lock, struct user_struct *user); | 53 | extern int shmem_lock(struct file *file, int lock, struct user_struct *user); |
52 | extern void shmem_unlock_mapping(struct address_space *mapping); | 54 | extern void shmem_unlock_mapping(struct address_space *mapping); |
diff --git a/include/linux/slab.h b/include/linux/slab.h index 74f105847d13..1e2f4fe12773 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
@@ -53,7 +53,14 @@ | |||
53 | * } | 53 | * } |
54 | * rcu_read_unlock(); | 54 | * rcu_read_unlock(); |
55 | * | 55 | * |
56 | * See also the comment on struct slab_rcu in mm/slab.c. | 56 | * This is useful if we need to approach a kernel structure obliquely, |
57 | * from its address obtained without the usual locking. We can lock | ||
58 | * the structure to stabilize it and check it's still at the given address, | ||
59 | * only if we can be sure that the memory has not been meanwhile reused | ||
60 | * for some other kind of object (which our subsystem's lock might corrupt). | ||
61 | * | ||
62 | * rcu_read_lock before reading the address, then rcu_read_unlock after | ||
63 | * taking the spinlock within the structure expected at that address. | ||
57 | */ | 64 | */ |
58 | #define SLAB_DESTROY_BY_RCU 0x00080000UL /* Defer freeing slabs to RCU */ | 65 | #define SLAB_DESTROY_BY_RCU 0x00080000UL /* Defer freeing slabs to RCU */ |
59 | #define SLAB_MEM_SPREAD 0x00100000UL /* Spread some memory over cpuset */ | 66 | #define SLAB_MEM_SPREAD 0x00100000UL /* Spread some memory over cpuset */ |
@@ -381,10 +388,55 @@ static __always_inline void *kmalloc_large(size_t size, gfp_t flags) | |||
381 | /** | 388 | /** |
382 | * kmalloc - allocate memory | 389 | * kmalloc - allocate memory |
383 | * @size: how many bytes of memory are required. | 390 | * @size: how many bytes of memory are required. |
384 | * @flags: the type of memory to allocate (see kcalloc). | 391 | * @flags: the type of memory to allocate. |
385 | * | 392 | * |
386 | * kmalloc is the normal method of allocating memory | 393 | * kmalloc is the normal method of allocating memory |
387 | * for objects smaller than page size in the kernel. | 394 | * for objects smaller than page size in the kernel. |
395 | * | ||
396 | * The @flags argument may be one of: | ||
397 | * | ||
398 | * %GFP_USER - Allocate memory on behalf of user. May sleep. | ||
399 | * | ||
400 | * %GFP_KERNEL - Allocate normal kernel ram. May sleep. | ||
401 | * | ||
402 | * %GFP_ATOMIC - Allocation will not sleep. May use emergency pools. | ||
403 | * For example, use this inside interrupt handlers. | ||
404 | * | ||
405 | * %GFP_HIGHUSER - Allocate pages from high memory. | ||
406 | * | ||
407 | * %GFP_NOIO - Do not do any I/O at all while trying to get memory. | ||
408 | * | ||
409 | * %GFP_NOFS - Do not make any fs calls while trying to get memory. | ||
410 | * | ||
411 | * %GFP_NOWAIT - Allocation will not sleep. | ||
412 | * | ||
413 | * %GFP_THISNODE - Allocate node-local memory only. | ||
414 | * | ||
415 | * %GFP_DMA - Allocation suitable for DMA. | ||
416 | * Should only be used for kmalloc() caches. Otherwise, use a | ||
417 | * slab created with SLAB_DMA. | ||
418 | * | ||
419 | * Also it is possible to set different flags by OR'ing | ||
420 | * in one or more of the following additional @flags: | ||
421 | * | ||
422 | * %__GFP_COLD - Request cache-cold pages instead of | ||
423 | * trying to return cache-warm pages. | ||
424 | * | ||
425 | * %__GFP_HIGH - This allocation has high priority and may use emergency pools. | ||
426 | * | ||
427 | * %__GFP_NOFAIL - Indicate that this allocation is in no way allowed to fail | ||
428 | * (think twice before using). | ||
429 | * | ||
430 | * %__GFP_NORETRY - If memory is not immediately available, | ||
431 | * then give up at once. | ||
432 | * | ||
433 | * %__GFP_NOWARN - If allocation fails, don't issue any warnings. | ||
434 | * | ||
435 | * %__GFP_REPEAT - If allocation fails initially, try once more before failing. | ||
436 | * | ||
437 | * There are other flags available as well, but these are not intended | ||
438 | * for general use, and so are not documented here. For a full list of | ||
439 | * potential flags, always refer to linux/gfp.h. | ||
388 | */ | 440 | */ |
389 | static __always_inline void *kmalloc(size_t size, gfp_t flags) | 441 | static __always_inline void *kmalloc(size_t size, gfp_t flags) |
390 | { | 442 | { |
@@ -495,61 +547,6 @@ int cache_show(struct kmem_cache *s, struct seq_file *m); | |||
495 | void print_slabinfo_header(struct seq_file *m); | 547 | void print_slabinfo_header(struct seq_file *m); |
496 | 548 | ||
497 | /** | 549 | /** |
498 | * kmalloc - allocate memory | ||
499 | * @size: how many bytes of memory are required. | ||
500 | * @flags: the type of memory to allocate. | ||
501 | * | ||
502 | * The @flags argument may be one of: | ||
503 | * | ||
504 | * %GFP_USER - Allocate memory on behalf of user. May sleep. | ||
505 | * | ||
506 | * %GFP_KERNEL - Allocate normal kernel ram. May sleep. | ||
507 | * | ||
508 | * %GFP_ATOMIC - Allocation will not sleep. May use emergency pools. | ||
509 | * For example, use this inside interrupt handlers. | ||
510 | * | ||
511 | * %GFP_HIGHUSER - Allocate pages from high memory. | ||
512 | * | ||
513 | * %GFP_NOIO - Do not do any I/O at all while trying to get memory. | ||
514 | * | ||
515 | * %GFP_NOFS - Do not make any fs calls while trying to get memory. | ||
516 | * | ||
517 | * %GFP_NOWAIT - Allocation will not sleep. | ||
518 | * | ||
519 | * %GFP_THISNODE - Allocate node-local memory only. | ||
520 | * | ||
521 | * %GFP_DMA - Allocation suitable for DMA. | ||
522 | * Should only be used for kmalloc() caches. Otherwise, use a | ||
523 | * slab created with SLAB_DMA. | ||
524 | * | ||
525 | * Also it is possible to set different flags by OR'ing | ||
526 | * in one or more of the following additional @flags: | ||
527 | * | ||
528 | * %__GFP_COLD - Request cache-cold pages instead of | ||
529 | * trying to return cache-warm pages. | ||
530 | * | ||
531 | * %__GFP_HIGH - This allocation has high priority and may use emergency pools. | ||
532 | * | ||
533 | * %__GFP_NOFAIL - Indicate that this allocation is in no way allowed to fail | ||
534 | * (think twice before using). | ||
535 | * | ||
536 | * %__GFP_NORETRY - If memory is not immediately available, | ||
537 | * then give up at once. | ||
538 | * | ||
539 | * %__GFP_NOWARN - If allocation fails, don't issue any warnings. | ||
540 | * | ||
541 | * %__GFP_REPEAT - If allocation fails initially, try once more before failing. | ||
542 | * | ||
543 | * There are other flags available as well, but these are not intended | ||
544 | * for general use, and so are not documented here. For a full list of | ||
545 | * potential flags, always refer to linux/gfp.h. | ||
546 | * | ||
547 | * kmalloc is the normal method of allocating memory | ||
548 | * in the kernel. | ||
549 | */ | ||
550 | static __always_inline void *kmalloc(size_t size, gfp_t flags); | ||
551 | |||
552 | /** | ||
553 | * kmalloc_array - allocate memory for an array. | 550 | * kmalloc_array - allocate memory for an array. |
554 | * @n: number of elements. | 551 | * @n: number of elements. |
555 | * @size: element size. | 552 | * @size: element size. |
diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h index e9346b4f1ef4..09bfffb08a56 100644 --- a/include/linux/slab_def.h +++ b/include/linux/slab_def.h | |||
@@ -27,8 +27,8 @@ struct kmem_cache { | |||
27 | 27 | ||
28 | size_t colour; /* cache colouring range */ | 28 | size_t colour; /* cache colouring range */ |
29 | unsigned int colour_off; /* colour offset */ | 29 | unsigned int colour_off; /* colour offset */ |
30 | struct kmem_cache *slabp_cache; | 30 | struct kmem_cache *freelist_cache; |
31 | unsigned int slab_size; | 31 | unsigned int freelist_size; |
32 | 32 | ||
33 | /* constructor func */ | 33 | /* constructor func */ |
34 | void (*ctor)(void *obj); | 34 | void (*ctor)(void *obj); |
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h index cc0b67eada42..f56bfa9e4526 100644 --- a/include/linux/slub_def.h +++ b/include/linux/slub_def.h | |||
@@ -11,7 +11,7 @@ | |||
11 | enum stat_item { | 11 | enum stat_item { |
12 | ALLOC_FASTPATH, /* Allocation from cpu slab */ | 12 | ALLOC_FASTPATH, /* Allocation from cpu slab */ |
13 | ALLOC_SLOWPATH, /* Allocation by getting a new cpu slab */ | 13 | ALLOC_SLOWPATH, /* Allocation by getting a new cpu slab */ |
14 | FREE_FASTPATH, /* Free to cpu slub */ | 14 | FREE_FASTPATH, /* Free to cpu slab */ |
15 | FREE_SLOWPATH, /* Freeing not to cpu slab */ | 15 | FREE_SLOWPATH, /* Freeing not to cpu slab */ |
16 | FREE_FROZEN, /* Freeing to frozen slab */ | 16 | FREE_FROZEN, /* Freeing to frozen slab */ |
17 | FREE_ADD_PARTIAL, /* Freeing moves slab to partial list */ | 17 | FREE_ADD_PARTIAL, /* Freeing moves slab to partial list */ |
diff --git a/include/linux/tegra-powergate.h b/include/linux/tegra-powergate.h index c98cfa406952..fd4498329c7c 100644 --- a/include/linux/tegra-powergate.h +++ b/include/linux/tegra-powergate.h | |||
@@ -45,6 +45,7 @@ struct clk; | |||
45 | 45 | ||
46 | #define TEGRA_POWERGATE_3D0 TEGRA_POWERGATE_3D | 46 | #define TEGRA_POWERGATE_3D0 TEGRA_POWERGATE_3D |
47 | 47 | ||
48 | #ifdef CONFIG_ARCH_TEGRA | ||
48 | int tegra_powergate_is_powered(int id); | 49 | int tegra_powergate_is_powered(int id); |
49 | int tegra_powergate_power_on(int id); | 50 | int tegra_powergate_power_on(int id); |
50 | int tegra_powergate_power_off(int id); | 51 | int tegra_powergate_power_off(int id); |
@@ -52,5 +53,31 @@ int tegra_powergate_remove_clamping(int id); | |||
52 | 53 | ||
53 | /* Must be called with clk disabled, and returns with clk enabled */ | 54 | /* Must be called with clk disabled, and returns with clk enabled */ |
54 | int tegra_powergate_sequence_power_up(int id, struct clk *clk); | 55 | int tegra_powergate_sequence_power_up(int id, struct clk *clk); |
56 | #else | ||
57 | static inline int tegra_powergate_is_powered(int id) | ||
58 | { | ||
59 | return -ENOSYS; | ||
60 | } | ||
61 | |||
62 | static inline int tegra_powergate_power_on(int id) | ||
63 | { | ||
64 | return -ENOSYS; | ||
65 | } | ||
66 | |||
67 | static inline int tegra_powergate_power_off(int id) | ||
68 | { | ||
69 | return -ENOSYS; | ||
70 | } | ||
71 | |||
72 | static inline int tegra_powergate_remove_clamping(int id) | ||
73 | { | ||
74 | return -ENOSYS; | ||
75 | } | ||
76 | |||
77 | static inline int tegra_powergate_sequence_power_up(int id, struct clk *clk) | ||
78 | { | ||
79 | return -ENOSYS; | ||
80 | } | ||
81 | #endif | ||
55 | 82 | ||
56 | #endif /* _MACH_TEGRA_POWERGATE_H_ */ | 83 | #endif /* _MACH_TEGRA_POWERGATE_H_ */ |
diff --git a/include/linux/usb.h b/include/linux/usb.h index 7454865ad148..512ab162832c 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -1264,6 +1264,8 @@ typedef void (*usb_complete_t)(struct urb *); | |||
1264 | * @sg: scatter gather buffer list, the buffer size of each element in | 1264 | * @sg: scatter gather buffer list, the buffer size of each element in |
1265 | * the list (except the last) must be divisible by the endpoint's | 1265 | * the list (except the last) must be divisible by the endpoint's |
1266 | * max packet size if no_sg_constraint isn't set in 'struct usb_bus' | 1266 | * max packet size if no_sg_constraint isn't set in 'struct usb_bus' |
1267 | * (FIXME: scatter-gather under xHCI is broken for periodic transfers. | ||
1268 | * Do not use urb->sg for interrupt endpoints for now, only bulk.) | ||
1267 | * @num_mapped_sgs: (internal) number of mapped sg entries | 1269 | * @num_mapped_sgs: (internal) number of mapped sg entries |
1268 | * @num_sgs: number of entries in the sg list | 1270 | * @num_sgs: number of entries in the sg list |
1269 | * @transfer_buffer_length: How big is transfer_buffer. The transfer may | 1271 | * @transfer_buffer_length: How big is transfer_buffer. The transfer may |
diff --git a/include/linux/usb/wusb.h b/include/linux/usb/wusb.h index 0c4d4ca370ec..eeb28329fa3c 100644 --- a/include/linux/usb/wusb.h +++ b/include/linux/usb/wusb.h | |||
@@ -271,6 +271,8 @@ static inline u8 wusb_key_index(int index, int type, int originator) | |||
271 | #define WUSB_KEY_INDEX_TYPE_GTK 2 | 271 | #define WUSB_KEY_INDEX_TYPE_GTK 2 |
272 | #define WUSB_KEY_INDEX_ORIGINATOR_HOST 0 | 272 | #define WUSB_KEY_INDEX_ORIGINATOR_HOST 0 |
273 | #define WUSB_KEY_INDEX_ORIGINATOR_DEVICE 1 | 273 | #define WUSB_KEY_INDEX_ORIGINATOR_DEVICE 1 |
274 | /* bits 0-3 used for the key index. */ | ||
275 | #define WUSB_KEY_INDEX_MAX 15 | ||
274 | 276 | ||
275 | /* A CCM Nonce, defined in WUSB1.0[6.4.1] */ | 277 | /* A CCM Nonce, defined in WUSB1.0[6.4.1] */ |
276 | struct aes_ccm_nonce { | 278 | struct aes_ccm_nonce { |
diff --git a/include/linux/user_namespace.h b/include/linux/user_namespace.h index 4db29859464f..4836ba3c1cd8 100644 --- a/include/linux/user_namespace.h +++ b/include/linux/user_namespace.h | |||
@@ -27,6 +27,12 @@ struct user_namespace { | |||
27 | kuid_t owner; | 27 | kuid_t owner; |
28 | kgid_t group; | 28 | kgid_t group; |
29 | unsigned int proc_inum; | 29 | unsigned int proc_inum; |
30 | |||
31 | /* Register of per-UID persistent keyrings for this namespace */ | ||
32 | #ifdef CONFIG_PERSISTENT_KEYRINGS | ||
33 | struct key *persistent_keyring_register; | ||
34 | struct rw_semaphore persistent_keyring_register_sem; | ||
35 | #endif | ||
30 | }; | 36 | }; |
31 | 37 | ||
32 | extern struct user_namespace init_user_ns; | 38 | extern struct user_namespace init_user_ns; |
diff --git a/include/linux/wait.h b/include/linux/wait.h index 61939ba30aa0..eaa00b10abaa 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h | |||
@@ -278,6 +278,31 @@ do { \ | |||
278 | __ret; \ | 278 | __ret; \ |
279 | }) | 279 | }) |
280 | 280 | ||
281 | #define __wait_event_cmd(wq, condition, cmd1, cmd2) \ | ||
282 | (void)___wait_event(wq, condition, TASK_UNINTERRUPTIBLE, 0, 0, \ | ||
283 | cmd1; schedule(); cmd2) | ||
284 | |||
285 | /** | ||
286 | * wait_event_cmd - sleep until a condition gets true | ||
287 | * @wq: the waitqueue to wait on | ||
288 | * @condition: a C expression for the event to wait for | ||
289 | * cmd1: the command will be executed before sleep | ||
290 | * cmd2: the command will be executed after sleep | ||
291 | * | ||
292 | * The process is put to sleep (TASK_UNINTERRUPTIBLE) until the | ||
293 | * @condition evaluates to true. The @condition is checked each time | ||
294 | * the waitqueue @wq is woken up. | ||
295 | * | ||
296 | * wake_up() has to be called after changing any variable that could | ||
297 | * change the result of the wait condition. | ||
298 | */ | ||
299 | #define wait_event_cmd(wq, condition, cmd1, cmd2) \ | ||
300 | do { \ | ||
301 | if (condition) \ | ||
302 | break; \ | ||
303 | __wait_event_cmd(wq, condition, cmd1, cmd2); \ | ||
304 | } while (0) | ||
305 | |||
281 | #define __wait_event_interruptible(wq, condition) \ | 306 | #define __wait_event_interruptible(wq, condition) \ |
282 | ___wait_event(wq, condition, TASK_INTERRUPTIBLE, 0, 0, \ | 307 | ___wait_event(wq, condition, TASK_INTERRUPTIBLE, 0, 0, \ |
283 | schedule()) | 308 | schedule()) |
diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h index bd8218b15009..941055e9d125 100644 --- a/include/media/videobuf2-core.h +++ b/include/media/videobuf2-core.h | |||
@@ -83,7 +83,7 @@ struct vb2_fileio_data; | |||
83 | struct vb2_mem_ops { | 83 | struct vb2_mem_ops { |
84 | void *(*alloc)(void *alloc_ctx, unsigned long size, gfp_t gfp_flags); | 84 | void *(*alloc)(void *alloc_ctx, unsigned long size, gfp_t gfp_flags); |
85 | void (*put)(void *buf_priv); | 85 | void (*put)(void *buf_priv); |
86 | struct dma_buf *(*get_dmabuf)(void *buf_priv); | 86 | struct dma_buf *(*get_dmabuf)(void *buf_priv, unsigned long flags); |
87 | 87 | ||
88 | void *(*get_userptr)(void *alloc_ctx, unsigned long vaddr, | 88 | void *(*get_userptr)(void *alloc_ctx, unsigned long vaddr, |
89 | unsigned long size, int write); | 89 | unsigned long size, int write); |
diff --git a/include/net/genetlink.h b/include/net/genetlink.h index 9b787b62cf16..1b177ed803b7 100644 --- a/include/net/genetlink.h +++ b/include/net/genetlink.h | |||
@@ -10,16 +10,9 @@ | |||
10 | /** | 10 | /** |
11 | * struct genl_multicast_group - generic netlink multicast group | 11 | * struct genl_multicast_group - generic netlink multicast group |
12 | * @name: name of the multicast group, names are per-family | 12 | * @name: name of the multicast group, names are per-family |
13 | * @id: multicast group ID, assigned by the core, to use with | ||
14 | * genlmsg_multicast(). | ||
15 | * @list: list entry for linking | ||
16 | * @family: pointer to family, need not be set before registering | ||
17 | */ | 13 | */ |
18 | struct genl_multicast_group { | 14 | struct genl_multicast_group { |
19 | struct genl_family *family; /* private */ | ||
20 | struct list_head list; /* private */ | ||
21 | char name[GENL_NAMSIZ]; | 15 | char name[GENL_NAMSIZ]; |
22 | u32 id; | ||
23 | }; | 16 | }; |
24 | 17 | ||
25 | struct genl_ops; | 18 | struct genl_ops; |
@@ -39,9 +32,12 @@ struct genl_info; | |||
39 | * @post_doit: called after an operation's doit callback, it may | 32 | * @post_doit: called after an operation's doit callback, it may |
40 | * undo operations done by pre_doit, for example release locks | 33 | * undo operations done by pre_doit, for example release locks |
41 | * @attrbuf: buffer to store parsed attributes | 34 | * @attrbuf: buffer to store parsed attributes |
42 | * @ops_list: list of all assigned operations | ||
43 | * @family_list: family list | 35 | * @family_list: family list |
44 | * @mcast_groups: multicast groups list | 36 | * @mcgrps: multicast groups used by this family (private) |
37 | * @n_mcgrps: number of multicast groups (private) | ||
38 | * @mcgrp_offset: starting number of multicast group IDs in this family | ||
39 | * @ops: the operations supported by this family (private) | ||
40 | * @n_ops: number of operations supported by this family (private) | ||
45 | */ | 41 | */ |
46 | struct genl_family { | 42 | struct genl_family { |
47 | unsigned int id; | 43 | unsigned int id; |
@@ -51,16 +47,19 @@ struct genl_family { | |||
51 | unsigned int maxattr; | 47 | unsigned int maxattr; |
52 | bool netnsok; | 48 | bool netnsok; |
53 | bool parallel_ops; | 49 | bool parallel_ops; |
54 | int (*pre_doit)(struct genl_ops *ops, | 50 | int (*pre_doit)(const struct genl_ops *ops, |
55 | struct sk_buff *skb, | 51 | struct sk_buff *skb, |
56 | struct genl_info *info); | 52 | struct genl_info *info); |
57 | void (*post_doit)(struct genl_ops *ops, | 53 | void (*post_doit)(const struct genl_ops *ops, |
58 | struct sk_buff *skb, | 54 | struct sk_buff *skb, |
59 | struct genl_info *info); | 55 | struct genl_info *info); |
60 | struct nlattr ** attrbuf; /* private */ | 56 | struct nlattr ** attrbuf; /* private */ |
61 | struct list_head ops_list; /* private */ | 57 | const struct genl_ops * ops; /* private */ |
58 | const struct genl_multicast_group *mcgrps; /* private */ | ||
59 | unsigned int n_ops; /* private */ | ||
60 | unsigned int n_mcgrps; /* private */ | ||
61 | unsigned int mcgrp_offset; /* private */ | ||
62 | struct list_head family_list; /* private */ | 62 | struct list_head family_list; /* private */ |
63 | struct list_head mcast_groups; /* private */ | ||
64 | struct module *module; | 63 | struct module *module; |
65 | }; | 64 | }; |
66 | 65 | ||
@@ -110,16 +109,15 @@ static inline void genl_info_net_set(struct genl_info *info, struct net *net) | |||
110 | * @ops_list: operations list | 109 | * @ops_list: operations list |
111 | */ | 110 | */ |
112 | struct genl_ops { | 111 | struct genl_ops { |
113 | u8 cmd; | ||
114 | u8 internal_flags; | ||
115 | unsigned int flags; | ||
116 | const struct nla_policy *policy; | 112 | const struct nla_policy *policy; |
117 | int (*doit)(struct sk_buff *skb, | 113 | int (*doit)(struct sk_buff *skb, |
118 | struct genl_info *info); | 114 | struct genl_info *info); |
119 | int (*dumpit)(struct sk_buff *skb, | 115 | int (*dumpit)(struct sk_buff *skb, |
120 | struct netlink_callback *cb); | 116 | struct netlink_callback *cb); |
121 | int (*done)(struct netlink_callback *cb); | 117 | int (*done)(struct netlink_callback *cb); |
122 | struct list_head ops_list; | 118 | u8 cmd; |
119 | u8 internal_flags; | ||
120 | u8 flags; | ||
123 | }; | 121 | }; |
124 | 122 | ||
125 | int __genl_register_family(struct genl_family *family); | 123 | int __genl_register_family(struct genl_family *family); |
@@ -130,24 +128,53 @@ static inline int genl_register_family(struct genl_family *family) | |||
130 | return __genl_register_family(family); | 128 | return __genl_register_family(family); |
131 | } | 129 | } |
132 | 130 | ||
133 | int __genl_register_family_with_ops(struct genl_family *family, | 131 | /** |
134 | struct genl_ops *ops, size_t n_ops); | 132 | * genl_register_family_with_ops - register a generic netlink family with ops |
135 | 133 | * @family: generic netlink family | |
136 | static inline int genl_register_family_with_ops(struct genl_family *family, | 134 | * @ops: operations to be registered |
137 | struct genl_ops *ops, size_t n_ops) | 135 | * @n_ops: number of elements to register |
136 | * | ||
137 | * Registers the specified family and operations from the specified table. | ||
138 | * Only one family may be registered with the same family name or identifier. | ||
139 | * | ||
140 | * The family id may equal GENL_ID_GENERATE causing an unique id to | ||
141 | * be automatically generated and assigned. | ||
142 | * | ||
143 | * Either a doit or dumpit callback must be specified for every registered | ||
144 | * operation or the function will fail. Only one operation structure per | ||
145 | * command identifier may be registered. | ||
146 | * | ||
147 | * See include/net/genetlink.h for more documenation on the operations | ||
148 | * structure. | ||
149 | * | ||
150 | * Return 0 on success or a negative error code. | ||
151 | */ | ||
152 | static inline int | ||
153 | _genl_register_family_with_ops_grps(struct genl_family *family, | ||
154 | const struct genl_ops *ops, size_t n_ops, | ||
155 | const struct genl_multicast_group *mcgrps, | ||
156 | size_t n_mcgrps) | ||
138 | { | 157 | { |
139 | family->module = THIS_MODULE; | 158 | family->module = THIS_MODULE; |
140 | return __genl_register_family_with_ops(family, ops, n_ops); | 159 | family->ops = ops; |
160 | family->n_ops = n_ops; | ||
161 | family->mcgrps = mcgrps; | ||
162 | family->n_mcgrps = n_mcgrps; | ||
163 | return __genl_register_family(family); | ||
141 | } | 164 | } |
142 | 165 | ||
166 | #define genl_register_family_with_ops(family, ops) \ | ||
167 | _genl_register_family_with_ops_grps((family), \ | ||
168 | (ops), ARRAY_SIZE(ops), \ | ||
169 | NULL, 0) | ||
170 | #define genl_register_family_with_ops_groups(family, ops, grps) \ | ||
171 | _genl_register_family_with_ops_grps((family), \ | ||
172 | (ops), ARRAY_SIZE(ops), \ | ||
173 | (grps), ARRAY_SIZE(grps)) | ||
174 | |||
143 | int genl_unregister_family(struct genl_family *family); | 175 | int genl_unregister_family(struct genl_family *family); |
144 | int genl_register_ops(struct genl_family *, struct genl_ops *ops); | 176 | void genl_notify(struct genl_family *family, |
145 | int genl_unregister_ops(struct genl_family *, struct genl_ops *ops); | 177 | struct sk_buff *skb, struct net *net, u32 portid, |
146 | int genl_register_mc_group(struct genl_family *family, | ||
147 | struct genl_multicast_group *grp); | ||
148 | void genl_unregister_mc_group(struct genl_family *family, | ||
149 | struct genl_multicast_group *grp); | ||
150 | void genl_notify(struct sk_buff *skb, struct net *net, u32 portid, | ||
151 | u32 group, struct nlmsghdr *nlh, gfp_t flags); | 178 | u32 group, struct nlmsghdr *nlh, gfp_t flags); |
152 | 179 | ||
153 | void *genlmsg_put(struct sk_buff *skb, u32 portid, u32 seq, | 180 | void *genlmsg_put(struct sk_buff *skb, u32 portid, u32 seq, |
@@ -227,41 +254,51 @@ static inline void genlmsg_cancel(struct sk_buff *skb, void *hdr) | |||
227 | 254 | ||
228 | /** | 255 | /** |
229 | * genlmsg_multicast_netns - multicast a netlink message to a specific netns | 256 | * genlmsg_multicast_netns - multicast a netlink message to a specific netns |
257 | * @family: the generic netlink family | ||
230 | * @net: the net namespace | 258 | * @net: the net namespace |
231 | * @skb: netlink message as socket buffer | 259 | * @skb: netlink message as socket buffer |
232 | * @portid: own netlink portid to avoid sending to yourself | 260 | * @portid: own netlink portid to avoid sending to yourself |
233 | * @group: multicast group id | 261 | * @group: offset of multicast group in groups array |
234 | * @flags: allocation flags | 262 | * @flags: allocation flags |
235 | */ | 263 | */ |
236 | static inline int genlmsg_multicast_netns(struct net *net, struct sk_buff *skb, | 264 | static inline int genlmsg_multicast_netns(struct genl_family *family, |
265 | struct net *net, struct sk_buff *skb, | ||
237 | u32 portid, unsigned int group, gfp_t flags) | 266 | u32 portid, unsigned int group, gfp_t flags) |
238 | { | 267 | { |
268 | if (WARN_ON_ONCE(group >= family->n_mcgrps)) | ||
269 | return -EINVAL; | ||
270 | group = family->mcgrp_offset + group; | ||
239 | return nlmsg_multicast(net->genl_sock, skb, portid, group, flags); | 271 | return nlmsg_multicast(net->genl_sock, skb, portid, group, flags); |
240 | } | 272 | } |
241 | 273 | ||
242 | /** | 274 | /** |
243 | * genlmsg_multicast - multicast a netlink message to the default netns | 275 | * genlmsg_multicast - multicast a netlink message to the default netns |
276 | * @family: the generic netlink family | ||
244 | * @skb: netlink message as socket buffer | 277 | * @skb: netlink message as socket buffer |
245 | * @portid: own netlink portid to avoid sending to yourself | 278 | * @portid: own netlink portid to avoid sending to yourself |
246 | * @group: multicast group id | 279 | * @group: offset of multicast group in groups array |
247 | * @flags: allocation flags | 280 | * @flags: allocation flags |
248 | */ | 281 | */ |
249 | static inline int genlmsg_multicast(struct sk_buff *skb, u32 portid, | 282 | static inline int genlmsg_multicast(struct genl_family *family, |
283 | struct sk_buff *skb, u32 portid, | ||
250 | unsigned int group, gfp_t flags) | 284 | unsigned int group, gfp_t flags) |
251 | { | 285 | { |
252 | return genlmsg_multicast_netns(&init_net, skb, portid, group, flags); | 286 | return genlmsg_multicast_netns(family, &init_net, skb, |
287 | portid, group, flags); | ||
253 | } | 288 | } |
254 | 289 | ||
255 | /** | 290 | /** |
256 | * genlmsg_multicast_allns - multicast a netlink message to all net namespaces | 291 | * genlmsg_multicast_allns - multicast a netlink message to all net namespaces |
292 | * @family: the generic netlink family | ||
257 | * @skb: netlink message as socket buffer | 293 | * @skb: netlink message as socket buffer |
258 | * @portid: own netlink portid to avoid sending to yourself | 294 | * @portid: own netlink portid to avoid sending to yourself |
259 | * @group: multicast group id | 295 | * @group: offset of multicast group in groups array |
260 | * @flags: allocation flags | 296 | * @flags: allocation flags |
261 | * | 297 | * |
262 | * This function must hold the RTNL or rcu_read_lock(). | 298 | * This function must hold the RTNL or rcu_read_lock(). |
263 | */ | 299 | */ |
264 | int genlmsg_multicast_allns(struct sk_buff *skb, u32 portid, | 300 | int genlmsg_multicast_allns(struct genl_family *family, |
301 | struct sk_buff *skb, u32 portid, | ||
265 | unsigned int group, gfp_t flags); | 302 | unsigned int group, gfp_t flags); |
266 | 303 | ||
267 | /** | 304 | /** |
@@ -332,5 +369,25 @@ static inline struct sk_buff *genlmsg_new(size_t payload, gfp_t flags) | |||
332 | return nlmsg_new(genlmsg_total_size(payload), flags); | 369 | return nlmsg_new(genlmsg_total_size(payload), flags); |
333 | } | 370 | } |
334 | 371 | ||
372 | /** | ||
373 | * genl_set_err - report error to genetlink broadcast listeners | ||
374 | * @family: the generic netlink family | ||
375 | * @net: the network namespace to report the error to | ||
376 | * @portid: the PORTID of a process that we want to skip (if any) | ||
377 | * @group: the broadcast group that will notice the error | ||
378 | * (this is the offset of the multicast group in the groups array) | ||
379 | * @code: error code, must be negative (as usual in kernelspace) | ||
380 | * | ||
381 | * This function returns the number of broadcast listeners that have set the | ||
382 | * NETLINK_RECV_NO_ENOBUFS socket option. | ||
383 | */ | ||
384 | static inline int genl_set_err(struct genl_family *family, struct net *net, | ||
385 | u32 portid, u32 group, int code) | ||
386 | { | ||
387 | if (WARN_ON_ONCE(group >= family->n_mcgrps)) | ||
388 | return -EINVAL; | ||
389 | group = family->mcgrp_offset + group; | ||
390 | return netlink_set_err(net->genl_sock, portid, group, code); | ||
391 | } | ||
335 | 392 | ||
336 | #endif /* __NET_GENERIC_NETLINK_H */ | 393 | #endif /* __NET_GENERIC_NETLINK_H */ |
diff --git a/include/net/ip.h b/include/net/ip.h index 217bc5bfc6c6..5a25f36fe3a7 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
@@ -473,7 +473,7 @@ int compat_ip_getsockopt(struct sock *sk, int level, int optname, | |||
473 | int ip_ra_control(struct sock *sk, unsigned char on, | 473 | int ip_ra_control(struct sock *sk, unsigned char on, |
474 | void (*destructor)(struct sock *)); | 474 | void (*destructor)(struct sock *)); |
475 | 475 | ||
476 | int ip_recv_error(struct sock *sk, struct msghdr *msg, int len); | 476 | int ip_recv_error(struct sock *sk, struct msghdr *msg, int len, int *addr_len); |
477 | void ip_icmp_error(struct sock *sk, struct sk_buff *skb, int err, __be16 port, | 477 | void ip_icmp_error(struct sock *sk, struct sk_buff *skb, int err, __be16 port, |
478 | u32 info, u8 *payload); | 478 | u32 info, u8 *payload); |
479 | void ip_local_error(struct sock *sk, int err, __be32 daddr, __be16 dport, | 479 | void ip_local_error(struct sock *sk, int err, __be32 daddr, __be16 dport, |
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index 2a5f668cd683..488316e339a1 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h | |||
@@ -110,7 +110,8 @@ struct frag_hdr { | |||
110 | __be32 identification; | 110 | __be32 identification; |
111 | }; | 111 | }; |
112 | 112 | ||
113 | #define IP6_MF 0x0001 | 113 | #define IP6_MF 0x0001 |
114 | #define IP6_OFFSET 0xFFF8 | ||
114 | 115 | ||
115 | #include <net/sock.h> | 116 | #include <net/sock.h> |
116 | 117 | ||
@@ -776,8 +777,10 @@ int compat_ipv6_getsockopt(struct sock *sk, int level, int optname, | |||
776 | 777 | ||
777 | int ip6_datagram_connect(struct sock *sk, struct sockaddr *addr, int addr_len); | 778 | int ip6_datagram_connect(struct sock *sk, struct sockaddr *addr, int addr_len); |
778 | 779 | ||
779 | int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len); | 780 | int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len, |
780 | int ipv6_recv_rxpmtu(struct sock *sk, struct msghdr *msg, int len); | 781 | int *addr_len); |
782 | int ipv6_recv_rxpmtu(struct sock *sk, struct msghdr *msg, int len, | ||
783 | int *addr_len); | ||
781 | void ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err, __be16 port, | 784 | void ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err, __be16 port, |
782 | u32 info, u8 *payload); | 785 | u32 info, u8 *payload); |
783 | void ipv6_local_error(struct sock *sk, int err, struct flowi6 *fl6, u32 info); | 786 | void ipv6_local_error(struct sock *sk, int err, struct flowi6 *fl6, u32 info); |
diff --git a/include/net/ping.h b/include/net/ping.h index 3f67704f3747..90f48417b03d 100644 --- a/include/net/ping.h +++ b/include/net/ping.h | |||
@@ -31,7 +31,8 @@ | |||
31 | 31 | ||
32 | /* Compatibility glue so we can support IPv6 when it's compiled as a module */ | 32 | /* Compatibility glue so we can support IPv6 when it's compiled as a module */ |
33 | struct pingv6_ops { | 33 | struct pingv6_ops { |
34 | int (*ipv6_recv_error)(struct sock *sk, struct msghdr *msg, int len); | 34 | int (*ipv6_recv_error)(struct sock *sk, struct msghdr *msg, int len, |
35 | int *addr_len); | ||
35 | int (*ip6_datagram_recv_ctl)(struct sock *sk, struct msghdr *msg, | 36 | int (*ip6_datagram_recv_ctl)(struct sock *sk, struct msghdr *msg, |
36 | struct sk_buff *skb); | 37 | struct sk_buff *skb); |
37 | int (*icmpv6_err_convert)(u8 type, u8 code, int *err); | 38 | int (*icmpv6_err_convert)(u8 type, u8 code, int *err); |
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index 2174d8da0770..67b5d0068273 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
@@ -629,6 +629,7 @@ struct sctp_chunk { | |||
629 | #define SCTP_NEED_FRTX 0x1 | 629 | #define SCTP_NEED_FRTX 0x1 |
630 | #define SCTP_DONT_FRTX 0x2 | 630 | #define SCTP_DONT_FRTX 0x2 |
631 | __u16 rtt_in_progress:1, /* This chunk used for RTT calc? */ | 631 | __u16 rtt_in_progress:1, /* This chunk used for RTT calc? */ |
632 | resent:1, /* Has this chunk ever been resent. */ | ||
632 | has_tsn:1, /* Does this chunk have a TSN yet? */ | 633 | has_tsn:1, /* Does this chunk have a TSN yet? */ |
633 | has_ssn:1, /* Does this chunk have a SSN yet? */ | 634 | has_ssn:1, /* Does this chunk have a SSN yet? */ |
634 | singleton:1, /* Only chunk in the packet? */ | 635 | singleton:1, /* Only chunk in the packet? */ |
@@ -1725,12 +1726,6 @@ struct sctp_association { | |||
1725 | /* How many duplicated TSNs have we seen? */ | 1726 | /* How many duplicated TSNs have we seen? */ |
1726 | int numduptsns; | 1727 | int numduptsns; |
1727 | 1728 | ||
1728 | /* Number of seconds of idle time before an association is closed. | ||
1729 | * In the association context, this is really used as a boolean | ||
1730 | * since the real timeout is stored in the timeouts array | ||
1731 | */ | ||
1732 | __u32 autoclose; | ||
1733 | |||
1734 | /* These are to support | 1729 | /* These are to support |
1735 | * "SCTP Extensions for Dynamic Reconfiguration of IP Addresses | 1730 | * "SCTP Extensions for Dynamic Reconfiguration of IP Addresses |
1736 | * and Enforcement of Flow and Message Limits" | 1731 | * and Enforcement of Flow and Message Limits" |
diff --git a/include/net/sock.h b/include/net/sock.h index e3a18ff0c38b..2ef3c3eca47a 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -1035,7 +1035,6 @@ enum cg_proto_flags { | |||
1035 | }; | 1035 | }; |
1036 | 1036 | ||
1037 | struct cg_proto { | 1037 | struct cg_proto { |
1038 | void (*enter_memory_pressure)(struct sock *sk); | ||
1039 | struct res_counter memory_allocated; /* Current allocated memory. */ | 1038 | struct res_counter memory_allocated; /* Current allocated memory. */ |
1040 | struct percpu_counter sockets_allocated; /* Current number of sockets. */ | 1039 | struct percpu_counter sockets_allocated; /* Current number of sockets. */ |
1041 | int memory_pressure; | 1040 | int memory_pressure; |
@@ -1155,8 +1154,7 @@ static inline void sk_leave_memory_pressure(struct sock *sk) | |||
1155 | struct proto *prot = sk->sk_prot; | 1154 | struct proto *prot = sk->sk_prot; |
1156 | 1155 | ||
1157 | for (; cg_proto; cg_proto = parent_cg_proto(prot, cg_proto)) | 1156 | for (; cg_proto; cg_proto = parent_cg_proto(prot, cg_proto)) |
1158 | if (cg_proto->memory_pressure) | 1157 | cg_proto->memory_pressure = 0; |
1159 | cg_proto->memory_pressure = 0; | ||
1160 | } | 1158 | } |
1161 | 1159 | ||
1162 | } | 1160 | } |
@@ -1171,7 +1169,7 @@ static inline void sk_enter_memory_pressure(struct sock *sk) | |||
1171 | struct proto *prot = sk->sk_prot; | 1169 | struct proto *prot = sk->sk_prot; |
1172 | 1170 | ||
1173 | for (; cg_proto; cg_proto = parent_cg_proto(prot, cg_proto)) | 1171 | for (; cg_proto; cg_proto = parent_cg_proto(prot, cg_proto)) |
1174 | cg_proto->enter_memory_pressure(sk); | 1172 | cg_proto->memory_pressure = 1; |
1175 | } | 1173 | } |
1176 | 1174 | ||
1177 | sk->sk_prot->enter_memory_pressure(sk); | 1175 | sk->sk_prot->enter_memory_pressure(sk); |
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 546084964d55..fe3b58e836c8 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h | |||
@@ -475,6 +475,9 @@ struct scsi_host_template { | |||
475 | */ | 475 | */ |
476 | unsigned ordered_tag:1; | 476 | unsigned ordered_tag:1; |
477 | 477 | ||
478 | /* True if the controller does not support WRITE SAME */ | ||
479 | unsigned no_write_same:1; | ||
480 | |||
478 | /* | 481 | /* |
479 | * Countdown for host blocking with no commands outstanding. | 482 | * Countdown for host blocking with no commands outstanding. |
480 | */ | 483 | */ |
@@ -677,6 +680,9 @@ struct Scsi_Host { | |||
677 | /* Don't resume host in EH */ | 680 | /* Don't resume host in EH */ |
678 | unsigned eh_noresume:1; | 681 | unsigned eh_noresume:1; |
679 | 682 | ||
683 | /* The controller does not support WRITE SAME */ | ||
684 | unsigned no_write_same:1; | ||
685 | |||
680 | /* | 686 | /* |
681 | * Optional work queue to be utilized by the transport | 687 | * Optional work queue to be utilized by the transport |
682 | */ | 688 | */ |
diff --git a/include/sound/memalloc.h b/include/sound/memalloc.h index af9983970417..5f73785f5977 100644 --- a/include/sound/memalloc.h +++ b/include/sound/memalloc.h | |||
@@ -108,7 +108,7 @@ static inline dma_addr_t snd_sgbuf_get_addr(struct snd_dma_buffer *dmab, | |||
108 | { | 108 | { |
109 | struct snd_sg_buf *sgbuf = dmab->private_data; | 109 | struct snd_sg_buf *sgbuf = dmab->private_data; |
110 | dma_addr_t addr = sgbuf->table[offset >> PAGE_SHIFT].addr; | 110 | dma_addr_t addr = sgbuf->table[offset >> PAGE_SHIFT].addr; |
111 | addr &= PAGE_MASK; | 111 | addr &= ~((dma_addr_t)PAGE_SIZE - 1); |
112 | return addr + offset % PAGE_SIZE; | 112 | return addr + offset % PAGE_SIZE; |
113 | } | 113 | } |
114 | 114 | ||
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index 2037c45adfe6..56ebdfca6273 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h | |||
@@ -104,7 +104,8 @@ struct device; | |||
104 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ | 104 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
105 | .kcontrol_news = wcontrols, .num_kcontrols = 1} | 105 | .kcontrol_news = wcontrols, .num_kcontrols = 1} |
106 | #define SND_SOC_DAPM_MUX(wname, wreg, wshift, winvert, wcontrols) \ | 106 | #define SND_SOC_DAPM_MUX(wname, wreg, wshift, winvert, wcontrols) \ |
107 | { .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, \ | 107 | { .id = snd_soc_dapm_mux, .name = wname, \ |
108 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ | ||
108 | .kcontrol_news = wcontrols, .num_kcontrols = 1} | 109 | .kcontrol_news = wcontrols, .num_kcontrols = 1} |
109 | #define SND_SOC_DAPM_VIRT_MUX(wname, wreg, wshift, winvert, wcontrols) \ | 110 | #define SND_SOC_DAPM_VIRT_MUX(wname, wreg, wshift, winvert, wcontrols) \ |
110 | { .id = snd_soc_dapm_virt_mux, .name = wname, \ | 111 | { .id = snd_soc_dapm_virt_mux, .name = wname, \ |
diff --git a/include/target/target_core_backend.h b/include/target/target_core_backend.h index 5ebe21cd5d1c..39e0114d70c5 100644 --- a/include/target/target_core_backend.h +++ b/include/target/target_core_backend.h | |||
@@ -34,6 +34,11 @@ struct se_subsystem_api { | |||
34 | sense_reason_t (*parse_cdb)(struct se_cmd *cmd); | 34 | sense_reason_t (*parse_cdb)(struct se_cmd *cmd); |
35 | u32 (*get_device_type)(struct se_device *); | 35 | u32 (*get_device_type)(struct se_device *); |
36 | sector_t (*get_blocks)(struct se_device *); | 36 | sector_t (*get_blocks)(struct se_device *); |
37 | sector_t (*get_alignment_offset_lbas)(struct se_device *); | ||
38 | /* lbppbe = logical blocks per physical block exponent. see SBC-3 */ | ||
39 | unsigned int (*get_lbppbe)(struct se_device *); | ||
40 | unsigned int (*get_io_min)(struct se_device *); | ||
41 | unsigned int (*get_io_opt)(struct se_device *); | ||
37 | unsigned char *(*get_sense_buffer)(struct se_cmd *); | 42 | unsigned char *(*get_sense_buffer)(struct se_cmd *); |
38 | bool (*get_write_cache)(struct se_device *); | 43 | bool (*get_write_cache)(struct se_device *); |
39 | }; | 44 | }; |
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h index 5bdb8b7d2a69..45412a6afa69 100644 --- a/include/target/target_core_base.h +++ b/include/target/target_core_base.h | |||
@@ -227,6 +227,7 @@ enum tcm_tmreq_table { | |||
227 | 227 | ||
228 | /* fabric independent task management response values */ | 228 | /* fabric independent task management response values */ |
229 | enum tcm_tmrsp_table { | 229 | enum tcm_tmrsp_table { |
230 | TMR_FUNCTION_FAILED = 0, | ||
230 | TMR_FUNCTION_COMPLETE = 1, | 231 | TMR_FUNCTION_COMPLETE = 1, |
231 | TMR_TASK_DOES_NOT_EXIST = 2, | 232 | TMR_TASK_DOES_NOT_EXIST = 2, |
232 | TMR_LUN_DOES_NOT_EXIST = 3, | 233 | TMR_LUN_DOES_NOT_EXIST = 3, |
@@ -282,11 +283,12 @@ struct t10_alua_lu_gp_member { | |||
282 | struct t10_alua_tg_pt_gp { | 283 | struct t10_alua_tg_pt_gp { |
283 | u16 tg_pt_gp_id; | 284 | u16 tg_pt_gp_id; |
284 | int tg_pt_gp_valid_id; | 285 | int tg_pt_gp_valid_id; |
286 | int tg_pt_gp_alua_supported_states; | ||
285 | int tg_pt_gp_alua_access_status; | 287 | int tg_pt_gp_alua_access_status; |
286 | int tg_pt_gp_alua_access_type; | 288 | int tg_pt_gp_alua_access_type; |
287 | int tg_pt_gp_nonop_delay_msecs; | 289 | int tg_pt_gp_nonop_delay_msecs; |
288 | int tg_pt_gp_trans_delay_msecs; | 290 | int tg_pt_gp_trans_delay_msecs; |
289 | int tg_pt_gp_implict_trans_secs; | 291 | int tg_pt_gp_implicit_trans_secs; |
290 | int tg_pt_gp_pref; | 292 | int tg_pt_gp_pref; |
291 | int tg_pt_gp_write_metadata; | 293 | int tg_pt_gp_write_metadata; |
292 | /* Used by struct t10_alua_tg_pt_gp->tg_pt_gp_md_buf_len */ | 294 | /* Used by struct t10_alua_tg_pt_gp->tg_pt_gp_md_buf_len */ |
@@ -442,7 +444,6 @@ struct se_cmd { | |||
442 | /* Used for sense data */ | 444 | /* Used for sense data */ |
443 | void *sense_buffer; | 445 | void *sense_buffer; |
444 | struct list_head se_delayed_node; | 446 | struct list_head se_delayed_node; |
445 | struct list_head se_lun_node; | ||
446 | struct list_head se_qf_node; | 447 | struct list_head se_qf_node; |
447 | struct se_device *se_dev; | 448 | struct se_device *se_dev; |
448 | struct se_dev_entry *se_deve; | 449 | struct se_dev_entry *se_deve; |
@@ -470,15 +471,11 @@ struct se_cmd { | |||
470 | #define CMD_T_SENT (1 << 4) | 471 | #define CMD_T_SENT (1 << 4) |
471 | #define CMD_T_STOP (1 << 5) | 472 | #define CMD_T_STOP (1 << 5) |
472 | #define CMD_T_FAILED (1 << 6) | 473 | #define CMD_T_FAILED (1 << 6) |
473 | #define CMD_T_LUN_STOP (1 << 7) | 474 | #define CMD_T_DEV_ACTIVE (1 << 7) |
474 | #define CMD_T_LUN_FE_STOP (1 << 8) | 475 | #define CMD_T_REQUEST_STOP (1 << 8) |
475 | #define CMD_T_DEV_ACTIVE (1 << 9) | 476 | #define CMD_T_BUSY (1 << 9) |
476 | #define CMD_T_REQUEST_STOP (1 << 10) | ||
477 | #define CMD_T_BUSY (1 << 11) | ||
478 | spinlock_t t_state_lock; | 477 | spinlock_t t_state_lock; |
479 | struct completion t_transport_stop_comp; | 478 | struct completion t_transport_stop_comp; |
480 | struct completion transport_lun_fe_stop_comp; | ||
481 | struct completion transport_lun_stop_comp; | ||
482 | 479 | ||
483 | struct work_struct work; | 480 | struct work_struct work; |
484 | 481 | ||
@@ -498,6 +495,9 @@ struct se_cmd { | |||
498 | 495 | ||
499 | /* backend private data */ | 496 | /* backend private data */ |
500 | void *priv; | 497 | void *priv; |
498 | |||
499 | /* Used for lun->lun_ref counting */ | ||
500 | bool lun_ref_active; | ||
501 | }; | 501 | }; |
502 | 502 | ||
503 | struct se_ua { | 503 | struct se_ua { |
@@ -628,6 +628,34 @@ struct se_dev_attrib { | |||
628 | struct config_group da_group; | 628 | struct config_group da_group; |
629 | }; | 629 | }; |
630 | 630 | ||
631 | struct se_port_stat_grps { | ||
632 | struct config_group stat_group; | ||
633 | struct config_group scsi_port_group; | ||
634 | struct config_group scsi_tgt_port_group; | ||
635 | struct config_group scsi_transport_group; | ||
636 | }; | ||
637 | |||
638 | struct se_lun { | ||
639 | #define SE_LUN_LINK_MAGIC 0xffff7771 | ||
640 | u32 lun_link_magic; | ||
641 | /* See transport_lun_status_table */ | ||
642 | enum transport_lun_status_table lun_status; | ||
643 | u32 lun_access; | ||
644 | u32 lun_flags; | ||
645 | u32 unpacked_lun; | ||
646 | atomic_t lun_acl_count; | ||
647 | spinlock_t lun_acl_lock; | ||
648 | spinlock_t lun_sep_lock; | ||
649 | struct completion lun_shutdown_comp; | ||
650 | struct list_head lun_acl_list; | ||
651 | struct se_device *lun_se_dev; | ||
652 | struct se_port *lun_sep; | ||
653 | struct config_group lun_group; | ||
654 | struct se_port_stat_grps port_stat_grps; | ||
655 | struct completion lun_ref_comp; | ||
656 | struct percpu_ref lun_ref; | ||
657 | }; | ||
658 | |||
631 | struct se_dev_stat_grps { | 659 | struct se_dev_stat_grps { |
632 | struct config_group stat_group; | 660 | struct config_group stat_group; |
633 | struct config_group scsi_dev_group; | 661 | struct config_group scsi_dev_group; |
@@ -656,11 +684,10 @@ struct se_device { | |||
656 | /* Pointer to transport specific device structure */ | 684 | /* Pointer to transport specific device structure */ |
657 | u32 dev_index; | 685 | u32 dev_index; |
658 | u64 creation_time; | 686 | u64 creation_time; |
659 | u32 num_resets; | 687 | atomic_long_t num_resets; |
660 | u64 num_cmds; | 688 | atomic_long_t num_cmds; |
661 | u64 read_bytes; | 689 | atomic_long_t read_bytes; |
662 | u64 write_bytes; | 690 | atomic_long_t write_bytes; |
663 | spinlock_t stats_lock; | ||
664 | /* Active commands on this virtual SE device */ | 691 | /* Active commands on this virtual SE device */ |
665 | atomic_t simple_cmds; | 692 | atomic_t simple_cmds; |
666 | atomic_t dev_ordered_id; | 693 | atomic_t dev_ordered_id; |
@@ -711,6 +738,7 @@ struct se_device { | |||
711 | struct se_subsystem_api *transport; | 738 | struct se_subsystem_api *transport; |
712 | /* Linked list for struct se_hba struct se_device list */ | 739 | /* Linked list for struct se_hba struct se_device list */ |
713 | struct list_head dev_list; | 740 | struct list_head dev_list; |
741 | struct se_lun xcopy_lun; | ||
714 | }; | 742 | }; |
715 | 743 | ||
716 | struct se_hba { | 744 | struct se_hba { |
@@ -730,34 +758,6 @@ struct se_hba { | |||
730 | struct se_subsystem_api *transport; | 758 | struct se_subsystem_api *transport; |
731 | }; | 759 | }; |
732 | 760 | ||
733 | struct se_port_stat_grps { | ||
734 | struct config_group stat_group; | ||
735 | struct config_group scsi_port_group; | ||
736 | struct config_group scsi_tgt_port_group; | ||
737 | struct config_group scsi_transport_group; | ||
738 | }; | ||
739 | |||
740 | struct se_lun { | ||
741 | #define SE_LUN_LINK_MAGIC 0xffff7771 | ||
742 | u32 lun_link_magic; | ||
743 | /* See transport_lun_status_table */ | ||
744 | enum transport_lun_status_table lun_status; | ||
745 | u32 lun_access; | ||
746 | u32 lun_flags; | ||
747 | u32 unpacked_lun; | ||
748 | atomic_t lun_acl_count; | ||
749 | spinlock_t lun_acl_lock; | ||
750 | spinlock_t lun_cmd_lock; | ||
751 | spinlock_t lun_sep_lock; | ||
752 | struct completion lun_shutdown_comp; | ||
753 | struct list_head lun_cmd_list; | ||
754 | struct list_head lun_acl_list; | ||
755 | struct se_device *lun_se_dev; | ||
756 | struct se_port *lun_sep; | ||
757 | struct config_group lun_group; | ||
758 | struct se_port_stat_grps port_stat_grps; | ||
759 | }; | ||
760 | |||
761 | struct scsi_port_stats { | 761 | struct scsi_port_stats { |
762 | u64 cmd_pdus; | 762 | u64 cmd_pdus; |
763 | u64 tx_data_octets; | 763 | u64 tx_data_octets; |
diff --git a/include/target/target_core_configfs.h b/include/target/target_core_configfs.h index 713c5004f4ae..e0801386e4dc 100644 --- a/include/target/target_core_configfs.h +++ b/include/target/target_core_configfs.h | |||
@@ -54,4 +54,3 @@ struct target_fabric_configfs { | |||
54 | struct target_fabric_configfs_template tf_cit_tmpl; | 54 | struct target_fabric_configfs_template tf_cit_tmpl; |
55 | }; | 55 | }; |
56 | 56 | ||
57 | #define TF_CIT_TMPL(tf) (&(tf)->tf_cit_tmpl) | ||
diff --git a/include/target/target_core_fabric.h b/include/target/target_core_fabric.h index 882b650e32be..4cf4fda404a3 100644 --- a/include/target/target_core_fabric.h +++ b/include/target/target_core_fabric.h | |||
@@ -137,6 +137,8 @@ void transport_generic_request_failure(struct se_cmd *, sense_reason_t); | |||
137 | void __target_execute_cmd(struct se_cmd *); | 137 | void __target_execute_cmd(struct se_cmd *); |
138 | int transport_lookup_tmr_lun(struct se_cmd *, u32); | 138 | int transport_lookup_tmr_lun(struct se_cmd *, u32); |
139 | 139 | ||
140 | struct se_node_acl *core_tpg_get_initiator_node_acl(struct se_portal_group *tpg, | ||
141 | unsigned char *); | ||
140 | struct se_node_acl *core_tpg_check_initiator_node_acl(struct se_portal_group *, | 142 | struct se_node_acl *core_tpg_check_initiator_node_acl(struct se_portal_group *, |
141 | unsigned char *); | 143 | unsigned char *); |
142 | void core_tpg_clear_object_luns(struct se_portal_group *); | 144 | void core_tpg_clear_object_luns(struct se_portal_group *); |
diff --git a/include/trace/events/btrfs.h b/include/trace/events/btrfs.h index f18b3b76e01e..4832d75dcbae 100644 --- a/include/trace/events/btrfs.h +++ b/include/trace/events/btrfs.h | |||
@@ -162,12 +162,14 @@ DEFINE_EVENT(btrfs__inode, btrfs_inode_evict, | |||
162 | { EXTENT_FLAG_LOGGING, "LOGGING" }, \ | 162 | { EXTENT_FLAG_LOGGING, "LOGGING" }, \ |
163 | { EXTENT_FLAG_FILLING, "FILLING" }) | 163 | { EXTENT_FLAG_FILLING, "FILLING" }) |
164 | 164 | ||
165 | TRACE_EVENT(btrfs_get_extent, | 165 | TRACE_EVENT_CONDITION(btrfs_get_extent, |
166 | 166 | ||
167 | TP_PROTO(struct btrfs_root *root, struct extent_map *map), | 167 | TP_PROTO(struct btrfs_root *root, struct extent_map *map), |
168 | 168 | ||
169 | TP_ARGS(root, map), | 169 | TP_ARGS(root, map), |
170 | 170 | ||
171 | TP_CONDITION(map), | ||
172 | |||
171 | TP_STRUCT__entry( | 173 | TP_STRUCT__entry( |
172 | __field( u64, root_objectid ) | 174 | __field( u64, root_objectid ) |
173 | __field( u64, start ) | 175 | __field( u64, start ) |
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index 6b852f60f8ae..5c38606613d8 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h | |||
@@ -379,7 +379,8 @@ ftrace_define_fields_##call(struct ftrace_event_call *event_call) \ | |||
379 | __data_size += (len) * sizeof(type); | 379 | __data_size += (len) * sizeof(type); |
380 | 380 | ||
381 | #undef __string | 381 | #undef __string |
382 | #define __string(item, src) __dynamic_array(char, item, strlen(src) + 1) | 382 | #define __string(item, src) __dynamic_array(char, item, \ |
383 | strlen((src) ? (const char *)(src) : "(null)") + 1) | ||
383 | 384 | ||
384 | #undef DECLARE_EVENT_CLASS | 385 | #undef DECLARE_EVENT_CLASS |
385 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ | 386 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ |
@@ -508,7 +509,7 @@ static inline notrace int ftrace_get_offsets_##call( \ | |||
508 | 509 | ||
509 | #undef __assign_str | 510 | #undef __assign_str |
510 | #define __assign_str(dst, src) \ | 511 | #define __assign_str(dst, src) \ |
511 | strcpy(__get_str(dst), src); | 512 | strcpy(__get_str(dst), (src) ? (const char *)(src) : "(null)"); |
512 | 513 | ||
513 | #undef TP_fast_assign | 514 | #undef TP_fast_assign |
514 | #define TP_fast_assign(args...) args | 515 | #define TP_fast_assign(args...) args |
diff --git a/include/uapi/drm/radeon_drm.h b/include/uapi/drm/radeon_drm.h index 46d41e8b0dcc..2f3f7ea8c77b 100644 --- a/include/uapi/drm/radeon_drm.h +++ b/include/uapi/drm/radeon_drm.h | |||
@@ -981,6 +981,8 @@ struct drm_radeon_cs { | |||
981 | #define RADEON_INFO_SI_TILE_MODE_ARRAY 0x16 | 981 | #define RADEON_INFO_SI_TILE_MODE_ARRAY 0x16 |
982 | /* query if CP DMA is supported on the compute ring */ | 982 | /* query if CP DMA is supported on the compute ring */ |
983 | #define RADEON_INFO_SI_CP_DMA_COMPUTE 0x17 | 983 | #define RADEON_INFO_SI_CP_DMA_COMPUTE 0x17 |
984 | /* CIK macrotile mode array */ | ||
985 | #define RADEON_INFO_CIK_MACROTILE_MODE_ARRAY 0x18 | ||
984 | 986 | ||
985 | 987 | ||
986 | struct drm_radeon_info { | 988 | struct drm_radeon_info { |
diff --git a/include/uapi/linux/audit.h b/include/uapi/linux/audit.h index db0b825b4810..44b05a09f193 100644 --- a/include/uapi/linux/audit.h +++ b/include/uapi/linux/audit.h | |||
@@ -68,6 +68,9 @@ | |||
68 | #define AUDIT_MAKE_EQUIV 1015 /* Append to watched tree */ | 68 | #define AUDIT_MAKE_EQUIV 1015 /* Append to watched tree */ |
69 | #define AUDIT_TTY_GET 1016 /* Get TTY auditing status */ | 69 | #define AUDIT_TTY_GET 1016 /* Get TTY auditing status */ |
70 | #define AUDIT_TTY_SET 1017 /* Set TTY auditing status */ | 70 | #define AUDIT_TTY_SET 1017 /* Set TTY auditing status */ |
71 | #define AUDIT_SET_FEATURE 1018 /* Turn an audit feature on or off */ | ||
72 | #define AUDIT_GET_FEATURE 1019 /* Get which features are enabled */ | ||
73 | #define AUDIT_FEATURE_CHANGE 1020 /* audit log listing feature changes */ | ||
71 | 74 | ||
72 | #define AUDIT_FIRST_USER_MSG 1100 /* Userspace messages mostly uninteresting to kernel */ | 75 | #define AUDIT_FIRST_USER_MSG 1100 /* Userspace messages mostly uninteresting to kernel */ |
73 | #define AUDIT_USER_AVC 1107 /* We filter this differently */ | 76 | #define AUDIT_USER_AVC 1107 /* We filter this differently */ |
@@ -357,6 +360,12 @@ enum { | |||
357 | #define AUDIT_PERM_READ 4 | 360 | #define AUDIT_PERM_READ 4 |
358 | #define AUDIT_PERM_ATTR 8 | 361 | #define AUDIT_PERM_ATTR 8 |
359 | 362 | ||
363 | /* MAX_AUDIT_MESSAGE_LENGTH is set in audit:lib/libaudit.h as: | ||
364 | * 8970 // PATH_MAX*2+CONTEXT_SIZE*2+11+256+1 | ||
365 | * max header+body+tailer: 44 + 29 + 32 + 262 + 7 + pad | ||
366 | */ | ||
367 | #define AUDIT_MESSAGE_TEXT_MAX 8560 | ||
368 | |||
360 | struct audit_status { | 369 | struct audit_status { |
361 | __u32 mask; /* Bit mask for valid entries */ | 370 | __u32 mask; /* Bit mask for valid entries */ |
362 | __u32 enabled; /* 1 = enabled, 0 = disabled */ | 371 | __u32 enabled; /* 1 = enabled, 0 = disabled */ |
@@ -368,11 +377,28 @@ struct audit_status { | |||
368 | __u32 backlog; /* messages waiting in queue */ | 377 | __u32 backlog; /* messages waiting in queue */ |
369 | }; | 378 | }; |
370 | 379 | ||
380 | struct audit_features { | ||
381 | #define AUDIT_FEATURE_VERSION 1 | ||
382 | __u32 vers; | ||
383 | __u32 mask; /* which bits we are dealing with */ | ||
384 | __u32 features; /* which feature to enable/disable */ | ||
385 | __u32 lock; /* which features to lock */ | ||
386 | }; | ||
387 | |||
388 | #define AUDIT_FEATURE_ONLY_UNSET_LOGINUID 0 | ||
389 | #define AUDIT_FEATURE_LOGINUID_IMMUTABLE 1 | ||
390 | #define AUDIT_LAST_FEATURE AUDIT_FEATURE_LOGINUID_IMMUTABLE | ||
391 | |||
392 | #define audit_feature_valid(x) ((x) >= 0 && (x) <= AUDIT_LAST_FEATURE) | ||
393 | #define AUDIT_FEATURE_TO_MASK(x) (1 << ((x) & 31)) /* mask for __u32 */ | ||
394 | |||
371 | struct audit_tty_status { | 395 | struct audit_tty_status { |
372 | __u32 enabled; /* 1 = enabled, 0 = disabled */ | 396 | __u32 enabled; /* 1 = enabled, 0 = disabled */ |
373 | __u32 log_passwd; /* 1 = enabled, 0 = disabled */ | 397 | __u32 log_passwd; /* 1 = enabled, 0 = disabled */ |
374 | }; | 398 | }; |
375 | 399 | ||
400 | #define AUDIT_UID_UNSET (unsigned int)-1 | ||
401 | |||
376 | /* audit_rule_data supports filter rules with both integer and string | 402 | /* audit_rule_data supports filter rules with both integer and string |
377 | * fields. It corresponds with AUDIT_ADD_RULE, AUDIT_DEL_RULE and | 403 | * fields. It corresponds with AUDIT_ADD_RULE, AUDIT_DEL_RULE and |
378 | * AUDIT_LIST_RULES requests. | 404 | * AUDIT_LIST_RULES requests. |
diff --git a/include/uapi/linux/eventpoll.h b/include/uapi/linux/eventpoll.h index 2c267bcbb85c..bc81fb2e1f0e 100644 --- a/include/uapi/linux/eventpoll.h +++ b/include/uapi/linux/eventpoll.h | |||
@@ -61,5 +61,16 @@ struct epoll_event { | |||
61 | __u64 data; | 61 | __u64 data; |
62 | } EPOLL_PACKED; | 62 | } EPOLL_PACKED; |
63 | 63 | ||
64 | 64 | #ifdef CONFIG_PM_SLEEP | |
65 | static inline void ep_take_care_of_epollwakeup(struct epoll_event *epev) | ||
66 | { | ||
67 | if ((epev->events & EPOLLWAKEUP) && !capable(CAP_BLOCK_SUSPEND)) | ||
68 | epev->events &= ~EPOLLWAKEUP; | ||
69 | } | ||
70 | #else | ||
71 | static inline void ep_take_care_of_epollwakeup(struct epoll_event *epev) | ||
72 | { | ||
73 | epev->events &= ~EPOLLWAKEUP; | ||
74 | } | ||
75 | #endif | ||
65 | #endif /* _UAPI_LINUX_EVENTPOLL_H */ | 76 | #endif /* _UAPI_LINUX_EVENTPOLL_H */ |
diff --git a/include/uapi/linux/genetlink.h b/include/uapi/linux/genetlink.h index c880a417d8a9..c3363ba1ae05 100644 --- a/include/uapi/linux/genetlink.h +++ b/include/uapi/linux/genetlink.h | |||
@@ -27,6 +27,8 @@ struct genlmsghdr { | |||
27 | */ | 27 | */ |
28 | #define GENL_ID_GENERATE 0 | 28 | #define GENL_ID_GENERATE 0 |
29 | #define GENL_ID_CTRL NLMSG_MIN_TYPE | 29 | #define GENL_ID_CTRL NLMSG_MIN_TYPE |
30 | #define GENL_ID_VFS_DQUOT (NLMSG_MIN_TYPE + 1) | ||
31 | #define GENL_ID_PMCRAID (NLMSG_MIN_TYPE + 2) | ||
30 | 32 | ||
31 | /************************************************************************** | 33 | /************************************************************************** |
32 | * Controller | 34 | * Controller |
diff --git a/include/uapi/linux/hash_info.h b/include/uapi/linux/hash_info.h new file mode 100644 index 000000000000..ca18c45f8304 --- /dev/null +++ b/include/uapi/linux/hash_info.h | |||
@@ -0,0 +1,37 @@ | |||
1 | /* | ||
2 | * Hash Info: Hash algorithms information | ||
3 | * | ||
4 | * Copyright (c) 2013 Dmitry Kasatkin <d.kasatkin@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 Free | ||
8 | * Software Foundation; either version 2 of the License, or (at your option) | ||
9 | * any later version. | ||
10 | * | ||
11 | */ | ||
12 | |||
13 | #ifndef _UAPI_LINUX_HASH_INFO_H | ||
14 | #define _UAPI_LINUX_HASH_INFO_H | ||
15 | |||
16 | enum hash_algo { | ||
17 | HASH_ALGO_MD4, | ||
18 | HASH_ALGO_MD5, | ||
19 | HASH_ALGO_SHA1, | ||
20 | HASH_ALGO_RIPE_MD_160, | ||
21 | HASH_ALGO_SHA256, | ||
22 | HASH_ALGO_SHA384, | ||
23 | HASH_ALGO_SHA512, | ||
24 | HASH_ALGO_SHA224, | ||
25 | HASH_ALGO_RIPE_MD_128, | ||
26 | HASH_ALGO_RIPE_MD_256, | ||
27 | HASH_ALGO_RIPE_MD_320, | ||
28 | HASH_ALGO_WP_256, | ||
29 | HASH_ALGO_WP_384, | ||
30 | HASH_ALGO_WP_512, | ||
31 | HASH_ALGO_TGR_128, | ||
32 | HASH_ALGO_TGR_160, | ||
33 | HASH_ALGO_TGR_192, | ||
34 | HASH_ALGO__LAST | ||
35 | }; | ||
36 | |||
37 | #endif /* _UAPI_LINUX_HASH_INFO_H */ | ||
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h index b78566f59aba..6db460121f84 100644 --- a/include/uapi/linux/if_link.h +++ b/include/uapi/linux/if_link.h | |||
@@ -488,7 +488,9 @@ enum { | |||
488 | IFLA_HSR_UNSPEC, | 488 | IFLA_HSR_UNSPEC, |
489 | IFLA_HSR_SLAVE1, | 489 | IFLA_HSR_SLAVE1, |
490 | IFLA_HSR_SLAVE2, | 490 | IFLA_HSR_SLAVE2, |
491 | IFLA_HSR_MULTICAST_SPEC, | 491 | IFLA_HSR_MULTICAST_SPEC, /* Last byte of supervision addr */ |
492 | IFLA_HSR_SUPERVISION_ADDR, /* Supervision frame multicast addr */ | ||
493 | IFLA_HSR_SEQ_NR, | ||
492 | __IFLA_HSR_MAX, | 494 | __IFLA_HSR_MAX, |
493 | }; | 495 | }; |
494 | 496 | ||
diff --git a/include/uapi/linux/input.h b/include/uapi/linux/input.h index a3726275876d..ecc88592ecbe 100644 --- a/include/uapi/linux/input.h +++ b/include/uapi/linux/input.h | |||
@@ -719,6 +719,8 @@ struct input_keymap_entry { | |||
719 | #define BTN_DPAD_LEFT 0x222 | 719 | #define BTN_DPAD_LEFT 0x222 |
720 | #define BTN_DPAD_RIGHT 0x223 | 720 | #define BTN_DPAD_RIGHT 0x223 |
721 | 721 | ||
722 | #define KEY_ALS_TOGGLE 0x230 /* Ambient light sensor */ | ||
723 | |||
722 | #define BTN_TRIGGER_HAPPY 0x2c0 | 724 | #define BTN_TRIGGER_HAPPY 0x2c0 |
723 | #define BTN_TRIGGER_HAPPY1 0x2c0 | 725 | #define BTN_TRIGGER_HAPPY1 0x2c0 |
724 | #define BTN_TRIGGER_HAPPY2 0x2c1 | 726 | #define BTN_TRIGGER_HAPPY2 0x2c1 |
@@ -856,6 +858,7 @@ struct input_keymap_entry { | |||
856 | #define SW_FRONT_PROXIMITY 0x0b /* set = front proximity sensor active */ | 858 | #define SW_FRONT_PROXIMITY 0x0b /* set = front proximity sensor active */ |
857 | #define SW_ROTATE_LOCK 0x0c /* set = rotate locked/disabled */ | 859 | #define SW_ROTATE_LOCK 0x0c /* set = rotate locked/disabled */ |
858 | #define SW_LINEIN_INSERT 0x0d /* set = inserted */ | 860 | #define SW_LINEIN_INSERT 0x0d /* set = inserted */ |
861 | #define SW_MUTE_DEVICE 0x0e /* set = device disabled */ | ||
859 | #define SW_MAX 0x0f | 862 | #define SW_MAX 0x0f |
860 | #define SW_CNT (SW_MAX+1) | 863 | #define SW_CNT (SW_MAX+1) |
861 | 864 | ||
diff --git a/include/uapi/linux/keyctl.h b/include/uapi/linux/keyctl.h index c9b7f4faf97a..840cb990abe2 100644 --- a/include/uapi/linux/keyctl.h +++ b/include/uapi/linux/keyctl.h | |||
@@ -56,5 +56,6 @@ | |||
56 | #define KEYCTL_REJECT 19 /* reject a partially constructed key */ | 56 | #define KEYCTL_REJECT 19 /* reject a partially constructed key */ |
57 | #define KEYCTL_INSTANTIATE_IOV 20 /* instantiate a partially constructed key */ | 57 | #define KEYCTL_INSTANTIATE_IOV 20 /* instantiate a partially constructed key */ |
58 | #define KEYCTL_INVALIDATE 21 /* invalidate a key */ | 58 | #define KEYCTL_INVALIDATE 21 /* invalidate a key */ |
59 | #define KEYCTL_GET_PERSISTENT 22 /* get a user's persistent keyring */ | ||
59 | 60 | ||
60 | #endif /* _LINUX_KEYCTL_H */ | 61 | #endif /* _LINUX_KEYCTL_H */ |
diff --git a/include/uapi/linux/mic_common.h b/include/uapi/linux/mic_common.h index 17e7d95e4f53..6eb40244e019 100644 --- a/include/uapi/linux/mic_common.h +++ b/include/uapi/linux/mic_common.h | |||
@@ -23,12 +23,7 @@ | |||
23 | 23 | ||
24 | #include <linux/virtio_ring.h> | 24 | #include <linux/virtio_ring.h> |
25 | 25 | ||
26 | #ifndef __KERNEL__ | 26 | #define __mic_align(a, x) (((a) + (x) - 1) & ~((x) - 1)) |
27 | #define ALIGN(a, x) (((a) + (x) - 1) & ~((x) - 1)) | ||
28 | #define __aligned(x) __attribute__ ((aligned(x))) | ||
29 | #endif | ||
30 | |||
31 | #define mic_aligned_size(x) ALIGN(sizeof(x), 8) | ||
32 | 27 | ||
33 | /** | 28 | /** |
34 | * struct mic_device_desc: Virtio device information shared between the | 29 | * struct mic_device_desc: Virtio device information shared between the |
@@ -48,8 +43,8 @@ struct mic_device_desc { | |||
48 | __u8 feature_len; | 43 | __u8 feature_len; |
49 | __u8 config_len; | 44 | __u8 config_len; |
50 | __u8 status; | 45 | __u8 status; |
51 | __u64 config[0]; | 46 | __le64 config[0]; |
52 | } __aligned(8); | 47 | } __attribute__ ((aligned(8))); |
53 | 48 | ||
54 | /** | 49 | /** |
55 | * struct mic_device_ctrl: Per virtio device information in the device page | 50 | * struct mic_device_ctrl: Per virtio device information in the device page |
@@ -66,7 +61,7 @@ struct mic_device_desc { | |||
66 | * @h2c_vdev_db: The doorbell number to be used by host. Set by guest. | 61 | * @h2c_vdev_db: The doorbell number to be used by host. Set by guest. |
67 | */ | 62 | */ |
68 | struct mic_device_ctrl { | 63 | struct mic_device_ctrl { |
69 | __u64 vdev; | 64 | __le64 vdev; |
70 | __u8 config_change; | 65 | __u8 config_change; |
71 | __u8 vdev_reset; | 66 | __u8 vdev_reset; |
72 | __u8 guest_ack; | 67 | __u8 guest_ack; |
@@ -74,7 +69,7 @@ struct mic_device_ctrl { | |||
74 | __u8 used_address_updated; | 69 | __u8 used_address_updated; |
75 | __s8 c2h_vdev_db; | 70 | __s8 c2h_vdev_db; |
76 | __s8 h2c_vdev_db; | 71 | __s8 h2c_vdev_db; |
77 | } __aligned(8); | 72 | } __attribute__ ((aligned(8))); |
78 | 73 | ||
79 | /** | 74 | /** |
80 | * struct mic_bootparam: Virtio device independent information in device page | 75 | * struct mic_bootparam: Virtio device independent information in device page |
@@ -87,13 +82,13 @@ struct mic_device_ctrl { | |||
87 | * @shutdown_card: Set to 1 by the host when a card shutdown is initiated | 82 | * @shutdown_card: Set to 1 by the host when a card shutdown is initiated |
88 | */ | 83 | */ |
89 | struct mic_bootparam { | 84 | struct mic_bootparam { |
90 | __u32 magic; | 85 | __le32 magic; |
91 | __s8 c2h_shutdown_db; | 86 | __s8 c2h_shutdown_db; |
92 | __s8 h2c_shutdown_db; | 87 | __s8 h2c_shutdown_db; |
93 | __s8 h2c_config_db; | 88 | __s8 h2c_config_db; |
94 | __u8 shutdown_status; | 89 | __u8 shutdown_status; |
95 | __u8 shutdown_card; | 90 | __u8 shutdown_card; |
96 | } __aligned(8); | 91 | } __attribute__ ((aligned(8))); |
97 | 92 | ||
98 | /** | 93 | /** |
99 | * struct mic_device_page: High level representation of the device page | 94 | * struct mic_device_page: High level representation of the device page |
@@ -116,10 +111,10 @@ struct mic_device_page { | |||
116 | * @num: The number of entries in the virtio_ring | 111 | * @num: The number of entries in the virtio_ring |
117 | */ | 112 | */ |
118 | struct mic_vqconfig { | 113 | struct mic_vqconfig { |
119 | __u64 address; | 114 | __le64 address; |
120 | __u64 used_address; | 115 | __le64 used_address; |
121 | __u16 num; | 116 | __le16 num; |
122 | } __aligned(8); | 117 | } __attribute__ ((aligned(8))); |
123 | 118 | ||
124 | /* | 119 | /* |
125 | * The alignment to use between consumer and producer parts of vring. | 120 | * The alignment to use between consumer and producer parts of vring. |
@@ -154,7 +149,7 @@ struct mic_vqconfig { | |||
154 | */ | 149 | */ |
155 | struct _mic_vring_info { | 150 | struct _mic_vring_info { |
156 | __u16 avail_idx; | 151 | __u16 avail_idx; |
157 | int magic; | 152 | __le32 magic; |
158 | }; | 153 | }; |
159 | 154 | ||
160 | /** | 155 | /** |
@@ -173,15 +168,13 @@ struct mic_vring { | |||
173 | int len; | 168 | int len; |
174 | }; | 169 | }; |
175 | 170 | ||
176 | #define mic_aligned_desc_size(d) ALIGN(mic_desc_size(d), 8) | 171 | #define mic_aligned_desc_size(d) __mic_align(mic_desc_size(d), 8) |
177 | 172 | ||
178 | #ifndef INTEL_MIC_CARD | 173 | #ifndef INTEL_MIC_CARD |
179 | static inline unsigned mic_desc_size(const struct mic_device_desc *desc) | 174 | static inline unsigned mic_desc_size(const struct mic_device_desc *desc) |
180 | { | 175 | { |
181 | return mic_aligned_size(*desc) | 176 | return sizeof(*desc) + desc->num_vq * sizeof(struct mic_vqconfig) |
182 | + desc->num_vq * mic_aligned_size(struct mic_vqconfig) | 177 | + desc->feature_len * 2 + desc->config_len; |
183 | + desc->feature_len * 2 | ||
184 | + desc->config_len; | ||
185 | } | 178 | } |
186 | 179 | ||
187 | static inline struct mic_vqconfig * | 180 | static inline struct mic_vqconfig * |
@@ -201,8 +194,7 @@ static inline __u8 *mic_vq_configspace(const struct mic_device_desc *desc) | |||
201 | } | 194 | } |
202 | static inline unsigned mic_total_desc_size(struct mic_device_desc *desc) | 195 | static inline unsigned mic_total_desc_size(struct mic_device_desc *desc) |
203 | { | 196 | { |
204 | return mic_aligned_desc_size(desc) + | 197 | return mic_aligned_desc_size(desc) + sizeof(struct mic_device_ctrl); |
205 | mic_aligned_size(struct mic_device_ctrl); | ||
206 | } | 198 | } |
207 | #endif | 199 | #endif |
208 | 200 | ||
diff --git a/include/uapi/linux/netlink_diag.h b/include/uapi/linux/netlink_diag.h index 4e31db4eea41..f2159d30d1f5 100644 --- a/include/uapi/linux/netlink_diag.h +++ b/include/uapi/linux/netlink_diag.h | |||
@@ -33,6 +33,7 @@ struct netlink_diag_ring { | |||
33 | }; | 33 | }; |
34 | 34 | ||
35 | enum { | 35 | enum { |
36 | /* NETLINK_DIAG_NONE, standard nl API requires this attribute! */ | ||
36 | NETLINK_DIAG_MEMINFO, | 37 | NETLINK_DIAG_MEMINFO, |
37 | NETLINK_DIAG_GROUPS, | 38 | NETLINK_DIAG_GROUPS, |
38 | NETLINK_DIAG_RX_RING, | 39 | NETLINK_DIAG_RX_RING, |
diff --git a/include/uapi/linux/packet_diag.h b/include/uapi/linux/packet_diag.h index b2cc0cd9c4d9..d08c63f3dd6f 100644 --- a/include/uapi/linux/packet_diag.h +++ b/include/uapi/linux/packet_diag.h | |||
@@ -29,6 +29,7 @@ struct packet_diag_msg { | |||
29 | }; | 29 | }; |
30 | 30 | ||
31 | enum { | 31 | enum { |
32 | /* PACKET_DIAG_NONE, standard nl API requires this attribute! */ | ||
32 | PACKET_DIAG_INFO, | 33 | PACKET_DIAG_INFO, |
33 | PACKET_DIAG_MCLIST, | 34 | PACKET_DIAG_MCLIST, |
34 | PACKET_DIAG_RX_RING, | 35 | PACKET_DIAG_RX_RING, |
diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h index 0890556f779e..4a98e85438a7 100644 --- a/include/uapi/linux/pci_regs.h +++ b/include/uapi/linux/pci_regs.h | |||
@@ -13,10 +13,10 @@ | |||
13 | * PCI to PCI Bridge Specification | 13 | * PCI to PCI Bridge Specification |
14 | * PCI System Design Guide | 14 | * PCI System Design Guide |
15 | * | 15 | * |
16 | * For hypertransport information, please consult the following manuals | 16 | * For HyperTransport information, please consult the following manuals |
17 | * from http://www.hypertransport.org | 17 | * from http://www.hypertransport.org |
18 | * | 18 | * |
19 | * The Hypertransport I/O Link Specification | 19 | * The HyperTransport I/O Link Specification |
20 | */ | 20 | */ |
21 | 21 | ||
22 | #ifndef LINUX_PCI_REGS_H | 22 | #ifndef LINUX_PCI_REGS_H |
@@ -37,7 +37,7 @@ | |||
37 | #define PCI_COMMAND_INVALIDATE 0x10 /* Use memory write and invalidate */ | 37 | #define PCI_COMMAND_INVALIDATE 0x10 /* Use memory write and invalidate */ |
38 | #define PCI_COMMAND_VGA_PALETTE 0x20 /* Enable palette snooping */ | 38 | #define PCI_COMMAND_VGA_PALETTE 0x20 /* Enable palette snooping */ |
39 | #define PCI_COMMAND_PARITY 0x40 /* Enable parity checking */ | 39 | #define PCI_COMMAND_PARITY 0x40 /* Enable parity checking */ |
40 | #define PCI_COMMAND_WAIT 0x80 /* Enable address/data stepping */ | 40 | #define PCI_COMMAND_WAIT 0x80 /* Enable address/data stepping */ |
41 | #define PCI_COMMAND_SERR 0x100 /* Enable SERR */ | 41 | #define PCI_COMMAND_SERR 0x100 /* Enable SERR */ |
42 | #define PCI_COMMAND_FAST_BACK 0x200 /* Enable back-to-back writes */ | 42 | #define PCI_COMMAND_FAST_BACK 0x200 /* Enable back-to-back writes */ |
43 | #define PCI_COMMAND_INTX_DISABLE 0x400 /* INTx Emulation Disable */ | 43 | #define PCI_COMMAND_INTX_DISABLE 0x400 /* INTx Emulation Disable */ |
@@ -45,7 +45,7 @@ | |||
45 | #define PCI_STATUS 0x06 /* 16 bits */ | 45 | #define PCI_STATUS 0x06 /* 16 bits */ |
46 | #define PCI_STATUS_INTERRUPT 0x08 /* Interrupt status */ | 46 | #define PCI_STATUS_INTERRUPT 0x08 /* Interrupt status */ |
47 | #define PCI_STATUS_CAP_LIST 0x10 /* Support Capability List */ | 47 | #define PCI_STATUS_CAP_LIST 0x10 /* Support Capability List */ |
48 | #define PCI_STATUS_66MHZ 0x20 /* Support 66 Mhz PCI 2.1 bus */ | 48 | #define PCI_STATUS_66MHZ 0x20 /* Support 66 MHz PCI 2.1 bus */ |
49 | #define PCI_STATUS_UDF 0x40 /* Support User Definable Features [obsolete] */ | 49 | #define PCI_STATUS_UDF 0x40 /* Support User Definable Features [obsolete] */ |
50 | #define PCI_STATUS_FAST_BACK 0x80 /* Accept fast-back to back */ | 50 | #define PCI_STATUS_FAST_BACK 0x80 /* Accept fast-back to back */ |
51 | #define PCI_STATUS_PARITY 0x100 /* Detected parity error */ | 51 | #define PCI_STATUS_PARITY 0x100 /* Detected parity error */ |
@@ -205,14 +205,14 @@ | |||
205 | #define PCI_CAP_ID_CHSWP 0x06 /* CompactPCI HotSwap */ | 205 | #define PCI_CAP_ID_CHSWP 0x06 /* CompactPCI HotSwap */ |
206 | #define PCI_CAP_ID_PCIX 0x07 /* PCI-X */ | 206 | #define PCI_CAP_ID_PCIX 0x07 /* PCI-X */ |
207 | #define PCI_CAP_ID_HT 0x08 /* HyperTransport */ | 207 | #define PCI_CAP_ID_HT 0x08 /* HyperTransport */ |
208 | #define PCI_CAP_ID_VNDR 0x09 /* Vendor specific */ | 208 | #define PCI_CAP_ID_VNDR 0x09 /* Vendor-Specific */ |
209 | #define PCI_CAP_ID_DBG 0x0A /* Debug port */ | 209 | #define PCI_CAP_ID_DBG 0x0A /* Debug port */ |
210 | #define PCI_CAP_ID_CCRC 0x0B /* CompactPCI Central Resource Control */ | 210 | #define PCI_CAP_ID_CCRC 0x0B /* CompactPCI Central Resource Control */ |
211 | #define PCI_CAP_ID_SHPC 0x0C /* PCI Standard Hot-Plug Controller */ | 211 | #define PCI_CAP_ID_SHPC 0x0C /* PCI Standard Hot-Plug Controller */ |
212 | #define PCI_CAP_ID_SSVID 0x0D /* Bridge subsystem vendor/device ID */ | 212 | #define PCI_CAP_ID_SSVID 0x0D /* Bridge subsystem vendor/device ID */ |
213 | #define PCI_CAP_ID_AGP3 0x0E /* AGP Target PCI-PCI bridge */ | 213 | #define PCI_CAP_ID_AGP3 0x0E /* AGP Target PCI-PCI bridge */ |
214 | #define PCI_CAP_ID_SECDEV 0x0F /* Secure Device */ | 214 | #define PCI_CAP_ID_SECDEV 0x0F /* Secure Device */ |
215 | #define PCI_CAP_ID_EXP 0x10 /* PCI Express */ | 215 | #define PCI_CAP_ID_EXP 0x10 /* PCI Express */ |
216 | #define PCI_CAP_ID_MSIX 0x11 /* MSI-X */ | 216 | #define PCI_CAP_ID_MSIX 0x11 /* MSI-X */ |
217 | #define PCI_CAP_ID_SATA 0x12 /* SATA Data/Index Conf. */ | 217 | #define PCI_CAP_ID_SATA 0x12 /* SATA Data/Index Conf. */ |
218 | #define PCI_CAP_ID_AF 0x13 /* PCI Advanced Features */ | 218 | #define PCI_CAP_ID_AF 0x13 /* PCI Advanced Features */ |
@@ -268,8 +268,8 @@ | |||
268 | #define PCI_AGP_COMMAND_RQ_MASK 0xff000000 /* Master: Maximum number of requests */ | 268 | #define PCI_AGP_COMMAND_RQ_MASK 0xff000000 /* Master: Maximum number of requests */ |
269 | #define PCI_AGP_COMMAND_SBA 0x0200 /* Sideband addressing enabled */ | 269 | #define PCI_AGP_COMMAND_SBA 0x0200 /* Sideband addressing enabled */ |
270 | #define PCI_AGP_COMMAND_AGP 0x0100 /* Allow processing of AGP transactions */ | 270 | #define PCI_AGP_COMMAND_AGP 0x0100 /* Allow processing of AGP transactions */ |
271 | #define PCI_AGP_COMMAND_64BIT 0x0020 /* Allow processing of 64-bit addresses */ | 271 | #define PCI_AGP_COMMAND_64BIT 0x0020 /* Allow processing of 64-bit addresses */ |
272 | #define PCI_AGP_COMMAND_FW 0x0010 /* Force FW transfers */ | 272 | #define PCI_AGP_COMMAND_FW 0x0010 /* Force FW transfers */ |
273 | #define PCI_AGP_COMMAND_RATE4 0x0004 /* Use 4x rate */ | 273 | #define PCI_AGP_COMMAND_RATE4 0x0004 /* Use 4x rate */ |
274 | #define PCI_AGP_COMMAND_RATE2 0x0002 /* Use 2x rate */ | 274 | #define PCI_AGP_COMMAND_RATE2 0x0002 /* Use 2x rate */ |
275 | #define PCI_AGP_COMMAND_RATE1 0x0001 /* Use 1x rate */ | 275 | #define PCI_AGP_COMMAND_RATE1 0x0001 /* Use 1x rate */ |
@@ -321,7 +321,7 @@ | |||
321 | #define PCI_MSIX_PBA_OFFSET 0xfffffff8 /* Offset into specified BAR */ | 321 | #define PCI_MSIX_PBA_OFFSET 0xfffffff8 /* Offset into specified BAR */ |
322 | #define PCI_CAP_MSIX_SIZEOF 12 /* size of MSIX registers */ | 322 | #define PCI_CAP_MSIX_SIZEOF 12 /* size of MSIX registers */ |
323 | 323 | ||
324 | /* MSI-X entry's format */ | 324 | /* MSI-X Table entry format */ |
325 | #define PCI_MSIX_ENTRY_SIZE 16 | 325 | #define PCI_MSIX_ENTRY_SIZE 16 |
326 | #define PCI_MSIX_ENTRY_LOWER_ADDR 0 | 326 | #define PCI_MSIX_ENTRY_LOWER_ADDR 0 |
327 | #define PCI_MSIX_ENTRY_UPPER_ADDR 4 | 327 | #define PCI_MSIX_ENTRY_UPPER_ADDR 4 |
@@ -372,7 +372,7 @@ | |||
372 | #define PCI_X_CMD_SPLIT_16 0x0060 /* Max 16 */ | 372 | #define PCI_X_CMD_SPLIT_16 0x0060 /* Max 16 */ |
373 | #define PCI_X_CMD_SPLIT_32 0x0070 /* Max 32 */ | 373 | #define PCI_X_CMD_SPLIT_32 0x0070 /* Max 32 */ |
374 | #define PCI_X_CMD_MAX_SPLIT 0x0070 /* Max Outstanding Split Transactions */ | 374 | #define PCI_X_CMD_MAX_SPLIT 0x0070 /* Max Outstanding Split Transactions */ |
375 | #define PCI_X_CMD_VERSION(x) (((x) >> 12) & 3) /* Version */ | 375 | #define PCI_X_CMD_VERSION(x) (((x) >> 12) & 3) /* Version */ |
376 | #define PCI_X_STATUS 4 /* PCI-X capabilities */ | 376 | #define PCI_X_STATUS 4 /* PCI-X capabilities */ |
377 | #define PCI_X_STATUS_DEVFN 0x000000ff /* A copy of devfn */ | 377 | #define PCI_X_STATUS_DEVFN 0x000000ff /* A copy of devfn */ |
378 | #define PCI_X_STATUS_BUS 0x0000ff00 /* A copy of bus nr */ | 378 | #define PCI_X_STATUS_BUS 0x0000ff00 /* A copy of bus nr */ |
@@ -407,8 +407,8 @@ | |||
407 | 407 | ||
408 | /* PCI Bridge Subsystem ID registers */ | 408 | /* PCI Bridge Subsystem ID registers */ |
409 | 409 | ||
410 | #define PCI_SSVID_VENDOR_ID 4 /* PCI-Bridge subsystem vendor id register */ | 410 | #define PCI_SSVID_VENDOR_ID 4 /* PCI Bridge subsystem vendor ID */ |
411 | #define PCI_SSVID_DEVICE_ID 6 /* PCI-Bridge subsystem device id register */ | 411 | #define PCI_SSVID_DEVICE_ID 6 /* PCI Bridge subsystem device ID */ |
412 | 412 | ||
413 | /* PCI Express capability registers */ | 413 | /* PCI Express capability registers */ |
414 | 414 | ||
@@ -484,12 +484,12 @@ | |||
484 | #define PCI_EXP_LNKCTL_CLKREQ_EN 0x0100 /* Enable clkreq */ | 484 | #define PCI_EXP_LNKCTL_CLKREQ_EN 0x0100 /* Enable clkreq */ |
485 | #define PCI_EXP_LNKCTL_HAWD 0x0200 /* Hardware Autonomous Width Disable */ | 485 | #define PCI_EXP_LNKCTL_HAWD 0x0200 /* Hardware Autonomous Width Disable */ |
486 | #define PCI_EXP_LNKCTL_LBMIE 0x0400 /* Link Bandwidth Management Interrupt Enable */ | 486 | #define PCI_EXP_LNKCTL_LBMIE 0x0400 /* Link Bandwidth Management Interrupt Enable */ |
487 | #define PCI_EXP_LNKCTL_LABIE 0x0800 /* Lnk Autonomous Bandwidth Interrupt Enable */ | 487 | #define PCI_EXP_LNKCTL_LABIE 0x0800 /* Link Autonomous Bandwidth Interrupt Enable */ |
488 | #define PCI_EXP_LNKSTA 18 /* Link Status */ | 488 | #define PCI_EXP_LNKSTA 18 /* Link Status */ |
489 | #define PCI_EXP_LNKSTA_CLS 0x000f /* Current Link Speed */ | 489 | #define PCI_EXP_LNKSTA_CLS 0x000f /* Current Link Speed */ |
490 | #define PCI_EXP_LNKSTA_CLS_2_5GB 0x0001 /* Current Link Speed 2.5GT/s */ | 490 | #define PCI_EXP_LNKSTA_CLS_2_5GB 0x0001 /* Current Link Speed 2.5GT/s */ |
491 | #define PCI_EXP_LNKSTA_CLS_5_0GB 0x0002 /* Current Link Speed 5.0GT/s */ | 491 | #define PCI_EXP_LNKSTA_CLS_5_0GB 0x0002 /* Current Link Speed 5.0GT/s */ |
492 | #define PCI_EXP_LNKSTA_NLW 0x03f0 /* Nogotiated Link Width */ | 492 | #define PCI_EXP_LNKSTA_NLW 0x03f0 /* Negotiated Link Width */ |
493 | #define PCI_EXP_LNKSTA_NLW_SHIFT 4 /* start of NLW mask in link status */ | 493 | #define PCI_EXP_LNKSTA_NLW_SHIFT 4 /* start of NLW mask in link status */ |
494 | #define PCI_EXP_LNKSTA_LT 0x0800 /* Link Training */ | 494 | #define PCI_EXP_LNKSTA_LT 0x0800 /* Link Training */ |
495 | #define PCI_EXP_LNKSTA_SLC 0x1000 /* Slot Clock Configuration */ | 495 | #define PCI_EXP_LNKSTA_SLC 0x1000 /* Slot Clock Configuration */ |
@@ -593,7 +593,7 @@ | |||
593 | #define PCI_EXT_CAP_ID_MFVC 0x08 /* Multi-Function VC Capability */ | 593 | #define PCI_EXT_CAP_ID_MFVC 0x08 /* Multi-Function VC Capability */ |
594 | #define PCI_EXT_CAP_ID_VC9 0x09 /* same as _VC */ | 594 | #define PCI_EXT_CAP_ID_VC9 0x09 /* same as _VC */ |
595 | #define PCI_EXT_CAP_ID_RCRB 0x0A /* Root Complex RB? */ | 595 | #define PCI_EXT_CAP_ID_RCRB 0x0A /* Root Complex RB? */ |
596 | #define PCI_EXT_CAP_ID_VNDR 0x0B /* Vendor Specific */ | 596 | #define PCI_EXT_CAP_ID_VNDR 0x0B /* Vendor-Specific */ |
597 | #define PCI_EXT_CAP_ID_CAC 0x0C /* Config Access - obsolete */ | 597 | #define PCI_EXT_CAP_ID_CAC 0x0C /* Config Access - obsolete */ |
598 | #define PCI_EXT_CAP_ID_ACS 0x0D /* Access Control Services */ | 598 | #define PCI_EXT_CAP_ID_ACS 0x0D /* Access Control Services */ |
599 | #define PCI_EXT_CAP_ID_ARI 0x0E /* Alternate Routing ID */ | 599 | #define PCI_EXT_CAP_ID_ARI 0x0E /* Alternate Routing ID */ |
@@ -602,12 +602,12 @@ | |||
602 | #define PCI_EXT_CAP_ID_MRIOV 0x11 /* Multi Root I/O Virtualization */ | 602 | #define PCI_EXT_CAP_ID_MRIOV 0x11 /* Multi Root I/O Virtualization */ |
603 | #define PCI_EXT_CAP_ID_MCAST 0x12 /* Multicast */ | 603 | #define PCI_EXT_CAP_ID_MCAST 0x12 /* Multicast */ |
604 | #define PCI_EXT_CAP_ID_PRI 0x13 /* Page Request Interface */ | 604 | #define PCI_EXT_CAP_ID_PRI 0x13 /* Page Request Interface */ |
605 | #define PCI_EXT_CAP_ID_AMD_XXX 0x14 /* reserved for AMD */ | 605 | #define PCI_EXT_CAP_ID_AMD_XXX 0x14 /* Reserved for AMD */ |
606 | #define PCI_EXT_CAP_ID_REBAR 0x15 /* resizable BAR */ | 606 | #define PCI_EXT_CAP_ID_REBAR 0x15 /* Resizable BAR */ |
607 | #define PCI_EXT_CAP_ID_DPA 0x16 /* dynamic power alloc */ | 607 | #define PCI_EXT_CAP_ID_DPA 0x16 /* Dynamic Power Allocation */ |
608 | #define PCI_EXT_CAP_ID_TPH 0x17 /* TPH request */ | 608 | #define PCI_EXT_CAP_ID_TPH 0x17 /* TPH Requester */ |
609 | #define PCI_EXT_CAP_ID_LTR 0x18 /* latency tolerance reporting */ | 609 | #define PCI_EXT_CAP_ID_LTR 0x18 /* Latency Tolerance Reporting */ |
610 | #define PCI_EXT_CAP_ID_SECPCI 0x19 /* Secondary PCIe */ | 610 | #define PCI_EXT_CAP_ID_SECPCI 0x19 /* Secondary PCIe Capability */ |
611 | #define PCI_EXT_CAP_ID_PMUX 0x1A /* Protocol Multiplexing */ | 611 | #define PCI_EXT_CAP_ID_PMUX 0x1A /* Protocol Multiplexing */ |
612 | #define PCI_EXT_CAP_ID_PASID 0x1B /* Process Address Space ID */ | 612 | #define PCI_EXT_CAP_ID_PASID 0x1B /* Process Address Space ID */ |
613 | #define PCI_EXT_CAP_ID_MAX PCI_EXT_CAP_ID_PASID | 613 | #define PCI_EXT_CAP_ID_MAX PCI_EXT_CAP_ID_PASID |
@@ -667,9 +667,9 @@ | |||
667 | #define PCI_ERR_ROOT_COR_RCV 0x00000001 /* ERR_COR Received */ | 667 | #define PCI_ERR_ROOT_COR_RCV 0x00000001 /* ERR_COR Received */ |
668 | /* Multi ERR_COR Received */ | 668 | /* Multi ERR_COR Received */ |
669 | #define PCI_ERR_ROOT_MULTI_COR_RCV 0x00000002 | 669 | #define PCI_ERR_ROOT_MULTI_COR_RCV 0x00000002 |
670 | /* ERR_FATAL/NONFATAL Recevied */ | 670 | /* ERR_FATAL/NONFATAL Received */ |
671 | #define PCI_ERR_ROOT_UNCOR_RCV 0x00000004 | 671 | #define PCI_ERR_ROOT_UNCOR_RCV 0x00000004 |
672 | /* Multi ERR_FATAL/NONFATAL Recevied */ | 672 | /* Multi ERR_FATAL/NONFATAL Received */ |
673 | #define PCI_ERR_ROOT_MULTI_UNCOR_RCV 0x00000008 | 673 | #define PCI_ERR_ROOT_MULTI_UNCOR_RCV 0x00000008 |
674 | #define PCI_ERR_ROOT_FIRST_FATAL 0x00000010 /* First Fatal */ | 674 | #define PCI_ERR_ROOT_FIRST_FATAL 0x00000010 /* First Fatal */ |
675 | #define PCI_ERR_ROOT_NONFATAL_RCV 0x00000020 /* Non-Fatal Received */ | 675 | #define PCI_ERR_ROOT_NONFATAL_RCV 0x00000020 /* Non-Fatal Received */ |
@@ -678,7 +678,7 @@ | |||
678 | 678 | ||
679 | /* Virtual Channel */ | 679 | /* Virtual Channel */ |
680 | #define PCI_VC_PORT_REG1 4 | 680 | #define PCI_VC_PORT_REG1 4 |
681 | #define PCI_VC_REG1_EVCC 0x7 /* extended vc count */ | 681 | #define PCI_VC_REG1_EVCC 0x7 /* extended VC count */ |
682 | #define PCI_VC_PORT_REG2 8 | 682 | #define PCI_VC_PORT_REG2 8 |
683 | #define PCI_VC_REG2_32_PHASE 0x2 | 683 | #define PCI_VC_REG2_32_PHASE 0x2 |
684 | #define PCI_VC_REG2_64_PHASE 0x4 | 684 | #define PCI_VC_REG2_64_PHASE 0x4 |
@@ -711,7 +711,7 @@ | |||
711 | #define PCI_VNDR_HEADER_LEN(x) (((x) >> 20) & 0xfff) | 711 | #define PCI_VNDR_HEADER_LEN(x) (((x) >> 20) & 0xfff) |
712 | 712 | ||
713 | /* | 713 | /* |
714 | * Hypertransport sub capability types | 714 | * HyperTransport sub capability types |
715 | * | 715 | * |
716 | * Unfortunately there are both 3 bit and 5 bit capability types defined | 716 | * Unfortunately there are both 3 bit and 5 bit capability types defined |
717 | * in the HT spec, catering for that is a little messy. You probably don't | 717 | * in the HT spec, catering for that is a little messy. You probably don't |
@@ -739,8 +739,8 @@ | |||
739 | #define HT_CAPTYPE_DIRECT_ROUTE 0xB0 /* Direct routing configuration */ | 739 | #define HT_CAPTYPE_DIRECT_ROUTE 0xB0 /* Direct routing configuration */ |
740 | #define HT_CAPTYPE_VCSET 0xB8 /* Virtual Channel configuration */ | 740 | #define HT_CAPTYPE_VCSET 0xB8 /* Virtual Channel configuration */ |
741 | #define HT_CAPTYPE_ERROR_RETRY 0xC0 /* Retry on error configuration */ | 741 | #define HT_CAPTYPE_ERROR_RETRY 0xC0 /* Retry on error configuration */ |
742 | #define HT_CAPTYPE_GEN3 0xD0 /* Generation 3 hypertransport configuration */ | 742 | #define HT_CAPTYPE_GEN3 0xD0 /* Generation 3 HyperTransport configuration */ |
743 | #define HT_CAPTYPE_PM 0xE0 /* Hypertransport powermanagement configuration */ | 743 | #define HT_CAPTYPE_PM 0xE0 /* HyperTransport power management configuration */ |
744 | #define HT_CAP_SIZEOF_LONG 28 /* slave & primary */ | 744 | #define HT_CAP_SIZEOF_LONG 28 /* slave & primary */ |
745 | #define HT_CAP_SIZEOF_SHORT 24 /* host & secondary */ | 745 | #define HT_CAP_SIZEOF_SHORT 24 /* host & secondary */ |
746 | 746 | ||
@@ -777,14 +777,14 @@ | |||
777 | #define PCI_PRI_ALLOC_REQ 0x0c /* PRI max reqs allowed */ | 777 | #define PCI_PRI_ALLOC_REQ 0x0c /* PRI max reqs allowed */ |
778 | #define PCI_EXT_CAP_PRI_SIZEOF 16 | 778 | #define PCI_EXT_CAP_PRI_SIZEOF 16 |
779 | 779 | ||
780 | /* PASID capability */ | 780 | /* Process Address Space ID */ |
781 | #define PCI_PASID_CAP 0x04 /* PASID feature register */ | 781 | #define PCI_PASID_CAP 0x04 /* PASID feature register */ |
782 | #define PCI_PASID_CAP_EXEC 0x02 /* Exec permissions Supported */ | 782 | #define PCI_PASID_CAP_EXEC 0x02 /* Exec permissions Supported */ |
783 | #define PCI_PASID_CAP_PRIV 0x04 /* Priviledge Mode Supported */ | 783 | #define PCI_PASID_CAP_PRIV 0x04 /* Privilege Mode Supported */ |
784 | #define PCI_PASID_CTRL 0x06 /* PASID control register */ | 784 | #define PCI_PASID_CTRL 0x06 /* PASID control register */ |
785 | #define PCI_PASID_CTRL_ENABLE 0x01 /* Enable bit */ | 785 | #define PCI_PASID_CTRL_ENABLE 0x01 /* Enable bit */ |
786 | #define PCI_PASID_CTRL_EXEC 0x02 /* Exec permissions Enable */ | 786 | #define PCI_PASID_CTRL_EXEC 0x02 /* Exec permissions Enable */ |
787 | #define PCI_PASID_CTRL_PRIV 0x04 /* Priviledge Mode Enable */ | 787 | #define PCI_PASID_CTRL_PRIV 0x04 /* Privilege Mode Enable */ |
788 | #define PCI_EXT_CAP_PASID_SIZEOF 8 | 788 | #define PCI_EXT_CAP_PASID_SIZEOF 8 |
789 | 789 | ||
790 | /* Single Root I/O Virtualization */ | 790 | /* Single Root I/O Virtualization */ |
@@ -839,22 +839,22 @@ | |||
839 | #define PCI_ACS_CTRL 0x06 /* ACS Control Register */ | 839 | #define PCI_ACS_CTRL 0x06 /* ACS Control Register */ |
840 | #define PCI_ACS_EGRESS_CTL_V 0x08 /* ACS Egress Control Vector */ | 840 | #define PCI_ACS_EGRESS_CTL_V 0x08 /* ACS Egress Control Vector */ |
841 | 841 | ||
842 | #define PCI_VSEC_HDR 4 /* extended cap - vendor specific */ | 842 | #define PCI_VSEC_HDR 4 /* extended cap - vendor-specific */ |
843 | #define PCI_VSEC_HDR_LEN_SHIFT 20 /* shift for length field */ | 843 | #define PCI_VSEC_HDR_LEN_SHIFT 20 /* shift for length field */ |
844 | 844 | ||
845 | /* sata capability */ | 845 | /* SATA capability */ |
846 | #define PCI_SATA_REGS 4 /* SATA REGs specifier */ | 846 | #define PCI_SATA_REGS 4 /* SATA REGs specifier */ |
847 | #define PCI_SATA_REGS_MASK 0xF /* location - BAR#/inline */ | 847 | #define PCI_SATA_REGS_MASK 0xF /* location - BAR#/inline */ |
848 | #define PCI_SATA_REGS_INLINE 0xF /* REGS in config space */ | 848 | #define PCI_SATA_REGS_INLINE 0xF /* REGS in config space */ |
849 | #define PCI_SATA_SIZEOF_SHORT 8 | 849 | #define PCI_SATA_SIZEOF_SHORT 8 |
850 | #define PCI_SATA_SIZEOF_LONG 16 | 850 | #define PCI_SATA_SIZEOF_LONG 16 |
851 | 851 | ||
852 | /* resizable BARs */ | 852 | /* Resizable BARs */ |
853 | #define PCI_REBAR_CTRL 8 /* control register */ | 853 | #define PCI_REBAR_CTRL 8 /* control register */ |
854 | #define PCI_REBAR_CTRL_NBAR_MASK (7 << 5) /* mask for # bars */ | 854 | #define PCI_REBAR_CTRL_NBAR_MASK (7 << 5) /* mask for # bars */ |
855 | #define PCI_REBAR_CTRL_NBAR_SHIFT 5 /* shift for # bars */ | 855 | #define PCI_REBAR_CTRL_NBAR_SHIFT 5 /* shift for # bars */ |
856 | 856 | ||
857 | /* dynamic power allocation */ | 857 | /* Dynamic Power Allocation */ |
858 | #define PCI_DPA_CAP 4 /* capability register */ | 858 | #define PCI_DPA_CAP 4 /* capability register */ |
859 | #define PCI_DPA_CAP_SUBSTATE_MASK 0x1F /* # substates - 1 */ | 859 | #define PCI_DPA_CAP_SUBSTATE_MASK 0x1F /* # substates - 1 */ |
860 | #define PCI_DPA_BASE_SIZEOF 16 /* size with 0 substates */ | 860 | #define PCI_DPA_BASE_SIZEOF 16 /* size with 0 substates */ |
diff --git a/include/uapi/linux/pkt_sched.h b/include/uapi/linux/pkt_sched.h index 307f293477e8..a806687ad98f 100644 --- a/include/uapi/linux/pkt_sched.h +++ b/include/uapi/linux/pkt_sched.h | |||
@@ -763,13 +763,14 @@ enum { | |||
763 | 763 | ||
764 | TCA_FQ_RATE_ENABLE, /* enable/disable rate limiting */ | 764 | TCA_FQ_RATE_ENABLE, /* enable/disable rate limiting */ |
765 | 765 | ||
766 | TCA_FQ_FLOW_DEFAULT_RATE,/* for sockets with unspecified sk_rate, | 766 | TCA_FQ_FLOW_DEFAULT_RATE,/* obsolete, do not use */ |
767 | * use the following rate | ||
768 | */ | ||
769 | 767 | ||
770 | TCA_FQ_FLOW_MAX_RATE, /* per flow max rate */ | 768 | TCA_FQ_FLOW_MAX_RATE, /* per flow max rate */ |
771 | 769 | ||
772 | TCA_FQ_BUCKETS_LOG, /* log2(number of buckets) */ | 770 | TCA_FQ_BUCKETS_LOG, /* log2(number of buckets) */ |
771 | |||
772 | TCA_FQ_FLOW_REFILL_DELAY, /* flow credit refill delay in usec */ | ||
773 | |||
773 | __TCA_FQ_MAX | 774 | __TCA_FQ_MAX |
774 | }; | 775 | }; |
775 | 776 | ||
diff --git a/include/uapi/linux/raid/md_p.h b/include/uapi/linux/raid/md_p.h index fe1a5406d4d9..f7cf7f351144 100644 --- a/include/uapi/linux/raid/md_p.h +++ b/include/uapi/linux/raid/md_p.h | |||
@@ -16,6 +16,7 @@ | |||
16 | #define _MD_P_H | 16 | #define _MD_P_H |
17 | 17 | ||
18 | #include <linux/types.h> | 18 | #include <linux/types.h> |
19 | #include <asm/byteorder.h> | ||
19 | 20 | ||
20 | /* | 21 | /* |
21 | * RAID superblock. | 22 | * RAID superblock. |
diff --git a/include/uapi/linux/unix_diag.h b/include/uapi/linux/unix_diag.h index b9e2a6a7446f..1eb0b8dd1830 100644 --- a/include/uapi/linux/unix_diag.h +++ b/include/uapi/linux/unix_diag.h | |||
@@ -31,6 +31,7 @@ struct unix_diag_msg { | |||
31 | }; | 31 | }; |
32 | 32 | ||
33 | enum { | 33 | enum { |
34 | /* UNIX_DIAG_NONE, standard nl API requires this attribute! */ | ||
34 | UNIX_DIAG_NAME, | 35 | UNIX_DIAG_NAME, |
35 | UNIX_DIAG_VFS, | 36 | UNIX_DIAG_VFS, |
36 | UNIX_DIAG_PEER, | 37 | UNIX_DIAG_PEER, |
diff --git a/include/uapi/sound/compress_offload.h b/include/uapi/sound/compress_offload.h index d630163b9a2e..5759810e1c1b 100644 --- a/include/uapi/sound/compress_offload.h +++ b/include/uapi/sound/compress_offload.h | |||
@@ -30,7 +30,7 @@ | |||
30 | #include <sound/compress_params.h> | 30 | #include <sound/compress_params.h> |
31 | 31 | ||
32 | 32 | ||
33 | #define SNDRV_COMPRESS_VERSION SNDRV_PROTOCOL_VERSION(0, 1, 1) | 33 | #define SNDRV_COMPRESS_VERSION SNDRV_PROTOCOL_VERSION(0, 1, 2) |
34 | /** | 34 | /** |
35 | * struct snd_compressed_buffer: compressed buffer | 35 | * struct snd_compressed_buffer: compressed buffer |
36 | * @fragment_size: size of buffer fragment in bytes | 36 | * @fragment_size: size of buffer fragment in bytes |
@@ -67,8 +67,8 @@ struct snd_compr_params { | |||
67 | struct snd_compr_tstamp { | 67 | struct snd_compr_tstamp { |
68 | __u32 byte_offset; | 68 | __u32 byte_offset; |
69 | __u32 copied_total; | 69 | __u32 copied_total; |
70 | snd_pcm_uframes_t pcm_frames; | 70 | __u32 pcm_frames; |
71 | snd_pcm_uframes_t pcm_io_frames; | 71 | __u32 pcm_io_frames; |
72 | __u32 sampling_rate; | 72 | __u32 sampling_rate; |
73 | }; | 73 | }; |
74 | 74 | ||